diff options
author | ModoX <moardox@gmail.com> | 2023-08-13 23:59:05 +0200 |
---|---|---|
committer | ModoX <moardox@gmail.com> | 2023-08-14 00:00:13 +0200 |
commit | 95893cf53cdc9ab2ca3ec26cfd85793e63e97317 (patch) | |
tree | 91294b0823bb476541274d3f01812d29848246e8 /src | |
parent | 35e5da37bdbbac355e454c5cbabe5991b7966709 (diff) |
Scripts/Commands: Implemented .debug play objectsound command
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Commands/cs_debug.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index dfd774b67e7..a1ea6538dd2 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -75,6 +75,7 @@ public: { "movie", HandleDebugPlayMovieCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No }, { "sound", HandleDebugPlaySoundCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No }, { "music", HandleDebugPlayMusicCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No }, + { "objectsound", HandleDebugPlayObjectSoundCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No }, }; static ChatCommandTable debugSendCommandTable = { @@ -273,6 +274,23 @@ public: return true; } + static bool HandleDebugPlayObjectSoundCommand(ChatHandler* handler, int32 soundKitId, Optional<int32> broadcastTextId) + { + if (!sSoundKitStore.LookupEntry(soundKitId)) + { + handler->PSendSysMessage(LANG_SOUND_NOT_EXIST, soundKitId); + handler->SetSentErrorMessage(true); + return false; + } + + Player* player = handler->GetPlayer(); + + player->PlayObjectSound(soundKitId, player->GetGUID(), player, broadcastTextId.has_value() ? *broadcastTextId : 0); + + handler->PSendSysMessage(LANG_YOU_HEAR_SOUND, soundKitId); + return true; + } + static bool HandleDebugSendSpellFailCommand(ChatHandler* handler, SpellCastResult result, Optional<int32> failArg1, Optional<int32> failArg2) { WorldPackets::Spells::CastFailed castFailed; |