Am I correct to presume that unless the unit firing the event has an unitid SPELL_CAST_START will return nil for destName, destGUID and destFlags?
I'm trying to detect when an enemy player starts casting a helpful or harmful spell just like CHAT_MSG_SPELL_HOSTILEPLAYER_DAMAGE vs CHAT_MSG_SPELL_HOSTILEPLAYER_BUFF did back in 2.3
Also, I'm trying to detect when a stun/incapacitate succesfully interrupts my targets casting, SPELL_INTERRUPT only works for interrupt type spells such as Kick/CS
You cannot get the target as indeed for _START it's nil. But you can detect if the unit who is casting is hostile from the srcFlags field by checking if COMBATLOG_OBJECT_REACTION_HOSTILE is set and you can check if it's a player via COMBATLOG_OBJECT_CONTROL_PLAYER and COMBATLOG_OBJECT_CONTROL_NPC.
To figure out if it's helpful or harmful you'll probably need to use spellId tables.
I don't really know another way. The thing that the target is invisible for SPELL_CAST_START clearly has to do with not giving mods too much knowledge where and what spells will land on folks to avoid this being too powerful for countering. SpellId tables can provide that at least the danger/use aspect of the spell but you'll have to provide that.
Another idea is to make it learning. You look for _START and then for a subsequent CL event for the same spell. From that you infer and store if the spell is buff, damage or heal. But essentially that's just dynamically creating that spellId table.
Will SPELL_AURA_APPLIED/REMOVED provide source info someday ? Even on the current 2.4.2 PTR build it's not the case, leaving us with ugly and ineffecient ways to track debuffs...
Also, i thought that SPELL_CAST_SUCCESS would be added to every spell in 2.4.2, not only instant ones, but it seems i was wrong. Not to say sometimes we receive SPELL_CAST_SUCCESS for resisted ones (or am i missing subsequent combat events ?).
I tried an AoE spell on PTR, and still no SPELL_CAST_SUCCESS event for it, im sad :(
Am I correct to presume that unless the unit firing the event has an unitid SPELL_CAST_START will return nil for destName, destGUID and destFlags?
I'm trying to detect when an enemy player starts casting a helpful or harmful spell just like CHAT_MSG_SPELL_HOSTILEPLAYER_DAMAGE vs CHAT_MSG_SPELL_HOSTILEPLAYER_BUFF did back in 2.3
...
For SPELL_CAST_START the destName is always nil, destGuid is always 0x0...... and destFlags are max -integer. Big nerf to spell alert type mods, there doesn't seem to be any way to check if something casting on you (the player) from SPELL_CAST_START unless I'm missing something.
sourceName is available I think, so can we look at the source unit's target somehow?
You can detect if a helpful or harmful spell is starting being cast by a hostile player, you just cannot tell where it will land. I don't think there is a change at all.
Use the source flags to determine if a cast is from a hostile unit and use a spellId table to determine if the cast is harmful or helpful.
SPELL_DAMAGE has 11 optional arguments.
optarg1 = unclear, a number
optarg2 = spell name
optarg3 = unclear, a number (e.g. 4) (4 for fire damage (e.g. immolate), 32 for shadow damage (e.g. shadow bolt)
optarg4 = damage amount
optarg5 = unclear, a number (e.g. 4) (seems to match optarg3)
optarg6-11 = nil
This morning I've discovered this;
optarg9 = Spell/Skill crit flag (not nil if spell/skill is a crit)
For SWING_DAMAGE the same flag is optarg6 as documented.
I couldn't find anywhere that this has been written, hope it helps.
"SPELL_AURA_APPLIED"
spellId, spellName, spellSchool, auraType
(source arguments are nil)
Someone has an idea to get the SourceGUID and SourceName ? We can't know who left a trap when someone walks on it, SPELL_AURA_APPLIED is fired but Source vars a nil with SrcFlags pointing to 0x80000000:/ Any workaround ?
Ps: I have checked on 2.4.2 PTR they didnt fixed this :(
As I was saying above blizzard intentionally leaves source and/or dest variables empty/nil/default for some events. They basically don't want addon's doing too much.
For example, I can make a spell alert mod that tells me someone nearby is casting something hostile based on SPELL_CAST_START, but I can't tell/warn that I am the target or a party member is the target of the spell.
I believe this is by design.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I'm trying to detect when an enemy player starts casting a helpful or harmful spell just like CHAT_MSG_SPELL_HOSTILEPLAYER_DAMAGE vs CHAT_MSG_SPELL_HOSTILEPLAYER_BUFF did back in 2.3
Also, I'm trying to detect when a stun/incapacitate succesfully interrupts my targets casting, SPELL_INTERRUPT only works for interrupt type spells such as Kick/CS
To figure out if it's helpful or harmful you'll probably need to use spellId tables.
How would I figure out if a nature spell is Healing Touch or Cyclone?
FriendlySpells =
{
[0815] = true, -- This is the famous FakeHealingTouch Spell
[5185] = true, -- Acutal healing touch rank 1
}
Wowhead uses these spell id's also.
http://www.wowhead.com/?spell=5185
Another idea is to make it learning. You look for _START and then for a subsequent CL event for the same spell. From that you infer and store if the spell is buff, damage or heal. But essentially that's just dynamically creating that spellId table.
Will the server send overhealing info as of 2.4.2 ?
!!!?
Also, i thought that SPELL_CAST_SUCCESS would be added to every spell in 2.4.2, not only instant ones, but it seems i was wrong. Not to say sometimes we receive SPELL_CAST_SUCCESS for resisted ones (or am i missing subsequent combat events ?).
I tried an AoE spell on PTR, and still no SPELL_CAST_SUCCESS event for it, im sad :(
For SPELL_CAST_START the destName is always nil, destGuid is always 0x0...... and destFlags are max -integer. Big nerf to spell alert type mods, there doesn't seem to be any way to check if something casting on you (the player) from SPELL_CAST_START unless I'm missing something.
sourceName is available I think, so can we look at the source unit's target somehow?
Use the source flags to determine if a cast is from a hostile unit and use a spellId table to determine if the cast is harmful or helpful.
SPELL_DAMAGE has 11 optional arguments.
optarg1 = unclear, a number
optarg2 = spell name
optarg3 = unclear, a number (e.g. 4) (4 for fire damage (e.g. immolate), 32 for shadow damage (e.g. shadow bolt)
optarg4 = damage amount
optarg5 = unclear, a number (e.g. 4) (seems to match optarg3)
optarg6-11 = nil
This morning I've discovered this;
optarg9 = Spell/Skill crit flag (not nil if spell/skill is a crit)
For SWING_DAMAGE the same flag is optarg6 as documented.
I couldn't find anywhere that this has been written, hope it helps.
spellId, spellName, spellSchool, auraType
(source arguments are nil)
Someone has an idea to get the SourceGUID and SourceName ? We can't know who left a trap when someone walks on it, SPELL_AURA_APPLIED is fired but Source vars a nil with SrcFlags pointing to 0x80000000:/ Any workaround ?
Ps: I have checked on 2.4.2 PTR they didnt fixed this :(
For example, I can make a spell alert mod that tells me someone nearby is casting something hostile based on SPELL_CAST_START, but I can't tell/warn that I am the target or a party member is the target of the spell.
I believe this is by design.