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:
Kitzunu
2022-04-05 13:52:42 +02:00
committed by GitHub
parent e2370446a5
commit edb7cac19b
75 changed files with 293 additions and 285 deletions

View File

@@ -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;