Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.92 KB | None | 0 0
  1. --sound files
  2. local File1 = "Interface/AddOns/SnC_Audio/OnDeath"
  3. local File2 = "Interface/AddOns/SnC_Audio/Warlock_Meta"
  4. local File3 = "Interface/AddOns/SnC_Audio/Warlock_Meta_Critical"
  5.  
  6. function SnC_OnLoad()
  7. this:RegisterEvent('PLAYER_DEAD')
  8. this:RegisterEvent('UNIT_CASTSPELL_SUCCEEDED')
  9. this:RegisterEvent('SPELL_DAMAGE')
  10. end
  11.  
  12. function SnC_OnEvent(self, event, ...)
  13.     if (event == 'PLAYER_DEAD') then
  14.             PlaySoundFile(File1)
  15.     end
  16.     if (event == 'UNIT_CASTSPELL_SUCCEEDED') then
  17.         if arg2 == 'Metamorphosis' then
  18.             PlaySoundFile(File2)
  19.         end
  20.     end
  21.     while UnitBuff("player", "Metamorphosis") do
  22.         local timestamp, event, sourceGUID, sourceName, sourceFlags, destGUID, destName, destFlags = select(1, ...)
  23.         if CombatLog_Object_IsA(sourceFlags, COMBATLOG_FILTER_MINE) then
  24.             if (event == "SPELL_DAMAGE") then
  25.                 critical = select(18, ...)
  26.                 if critical then
  27.                     PlaySoundFile(File3)
  28.                 end
  29.             end
  30.         end
  31.     end
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement