mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 13:16:23 +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;
|
||||
|
||||
@@ -523,7 +523,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
creature->SetUInt32Value(UNIT_NPC_FLAGS, NPCFlags(npcFlags));
|
||||
creature->ReplaceAllNpcFlags(NPCFlags(npcFlags));
|
||||
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_NPCFLAG);
|
||||
|
||||
@@ -588,7 +588,7 @@ public:
|
||||
|
||||
CreatureTemplate const* cInfo = target->GetCreatureTemplate();
|
||||
uint32 faction = target->GetFaction();
|
||||
uint32 npcflags = target->GetUInt32Value(UNIT_NPC_FLAGS);
|
||||
uint32 npcflags = target->GetNpcFlags();
|
||||
uint32 mechanicImmuneMask = cInfo->MechanicImmuneMask;
|
||||
uint32 spellSchoolImmuneMask = cInfo->SpellSchoolImmuneMask;
|
||||
uint32 displayid = target->GetDisplayId();
|
||||
|
||||
Reference in New Issue
Block a user