View Single Post
04-28-15, 10:47 AM   #8
sirann
A Flamescale Wyrmkin
Join Date: Mar 2007
Posts: 142
So basically, the only way I can think of doing this, is by tricking the game. The game is going to play that noise every time you hit a level. But, you don't want that. So we need to have the game play a "spoof" file, of nothing. So, you'll need an empty .ogg file that will be the exact name of the level up file. See:
Originally Posted by Phanx View Post

"Sound\\Interface\\Levelup.ogg"
"Sound\\Interface\\Levelup2.ogg"

Once you figure out which sound it is, you can create an empty text file with the same name, under the same directory structure:

World of Warcraft\Sound\Interface\Levelup.ogg

Create any folders that don't exist. The file can just be a plain text file, renamed with an .ogg extension.
This will disable the sound file the game will play. However, you still want to hear the noise every 10th level. So you could download the sound file, and have a PlaySoundFile(PATH\\TO\\YOUR\\SOUNDFILE\\THAT\\WILL\\ACTUALLY\\PLAY\\NOISE)

this code should do that, assuming you have the two spoof files, and the one file that will actually play the noise properly directed:
Lua Code:
  1. local levelchecktable = {}
  2.  
  3. for i = 10, 100, 10 do
  4.     levelchecktable[i] = true
  5. end
  6.  
  7. local f = CreateFrame('Frame', nil, UIParent)
  8. f:RegisterEvent('PLAYER_LEVEL_UP')
  9.  
  10. f:SetScript('OnEvent', function(self, event, ...)
  11.     if levelchecktable[UnitLevel('player')] then
  12.         PlaySoundFile(PATH\\TO\\YOUR\\SOUNDFILE\\THAT\\WILL\\ACTUALLY\\PLAY\\NOISE)
  13.     end
  14. end)

Last edited by sirann : 04-28-15 at 10:52 AM.
  Reply With Quote