mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
feat(Core/Command): add GM spectator to allow cross-faction /follow (#22393)
This commit is contained in:
@@ -38,13 +38,14 @@ public:
|
||||
{
|
||||
static ChatCommandTable gmCommandTable =
|
||||
{
|
||||
{ "chat", HandleGMChatCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "fly", HandleGMFlyCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "ingame", HandleGMListIngameCommand, SEC_PLAYER, Console::Yes },
|
||||
{ "list", HandleGMListFullCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "visible", HandleGMVisibleCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "on", HandleGMOnCommand, SEC_MODERATOR, Console::No },
|
||||
{ "off", HandleGMOffCommand, SEC_MODERATOR, Console::No }
|
||||
{ "chat", HandleGMChatCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "fly", HandleGMFlyCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "ingame", HandleGMListIngameCommand, SEC_PLAYER, Console::Yes },
|
||||
{ "list", HandleGMListFullCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "visible", HandleGMVisibleCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "on", HandleGMOnCommand, SEC_MODERATOR, Console::No },
|
||||
{ "off", HandleGMOffCommand, SEC_MODERATOR, Console::No },
|
||||
{ "spectator", HandleGMSpectatorCommand, SEC_GAMEMASTER, Console::No },
|
||||
};
|
||||
static ChatCommandTable commandTable =
|
||||
{
|
||||
@@ -236,6 +237,19 @@ public:
|
||||
handler->SendNotification(LANG_GM_OFF);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleGMSpectatorCommand(ChatHandler* handler, Optional<bool> enable)
|
||||
{
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
|
||||
if (enable.has_value())
|
||||
player->SetGMSpectator(*enable);
|
||||
else
|
||||
player->SetGMSpectator(!player->IsGMSpectator());
|
||||
handler->SendNotification(player->IsGMSpectator() ? LANG_GM_SPECTATOR_ON : LANG_GM_SPECTATOR_OFF);
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_gm_commandscript()
|
||||
|
||||
Reference in New Issue
Block a user