mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 09:39:11 +00:00
fix(Core/Command): cheat explore (#2862)
Co-authored-by: P-Kito <p-kito@users.noreply.github.com>
This commit is contained in:
@@ -24,6 +24,7 @@ public:
|
||||
{ "waterwalk", SEC_GAMEMASTER, false, &HandleWaterwalkCheatCommand, "" },
|
||||
{ "status", SEC_GAMEMASTER, false, &HandleCheatStatusCommand, "" },
|
||||
{ "taxi", SEC_GAMEMASTER, false, &HandleTaxiCheatCommand, "" },
|
||||
{ "explore", SEC_GAMEMASTER, false, &HandleExploreCheatCommand, "" },
|
||||
|
||||
};
|
||||
|
||||
@@ -184,7 +185,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static bool HandleTaxiCheatCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
std::string argStr = (char*)args;
|
||||
@@ -222,6 +223,39 @@ public:
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool HandleExploreCheatCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
int flag = atoi((char*)args);
|
||||
|
||||
Player* target = handler->getSelectedPlayerOrSelf();
|
||||
|
||||
for (uint8 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i)
|
||||
{
|
||||
if (flag != 0)
|
||||
target->SetFlag(PLAYER_EXPLORED_ZONES_1 + i, 0xFFFFFFFF);
|
||||
else
|
||||
target->RemoveFlag(PLAYER_EXPLORED_ZONES_1 + i, 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
if (flag != 0)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, handler->GetNameLink(target).c_str());
|
||||
if (handler->needReportToTarget(target))
|
||||
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL, handler->GetNameLink().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, handler->GetNameLink(target).c_str());
|
||||
if (handler->needReportToTarget(target))
|
||||
ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING, handler->GetNameLink().c_str());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_cheat_commandscript()
|
||||
|
||||
Reference in New Issue
Block a user