mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 17:49:10 +00:00
feat(Commands): Added cheat commands (#1412)
This commit is contained in:
committed by
Francesco Borzì
parent
e659ca5fe9
commit
40f68ab026
@@ -80,7 +80,6 @@ public:
|
||||
{ "saveall", SEC_GAMEMASTER, true, &HandleSaveAllCommand, "" },
|
||||
{ "kick", SEC_GAMEMASTER, true, &HandleKickPlayerCommand, "" },
|
||||
{ "unstuck", SEC_GAMEMASTER, true, &HandleUnstuckCommand, "" },
|
||||
{ "taxicheat", SEC_GAMEMASTER, false, &HandleTaxiCheatCommand, "" },
|
||||
{ "linkgrave", SEC_ADMINISTRATOR, false, &HandleLinkGraveCommand, "" },
|
||||
{ "neargrave", SEC_GAMEMASTER, false, &HandleNearGraveCommand, "" },
|
||||
{ "explorecheat", SEC_ADMINISTRATOR, false, &HandleExploreCheatCommand, "" },
|
||||
@@ -105,7 +104,6 @@ public:
|
||||
{ "combatstop", SEC_GAMEMASTER, true, &HandleCombatStopCommand, "" },
|
||||
{ "flusharenapoints", SEC_ADMINISTRATOR, false, &HandleFlushArenaPointsCommand, "" },
|
||||
{ "repairitems", SEC_GAMEMASTER, true, &HandleRepairitemsCommand, "" },
|
||||
{ "waterwalk", SEC_GAMEMASTER, false, &HandleWaterwalkCommand, "" },
|
||||
{ "freeze", SEC_GAMEMASTER, false, &HandleFreezeCommand, "" },
|
||||
{ "unfreeze", SEC_GAMEMASTER, false, &HandleUnFreezeCommand, "" },
|
||||
{ "group", SEC_GAMEMASTER, false, nullptr, "", groupCommandTable },
|
||||
@@ -1201,49 +1199,6 @@ public:
|
||||
return false;
|
||||
|
||||
}
|
||||
// Enable on\off all taxi paths
|
||||
static bool HandleTaxiCheatCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
{
|
||||
handler->SendSysMessage(LANG_USE_BOL);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string argStr = (char*)args;
|
||||
|
||||
Player* chr = handler->getSelectedPlayer();
|
||||
|
||||
if (!chr)
|
||||
chr = handler->GetSession()->GetPlayer();
|
||||
else if (handler->HasLowerSecurity(chr, 0)) // check online security
|
||||
return false;
|
||||
|
||||
if (argStr == "on")
|
||||
{
|
||||
chr->SetTaxiCheater(true);
|
||||
handler->PSendSysMessage(LANG_YOU_GIVE_TAXIS, handler->GetNameLink(chr).c_str());
|
||||
if (handler->needReportToTarget(chr))
|
||||
ChatHandler(chr->GetSession()).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, handler->GetNameLink().c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
if (argStr == "off")
|
||||
{
|
||||
chr->SetTaxiCheater(false);
|
||||
handler->PSendSysMessage(LANG_YOU_REMOVE_TAXIS, handler->GetNameLink(chr).c_str());
|
||||
if (handler->needReportToTarget(chr))
|
||||
ChatHandler(chr->GetSession()).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, handler->GetNameLink().c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
handler->SendSysMessage(LANG_USE_BOL);
|
||||
handler->SetSentErrorMessage(true);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool HandleLinkGraveCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
@@ -1392,9 +1347,9 @@ public:
|
||||
for (uint8 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i)
|
||||
{
|
||||
if (flag != 0)
|
||||
handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0xFFFFFFFF);
|
||||
handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1 + i, 0xFFFFFFFF);
|
||||
else
|
||||
handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0);
|
||||
handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1 + i, 0);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -2608,39 +2563,6 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleWaterwalkCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
Player* player = handler->getSelectedPlayer();
|
||||
if (!player)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
// check online security
|
||||
if (handler->HasLowerSecurity(player, 0))
|
||||
return false;
|
||||
|
||||
if (strncmp(args, "on", 3) == 0)
|
||||
player->SetMovement(MOVE_WATER_WALK); // ON
|
||||
else if (strncmp(args, "off", 4) == 0)
|
||||
player->SetMovement(MOVE_LAND_WALK); // OFF
|
||||
else
|
||||
{
|
||||
handler->SendSysMessage(LANG_USE_BOL);
|
||||
return false;
|
||||
}
|
||||
|
||||
handler->PSendSysMessage(LANG_YOU_SET_WATERWALK, args, handler->GetNameLink(player).c_str());
|
||||
if (handler->needReportToTarget(player))
|
||||
ChatHandler(player->GetSession()).PSendSysMessage(LANG_YOUR_WATERWALK_SET, args, handler->GetNameLink().c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
// Send mail by command
|
||||
static bool HandleSendMailCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user