Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function(event,time,type,_,sourceGUID,_,_,_,destGUID,destname,_,_,spellid,spellname,_,_,_,_,_,_,_,_,_,_,_,_)
- if event == "COMBAT_LOG_EVENT_UNFILTERED" and sourceGUID == UnitGUID("player") then
- local Info = soulShard_timerInfo
- if type == "SPELL_AURA_APPLIED" then
- if spellid == 603 then -- doom was applied
- local time = GetTime()
- soulShard_timerInfo[destGUID] = {
- time, -- LastTick 1
- time + soulShard_tickLength, --DoomDuration 2
- time + soulShard_tickLength, --NextFullTick 3
- time + soulShard_tickLength, --NextTick 4
- soulShard_tickLength, --RefreshHaste 5
- soulShard_tickLength, --CurrentHastedTick 6
- destGUID, -- GUID 7
- }
- wipe(soulShard_sortedTable)
- for _, v in pairs(soulShard_timerInfo) do
- table.insert(soulShard_sortedTable, v)
- end
- if soulShard_sortedTable and soulShard_sortedTable[2] and soulShard_sortedTable[2][4] then
- table.sort(soulShard_sortedTable, function(x,y)
- if x[4] and y[4] then
- return x[4] < y[4]
- else return true
- end
- end)
- end
- end
- elseif type == "SPELL_AURA_REMOVED" or type == "SPELL_INSTAKILL" or type == "UNIT_DIED" then
- if spellid == 603 then -- doom was removed
- Info[destGUID] = nil
- wipe(soulShard_sortedTable)
- for _, v in pairs(soulShard_timerInfo) do
- table.insert(soulShard_sortedTable, v)
- end
- if soulShard_sortedTable and soulShard_sortedTable[2] and soulShard_sortedTable[2][4] then
- table.sort(soulShard_sortedTable, function(x,y)
- if x[4] and y[4] then
- return x[4] < y[4]
- else return true
- end
- end)
- end
- end
- elseif type =="SPELL_AURA_REFRESH" then
- if spellid == 603 then -- doom was refreshed
- local time = GetTime()
- Info[destGUID][5] = soulShard_tickLength
- if Info[destGUID][2] - time <= soulShard_tickLength*0.3 then -- Pandemic check, next version should take timer info from UnitDebuff()
- Info[destGUID][2] = Info[destGUID][2] + soulShard_tickLength
- else
- Info[destGUID][2] = time + soulShard_tickLength + soulShard_tickLength*0.3
- end
- -- check when the next tick will be
- if Info[destGUID][2] >= Info[destGUID][3] then
- Info[destGUID][4] = Info[destGUID][3]
- elseif Info[destGUID][2] < Info[destGUID][3] and Info[destGUID][2] - time >= soulShard_tickLength*soulShard_tickThreshold then
- Info[destGUID][4] = Info[destGUID][2]
- else
- Info[destGUID][4] = nil
- end
- wipe(soulShard_sortedTable)
- for _, v in pairs(soulShard_timerInfo) do
- table.insert(soulShard_sortedTable, v)
- end
- if soulShard_sortedTable and soulShard_sortedTable[2] and soulShard_sortedTable[2][4] then
- table.sort(soulShard_sortedTable, function(x,y)
- if x[4] and y[4] then
- return x[4] < y[4]
- else return true
- end
- end)
- end
- end
- elseif type == "SPELL_PERIODIC_DAMAGE" then
- if spellid == 603 then -- doom ticked for damage
- local time = GetTime()
- Info[destGUID][6] = Info[destGUID][5]
- Info[destGUID][3] = time + Info[destGUID][6]
- Info[destGUID][1] = time
- -- check when the next tick will be
- if Info[destGUID][2] >= Info[destGUID][3] then
- Info[destGUID][4] = Info[destGUID][3]
- elseif Info[destGUID][2] < Info[destGUID][3] and Info[destGUID][2] - time >= soulShard_tickLength*soulShard_tickThreshold then
- Info[destGUID][4] = Info[destGUID][2]
- else
- Info[destGUID][4] = nil
- end
- wipe(soulShard_sortedTable)
- for _, v in pairs(soulShard_timerInfo) do
- table.insert(soulShard_sortedTable, v)
- end
- if soulShard_sortedTable and soulShard_sortedTable[2] and soulShard_sortedTable[2][4] then
- table.sort(soulShard_sortedTable, function(x,y)
- if x[4] and y[4] then
- return x[4] < y[4]
- else return true
- end
- end)
- end
- end
- end
- --[[if soulShard_timerInfo then
- for k,v in pairs(soulShard_timerInfo) do
- for i,j in pairs(v) do
- if i == 4 then
- print(j, GetTime())
- end
- end
- end
- end]]
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement