mirror of
https://github.com/Bluewhale1337/HealBotBlue.git
synced 2026-07-27 09:44:44 +00:00
feat: add spell cast announcements with target validation for resurrections and added announcements for hoovercasting (mousover frames)
This commit is contained in:
+12
@@ -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)
|
||||||
|
|||||||
@@ -74,19 +74,13 @@ 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
|
|
||||||
SpellTargetUnit(target);
|
|
||||||
SpellStopTargeting()
|
|
||||||
elseif ttype == "direct" then
|
|
||||||
if ( CheckInteractDistance(target, 4) ) then
|
|
||||||
ttype = "fired";
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user