Add damage intake from wago
This commit is contained in:
41
NewAge/DamageIntake/trigger.lua
Normal file
41
NewAge/DamageIntake/trigger.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
-- COMBAT_LOG_EVENT_UNFILTERED, FRAME_UPDATE
|
||||
function (allStates, ev, ...)
|
||||
local now = GetTime()
|
||||
|
||||
if (WeakAuras.IsOptionsOpen()) then
|
||||
aura_env.fn.createDummyDisplay(allStates)
|
||||
return true
|
||||
end
|
||||
|
||||
if (ev == "COMBAT_LOG_EVENT_UNFILTERED") then
|
||||
-----------------------------------------
|
||||
-- COMBAT LOG
|
||||
-----------------------------------------
|
||||
local timestamp, damageType, _, _, _, _, _, destGUID, _, _, _, _, _, spellSchool = ...
|
||||
|
||||
-- hack to separate bleeds from magical DoT
|
||||
if (damageType == "SPELL_PERIODIC_DAMAGE" and spellSchool == aura_env.spellSchool.PHYSICAL) then
|
||||
damageType = aura_env.types.BLEED
|
||||
end
|
||||
|
||||
-- exit early if target is NOT the player or the damageType is NOT relevant
|
||||
if (destGUID ~= aura_env.playerGUID or not aura_env.fn.isTrackedEvent(damageType)) then
|
||||
return
|
||||
end
|
||||
|
||||
-- get damage of current "hit"
|
||||
local damage = aura_env.fn.parseDamage(damageType, ...)
|
||||
-- record new damage application
|
||||
aura_env.fn.addDamageRecord(allStates, now, damageType, damage)
|
||||
else
|
||||
-----------------------------------------
|
||||
-- FRAME UPDATE
|
||||
-----------------------------------------
|
||||
if (now - aura_env.lastCleanup > aura_env.cleanupInterval) then
|
||||
aura_env.lastCleanup = now
|
||||
aura_env.fn.calcCurrentHistoricalDamage()
|
||||
aura_env.fn.updateAllState(allStates)
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
Reference in New Issue
Block a user