feat(Core/Commands): Debug Spell Visuals Command (#12216)

* feat(Core/Commands): Debug Spell Visuals Command

* feat(DB/Commands): Debug Visual Help

* Add missing eol at eof
This commit is contained in:
Kempec Halk
2022-07-06 03:55:37 +02:00
committed by GitHub
parent 8854117a28
commit c93fb05515
2 changed files with 28 additions and 1 deletions

View File

@@ -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<uint32> failArg1, Optional<uint32> failArg2)
{
WorldPacket data(SMSG_CAST_FAILED, 5);