Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Trinket and Combat Arena Tracker! Credits Syncrow on AJ forums, www.arenajunkies.com/topic/237770-in-combat-script-for-arenaframes-with-trinket/
- LoadAddOn("Blizzard_ArenaUI")
- for i = 1, 5 do
- --(( TRINKET TRACKER ))--
- _G["TR"..i] = CreateFrame("Frame",nil,_G["ArenaEnemyFrame"..i])
- _G["TR"..i]:SetSize(25,25)
- _G["TR"..i]:SetPoint("RIGHT",15,0)
- _G["TR"..i].t = _G["TR"..i]:CreateTexture(nil,BORDER)
- _G["TR"..i].t:SetAllPoints()
- _G["TR"..i].t:SetTexture("Interface\\Icons\\inv_jewelry_trinketpvp_01")
- _G["TR"..i].c = CreateFrame("Cooldown",nil,_G["TR"..i])
- _G["TR"..i].c:SetAllPoints(_G["TR"..i])
- _G["TR"..i]:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
- _G["TR"..i].unit = "arena"..i
- _G["TR"..i].timecheck = 0
- _G["TR"..i]:SetScript("OnEvent", function(self,event,unit,_,_,_,spellID)
- local unitID = _G["TR"..i].unit
- if unitID == unit then
- if spellID == 59752 or spellID == 42292 then
- SendChatMessage("Trinket used by: "..GetUnitName(unitID, true), "PARTY")
- self.c:SetCooldown(GetTime(),120)
- self.timecheck = GetTime()
- elseif spellID == 7744 then
- SendChatMessage("WotF used by: "..GetUnitName(unitID, true), "PARTY")
- if GetTime() - self.timecheck > 90 then
- self.c:SetCooldown(GetTime(),30)
- elseif self.timecheck == 0 then
- self.c:SetCooldown(GetTime(),30)
- end
- end
- end
- end)
- --(( COMBAT TRACKER ))--
- _G["CT"..i] = CreateFrame("Frame",nil,_G["ArenaEnemyFrame"..i])
- _G["CT"..i]:SetSize(15,15)
- _G["CT"..i]:SetPoint("LEFT",_G["TR"..i],"RIGHT",2,0)
- _G["CT"..i].t = _G["CT"..i]:CreateTexture(nil,BORDER)
- _G["CT"..i].t:SetAllPoints()
- _G["CT"..i].t:SetTexture("Interface\\Icons\\ABILITY_DUALWIELD")
- _G["CT"..i]:SetAlpha(0)
- _G["CT"..i]:SetScript("OnUpdate", function(self)
- if UnitAffectingCombat("arena"..i) then
- self:SetAlpha(1)
- else
- self:SetAlpha(0)
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement