[7290] Command .npc setdeathstate on/off. Author: GriffonHeart
--HG-- branch : trunk
This commit is contained in:
@@ -468,6 +468,8 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{ "yell", SEC_MODERATOR, false, &ChatHandler::HandleNpcYellCommand, "", NULL },
|
||||
{ "addtemp", SEC_GAMEMASTER, false, &ChatHandler::HandleTempAddSpwCommand, "", NULL },
|
||||
{ "addformation", SEC_MODERATOR, false, &ChatHandler::HandleNpcAddFormationCommand, "", NULL },
|
||||
{ "tame", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcTameCommand, "", NULL },
|
||||
{ "setdeathstate", SEC_GAMEMASTER, false, &ChatHandler::HandleNpcSetDeathStateCommand, "", NULL },
|
||||
|
||||
//{ TODO: fix or remove this commands
|
||||
{ "name", SEC_GAMEMASTER, false, &ChatHandler::HandleNameCommand, "", NULL },
|
||||
|
||||
@@ -208,6 +208,7 @@ class ChatHandler
|
||||
bool HandleNpcWhisperCommand(const char* args);
|
||||
bool HandleNpcYellCommand(const char* args);
|
||||
bool HandleNpcAddFormationCommand(const char* args);
|
||||
bool HandleNpcSetDeathStateCommand(const char* args);
|
||||
|
||||
bool HandleReloadAllCommand(const char* args);
|
||||
bool HandleReloadAllAreaCommand(const char* args);
|
||||
|
||||
@@ -642,6 +642,8 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
||||
uint32 GetFormationID(){return m_formationID;}
|
||||
|
||||
Unit *SelectVictim();
|
||||
void SetDeadByDefault (bool death_state) {m_isDeadByDefault = death_state;}
|
||||
|
||||
protected:
|
||||
bool CreateFromProto(uint32 guidlow,uint32 Entry,uint32 team, const CreatureData *data = NULL);
|
||||
bool InitEntry(uint32 entry, uint32 team=ALLIANCE, const CreatureData* data=NULL);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7289"
|
||||
#define REVISION_NR "7290"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
||||
Reference in New Issue
Block a user