From 71d3ade117f55c4e091bdd3c16a65c1bb972c914 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Sat, 6 Jan 2007 16:58:13 +0000 Subject: [PATCH] Changed the way aggro is updated, to ensure its kept up to date. Will only fire on a state change. --- PerfectRaid_Aggro.lua | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/PerfectRaid_Aggro.lua b/PerfectRaid_Aggro.lua index 6490464..b93edb4 100644 --- a/PerfectRaid_Aggro.lua +++ b/PerfectRaid_Aggro.lua @@ -92,17 +92,8 @@ function Aggro.OnUpdate() local victim = victims[unit] if UnitIsUnit(victim, unit) and UnitCanAttack(unit, target) then -- unit is being targeted by a hostile mob - if aggro[unit] < 20 then - local val = aggro[unit] - if val >= 5 and val <= 10 then - if not marked[unit] then - PerfectRaid:UNIT_HEALTH(nil, unit) - end - else - if marked[unit] then - PerfectRaid:UNIT_HEALTH(nil, unit) - end - end + local val = aggro[unit] + if val < 20 then aggro[unit] = val + 10 end end @@ -114,7 +105,15 @@ function Aggro.OnUpdate() -- Use this when a unit has aggro if aggro[unit] >= 15 then - --self:FlashAggro(unit) + if not marked[unit] then + PerfectRaid:UNIT_HEALTH(nil, unit) + marked[unit] = true + end + else + if marked[unit] then + PerfectRaid:UNIT_HEALTH(nil, unit) + marked[unit] = nil + end end local name = UnitName(unit) -- 1.7.9.5