View Single Post
01-25-14, 06:38 AM   #42
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
For Tiger's Lust you'll have to put double quotes around it like "Tiger's lust" instead of 'Tiger's Lust' because the string would stop at the first quote and cause an error which would prevent the rest of the script from running.

Although it might be a better idea to leave the apostrophe out and change the file name to match. It doesn't need to match the spell name since it's using the spell ID, the name is just what sound file you want it to play when that spell ID is detected.

Lua Code:
  1. local Channeled = {
  2.     [113656] = 'Fists of Fury',
  3. }
  4.  
  5. local Instants = {
  6.     [100784] = 'Blackout Kick',
  7.     [115072] = 'Expel Harm',
  8.     [101545] = 'Flying Serpent Kick',
  9.     [117368] = 'Grapple Weapon',
  10.     [115178] = 'Resuscitate',
  11.     [107428] = 'Rising Sun Kick',
  12.     [116705] = 'Spear Hand Strike',
  13.     [101546] = 'Spinning Crane Kick',
  14.     [100787] = 'Tiger Palm',
  15.     [122470] = 'Touch of Karma',
  16.     [115176] = 'Zen Meditation',
  17.     [115078] = 'Paralysis',
  18.     [115203] = 'Fortifying Brew',
  19.     [115080] = 'Touch of Death',
  20.     [116740] = 'Tigereye Brew',
  21.     [116841] = 'Tigers Lust',
  22. }
  23.  
  24. local SoundPath = [[Interface\AddOns\HokutoNoMonk\sounds\]]
  25.  
  26. local f = CreateFrame('frame')
  27. f:SetScript('OnEvent', function(self, event, unit, spellName, _, _, spellID)
  28.     if event == 'UNIT_SPELLCAST_CHANNEL_START' and Channeled[spellID] then
  29.         PlaySoundFile(SoundPath .. Channeled[spellID] .. '.ogg', 'SFX')
  30.     elseif event == 'UNIT_SPELLCAST_SUCCEEDED' and Instants[spellID] then
  31.         PlaySoundFile(SoundPath .. Instants[spellID] .. '.ogg', 'SFX')
  32.     elseif event == 'PLAYER_DEAD' then
  33.         PlaySoundFile(SoundPath .. 'DeadSound.ogg', 'SFX')
  34.     end
  35. end)
  36.  
  37. f:RegisterUnitEvent('UNIT_SPELLCAST_CHANNEL_START', 'player')
  38. f:RegisterUnitEvent('UNIT_SPELLCAST_SUCCEEDED', 'player')
  39. f:RegisterEvent('PLAYER_DEAD')
I don't know what other spells you wanted to add, but the spell IDs shouldn't be too hard to find.

Last edited by semlar : 01-25-14 at 07:54 AM.
  Reply With Quote