Hello,
I am trying to build a simple function which will track a certain debuffs, that is to track moments when debuffs are applied and when they are removed. Then I would like to start a simple timer when the debuff which I track is over.
First I tried using UNIT_AURA but it gets fired every time a debuff changes or do damage to a unit. Then I came across COMBAT_LOG_EVENT, which is quite complicated. I have a simple function which I tried to create based on wowpedia and some code from WoW Interface:
Lua Code:
function(timestamp, event, hideCaster,
sourceGUID, sourceName, sourceFlags, sourceRaidFlags,
destGUID, destName, destFlags, destRaidFlags, spellId, spellName, spellSchool, ...)
if event == "SPELL_AURA_APPLIED" or event == "SPELL_AURA_REFRESHED" then
auraType, amount = ...
if auraType == "DEBUFF" then
-- Check the debuff is in the list to track
-- cache Target's GUID and the debuff's ID
end
elseif event == "SPELL_AURA_REMOVED" then
auraType, amount = ...
if check whether you track that debuff then
-- Check if debuff is in cache, if it was applied
-- if Yes, removed from cache and start a timer
end
else
-- do things in case debuff was neither atarted nor removed
end
end
So the above function is run such that I pass all parameters COMBAT_LOG_EVENT returns. Is this function any close to do what I need it to do? I am simply need to know what aura is applied to a target and when it is over. Then I would like to start a timer.
Thanks.