mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[7290] Command .npc setdeathstate on/off.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
25a57cca18
commit
74fdc7bee7
8 changed files with 45 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue