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