CapsAdmin

Untitled

Nov 19th, 2013
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.07 KB | None | 0 0
  1. function()
  2.     local buffName = "Twilight Ward"
  3.     local buff = UnitAura("player", buffName)
  4.     local timeRemain = ""
  5.    
  6.     if buff then
  7.         local timeNow = GetTime()
  8.         local timeExpires = select(7, UnitAura("player", buffName))
  9.         local timeLeft = timeExpires - timeNow
  10.        
  11.         if timeLeft < 5 then
  12.             timeRemain = math.floor(timeLeft)
  13.            
  14.             if lastTime ~= timeRemain then
  15.                 if timeRemain == 5 then
  16.                     PlaySoundFile("Interface/AddOns/WeakAuras/Media/Sounds/blast.mp3")
  17.                 elseif timeRemain == 4 then
  18.                     PlaySoundFile("Interface/AddOns/WeakAuras/Media/Sounds/blast.mp3")
  19.                 elseif timeRemain == 3 then
  20.                     PlaySoundFile("Interface/AddOns/WeakAuras/Media/Sounds/blast.mp3")
  21.                 elseif timeRemain == 2 then
  22.                     PlaySoundFile("Interface/AddOns/WeakAuras/Media/Sounds/blast.mp3")
  23.                 elseif timeRemain == 1 then
  24.                     PlaySoundFile("Interface/AddOns/WeakAuras/Media/Sounds/blast.mp3")
  25.                 elseif timeRemain == 0 then
  26.                     PlaySoundFile("Interface/AddOns/WeakAuras/Media/Sounds/blast.mp3")
  27.                 end
  28.                 lastTime = timeRemain
  29.             end
  30.         end
  31.     end
  32.    
  33.     return tostring(timeRemain)
  34. end
Advertisement
Add Comment
Please, Sign In to add comment