Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
ZhengPeiRu21
2022-04-07 08:55:50 -06:00
committed by GitHub
143 changed files with 665 additions and 546 deletions

View File

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