aboutsummaryrefslogtreecommitdiff
path: root/src/game/Level2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Level2.cpp')
-rw-r--r--src/game/Level2.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index 8d560783d89..05af6cbcbfe 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -4495,3 +4495,34 @@ bool ChatHandler::HandleGOPhaseCommand(const char* args)
obj->SaveToDB();
return true;
}
+
+bool ChatHandler::HandleNpcSetDeathStateCommand(const char* args)
+{
+ if (!*args)
+ return false;
+
+ Creature* pCreature = getSelectedCreature();
+ if(!pCreature || pCreature->isPet())
+ {
+ SendSysMessage(LANG_SELECT_CREATURE);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (strncmp(args, "on", 3) == 0)
+ pCreature->SetDeadByDefault(true);
+ else if (strncmp(args, "off", 4) == 0)
+ pCreature->SetDeadByDefault(false);
+ else
+ {
+ SendSysMessage(LANG_USE_BOL);
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ pCreature->SaveToDB();
+ pCreature->Respawn();
+
+ return true;
+}
+