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
"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:
local levelchecktable = {}
for i = 10, 100, 10 do
levelchecktable[i] = true
end
local f = CreateFrame('Frame', nil, UIParent)
f:RegisterEvent('PLAYER_LEVEL_UP')
f:SetScript('OnEvent', function(self, event, ...)
if levelchecktable[UnitLevel('player')] then
PlaySoundFile(PATH\\TO\\YOUR\\SOUNDFILE\\THAT\\WILL\\ACTUALLY\\PLAY\\NOISE)
end
end)