feat: add spell cast announcements with target validation for resurrections and added announcements for hoovercasting (mousover frames)

This commit is contained in:
Bluewhale1337
2026-07-11 11:06:27 +02:00
parent 86e0e0b18a
commit a1aa1a4c1d
2 changed files with 40 additions and 14 deletions
+12
View File
@@ -276,10 +276,22 @@ do
do
local autoSelfCast = GetCVar("autoSelfCast")
SetCVar("autoSelfCast", "0") -- Ensure disabled
local spellName = nil
if not GetActionText(slot) then
HealBot_ScanTooltip:SetOwner(HealBot_ScanTooltip, "ANCHOR_NONE")
HealBot_ScanTooltip:SetAction(slot)
spellName = HealBot_ScanTooltipTextLeft1 and HealBot_ScanTooltipTextLeft1:GetText()
end
orig(slot, checkCursor, onSelf)
if autoSelfCast then
SetCVar("autoSelfCast", autoSelfCast)
end
if spellName and HealBot_AnnounceCast then
HealBot_AnnounceCast(spellName, mouseover)
end
end
SpellTargetUnit(mouseover)
+28 -14
View File
@@ -74,20 +74,14 @@ function HealBot_CastSpellByName(spell)
CastSpell(id, BOOKTYPE_SPELL);
end
function HealBot_StartCasting(spell, target, ttype)
HealBot_CastSpellByName(spell);
HealBot_CastingSpell = spell;
HealBot_CastingTarget = target;
if ( SpellCanTargetUnit(target) ) then
SpellTargetUnit(target);
ttype = "fired";
elseif SpellIsTargeting() then
SpellTargetUnit(target);
SpellStopTargeting()
elseif ttype == "direct" then
if ( CheckInteractDistance(target, 4) ) then
ttype = "fired";
end
function HealBot_AnnounceCast(spell, target)
if not spell or not target then return end
if UnitIsDeadOrGhost(target) then
local spellLower = string.lower(spell)
if not (string.find(spellLower, "resurrection") or string.find(spellLower, "ancestral spirit") or string.find(spellLower, "redemption") or string.find(spellLower, "rebirth")) then
return
end
end
if HealBot_Config.ChatMessages then
@@ -131,6 +125,26 @@ function HealBot_StartCasting(spell, target, ttype)
end
end
end
end
function HealBot_StartCasting(spell, target, ttype)
HealBot_CastSpellByName(spell);
HealBot_CastingSpell = spell;
HealBot_CastingTarget = target;
if ( SpellCanTargetUnit(target) ) then
SpellTargetUnit(target);
ttype = "fired";
elseif SpellIsTargeting() then
SpellTargetUnit(target);
SpellStopTargeting()
elseif ttype == "direct" then
if ( CheckInteractDistance(target, 4) ) then
ttype = "fired";
end
end
HealBot_AnnounceCast(spell, target)
if ttype == "fired" and HealBot_Spells[spell] then
if HealBot_Spells[spell].CastTime > 1 then
HealBot_HealValue = HealBot_Spells[spell].HealsDur;