38 lines
1.2 KiB
Lua
38 lines
1.2 KiB
Lua
---COMBAT_LOG_EVENT_UNFILTERED
|
|
function(allstates, e, ...)
|
|
local source, err = CLEUParser.GetSourceName(...)
|
|
if err then return end
|
|
if source ~= UnitName("player") then return end
|
|
local targetGUID, err = CLEUParser.GetDestGUID(...)
|
|
if err then return end
|
|
local targetName, err = CLEUParser.GetDestName(...)
|
|
if err then return end
|
|
--if target ~= "Valkor" then return end
|
|
local overkill, err = CLEUParser.GetOverkill(...)
|
|
if err then return end
|
|
if 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 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
|