mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 10:55:43 +00:00
feat(Scripts/Spells): GM utility spells and Beastmaster Mode (#22964)
Co-authored-by: ratkosrb <ratkomladic2@abv.bg>
This commit is contained in:
@@ -193,7 +193,8 @@ public:
|
||||
{ "skirmish", HandleSkirmishCommand, SEC_ADMINISTRATOR, Console::No },
|
||||
{ "mailbox", HandleMailBoxCommand, SEC_MODERATOR, Console::No },
|
||||
{ "string", HandleStringCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "opendoor", HandleOpenDoorCommand, SEC_GAMEMASTER, Console::No }
|
||||
{ "opendoor", HandleOpenDoorCommand, SEC_GAMEMASTER, Console::No },
|
||||
{ "bm", HandleBMCommand, SEC_GAMEMASTER, Console::No }
|
||||
};
|
||||
|
||||
return commandTable;
|
||||
@@ -504,6 +505,7 @@ public:
|
||||
|
||||
if (!session)
|
||||
{
|
||||
handler->SendErrorMessage(LANG_USE_BOL);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -537,9 +539,6 @@ public:
|
||||
SetCommentatorMod(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
handler->SendErrorMessage(LANG_USE_BOL);
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool HandleDevCommand(ChatHandler* handler, Optional<bool> enableArg)
|
||||
@@ -548,6 +547,7 @@ public:
|
||||
|
||||
if (!session)
|
||||
{
|
||||
handler->SendErrorMessage(LANG_USE_BOL);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -582,9 +582,6 @@ public:
|
||||
SetDevMod(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
handler->SendErrorMessage(LANG_USE_BOL);
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool HandleGPSCommand(ChatHandler* handler, Optional<PlayerIdentifier> target)
|
||||
@@ -3069,6 +3066,48 @@ public:
|
||||
handler->SendErrorMessage(LANG_CMD_NO_DOOR_FOUND, range ? *range : 5.0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool HandleBMCommand(ChatHandler* handler, Optional<bool> enableArg)
|
||||
{
|
||||
WorldSession* session = handler->GetSession();
|
||||
|
||||
if (!session)
|
||||
return false;
|
||||
|
||||
auto SetBMMod = [&](bool enable)
|
||||
{
|
||||
char const* enabled = "ON";
|
||||
char const* disabled = "OFF";
|
||||
handler->SendNotification(LANG_COMMAND_BEASTMASTER_MODE, enable ? enabled : disabled);
|
||||
|
||||
session->GetPlayer()->SetBeastMaster(enable);
|
||||
};
|
||||
|
||||
if (!enableArg)
|
||||
{
|
||||
if (!AccountMgr::IsPlayerAccount(session->GetSecurity()) && session->GetPlayer()->IsDeveloper())
|
||||
SetBMMod(true);
|
||||
else
|
||||
SetBMMod(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (*enableArg)
|
||||
{
|
||||
SetBMMod(true);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetBMMod(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
handler->SendErrorMessage(LANG_USE_BOL);
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
void AddSC_misc_commandscript()
|
||||
|
||||
Reference in New Issue
Block a user