I have absolutely 0 experience with making an addon.
However i do find another work around using Tell Me When, and should also work if you’re using Weak Aura, as both addon serve almost similar function, though Weak Aura is more robust and more customizeable.
I mostly use Tell Me When, so this is how i do it
First i downloaded the sound that i want to use, in this case
Shield of the Righteous, here’s the sound file that i use
https://wow.tools/casc/preview/chash?buildconfig=806f4fd265de05a9b328310fcc42eed0&cdnconfig=b225a5d105393ef582066157f7dd34fc&filename=sound%2Fspells%2Fspell_pa_shieldoftherightious_impact.ogg&contenthash=73ec510d4057b161b76e7005bf076e0f
I download the sound file and put it in my Interface folder (anywhere inside that folder work, so you can make your own folder inside that Interface folder for your custom sounds)
Now in-game, i make a tell me when icon that track my Shield of Righteous cooldowns, but i check the always hide.
This will hide the icon from your view, but the addon itself will track the ability for conditions.
Now i go to notifications tab, add notifications, sounds, and select “on charge spent”
On the bottom, there is “custom sound file”, this is where you want to write where your custom sound file location, remember it has to be in the Interface folder.
For me it’s Interface/Shield of Righteous.ogg
Now close the TMW setting and press the Shield of Righteous, voila, whenever a charge is spent you can hear that loud CLANG! sound effect.
I did the same thing with Hammer of the Righteous (or Blessed Hammer if you talented)
I track both ability and use this sound :
https://wow.tools/casc/preview/chash?buildconfig=806f4fd265de05a9b328310fcc42eed0&cdnconfig=b225a5d105393ef582066157f7dd34fc&filename=sound%2Fspells%2Fhammeroftherighteousimpact.ogg&contenthash=2522c2b2316644bad9ac60a99bc9ef50
Now the tricky part is for ability that don’t have charges nor cooldowns, such as Templar Verdict, Swipe and Thrash (cat).
I can use the Combat Event tracker for Templar Verdict and have no problem with it (because you can only use the ability when hitting enemy, thus in combat)
But i can’t find a work around for Swipe or Feral Thrash, it doesn’t have charge nor cd. So the only option for the custom sound effect to happen is if you’re in combat using the combat event tracker.
While out of combat however, the custom sound won’t play.
I wonder if spell cast is not trackable outside of combat?
If anyone can find a way to make a sound effect to play whenever a spell cast is successful, let me know.