[7290] Command .npc setdeathstate on/off.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
GriffonHeart 2009-02-17 13:31:30 +03:00 committed by VladimirMangos
parent 25a57cca18
commit 74fdc7bee7
8 changed files with 45 additions and 2 deletions

View file

@ -4301,3 +4301,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;
}