Scripts/Commands: Implemented .debug play objectsound command
Port From (https://github.com/TrinityCore/TrinityCore/commit/95893cf53cdc9ab2ca3ec26cfd85793e63e97317)
This commit is contained in:
@@ -1238,6 +1238,23 @@ namespace Game.Chat
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Command("objectsound", RBACPermissions.CommandDebug)]
|
||||||
|
static bool HandleDebugPlayObjectSoundCommand(CommandHandler handler, uint soundKitId, int? broadcastTextId)
|
||||||
|
{
|
||||||
|
if (!CliDB.SoundKitStorage.ContainsKey(soundKitId))
|
||||||
|
{
|
||||||
|
handler.SendSysMessage(CypherStrings.SoundNotExist, soundKitId);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Player player = handler.GetPlayer();
|
||||||
|
|
||||||
|
player.PlayObjectSound(soundKitId, player.GetGUID(), player, broadcastTextId.GetValueOrDefault(0));
|
||||||
|
|
||||||
|
handler.SendSysMessage(CypherStrings.YouHearSound, soundKitId);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
[Command("sound", RBACPermissions.CommandDebug)]
|
[Command("sound", RBACPermissions.CommandDebug)]
|
||||||
static bool HandleDebugPlaySoundCommand(CommandHandler handler, uint soundId, uint broadcastTextId)
|
static bool HandleDebugPlaySoundCommand(CommandHandler handler, uint soundId, uint broadcastTextId)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2960,7 +2960,7 @@ namespace Game.Entities
|
|||||||
SendMessageToSet(new PlayMusic(musicId), true);
|
SendMessageToSet(new PlayMusic(musicId), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayObjectSound(uint soundKitId, ObjectGuid targetObjectGUID, Player target = null, int broadcastTextId = 0)
|
public void PlayObjectSound(uint soundKitId, ObjectGuid targetObjectGUID, Player target = null, int broadcastTextId = 0)
|
||||||
{
|
{
|
||||||
PlayObjectSound pkt = new();
|
PlayObjectSound pkt = new();
|
||||||
pkt.TargetObjectGUID = targetObjectGUID;
|
pkt.TargetObjectGUID = targetObjectGUID;
|
||||||
|
|||||||
Reference in New Issue
Block a user