Files
wow-weakauras/FreshShit/OreCamper/event2.lua

36 lines
1.1 KiB
Lua

--- CLEU:SPELL_DAMAGE
function(allstates, e, ...)
local source = arg4
if not source or source ~= UnitName("player") then return end
local targetGUID = arg6
if not targetGUID then return end
local targetName = arg7
if not targetName then return end
local overkill = arg13
if not overkill or overkill <= 0 then return end
local currentTime = GetTime()
if aura_env.lastEvent > 0 and currentTime - aura_env.lastEvent < aura_env.throttle then return end
aura_env.lastEvent = currentTime
local cooldown = aura_env.cooldown
-- local lastEventTime = aura_env.lastEventTimes[targetGUID] or currentTime
-- local timeSinceLastEvent = currentTime - lastEventTime
-- local cooldown = timeSinceLastEvent
-- if cooldown == 0 then cooldown = aura_env.cooldown end
local state = {
changed = true,
show = true,
progressType = "timed",
autoHide = true,
duration = cooldown,
expirationTime = currentTime + cooldown,
name = string.format("%s", targetName),
}
aura_env.lastEventTimes[targetGUID] = currentTime
allstates[targetGUID] = state
return true
end