Advertisement
wit4er

Untitled

Apr 10th, 2012
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.30 KB | None | 0 0
  1. local USS="UNIT_SPELLCAST_SUCCEEDED"
  2. local OE="OnEvent"
  3. local PvP="Interface\\Icons\\inv_jewelry_trinketpvp_01"
  4. local F="Frame"
  5. local CF=CreateFrame
  6. local BO="Border"
  7. local PvPT="PvP Trinket"
  8. local EMFH="Every Man For Himself"
  9. local UC=UnitClass
  10. local SCM=SendChatMessage
  11. local RW="RAID_WARNING"
  12. function TrS(f,x,y,cd,T,s,h)
  13.          f:SetPoint("BOTTOMLEFT",x,y)
  14.          f:SetSize(s,s)
  15.          f.c=CF("Cooldown",cd)
  16.          f.c:SetAllPoints(f)
  17.          f.t=f:CreateTexture(nil,BO)
  18.          f.t:SetAllPoints()
  19.          f.t:SetTexture(T);
  20.          if not h then
  21.               f:Hide();
  22.          end
  23.          f:RegisterEvent(USS)
  24. end
  25. function Ts(f,cd,U,N,S,TI)
  26.          if CPz(N,S,U) then
  27.          CooldownFrame_SetTimer(cd,GetTime(),TI,1)
  28.             f:Show();          
  29.             f.elapsed = 0
  30.             f:SetScript('OnUpdate', function(self, elapsed)
  31.             if self.elapsed > TI then
  32.             self:SetScript('OnUpdate', nil)
  33.             self:Hide();
  34.             else
  35.             self.elapsed = self.elapsed + elapsed
  36.             end
  37.          end)
  38.              
  39.          end
  40. end
  41. function CPz(N,S,U)
  42.          if(N==S and
  43.            (U=="arena1"
  44.            or U=="arena2"
  45.            or U=="arena3"
  46.            or U=="arenapet1"
  47.            or U=="arenapet2"
  48.            or U=="arenapet3"
  49.            or U=="target"
  50.            or U=="focus"))then
  51.            return true
  52.            else
  53.            return false
  54.           end
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement