aboutsummaryrefslogtreecommitdiff
path: root/src/game/Level2.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-02-17 14:51:25 -0600
committermegamage <none@none>2009-02-17 14:51:25 -0600
commitd73b38f0fa09b68489c8407dee59804272ce9dd8 (patch)
tree80efe2adf4d248b79c3999307c4e10382d38bb38 /src/game/Level2.cpp
parent1c894bee918b1b5e50c49d91e80bb09446dc84e3 (diff)
[7290] Command .npc setdeathstate on/off. Author: GriffonHeart
--HG-- branch : trunk
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;
+}
+