diff --git a/data/sql/updates/pending_db_world/rev_1656377467861686900.sql b/data/sql/updates/pending_db_world/rev_1656377467861686900.sql new file mode 100644 index 000000000..a5e89a128 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1656377467861686900.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `command` WHERE `name` = 'debug play visual'; +INSERT INTO `command` (`name`, `security`, `help`) VALUES +('debug play visual', 3, 'Syntax: .debug play visual #visualid\r\nPlay spell visual with #visualid.\n#visualid refers to the ID from SpellVisualKit.dbc'); diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index a5cf1b9fa..e0c12e927 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -58,7 +58,8 @@ public: { "cinematic", HandleDebugPlayCinematicCommand, SEC_ADMINISTRATOR, Console::No }, { "movie", HandleDebugPlayMovieCommand, SEC_ADMINISTRATOR, Console::No }, { "sound", HandleDebugPlaySoundCommand, SEC_ADMINISTRATOR, Console::No }, - { "music", HandleDebugPlayMusicCommand, SEC_ADMINISTRATOR, Console::No } + { "music", HandleDebugPlayMusicCommand, SEC_ADMINISTRATOR, Console::No }, + { "visual", HandleDebugVisualCommand, SEC_ADMINISTRATOR, Console::No } }; static ChatCommandTable debugSendCommandTable = { @@ -203,6 +204,28 @@ public: return true; } + static bool HandleDebugVisualCommand(ChatHandler* handler, uint32 visualId) + { + if (!visualId) + { + handler->SendSysMessage(LANG_BAD_VALUE); + handler->SetSentErrorMessage(true); + return false; + } + + Player* player = handler->GetPlayer(); + Unit* target = handler->getSelectedUnit(); + + if (!target) + { + player->SendPlaySpellVisual(visualId); + return true; + } + + player->SendPlaySpellImpact(target->GetGUID(), visualId); + return true; + } + static bool HandleDebugSendSpellFailCommand(ChatHandler* handler, SpellCastResult result, Optional failArg1, Optional failArg2) { WorldPacket data(SMSG_CAST_FAILED, 5);