-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmarkOfTheCrane.lua
60 lines (49 loc) · 1.83 KB
/
markOfTheCrane.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
-------------------------------------------------------------------------------
-- init
aura_env.latestStates = {} -- an array of the 5 states with the latest
-- expiration times, where the state at index 5 is
-- the closest to expiring.
-------------------------------------------------------------------------------
-- TSU: CLEU:SPELL_DAMAGE
function(allstates, event, ...)
local sourceFlags = select(6, ...)
if sourceFlags == nil
or bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) == 0 then
return false
end
local spellId = select(12, ...)
if spellId ~= 100780 -- tiger palm
and spellId ~= 100784 -- blackout kick
and spellId ~= 185099 -- rising sun kick
and spellID ~= 261947 then -- fist of the white tiger
return false
end
local latestStates = aura_env.latestStates
local targetGuid = select(8, ...)
local state = allstates[targetGuid]
if state == nil then
-- This is a new target. Create a state for it, push it into
-- 'latestStates', then pop and hide 'latestStates[6]', if it exists.
state = {
["show"] = true,
["changed"] = true,
["progressType"] = "timed",
["expirationTime"] = GetTime() + 20,
["duration"] = 20,
["autoHide"] = true,
}
allstates[targetGuid] = state
table.insert(latestStates, 1, state)
local oldestState = latestStates[6]
if oldestState ~= nil then
oldestState.show = false
oldestState.changed = true
latestStates[6] = nil
end
else
-- This is an old target. Refresh its duration.
state.expirationTime = GetTime() + 20
state.changed = true
end
return true
end