diff --git a/HealBot.lua b/HealBot.lua index b26eae9..62360c5 100644 --- a/HealBot.lua +++ b/HealBot.lua @@ -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) diff --git a/HealBot_Controller_Spells.lua b/HealBot_Controller_Spells.lua index 3c4f285..1677da2 100644 --- a/HealBot_Controller_Spells.lua +++ b/HealBot_Controller_Spells.lua @@ -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;