[7290] Command .npc setdeathstate on/off. Author: GriffonHeart

--HG--
branch : trunk
This commit is contained in:
megamage
2009-02-17 14:51:25 -06:00
parent 1c894bee91
commit d73b38f0fa
7 changed files with 44 additions and 2 deletions

View File

@@ -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;
}