You will need to obtain the sound UI name from your client media file effectsound.txt.
You will also need to obtain the character ID for the character you want to play the sound for. You can use the following query to get the character ID from the database.
SELECT CharID FROM _OnlinePlayers WHERE CharName16 = 'character_name'
Stored Procedure: _Char_PlaySound
Parameters:
@CharID INT- Target character ID@SoundEffect VARCHAR(128)- Sound UI code
Let us first test whether the command works by using the following code, which will play a quest sound for a specific character.
USE [vPlus] GO DECLARE @CharID INT = (SELECT CharID FROM _OnlinePlayers WHERE CharName16 = 'character_name') EXEC _Char_PlaySound @CharID, 'snd_quest';
For real usage, use @CharID directly from your calling procedure.
EXEC _Char_PlaySound @CharID, 'snd_quest';