aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/GameObject
diff options
context:
space:
mode:
authorfunjoker <torti-esser@web.de>2017-11-05 20:24:45 +0100
committerjoschiwald <joschiwald.trinity@gmail.com>2017-11-05 20:24:45 +0100
commitc77e76fa61a620affdfe60ae2dae639f95091e1b (patch)
tree20a7d4748969f0140ad62b7407a9566c3cebe3ed /src/server/game/Entities/GameObject
parent983b0a5fcf48494a113a108cd6ccc9230094cc4c (diff)
Core/Gameobject: Add WorldEffectID to Gameobject (#20785)
Diffstat (limited to 'src/server/game/Entities/GameObject')
-rw-r--r--src/server/game/Entities/GameObject/GameObject.cpp14
-rw-r--r--src/server/game/Entities/GameObject/GameObject.h4
-rw-r--r--src/server/game/Entities/GameObject/GameObjectData.h2
3 files changed, 19 insertions, 1 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index e5bcf6623c4..023e827754f 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -55,7 +55,7 @@ QuaternionData QuaternionData::fromEulerAnglesZYX(float Z, float Y, float X)
}
GameObject::GameObject() : WorldObject(false), MapObject(),
- m_model(nullptr), m_goValue(), m_AI(nullptr), _animKitId(0)
+ m_model(nullptr), m_goValue(), m_AI(nullptr), _animKitId(0), _worldEffectID(0)
{
m_objectType |= TYPEMASK_GAMEOBJECT;
m_objectTypeId = TYPEID_GAMEOBJECT;
@@ -267,6 +267,12 @@ bool GameObject::Create(uint32 name_id, Map* map, uint32 /*phaseMask*/, Position
{
SetUInt32Value(GAMEOBJECT_FACTION, m_goTemplateAddon->faction);
SetUInt32Value(GAMEOBJECT_FLAGS, m_goTemplateAddon->flags);
+
+ if (m_goTemplateAddon->WorldEffectID)
+ {
+ m_updateFlag |= UPDATEFLAG_GAMEOBJECT;
+ SetWorldEffectID(m_goTemplateAddon->WorldEffectID);
+ }
}
SetEntry(goinfo->entry);
@@ -359,6 +365,12 @@ bool GameObject::Create(uint32 name_id, Map* map, uint32 /*phaseMask*/, Position
m_invisibility.AddValue(gameObjectAddon->invisibilityType, gameObjectAddon->InvisibilityValue);
}
+ if (gameObjectAddon && gameObjectAddon->WorldEffectID)
+ {
+ m_updateFlag |= UPDATEFLAG_GAMEOBJECT;
+ SetWorldEffectID(gameObjectAddon->WorldEffectID);
+ }
+
LastUsedScriptID = GetGOInfo()->ScriptId;
AIM_Initialize();
diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h
index f91aa3d4672..5aa46577ccb 100644
--- a/src/server/game/Entities/GameObject/GameObject.h
+++ b/src/server/game/Entities/GameObject/GameObject.h
@@ -286,6 +286,9 @@ class TC_GAME_API GameObject : public WorldObject, public GridObject<GameObject>
uint16 GetAIAnimKitId() const override { return _animKitId; }
void SetAnimKitId(uint16 animKitId, bool oneshot);
+ uint32 GetWorldEffectID() const { return _worldEffectID; }
+ void SetWorldEffectID(uint32 worldEffectID) { _worldEffectID = worldEffectID; }
+
void AIM_Destroy();
bool AIM_Initialize();
@@ -338,5 +341,6 @@ class TC_GAME_API GameObject : public WorldObject, public GridObject<GameObject>
GameObjectAI* m_AI;
uint16 _animKitId;
+ uint32 _worldEffectID;
};
#endif
diff --git a/src/server/game/Entities/GameObject/GameObjectData.h b/src/server/game/Entities/GameObject/GameObjectData.h
index 70d6ac14ee8..b1f4cb0fdf2 100644
--- a/src/server/game/Entities/GameObject/GameObjectData.h
+++ b/src/server/game/Entities/GameObject/GameObjectData.h
@@ -817,6 +817,7 @@ struct GameObjectTemplateAddon
uint32 flags;
uint32 mingold;
uint32 maxgold;
+ uint32 WorldEffectID;
};
@@ -844,6 +845,7 @@ struct GameObjectAddon
QuaternionData ParentRotation;
InvisibilityType invisibilityType;
uint32 InvisibilityValue;
+ uint32 WorldEffectID;
};
// from `gameobject`