diff --git a/src/game/Chat/Chat.cpp b/src/game/Chat/Chat.cpp index d2b202416a..eac1ec5147 100644 --- a/src/game/Chat/Chat.cpp +++ b/src/game/Chat/Chat.cpp @@ -546,6 +546,7 @@ ChatCommand* ChatHandler::getCommandTable() { "showloot", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcShowLootCommand, "", nullptr }, { "tempspawn", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcTempSpawn, "", nullptr }, { "evade", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcEvade, "", nullptr }, + { "despawn", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcDespawn, "", nullptr }, { "formation", SEC_GAMEMASTER, false, nullptr, "", npcFormationCommandTable }, { "group", SEC_GAMEMASTER, false, nullptr, "", npcGroupCommandTable }, diff --git a/src/game/Chat/Chat.h b/src/game/Chat/Chat.h index 603fafcded..d2e925783c 100644 --- a/src/game/Chat/Chat.h +++ b/src/game/Chat/Chat.h @@ -489,6 +489,7 @@ class ChatHandler bool HandleNpcYellCommand(char* args); bool HandleNpcTempSpawn(char* args); bool HandleNpcEvade(char* args); + bool HandleNpcDespawn(char* args); bool HandleNpcGroupInfoCommand(char* args); //bool HandleNpcGroupBehaviorShowCommand(char* args); //bool HandleNpcGroupBehaviorSetCommand(char* args); diff --git a/src/game/Chat/Level2.cpp b/src/game/Chat/Level2.cpp index f1a6e03078..7122940193 100644 --- a/src/game/Chat/Level2.cpp +++ b/src/game/Chat/Level2.cpp @@ -1700,6 +1700,21 @@ bool ChatHandler::HandleNpcEvade(char* /*args*/) return true; } +bool ChatHandler::HandleNpcDespawn(char* /*args*/) +{ + Creature* target = getSelectedCreature(); + + if (!target) + { + SendSysMessage(LANG_SELECT_CREATURE); + SetSentErrorMessage(true); + return false; + } + + target->ForcedDespawn(); + return true; +} + // add item in vendorlist bool ChatHandler::HandleNpcAddVendorItemCommand(char* args) {