Sound when pet dies
Hello world, I play BM hunter and sometimes (especially Ashran) my pet dies and I'm too distracted to see it... Can someone share the code to create an addon that play a sound when pet dies? Thanks in advance.
|
I don't play hunter, so I'm not quite sure if a dead pet is a 'corpse' (zero health, would trigger UNIT_HEALTH) or despawns (no longer exists, would trigger UNIT_PET).
This code is just a guess -- I haven't tested it -- to cover both possible cases. Lua Code:
Change the soundkit for something on this list (I just took the first one): https://github.com/Gethe/wow-ui-sour...tConstants.lua |
I play a hunter so will take a look see.
|
Nice, it works amazing :)
But where can I see the list of all sounds to choose another one? |
Quote:
Glad you got it working for you. My everyday fighting that didn't kill the pet didn't trigger any of the events for me rofl. So maybe it only triggers on death after combat. To get the other sounds, the link under the code that was provided will give you the different sounds the game uses. |
Oh nice I didnt saw it, thanks.
My pet was killed by the dummy at Boralus and there was a coin sound. UI_LEGENDARY_LOOT_TOAST is a nice sound. Edit: I changed the sound and deleted f:RegisterUnitEvent("UNIT_PET", "player") because this part plays the sound a second time when I use the Revive Pet ability. Just f:RegisterUnitEvent("UNIT_HEALTH", "pet") is enough. Quote:
|
Quote:
Examples I use for some stuff is PlaySound(23331) which has a few random "engineering doodad" fun sounds. I also use the old major/minor glyph sounds for special events PlaySoundFile(567404)PlaySoundFile(567487) I don't remember which one is which, but played together, they sound great. Notice how those last two say "PlaySoundFile" instead. Sound IDs, which PlaySound uses, are basically indexes to a scripted table of sounds, some going to single sounds, others going to a group of randomly played sounds. File IDs, however, correlate directly to a file. File IDs are a little more tricky to get if you don't know what you're doing. wow.tools is one of the best tools available. That specific link takes you to the main sound table for the game. Searching names or IDs gets you File IDs in the FileDataID columns. Going back to that engineering doodad ID, let's search for that. Now we know that ID plays one of five random sounds. |
All times are GMT -6. The time now is 08:23 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI