feat(Core/Unit): New helpers for UnitFlag and UnitFlag2 (#11227)

This commit is contained in:
Kitzunu
2022-03-30 12:59:42 +02:00
committed by GitHub
parent 54c06eb72e
commit 856aed6fc6
243 changed files with 1205 additions and 1191 deletions

View File

@@ -265,7 +265,7 @@ public:
if (!factionID)
{
uint32 factionid = target->GetFaction();
uint32 flag = target->GetUInt32Value(UNIT_FIELD_FLAGS);
uint32 flag = target->GetUnitFlags();
uint32 npcflag = target->GetUInt32Value(UNIT_NPC_FLAGS);
uint32 dyflag = target->GetUInt32Value(UNIT_DYNAMIC_FLAGS);
handler->PSendSysMessage(LANG_CURRENT_FACTION, target->GetGUID().GetCounter(), factionid, flag, npcflag, dyflag);
@@ -273,15 +273,15 @@ public:
}
uint32 factionid = factionID.value();
uint32 flag;
UnitFlags flag;
uint32 npcflag;
uint32 dyflag;
auto pflag = flagID;
if (!pflag)
flag = target->GetUInt32Value(UNIT_FIELD_FLAGS);
flag = target->GetUnitFlags();
else
flag = *pflag;
flag = UnitFlags(*pflag);
auto pnpcflag = npcFlagID;
if (!pnpcflag)
@@ -305,7 +305,7 @@ public:
handler->PSendSysMessage(LANG_YOU_CHANGE_FACTION, target->GetGUID().GetCounter(), factionid, flag, npcflag, dyflag);
target->SetFaction(factionid);
target->SetUInt32Value(UNIT_FIELD_FLAGS, flag);
target->ReplaceAllUnitFlags(flag);
target->SetUInt32Value(UNIT_NPC_FLAGS, npcflag);
target->SetUInt32Value(UNIT_DYNAMIC_FLAGS, dyflag);

View File

@@ -614,7 +614,7 @@ public:
handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->getLevel());
handler->PSendSysMessage(LANG_NPCINFO_EQUIPMENT, target->GetCurrentEquipmentId(), target->GetOriginalEquipmentId());
handler->PSendSysMessage(LANG_NPCINFO_HEALTH, target->GetCreateHealth(), target->GetMaxHealth(), target->GetHealth());
handler->PSendSysMessage(LANG_NPCINFO_FLAGS, target->GetUInt32Value(UNIT_FIELD_FLAGS), target->GetUInt32Value(UNIT_FIELD_FLAGS_2), target->GetUInt32Value(UNIT_DYNAMIC_FLAGS), target->GetFaction());
handler->PSendSysMessage(LANG_NPCINFO_FLAGS, target->GetUnitFlags(), target->GetUnitFlags2(), target->GetUInt32Value(UNIT_DYNAMIC_FLAGS), target->GetFaction());
handler->PSendSysMessage(LANG_COMMAND_RAWPAWNTIMES, defRespawnDelayStr.c_str(), curRespawnDelayStr.c_str());
handler->PSendSysMessage(LANG_NPCINFO_LOOT, cInfo->lootid, cInfo->pickpocketLootId, cInfo->SkinLootId);
handler->PSendSysMessage(LANG_NPCINFO_DUNGEON_ID, target->GetInstanceId());

View File

@@ -116,7 +116,7 @@ public:
player->SetByteValue(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP);
player->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
player->ReplaceAllUnitFlags(UNIT_FLAG_PLAYER_CONTROLLED);
//-1 is default value
player->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, uint32(-1));