TrinityCore
Loading...
Searching...
No Matches
GameObject.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef TRINITYCORE_GAMEOBJECT_H
19#define TRINITYCORE_GAMEOBJECT_H
20
21#include "Object.h"
22#include "GridObject.h"
23#include "GameObjectData.h"
24#include "MapObject.h"
25#include "SharedDefines.h"
26
27class GameObject;
28class GameObjectAI;
29class GameObjectModel;
31class Transport;
32class TransportBase;
33class Unit;
34struct Loot;
37
38// enum for GAMEOBJECT_TYPE_NEW_FLAG
39// values taken from world state
40enum class FlagState : uint8
41{
42 InBase = 1,
43 Taken,
44 Dropped,
46};
47
48namespace WorldPackets
49{
50 namespace Battleground
51 {
53 }
54}
55
56// Base class for GameObject type specific implementations
58{
59public:
61 {
62 public:
63 virtual ~CustomCommand();
64 virtual void Execute(GameObjectTypeBase& type) const = 0;
65 };
66
67 explicit GameObjectTypeBase(GameObject& owner) : _owner(owner) { }
68 virtual ~GameObjectTypeBase() = default;
69
70 virtual void Update([[maybe_unused]] uint32 diff) { }
71 virtual void OnStateChanged([[maybe_unused]] GOState oldState, [[maybe_unused]] GOState newState) { }
72 virtual void OnRelocated() { }
73 virtual bool IsNeverVisibleFor([[maybe_unused]] WorldObject const* seer, [[maybe_unused]] bool allowServersideObjects) const { return false; }
74
75protected:
77};
78
79namespace GameObjectType
80{
82{
83public:
85
86 void Execute(GameObjectTypeBase& type) const override;
87
88private:
89 bool _on;
90};
91
93{
94public:
95 explicit SetNewFlagState(FlagState state, Player* player);
96
97 void Execute(GameObjectTypeBase& type) const override;
98
99private:
102};
103}
104
106{
107 //25 GAMEOBJECT_TYPE_FISHINGHOLE
108 struct
109 {
112 //29 GAMEOBJECT_TYPE_CONTROL_ZONE
113 struct
114 {
117 //33 GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING
118 struct
119 {
123 //42 GAMEOBJECT_TYPE_CAPTURE_POINT
124 struct
125 {
130};
131
132// For containers: [GO_NOT_READY]->GO_READY (close)->GO_ACTIVATED (open) ->GO_JUST_DEACTIVATED->GO_READY -> ...
133// For bobber: GO_NOT_READY ->GO_READY (close)->GO_ACTIVATED (open) ->GO_JUST_DEACTIVATED-><deleted>
134// For door(closed):[GO_NOT_READY]->GO_READY (close)->GO_ACTIVATED (open) ->GO_JUST_DEACTIVATED->GO_READY(close) -> ...
135// For door(open): [GO_NOT_READY]->GO_READY (open) ->GO_ACTIVATED (close)->GO_JUST_DEACTIVATED->GO_READY(open) -> ...
137{
139 GO_READY, // can be ready but despawned, and then not possible activate until spawn
143
144// 5 sec for bobber catch
145#define FISHING_BOBBER_READY_TIME 5
146
147class TC_GAME_API GameObject : public WorldObject, public GridObject<GameObject>, public MapObject
148{
149 public:
150 explicit GameObject();
151 ~GameObject();
152
153 protected:
154 void BuildValuesCreate(ByteBuffer* data, Player const* target) const override;
155 void BuildValuesUpdate(ByteBuffer* data, Player const* target) const override;
156 void ClearUpdateMask(bool remove) override;
157
158 public:
159 void BuildValuesUpdateForPlayerWithMask(UpdateData* data, UF::ObjectData::Mask const& requestedObjectMask,
160 UF::GameObjectData::Mask const& requestedGameObjectMask, Player const* target) const;
161
162 struct ValuesUpdateForPlayerWithMaskSender // sender compatible with MessageDistDeliverer
163 {
164 explicit ValuesUpdateForPlayerWithMaskSender(GameObject const* owner) : Owner(owner) { }
165
169
170 void operator()(Player const* player) const;
171 };
172
173 void AddToWorld() override;
174 void RemoveFromWorld() override;
175 void CleanupsBeforeDelete(bool finalCleanup = true) override;
176
177 private:
178 bool Create(uint32 entry, Map* map, Position const& pos, QuaternionData const& rotation, uint32 animProgress, GOState goState, uint32 artKit, bool dynamic, ObjectGuid::LowType spawnid);
179 public:
180 static GameObject* CreateGameObject(uint32 entry, Map* map, Position const& pos, QuaternionData const& rotation, uint32 animProgress, GOState goState, uint32 artKit = 0);
181 static GameObject* CreateGameObjectFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap = true);
182
183 void Update(uint32 p_time) override;
184 GameObjectTemplate const* GetGOInfo() const { return m_goInfo; }
185 GameObjectTemplateAddon const* GetTemplateAddon() const { return m_goTemplateAddon; }
186 GameObjectOverride const* GetGameObjectOverride() const;
187 GameObjectData const* GetGameObjectData() const { return m_goData; }
188 GameObjectValue const* GetGOValue() const { return &m_goValue; }
189
190 bool IsTransport() const;
191 bool IsDynTransport() const;
192 bool IsDestructibleBuilding() const;
193
194 ObjectGuid::LowType GetSpawnId() const { return m_spawnId; }
195
196 // z_rot, y_rot, x_rot - rotation angles around z, y and x axes
197 void SetLocalRotationAngles(float z_rot, float y_rot, float x_rot);
198 void SetLocalRotation(float qx, float qy, float qz, float qw);
199 void SetParentRotation(QuaternionData const& rotation); // transforms(rotates) transport's path
200 QuaternionData const& GetLocalRotation() const { return m_localRotation; }
201 int64 GetPackedLocalRotation() const { return m_packedRotation; }
202
203 QuaternionData GetWorldRotation() const;
204
205 // overwrite WorldObject function for proper name localization
206 std::string GetNameForLocaleIdx(LocaleConstant locale) const override;
207
208 void SaveToDB();
209 void SaveToDB(uint32 mapid, std::vector<Difficulty> const& spawnDifficulties);
210 bool LoadFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap, bool = true); // arg4 is unused, only present to match the signature on Creature
211 static bool DeleteFromDB(ObjectGuid::LowType spawnId);
212
214 {
215 // Owner already found and different than expected owner - remove object from old owner
216 if (!owner.IsEmpty() && !GetOwnerGUID().IsEmpty() && GetOwnerGUID() != owner)
217 {
218 ABORT();
219 }
220 m_spawnedByDefault = false; // all object with owner is despawned after delay
221 SetUpdateFieldValue(m_values.ModifyValue(&GameObject::m_gameObjectData).ModifyValue(&UF::GameObjectData::CreatedBy), owner);
222 }
223 ObjectGuid GetOwnerGUID() const override { return m_gameObjectData->CreatedBy; }
224
226 {
227 m_spawnedByDefault = false; // all summoned object is despawned after delay
228 m_spellId = id;
229 }
230 uint32 GetSpellId() const { return m_spellId;}
231
232 time_t GetRespawnTime() const { return m_respawnTime; }
233 time_t GetRespawnTimeEx() const;
234
235 void SetRespawnTime(int32 respawn);
236 void Respawn();
237 bool isSpawned() const
238 {
239 return m_respawnDelayTime == 0 ||
240 (m_respawnTime > 0 && !m_spawnedByDefault) ||
241 (m_respawnTime == 0 && m_spawnedByDefault);
242 }
243 bool isSpawnedByDefault() const { return m_spawnedByDefault; }
244 void SetSpawnedByDefault(bool b) { m_spawnedByDefault = b; }
245 uint32 GetRespawnDelay() const { return m_respawnDelayTime; }
246 void Refresh();
247 void DespawnOrUnsummon(Milliseconds delay = 0ms, Seconds forceRespawnTime = 0s);
248 void DespawnForPlayer(Player* seer, Seconds respawnTime);
249 void Delete();
250 void SendGameObjectDespawn();
251 Loot* GetFishLoot(Player* lootOwner);
252 Loot* GetFishLootJunk(Player* lootOwner);
253
254 bool HasFlag(GameObjectFlags flags) const { return (*m_gameObjectData->Flags & flags) != 0; }
255 void SetFlag(GameObjectFlags flags) { SetUpdateFieldFlagValue(m_values.ModifyValue(&GameObject::m_gameObjectData).ModifyValue(&UF::GameObjectData::Flags), flags); }
256 void RemoveFlag(GameObjectFlags flags) { RemoveUpdateFieldFlagValue(m_values.ModifyValue(&GameObject::m_gameObjectData).ModifyValue(&UF::GameObjectData::Flags), flags); }
257 void ReplaceAllFlags(GameObjectFlags flags) { SetUpdateFieldValue(m_values.ModifyValue(&GameObject::m_gameObjectData).ModifyValue(&UF::GameObjectData::Flags), flags); }
258
259 void SetLevel(uint32 level) { SetUpdateFieldValue(m_values.ModifyValue(&GameObject::m_gameObjectData).ModifyValue(&UF::GameObjectData::Level), level); }
260 GameobjectTypes GetGoType() const { return GameobjectTypes(*m_gameObjectData->TypeID); }
261 void SetGoType(GameobjectTypes type) { SetUpdateFieldValue(m_values.ModifyValue(&GameObject::m_gameObjectData).ModifyValue(&UF::GameObjectData::TypeID), type); }
262 GOState GetGoState() const { return GOState(*m_gameObjectData->State); }
263 void SetGoState(GOState state);
264 GOState GetGoStateFor(ObjectGuid const& viewer) const;
265 void SetGoStateFor(GOState state, Player const* viewer);
266 uint32 GetGoArtKit() const { return m_gameObjectData->ArtKit; }
267 void SetGoArtKit(uint32 artkit);
268 uint8 GetGoAnimProgress() const { return m_gameObjectData->PercentHealth; }
269 void SetGoAnimProgress(uint8 animprogress) { SetUpdateFieldValue(m_values.ModifyValue(&GameObject::m_gameObjectData).ModifyValue(&UF::GameObjectData::PercentHealth), animprogress); }
270 static void SetGoArtKit(uint32 artkit, GameObject* go, ObjectGuid::LowType lowguid = UI64LIT(0));
271
272 std::vector<uint32> const* GetPauseTimes() const;
273 void SetPathProgressForClient(float progress);
274
275 void EnableCollision(bool enable);
276
277 void Use(Unit* user);
278
279 LootState getLootState() const { return m_lootState; }
280 // Note: unit is only used when s = GO_ACTIVATED
281 void SetLootState(LootState s, Unit* unit = nullptr);
282
283 uint16 GetLootMode() const { return m_LootMode; }
284 bool HasLootMode(uint16 lootMode) const { return (m_LootMode & lootMode) != 0; }
285 void SetLootMode(uint16 lootMode) { m_LootMode = lootMode; }
286 void AddLootMode(uint16 lootMode) { m_LootMode |= lootMode; }
287 void RemoveLootMode(uint16 lootMode) { m_LootMode &= ~lootMode; }
288 void ResetLootMode() { m_LootMode = LOOT_MODE_DEFAULT; }
289 void ClearLoot();
290 bool IsFullyLooted() const;
291 void OnLootRelease(Player* looter);
292
293 void AddToSkillupList(ObjectGuid const& PlayerGuidLow) { m_SkillupList.insert(PlayerGuidLow); }
294 bool IsInSkillupList(ObjectGuid const& playerGuid) const
295 {
296 return m_SkillupList.count(playerGuid) > 0;
297 }
298 void ClearSkillupList() { m_SkillupList.clear(); }
299
300 void AddUniqueUse(Player* player);
301 void AddUse() { ++m_usetimes; }
302
303 uint32 GetUseCount() const { return m_usetimes; }
304 uint32 GetUniqueUseCount() const { return uint32(m_unique_users.size()); }
305
306 void SaveRespawnTime(uint32 forceDelay = 0);
307
308 std::unique_ptr<Loot> m_loot;
309 std::unordered_map<ObjectGuid, std::unique_ptr<Loot>> m_personalLoot;
310
311 GuidUnorderedSet const& GetTapList() const { return m_tapList; }
312 void SetTapList(GuidUnorderedSet tapList) { m_tapList = std::move(tapList); }
313 bool IsLootAllowedFor(Player const* player) const;
314 bool HasLootRecipient() const { return !m_tapList.empty(); }
315 Loot* GetLootForPlayer(Player const* /*player*/) const override;
316
317 GameObject* GetLinkedTrap();
318 void SetLinkedTrap(GameObject* linkedTrap) { m_linkedTrap = linkedTrap->GetGUID(); }
319
320 bool hasQuest(uint32 quest_id) const override;
321 bool hasInvolvedQuest(uint32 quest_id) const override;
322 bool ActivateToQuest(Player const* target) const;
323 void UseDoorOrButton(uint32 time_to_restore = 0, bool alternative = false, Unit* user = nullptr);
324 // 0 = use `gameobject`.`spawntimesecs`
325 void ResetDoorOrButton();
326 void ActivateObject(GameObjectActions action, int32 param, WorldObject* spellCaster = nullptr, uint32 spellId = 0, int32 effectIndex = -1);
327
328 void TriggeringLinkedGameObject(uint32 trapEntry, Unit* target);
329
330 bool IsNeverVisibleFor(WorldObject const* seer, bool allowServersideObjects = false) const override;
331 bool IsAlwaysVisibleFor(WorldObject const* seer) const override;
332 bool IsInvisibleDueToDespawn(WorldObject const* seer) const override;
333
334 uint8 GetLevelForTarget(WorldObject const* target) const override;
335
336 GameObject* LookupFishingHoleAround(float range);
337
338 void SendCustomAnim(uint32 anim);
339 bool IsInRange(float x, float y, float z, float radius) const;
340
341 void ModifyHealth(int32 change, WorldObject* attackerOrHealer = nullptr, uint32 spellId = 0);
342 // sets GameObject type 33 destruction flags and optionally default health for that state
343 void SetDestructibleState(GameObjectDestructibleState state, WorldObject* attackerOrHealer = nullptr, bool setHealth = false);
345 {
346 if ((*m_gameObjectData->Flags & GO_FLAG_DESTROYED))
348 if ((*m_gameObjectData->Flags & GO_FLAG_DAMAGED))
351 }
352
353 // There's many places not ready for dynamic spawns. This allows them to live on for now.
354 void SetRespawnCompatibilityMode(bool mode = true) { m_respawnCompatibilityMode = mode; }
355 bool GetRespawnCompatibilityMode() {return m_respawnCompatibilityMode; }
356
357 std::string const& GetAIName() const;
358 uint32 GetScriptId() const;
359 GameObjectAI* AI() const { return m_AI; }
360
361 bool HasStringId(std::string_view id) const;
362 void SetScriptStringId(std::string id);
363 std::array<std::string_view, 3> const& GetStringIds() const { return m_stringIds; }
364
365 void SetDisplayId(uint32 displayid);
366 uint32 GetDisplayId() const { return m_gameObjectData->DisplayID; }
367 uint8 GetNameSetId() const;
368
369 uint32 GetFaction() const override { return m_gameObjectData->FactionTemplate; }
370 void SetFaction(uint32 faction) override { SetUpdateFieldValue(m_values.ModifyValue(&GameObject::m_gameObjectData).ModifyValue(&UF::GameObjectData::FactionTemplate), faction); }
371
373 void GetRespawnPosition(float &x, float &y, float &z, float* ori = nullptr) const;
374
375 TransportBase* ToTransportBase() { return const_cast<TransportBase*>(const_cast<GameObject const*>(this)->ToTransportBase()); }
376 TransportBase const* ToTransportBase() const;
377
378 Transport* ToTransport() { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return reinterpret_cast<Transport*>(this); else return nullptr; }
379 Transport const* ToTransport() const { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT) return reinterpret_cast<Transport const*>(this); else return nullptr; }
380
381 float GetStationaryX() const override { return m_stationaryPosition.GetPositionX(); }
382 float GetStationaryY() const override { return m_stationaryPosition.GetPositionY(); }
383 float GetStationaryZ() const override { return m_stationaryPosition.GetPositionZ(); }
384 float GetStationaryO() const override { return m_stationaryPosition.GetOrientation(); }
385 Position const& GetStationaryPosition() const { return m_stationaryPosition; }
386 void RelocateStationaryPosition(float x, float y, float z, float o) { m_stationaryPosition.Relocate(x, y, z, o); }
387
388 void AfterRelocation();
389
390 float GetInteractionDistance() const;
391
392 void UpdateModelPosition();
393
394 bool IsAtInteractDistance(Position const& pos, float radius) const;
395 bool IsAtInteractDistance(Player const* player, SpellInfo const* spell = nullptr) const;
396
397 bool IsWithinDistInMap(Player const* player) const;
399
400 SpellInfo const* GetSpellForLock(Player const* player) const;
401
402 uint16 GetAIAnimKitId() const override { return _animKitId; }
403 void SetAnimKitId(uint16 animKitId, bool oneshot);
404
405 uint32 GetWorldEffectID() const { return _worldEffectID; }
406 void SetWorldEffectID(uint32 worldEffectID) { _worldEffectID = worldEffectID; }
407
408 void SetSpellVisualId(int32 spellVisualId, ObjectGuid activatorGuid = ObjectGuid::Empty);
409 void AssaultCapturePoint(Player* player);
410 void UpdateCapturePoint();
411 bool CanInteractWithCapturePoint(Player const* target) const;
412 FlagState GetFlagState() const;
413 ObjectGuid const& GetFlagCarrierGUID() const;
414 time_t GetFlagTakenFromBaseTime() const;
415
416 bool MeetsInteractCondition(Player const* user) const;
417
418 void AIM_Destroy();
419 bool AIM_Initialize();
420
421 std::string GetDebugInfo() const override;
422
423 void UpdateDynamicFlagsForNearbyPlayers();
424
425 void HandleCustomTypeCommand(GameObjectTypeBase::CustomCommand const& command) const;
426
428
429 protected:
430 void CreateModel();
431 void UpdateModel(); // updates model in case displayId were changed
433 time_t m_respawnTime; // (secs) time of next respawn (or despawn if GO have owner()),
434 uint32 m_respawnDelayTime; // (secs) if 0 then current GO state no dependent from timer
436 Seconds m_despawnRespawnTime; // override respawn time after delayed despawn
438 ObjectGuid m_lootStateUnitGUID; // GUID of the unit passed with SetLootState(LootState, Unit*)
441 time_t m_cooldownTime; // used as internal reaction delay time store (not state change reaction).
442 // For traps this: spell casting cooldown, for doors/buttons: reset time.
443 GOState m_prevGoState; // What state to set whenever resetting
444
446
447 ObjectGuid m_ritualOwnerGUID; // used for GAMEOBJECT_TYPE_RITUAL where GO is not summoned (no owner)
450
451 typedef std::map<uint32, ObjectGuid> ChairSlotAndUser;
453
458 std::unique_ptr<GameObjectTypeBase> m_goTypeImpl;
459 GameObjectValue m_goValue; // TODO: replace with m_goTypeImpl
460 std::array<std::string_view, 3> m_stringIds;
462
466
468 uint16 m_LootMode; // bitmask, default LOOT_MODE_DEFAULT, determines what loot will be lootable
469
471
472 private:
473 void RemoveFromOwner();
474 void SwitchDoorOrButton(bool activate, bool alternative = false);
475 void UpdatePackedRotation();
476
478 bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool /*is3D*/, bool /*incOwnRadius*/, bool /*incTargetRadius*/) const override
479 {
481 return IsInRange(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), dist2compare);
482 }
483
488
490 {
491 SystemTimePoint ValidUntil = SystemTimePoint::min();
493 bool Despawned = false;
494 };
495
496 std::unique_ptr<std::unordered_map<ObjectGuid, PerPlayerState>> m_perPlayerState;
497
498 std::unordered_map<ObjectGuid, PerPlayerState>& GetOrCreatePerPlayerStates();
499};
500#endif
LocaleConstant
Definition: Common.h:48
#define TC_GAME_API
Definition: Define.h:124
uint8_t uint8
Definition: Define.h:145
int64_t int64
Definition: Define.h:138
int32_t int32
Definition: Define.h:139
#define UI64LIT(N)
Definition: Define.h:128
uint16_t uint16
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:143
uint16 flags
Definition: DisableMgr.cpp:49
std::chrono::system_clock::time_point SystemTimePoint
Definition: Duration.h:42
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:32
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition: Duration.h:29
std::string GetDebugInfo()
Definition: Errors.cpp:157
#define ABORT
Definition: Errors.h:74
GameObjectActions
LootState
Definition: GameObject.h:137
@ GO_ACTIVATED
Definition: GameObject.h:140
@ GO_READY
Definition: GameObject.h:139
@ GO_NOT_READY
Definition: GameObject.h:138
@ GO_JUST_DEACTIVATED
Definition: GameObject.h:141
FlagState
Definition: GameObject.h:41
std::unordered_set< ObjectGuid > GuidUnorderedSet
Definition: ObjectGuid.h:394
std::set< ObjectGuid > GuidSet
Definition: ObjectGuid.h:391
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition: Optional.h:25
static void SaveToDB(QuestPool const &pool, CharacterDatabaseTransaction trans)
Definition: QuestPools.cpp:50
GameobjectTypes
@ GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT
TeamId
GameObjectDestructibleState
@ GO_DESTRUCTIBLE_DESTROYED
@ GO_DESTRUCTIBLE_INTACT
@ GO_DESTRUCTIBLE_DAMAGED
@ LOOT_MODE_DEFAULT
Definition: SharedDefines.h:77
GameObjectFlags
@ GO_FLAG_DESTROYED
@ GO_FLAG_DAMAGED
GOState
TriggerCastFlags
Definition: SpellDefines.h:245
virtual void Execute(GameObjectTypeBase &type) const =0
virtual void Update(uint32 diff)
Definition: GameObject.h:70
virtual ~GameObjectTypeBase()=default
virtual void OnRelocated()
Definition: GameObject.h:72
GameObjectTypeBase(GameObject &owner)
Definition: GameObject.h:67
virtual bool IsNeverVisibleFor(WorldObject const *seer, bool allowServersideObjects) const
Definition: GameObject.h:73
virtual void OnStateChanged(GOState oldState, GOState newState)
Definition: GameObject.h:71
GameObject & _owner
Definition: GameObject.h:76
uint32 GetRespawnDelay() const
Definition: GameObject.h:245
uint32 _worldEffectID
Definition: GameObject.h:487
ObjectGuid GetOwnerGUID() const override
Definition: GameObject.h:223
bool _IsWithinDist(WorldObject const *obj, float dist2compare, bool, bool, bool) const override
Object distance/size - overridden from Object::_IsWithinDist. Needs to take in account proper GO size...
Definition: GameObject.h:478
GameObjectValue m_goValue
Definition: GameObject.h:459
void AddLootMode(uint16 lootMode)
Definition: GameObject.h:286
GameObjectTemplate const * GetGOInfo() const
Definition: GameObject.h:184
GOState GetGoState() const
Definition: GameObject.h:262
time_t m_respawnTime
Definition: GameObject.h:433
time_t m_cooldownTime
Definition: GameObject.h:441
void AddUse()
Definition: GameObject.h:301
void RemoveFlag(GameObjectFlags flags)
Definition: GameObject.h:256
uint32 GetGoArtKit() const
Definition: GameObject.h:266
bool HasFlag(GameObjectFlags flags) const
Definition: GameObject.h:254
float GetStationaryZ() const override
Definition: GameObject.h:383
GameObjectData const * m_goData
Definition: GameObject.h:457
LootState getLootState() const
Definition: GameObject.h:279
uint32 GetSpellId() const
Definition: GameObject.h:230
uint8 GetGoAnimProgress() const
Definition: GameObject.h:268
int64 m_packedRotation
Definition: GameObject.h:463
Position m_stationaryPosition
Definition: GameObject.h:465
QuaternionData const & GetLocalRotation() const
Definition: GameObject.h:200
time_t m_restockTime
Definition: GameObject.h:440
uint32 GetUniqueUseCount() const
Definition: GameObject.h:304
void ReplaceAllFlags(GameObjectFlags flags)
Definition: GameObject.h:257
uint32 GetFaction() const override
Definition: GameObject.h:369
uint16 m_LootMode
Definition: GameObject.h:468
std::unordered_map< ObjectGuid, std::unique_ptr< Loot > > m_personalLoot
Definition: GameObject.h:309
void SetGoAnimProgress(uint8 animprogress)
Definition: GameObject.h:269
ObjectGuid m_lootStateUnitGUID
Definition: GameObject.h:438
float GetStationaryY() const override
Definition: GameObject.h:382
bool isSpawned() const
Definition: GameObject.h:237
void SetOwnerGUID(ObjectGuid owner)
Definition: GameObject.h:213
bool isSpawnedByDefault() const
Definition: GameObject.h:243
ChairSlotAndUser ChairListSlots
Definition: GameObject.h:452
bool HasLootMode(uint16 lootMode) const
Definition: GameObject.h:284
GameObjectValue const * GetGOValue() const
Definition: GameObject.h:188
void SetFlag(GameObjectFlags flags)
Definition: GameObject.h:255
uint16 GetAIAnimKitId() const override
Definition: GameObject.h:402
uint32 m_spellId
Definition: GameObject.h:432
time_t GetRespawnTime() const
Definition: GameObject.h:232
void SetWorldEffectID(uint32 worldEffectID)
Definition: GameObject.h:406
bool HasLootRecipient() const
Definition: GameObject.h:314
void AddToSkillupList(ObjectGuid const &PlayerGuidLow)
Definition: GameObject.h:293
float GetStationaryX() const override
Definition: GameObject.h:381
uint32 m_respawnDelayTime
Definition: GameObject.h:434
GameObjectAI * AI() const
Definition: GameObject.h:359
void ResetLootMode()
Definition: GameObject.h:288
GuidSet m_unique_users
Definition: GameObject.h:448
void RemoveLootMode(uint16 lootMode)
Definition: GameObject.h:287
void SetSpawnedByDefault(bool b)
Definition: GameObject.h:244
bool IsInSkillupList(ObjectGuid const &playerGuid) const
Definition: GameObject.h:294
void SetRespawnCompatibilityMode(bool mode=true)
Definition: GameObject.h:354
GameobjectTypes GetGoType() const
Definition: GameObject.h:260
Transport const * ToTransport() const
Definition: GameObject.h:379
void SetGoType(GameobjectTypes type)
Definition: GameObject.h:261
uint32 m_despawnDelay
Definition: GameObject.h:435
Seconds m_despawnRespawnTime
Definition: GameObject.h:436
QuaternionData m_localRotation
Definition: GameObject.h:464
void SetLinkedTrap(GameObject *linkedTrap)
Definition: GameObject.h:318
GameObjectData const * GetGameObjectData() const
Definition: GameObject.h:187
bool m_respawnCompatibilityMode
Definition: GameObject.h:485
GameObjectTemplateAddon const * m_goTemplateAddon
Definition: GameObject.h:456
ObjectGuid::LowType GetSpawnId() const
Definition: GameObject.h:194
GuidUnorderedSet m_tapList
Definition: GameObject.h:467
bool GetRespawnCompatibilityMode()
Definition: GameObject.h:355
GameObjectAI * m_AI
Definition: GameObject.h:484
uint32 GetDisplayId() const
Definition: GameObject.h:366
int64 GetPackedLocalRotation() const
Definition: GameObject.h:201
GameObjectModel * m_model
Definition: GameObject.h:372
std::unique_ptr< Loot > m_loot
Definition: GameObject.h:308
void SetLevel(uint32 level)
Definition: GameObject.h:259
UF::UpdateField< UF::GameObjectData, 0, TYPEID_GAMEOBJECT > m_gameObjectData
Definition: GameObject.h:427
Optional< std::string > m_scriptStringId
Definition: GameObject.h:461
std::array< std::string_view, 3 > const & GetStringIds() const
Definition: GameObject.h:363
GameObjectTemplateAddon const * GetTemplateAddon() const
Definition: GameObject.h:185
void SetLootMode(uint16 lootMode)
Definition: GameObject.h:285
uint32 GetUseCount() const
Definition: GameObject.h:303
void RelocateStationaryPosition(float x, float y, float z, float o)
Definition: GameObject.h:386
uint16 _animKitId
Definition: GameObject.h:486
GameObjectTemplate const * m_goInfo
Definition: GameObject.h:455
GuidUnorderedSet const & GetTapList() const
Definition: GameObject.h:311
ObjectGuid::LowType m_spawnId
For new or temporary gameobjects is 0 for saved it is lowguid.
Definition: GameObject.h:454
std::map< uint32, ObjectGuid > ChairSlotAndUser
Definition: GameObject.h:451
ObjectGuid m_linkedTrap
Definition: GameObject.h:470
Position const & GetStationaryPosition() const
Definition: GameObject.h:385
uint16 GetLootMode() const
Definition: GameObject.h:283
TransportBase * ToTransportBase()
Definition: GameObject.h:375
std::array< std::string_view, 3 > m_stringIds
Definition: GameObject.h:460
Transport * ToTransport()
Definition: GameObject.h:378
void ClearSkillupList()
Definition: GameObject.h:298
bool m_spawnedByDefault
Definition: GameObject.h:439
GameObjectDestructibleState GetDestructibleState() const
Definition: GameObject.h:344
uint32 GetWorldEffectID() const
Definition: GameObject.h:405
std::unique_ptr< std::unordered_map< ObjectGuid, PerPlayerState > > m_perPlayerState
Definition: GameObject.h:496
float GetStationaryO() const override
Definition: GameObject.h:384
LootState m_lootState
Definition: GameObject.h:437
void SetTapList(GuidUnorderedSet tapList)
Definition: GameObject.h:312
std::unique_ptr< GameObjectTypeBase > m_goTypeImpl
Definition: GameObject.h:458
ObjectGuid m_ritualOwnerGUID
Definition: GameObject.h:447
uint32 m_usetimes
Definition: GameObject.h:449
void SetSpellId(uint32 id)
Definition: GameObject.h:225
GOState m_prevGoState
Definition: GameObject.h:443
void SetFaction(uint32 faction) override
Definition: GameObject.h:370
GuidSet m_SkillupList
Definition: GameObject.h:445
Definition: Map.h:187
static ObjectGuid const Empty
Definition: ObjectGuid.h:272
bool IsEmpty() const
Definition: ObjectGuid.h:317
uint64 LowType
Definition: ObjectGuid.h:276
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:158
Definition: Unit.h:747
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition: Object.cpp:1138
Definition: wmo.h:163
Optional< GOState > State
Definition: GameObject.h:492
ValuesUpdateForPlayerWithMaskSender(GameObject const *owner)
Definition: GameObject.h:164
Definition: Loot.h:281
float GetPositionZ() const
Definition: Position.h:78
float GetPositionX() const
Definition: Position.h:76
float GetPositionY() const
Definition: Position.h:77
UpdateField< uint32, 0, 12 > Flags
UpdateField< ObjectGuid, 0, 10 > CreatedBy
UpdateField< int8, 0, 16 > TypeID
UpdateField< int32, 0, 20 > Level
UpdateField< uint8, 0, 17 > PercentHealth
UpdateField< int32, 0, 14 > FactionTemplate
uint32 id
Definition: EventMap.cpp:184
eventMap Update(1s)
TeamId LastTeamCapture
Definition: GameObject.h:126
struct GameObjectValue::@208 Building
uint32 AssaultTimer
Definition: GameObject.h:128
OPvPCapturePoint * OPvPObj
Definition: GameObject.h:115
WorldPackets::Battleground::BattlegroundCapturePointState State
Definition: GameObject.h:127
struct GameObjectValue::@209 CapturePoint
uint32 MaxHealth
Definition: GameObject.h:121
struct GameObjectValue::@206 FishingHole
struct GameObjectValue::@207 ControlZone