OregonCore  revision be9e804-git
Your Favourite TBC server
Object.h
Go to the documentation of this file.
1 /*
2  * This file is part of the OregonCore 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 <https://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef _OBJECT_H
19 #define _OBJECT_H
20 
21 #include "Common.h"
22 #include "Position.h"
23 #include "ByteBuffer.h"
24 #include "UpdateFields.h"
25 #include "UpdateData.h"
27 #include "ObjectGuid.h"
28 #include "GridDefines.h"
29 #include "Map.h"
30 
31 #include <set>
32 #include <string>
33 
34 #define CONTACT_DISTANCE 0.5f
35 #define INTERACTION_DISTANCE 5.0f
36 #define ATTACK_DISTANCE 5.0f
37 #define INSPECT_DISTANCE 28.0f
38 #define MAX_VISIBILITY_DISTANCE SIZE_OF_GRIDS // max distance for visible object show
39 #define SIGHT_RANGE_UNIT 50.0f
40 #define VISIBILITY_DISTANCE_GIGANTIC 400.0f
41 #define VISIBILITY_DISTANCE_LARGE 200.0f
42 #define VISIBILITY_DISTANCE_NORMAL 100.0f
43 #define VISIBILITY_DISTANCE_SMALL 50.0f
44 #define VISIBILITY_DISTANCE_TINY 25.0f
45 #define DEFAULT_VISIBILITY_DISTANCE VISIBILITY_DISTANCE_NORMAL // default visible distance, 100 yards on continents
46 #define DEFAULT_VISIBILITY_INSTANCE 170.0f // default visible distance in instances, 170 yards
47 #define DEFAULT_VISIBILITY_BGARENAS 533.0f // default visible distance in BG/Arenas, roughly 533 yards
48 
49 #define DEFAULT_WORLD_OBJECT_SIZE 0.388999998569489f // player size, also currently used (correctly?) for any non Unit world objects
50 #define DEFAULT_COMBAT_REACH 1.5f
51 #define MIN_MELEE_REACH 2.0f
52 #define NOMINAL_MELEE_RANGE 5.0f
53 #define MELEE_RANGE (NOMINAL_MELEE_RANGE - MIN_MELEE_REACH * 2) //center to center for players
54 
55 #define GRID_SEARCH_ALL_ENTRIES 0
56 
58 
60 {
61  NOTIFY_NONE = 0x00,
64  NOTIFY_ALL = 0xFF
65 };
66 
68 {
69  MOVEMENTFLAG_NONE = 0x00000000,
70  MOVEMENTFLAG_FORWARD = 0x00000001,
71  MOVEMENTFLAG_BACKWARD = 0x00000002,
74  MOVEMENTFLAG_TURN_LEFT = 0x00000010,
76  MOVEMENTFLAG_PITCH_UP = 0x00000040,
78  MOVEMENTFLAG_WALK_MODE = 0x00000100, // Walking
79  MOVEMENTFLAG_ONTRANSPORT = 0x00000200, // Used for flying on some creatures
81  MOVEMENTFLAG_ROOT = 0x00000800,
82  MOVEMENTFLAG_FALLING = 0x00001000,
84  MOVEMENTFLAG_SWIMMING = 0x00200000, // appears with fly flag also
85  MOVEMENTFLAG_ASCENDING = 0x00400000, // swim up also
86  MOVEMENTFLAG_CAN_FLY = 0x00800000,
87  MOVEMENTFLAG_FLYING = 0x01000000,
88  MOVEMENTFLAG_FLYING2 = 0x02000000, // Actual flying mode
89  MOVEMENTFLAG_SPLINE_ELEVATION = 0x04000000, // used for flight paths
90  MOVEMENTFLAG_SPLINE_ENABLED = 0x08000000, // used for flight paths
91  MOVEMENTFLAG_WATERWALKING = 0x10000000, // prevent unit from falling through water
92  MOVEMENTFLAG_SAFE_FALL = 0x20000000, // Feather Fall (spell)
93  MOVEMENTFLAG_HOVER = 0x40000000,
94 
100 
103 
106 };
107 
108 namespace Movement
109 {
110  class MoveSpline;
111 }
112 
114 {
115  PHASEMASK_NORMAL = 0x00000001,
116  PHASEMASK_ANYWHERE = 0xFFFFFFFF
117 };
118 
120 {
127 };
128 
129 class WorldPacket;
130 class UpdateData;
131 class ByteBuffer;
132 class WorldSession;
133 class Creature;
134 class Player;
135 class UpdateMask;
136 class InstanceData;
137 class GameObject;
138 class TempSummon;
139 class CreatureAI;
140 class ZoneScript;
141 class Unit;
142 
143 typedef UNORDERED_MAP<Player*, UpdateData> UpdateDataMapType;
144 
145 class Object
146 {
147  public:
148  virtual ~Object ();
149 
150  const bool& IsInWorld() const
151  {
152  return m_inWorld;
153  }
154  virtual void AddToWorld()
155  {
156  if (m_inWorld)
157  return;
158 
159  ASSERT(m_uint32Values);
160 
161  m_inWorld = true;
162 
163  // synchronize values mirror with values array (changes will send in updatecreate opcode any way
164  ClearUpdateMask(true);
165  }
166  virtual void RemoveFromWorld()
167  {
168  if (!m_inWorld)
169  return;
170 
171  m_inWorld = false;
172 
173  // if we remove from world then sending changes not required
174  ClearUpdateMask(true);
175  }
176 
177  uint64 GetGUID() const { return GetUInt64Value(0); }
178  uint32 GetGUIDLow() const { return GUID_LOPART(GetUInt64Value(0)); }
179  uint32 GetGUIDMid() const { return GUID_ENPART(GetUInt64Value(0)); }
180  uint32 GetGUIDHigh() const { return GUID_HIPART(GetUInt64Value(0)); }
181  PackedGuid const& GetPackGUID() const { return m_PackGUID; }
182  ObjectGuid const& GetObjectGUID() const { return GetGuidValue(OBJECT_FIELD_GUID); }
183 
184  std::string GetGuidStr() const { return GetObjectGUID().GetString(); }
185 
186  uint32 GetEntry() const { return GetUInt32Value(OBJECT_FIELD_ENTRY); }
187  void SetEntry(uint32 entry) { SetUInt32Value(OBJECT_FIELD_ENTRY, entry); }
188 
189  float GetObjectScale() const { return GetFloatValue(OBJECT_FIELD_SCALE_X); }
190  void SetObjectScale(float scale) { SetFloatValue(OBJECT_FIELD_SCALE_X, scale); }
191 
192  uint8 GetTypeId() const { return m_objectTypeId; }
193  bool isType(uint16 mask) const { return (mask & m_objectType); }
194 
195  virtual void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const;
196  void SendUpdateToPlayer(Player* player);
197 
198  void BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target) const;
199  void BuildOutOfRangeUpdateBlock(UpdateData* data) const;
200  void BuildMovementUpdateBlock(UpdateData* data, uint32 flags = 0) const;
201 
202  virtual void DestroyForPlayer(Player* target, bool onDeath = false) const;
203 
204  const int32& GetInt32Value(uint16 index) const
205  {
206  ASSERT(index < m_valuesCount || PrintIndexError(index , false));
207  return m_int32Values[ index ];
208  }
209 
210  const uint32& GetUInt32Value(uint16 index) const
211  {
212  ASSERT(index < m_valuesCount || PrintIndexError(index , false));
213  return m_uint32Values[ index ];
214  }
215 
216  const uint64& GetUInt64Value(uint16 index) const
217  {
218  ASSERT(index + 1 < m_valuesCount || PrintIndexError(index , false));
219  return *((uint64*) & (m_uint32Values[ index ]));
220  }
221 
222  const float& GetFloatValue(uint16 index) const
223  {
224  ASSERT(index < m_valuesCount || PrintIndexError(index , false));
225  return m_floatValues[ index ];
226  }
227 
228  uint8 GetByteValue(uint16 index, uint8 offset) const
229  {
230  ASSERT(index < m_valuesCount || PrintIndexError(index , false));
231  ASSERT(offset < 4);
232  return *(((uint8*)&m_uint32Values[ index ]) + offset);
233  }
234 
235  ObjectGuid const& GetGuidValue(uint16 index) const
236  {
237  return *reinterpret_cast<ObjectGuid const*>(&GetUInt64Value(index));
238  }
239 
240  uint16 GetUInt16Value(uint16 index, uint8 offset) const
241  {
242  ASSERT(index < m_valuesCount || PrintIndexError(index , false));
243  ASSERT(offset < 2);
244  return *(((uint16*)&m_uint32Values[ index ]) + offset);
245  }
246 
247  void SetInt32Value( uint16 index, int32 value);
248  void SetUInt32Value(uint16 index, uint32 value);
249  void SetUInt64Value(uint16 index, const uint64& value);
250  void SetFloatValue( uint16 index, float value);
251  void SetByteValue( uint16 index, uint8 offset, uint8 value);
252  void SetUInt16Value(uint16 index, uint8 offset, uint16 value);
253  void SetInt16Value( uint16 index, uint8 offset, int16 value)
254  {
255  SetUInt16Value(index, offset, (uint16)value);
256  }
257  void SetStatFloatValue(uint16 index, float value);
258  void SetStatInt32Value(uint16 index, int32 value);
259 
260  bool AddUInt64Value(uint16 index, const uint64& value);
261  bool RemoveUInt64Value(uint16 index, const uint64& value);
262 
263  void ApplyModUInt32Value(uint16 index, int32 val, bool apply);
264  void ApplyModInt32Value(uint16 index, int32 val, bool apply);
265  void ApplyModUInt64Value(uint16 index, int32 val, bool apply);
266  void ApplyModPositiveFloatValue(uint16 index, float val, bool apply);
267  void ApplyModSignedFloatValue(uint16 index, float val, bool apply);
268  void ApplyPercentModFloatValue(uint16 index, float val, bool apply);
269 
270  void SetFlag(uint16 index, uint32 newFlag);
271  void RemoveFlag(uint16 index, uint32 oldFlag);
272 
273  void ToggleFlag(uint16 index, uint32 flag)
274  {
275  if (HasFlag(index, flag))
276  RemoveFlag(index, flag);
277  else
278  SetFlag(index, flag);
279  }
280 
281  bool HasFlag(uint16 index, uint32 flag) const
282  {
283  ASSERT(index < m_valuesCount || PrintIndexError(index , false));
284  return (m_uint32Values[ index ] & flag) != 0;
285  }
286 
287  void SetByteFlag(uint16 index, uint8 offset, uint8 newFlag);
288  void RemoveByteFlag(uint16 index, uint8 offset, uint8 newFlag);
289 
290  void ToggleFlag(uint16 index, uint8 offset, uint8 flag)
291  {
292  if (HasByteFlag(index, offset, flag))
293  RemoveByteFlag(index, offset, flag);
294  else
295  SetByteFlag(index, offset, flag);
296  }
297 
298  bool HasByteFlag(uint16 index, uint8 offset, uint8 flag) const
299  {
300  ASSERT(index < m_valuesCount || PrintIndexError(index , false));
301  ASSERT(offset < 4);
302  return (((uint8*)&m_uint32Values[index])[offset] & flag) != 0;
303  }
304 
305  void ApplyModFlag(uint16 index, uint32 flag, bool apply)
306  {
307  if (apply) SetFlag(index, flag);
308  else RemoveFlag(index, flag);
309  }
310 
311  void SetFlag64(uint16 index, uint64 newFlag)
312  {
313  uint64 oldval = GetUInt64Value(index);
314  uint64 newval = oldval | newFlag;
315  SetUInt64Value(index, newval);
316  }
317 
318  void RemoveFlag64(uint16 index, uint64 oldFlag)
319  {
320  uint64 oldval = GetUInt64Value(index);
321  uint64 newval = oldval & ~oldFlag;
322  SetUInt64Value(index, newval);
323  }
324 
325  void ToggleFlag64(uint16 index, uint64 flag)
326  {
327  if (HasFlag64(index, flag))
328  RemoveFlag64(index, flag);
329  else
330  SetFlag64(index, flag);
331  }
332 
333  bool HasFlag64(uint16 index, uint64 flag) const
334  {
335  ASSERT(index < m_valuesCount || PrintIndexError(index , false));
336  return (GetUInt64Value(index) & flag) != 0;
337  }
338 
339  void ApplyModFlag64(uint16 index, uint64 flag, bool apply)
340  {
341  if (apply) SetFlag64(index, flag);
342  else RemoveFlag64(index, flag);
343  }
344 
345  void ClearUpdateMask(bool remove);
346 
347  bool LoadValues(const char* data);
348 
350  {
351  return m_valuesCount;
352  }
353 
354  virtual bool hasQuest(uint32 /* quest_id */) const
355  {
356  return false;
357  }
358  virtual bool hasInvolvedQuest(uint32 /* quest_id */) const
359  {
360  return false;
361  }
362  virtual void BuildUpdate(UpdateDataMapType&) {}
363  void BuildFieldsUpdate(Player*, UpdateDataMapType&) const;
364 
365  // FG: some hacky helpers
366  void ForceValuesUpdateAtIndex(uint32);
367 
368  Player* ToPlayer() { if (GetTypeId() == TYPEID_PLAYER) return reinterpret_cast<Player*>(this); else return NULL; }
369  Player const* ToPlayer() const { if (GetTypeId() == TYPEID_PLAYER) return reinterpret_cast<Player const*>(this); else return NULL; }
370 
371  Creature* ToCreature() { if (GetTypeId() == TYPEID_UNIT) return reinterpret_cast<Creature*>(this); else return NULL; }
372  Creature const* ToCreature() const { if (GetTypeId() == TYPEID_UNIT) return reinterpret_cast<Creature const*>(this); else return NULL; }
373 
374  Unit* ToUnit() { if (isType(TYPEMASK_UNIT)) return reinterpret_cast<Unit*>(this); else return NULL; }
375  Unit const* ToUnit() const { if (isType(TYPEMASK_UNIT)) return reinterpret_cast<Unit const*>(this); else return NULL; }
376 
377  GameObject* ToGameObject() { if (GetTypeId() == TYPEID_GAMEOBJECT) return reinterpret_cast<GameObject*>(this); else return NULL; }
378  GameObject const* ToGameObject() const { if (GetTypeId() == TYPEID_GAMEOBJECT) return reinterpret_cast<GameObject const*>(this); else return NULL; }
379 
380  Corpse* ToCorpse() { if (GetTypeId() == TYPEID_CORPSE) return reinterpret_cast<Corpse*>(this); else return NULL; }
381  Corpse const* ToCorpse() const { if (GetTypeId() == TYPEID_CORPSE) return reinterpret_cast<Corpse const*>(this); else return NULL; }
382 
383  DynamicObject* ToDynObject() { if (GetTypeId() == TYPEID_DYNAMICOBJECT) return reinterpret_cast<DynamicObject*>(this); else return NULL; }
384  DynamicObject const* ToDynObject() const { if (GetTypeId() == TYPEID_DYNAMICOBJECT) return reinterpret_cast<DynamicObject const*>(this); else return NULL; }
385 
386  protected:
387 
388  Object ();
389 
390  void _InitValues();
391  void _Create (uint32 guidlow, uint32 entry, HighGuid guidhigh);
392  void _LoadIntoDataField(const char* data, uint32 startOffset, uint32 count);
393 
394  virtual void _SetUpdateBits(UpdateMask* updateMask, Player* target) const;
395 
396  virtual void _SetCreateBits(UpdateMask* updateMask, Player* target) const;
397  void _BuildMovementUpdate(ByteBuffer* data, uint8 updateFlags) const;
398  void _BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, UpdateMask* updateMask, Player* target) const;
399 
401 
404 
405  union
406  {
410  };
411 
413 
415 
417 
418  private:
419  bool m_inWorld;
420 
422 
423  // for output helpfull error messages from asserts
424  bool PrintIndexError(uint32 index, bool set) const;
425  Object(const Object&); // prevent generation copy constructor
426  Object& operator=(Object const&); // prevent generation assigment operator
427 };
428 
430 {
431  uint32 moveFlags; // see enum MovementFlags
435  // transport
439  // swimming and unknown
440  float s_pitch;
441  // last fall time
443  // jumping
444  float j_velocity, j_sinAngle, j_cosAngle, j_xyspeed;
445  // spline
446  float u_unk1;
447  MovementInfo() : moveFlags(MOVEMENTFLAG_NONE), moveFlags2(0), time(0), t_guid(0),
448  t_time(0), s_pitch(0.0f), fallTime(0), j_velocity(0.0f), j_sinAngle(0.0f),
449  j_cosAngle(0.0f), j_xyspeed(0.0f), u_unk1(0.0f)
450  {
451  t_pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
452  }
453 
454  // Read/Write methods
455  void Read(ByteBuffer& data);
456  void Write(ByteBuffer& data) const;
457 
458  // Movement flags manipulations
460  {
461  moveFlags |= f;
462  }
464  {
465  moveFlags &= ~f;
466  }
468  {
469  return moveFlags & f;
470  }
472  {
473  return MovementFlags(moveFlags);
474  }
476  {
477  moveFlags = f;
478  }
479 
480  // Position manipulations
481  Position const* GetPos() const
482  {
483  return &pos;
484  }
485  void SetTransportData(uint64 guid, float x, float y, float z, float o, uint32 time)
486  {
487  t_guid = guid;
488  t_pos.m_positionX = x;
489  t_pos.m_positionY = y;
490  t_pos.m_positionZ = z;
491  t_pos.SetOrientation(o);
492  t_time = time;
493  }
495  {
496  t_guid = 0;
497  t_pos.m_positionX = 0.0f;
498  t_pos.m_positionY = 0.0f;
499  t_pos.m_positionZ = 0.0f;
500  t_pos.SetOrientation(0.0f);
501  t_time = 0;
502  }
503  uint64 const& GetTransportGuid() const
504  {
505  return t_guid;
506  }
507  Position const* GetTransportPos() const
508  {
509  return &t_pos;
510  }
512  {
513  return t_time;
514  }
516  {
517  return fallTime;
518  }
519  void ChangePosition(float x, float y, float z, float o)
520  {
521  pos.m_positionX = x;
522  pos.m_positionY = y;
523  pos.m_positionZ = z;
524  pos.SetOrientation(o);
525  }
526  void UpdateTime(uint32 _time)
527  {
528  time = _time;
529  }
530 
531  //private:
532  // common
533 };
534 
536 {
537  mi.Write(buf);
538  return buf;
539 }
540 
542 {
543  mi.Read(buf);
544  return buf;
545 }
546 
547 #define MAPID_INVALID 0xFFFFFFFF
548 
549 class WorldLocation : public Position
550 {
551  public:
552  explicit WorldLocation(uint32 _mapid = MAPID_INVALID, float _x = 0, float _y = 0, float _z = 0, float _o = 0)
553  : m_mapId(_mapid)
554  {
555  Relocate(_x, _y, _z, _o);
556  }
558  {
559  WorldRelocate(loc);
560  }
561 
562  void WorldRelocate(const WorldLocation& loc)
563  {
564  m_mapId = loc.GetMapId();
565  Relocate(loc);
566  }
567  uint32 GetMapId() const
568  {
569  return m_mapId;
570  }
571 
573 };
574 
575 template<class T>
577 {
578  public:
579  bool IsInGrid() const { return _gridRef.isValid(); }
580  void AddToGrid(GridRefManager<T>& m) { ASSERT(!IsInGrid()); _gridRef.link(&m, (T*)this); }
581  void RemoveFromGrid() { ASSERT(IsInGrid()); _gridRef.unlink(); }
582  private:
584 };
585 
586 template <class T_VALUES, class T_FLAGS, class FLAG_TYPE, uint8 ARRAY_SIZE>
588 {
589  public:
591  {
592  memset(&m_values, 0x00, sizeof(T_VALUES) * ARRAY_SIZE);
593  m_flags = 0;
594  }
595 
596  T_FLAGS GetFlags() const { return m_flags; }
597  bool HasFlag(FLAG_TYPE flag) const { return m_flags & (1 << flag); }
598  void AddFlag(FLAG_TYPE flag) { m_flags |= (1 << flag); }
599  void DelFlag(FLAG_TYPE flag) { m_flags &= ~(1 << flag); }
600 
601  T_VALUES GetValue(FLAG_TYPE flag) const { return m_values[flag]; }
602  void SetValue(FLAG_TYPE flag, T_VALUES value) { m_values[flag] = value; }
603  void AddValue(FLAG_TYPE flag, T_VALUES value) { m_values[flag] += value; }
604 
605  private:
606  T_VALUES m_values[ARRAY_SIZE];
607  T_FLAGS m_flags;
608 };
609 
610 class WorldObject : public Object, public WorldLocation
611 {
612  public:
613  ~WorldObject() override;
614 
615  virtual void Update (uint32 /*time_diff*/) { }
616 
617  void _Create(uint32 guidlow, HighGuid guidhigh, uint32 phaseMask);
618  virtual void RemoveFromWorld() override;
619 
620  void GetNearPoint2D(float& x, float& y, float distance, float absAngle) const;
621  void GetNearPoint(WorldObject const* searcher, float& x, float& y, float& z, float searcher_size, float distance2d, float absAngle) const;
622  void GetClosePoint(float& x, float& y, float& z, float size, float distance2d = 0, float angle = 0) const
623  {
624  // angle calculated from current orientation
625  GetNearPoint(NULL, x, y, z, size, distance2d, GetOrientation() + angle);
626  }
627  void MovePosition(Position& pos, float dist, float angle);
628  Position GetNearPosition(float dist, float angle);
629  void MovePositionToFirstCollision(Position& pos, float dist, float angle);
630  Position GetFirstCollisionPosition(float dist, float angle);
631  float GetPositionZTarget(Position& pos, float destx, float desty);
632  Position GetRandomNearPosition(float radius);
633 
634  void GetContactPoint(const WorldObject* obj, float& x, float& y, float& z, float distance2d = CONTACT_DISTANCE) const
635  {
636  // angle to face `obj` to `this` using distance includes size of `obj`
637  GetNearPoint(obj, x, y, z, obj->GetObjectSize(), distance2d, GetAngle(obj));
638  }
639 
640  virtual float GetObjectBoundingRadius() const
641  {
643  }
644 
645  float GetObjectSize() const
646  {
647  return (m_valuesCount > UNIT_FIELD_COMBATREACH) ? m_floatValues[UNIT_FIELD_COMBATREACH] : DEFAULT_WORLD_OBJECT_SIZE;
648  }
649  void UpdateGroundPositionZ(float x, float y, float& z) const;
650  void UpdateAllowedPositionZ(float x, float y, float& z) const;
651 
652  void GetRandomPoint(const Position& srcPos, float distance, float& rand_x, float& rand_y, float& rand_z) const;
653  void GetRandomPoint(const Position& srcPos, float distance, Position& pos) const
654  {
655  float x, y, z;
656  GetRandomPoint(srcPos, distance, x, y, z);
657  pos.Relocate(x, y, z, GetOrientation());
658  }
659 
660  float GetDistanceSqr(float x, float y, float z) const;
661  bool HasInArc(float arcangle, const Position* pos) const;
662  bool HasInArc(const float arcangle, const float x, const float y) const;
663 
665  {
666  return m_InstanceId;
667  }
668 
669  virtual void SetPhaseMask(uint32 newPhaseMask, bool update);
670  uint32 GetPhaseMask() const { return m_phaseMask; }
671  bool InSamePhase(uint32 phasemask) const { return (GetPhaseMask() & phasemask) != 0; }
672  bool InSamePhase(WorldObject const* obj) const { return obj && InSamePhase(obj->GetPhaseMask()); }
673  static bool InSamePhase(WorldObject const* a, WorldObject const* b) { return a && a->InSamePhase(b); }
674 
675  uint32 GetZoneId() const;
676  uint32 GetAreaId() const;
677 
678  InstanceData* GetInstanceData();
679 
680  const char* GetName() const
681  {
682  return m_name.c_str();
683  }
684  void SetName(const std::string& newname)
685  {
686  m_name = newname;
687  }
688 
689  virtual const char* GetNameForLocaleIdx(int32 /*locale_idx*/) const
690  {
691  return GetName();
692  }
693 
694  float GetDistance(const WorldObject* obj) const
695  {
696  float d = GetExactDist(obj) - GetObjectSize() - obj->GetObjectSize();
697  return d > 0.0f ? d : 0.0f;
698  }
699  float GetDistance(const Position& pos) const
700  {
701  float d = GetExactDist(&pos) - GetObjectSize();
702  return d > 0.0f ? d : 0.0f;
703  }
704  float GetDistance(float x, float y, float z) const
705  {
706  float d = GetExactDist(x, y, z) - GetObjectSize();
707  return d > 0.0f ? d : 0.0f;
708  }
709  float GetDistance2d(const WorldObject* obj) const
710  {
711  float d = GetExactDist2d(obj) - GetObjectSize() - obj->GetObjectSize();
712  return d > 0.0f ? d : 0.0f;
713  }
714  float GetDistance2d(float x, float y) const
715  {
716  float d = GetExactDist2d(x, y) - GetObjectSize();
717  return d > 0.0f ? d : 0.0f;
718  }
719  float GetDistanceZ(const WorldObject* obj) const;
720 
721  bool IsInMap(const WorldObject* obj) const
722  {
723  if (obj)
724  return IsInWorld() && obj->IsInWorld() && (GetMap() == obj->GetMap()) && InSamePhase(obj);
725  else
726  return false;
727  }
728  bool IsWithinDist3d(float x, float y, float z, float dist) const
729  {
730  return IsInDist(x, y, z, dist + GetObjectSize());
731  }
732  bool IsWithinDist3d(const Position* pos, float dist) const
733  {
734  return IsInDist(pos, dist + GetObjectSize());
735  }
736  bool IsWithinDist2d(float x, float y, float dist) const
737  {
738  return IsInDist2d(x, y, dist + GetObjectSize());
739  }
740  bool IsWithinDist2d(const Position* pos, float dist) const
741  {
742  return IsInDist2d(pos, dist + GetObjectSize());
743  }
744  bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D) const;
745  // use only if you will sure about placing both object at same map
746  bool IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D = true) const
747  {
748  return obj && _IsWithinDist(obj, dist2compare, is3D);
749  }
750  bool IsWithinDistInMap(WorldObject const* obj, float dist2compare, bool is3D = true) const
751  {
752  return obj && IsInMap(obj) && _IsWithinDist(obj, dist2compare, is3D);
753  }
754  bool IsWithinLOS(float x, float y, float z) const;
755  bool IsWithinLOSInMap(const WorldObject* obj) const;
756  Position GetHitSpherePointFor(Position const& dest) const;
757  void GetHitSpherePointFor(Position const& dest, float& x, float& y, float& z) const;
758  bool GetDistanceOrder(WorldObject const* obj1, WorldObject const* obj2, bool is3D = true) const;
759  bool IsInRange(WorldObject const* obj, float minRange, float maxRange, bool is3D = true) const;
760  bool IsInRange2d(float x, float y, float minRange, float maxRange) const;
761  bool IsInRange3d(float x, float y, float z, float minRange, float maxRange) const;
762 
763  virtual void CleanupsBeforeDelete(); // used in destructor or explicitly before mass creature delete to remove cross-references to already deleted units
764 
765  virtual void SendMessageToSet(WorldPacket *data, bool self) { SendMessageToSetInRange(data, GetVisibilityRange(), self); }
766  virtual void SendMessageToSetInRange(WorldPacket* data, float dist, bool self);
767 
768  virtual uint8 getLevelForTarget(WorldObject const* /*target*/) const { return 1; }
769 
770  void MonsterSay(const char* text, uint32 language, uint64 TargetGuid);
771  void MonsterYell(const char* text, uint32 language, uint64 TargetGuid);
772  void MonsterTextEmote(const char* text, uint64 TargetGuid, bool IsBossEmote = false);
773  void MonsterWhisper(const char* text, uint64 receiver, bool IsBossWhisper = false);
774  void MonsterSay(int32 textId, uint32 language, uint64 TargetGuid);
775  void MonsterYell(int32 textId, uint32 language, uint64 TargetGuid);
776  void MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote = false);
777  void MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper = false);
778  void MonsterYellToZone(int32 textId, uint32 language, uint64 TargetGuid);
779  void BuildMonsterChat(WorldPacket* data, uint8 msgtype, char const* text, uint32 language, char const* name, uint64 TargetGuid) const;
780 
781  void PlayDistanceSound(uint32 sound_id, Player* target = NULL);
782  void PlayDirectSound(uint32 sound_id, Player* target = NULL);
783 
784  void SendObjectDeSpawnAnim(uint64 guid);
785  void SendObjectCustomAnim(uint64 guid, uint32 anim = 0);
786 
787  virtual void SaveRespawnTime() {}
788  void AddObjectToRemoveList();
789 
790  virtual bool isValid() const;
791 
792  virtual bool IsNeverVisible() const { return !IsInWorld(); }
793  virtual bool IsAlwaysVisibleFor(WorldObject const* /*seer*/) const { return false; }
794  virtual bool IsInvisibleDueToDespawn() const { return false; }
795  //difference from IsAlwaysVisibleFor: 1. after distance check; 2. use owner or charmer as seer
796  virtual bool IsAlwaysDetectableFor(WorldObject const* /*seer*/) const { return false; }
797 
798  float GetGridActivationRange() const;
799  float GetVisibilityRange() const;
800  float GetSightRange(const WorldObject* target = NULL) const;
801  bool CanSeeOrDetect(WorldObject const* obj, bool ignoreStealth = false, bool distanceCheck = false, bool checkAlert = false) const;
802 
805 
808 
811 
812  // Low Level Packets
813  void SendPlaySound(uint32 Sound, bool OnlySelf);
814 
815  virtual void SetMap(Map* map);
816  virtual void ResetMap();
817  Map* GetMap() const { ASSERT(m_currMap); return m_currMap; }
818  Map* FindMap() const { return m_currMap; }
819  //used to check all object's GetMap() calls when object is not in world!
820 
821  //this function should be removed in nearest time...
822  Map const* GetBaseMap() const;
823 
824  void SetZoneScript();
825 
826  TempSummon* SummonCreature(uint32 id, const Position& pos, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0);
827  TempSummon* SummonCreature(uint32 id, float x, float y, float z, float ang, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0)
828  {
829  if (!x && !y && !z)
830  {
831  GetClosePoint(x, y, z, GetObjectSize());
832  ang = GetOrientation();
833  }
834  Position pos = {x, y, z, ang};
835  return SummonCreature(id, pos, spwtype, despwtime);
836  }
837  GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime);
838  Creature* SummonTrigger(float x, float y, float z, float ang, uint32 dur, CreatureAI * (*GetAI)(Creature*) = NULL);
839  void SummonCreatureGroup(uint8 group, std::list<TempSummon*>* list = NULL);
840 
841  Creature* FindNearestCreature(uint32 entry, float range, bool alive = true);
842  GameObject* FindNearestGameObject(uint32 entry, float range);
843  GameObject* FindNearestGameObjectOfType(GameobjectTypes type, float range) const;
844 
845  void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& gameobjectList, uint32 entry = GRID_SEARCH_ALL_ENTRIES, float maxSearchRange = 250.0f) const;
846  void GetCreatureListWithEntryInGrid(std::list<Creature*>& creatureList, uint32 entry = GRID_SEARCH_ALL_ENTRIES, float maxSearchRange = 250.0f) const;
847 
848  void DestroyForNearbyPlayers();
849  virtual void UpdateObjectVisibility(bool forced = true);
851  {
852  UpdateObjectVisibility(true);
853  }
854 
855  void BuildUpdate(UpdateDataMapType&) override;
856 
857  //relocation and visibility system functions
858  void AddToNotify(uint16 f) { m_notifyflags |= f; }
859  bool isNeedNotify(uint16 f) const { return (m_notifyflags & f) != 0; }
860  uint16 GetNotifyFlags() const { return m_notifyflags; }
861  bool NotifyExecuted(uint16 f) const
862  {
863  return m_executed_notifies & f;
864  }
866  {
867  m_executed_notifies |= f;
868  }
870  {
871  m_notifyflags = 0;
872  m_executed_notifies = 0;
873  }
874 
875  bool isActiveObject() const { return m_isActive; }
876  void setActive(bool isActiveObject);
877  bool IsVisibilityOverridden() const { return m_visibilityDistanceOverride != 0; }
878  void SetVisibilityDistanceOverride(VisibilityDistanceType type);
879  void SetWorldObject(bool apply);
880  bool IsPermanentWorldObject() const { return m_isWorldObject; }
881  bool IsWorldObject() const;
882 
883  template<class NOTIFIER> void VisitNearbyWorldObject(const float &radius, NOTIFIER &notifier) const { if (IsInWorld()) GetMap()->VisitWorld(GetPositionX(), GetPositionY(), radius, notifier); }
884  template<class NOTIFIER> void VisitNearbyObject(float const& radius, NOTIFIER& notifier) const { if (IsInWorld()) GetMap()->VisitAll(GetPositionX(), GetPositionY(), radius, notifier); }
885  template<class NOTIFIER> void VisitNearbyGridObject(float const& radius, NOTIFIER& notifier) const { if (IsInWorld()) GetMap()->VisitGrid(GetPositionX(), GetPositionY(), radius, notifier); }
886 
887  uint32 m_groupLootTimer; // (msecs)timer used for group loot
888  uint64 lootingGroupLeaderGUID; // used to find group which is looting corpse
889 
891 
892  protected:
893  explicit WorldObject(bool isWorldObject); //note: here it means if it is in grid object list or world object list
894  std::string m_name;
896  const bool m_isWorldObject;
899 
900  //these functions are used mostly for Relocate() and Corpse/Player specific stuff...
901  //use them ONLY in LoadFromDB()/Create() funcs and nowhere else!
902  //mapId/instanceId should be set in SetMap() function!
904  {
905  m_mapId = _mapId;
906  }
907  void SetLocationInstanceId(uint32 _instanceId)
908  {
909  m_InstanceId = _instanceId;
910  }
911 
912  private:
913  Map* m_currMap; //current object's Map location
914 
915  //uint32 m_mapId; // object at map with map_id
916  uint32 m_InstanceId; // in map copy with instance id
917  uint32 m_phaseMask; // in area phase state
918 
921 
922  bool CanNeverSee(WorldObject const* obj) const;
923  virtual bool CanAlwaysSee(WorldObject const* /*obj*/) const { return false; }
924  bool CanDetect(WorldObject const* obj, bool ignoreStealth, bool checkAlert = false) const;
925  bool CanDetectInvisibilityOf(WorldObject const* obj) const;
926  bool CanDetectStealthOf(WorldObject const* obj, bool checkAlert = false) const;
927 };
928 
929 namespace Oregon
930 {
931 // Binary predicate to sort WorldObjects based on the distance to a reference WorldObject
933 {
934  public:
935  ObjectDistanceOrderPred(const WorldObject* pRefObj, bool ascending = true) : m_refObj(pRefObj), m_ascending(ascending) {}
936  bool operator()(const WorldObject* pLeft, const WorldObject* pRight) const
937  {
938  return m_ascending ? m_refObj->GetDistanceOrder(pLeft, pRight) : !m_refObj->GetDistanceOrder(pLeft, pRight);
939  }
940  private:
942  const bool m_ascending;
943 };
944 }
945 
946 #endif
947 
despawns when UnSummon() is called
GameobjectTypes
Definition: Object.h:145
void operator<<(ByteBuffer &b, const Vector3 &v)
Definition: Corpse.h:48
float s_pitch
Definition: Object.h:440
const bool m_isWorldObject
Definition: Object.h:896
float GetDistance(float x, float y, float z) const
Definition: Object.h:704
void RemoveFromGrid()
Definition: Object.h:581
T_FLAGS GetFlags() const
Definition: Object.h:596
uint32 GuidHigh2TypeId(uint32 guid_hi)
Definition: Object.cpp:43
void Write(ByteBuffer &data) const
Definition: Unit.cpp:328
bool m_objectUpdated
Definition: Object.h:416
const uint32 & GetUInt32Value(uint16 index) const
Definition: Object.h:210
void ResetAllNotifies()
Definition: Object.h:869
virtual bool IsNeverVisible() const
Definition: Object.h:792
virtual void UpdateObjectVisibilityOnCreate()
Definition: Object.h:850
Map * m_currMap
Definition: Object.h:913
ObjectGuid const & GetObjectGUID() const
Definition: Object.h:182
#define GUID_LOPART(x)
Definition: ObjectGuid.h:110
bool m_inWorld
Definition: Object.h:419
#define MAPID_INVALID
Definition: Object.h:547
void GetRandomPoint(const Position &srcPos, float distance, Position &pos) const
Definition: Object.h:653
uint32 * m_uint32Values
Definition: Object.h:408
static bool InSamePhase(WorldObject const *a, WorldObject const *b)
Definition: Object.h:673
int32 * m_int32Values
Definition: Object.h:407
Map * GetMap() const
Definition: Object.h:817
bool IsVisibilityOverridden() const
Definition: Object.h:877
uint16 GetUInt16Value(uint16 index, uint8 offset) const
Definition: Object.h:240
float m_positionY
Definition: Position.h:51
virtual void BuildUpdate(UpdateDataMapType &)
Definition: Object.h:362
void SetOrientation(float orientation)
Definition: Position.h:92
uint32 GetGUIDMid() const
Definition: Object.h:179
void AddToNotify(uint16 f)
Definition: Object.h:858
MovementInfo m_movementInfo
Definition: Object.h:890
void SetObjectScale(float scale)
Definition: Object.h:190
std::string m_name
Definition: Object.h:894
bool isType(uint16 mask) const
Definition: Object.h:193
void Read(ByteBuffer &data)
Definition: Unit.cpp:292
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibility
Definition: Object.h:809
uint64 lootingGroupLeaderGUID
Definition: Object.h:888
void UpdateTime(uint32 _time)
Definition: Object.h:526
const uint64 & GetUInt64Value(uint16 index) const
Definition: Object.h:216
float GetDistance(const Position &pos) const
Definition: Object.h:699
virtual void Update(uint32)
Definition: Object.h:615
bool HasByteFlag(uint16 index, uint8 offset, uint8 flag) const
Definition: Object.h:298
void SetValue(FLAG_TYPE flag, T_VALUES value)
Definition: Object.h:602
Creature const * ToCreature() const
Definition: Object.h:372
ACE_INT32 int32
Definition: Define.h:67
void GetGameObjectListWithEntryInGrid(std::list< GameObject * > &lList, WorldObject *pSource, uint32 uiEntry, float fMaxSearchRange)
void SetTransportData(uint64 guid, float x, float y, float z, float o, uint32 time)
Definition: Object.h:485
uint16 GetNotifyFlags() const
Definition: Object.h:860
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibilityDetect
Definition: Object.h:807
void RemoveMovementFlag(MovementFlags f)
Definition: Object.h:463
TempSummon * SummonCreature(uint32 id, float x, float y, float z, float ang, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0)
Definition: Object.h:827
float m_positionX
Definition: Position.h:50
void ToggleFlag(uint16 index, uint8 offset, uint8 flag)
Definition: Object.h:290
bool isNeedNotify(uint16 f) const
Definition: Object.h:859
void SetLocationMapId(uint32 _mapId)
Definition: Object.h:903
#define GUID_HIPART(x)
Definition: ObjectGuid.h:82
Position pos
Definition: Object.h:434
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPES > m_stealthDetect
Definition: Object.h:804
uint32 GetGUIDLow() const
Definition: Object.h:178
MovementInfo()
Definition: Object.h:447
void SetEntry(uint32 entry)
Definition: Object.h:187
DynamicObject * ToDynObject()
Definition: Object.h:383
GridReference< T > _gridRef
Definition: Object.h:583
WorldLocation(const WorldLocation &loc)
Definition: Object.h:557
float u_unk1
Definition: Object.h:446
void apply(T *val)
Definition: ByteConverter.h:41
uint16 m_objectType
Definition: Object.h:400
GameObject * ToGameObject()
Definition: Object.h:377
bool IsInGrid() const
Definition: Object.h:579
virtual void SendMessageToSet(WorldPacket *data, bool self)
Definition: Object.h:765
bool IsWithinDist2d(float x, float y, float dist) const
Definition: Object.h:736
void VisitNearbyGridObject(float const &radius, NOTIFIER &notifier) const
Definition: Object.h:885
uint32 m_InstanceId
Definition: Object.h:916
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.h:750
void VisitNearbyObject(float const &radius, NOTIFIER &notifier) const
Definition: Object.h:884
Player * ToPlayer()
Definition: Object.h:368
float GetDistance2d(const WorldObject *obj) const
Definition: Object.h:709
float GetDistance2d(float x, float y) const
Definition: Object.h:714
uint32 time
Definition: Object.h:433
virtual void RemoveFromWorld()
Definition: Object.h:166
MovementFlags
Definition: Object.h:67
uint16 m_notifyflags
Definition: Object.h:919
virtual uint8 getLevelForTarget(WorldObject const *) const
Definition: Object.h:768
virtual bool IsInvisibleDueToDespawn() const
Definition: Object.h:794
uint8 m_objectTypeId
Definition: Object.h:402
void SetMovementFlags(MovementFlags f)
Definition: Object.h:475
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.h:746
uint64 GetGUID() const
Definition: Object.h:177
void ApplyModFlag64(uint16 index, uint64 flag, bool apply)
Definition: Object.h:339
uint8 GetTypeId() const
Definition: Object.h:192
uint32 m_mapId
Definition: Object.h:572
virtual void SaveRespawnTime()
Definition: Object.h:787
ACE_UINT8 uint8
Definition: Define.h:73
Position const * GetPos() const
Definition: Object.h:481
bool IsWithinDist2d(const Position *pos, float dist) const
Definition: Object.h:740
void Relocate(float x, float y)
Definition: Position.h:65
virtual bool IsAlwaysVisibleFor(WorldObject const *) const
Definition: Object.h:793
float m_visibilityDistanceOverride
Definition: Object.h:898
bool operator()(const WorldObject *pLeft, const WorldObject *pRight) const
Definition: Object.h:936
PackedGuid m_PackGUID
Definition: Object.h:421
const bool & IsInWorld() const
Definition: Object.h:150
bool HasMovementFlag(MovementFlags f) const
Definition: Object.h:467
void ToggleFlag(uint16 index, uint32 flag)
Definition: Object.h:273
ObjectDistanceOrderPred(const WorldObject *pRefObj, bool ascending=true)
Definition: Object.h:935
HighGuid
Definition: ObjectGuid.h:51
ZoneScript * m_zoneScript
Definition: Object.h:897
uint32 GetPhaseMask() const
Definition: Object.h:670
uint32 * m_uint32Values_mirror
Definition: Object.h:412
Corpse const * ToCorpse() const
Definition: Object.h:381
Map * FindMap() const
Definition: Object.h:818
uint8 moveFlags2
Definition: Object.h:432
void ToggleFlag64(uint16 index, uint64 flag)
Definition: Object.h:325
float GetDistance(const WorldObject *obj) const
Definition: Object.h:694
uint8 m_updateFlag
Definition: Object.h:403
const WorldObject * m_refObj
Definition: Object.h:941
PhaseMasks
Definition: Object.h:113
Corpse * ToCorpse()
Definition: Object.h:380
bool m_isActive
Definition: Object.h:895
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibilityDetect
Definition: Object.h:810
Player const * ToPlayer() const
Definition: Object.h:369
void GetContactPoint(const WorldObject *obj, float &x, float &y, float &z, float distance2d=CONTACT_DISTANCE) const
Definition: Object.h:634
uint32 GetInstanceId() const
Definition: Object.h:664
etc mysql my cnf *Then change max_allowed_packet to a bigger value
bool isActiveObject() const
Definition: Object.h:875
TempSummonType
VisibilityDistanceType
Definition: Object.h:119
PackedGuid const & GetPackGUID() const
Definition: Object.h:181
void ClearTransportData()
Definition: Object.h:494
#define DEFAULT_WORLD_OBJECT_SIZE
Definition: Object.h:49
virtual bool CanAlwaysSee(WorldObject const *) const
Definition: Object.h:923
void SetFlag64(uint16 index, uint64 newFlag)
Definition: Object.h:311
uint32 moveFlags
Definition: Object.h:431
uint32 GetMapId() const
Definition: Object.h:567
float m_positionZ
Definition: Position.h:52
void GetCreatureListWithEntryInGrid(std::list< Creature * > &lList, WorldObject *pSource, uint32 uiEntry, float fMaxSearchRange)
bool IsInMap(const WorldObject *obj) const
Definition: Object.h:721
void AddValue(FLAG_TYPE flag, T_VALUES value)
Definition: Object.h:603
UNORDERED_MAP< Player *, UpdateData > UpdateDataMapType
Definition: Object.h:141
Position const * GetTransportPos() const
Definition: Object.h:507
bool IsWithinDist3d(float x, float y, float z, float dist) const
Definition: Object.h:728
Definition: Map.h:266
void WorldRelocate(const WorldLocation &loc)
Definition: Object.h:562
void AddFlag(FLAG_TYPE flag)
Definition: Object.h:598
const char * GetName() const
Definition: Object.h:680
ACE_UINT64 uint64
Definition: Define.h:70
void ApplyModFlag(uint16 index, uint32 flag, bool apply)
Definition: Object.h:305
void SetInt16Value(uint16 index, uint8 offset, int16 value)
Definition: Object.h:253
bool IsWithinDist3d(const Position *pos, float dist) const
Definition: Object.h:732
void DelFlag(FLAG_TYPE flag)
Definition: Object.h:599
void SetLocationInstanceId(uint32 _instanceId)
Definition: Object.h:907
bool HasFlag64(uint16 index, uint64 flag) const
Definition: Object.h:333
uint16 GetValuesCount() const
Definition: Object.h:349
virtual void AddToWorld()
Definition: Object.h:154
GameObject const * ToGameObject() const
Definition: Object.h:378
void AddToGrid(GridRefManager< T > &m)
Definition: Object.h:580
bool NotifyExecuted(uint16 f) const
Definition: Object.h:861
MovementFlags GetMovementFlags() const
Definition: Object.h:471
virtual float GetObjectBoundingRadius() const
Definition: Object.h:640
Creature * ToCreature()
Definition: Object.h:371
float * m_floatValues
Definition: Object.h:409
std::string GetGuidStr() const
Definition: Object.h:184
uint32 GetGUIDHigh() const
Definition: Object.h:180
uint32 m_phaseMask
Definition: Object.h:917
uint16 m_valuesCount
Definition: Object.h:414
uint64 t_guid
Definition: Object.h:436
uint32 GetFallTime() const
Definition: Object.h:515
void SetName(const std::string &newname)
Definition: Object.h:684
void AddMovementFlag(MovementFlags f)
Definition: Object.h:459
uint32 t_time
Definition: Object.h:438
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPES > m_stealth
Definition: Object.h:803
#define ASSERT
Definition: Errors.h:29
uint64 const & GetTransportGuid() const
Definition: Object.h:503
#define GRID_SEARCH_ALL_ENTRIES
Definition: Object.h:55
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibility
Definition: Object.h:806
T_VALUES GetValue(FLAG_TYPE flag) const
Definition: Object.h:601
const int32 & GetInt32Value(uint16 index) const
Definition: Object.h:204
uint32 GetEntry() const
Definition: Object.h:186
Position t_pos
Definition: Object.h:437
#define CONTACT_DISTANCE
Definition: Object.h:34
ACE_UINT16 uint16
Definition: Define.h:72
ACE_INT16 int16
Definition: Define.h:68
bool HasFlag(uint16 index, uint32 flag) const
Definition: Object.h:281
void RemoveFlag64(uint16 index, uint64 oldFlag)
Definition: Object.h:318
virtual bool IsAlwaysDetectableFor(WorldObject const *) const
Definition: Object.h:796
ACE_UINT32 uint32
Definition: Define.h:71
Unit const * ToUnit() const
Definition: Object.h:375
virtual const char * GetNameForLocaleIdx(int32) const
Definition: Object.h:689
bool InSamePhase(uint32 phasemask) const
Definition: Object.h:671
virtual bool hasQuest(uint32) const
Definition: Object.h:354
Definition: Unit.h:908
#define GUID_ENPART(x)
Definition: ObjectGuid.h:109
float GetObjectSize() const
Definition: Object.h:645
void ChangePosition(float x, float y, float z, float o)
Definition: Object.h:519
Definition: Player.h:923
uint32 m_groupLootTimer
Definition: Object.h:887
uint16 m_executed_notifies
Definition: Object.h:920
void SetNotified(uint16 f)
Definition: Object.h:865
DynamicObject const * ToDynObject() const
Definition: Object.h:384
virtual bool hasInvolvedQuest(uint32) const
Definition: Object.h:358
void operator>>(ByteBuffer &b, Vector3 &v)
Unit * ToUnit()
Definition: Object.h:374
uint8 GetByteValue(uint16 index, uint8 offset) const
Definition: Object.h:228
float GetObjectScale() const
Definition: Object.h:189
bool HasFlag(FLAG_TYPE flag) const
Definition: Object.h:597
void VisitNearbyWorldObject(const float &radius, NOTIFIER &notifier) const
Definition: Object.h:883
float j_xyspeed
Definition: Object.h:444
bool IsPermanentWorldObject() const
Definition: Object.h:880
uint32 fallTime
Definition: Object.h:442
bool InSamePhase(WorldObject const *obj) const
Definition: Object.h:672
uint32 GetTransportTime() const
Definition: Object.h:511
WorldLocation(uint32 _mapid=MAPID_INVALID, float _x=0, float _y=0, float _z=0, float _o=0)
Definition: Object.h:552
void GetClosePoint(float &x, float &y, float &z, float size, float distance2d=0, float angle=0) const
Definition: Object.h:622
NotifyFlags
Definition: Object.h:59
const float & GetFloatValue(uint16 index) const
Definition: Object.h:222
ObjectGuid const & GetGuidValue(uint16 index) const
Definition: Object.h:235