-- -- Part of WoWLiCe Copyright (c)2008 Alex Quintana -- see main file for more copyright details -- -- LiCe Combo Damage functions -- enables this addon to run standalone if (not LiCe) then LiCe = {}; end LiCe.Combos = {}; LiCe.Combos.Hits = 0; LiCe.Combos.ComboDamage = 0; -- OnLoad handler function LiCe.Combos:OnLoad() this:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED"); end -- OnEvent handler function LiCe.Combos:OnEvent(self, event, ...) if (event=="COMBAT_LOG_EVENT_UNFILTERED") then local src = select(4, ...); if (not src or src ~= UnitName("Player")) then return; end local etype = select(2, ...); local dmg = "z"; if (etype == "SWING_DAMAGE") then dmg = select(9, ...); elseif (etype == "SPELL_DAMAGE" or etype == "SPELL_PERIODIC_DAMAGE") then dmg = select(12, ...); end if (dmg ~= "z") then AlexLib:ClearTimer("combotimer"); LiCe.Combos.Hits = LiCe.Combos.Hits + 1; LiCe.Combos.ComboDamage = LiCe.Combos.ComboDamage + dmg; AlexLib:NewTimer(1500, function() if (LiCe.Combos.Hits > 1) then local msg = LiCe.Combos.Hits.." hits! "..LiCe.Combos.ComboDamage.." damage."; UIErrorsFrame:AddMessage(msg,1,1,0); --[[if (LiCe.Print) then LiCe:Print("INFO", msg); else DEFAULT_CHAT_FRAME:AddMessage(msg,1,1,0); end]] end LiCe.Combos.Hits = 0; LiCe.Combos.ComboDamage = 0; end, nil, "combotimer"); end end end -- aeq/2k8