mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 01:59:09 +00:00
feat(Core/Unit): NPCFlags helpers (#11286)
* cherry-pick commit (TrinityCore/TrinityCore@d611925) Co-Authored-By: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
@@ -266,7 +266,7 @@ public:
|
||||
{
|
||||
uint32 factionid = target->GetFaction();
|
||||
uint32 flag = target->GetUnitFlags();
|
||||
uint32 npcflag = target->GetUInt32Value(UNIT_NPC_FLAGS);
|
||||
uint32 npcflag = target->GetNpcFlags();
|
||||
uint32 dyflag = target->GetDynamicFlags();
|
||||
handler->PSendSysMessage(LANG_CURRENT_FACTION, target->GetGUID().GetCounter(), factionid, flag, npcflag, dyflag);
|
||||
return true;
|
||||
@@ -274,7 +274,7 @@ public:
|
||||
|
||||
uint32 factionid = factionID.value();
|
||||
UnitFlags flag;
|
||||
uint32 npcflag;
|
||||
NPCFlags npcflag;
|
||||
uint32 dyflag;
|
||||
|
||||
auto pflag = flagID;
|
||||
@@ -285,9 +285,9 @@ public:
|
||||
|
||||
auto pnpcflag = npcFlagID;
|
||||
if (!pnpcflag)
|
||||
npcflag = target->GetUInt32Value(UNIT_NPC_FLAGS);
|
||||
npcflag = target->GetNpcFlags();
|
||||
else
|
||||
npcflag = *npcFlagID;
|
||||
npcflag = NPCFlags(*npcFlagID);
|
||||
|
||||
auto pdyflag = dynamicFlagID;
|
||||
if (!pdyflag)
|
||||
@@ -306,7 +306,7 @@ public:
|
||||
|
||||
target->SetFaction(factionid);
|
||||
target->ReplaceAllUnitFlags(flag);
|
||||
target->SetUInt32Value(UNIT_NPC_FLAGS, npcflag);
|
||||
target->ReplaceAllNpcFlags(npcflag);
|
||||
target->ReplaceAllDynamicFlags(dyflag);
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user