69 lines
2.3 KiB
Lua
69 lines
2.3 KiB
Lua
--COMBAT_LOG_EVENT_UNFILTERED GROUP_ROSTER_UPDATE UNTRIGGER
|
|
function(e, ...)
|
|
if e == "COMBAT_LOG_EVENT_UNFILTERED" then --CLEU
|
|
if not aura_env.tank then aura_env.tank = "" end
|
|
local se = select(2, ...)
|
|
if se == "SPELL_AURA_APPLIED" then
|
|
local type = select(15, ...)
|
|
if type == "DEBUFF" then
|
|
local caster = select(5, ...)
|
|
local target = select(9, ...)
|
|
local name = select(13, ...)
|
|
--If selected debuff is cast on other tank, get other tank from other trigger
|
|
if (target == aura_env.tank or target == UnitName("player")) and aura_env.auras[name] then
|
|
--Get stacks duration and expiry time for duration control and trigger
|
|
local stacks, dur = select(3, aura_env.unitDebuffC(target, name)), select(5, aura_env.unitDebuffC(target, name))
|
|
if stacks > aura_env.auras[name] then
|
|
--If I have too many stacks and I am tanking then -- other taunts
|
|
if target == UnitName("player") and select(1, UnitDetailedThreatSituation("player", "target")) then
|
|
aura_env.returnName = "DEBIL TAUNT"
|
|
aura_env.region:Color(0.3715, 0.6285, 0, 1)
|
|
--If other tank has too many stacks and other tank is tanking then -- I taunt
|
|
elseif target == aura_env.tank and select(1, UnitDetailedThreatSituation(target, "target")) then
|
|
aura_env.returnName = "TAUNT DEBIL"
|
|
aura_env.region:Color(0.5660, 0.1588, 0.2752, 1)
|
|
end
|
|
if aura_env.timer then aura_env.timer:Cancel() end
|
|
aura_env.timer = C_Timer.NewTimer(dur, function() WeakAuras.ScanEvents("UNTRIGGER") end)
|
|
return true
|
|
end
|
|
end
|
|
end
|
|
end
|
|
elseif e == "GROUP_ROSTER_UPDATE" then --Find other tank
|
|
if IsInRaid() then
|
|
for i = 1, GetNumGroupMembers() do
|
|
if UnitGroupRolesAssigned("raid" .. i) == "TANK" and UnitName("raid" .. i) ~= UnitName("player") then
|
|
aura_env.tank = UnitName("raid" .. i)
|
|
end
|
|
end
|
|
end
|
|
elseif e == "UNTRIGGER" then
|
|
return false
|
|
end
|
|
end
|
|
|
|
--NAME INFO
|
|
function()
|
|
return aura_env.returnName
|
|
end
|
|
|
|
--INIT
|
|
aura_env.UnitDebuffC = function(unit, spell)
|
|
for i = 1, 40 do
|
|
local name = UnitDebuff(unit, i)
|
|
if name then
|
|
if name == spell then
|
|
return UnitDebuff(unit, i)
|
|
end
|
|
else
|
|
return nil
|
|
end
|
|
end
|
|
end
|
|
aura_env.auras =
|
|
{
|
|
["Rimefrost"] = 5,
|
|
["Septic Taint"] = 5,
|
|
|
|
} |