mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 10:00:28 +00:00
added two more commands to .npc set
* .npc set tempfactionid (35) - will changed the selected npc faction but will not save it. * .npc set originalFaction - will restore the correct faction from the npc faction template in the DB. closes #706
This commit is contained in:
@@ -135,6 +135,8 @@ public:
|
||||
{ "allowmove", SEC_ADMINISTRATOR, false, &HandleNpcSetAllowMovementCommand, "" },
|
||||
{ "entry", SEC_ADMINISTRATOR, false, &HandleNpcSetEntryCommand, "" },
|
||||
{ "factionid", SEC_ADMINISTRATOR, false, &HandleNpcSetFactionIdCommand, "" },
|
||||
{ "factiontempid", SEC_ADMINISTRATOR, false, &HandleNpcSetFactionTempIdCommand, "" },
|
||||
{ "originalFaction",SEC_ADMINISTRATOR, false, &HandleNpcSetOriginalFaction, "" },
|
||||
{ "flag", SEC_ADMINISTRATOR, false, &HandleNpcSetFlagCommand, "" },
|
||||
{ "level", SEC_ADMINISTRATOR, false, &HandleNpcSetLevelCommand, "" },
|
||||
{ "link", SEC_ADMINISTRATOR, false, &HandleNpcSetLinkCommand, "" },
|
||||
@@ -568,6 +570,44 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
//set tempfaction for creature
|
||||
static bool HandleNpcSetFactionTempIdCommand(ChatHandler* handler, const char* args)
|
||||
{
|
||||
Player* me = handler->GetSession()->GetPlayer();
|
||||
Creature* creature = me->GetSelectedUnit()->ToCreature();
|
||||
|
||||
if (!me)
|
||||
return false;
|
||||
|
||||
if (!creature)
|
||||
return false;
|
||||
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
uint32 tempfaction = (uint32)atoi((char*)args);
|
||||
|
||||
creature->setFaction(tempfaction);
|
||||
return true;
|
||||
}
|
||||
|
||||
//set orginal faction for npc
|
||||
static bool HandleNpcSetOriginalFaction(ChatHandler* handler, const char* args)
|
||||
{
|
||||
Player* me = handler->GetSession()->GetPlayer();
|
||||
Creature* creature = me->GetSelectedUnit()->ToCreature();
|
||||
|
||||
if (!me)
|
||||
return false;
|
||||
|
||||
if (!creature)
|
||||
return false;
|
||||
|
||||
creature->RestoreFaction();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//set npcflag of creature
|
||||
static bool HandleNpcSetFlagCommand(ChatHandler* handler, const char* args)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user