Files
wow-weakauras/WeakAuras/Projects/Judgment of Light.lua

41 lines
1.2 KiB
Lua

DISPLAY
function()
if aura_env.update == 1 then
for i = 1, 40 do
if UnitExists("nameplate" .. i) and UnitIsEnemy("player", "nameplate" .. i) and UnitAffectingCombat("nameplate" .. i) then
aura_env.enemies = aura_env.enemies + 1
if UnitDebuff("nameplate" .. i, "Judgment of Light") then
aura_env.lightenemies = aura_env.lightenemies + 1
local stacks = select(4, UnitDebuff("nameplate" .. i, "Judgment of Light"))
aura_env.totalstacks = aura_env.totalstacks + stacks
aura_env.update = 0
end
end
end
end
return aura_env.lightenemies .. "/" .. aura_env.enemies .. " " .. aura_env.totalstacks
end
TRIGGER
NAME_PLATE_UNIT_ADDED / REMOVED
function(...)
local subEvent = select(3, ...)
local caster = select(6, ...)
if (subEvent == "SPELL_AURA_APPLIED" or subEvent == "SPELL_HEAL" or subEvent == "SPELL_AURA_REMOVED") and aura_env.update == 0 and caster == UnitName("player") and InCombatLockdown("player") then
aura_env.lightenemies = 0
aura_env.enemies = 0
aura_env.totalstacks = 0
aura_env.update = 1
end
end
DURATION
function()
return aura_env.totalstacks, aura_env.lightenemies * 40, 1
end
INIT
aura_env.update = 0
aura_env.lightenemies = 0
aura_env.enemies = 0
aura_env.totalstacks = 0