summaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_gobject.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp
index b44ccd4d06..499d5f72f3 100644
--- a/src/server/scripts/Commands/cs_gobject.cpp
+++ b/src/server/scripts/Commands/cs_gobject.cpp
@@ -15,13 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/* ScriptData
-Name: gobject_commandscript
-%Complete: 100
-Comment: All gobject related commands
-Category: commandscripts
-EndScriptData */
-
#include "Chat.h"
#include "CommandScript.h"
#include "GameEventMgr.h"
@@ -59,7 +52,8 @@ public:
{ "add temp", HandleGameObjectAddTempCommand, SEC_GAMEMASTER, Console::No },
{ "add", HandleGameObjectAddCommand, SEC_ADMINISTRATOR, Console::No },
{ "set phase", HandleGameObjectSetPhaseCommand, SEC_ADMINISTRATOR, Console::No },
- { "set state", HandleGameObjectSetStateCommand, SEC_ADMINISTRATOR, Console::No }
+ { "set state", HandleGameObjectSetStateCommand, SEC_ADMINISTRATOR, Console::No },
+ { "respawn", HandleGameObjectRespawn, SEC_GAMEMASTER, Console::No }
};
static ChatCommandTable commandTable =
{
@@ -581,6 +575,20 @@ public:
handler->PSendSysMessage("Set gobject type %d state %u", objectType, *objectState);
return true;
}
+
+ static bool HandleGameObjectRespawn(ChatHandler* handler, GameObjectSpawnId guidLow)
+ {
+ GameObject* object = handler->GetObjectFromPlayerMapByDbGuid(guidLow);
+ if (!object)
+ {
+ handler->SendErrorMessage(LANG_COMMAND_OBJNOTFOUND, uint32(guidLow));
+ return false;
+ }
+
+ object->Respawn();
+ handler->PSendSysMessage(LANG_CMD_GO_RESPAWN, object->GetNameForLocaleIdx(handler->GetSessionDbcLocale()), object->GetEntry(), object->GetSpawnId());
+ return true;
+ }
};
void AddSC_gobject_commandscript()