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