mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 08:06:23 +00:00
feat(gameobject): allow gameobjects to loot money + align table with TC (#1368)
This commit is contained in:
@@ -287,8 +287,11 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
|
||||
|
||||
SetObjectScale(goinfo->size);
|
||||
|
||||
SetUInt32Value(GAMEOBJECT_FACTION, goinfo->faction);
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, goinfo->flags);
|
||||
if (GameObjectTemplateAddon const* addon = GetTemplateAddon())
|
||||
{
|
||||
SetUInt32Value(GAMEOBJECT_FACTION, addon->faction);
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, addon->flags);
|
||||
}
|
||||
|
||||
SetEntry(goinfo->entry);
|
||||
|
||||
@@ -688,8 +691,9 @@ void GameObject::Update(uint32 diff)
|
||||
//any return here in case battleground traps
|
||||
// Xinef: Do not return here for summoned gos that should be deleted few lines below
|
||||
// Xinef: Battleground objects are treated as spawned by default
|
||||
if ((GetGOInfo()->flags & GO_FLAG_NODESPAWN) && isSpawnedByDefault())
|
||||
return;
|
||||
if (GameObjectTemplateAddon const* addon = GetTemplateAddon())
|
||||
if ((addon->flags & GO_FLAG_NODESPAWN) && isSpawnedByDefault())
|
||||
return;
|
||||
}
|
||||
|
||||
loot.clear();
|
||||
@@ -710,7 +714,8 @@ void GameObject::Update(uint32 diff)
|
||||
{
|
||||
SendObjectDeSpawnAnim(GetGUID());
|
||||
//reset flags
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags);
|
||||
if (GameObjectTemplateAddon const* addon = GetTemplateAddon())
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, addon->flags);
|
||||
}
|
||||
|
||||
if (!m_respawnDelayTime)
|
||||
@@ -736,6 +741,11 @@ void GameObject::Update(uint32 diff)
|
||||
sScriptMgr->OnGameObjectUpdate(this, diff);
|
||||
}
|
||||
|
||||
GameObjectTemplateAddon const* GameObject::GetTemplateAddon() const
|
||||
{
|
||||
return sObjectMgr->GetGameObjectTemplateAddon(GetGOInfo()->entry);
|
||||
}
|
||||
|
||||
void GameObject::Refresh()
|
||||
{
|
||||
// not refresh despawned not casted GO (despawned casted GO destroyed in all cases anyway)
|
||||
@@ -760,7 +770,9 @@ void GameObject::Delete()
|
||||
SendObjectDeSpawnAnim(GetGUID());
|
||||
|
||||
SetGoState(GO_STATE_READY);
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags);
|
||||
|
||||
if (GameObjectTemplateAddon const* addon = GetTemplateAddon())
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, addon->flags);
|
||||
|
||||
// Xinef: if ritual gameobject is removed, clear anim spells
|
||||
if (GetGOInfo()->type == GAMEOBJECT_TYPE_SUMMONING_RITUAL)
|
||||
|
||||
@@ -532,8 +532,19 @@ struct GameObjectTemplate
|
||||
}
|
||||
};
|
||||
|
||||
// From `gameobject_template_addon`
|
||||
struct GameObjectTemplateAddon
|
||||
{
|
||||
uint32 entry;
|
||||
uint32 faction;
|
||||
uint32 flags;
|
||||
uint32 mingold;
|
||||
uint32 maxgold;
|
||||
};
|
||||
|
||||
// Benchmarked: Faster than std::map (insert/find)
|
||||
typedef UNORDERED_MAP<uint32, GameObjectTemplate> GameObjectTemplateContainer;
|
||||
typedef UNORDERED_MAP<uint32, GameObjectTemplateAddon> GameObjectTemplateAddonContainer;
|
||||
|
||||
class OPvPCapturePoint;
|
||||
struct TransportAnimation;
|
||||
@@ -646,6 +657,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Mov
|
||||
virtual bool Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang, G3D::Quat const& rotation, uint32 animprogress, GOState go_state, uint32 artKit = 0);
|
||||
void Update(uint32 p_time);
|
||||
GameObjectTemplate const* GetGOInfo() const { return m_goInfo; }
|
||||
GameObjectTemplateAddon const* GetTemplateAddon() const;
|
||||
GameObjectData const* GetGOData() const { return m_goData; }
|
||||
GameObjectValue const* GetGOValue() const { return &m_goValue; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user