Determining spell cast by SPELLCAST_STOP event & Catching Spell Breaks
Two questions:
1) I'm writing a Warlock AddOn and I need to detect when certain types of spells are cast. I'm currently trapping the SPELLCAST_STOP event, but I'm not sure how to determine the spell that generated the event. I've tried overriding the CastSpell and CastSpellByName global functions but I'm having no luck there (code attached below).
2) What event should I be looking for if a mob breaks a spell with a duration? (break Banish early for instance).
THANKS!!
My Non-Functional Global Function Override Attempt:
[code]GameCastSpellByName = CastSpellByName;
function My_OnCastSpellByName(spellString)
println("TEST::: CastSpellByName!!" .. spellString);
GameCastSpellByName(spellString);
end
CastSpellByName = My_OnCastSpellByName;
My_GameCastSpell = CastSpell;
function My_OnCastSpell(spellId, spellBookTabNum)
local spellName, spellRank = GetSpellName(spellId, spellbookTabNum);
println("TEST::: CastSpell!!" .. spellName);
My_GameCastSpell(spellId, spellBookTabNum);
end
CastSpell = My_OnCastSpell;[\code]
|