feat(Core/Command): Split respawn command (#11245)

* feat(Core/Command): Split respawn command

* feat(Core/Command): Split respawn command

* typo
This commit is contained in:
Nefertumm
2022-04-02 11:48:04 -03:00
committed by GitHub
parent 0ef2781ede
commit 883becc6d9
2 changed files with 16 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1648810356834040900');
DELETE FROM `command` WHERE `name` IN ('respawn', 'respawn all');
INSERT INTO `command` (`name`, `security`, `help`) VALUES
('respawn', 2, 'Syntax: .respawn\nRespawn the selected unit without waiting respawn time expiration.'),
('respawn all', 2, 'Syntax: .respawn all\nRespawn all nearest creatures and GO without waiting respawn time expiration.');

View File

@@ -119,6 +119,7 @@ public:
{ "setskill", HandleSetSkillCommand, SEC_GAMEMASTER, Console::No },
{ "pinfo", HandlePInfoCommand, SEC_GAMEMASTER, Console::Yes },
{ "respawn", HandleRespawnCommand, SEC_GAMEMASTER, Console::No },
{ "respawn all", HandleRespawnAllCommand, SEC_GAMEMASTER, Console::No },
{ "mute", HandleMuteCommand, SEC_GAMEMASTER, Console::Yes },
{ "mutehistory", HandleMuteInfoCommand, SEC_GAMEMASTER, Console::Yes },
{ "unmute", HandleUnmuteCommand, SEC_GAMEMASTER, Console::Yes },
@@ -2333,7 +2334,6 @@ public:
{
Player* player = handler->GetSession()->GetPlayer();
// accept only explicitly selected target (not implicitly self targeting case)
Unit* target = handler->getSelectedUnit();
if (player->GetTarget() && target)
{
@@ -2351,6 +2351,15 @@ public:
return true;
}
handler->SendSysMessage(LANG_SELECT_CREATURE);
handler->SetSentErrorMessage(true);
return false;
}
static bool HandleRespawnAllCommand(ChatHandler* handler)
{
Player* player = handler->GetSession()->GetPlayer();
CellCoord p(Acore::ComputeCellCoord(player->GetPositionX(), player->GetPositionY()));
Cell cell(p);
cell.SetNoCreate();