diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 15fc25638..ea5250fff 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -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) {