-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlastDeathSweep.lua
36 lines (30 loc) · 1.19 KB
/
lastDeathSweep.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
-- init
WeakAuras.WatchSpellCooldown(210152)
aura_env.canFitOneMoreDeathSweep = function()
-- Return 'true' if death sweep will come off cooldown right before meta
-- expires. Otherwise, return 'false'.
local metaExpirationTime = aura_env.metaExpirationTime
local deathSweepReadyTime = aura_env.deathSweepReadyTime
return (metaExpirationTime and deathSweepReadyTime
and metaExpirationTime - 2 < deathSweepReadyTime
and deathSweepReadyTime < metaExpirationTime - 0.1) -- Add a tolerance of 100ms
end
-- trigger: SPELL_COOLDOWN_CHANGED:210152, UNIT_AURA:player
function(event, arg1)
if event == "SPELL_COOLDOWN_CHANGED" and arg1 == 210152 and aura_env.metaExpirationTime ~= nil then
local start, duration = GetSpellCooldown(210152)
if start ~= 0 then
aura_env.deathSweepReadyTime = start + duration
else
aura_env.deathSweepReadyTime = nil
end
elseif event == "UNIT_AURA" then
local _, _, _, _, _, expirationTime = WA_GetUnitBuff("player", 162264)
aura_env.metaExpirationTime = expirationTime
end
return aura_env.canFitOneMoreDeathSweep()
end
-- untrigger
function(event)
return true
end