Merge branch 'azerothcore:master' into Playerbot
This commit is contained in:
@@ -53,7 +53,7 @@ namespace FactorySelector
|
||||
ai_factory = ai_registry.GetRegistryItem("VehicleAI");
|
||||
else if (creature->HasUnitTypeMask(UNIT_MASK_CONTROLABLE_GUARDIAN) && ((Guardian*)creature)->GetOwner()->GetTypeId() == TYPEID_PLAYER)
|
||||
ai_factory = ai_registry.GetRegistryItem("PetAI");
|
||||
else if (creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK))
|
||||
else if (creature->HasNpcFlag(UNIT_NPC_FLAG_SPELLCLICK))
|
||||
ai_factory = ai_registry.GetRegistryItem("NullCreatureAI");
|
||||
else if (creature->IsGuard())
|
||||
ai_factory = ai_registry.GetRegistryItem("GuardAI");
|
||||
|
||||
@@ -496,7 +496,7 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
|
||||
}
|
||||
|
||||
//disable npcflags
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE);
|
||||
if (me->HasUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC))
|
||||
{
|
||||
HasImmuneToNPCFlags = true;
|
||||
|
||||
@@ -293,7 +293,7 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu
|
||||
LOG_DEBUG("scripts.ai", "FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle.");
|
||||
}
|
||||
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE);
|
||||
|
||||
AddFollowState(STATE_FOLLOW_INPROGRESS);
|
||||
|
||||
|
||||
@@ -199,8 +199,8 @@ void SmartAI::StartPath(bool run, uint32 path, bool repeat, Unit* invoker)
|
||||
|
||||
if (invoker && invoker->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
mEscortNPCFlags = me->GetUInt32Value(UNIT_NPC_FLAGS);
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, 0);
|
||||
mEscortNPCFlags = me->GetNpcFlags();
|
||||
me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE);
|
||||
}
|
||||
|
||||
Movement::PointsArray pathPoints;
|
||||
@@ -287,7 +287,7 @@ void SmartAI::EndPath(bool fail)
|
||||
|
||||
if (mEscortNPCFlags)
|
||||
{
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, mEscortNPCFlags);
|
||||
me->ReplaceAllNpcFlags(NPCFlags(mEscortNPCFlags));
|
||||
mEscortNPCFlags = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -2167,7 +2167,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
if (IsCreature(*itr))
|
||||
(*itr)->ToUnit()->SetUInt32Value(UNIT_NPC_FLAGS, e.action.flag.flag);
|
||||
(*itr)->ToUnit()->ReplaceAllNpcFlags(NPCFlags(e.action.flag.flag));
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
@@ -2180,7 +2180,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
if (IsCreature(*itr))
|
||||
(*itr)->ToUnit()->SetFlag(UNIT_NPC_FLAGS, e.action.flag.flag);
|
||||
(*itr)->ToUnit()->SetNpcFlag(NPCFlags(e.action.flag.flag));
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
@@ -2193,7 +2193,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
if (IsCreature(*itr))
|
||||
(*itr)->ToUnit()->RemoveFlag(UNIT_NPC_FLAGS, e.action.flag.flag);
|
||||
(*itr)->ToUnit()->RemoveNpcFlag(NPCFlags(e.action.flag.flag));
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
@@ -2680,7 +2680,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
if (IsGameObject(*itr))
|
||||
(*itr)->ToGameObject()->SetUInt32Value(GAMEOBJECT_FLAGS, e.action.goFlag.flag);
|
||||
(*itr)->ToGameObject()->ReplaceAllGameObjectFlags((GameObjectFlags)e.action.goFlag.flag);
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
@@ -2693,7 +2693,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
if (IsGameObject(*itr))
|
||||
(*itr)->ToGameObject()->SetFlag(GAMEOBJECT_FLAGS, e.action.goFlag.flag);
|
||||
(*itr)->ToGameObject()->SetGameObjectFlag((GameObjectFlags)e.action.goFlag.flag);
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
@@ -2706,7 +2706,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
if (IsGameObject(*itr))
|
||||
(*itr)->ToGameObject()->RemoveFlag(GAMEOBJECT_FLAGS, e.action.goFlag.flag);
|
||||
(*itr)->ToGameObject()->RemoveGameObjectFlag((GameObjectFlags)e.action.goFlag.flag);
|
||||
|
||||
delete targets;
|
||||
break;
|
||||
|
||||
@@ -225,7 +225,7 @@ void BattlefieldWG::OnBattleStart()
|
||||
// Update faction of relic, only attacker can click on
|
||||
go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[GetAttackerTeam()]);
|
||||
// Set in use (not allow to click on before last door is broken)
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
go->SetGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
|
||||
|
||||
// save guid
|
||||
m_titansRelic = go->GetGUID();
|
||||
|
||||
@@ -1208,7 +1208,7 @@ struct BfWGGameObjectBuilding
|
||||
case BATTLEFIELD_WG_OBJECTTYPE_DOOR_LAST:
|
||||
m_WG->SetRelicInteractible(true);
|
||||
if (GameObject* go = m_WG->GetRelic())
|
||||
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
go->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
|
||||
else
|
||||
LOG_ERROR("bg.battlefield", "BattlefieldWG: Relic not found.");
|
||||
break;
|
||||
|
||||
@@ -1077,7 +1077,7 @@ void Battleground::StartBattleground()
|
||||
void Battleground::AddPlayer(Player* player)
|
||||
{
|
||||
// remove afk from player
|
||||
if (player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK))
|
||||
if (player->HasPlayerFlag(PLAYER_FLAGS_AFK))
|
||||
player->ToggleAFK();
|
||||
|
||||
sScriptMgr->OnBattlegroundBeforeAddPlayer(this, player);
|
||||
|
||||
@@ -293,7 +293,7 @@ void BattlegroundIC::StartingEventOpenDoors()
|
||||
DoorOpen(BG_IC_GO_DOODAD_VR_PORTCULLIS01_2);
|
||||
|
||||
for (uint8 i = 0; i < MAX_FORTRESS_TELEPORTERS_SPAWNS; ++i)
|
||||
GetBGObject(BG_IC_Teleporters[i].type)->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
GetBGObject(BG_IC_Teleporters[i].type)->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
|
||||
|
||||
for (uint8 i = 0; i < MAX_FORTRESS_TELEPORTER_EFFECTS_SPAWNS; ++i)
|
||||
GetBGObject(BG_IC_TeleporterEffects[i].type)->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
@@ -125,7 +125,7 @@ void BattlegroundRV::PostUpdateImpl(uint32 diff)
|
||||
uint32 objects[2] = { BG_RV_OBJECT_ELEVATOR_1, BG_RV_OBJECT_ELEVATOR_2 };
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
if (GameObject* go = GetBGObject(objects[i]))
|
||||
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_TRANSPORT);
|
||||
go->RemoveGameObjectFlag(GO_FLAG_TRANSPORT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -853,9 +853,9 @@ void BattlegroundSA::UpdateObjectInteractionFlags(uint32 objectId)
|
||||
if (GameObject* go = GetBGObject(objectId))
|
||||
{
|
||||
if (CanInteractWithObject(objectId))
|
||||
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE | GO_FLAG_INTERACT_COND | GO_FLAG_IN_USE);
|
||||
go->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE | GO_FLAG_INTERACT_COND | GO_FLAG_IN_USE);
|
||||
else
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
go->SetGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -492,9 +492,9 @@ bool Creature::UpdateEntry(uint32 Entry, const CreatureData* data, bool changele
|
||||
ObjectMgr::ChooseCreatureFlags(cInfo, npcflag, unit_flags, dynamicflags, data);
|
||||
|
||||
if (cInfo->flags_extra & CREATURE_FLAG_EXTRA_WORLDEVENT)
|
||||
SetUInt32Value(UNIT_NPC_FLAGS, npcflag | sGameEventMgr->GetNPCFlag(this));
|
||||
ReplaceAllNpcFlags(NPCFlags(npcflag | sGameEventMgr->GetNPCFlag(this)));
|
||||
else
|
||||
SetUInt32Value(UNIT_NPC_FLAGS, npcflag);
|
||||
ReplaceAllNpcFlags(NPCFlags(npcflag));
|
||||
|
||||
// Xinef: NPC is in combat, keep this flag!
|
||||
unit_flags &= ~UNIT_FLAG_IN_COMBAT;
|
||||
@@ -1302,7 +1302,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
||||
data.spawnId = m_spawnId;
|
||||
|
||||
uint32 displayId = GetNativeDisplayId();
|
||||
uint32 npcflag = GetUInt32Value(UNIT_NPC_FLAGS);
|
||||
uint32 npcflag = GetNpcFlags();
|
||||
uint32 unit_flags = GetUnitFlags();
|
||||
uint32 dynamicflags = GetDynamicFlags();
|
||||
|
||||
@@ -1847,7 +1847,7 @@ void Creature::setDeathState(DeathState s, bool despawn)
|
||||
SaveRespawnTime();
|
||||
|
||||
SetTarget(); // remove target selection in any cases (can be set at aura remove in Unit::setDeathState)
|
||||
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE);
|
||||
|
||||
Dismount(); // if creature is mounted on a virtual mount, remove it at death
|
||||
|
||||
@@ -1889,7 +1889,7 @@ void Creature::setDeathState(DeathState s, bool despawn)
|
||||
|
||||
UpdateMovementFlags();
|
||||
|
||||
SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag);
|
||||
ReplaceAllNpcFlags(NPCFlags(cinfo->npcflag));
|
||||
ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~(UNIT_STATE_IGNORE_PATHFINDING | UNIT_STATE_NO_ENVIRONMENT_UPD)));
|
||||
SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool));
|
||||
|
||||
|
||||
@@ -319,7 +319,7 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u
|
||||
if (GameObjectTemplateAddon const* templateAddon = GetTemplateAddon())
|
||||
{
|
||||
SetUInt32Value(GAMEOBJECT_FACTION, templateAddon->faction);
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, templateAddon->flags);
|
||||
ReplaceAllGameObjectFlags((GameObjectFlags)templateAddon->flags);
|
||||
}
|
||||
|
||||
SetEntry(goinfo->entry);
|
||||
@@ -479,7 +479,7 @@ void GameObject::Update(uint32 diff)
|
||||
if (caster && caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
SetGoState(GO_STATE_ACTIVE);
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, GO_FLAG_NODESPAWN);
|
||||
ReplaceAllGameObjectFlags(GO_FLAG_NODESPAWN);
|
||||
|
||||
UpdateData udata;
|
||||
WorldPacket packet;
|
||||
@@ -721,7 +721,7 @@ void GameObject::Update(uint32 diff)
|
||||
case GAMEOBJECT_TYPE_GOOBER:
|
||||
if (GameTime::GetGameTimeMS().count() >= m_cooldownTime)
|
||||
{
|
||||
RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
|
||||
RemoveGameObjectFlag(GO_FLAG_IN_USE);
|
||||
|
||||
SetLootState(GO_JUST_DEACTIVATED);
|
||||
}
|
||||
@@ -826,7 +826,7 @@ void GameObject::Update(uint32 diff)
|
||||
SendObjectDeSpawnAnim(GetGUID());
|
||||
//reset flags
|
||||
if (GameObjectTemplateAddon const* addon = GetTemplateAddon())
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, addon->flags);
|
||||
ReplaceAllGameObjectFlags((GameObjectFlags)addon->flags);
|
||||
}
|
||||
|
||||
if (!m_respawnDelayTime)
|
||||
@@ -908,7 +908,7 @@ void GameObject::DespawnOrUnsummon(Milliseconds delay, Seconds forceRespawnTime)
|
||||
|
||||
if (GameObjectTemplateAddon const* addon = GetTemplateAddon())
|
||||
{
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, addon->flags);
|
||||
ReplaceAllGameObjectFlags((GameObjectFlags)addon->flags);
|
||||
}
|
||||
|
||||
uint32 poolid = m_spawnId ? sPoolMgr->IsPartOfAPool<GameObject>(m_spawnId) : 0;
|
||||
@@ -930,7 +930,7 @@ void GameObject::Delete()
|
||||
SetGoState(GO_STATE_READY);
|
||||
|
||||
if (GameObjectTemplateAddon const* addon = GetTemplateAddon())
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, addon->flags);
|
||||
ReplaceAllGameObjectFlags((GameObjectFlags)addon->flags);
|
||||
|
||||
// Xinef: if ritual gameobject is removed, clear anim spells
|
||||
if (GetGOInfo()->type == GAMEOBJECT_TYPE_SUMMONING_RITUAL)
|
||||
@@ -1097,7 +1097,7 @@ bool GameObject::LoadGameObjectFromDB(ObjectGuid::LowType spawnId, Map* map, boo
|
||||
|
||||
if (!GetGOInfo()->GetDespawnPossibility() && !GetGOInfo()->IsDespawnAtAction())
|
||||
{
|
||||
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NODESPAWN);
|
||||
SetGameObjectFlag(GO_FLAG_NODESPAWN);
|
||||
m_respawnDelayTime = 0;
|
||||
m_respawnTime = 0;
|
||||
}
|
||||
@@ -1411,9 +1411,9 @@ void GameObject::SetGoArtKit(uint8 artkit, GameObject* go, ObjectGuid::LowType l
|
||||
void GameObject::SwitchDoorOrButton(bool activate, bool alternative /* = false */)
|
||||
{
|
||||
if (activate)
|
||||
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
|
||||
SetGameObjectFlag(GO_FLAG_IN_USE);
|
||||
else
|
||||
RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
|
||||
RemoveGameObjectFlag(GO_FLAG_IN_USE);
|
||||
|
||||
if (GetGoState() == GO_STATE_READY) //if closed -> open
|
||||
SetGoState(alternative ? GO_STATE_ACTIVE_ALTERNATIVE : GO_STATE_ACTIVE);
|
||||
@@ -1424,7 +1424,7 @@ void GameObject::SwitchDoorOrButton(bool activate, bool alternative /* = false *
|
||||
void GameObject::Use(Unit* user)
|
||||
{
|
||||
// Xinef: we cannot use go with not selectable flags
|
||||
if (HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE))
|
||||
if (HasGameObjectFlag(GO_FLAG_NOT_SELECTABLE))
|
||||
return;
|
||||
|
||||
// by default spell caster is user
|
||||
@@ -1578,7 +1578,7 @@ void GameObject::Use(Unit* user)
|
||||
GameObjectTemplate const* info = GetGOInfo();
|
||||
|
||||
// xinef: Goober cannot be used with this flag, skip
|
||||
if (HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE))
|
||||
if (HasGameObjectFlag(GO_FLAG_IN_USE))
|
||||
return;
|
||||
|
||||
if (user->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -1639,7 +1639,7 @@ void GameObject::Use(Unit* user)
|
||||
|
||||
if (info->GetAutoCloseTime())
|
||||
{
|
||||
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
|
||||
SetGameObjectFlag(GO_FLAG_IN_USE);
|
||||
SetLootState(GO_ACTIVATED, user);
|
||||
if (!info->goober.customAnim)
|
||||
SetGoState(GO_STATE_ACTIVE);
|
||||
@@ -2283,7 +2283,7 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
|
||||
switch (state)
|
||||
{
|
||||
case GO_DESTRUCTIBLE_INTACT:
|
||||
RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED | GO_FLAG_DESTROYED);
|
||||
RemoveGameObjectFlag(GO_FLAG_DAMAGED | GO_FLAG_DESTROYED);
|
||||
SetDisplayId(m_goInfo->displayId);
|
||||
if (setHealth)
|
||||
{
|
||||
@@ -2302,8 +2302,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
|
||||
if (Battleground* bg = bgMap->GetBG())
|
||||
bg->EventPlayerDamagedGO(eventInvoker, this, m_goInfo->building.damagedEvent);
|
||||
|
||||
RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED);
|
||||
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED);
|
||||
RemoveGameObjectFlag(GO_FLAG_DESTROYED);
|
||||
SetGameObjectFlag(GO_FLAG_DAMAGED);
|
||||
|
||||
uint32 modelId = m_goInfo->building.damagedDisplayId;
|
||||
if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->building.destructibleData))
|
||||
@@ -2337,8 +2337,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
|
||||
}
|
||||
}
|
||||
|
||||
RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED);
|
||||
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED);
|
||||
RemoveGameObjectFlag(GO_FLAG_DAMAGED);
|
||||
SetGameObjectFlag(GO_FLAG_DESTROYED);
|
||||
|
||||
uint32 modelId = m_goInfo->building.destroyedDisplayId;
|
||||
if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->building.destructibleData))
|
||||
@@ -2357,7 +2357,7 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
|
||||
case GO_DESTRUCTIBLE_REBUILDING:
|
||||
{
|
||||
EventInform(m_goInfo->building.rebuildingEvent);
|
||||
RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED | GO_FLAG_DESTROYED);
|
||||
RemoveGameObjectFlag(GO_FLAG_DAMAGED | GO_FLAG_DESTROYED);
|
||||
|
||||
uint32 modelId = m_goInfo->displayId;
|
||||
if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->building.destructibleData))
|
||||
|
||||
@@ -857,6 +857,12 @@ public:
|
||||
void SetPhaseMask(uint32 newPhaseMask, bool update) override;
|
||||
void EnableCollision(bool enable);
|
||||
|
||||
GameObjectFlags GetGameObjectFlags() const { return GameObjectFlags(GetUInt32Value(GAMEOBJECT_FLAGS)); }
|
||||
bool HasGameObjectFlag(GameObjectFlags flags) const { return HasFlag(GAMEOBJECT_FLAGS, flags) != 0; }
|
||||
void SetGameObjectFlag(GameObjectFlags flags) { SetFlag(GAMEOBJECT_FLAGS, flags); }
|
||||
void RemoveGameObjectFlag(GameObjectFlags flags) { RemoveFlag(GAMEOBJECT_FLAGS, flags); }
|
||||
void ReplaceAllGameObjectFlags(GameObjectFlags flags) { SetUInt32Value(GAMEOBJECT_FLAGS, flags); }
|
||||
|
||||
void Use(Unit* user);
|
||||
|
||||
[[nodiscard]] LootState getLootState() const { return m_lootState; }
|
||||
@@ -933,9 +939,9 @@ public:
|
||||
void SetDestructibleState(GameObjectDestructibleState state, Player* eventInvoker = nullptr, bool setHealth = false);
|
||||
[[nodiscard]] GameObjectDestructibleState GetDestructibleState() const
|
||||
{
|
||||
if (HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED))
|
||||
if (HasGameObjectFlag(GO_FLAG_DESTROYED))
|
||||
return GO_DESTRUCTIBLE_DESTROYED;
|
||||
if (HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED))
|
||||
if (HasGameObjectFlag(GO_FLAG_DAMAGED))
|
||||
return GO_DESTRUCTIBLE_DAMAGED;
|
||||
return GO_DESTRUCTIBLE_INTACT;
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
|
||||
SetNativeDisplayId(petInfo->DisplayId);
|
||||
UpdatePositionData();
|
||||
uint8 petlevel = petInfo->Level;
|
||||
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE);
|
||||
SetName(petInfo->Name);
|
||||
|
||||
switch (getPetType())
|
||||
@@ -991,7 +991,7 @@ bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phas
|
||||
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
|
||||
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
|
||||
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, uint32(sObjectMgr->GetXPForLevel(getLevel() + 1)* sWorld->getRate(RATE_XP_PET_NEXT_LEVEL)));
|
||||
SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE);
|
||||
|
||||
if (cinfo->type == CREATURE_TYPE_BEAST)
|
||||
{
|
||||
|
||||
@@ -894,7 +894,7 @@ void Player::HandleDrowning(uint32 time_diff)
|
||||
uint32 damage = GetMaxHealth() / 5 + urand(0, getLevel() - 1);
|
||||
EnvironmentalDamage(DAMAGE_EXHAUSTED, damage);
|
||||
}
|
||||
else if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)) // Teleport ghost to graveyard
|
||||
else if (HasPlayerFlag(PLAYER_FLAGS_GHOST)) // Teleport ghost to graveyard
|
||||
RepopAtGraveyard();
|
||||
}
|
||||
else if (!(m_MirrorTimerFlagsLast & UNDERWATER_INDARKWATER))
|
||||
@@ -1066,14 +1066,14 @@ void Player::SetRestState(uint32 triggerId)
|
||||
{
|
||||
_innTriggerId = triggerId;
|
||||
_restTime = GameTime::GetGameTime().count();
|
||||
SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
|
||||
SetPlayerFlag(PLAYER_FLAGS_RESTING);
|
||||
}
|
||||
|
||||
void Player::RemoveRestState()
|
||||
{
|
||||
_innTriggerId = 0;
|
||||
_restTime = 0;
|
||||
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
|
||||
RemovePlayerFlag(PLAYER_FLAGS_RESTING);
|
||||
}
|
||||
|
||||
bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data)
|
||||
@@ -2062,7 +2062,7 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask)
|
||||
return nullptr;
|
||||
|
||||
// appropriate npc type
|
||||
if (npcflagmask && !creature->HasFlag(UNIT_NPC_FLAGS, npcflagmask))
|
||||
if (npcflagmask && !creature->HasNpcFlag(NPCFlags(npcflagmask)))
|
||||
return nullptr;
|
||||
|
||||
// not allow interaction under control, but allow with own pets
|
||||
@@ -2172,7 +2172,7 @@ void Player::SetGameMaster(bool on)
|
||||
m_ExtraFlags |= PLAYER_EXTRA_GM_ON;
|
||||
if (AccountMgr::IsGMAccount(GetSession()->GetSecurity()))
|
||||
SetFaction(FACTION_FRIENDLY);
|
||||
SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM);
|
||||
SetPlayerFlag(PLAYER_FLAGS_GM);
|
||||
SetUnitFlag2(UNIT_FLAG2_ALLOW_CHEAT_SPELLS);
|
||||
|
||||
if (Pet* pet = GetPet())
|
||||
@@ -2203,7 +2203,7 @@ void Player::SetGameMaster(bool on)
|
||||
|
||||
m_ExtraFlags &= ~ PLAYER_EXTRA_GM_ON;
|
||||
SetFactionForRace(getRace(true));
|
||||
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GM);
|
||||
RemovePlayerFlag(PLAYER_FLAGS_GM);
|
||||
RemoveUnitFlag2(UNIT_FLAG2_ALLOW_CHEAT_SPELLS);
|
||||
|
||||
if (Pet* pet = GetPet())
|
||||
@@ -2337,7 +2337,7 @@ void Player::GiveXP(uint32 xp, Unit* victim, float group_rate, bool isLFGReward)
|
||||
return;
|
||||
}
|
||||
|
||||
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_NO_XP_GAIN))
|
||||
if (HasPlayerFlag(PLAYER_FLAGS_NO_XP_GAIN))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2654,7 +2654,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
|
||||
SetUnitFlag2(UNIT_FLAG2_REGENERATE_POWER);// must be set
|
||||
|
||||
// cleanup player flags (will be re-applied if need at aura load), to avoid have ghost flag without ghost aura, for example.
|
||||
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK | PLAYER_FLAGS_DND | PLAYER_FLAGS_GM | PLAYER_FLAGS_GHOST | PLAYER_ALLOW_ONLY_ABILITY);
|
||||
RemovePlayerFlag(PLAYER_FLAGS_AFK | PLAYER_FLAGS_DND | PLAYER_FLAGS_GM | PLAYER_FLAGS_GHOST | PLAYER_ALLOW_ONLY_ABILITY);
|
||||
|
||||
RemoveStandFlags(UNIT_STAND_FLAGS_ALL); // one form stealth modified bytes
|
||||
RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP | UNIT_BYTE2_FLAG_SANCTUARY);
|
||||
@@ -4499,9 +4499,9 @@ Corpse* Player::CreateCorpse()
|
||||
corpse->SetUInt32Value(CORPSE_FIELD_BYTES_2, _cfb2);
|
||||
|
||||
uint32 flags = CORPSE_FLAG_UNK2;
|
||||
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM))
|
||||
if (HasPlayerFlag(PLAYER_FLAGS_HIDE_HELM))
|
||||
flags |= CORPSE_FLAG_HIDE_HELM;
|
||||
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK))
|
||||
if (HasPlayerFlag(PLAYER_FLAGS_HIDE_CLOAK))
|
||||
flags |= CORPSE_FLAG_HIDE_CLOAK;
|
||||
|
||||
// Xinef: Player can loop corpses while in BG or in WG
|
||||
@@ -4844,7 +4844,7 @@ void Player::RepopAtGraveyard()
|
||||
else if (GetPositionZ() < GetMap()->GetMinHeight(GetPositionX(), GetPositionY()))
|
||||
TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, GetOrientation());
|
||||
|
||||
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_IS_OUT_OF_BOUNDS);
|
||||
RemovePlayerFlag(PLAYER_FLAGS_IS_OUT_OF_BOUNDS);
|
||||
}
|
||||
|
||||
bool Player::CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, AreaTableEntry const* zone)
|
||||
@@ -7545,7 +7545,7 @@ void Player::SendQuestGiverStatusMultiple()
|
||||
Creature* questgiver = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, *itr);
|
||||
if (!questgiver || questgiver->IsHostileTo(this))
|
||||
continue;
|
||||
if (!questgiver->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER))
|
||||
if (!questgiver->HasNpcFlag(UNIT_NPC_FLAG_QUESTGIVER))
|
||||
continue;
|
||||
|
||||
questStatus = GetQuestDialogStatus(questgiver);
|
||||
@@ -8828,7 +8828,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
|
||||
pet->SetCreatorGUID(GetGUID());
|
||||
pet->SetFaction(GetFaction());
|
||||
pet->setPowerType(POWER_MANA);
|
||||
pet->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
pet->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE);
|
||||
pet->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
pet->InitStatsForLevel(getLevel());
|
||||
|
||||
@@ -13878,7 +13878,7 @@ bool Player::CanResummonPet(uint32 spellid)
|
||||
|
||||
bool Player::CanSeeSpellClickOn(Creature const* c) const
|
||||
{
|
||||
if (!c->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK))
|
||||
if (!c->HasNpcFlag(UNIT_NPC_FLAG_SPELLCLICK))
|
||||
return false;
|
||||
|
||||
SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(c->GetEntry());
|
||||
@@ -13901,7 +13901,7 @@ bool Player::CanSeeSpellClickOn(Creature const* c) const
|
||||
|
||||
bool Player::CanSeeVendor(Creature const* creature) const
|
||||
{
|
||||
if (!creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_VENDOR))
|
||||
if (!creature->HasNpcFlag(UNIT_NPC_FLAG_VENDOR))
|
||||
return true;
|
||||
|
||||
ConditionList conditions = sConditionMgr->GetConditionsForNpcVendorEvent(creature->GetEntry(), 0);
|
||||
@@ -14313,7 +14313,7 @@ void Player::_SaveCharacter(bool create, CharacterDatabaseTransaction trans)
|
||||
stmt->SetData(index++, GetByteValue(PLAYER_BYTES_2, 0));
|
||||
stmt->SetData(index++, GetByteValue(PLAYER_BYTES_2, 2));
|
||||
stmt->SetData(index++, GetByteValue(PLAYER_BYTES_2, 3));
|
||||
stmt->SetData(index++, GetUInt32Value(PLAYER_FLAGS));
|
||||
stmt->SetData(index++, (uint32)GetPlayerFlags());
|
||||
stmt->SetData(index++, (uint16)GetMapId());
|
||||
stmt->SetData(index++, (uint32)GetInstanceId());
|
||||
stmt->SetData(index++, (uint8(GetDungeonDifficulty()) | uint8(GetRaidDifficulty()) << 4));
|
||||
@@ -14344,7 +14344,7 @@ void Player::_SaveCharacter(bool create, CharacterDatabaseTransaction trans)
|
||||
stmt->SetData(index++, m_Played_time[PLAYED_TIME_LEVEL]);
|
||||
stmt->SetData(index++, finiteAlways(_restBonus));
|
||||
stmt->SetData(index++, uint32(GameTime::GetGameTime().count()));
|
||||
stmt->SetData(index++, (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0));
|
||||
stmt->SetData(index++, (HasPlayerFlag(PLAYER_FLAGS_RESTING) ? 1 : 0));
|
||||
//save, far from tavern/city
|
||||
//save, but in tavern/city
|
||||
stmt->SetData(index++, m_resetTalentsCost);
|
||||
@@ -14430,7 +14430,7 @@ void Player::_SaveCharacter(bool create, CharacterDatabaseTransaction trans)
|
||||
stmt->SetData(index++, GetByteValue(PLAYER_BYTES_2, 0));
|
||||
stmt->SetData(index++, GetByteValue(PLAYER_BYTES_2, 2));
|
||||
stmt->SetData(index++, GetByteValue(PLAYER_BYTES_2, 3));
|
||||
stmt->SetData(index++, GetUInt32Value(PLAYER_FLAGS));
|
||||
stmt->SetData(index++, GetPlayerFlags());
|
||||
|
||||
if (!IsBeingTeleported())
|
||||
{
|
||||
@@ -14483,7 +14483,7 @@ void Player::_SaveCharacter(bool create, CharacterDatabaseTransaction trans)
|
||||
stmt->SetData(index++, m_Played_time[PLAYED_TIME_LEVEL]);
|
||||
stmt->SetData(index++, finiteAlways(_restBonus));
|
||||
stmt->SetData(index++, uint32(GameTime::GetGameTime().count()));
|
||||
stmt->SetData(index++, (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0));
|
||||
stmt->SetData(index++, (HasPlayerFlag(PLAYER_FLAGS_RESTING) ? 1 : 0));
|
||||
//save, far from tavern/city
|
||||
//save, but in tavern/city
|
||||
stmt->SetData(index++, m_resetTalentsCost);
|
||||
@@ -15745,7 +15745,7 @@ void Player::SetRestFlag(RestFlag restFlag, uint32 triggerId /*= 0*/)
|
||||
if (!oldRestMask && _restFlagMask) // only set flag/time on the first rest state
|
||||
{
|
||||
_restTime = GameTime::GetGameTime().count();
|
||||
SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
|
||||
SetPlayerFlag(PLAYER_FLAGS_RESTING);
|
||||
}
|
||||
|
||||
if (triggerId)
|
||||
@@ -15760,7 +15760,7 @@ void Player::RemoveRestFlag(RestFlag restFlag)
|
||||
if (oldRestMask && !_restFlagMask) // only remove flag/time on the last rest state remove
|
||||
{
|
||||
_restTime = 0;
|
||||
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
|
||||
RemovePlayerFlag(PLAYER_FLAGS_RESTING);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "CinematicMgr.h"
|
||||
#include "DBCStores.h"
|
||||
#include "DatabaseEnvFwd.h"
|
||||
#include "EnumFlag.h"
|
||||
#include "GroupReference.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "Item.h"
|
||||
@@ -464,7 +465,7 @@ enum DrunkenState
|
||||
|
||||
#define MAX_DRUNKEN 4
|
||||
|
||||
enum PlayerFlags
|
||||
enum PlayerFlags : uint32
|
||||
{
|
||||
PLAYER_FLAGS_GROUP_LEADER = 0x00000001,
|
||||
PLAYER_FLAGS_AFK = 0x00000002,
|
||||
@@ -500,6 +501,8 @@ enum PlayerFlags
|
||||
PLAYER_FLAGS_UNK31 = 0x80000000,
|
||||
};
|
||||
|
||||
DEFINE_ENUM_FLAG(PlayerFlags);
|
||||
|
||||
enum PlayerBytesOffsets //@todo: Implement
|
||||
{
|
||||
PLAYER_BYTES_OFFSET_SKIN_ID = 0,
|
||||
@@ -1078,6 +1081,12 @@ public:
|
||||
|
||||
void Update(uint32 time) override;
|
||||
|
||||
PlayerFlags GetPlayerFlags() const { return PlayerFlags(GetUInt32Value(PLAYER_FLAGS)); }
|
||||
bool HasPlayerFlag(PlayerFlags flags) const { return HasFlag(PLAYER_FLAGS, flags) != 0; }
|
||||
void SetPlayerFlag(PlayerFlags flags) { SetFlag(PLAYER_FLAGS, flags); }
|
||||
void RemovePlayerFlag(PlayerFlags flags) { RemoveFlag(PLAYER_FLAGS, flags); }
|
||||
void ReplaceAllPlayerFlags(PlayerFlags flags) { SetUInt32Value(PLAYER_FLAGS, flags); }
|
||||
|
||||
static bool BuildEnumData(PreparedQueryResult result, WorldPacket* data);
|
||||
|
||||
void SetInWater(bool apply);
|
||||
@@ -1097,8 +1106,8 @@ public:
|
||||
|
||||
void ToggleAFK();
|
||||
void ToggleDND();
|
||||
[[nodiscard]] bool isAFK() const { return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK); }
|
||||
[[nodiscard]] bool isDND() const { return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DND); }
|
||||
[[nodiscard]] bool isAFK() const { return HasPlayerFlag(PLAYER_FLAGS_AFK); }
|
||||
[[nodiscard]] bool isDND() const { return HasPlayerFlag(PLAYER_FLAGS_DND); }
|
||||
[[nodiscard]] uint8 GetChatTag() const;
|
||||
std::string autoReplyMsg;
|
||||
|
||||
@@ -1114,7 +1123,7 @@ public:
|
||||
void ContinueTaxiFlight();
|
||||
// mount_id can be used in scripting calls
|
||||
|
||||
[[nodiscard]] bool IsDeveloper() const { return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER); }
|
||||
[[nodiscard]] bool IsDeveloper() const { return HasPlayerFlag(PLAYER_FLAGS_DEVELOPER); }
|
||||
void SetDeveloper(bool on) { ApplyModFlag(PLAYER_FLAGS, PLAYER_FLAGS_DEVELOPER, on); }
|
||||
[[nodiscard]] bool isAcceptWhispers() const { return m_ExtraFlags & PLAYER_EXTRA_ACCEPT_WHISPERS; }
|
||||
void SetAcceptWhispers(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_ACCEPT_WHISPERS; else m_ExtraFlags &= ~PLAYER_EXTRA_ACCEPT_WHISPERS; }
|
||||
@@ -1803,7 +1812,7 @@ public:
|
||||
void ResetContestedPvP()
|
||||
{
|
||||
ClearUnitState(UNIT_STATE_ATTACK_PLAYER);
|
||||
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP);
|
||||
RemovePlayerFlag(PLAYER_FLAGS_CONTESTED_PVP);
|
||||
m_contestedPvPTimer = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
|
||||
|
||||
if (source->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
npcflags = source->GetUInt32Value(UNIT_NPC_FLAGS);
|
||||
npcflags = source->ToUnit()->GetNpcFlags();
|
||||
if (showQuests && npcflags & UNIT_NPC_FLAG_QUESTGIVER)
|
||||
PrepareQuestMenu(source->GetGUID());
|
||||
}
|
||||
@@ -215,7 +215,7 @@ void Player::SendPreparedGossip(WorldObject* source)
|
||||
if (source->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
// in case no gossip flag and quest menu not empty, open quest menu (client expect gossip menu with this flag)
|
||||
if (!source->ToCreature()->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP) && !PlayerTalkClass->GetQuestMenu().Empty())
|
||||
if (!source->ToCreature()->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP) && !PlayerTalkClass->GetQuestMenu().Empty())
|
||||
{
|
||||
SendPreparedQuest(source->GetGUID());
|
||||
return;
|
||||
@@ -259,7 +259,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
|
||||
|
||||
if (sWorld->getIntConfig(CONFIG_INSTANT_TAXI) == 2 && source->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if (gossipOptionId == GOSSIP_ACTION_TOGGLE_INSTANT_FLIGHT && source->GetUInt32Value(UNIT_NPC_FLAGS) & UNIT_NPC_FLAG_FLIGHTMASTER)
|
||||
if (gossipOptionId == GOSSIP_ACTION_TOGGLE_INSTANT_FLIGHT && source->ToUnit()->GetNpcFlags() & UNIT_NPC_FLAG_FLIGHTMASTER)
|
||||
{
|
||||
ToggleInstantFlight();
|
||||
|
||||
|
||||
@@ -353,8 +353,8 @@ void Player::UpdatePvPFlag(time_t currTime)
|
||||
|
||||
if (currTime < (pvpInfo.EndTimer + 300 + 5))
|
||||
{
|
||||
if (currTime > (pvpInfo.EndTimer + 4) && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_PVP_TIMER))
|
||||
SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_PVP_TIMER);
|
||||
if (currTime > (pvpInfo.EndTimer + 4) && !HasPlayerFlag(PLAYER_FLAGS_PVP_TIMER))
|
||||
SetPlayerFlag(PLAYER_FLAGS_PVP_TIMER);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5053,7 +5053,7 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons
|
||||
SetByteValue(PLAYER_BYTES_2, 3, fields[15].Get<uint8>());
|
||||
SetByteValue(PLAYER_BYTES_3, 0, fields[5].Get<uint8>());
|
||||
SetByteValue(PLAYER_BYTES_3, 1, fields[54].Get<uint8>());
|
||||
SetUInt32Value(PLAYER_FLAGS, fields[16].Get<uint32>());
|
||||
ReplaceAllPlayerFlags((PlayerFlags)fields[16].Get<uint32>());
|
||||
SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[53].Get<uint32>());
|
||||
|
||||
SetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES, fields[52].Get<uint64>());
|
||||
@@ -5460,7 +5460,7 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons
|
||||
_LoadGlyphAuras();
|
||||
_LoadAuras(holder.GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_AURAS), time_diff);
|
||||
// add ghost flag (must be after aura load: PLAYER_FLAGS_GHOST set in aura)
|
||||
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
if (HasPlayerFlag(PLAYER_FLAGS_GHOST))
|
||||
{
|
||||
m_deathState = DEAD;
|
||||
AddUnitState(UNIT_STATE_ISOLATED);
|
||||
@@ -6514,7 +6514,7 @@ void Player::_LoadGroup()
|
||||
{
|
||||
if (group->IsLeader(GetGUID()))
|
||||
{
|
||||
SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GROUP_LEADER);
|
||||
SetPlayerFlag(PLAYER_FLAGS_GROUP_LEADER);
|
||||
}
|
||||
|
||||
uint8 subgroup = group->GetMemberGroup(GetGUID());
|
||||
@@ -6528,7 +6528,7 @@ void Player::_LoadGroup()
|
||||
}
|
||||
|
||||
if (!GetGroup() || !GetGroup()->IsLeader(GetGUID()))
|
||||
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GROUP_LEADER);
|
||||
RemovePlayerFlag(PLAYER_FLAGS_GROUP_LEADER);
|
||||
}
|
||||
|
||||
void Player::BindToInstance()
|
||||
|
||||
@@ -232,7 +232,7 @@ void Player::Update(uint32 p_time)
|
||||
}
|
||||
}
|
||||
|
||||
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING))
|
||||
if (HasPlayerFlag(PLAYER_FLAGS_RESTING))
|
||||
{
|
||||
if (now > lastTick && _restTime > 0) // freeze update
|
||||
{
|
||||
@@ -1386,7 +1386,7 @@ void Player::UpdatePvPState()
|
||||
}
|
||||
else // in friendly area
|
||||
{
|
||||
if (IsPvP() && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP) &&
|
||||
if (IsPvP() && !HasPlayerFlag(PLAYER_FLAGS_IN_PVP) &&
|
||||
pvpInfo.EndTimer == 0)
|
||||
pvpInfo.EndTimer = GameTime::GetGameTime().count(); // start toggle-off
|
||||
}
|
||||
@@ -1474,7 +1474,7 @@ void Player::UpdatePvP(bool state, bool _override)
|
||||
SetPvP(state);
|
||||
}
|
||||
|
||||
RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_PVP_TIMER);
|
||||
RemovePlayerFlag(PLAYER_FLAGS_PVP_TIMER);
|
||||
sScriptMgr->OnPlayerPVPFlagChange(this, state);
|
||||
}
|
||||
|
||||
@@ -1741,7 +1741,7 @@ void Player::UpdateForQuestWorldObjects()
|
||||
continue;
|
||||
|
||||
// check if this unit requires quest specific flags
|
||||
if (!obj->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK))
|
||||
if (!obj->HasNpcFlag(UNIT_NPC_FLAG_SPELLCLICK))
|
||||
continue;
|
||||
|
||||
SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(obj->GetEntry());
|
||||
|
||||
@@ -84,7 +84,7 @@ bool MotionTransport::CreateMoTrans(ObjectGuid::LowType guidlow, uint32 entry, u
|
||||
if (GameObjectTemplateAddon const* addon = GetTemplateAddon())
|
||||
{
|
||||
SetUInt32Value(GAMEOBJECT_FACTION, addon->faction);
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, addon->flags);
|
||||
ReplaceAllGameObjectFlags((GameObjectFlags)addon->flags);
|
||||
}
|
||||
|
||||
SetObjectScale(goinfo->size);
|
||||
@@ -727,7 +727,7 @@ bool StaticTransport::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* m
|
||||
if (GameObjectTemplateAddon const* addon = GetTemplateAddon())
|
||||
{
|
||||
SetUInt32Value(GAMEOBJECT_FACTION, addon->faction);
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, addon->flags);
|
||||
ReplaceAllGameObjectFlags((GameObjectFlags)addon->flags);
|
||||
}
|
||||
|
||||
SetEntry(goinfo->entry);
|
||||
|
||||
@@ -9675,7 +9675,7 @@ ReputationRank Unit::GetReactionTo(Unit const* target, bool checkOriginalFaction
|
||||
{
|
||||
// check contested flags
|
||||
if (targetFactionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_ATTACK_PVP_ACTIVE_PLAYERS
|
||||
&& selfPlayerOwner->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP))
|
||||
&& selfPlayerOwner->HasPlayerFlag(PLAYER_FLAGS_CONTESTED_PVP))
|
||||
return REP_HOSTILE;
|
||||
|
||||
// if faction has reputation, hostile state depends only from AtWar state
|
||||
@@ -9748,7 +9748,7 @@ ReputationRank Unit::GetFactionReactionTo(FactionTemplateEntry const* factionTem
|
||||
{
|
||||
// check contested flags
|
||||
if (factionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_ATTACK_PVP_ACTIVE_PLAYERS
|
||||
&& targetPlayerOwner->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP))
|
||||
&& targetPlayerOwner->HasPlayerFlag(PLAYER_FLAGS_CONTESTED_PVP))
|
||||
return REP_HOSTILE;
|
||||
if (ReputationRank const* repRank = targetPlayerOwner->GetReputationMgr().GetForcedRankIfAny(factionTemplateEntry))
|
||||
return *repRank;
|
||||
@@ -13269,7 +13269,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
|
||||
|
||||
if (Player const* playerAttacker = ToPlayer())
|
||||
{
|
||||
if (playerAttacker->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_UBER) || playerAttacker->IsSpectator())
|
||||
if (playerAttacker->HasPlayerFlag(PLAYER_FLAGS_UBER) || playerAttacker->IsSpectator())
|
||||
return false;
|
||||
}
|
||||
// check flags
|
||||
@@ -16796,7 +16796,7 @@ void Unit::SetContestedPvP(Player* attackedPlayer, bool lookForNearContestedGuar
|
||||
if (!player->HasUnitState(UNIT_STATE_ATTACK_PLAYER))
|
||||
{
|
||||
player->AddUnitState(UNIT_STATE_ATTACK_PLAYER);
|
||||
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP);
|
||||
player->SetPlayerFlag(PLAYER_FLAGS_CONTESTED_PVP);
|
||||
// call MoveInLineOfSight for nearby contested guards
|
||||
AddToNotify(NOTIFY_AI_RELOCATION);
|
||||
}
|
||||
@@ -18203,7 +18203,7 @@ void Unit::RemoveVehicleKit()
|
||||
|
||||
m_updateFlag &= ~UPDATEFLAG_VEHICLE;
|
||||
m_unitTypeMask &= ~UNIT_MASK_VEHICLE;
|
||||
RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK | UNIT_NPC_FLAG_PLAYER_VEHICLE);
|
||||
RemoveNpcFlag(UNIT_NPC_FLAG_SPELLCLICK | UNIT_NPC_FLAG_PLAYER_VEHICLE);
|
||||
}
|
||||
|
||||
Unit* Unit::GetVehicleBase() const
|
||||
|
||||
@@ -540,6 +540,8 @@ enum NPCFlags : uint32
|
||||
UNIT_NPC_FLAG_VENDOR_MASK = UNIT_NPC_FLAG_VENDOR | UNIT_NPC_FLAG_VENDOR_AMMO | UNIT_NPC_FLAG_VENDOR_POISON | UNIT_NPC_FLAG_VENDOR_REAGENT
|
||||
};
|
||||
|
||||
DEFINE_ENUM_FLAG(NPCFlags);
|
||||
|
||||
enum MovementFlags
|
||||
{
|
||||
MOVEMENTFLAG_NONE = 0x00000000,
|
||||
@@ -1491,6 +1493,7 @@ public:
|
||||
else
|
||||
RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP);
|
||||
}
|
||||
|
||||
[[nodiscard]] uint32 GetCreatureType() const;
|
||||
[[nodiscard]] uint32 GetCreatureTypeMask() const
|
||||
{
|
||||
@@ -1607,20 +1610,26 @@ public:
|
||||
MeleeHitOutcome RollMeleeOutcomeAgainst (Unit const* victim, WeaponAttackType attType) const;
|
||||
MeleeHitOutcome RollMeleeOutcomeAgainst (Unit const* victim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const;
|
||||
|
||||
[[nodiscard]] bool IsVendor() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_VENDOR); }
|
||||
[[nodiscard]] bool IsTrainer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_TRAINER); }
|
||||
[[nodiscard]] bool IsQuestGiver() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); }
|
||||
[[nodiscard]] bool IsGossip() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); }
|
||||
[[nodiscard]] bool IsTaxi() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_FLIGHTMASTER); }
|
||||
[[nodiscard]] bool IsGuildMaster() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_PETITIONER); }
|
||||
[[nodiscard]] bool IsBattleMaster() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BATTLEMASTER); }
|
||||
[[nodiscard]] bool IsBanker() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BANKER); }
|
||||
[[nodiscard]] bool IsInnkeeper() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_INNKEEPER); }
|
||||
[[nodiscard]] bool IsSpiritHealer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER); }
|
||||
[[nodiscard]] bool IsSpiritGuide() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITGUIDE); }
|
||||
[[nodiscard]] bool IsTabardDesigner()const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_TABARDDESIGNER); }
|
||||
[[nodiscard]] bool IsAuctioner() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_AUCTIONEER); }
|
||||
[[nodiscard]] bool IsArmorer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_REPAIR); }
|
||||
NPCFlags GetNpcFlags() const { return NPCFlags(GetUInt32Value(UNIT_NPC_FLAGS)); }
|
||||
bool HasNpcFlag(NPCFlags flags) const { return HasFlag(UNIT_NPC_FLAGS, flags) != 0; }
|
||||
void SetNpcFlag(NPCFlags flags) { SetFlag(UNIT_NPC_FLAGS, flags); }
|
||||
void RemoveNpcFlag(NPCFlags flags) { RemoveFlag(UNIT_NPC_FLAGS, flags); }
|
||||
void ReplaceAllNpcFlags(NPCFlags flags) { SetUInt32Value(UNIT_NPC_FLAGS, flags); }
|
||||
|
||||
[[nodiscard]] bool IsVendor() const { return HasNpcFlag(UNIT_NPC_FLAG_VENDOR); }
|
||||
[[nodiscard]] bool IsTrainer() const { return HasNpcFlag(UNIT_NPC_FLAG_TRAINER); }
|
||||
[[nodiscard]] bool IsQuestGiver() const { return HasNpcFlag(UNIT_NPC_FLAG_QUESTGIVER); }
|
||||
[[nodiscard]] bool IsGossip() const { return HasNpcFlag(UNIT_NPC_FLAG_GOSSIP); }
|
||||
[[nodiscard]] bool IsTaxi() const { return HasNpcFlag(UNIT_NPC_FLAG_FLIGHTMASTER); }
|
||||
[[nodiscard]] bool IsGuildMaster() const { return HasNpcFlag(UNIT_NPC_FLAG_PETITIONER); }
|
||||
[[nodiscard]] bool IsBattleMaster() const { return HasNpcFlag(UNIT_NPC_FLAG_BATTLEMASTER); }
|
||||
[[nodiscard]] bool IsBanker() const { return HasNpcFlag(UNIT_NPC_FLAG_BANKER); }
|
||||
[[nodiscard]] bool IsInnkeeper() const { return HasNpcFlag(UNIT_NPC_FLAG_INNKEEPER); }
|
||||
[[nodiscard]] bool IsSpiritHealer() const { return HasNpcFlag(UNIT_NPC_FLAG_SPIRITHEALER); }
|
||||
[[nodiscard]] bool IsSpiritGuide() const { return HasNpcFlag(UNIT_NPC_FLAG_SPIRITGUIDE); }
|
||||
[[nodiscard]] bool IsTabardDesigner()const { return HasNpcFlag(UNIT_NPC_FLAG_TABARDDESIGNER); }
|
||||
[[nodiscard]] bool IsAuctioner() const { return HasNpcFlag(UNIT_NPC_FLAG_AUCTIONEER); }
|
||||
[[nodiscard]] bool IsArmorer() const { return HasNpcFlag(UNIT_NPC_FLAG_REPAIR); }
|
||||
[[nodiscard]] bool IsServiceProvider() const
|
||||
{
|
||||
return HasFlag(UNIT_NPC_FLAGS,
|
||||
@@ -1629,7 +1638,7 @@ public:
|
||||
UNIT_NPC_FLAG_INNKEEPER | UNIT_NPC_FLAG_SPIRITHEALER |
|
||||
UNIT_NPC_FLAG_SPIRITGUIDE | UNIT_NPC_FLAG_TABARDDESIGNER | UNIT_NPC_FLAG_AUCTIONEER);
|
||||
}
|
||||
[[nodiscard]] bool IsSpiritService() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER | UNIT_NPC_FLAG_SPIRITGUIDE); }
|
||||
[[nodiscard]] bool IsSpiritService() const { return HasNpcFlag(UNIT_NPC_FLAG_SPIRITHEALER | UNIT_NPC_FLAG_SPIRITGUIDE); }
|
||||
[[nodiscard]] bool IsCritter() const { return GetCreatureType() == CREATURE_TYPE_CRITTER; }
|
||||
|
||||
[[nodiscard]] bool IsInFlight() const { return HasUnitState(UNIT_STATE_IN_FLIGHT); }
|
||||
|
||||
@@ -119,14 +119,14 @@ void Vehicle::Reset(bool evading /*= false*/)
|
||||
if (_me->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (_usableSeatNum)
|
||||
_me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_PLAYER_VEHICLE);
|
||||
_me->SetNpcFlag(UNIT_NPC_FLAG_PLAYER_VEHICLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplyAllImmunities();
|
||||
InstallAllAccessories(evading);
|
||||
if (_usableSeatNum)
|
||||
_me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
|
||||
_me->SetNpcFlag(UNIT_NPC_FLAG_SPELLCLICK);
|
||||
}
|
||||
|
||||
if (GetBase()->GetTypeId() == TYPEID_UNIT)
|
||||
@@ -355,9 +355,9 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
|
||||
if (!_usableSeatNum)
|
||||
{
|
||||
if (_me->GetTypeId() == TYPEID_PLAYER)
|
||||
_me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_PLAYER_VEHICLE);
|
||||
_me->RemoveNpcFlag(UNIT_NPC_FLAG_PLAYER_VEHICLE);
|
||||
else
|
||||
_me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
|
||||
_me->RemoveNpcFlag(UNIT_NPC_FLAG_SPELLCLICK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -460,7 +460,7 @@ void Vehicle::RemovePassenger(Unit* unit)
|
||||
unit->GetName(), _me->GetEntry(), _vehicleInfo->m_ID, _me->GetGUID().ToString(), (int32)seat->first);
|
||||
|
||||
if (seat->second.SeatInfo->CanEnterOrExit() && ++_usableSeatNum)
|
||||
_me->SetFlag(UNIT_NPC_FLAGS, (_me->GetTypeId() == TYPEID_PLAYER ? UNIT_NPC_FLAG_PLAYER_VEHICLE : UNIT_NPC_FLAG_SPELLCLICK));
|
||||
_me->SetNpcFlag((_me->GetTypeId() == TYPEID_PLAYER ? UNIT_NPC_FLAG_PLAYER_VEHICLE : UNIT_NPC_FLAG_SPELLCLICK));
|
||||
|
||||
// Remove UNIT_FLAG_NOT_SELECTABLE if passenger did not have it before entering vehicle
|
||||
if (seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE && !seat->second.Passenger.IsUnselectable)
|
||||
|
||||
@@ -1289,7 +1289,7 @@ void GameEventMgr::UpdateEventNPCFlags(uint16 event_id)
|
||||
if (CreatureTemplate const* creatureTemplate = creature->GetCreatureTemplate())
|
||||
npcflag |= creatureTemplate->npcflag;
|
||||
|
||||
creature->SetUInt32Value(UNIT_NPC_FLAGS, npcflag);
|
||||
creature->ReplaceAllNpcFlags(NPCFlags(npcflag));
|
||||
// reset gossip options, since the flag change might have added / removed some
|
||||
//cr->ResetGossipOptions();
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ bool Group::Create(Player* leader)
|
||||
m_guid = ObjectGuid::Create<HighGuid::Group>(lowguid);
|
||||
m_leaderGuid = leaderGuid;
|
||||
m_leaderName = leader->GetName();
|
||||
leader->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GROUP_LEADER);
|
||||
leader->SetPlayerFlag(PLAYER_FLAGS_GROUP_LEADER);
|
||||
|
||||
if (isBGGroup() || isBFGroup())
|
||||
m_groupType = GROUPTYPE_BGRAID;
|
||||
@@ -725,9 +725,9 @@ void Group::ChangeLeader(ObjectGuid newLeaderGuid)
|
||||
}
|
||||
|
||||
if (Player* oldLeader = ObjectAccessor::FindConnectedPlayer(m_leaderGuid))
|
||||
oldLeader->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GROUP_LEADER);
|
||||
oldLeader->RemovePlayerFlag(PLAYER_FLAGS_GROUP_LEADER);
|
||||
|
||||
newLeader->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GROUP_LEADER);
|
||||
newLeader->SetPlayerFlag(PLAYER_FLAGS_GROUP_LEADER);
|
||||
m_leaderGuid = newLeader->GetGUID();
|
||||
m_leaderName = newLeader->GetName();
|
||||
ToggleGroupMemberFlag(slot, MEMBER_FLAG_ASSISTANT, false);
|
||||
|
||||
@@ -942,10 +942,10 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
|
||||
}
|
||||
|
||||
// Set FFA PvP for non GM in non-rest mode
|
||||
if (sWorld->IsFFAPvPRealm() && !pCurrChar->IsGameMaster() && !pCurrChar->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING))
|
||||
if (sWorld->IsFFAPvPRealm() && !pCurrChar->IsGameMaster() && !pCurrChar->HasPlayerFlag(PLAYER_FLAGS_RESTING))
|
||||
pCurrChar->SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
|
||||
|
||||
if (pCurrChar->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP))
|
||||
if (pCurrChar->HasPlayerFlag(PLAYER_FLAGS_CONTESTED_PVP))
|
||||
{
|
||||
pCurrChar->SetContestedPvP(nullptr, false);
|
||||
}
|
||||
@@ -1056,8 +1056,8 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
|
||||
}
|
||||
|
||||
// pussywizard: pvp mode
|
||||
pCurrChar->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_PVP_TIMER);
|
||||
if (pCurrChar->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP))
|
||||
pCurrChar->RemovePlayerFlag(PLAYER_FLAGS_PVP_TIMER);
|
||||
if (pCurrChar->HasPlayerFlag(PLAYER_FLAGS_IN_PVP))
|
||||
pCurrChar->UpdatePvP(true, true);
|
||||
|
||||
// pussywizard: on login it's not possible to go back to arena as a spectator, HandleMoveWorldportAckOpcode is not sent, so call it here
|
||||
@@ -1301,17 +1301,17 @@ void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket& recvData)
|
||||
void WorldSession::HandleShowingHelmOpcode(WorldPackets::Character::ShowingHelm& packet)
|
||||
{
|
||||
if (packet.ShowHelm)
|
||||
_player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM);
|
||||
_player->RemovePlayerFlag(PLAYER_FLAGS_HIDE_HELM);
|
||||
else
|
||||
_player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM);
|
||||
_player->SetPlayerFlag(PLAYER_FLAGS_HIDE_HELM);
|
||||
}
|
||||
|
||||
void WorldSession::HandleShowingCloakOpcode(WorldPackets::Character::ShowingCloak& packet)
|
||||
{
|
||||
if (packet.ShowCloak)
|
||||
_player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK);
|
||||
_player->RemovePlayerFlag(PLAYER_FLAGS_HIDE_CLOAK);
|
||||
else
|
||||
_player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK);
|
||||
_player->SetPlayerFlag(PLAYER_FLAGS_HIDE_CLOAK);
|
||||
}
|
||||
|
||||
void WorldSession::HandleCharRenameOpcode(WorldPacket& recvData)
|
||||
|
||||
@@ -812,7 +812,7 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke
|
||||
|
||||
if (!player->IsAlive())
|
||||
{
|
||||
if (player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
if (player->HasPlayerFlag(PLAYER_FLAGS_GHOST))
|
||||
playerStatus |= MEMBER_STATUS_GHOST;
|
||||
else
|
||||
playerStatus |= MEMBER_STATUS_DEAD;
|
||||
@@ -1014,7 +1014,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData)
|
||||
|
||||
if (!player->IsAlive())
|
||||
{
|
||||
if (player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
if (player->HasPlayerFlag(PLAYER_FLAGS_GHOST))
|
||||
playerStatus |= MEMBER_STATUS_GHOST;
|
||||
else
|
||||
playerStatus |= MEMBER_STATUS_DEAD;
|
||||
|
||||
@@ -60,7 +60,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket& recv_data)
|
||||
|
||||
recv_data.read_skip<uint8>();
|
||||
|
||||
if (GetPlayer()->IsAlive() || GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
if (GetPlayer()->IsAlive() || GetPlayer()->HasPlayerFlag(PLAYER_FLAGS_GHOST))
|
||||
return;
|
||||
|
||||
if (GetPlayer()->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION))
|
||||
@@ -417,7 +417,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPackets::Character::LogoutRequ
|
||||
DoLootRelease(lguid);
|
||||
|
||||
bool instantLogout = ((GetSecurity() >= 0 && uint32(GetSecurity()) >= sWorld->getIntConfig(CONFIG_INSTANT_LOGOUT))
|
||||
|| (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) && !GetPlayer()->IsInCombat())) || GetPlayer()->IsInFlight();
|
||||
|| (GetPlayer()->HasPlayerFlag(PLAYER_FLAGS_RESTING) && !GetPlayer()->IsInCombat())) || GetPlayer()->IsInFlight();
|
||||
|
||||
bool preventAfkSanctuaryLogout = sWorld->getIntConfig(CONFIG_AFK_PREVENT_LOGOUT) == 1
|
||||
&& GetPlayer()->isAFK() && sAreaTableStore.LookupEntry(GetPlayer()->GetAreaId())->IsSanctuary();
|
||||
@@ -426,7 +426,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPackets::Character::LogoutRequ
|
||||
&& GetPlayer()->isAFK();
|
||||
|
||||
/// TODO: Possibly add RBAC permission to log out in combat
|
||||
bool canLogoutInCombat = GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
|
||||
bool canLogoutInCombat = GetPlayer()->HasPlayerFlag(PLAYER_FLAGS_RESTING);
|
||||
|
||||
uint32 reason = 0;
|
||||
if (GetPlayer()->IsInCombat() && !canLogoutInCombat)
|
||||
@@ -501,7 +501,7 @@ void WorldSession::HandleTogglePvP(WorldPacket& recv_data)
|
||||
else
|
||||
GetPlayer()->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
|
||||
|
||||
if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP))
|
||||
if (GetPlayer()->HasPlayerFlag(PLAYER_FLAGS_IN_PVP))
|
||||
GetPlayer()->UpdatePvP(true, true);
|
||||
else if (!GetPlayer()->pvpInfo.IsHostile && GetPlayer()->IsPvP()) // pussywizard: in pvp mode, but doesn't want to be and not in hostile territory, so start timer
|
||||
GetPlayer()->UpdatePvP(true, false);
|
||||
@@ -645,7 +645,7 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket& recv_data)
|
||||
return;
|
||||
|
||||
// body not released yet
|
||||
if (!_player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
if (!_player->HasPlayerFlag(PLAYER_FLAGS_GHOST))
|
||||
return;
|
||||
|
||||
Corpse* corpse = _player->GetCorpse();
|
||||
@@ -1549,7 +1549,7 @@ void WorldSession::HandleSetTaxiBenchmarkOpcode(WorldPacket& recv_data)
|
||||
uint8 mode;
|
||||
recv_data >> mode;
|
||||
|
||||
mode ? _player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK) : _player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK);
|
||||
mode ? _player->SetPlayerFlag(PLAYER_FLAGS_TAXI_BENCHMARK) : _player->RemovePlayerFlag(PLAYER_FLAGS_TAXI_BENCHMARK);
|
||||
|
||||
LOG_DEBUG("network", "Client used \"/timetest {}\" command", mode);
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ void WorldSession::HandleMoveWorldportAck()
|
||||
GetPlayer()->CastSpell(GetPlayer(), 2479, true);
|
||||
|
||||
// in friendly area
|
||||
else if (GetPlayer()->IsPvP() && !GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP))
|
||||
else if (GetPlayer()->IsPvP() && !GetPlayer()->HasPlayerFlag(PLAYER_FLAGS_IN_PVP))
|
||||
GetPlayer()->UpdatePvP(false, false);
|
||||
|
||||
// resummon pet
|
||||
@@ -297,7 +297,7 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recvData)
|
||||
plMover->CastSpell(plMover, 2479, true);
|
||||
|
||||
// in friendly area
|
||||
else if (plMover->IsPvP() && !plMover->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP))
|
||||
else if (plMover->IsPvP() && !plMover->HasPlayerFlag(PLAYER_FLAGS_IN_PVP))
|
||||
plMover->UpdatePvP(false, false);
|
||||
}
|
||||
}
|
||||
@@ -570,13 +570,13 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvData)
|
||||
{
|
||||
if (plrMover->IsAlive())
|
||||
{
|
||||
plrMover->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IS_OUT_OF_BOUNDS);
|
||||
plrMover->SetPlayerFlag(PLAYER_FLAGS_IS_OUT_OF_BOUNDS);
|
||||
plrMover->EnvironmentalDamage(DAMAGE_FALL_TO_VOID, GetPlayer()->GetMaxHealth());
|
||||
// player can be alive if GM
|
||||
if (plrMover->IsAlive())
|
||||
plrMover->KillPlayer();
|
||||
}
|
||||
else if (!plrMover->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IS_OUT_OF_BOUNDS))
|
||||
else if (!plrMover->HasPlayerFlag(PLAYER_FLAGS_IS_OUT_OF_BOUNDS))
|
||||
{
|
||||
GraveyardStruct const* grave = sGraveyard->GetClosestGraveyard(plrMover, plrMover->GetTeamId());
|
||||
if (grave)
|
||||
|
||||
@@ -286,11 +286,11 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData)
|
||||
}
|
||||
|
||||
// xinef: check if we have ANY npc flags
|
||||
if (unit->GetUInt32Value(UNIT_NPC_FLAGS) == UNIT_NPC_FLAG_NONE)
|
||||
if (unit->GetNpcFlags() == UNIT_NPC_FLAG_NONE)
|
||||
return;
|
||||
|
||||
// xinef: do not allow to open gossip when npc is in combat
|
||||
if (unit->GetUInt32Value(UNIT_NPC_FLAGS) == UNIT_NPC_FLAG_GOSSIP && unit->IsInCombat()) // should work on all flags?
|
||||
if (unit->GetNpcFlags() == UNIT_NPC_FLAG_GOSSIP && unit->IsInCombat()) // should work on all flags?
|
||||
return;
|
||||
|
||||
// set faction visible if needed
|
||||
|
||||
@@ -689,9 +689,9 @@ void WorldSession::HandleMirrorImageDataRequest(WorldPacket& recvData)
|
||||
// Display items in visible slots
|
||||
for (EquipmentSlots const* itr = &itemSlots[0]; *itr != EQUIPMENT_SLOT_END; ++itr)
|
||||
{
|
||||
if (*itr == EQUIPMENT_SLOT_HEAD && player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM))
|
||||
if (*itr == EQUIPMENT_SLOT_HEAD && player->HasPlayerFlag(PLAYER_FLAGS_HIDE_HELM))
|
||||
data << uint32(0);
|
||||
else if (*itr == EQUIPMENT_SLOT_BACK && player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK))
|
||||
else if (*itr == EQUIPMENT_SLOT_BACK && player->HasPlayerFlag(PLAYER_FLAGS_HIDE_CLOAK))
|
||||
data << uint32(0);
|
||||
else if (Item const* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, *itr))
|
||||
{
|
||||
|
||||
@@ -328,7 +328,7 @@ void FlightPathMovementGenerator::DoFinalize(Player* player)
|
||||
player->SetFallInformation(GameTime::GetGameTime().count(), player->GetPositionZ());
|
||||
}
|
||||
|
||||
player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK);
|
||||
player->RemovePlayerFlag(PLAYER_FLAGS_TAXI_BENCHMARK);
|
||||
}
|
||||
|
||||
#define PLAYER_FLIGHT_SPEED 32.0f
|
||||
|
||||
@@ -1764,7 +1764,7 @@ void AuraEffect::HandleAuraGhost(AuraApplication const* aurApp, uint8 mode, bool
|
||||
|
||||
if (apply)
|
||||
{
|
||||
target->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST);
|
||||
target->ToPlayer()->SetPlayerFlag(PLAYER_FLAGS_GHOST);
|
||||
target->m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_GHOST);
|
||||
target->m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_GHOST);
|
||||
}
|
||||
@@ -1773,7 +1773,7 @@ void AuraEffect::HandleAuraGhost(AuraApplication const* aurApp, uint8 mode, bool
|
||||
if (target->HasAuraType(SPELL_AURA_GHOST))
|
||||
return;
|
||||
|
||||
target->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST);
|
||||
target->ToPlayer()->RemovePlayerFlag(PLAYER_FLAGS_GHOST);
|
||||
target->m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE);
|
||||
target->m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE);
|
||||
}
|
||||
@@ -2671,13 +2671,13 @@ void AuraEffect::HandleAuraAllowOnlyAbility(AuraApplication const* aurApp, uint8
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (apply)
|
||||
target->SetFlag(PLAYER_FLAGS, PLAYER_ALLOW_ONLY_ABILITY);
|
||||
target->ToPlayer()->SetPlayerFlag(PLAYER_ALLOW_ONLY_ABILITY);
|
||||
else
|
||||
{
|
||||
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
|
||||
if (target->HasAuraType(SPELL_AURA_ALLOW_ONLY_ABILITY))
|
||||
return;
|
||||
target->RemoveFlag(PLAYER_FLAGS, PLAYER_ALLOW_ONLY_ABILITY);
|
||||
target->ToPlayer()->RemovePlayerFlag(PLAYER_ALLOW_ONLY_ABILITY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5392,7 +5392,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
if (m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
//can cast triggered (by aura only?) spells while have this flag
|
||||
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_CASTER_AURASTATE) && m_caster->ToPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_ALLOW_ONLY_ABILITY))
|
||||
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_CASTER_AURASTATE) && m_caster->ToPlayer()->HasPlayerFlag(PLAYER_ALLOW_ONLY_ABILITY))
|
||||
return SPELL_FAILED_SPELL_IN_PROGRESS;
|
||||
|
||||
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD) && m_caster->ToPlayer()->HasSpellCooldown(m_spellInfo->Id))
|
||||
|
||||
@@ -2412,7 +2412,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
|
||||
return;
|
||||
|
||||
summon->SelectLevel(); // some summoned creaters have different from 1 DB data for level/hp
|
||||
summon->SetUInt32Value(UNIT_NPC_FLAGS, summon->GetCreatureTemplate()->npcflag);
|
||||
summon->ReplaceAllNpcFlags(NPCFlags(summon->GetCreatureTemplate()->npcflag));
|
||||
|
||||
summon->ReplaceAllUnitFlags(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
summon->SetReactState(REACT_PASSIVE);
|
||||
@@ -4230,7 +4230,7 @@ void Spell::EffectStuck(SpellEffIndex /*effIndex*/)
|
||||
return;
|
||||
|
||||
// xinef: player is in corpse
|
||||
if (!target->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||
if (!target->HasPlayerFlag(PLAYER_FLAGS_GHOST))
|
||||
target->BuildPlayerRepop();
|
||||
target->RepopAtGraveyard();
|
||||
return;
|
||||
|
||||
@@ -4252,6 +4252,8 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
ApplySpellFix({ 20038 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_50000_YARDS);
|
||||
spellInfo->Attributes |= SPELL_ATTR0_NO_IMMUNITIES;
|
||||
spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
|
||||
});
|
||||
|
||||
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
|
||||
|
||||
Reference in New Issue
Block a user