76 lines
3.3 KiB
Lua
76 lines
3.3 KiB
Lua
--COMBAT_LOG_EVENT_UNFILTERED PLAYER_REGEN_ENABLED PLAYER_REGEN_DISABLED DRUID_HOTS_REMOVE_HOT UPDATE_WOUNDS
|
|
function(e, ...)
|
|
if not WeakAurasSaved.FesteringWounds then WeakAurasSaved.FesteringWounds = {["count"] = 0} end
|
|
if not WeakAurasSaved.FesteringWounds.ticker then WeakAurasSaved.FesteringWounds.ticker = C_Timer.NewTicker(0.5, function() WeakAuras.ScanEvents("UPDATE_WOUNDS") end) end
|
|
if e == "UPDATE_WOUNDS" then return true
|
|
elseif e == "COMBAT_LOG_EVENT_UNFILTERED" then
|
|
local se = select(2, ...)
|
|
local caster = select(5, ...)
|
|
local spellname = select(13, ...)
|
|
local stacks = select(16, ...)
|
|
if se == "SPELL_AURA_APPLIED" or se == "SPELL_AURA_APPLIED_DOSE" or se == "SPELL_AURA_REMOVED" or se == "SPELL_AURA_REMOVED_DOSE" then
|
|
if caster and caster == UnitName("player") and spellname == "Festering Wound" then
|
|
local countsum = 0
|
|
local counted = 0
|
|
for i = 1, 40 do
|
|
if UnitExists("nameplate" .. i) then
|
|
local index = 1
|
|
while UnitDebuff("nameplate" .. i, index) do
|
|
local name, _, _, count = UnitDebuff("nameplate" .. i, index)
|
|
local caster = select(8, UnitDebuff("nameplate" .. i, index))
|
|
if name == "Festering Wound" then
|
|
countsum = countsum + count
|
|
if counted == 0 then counted = 1 end
|
|
end
|
|
index = index + 1
|
|
end
|
|
end
|
|
end
|
|
if counted == 0 and se == "SPELL_AURA_REMOVED" then
|
|
WeakAurasSaved.FesteringWounds.count = 0
|
|
end
|
|
if counted == 1 then
|
|
WeakAurasSaved.FesteringWounds.count = countsum
|
|
end
|
|
--DevTools_Dump(WeakAurasSaved.FesteringWounds)
|
|
return true
|
|
end
|
|
end
|
|
elseif e == "PLAYER_REGEN_ENABLED" or e == "PLAYER_REGEN_DISABLED" then
|
|
WeakAurasSaved.FesteringWounds.count = 0
|
|
local countsum = 0
|
|
local counted = 0
|
|
for i = 1, 40 do
|
|
if UnitExists("nameplate" .. i) then
|
|
local index = 1
|
|
while UnitDebuff("nameplate" .. i, index) do
|
|
local name, _, _, count = UnitDebuff("nameplate" .. i, index)
|
|
local caster = select(8, UnitDebuff("nameplate" .. i, index))
|
|
if name == "Festering Wound" then
|
|
countsum = countsum + count
|
|
if counted == 0 then counted = 1 end
|
|
end
|
|
index = index + 1
|
|
end
|
|
end
|
|
end
|
|
if counted == 1 then
|
|
WeakAurasSaved.FesteringWounds.count = countsum
|
|
end
|
|
--DevTools_Dump(WeakAurasSaved.FesteringWounds)
|
|
return true
|
|
end
|
|
end
|
|
|
|
--STACK INFO
|
|
function()
|
|
return WeakAurasSaved.FesteringWounds.count
|
|
end
|
|
|
|
--DISPLAY
|
|
function()
|
|
return WeakAurasSaved.FesteringWounds["Spring Blossoms"].count
|
|
end
|
|
|
|
--INIT
|
|
if not WeakAurasSaved.FesteringWounds then WeakAurasSaved.FesteringWounds = {["count"] = 0} end |