Hi.
First, sorry for my bad English. I am creating an addon that needs check the buffs/debuffs of the some units when they are casted. I have 4 questions.
I am using COMBAT_LOG_EVENT_UNFILTERED and checking the type of events SPELL_AURA_APPLIED, SPELL_AURA_REFRESH for check when the buff/debuff applieds, but the duration it's not included in this event. For check the durations, I think I can't use UnitAura() function on COMBAT_LOG_EVENT_UNFILTERED, because this it's insecure, I think UnitAura() function it's only guaranted to provide correct results after UNIT_AURA event. I use the event UNIT_AURA, but some drawbacks occurs:
- UNIT_AURA only triggers for valid units (player, pet, target, focus, partyX, raidX arenaX, nameplateX, ...), while COMBAT_LOG_EVENT_UNFILTERED triggers for any unit loaded by the client (100yd aprox). This it's a minor issue, I think I can ignore these units...
- UNIT_AURA only have 1 arg, the unitId, I need do a loop for all auras using UnitAura(unit, i) (maybe a bit cpu expensive do this in all UNIT_AURA events?)
- I think UNIT_AURA it's executed after the COMBAT_LOG_EVENT_UNFILTERED events, but i don't know if this it's always the case, and it's hard maintain the consistency if I don't know the exact order of the execution... I don't know if when I executed the UNIT_AURA event I have the security that my COMBAT_LOG_EVENT_UNFILTERED function it's totally executed.
For the events, I am using a Frame and RegisterEvent function.
Now, the questions:
- 1º question: Is it right that I can't use UnitAura() in COMBAT_LOG_EVENT_UNFILTERED and I should wait to UNIT_AURA event to use UnitAura() function securely?
- 2º question: UNIT_AURA event it's always triggered after COMBAT_LOG_EVENT_UNFILTERED? it's guaranted the order?
- 3º question: If the 2º question answer it's "yes": UNIT_AURA event it's executed in my script after the execution of the COMBAT_LOG_EVENT_UNFILTERED finished? or these two events executes in my script asynchronously?
- 4º question: any other simple way to do this better?
Thanks for the help!