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 do
local autoSelfCast = GetCVar("autoSelfCast") local autoSelfCast = GetCVar("autoSelfCast")
SetCVar("autoSelfCast", "0") -- Ensure disabled 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) orig(slot, checkCursor, onSelf)
if autoSelfCast then if autoSelfCast then
SetCVar("autoSelfCast", autoSelfCast) SetCVar("autoSelfCast", autoSelfCast)
end end
if spellName and HealBot_AnnounceCast then
HealBot_AnnounceCast(spellName, mouseover)
end
end end
SpellTargetUnit(mouseover) SpellTargetUnit(mouseover)
+28 -14
View File
@@ -74,20 +74,14 @@ function HealBot_CastSpellByName(spell)
CastSpell(id, BOOKTYPE_SPELL); CastSpell(id, BOOKTYPE_SPELL);
end end
function HealBot_StartCasting(spell, target, ttype) function HealBot_AnnounceCast(spell, target)
HealBot_CastSpellByName(spell); if not spell or not target then return end
HealBot_CastingSpell = spell;
HealBot_CastingTarget = target; if UnitIsDeadOrGhost(target) then
if ( SpellCanTargetUnit(target) ) then local spellLower = string.lower(spell)
SpellTargetUnit(target); if not (string.find(spellLower, "resurrection") or string.find(spellLower, "ancestral spirit") or string.find(spellLower, "redemption") or string.find(spellLower, "rebirth")) then
ttype = "fired"; return
elseif SpellIsTargeting() then end
SpellTargetUnit(target);
SpellStopTargeting()
elseif ttype == "direct" then
if ( CheckInteractDistance(target, 4) ) then
ttype = "fired";
end
end end
if HealBot_Config.ChatMessages then if HealBot_Config.ChatMessages then
@@ -131,6 +125,26 @@ function HealBot_StartCasting(spell, target, ttype)
end end
end 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 ttype == "fired" and HealBot_Spells[spell] then
if HealBot_Spells[spell].CastTime > 1 then if HealBot_Spells[spell].CastTime > 1 then
HealBot_HealValue = HealBot_Spells[spell].HealsDur; HealBot_HealValue = HealBot_Spells[spell].HealsDur;