Thread Tools Display Modes
09-05-08, 10:13 AM   #1
dragonclaw7000
A Deviate Faerie Dragon
 
dragonclaw7000's Avatar
Join Date: Oct 2006
Posts: 13
Need debuff coding help

Is there a way to know if trap debuffs are from the player and when they get applied? Have tried for ages now without finding a way to do it

I have tried to listen to "COMBAT_LOG_EVENT_UNFILTERED" and catch the Aura but then I dont know if it was me who triggered it + it does not seem to work
  Reply With Quote
09-05-08, 10:22 AM   #2
Taffu
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 149
I had an issue with this when working on a spell timer AddOn. What I would do is store the info from the spell cast event prior to the Aura event (trap actually activating) so that when the trap activated, it would only do so if it existed in the table. That way, using the comparison you can omit players other than yourself.

Just remove the key from the table once the Aura fires and recycle it that way and you should be good to go.
  Reply With Quote
09-05-08, 10:50 AM   #3
dragonclaw7000
A Deviate Faerie Dragon
 
dragonclaw7000's Avatar
Join Date: Oct 2006
Posts: 13
Do this work even if the unit isn't targeted or on focus? The trap is the source when it goes of but it doesn't have any form of id. For the trap effect the source = nil

Last edited by dragonclaw7000 : 09-05-08 at 10:53 AM.
  Reply With Quote
09-05-08, 11:07 AM   #4
Taffu
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 149
Target/Focus/Etc doesn't matter, you're only comparing it to an instance of an active trap based on your casting it (and the data from the cast being held in a table). Then compare the trap firing the Aura update to the existing data you stored from you casting it. If it matches (ie. Frost Trap set & stored, and then the Aura is a Frost Trap), have it trigger. If not, just ignore it (ie. someone elses Trap). Once the trigger happens, delete the table key.

It's not a 100% sure-fire way to properly do it, to be honest. It's just one way to create a comparison on a possible active trap (ie. if you didn't cast a trap, there won't be a table instance and nothing will trigger). The problem will be once you "do" cast a Trap, that it's liable to find someone elses trap go off. I don't know of any other way to do it, though...it stinks that the AURA events don't contain a sourceID.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Need debuff coding help


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off