Thread Tools Display Modes
04-02-20, 10:46 PM   #1
dfsdfvh
A Kobold Labourer
Join Date: Apr 2020
Posts: 1
Changing spell sound effect?

Title. I really like sub rogue’ Shuriken Storm sound effect, is there anyway for me ro replace Fan of Knives sound effect with Shuriken Storm', or maybe even any custom sound on my PC?
Thanks for your help
  Reply With Quote
04-03-20, 01:27 AM   #2
LudiusMaximus
A Rage Talon Dragon Guard
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 320
As I have already told you , you could try to hook PlaySound() as described here: https://www.wowinterface.com/forums/...688#post325688

I have not tried it myself, but this is how I would go about it. First you write:

Code:
hooksecurefunc("PlaySound", function(...)
  local id, channel, forceNoDuplicates, runFinishCallback = ...
  print("PlaySound", id)
end)
This should print the sound id of any sound played.
Thus, you can note down the sound ids of Shuriken Storm and Fan of Knives.

Then you make a function above your hook function:
Code:
local function StopLastSound()
  -- Play some sound to get a handle.
  local _, handle = PlaySound(SOUNDKIT[next(SOUNDKIT)], "SFX", false)
  if handle then
    -- Stop this sound and the previous.
    StopSound(handle-1)
    StopSound(handle)
  end
end

And change your hook function to
Code:
hooksecurefunc("PlaySound", function(...)
  local id = ...
  
  if id == <Fan of Knives id> then
    StopLastSound()
    PlaySound(<Shuriken Storm id>)
  end
end)
__________________
~ Be the change you want to see in the world... of warcraft interface! ~
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Changing spell sound effect?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off