I need a target macro that plays a sound

Like title says. I have seen some examples but I believe the work on retail and not WOTLK.

I want to have a /tar macro that when it targets the NPC plays a noise pref the raid warning. I already know about some of the addons but they work off name platers or mouse over and i dont want to mouse over or fly right up to every npc in the area.

Any idea how this can be done?

1 Like

I have not tried this in Wrath Classic, but the command to do so in the retail client is:

/run PlaySound(soundKitID [, channel, forceNoDuplicates, runFinishCallback])

You can read more here:

1 Like

I’d love to have bowfingers “gotcha suckers” as a sound file as I target stuff.

You can only reference sounds that are a part of the game. Blizzard does not want you to be able to use external resources as it can open up avenues for exploits and bots.

So unless it is a standard Blizzard sound file, you will not be able to play it.

!Please note! If you are doing things like this, NEVER try to modify, replace or add additional files, data, or information to any of the default Blizzard files/folders. That is a quick way to get a nice game vacation or possibly have your account permanently suspended.

2 Likes

This should be the basics:

/tar (NPC Name here)
/script PlaySound(8959)

or

/tar (NPC Name here)
/run PlaySound(8959)

Either should get you the same end results.

2 Likes

Just tested this in Wrath Classic and it works correctly; that should get you want you want as long as you specify the correct NPC name in the /tar command.

1 Like

How to I make it play through let’s say dialog so I can have sound effects disabled? I cant stand the wind/whisping noise.

Now you are into addon territory. The macro system does not have functionality to create dialog boxes. If you wanted such a thing, it would need to be built as an addon.

1 Like

No I mean channel. Cant it tell it to play through the dialog channel? Or music channel and so forth?

Ah gotcha; then yes, the macro PlaySound command does accept a channel as input.

PlaySound(soundKitID [, channel, forceNoDuplicates, runFinishCallback])

Here are the available channels:

Channel Toggle CVar Volume CVar[1]
Master Sound_EnableAllSound Sound_MasterVolume
Music Sound_EnableMusic Sound_MusicVolume
SFX (Effects) Sound_EnableSFX Sound_SFXVolume
Ambience Sound_EnableAmbience Sound_AmbienceVolume
Dialog Sound_EnableDialog Sound_DialogVolume
Talking Head

So the line in the macro would be:
/script PlaySound(8959,“Dialog”)

1 Like

There is a way to use weakauras to play custom sounds.

Haven’t bothered myself, but have seen guides on adding music for bloodlust.

1 Like

Yes, I have seen similar; you can play custom sounds if you build an addon and place all the sound files you need within the addon directory.

I personally have never used it because there are already hundreds of sounds available in the default game, so you can easily find something that works.

WeakAuras does have many of these features, so if the OP wanted, they could just use that and add whatever sound they wanted. But since they asked for a macro, I went down that route.

You will need to create a weak aura with a sound trigger condition. Though it may be a bit difficult to code it to ping a sound on just a tab target though.

Why, the in-game macro system will do this just fine.

/tar (NPC Name here)
/script PlaySound(8959,“Dialog”)

Will do exactly what the OP wants and will not require an addon.

What is the objective/application? I’m sure you can do it with a weak aura

/cleartarget
/tar Time-Lost
/tar Vyra
/tar time
/stopmacro [dead][noexists]
/tm 6
/script PlaySound(8959,“Dialog”)

This is what I have but im not hearing any noise. By itself I was and I have dialog volume maxed
Edit: I have time in it to target myself and check if it works

Doesn’t work in classic

Yes it does, I just tested it.

I get an lua error with the script

Not sure what to tell you. If you are horde and go to Org bank and create the following macro:

/tar Zazo
/script PlaySound(8959,“Dialog”)

Your macro will target Zazo in the Inn and play the raid warning sound. I am doing it right now in Classic Wrath.