Hi all
I need to track the player, (and the player only), spell casts, so I am tracking the different Spell Cast events.
The UNIT_SPELLCAST_SENT event is the only one that returns the unit casting the spell, however this returns regardless of whether the cast goes off or not, (eg; casting Health Funnel cannot be cast on a pet that is already full health).
I thought I could track UNIT_SPELLCAST_FAILED, UNIT_SPELLCAST_STOP and UNIT_SPELLCAST_SUCCEEDED yet these fire on any spell cast by others in the same group/instance/raid so I cannot guarantee that it is my spell that fails, stops or succeeds.
I have further problems that when I get multiple returns from the one spell cast, ( eg I cast agony and I get two returns).
Corruption returns multiples for two different spell IDs, (146739, 172), even though the spell cast sent is only for the 172 spell ID.
Here is my event tracking chunk;
Lua Code:
elseif event == "UNIT_SPELLCAST_SENT" then
unit, target, _, spellID = ...
spellName = GetSpellInfo(spellID)
print("|cffAAD372 UNIT_SPELLCAST_SENT - unit, spellID, spellName - ", unit, spellID, spellName) -- debug --
elseif event == "UNIT_SPELLCAST_FAILED" then
_, _, spellID = ...
spellName = GetSpellInfo(spellID)
print("|cff3FC7EB UNIT_SPELLCAST_FAILED - spellID, spellName - ", spellID, spellName) -- debug --
elseif event == "UNIT_SPELLCAST_START" then
_, _, spellID = ...
spellName = GetSpellInfo(spellID)
print("|cffF48CBA UNIT_SPELLCAST_START - spellID, spellName - ", spellID, spellName) -- debug --
elseif event == "UNIT_SPELLCAST_STOP" then
_, _, spellID = ...
spellName = GetSpellInfo(spellID)
print("|cffFF7C0A UNIT_SPELLCAST_STOP - spellID, spellName - ", spellID, spellName) -- debug --
elseif event == "UNIT_SPELLCAST_SUCCEEDED" then
_, _, spellID = ...
spellName = GetSpellInfo(spellID)
print("|cffFFF468 UNIT_SPELLCAST_SUCCEEDED - spellID, spellName - ", spellID, spellName) -- debug --
Here is a gif of the returns for each event that I am tracking;
Is there a way that I can reliably track only my spell casts and only my spell cast successes?