mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/Commands: Implemented .debug play objectsound command
This commit is contained in:
3
sql/updates/world/master/2023_08_13_01_world.sql
Normal file
3
sql/updates/world/master/2023_08_13_01_world.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
DELETE FROM `command` WHERE `name`='debug play objectsound';
|
||||
INSERT INTO `command` (`name`, `help`) VALUES
|
||||
('debug play objectsound', 'Syntax: .debug play objectsound #soundKitId [#broadcastTextId]\nPlay object sound with #soundKitId [and #broadcastTextId].\nSound will be played only for you. Other players will not hear this.');
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user