AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
WorldObject Class Reference

#include "Object.h"

Inheritance diagram for WorldObject:
Object WorldLocation Position Corpse DynamicObject GameObject Unit Transport Creature Player MotionTransport StaticTransport TempSummon TestCreature TestPlayer Minion Guardian Puppet Totem Pet

Public Member Functions

 ~WorldObject () override
 
virtual void Update (uint32 diff)
 
void _Create (ObjectGuid::LowType guidlow, HighGuid guidhigh, uint32 phaseMask)
 
void AddToWorld () override
 
void RemoveFromWorld () override
 
void GetNearPoint2D (WorldObject const *searcher, float &x, float &y, float distance, float absAngle, Position const *startPos=nullptr) const
 
void GetNearPoint2D (float &x, float &y, float distance, float absAngle, Position const *startPos=nullptr) const
 
void GetNearPoint (WorldObject const *searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle, float controlZ=0, Position const *startPos=nullptr) const
 
void GetVoidClosePoint (float &x, float &y, float &z, float size, float distance2d=0, float relAngle=0, float controlZ=0) const
 
bool GetClosePoint (float &x, float &y, float &z, float size, float distance2d=0, float angle=0, WorldObject const *forWho=nullptr, bool force=false) const
 
void MovePosition (Position &pos, float dist, float angle)
 
Position GetNearPosition (float dist, float angle)
 
void MovePositionToFirstCollision (Position &pos, float dist, float angle)
 
Position GetFirstCollisionPosition (float startX, float startY, float startZ, float destX, float destY)
 
Position GetFirstCollisionPosition (float destX, float destY, float destZ)
 
Position GetFirstCollisionPosition (float dist, float angle)
 
Position GetRandomNearPosition (float radius)
 
void GetContactPoint (WorldObject const *obj, float &x, float &y, float &z, float distance2d=CONTACT_DISTANCE) const
 
void GetChargeContactPoint (WorldObject const *obj, float &x, float &y, float &z, float distance2d=CONTACT_DISTANCE) const
 
float GetObjectSize () const
 
virtual float GetCombatReach () const
 
void UpdateGroundPositionZ (float x, float y, float &z) const
 
void UpdateAllowedPositionZ (float x, float y, float &z, float *groundZ=nullptr) const
 
void GetRandomPoint (Position const &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const
 
Position GetRandomPoint (Position const &srcPos, float distance) const
 
uint32 GetInstanceId () const
 
virtual void SetPhaseMask (uint32 newPhaseMask, bool update)
 
uint32 GetPhaseMask () const
 
bool InSamePhase (WorldObject const *obj) const
 
bool InSamePhase (uint32 phasemask) const
 
uint32 GetZoneId () const
 
uint32 GetAreaId () const
 
void GetZoneAndAreaId (uint32 &zoneid, uint32 &areaid) const
 
bool IsOutdoors () const
 
LiquidData const & GetLiquidData () const
 
InstanceScript * GetInstanceScript () const
 
std::string const & GetName () const
 
void SetName (std::string const &newname)
 
virtual std::string const & GetNameForLocaleIdx (LocaleConstant) const
 
float GetDistance (WorldObject const *obj) const
 
float GetDistance (Position const &pos) const
 
float GetDistance (float x, float y, float z) const
 
float GetDistance2d (WorldObject const *obj) const
 
float GetDistance2d (float x, float y) const
 
float GetDistanceZ (WorldObject const *obj) const
 
bool IsSelfOrInSameMap (WorldObject const *obj) const
 
bool IsInMap (WorldObject const *obj) const
 
bool IsWithinDist3d (float x, float y, float z, float dist) const
 
bool IsWithinDist3d (Position const *pos, float dist) const
 
bool IsWithinDist2d (float x, float y, float dist) const
 
bool IsWithinDist2d (Position const *pos, float dist) const
 
virtual bool IsWithinSightRange (Position const &pos, float dist) const
 
bool IsWithinDist (WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
 
bool IsWithinDistInMap (WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
 
bool IsWithinLOS (float x, float y, float z, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS) const
 
bool IsWithinLOSInMap (WorldObject const *obj, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
 
Position GetHitSpherePointFor (Position const &dest, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
 
void GetHitSpherePointFor (Position const &dest, float &x, float &y, float &z, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
 
bool GetDistanceOrder (WorldObject const *obj1, WorldObject const *obj2, bool is3D=true) const
 
bool IsInRange (WorldObject const *obj, float minRange, float maxRange, bool is3D=true) const
 
bool IsInRange2d (float x, float y, float minRange, float maxRange) const
 
bool IsInRange3d (float x, float y, float z, float minRange, float maxRange) const
 
bool isInFront (WorldObject const *target, float arc=M_PI) const
 
bool isInBack (WorldObject const *target, float arc=M_PI) const
 
bool IsInBetween (WorldObject const *obj1, WorldObject const *obj2, float size=0) const
 
virtual void CleanupsBeforeDelete (bool finalCleanup=true)
 
virtual void SendMessageToSet (WorldPacket const *data, bool self) const
 
virtual void SendMessageToSetInRange (WorldPacket const *data, float dist, bool self) const
 
virtual void SendMessageToSet (WorldPacket const *data, Player const *skipped_rcvr) const
 
virtual uint8 getLevelForTarget (WorldObject const *) const
 
void PlayDistanceSound (uint32 sound_id, Player *target=nullptr)
 
void PlayDirectSound (uint32 sound_id, Player *target=nullptr)
 
void PlayRadiusSound (uint32 sound_id, float radius)
 
void PlayDirectMusic (uint32 music_id, Player *target=nullptr)
 
void PlayRadiusMusic (uint32 music_id, float radius)
 
template<typename Worker >
void DoForAllVisiblePlayers (Worker &&worker)
 
template<typename Worker >
void DoForAllVisibleWorldObjects (Worker &&worker)
 
void DestroyForVisiblePlayers ()
 
void SendObjectDeSpawnAnim (ObjectGuid guid)
 
virtual void SaveRespawnTime ()
 
void AddObjectToRemoveList ()
 
float GetGridActivationRange () const
 
float GetVisibilityRange () const
 
virtual float GetSightRange (WorldObject const *target=nullptr) const
 
float GetLeewayBonusRange (Unit const *target) const
 
float GetLeewayBonusRadius () const
 
bool CanSeeOrDetect (WorldObject const *obj, bool ignoreStealth=false, bool distanceCheck=false, bool checkAlert=false) const
 
void SendPlayMusic (uint32 Music, bool OnlySelf)
 
virtual void SetMap (Map *map)
 
virtual void ResetMap ()
 
Map * GetMap () const
 
Map * FindMap () const
 
void SetZoneScript ()
 
void ClearZoneScript ()
 
ZoneScript * GetZoneScript () const
 
TempSummon * SummonCreature (uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
 
TempSummon * SummonCreature (uint32 id, float x, float y, float z, float ang=0, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false)
 
GameObject * SummonGameObject (uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
 
Creature * SummonTrigger (float x, float y, float z, float ang, uint32 dur, bool setLevel=false, CreatureAI *(*GetAI)(Creature *)=nullptr)
 
void SummonCreatureGroup (uint8 group, std::list< TempSummon * > *list=nullptr)
 
void SummonGameObjectGroup (uint8 group, std::list< GameObject * > *list=nullptr)
 
Creature * FindNearestCreature (uint32 entry, float range, bool alive=true) const
 
GameObject * FindNearestGameObject (uint32 entry, float range, bool onlySpawned=false) const
 
GameObject * FindNearestGameObjectOfType (GameobjectTypes type, float range) const
 
Player * SelectNearestPlayer (float distance=0) const
 
void GetGameObjectListWithEntryInGrid (std::list< GameObject * > &lList, uint32 uiEntry, float fMaxSearchRange) const
 
void GetGameObjectListWithEntryInGrid (std::list< GameObject * > &gameobjectList, std::vector< uint32 > const &entries, float maxSearchRange) const
 
void GetCreatureListWithEntryInGrid (std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
 
void GetCreatureListWithEntryInGrid (std::list< Creature * > &creatureList, std::vector< uint32 > const &entries, float maxSearchRange) const
 
void GetDeadCreatureListInGrid (std::list< Creature * > &lList, float maxSearchRange, bool alive=false) const
 
virtual void UpdateObjectVisibility (bool forced=true, bool fromUpdate=false)
 
virtual void UpdateObjectVisibilityOnCreate ()
 
void BuildUpdate (UpdateDataMapType &data_map) override
 
void GetCreaturesWithEntryInRange (std::list< Creature * > &creatureList, float radius, uint32 entry)
 
void SetPositionDataUpdate ()
 
void UpdatePositionData ()
 
bool IsPositionDataUpdatePending () const
 
void AddToObjectUpdate () override
 
void RemoveFromObjectUpdate () override
 
void AddToNotify (uint16 f)
 
void RemoveFromNotify (uint16 f)
 
bool isNeedNotify (uint16 f) const
 
uint16 GetNotifyFlags () const
 
bool NotifyExecuted (uint16 f) const
 
void SetNotified (uint16 f)
 
void ResetAllNotifies ()
 
bool isActiveObject () const
 
void setActive (bool isActiveObject)
 
VisibilityDistanceType GetVisibilityOverrideType () const
 
bool IsVisibilityOverridden () const
 
bool IsZoneWideVisible () const
 
bool IsFarVisible () const
 
float GetVisibilityOverrideDistance () const
 
void SetVisibilityDistanceOverride (VisibilityDistanceType type)
 
bool IsInWintergrasp () const
 
Transport * GetTransport () const
 
float GetTransOffsetX () const
 
float GetTransOffsetY () const
 
float GetTransOffsetZ () const
 
float GetTransOffsetO () const
 
uint32 GetTransTime () const
 
int8 GetTransSeat () const
 
virtual ObjectGuid GetTransGUID () const
 
void SetTransport (Transport *t)
 
virtual float GetStationaryX () const
 
virtual float GetStationaryY () const
 
virtual float GetStationaryZ () const
 
virtual float GetStationaryO () const
 
float GetMapWaterOrGroundLevel (Position pos, float *ground=nullptr) const
 
float GetMapWaterOrGroundLevel (float x, float y, float z, float *ground=nullptr) const
 
float GetMapHeight (float x, float y, float z, bool vmap=true, float distanceToSearch=50.0f) const
 
float GetFloorZ () const
 
float GetMinHeightInWater () const
 Get the minimum height of a object that should be in water to start floating/swim.
 
virtual float GetCollisionHeight () const
 
virtual float GetCollisionWidth () const
 
virtual float GetCollisionRadius () const
 
void AddAllowedLooter (ObjectGuid guid)
 
void ResetAllowedLooters ()
 
void SetAllowedLooters (GuidUnorderedSet const looters)
 
bool HasAllowedLooter (ObjectGuid guid) const
 
GuidUnorderedSet const & GetAllowedLooters () const
 
void RemoveAllowedLooter (ObjectGuid guid)
 
virtual bool IsUpdateNeeded ()
 
bool CanBeAddedToMapUpdateList ()
 
std::string GetDebugInfo () const override
 
ObjectVisibilityContainer & GetObjectVisibilityContainer ()
 
ObjectVisibilityContainer const & GetObjectVisibilityContainer () const
 
SpellCastResult CastSpell (CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={})
 
SpellCastResult CastSpell (CastSpellTargetArg const &targets, SpellInfo const *info, CastSpellExtraArgs const &args={})
 
virtual ObjectGuid GetOwnerGUID () const
 
virtual ObjectGuid GetCharmerOrOwnerGUID () const
 
Unit * GetOwnerUnit () const
 
Unit * GetCharmerOrOwnerUnit () const
 
Unit * GetCharmerOrOwnerOrSelfUnit () const
 
Player * GetCharmerOrOwnerPlayerOrPlayerItself () const
 
Player * GetAffectingPlayer () const
 
virtual Player * GetSpellModOwner () const
 
virtual uint32 GetFaction () const
 
FactionTemplateEntry const * GetFactionTemplateEntry () const
 
ReputationRank GetReactionTo (WorldObject const *target) const
 
bool IsHostileTo (WorldObject const *target) const
 
bool IsFriendlyTo (WorldObject const *target) const
 
float GetSpellMaxRangeForTarget (Unit const *target, SpellInfo const *spellInfo) const
 
float GetSpellMinRangeForTarget (Unit const *target, SpellInfo const *spellInfo) const
 
bool IsValidAttackTarget (WorldObject const *target, SpellInfo const *bySpell=nullptr) const
 
bool IsValidAssistTarget (WorldObject const *target, SpellInfo const *bySpell=nullptr) const
 
Unit * GetMagicHitRedirectTarget (Unit *victim, SpellInfo const *spellInfo)
 
Unit * GetMeleeHitRedirectTarget (Unit *victim, SpellInfo const *spellInfo)
 
int32 CalculateSpellDamage (Unit const *target, SpellInfo const *spellProto, uint8 effect_index, int32 const *basePoints=nullptr) const
 
int32 CalcSpellDuration (SpellInfo const *spellProto) const
 
int32 ModSpellDuration (SpellInfo const *spellProto, Unit const *target, int32 duration, bool positive, uint32 effectMask) const
 
void ModSpellCastTime (SpellInfo const *spellProto, int32 &castTime, Spell *spell=nullptr) const
 
virtual SpellMissInfo MeleeSpellHitResult (Unit *, SpellInfo const *)
 
SpellMissInfo MagicSpellHitResult (Unit *victim, SpellInfo const *spellInfo)
 
SpellMissInfo SpellHitResult (Unit *victim, SpellInfo const *spellInfo, bool canReflect=false)
 
SpellMissInfo SpellHitResult (Unit *victim, Spell const *spell, bool canReflect=false)
 
void SendSpellMiss (Unit *target, uint32 spellID, SpellMissInfo missInfo)
 
void SendSpellNonMeleeDamageLog (Unit *target, SpellInfo const *spellInfo, uint32 damage, SpellSchoolMask schoolMask, uint32 absorb, uint32 resist)
 
- Public Member Functions inherited from Object
virtual ~Object ()
 
bool IsInWorld () const
 
ObjectGuid GetGUID () const
 
PackedGuid const & GetPackGUID () const
 
uint32 GetEntry () const
 
void SetEntry (uint32 entry)
 
float GetObjectScale () const
 
virtual void SetObjectScale (float scale)
 
virtual uint32 GetDynamicFlags () const
 
bool HasDynamicFlag (uint32 flag) const
 
virtual void SetDynamicFlag (uint32 flag)
 
virtual void RemoveDynamicFlag (uint32 flag)
 
virtual void ReplaceAllDynamicFlags (uint32 flag)
 
TypeID GetTypeId () const
 
bool isType (uint16 mask) const
 
virtual void BuildCreateUpdateBlockForPlayer (UpdateData *data, Player *target)
 
void SendUpdateToPlayer (Player *player)
 
void BuildValuesUpdateBlockForPlayer (UpdateData *data, Player *target)
 
void BuildOutOfRangeUpdateBlock (UpdateData *data) const
 
void BuildMovementUpdateBlock (UpdateData *data, uint32 flags=0) const
 
virtual void DestroyForPlayer (Player *target, bool onDeath=false) const
 
int32 GetInt32Value (uint16 index) const
 
uint32 GetUInt32Value (uint16 index) const
 
uint64 GetUInt64Value (uint16 index) const
 
float GetFloatValue (uint16 index) const
 
uint8 GetByteValue (uint16 index, uint8 offset) const
 
uint16 GetUInt16Value (uint16 index, uint8 offset) const
 
ObjectGuid GetGuidValue (uint16 index) const
 
void SetInt32Value (uint16 index, int32 value)
 
void SetUInt32Value (uint16 index, uint32 value)
 
void UpdateUInt32Value (uint16 index, uint32 value)
 
void SetUInt64Value (uint16 index, uint64 value)
 
void SetFloatValue (uint16 index, float value)
 
void SetByteValue (uint16 index, uint8 offset, uint8 value)
 
void SetUInt16Value (uint16 index, uint8 offset, uint16 value)
 
void SetInt16Value (uint16 index, uint8 offset, int16 value)
 
void SetGuidValue (uint16 index, ObjectGuid value)
 
void SetStatFloatValue (uint16 index, float value)
 
void SetStatInt32Value (uint16 index, int32 value)
 
bool AddGuidValue (uint16 index, ObjectGuid value)
 
bool RemoveGuidValue (uint16 index, ObjectGuid value)
 
void ApplyModUInt32Value (uint16 index, int32 val, bool apply)
 
void ApplyModInt32Value (uint16 index, int32 val, bool apply)
 
void ApplyModUInt64Value (uint16 index, int32 val, bool apply)
 
void ApplyModPositiveFloatValue (uint16 index, float val, bool apply)
 
void ApplyModSignedFloatValue (uint16 index, float val, bool apply)
 
void SetFlag (uint16 index, uint32 newFlag)
 
void RemoveFlag (uint16 index, uint32 oldFlag)
 
void ToggleFlag (uint16 index, uint32 flag)
 
bool HasFlag (uint16 index, uint32 flag) const
 
void ApplyModFlag (uint16 index, uint32 flag, bool apply)
 
void SetByteFlag (uint16 index, uint8 offset, uint8 newFlag)
 
void RemoveByteFlag (uint16 index, uint8 offset, uint8 newFlag)
 
bool HasByteFlag (uint16 index, uint8 offset, uint8 flag) const
 
void SetFlag64 (uint16 index, uint64 newFlag)
 
void RemoveFlag64 (uint16 index, uint64 oldFlag)
 
void ToggleFlag64 (uint16 index, uint64 flag)
 
bool HasFlag64 (uint16 index, uint64 flag) const
 
void ApplyModFlag64 (uint16 index, uint64 flag, bool apply)
 
void ClearUpdateMask (bool remove)
 
uint16 GetValuesCount () const
 
virtual bool hasQuest (uint32) const
 
virtual bool hasInvolvedQuest (uint32) const
 
void BuildFieldsUpdate (Player *, UpdateDataMapType &)
 
void SetFieldNotifyFlag (uint16 flag)
 
void RemoveFieldNotifyFlag (uint16 flag)
 
void ForceValuesUpdateAtIndex (uint32)
 
bool IsPlayer () const
 
Player * ToPlayer ()
 
Player const * ToPlayer () const
 
bool IsCreature () const
 
Creature * ToCreature ()
 
Creature const * ToCreature () const
 
bool IsUnit () const
 
Unit * ToUnit ()
 
Unit const * ToUnit () const
 
bool IsGameObject () const
 
GameObject * ToGameObject ()
 
GameObject const * ToGameObject () const
 
bool IsCorpse () const
 
Corpse * ToCorpse ()
 
Corpse const * ToCorpse () const
 
bool IsDynamicObject () const
 
DynamicObject * ToDynObject ()
 
DynamicObject const * ToDynObject () const
 
bool IsItem () const
 
virtual void Heartbeat ()
 
template<typename... T>
bool EntryEquals (T... entries) const
 
- Public Member Functions inherited from WorldLocation
 WorldLocation (uint32 _mapId=MAPID_INVALID, float x=0.f, float y=0.f, float z=0.f, float o=0.f)
 
 WorldLocation (uint32 mapId, Position const &position)
 
void WorldRelocate (WorldLocation const &loc)
 
void WorldRelocate (uint32 mapId=MAPID_INVALID, float x=0.f, float y=0.f, float z=0.f, float o=0.f)
 
void SetMapId (uint32 mapId)
 
uint32 GetMapId () const
 
void GetWorldLocation (uint32 &mapId, float &x, float &y) const
 
void GetWorldLocation (uint32 &mapId, float &x, float &y, float &z) const
 
void GetWorldLocation (uint32 &mapId, float &x, float &y, float &z, float &o) const
 
void GetWorldLocation (WorldLocation *location) const
 
WorldLocation GetWorldLocation () const
 
std::string GetDebugInfo () const
 
- Public Member Functions inherited from Position
 Position (float x=0, float y=0, float z=0, float o=0)
 
 Position (Position const &loc)
 
 Position (Position &&)=default
 
Position & operator= (Position const &)=default
 
Position & operator= (Position &&)=default
 
bool operator== (Position const &a) const
 
bool operator!= (Position const &a)
 
bool operator!= (Position const &a) const
 
 operator G3D::Vector3 () const
 
void Relocate (float x, float y)
 
void Relocate (float x, float y, float z)
 
void Relocate (float x, float y, float z, float orientation)
 
void Relocate (Position const &pos)
 
void Relocate (Position const *pos)
 
void RelocatePolarOffset (float angle, float dist, float z=0.0f)
 
void RelocateOffset (Position const &offset)
 
void SetOrientation (float orientation)
 
float GetPositionX () const
 
float GetPositionY () const
 
float GetPositionZ () const
 
float GetOrientation () const
 
void GetPosition (float &x, float &y) const
 
void GetPosition (float &x, float &y, float &z) const
 
void GetPosition (float &x, float &y, float &z, float &o) const
 
Position GetPosition () const
 
Position::PositionXYZStreamer PositionXYZStream ()
 
Position::PositionXYZOStreamer PositionXYZOStream ()
 
bool IsPositionValid () const
 
float GetExactDist2dSq (const float x, const float y) const
 
float GetExactDist2dSq (Position const &pos) const
 
float GetExactDist2dSq (Position const *pos) const
 
float GetExactDist2d (const float x, const float y) const
 
float GetExactDist2d (Position const &pos) const
 
float GetExactDist2d (Position const *pos) const
 
float GetExactDistSq (float x, float y, float z) const
 
float GetExactDistSq (Position const &pos) const
 
float GetExactDistSq (Position const *pos) const
 
float GetExactDist (float x, float y, float z) const
 
float GetExactDist (Position const &pos) const
 
float GetExactDist (Position const *pos) const
 
void GetPositionOffsetTo (Position const &endPos, Position &retOffset) const
 
Position GetPositionWithOffset (Position const &offset) const
 
float GetAngle (Position const *pos) const
 
float GetAngle (float x, float y) const
 
float GetAbsoluteAngle (float x, float y) const
 
float GetAbsoluteAngle (Position const &pos) const
 
float GetAbsoluteAngle (Position const *pos) const
 
float GetRelativeAngle (Position const *pos) const
 
float GetRelativeAngle (float x, float y) const
 
float ToAbsoluteAngle (float relAngle) const
 
void GetSinCos (float x, float y, float &vsin, float &vcos) const
 
bool IsInDist2d (float x, float y, float dist) const
 
bool IsInDist2d (Position const *pos, float dist) const
 
bool IsInDist (float x, float y, float z, float dist) const
 
bool IsInDist (Position const *pos, float dist) const
 
bool IsWithinBox (Position const &center, float xradius, float yradius, float zradius) const
 
bool HasInArc (float arcangle, Position const *pos, float targetRadius=0.0f) const
 
bool HasInLine (Position const *pos, float width) const
 
bool HasInLine (Position const *pos, float objSize, float width) const
 
std::string ToString () const
 

Static Public Member Functions

static float GetLeewayBonusRangeForTargets (Player const *player, Unit const *target)
 
static ReputationRank GetFactionReactionTo (FactionTemplateEntry const *factionTemplateEntry, WorldObject const *target)
 
- Static Public Member Functions inherited from Object
static ObjectGuid GetGUID (Object const *o)
 
- Static Public Member Functions inherited from Position
static float NormalizeOrientation (float o)
 

Public Attributes

FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPES > m_stealth
 
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPES > m_stealthDetect
 
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibility
 
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibilityDetect
 
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibility
 
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibilityDetect
 
uint32 LastUsedScriptID
 
MovementInfo m_movementInfo
 
ALEEventProcessor * ALEEvents
 
EventProcessor m_Events
 
- Public Attributes inherited from Object
DataMap CustomData
 
- Public Attributes inherited from WorldLocation
uint32 m_mapId
 
- Public Attributes inherited from Position
float m_positionX = 0
 
float m_positionY = 0
 
float m_positionZ = 0
 
float m_orientation = 0
 

Protected Member Functions

 WorldObject ()
 
virtual void ProcessPositionDataChanged (PositionFullTerrainStatus const &data)
 
void SetLocationMapId (uint32 _mapId)
 
void SetLocationInstanceId (uint32 _instanceId)
 
virtual bool IsNeverVisible () const
 
virtual bool IsAlwaysVisibleFor (WorldObject const *) const
 
virtual bool IsInvisibleDueToDespawn () const
 
virtual bool IsAlwaysDetectableFor (WorldObject const *) const
 
- Protected Member Functions inherited from Object
 Object ()
 
void _InitValues ()
 
void _Create (ObjectGuid::LowType guidlow, uint32 entry, HighGuid guidhigh)
 
void _Create (ObjectGuid guid)
 
std::string _ConcatFields (uint16 startIndex, uint16 size) const
 
bool _LoadIntoDataField (std::string const &data, uint32 startOffset, uint32 count)
 
uint32 GetUpdateFieldData (Player const *target, uint32 *&flags) const
 
void BuildMovementUpdate (ByteBuffer *data, uint16 flags) const
 
virtual void BuildValuesUpdate (uint8 updateType, ByteBuffer *data, Player *target)
 
void AddToObjectUpdateIfNeeded ()
 

Protected Attributes

std::string m_name
 
bool m_isActive
 
VisibilityDistanceType _visibilityDistanceOverrideType
 
ZoneScript * m_zoneScript
 
uint32 _zoneId
 
uint32 _areaId
 
float _floorZ
 
bool _outdoors
 
LiquidData _liquidData
 
bool _updatePositionData
 
Transport * m_transport
 
- Protected Attributes inherited from Object
uint16 m_objectType
 
TypeID m_objectTypeId
 
uint16 m_updateFlag
 
union { 
 
   int32 *   m_int32Values 
 
   uint32 *   m_uint32Values 
 
   float *   m_floatValues 
 
};  
 
UpdateMask _changesMask
 
uint16 m_valuesCount
 
uint16 _fieldNotifyFlags
 
bool m_objectUpdated
 

Private Member Functions

virtual bool _IsWithinDist (WorldObject const *obj, float dist2compare, bool is3D, bool incOwnRadius=true, bool incTargetRadius=true) const
 
bool CanNeverSee (WorldObject const *obj) const
 
virtual bool CanAlwaysSee (WorldObject const *) const
 
bool CanDetect (WorldObject const *obj, bool ignoreStealth, bool checkClient, bool checkAlert=false) const
 
bool CanDetectInvisibilityOf (WorldObject const *obj) const
 
bool CanDetectStealthOf (WorldObject const *obj, bool checkAlert=false) const
 
void RemoveFromMapVisibilityOverrideContainers ()
 
void AddToMapVisibilityOverrideContainers ()
 

Private Attributes

Map * m_currMap
 
Milliseconds _heartbeatTimer
 
uint32 m_InstanceId
 
uint32 m_phaseMask
 
bool m_useCombinedPhases
 
uint16 m_notifyflags
 
uint16 m_executed_notifies
 
GuidUnorderedSet _allowedLooters
 
ObjectVisibilityContainer _objectVisibilityContainer
 

Detailed Description

Constructor & Destructor Documentation

◆ WorldObject()

WorldObject::WorldObject ( )
explicitprotected
1065 : WorldLocation(),
1070{
1073
1074 sScriptMgr->OnWorldObjectCreate(this);
1075}
#define INVALID_HEIGHT
Definition GridTerrainData.h:27
@ PHASEMASK_NORMAL
Definition Object.h:64
static constexpr Milliseconds HEARTBEAT_INTERVAL
Definition Object.h:108
#define sScriptMgr
Definition ScriptMgr.h:766
@ SERVERSIDE_VISIBILITY_GHOST
Definition SharedDefines.h:1262
@ GHOST_VISIBILITY_ALIVE
Definition SharedDefines.h:1269
@ GHOST_VISIBILITY_GHOST
Definition SharedDefines.h:1270
void SetValue(FLAG_TYPE flag, T_VALUES value)
Definition Object.h:405
Definition Position.h:256
bool _updatePositionData
Definition Object.h:810
std::string m_name
Definition Object.h:799
uint16 m_executed_notifies
Definition Object.h:836
bool _outdoors
Definition Object.h:808
uint16 m_notifyflags
Definition Object.h:835
uint32 m_InstanceId
Definition Object.h:830
uint32 _zoneId
Definition Object.h:805
uint32 LastUsedScriptID
Definition Object.h:698
float _floorZ
Definition Object.h:807
ZoneScript * m_zoneScript
Definition Object.h:802
bool m_useCombinedPhases
Definition Object.h:832
uint32 m_phaseMask
Definition Object.h:831
LiquidData _liquidData
Definition Object.h:809
uint32 _areaId
Definition Object.h:806
bool m_isActive
Definition Object.h:800
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibilityDetect
Definition Object.h:630
Milliseconds _heartbeatTimer
Definition Object.h:828
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibility
Definition Object.h:629
VisibilityDistanceType _visibilityDistanceOverrideType
Definition Object.h:801
Map * m_currMap
Definition Object.h:827
ObjectVisibilityContainer _objectVisibilityContainer
Definition Object.h:853
Transport * m_transport
Definition Object.h:813

References GHOST_VISIBILITY_ALIVE, GHOST_VISIBILITY_GHOST, m_serverSideVisibility, m_serverSideVisibilityDetect, SERVERSIDE_VISIBILITY_GHOST, FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::SetValue(), and sScriptMgr.

◆ ~WorldObject()

WorldObject::~WorldObject ( )
override
92{
93 sScriptMgr->OnWorldObjectDestroy(this);
94}

References sScriptMgr.

Member Function Documentation

◆ _Create()

void WorldObject::_Create ( ObjectGuid::LowType  guidlow,
HighGuid  guidhigh,
uint32  phaseMask 
)
1174{
1175 Object::_Create(guidlow, 0, guidhigh);
1176 SetPhaseMask(phaseMask, false);
1177}
void _Create(ObjectGuid::LowType guidlow, uint32 entry, HighGuid guidhigh)
Definition Object.cpp:128
virtual void SetPhaseMask(uint32 newPhaseMask, bool update)
Definition Object.cpp:2999

References Object::_Create(), and SetPhaseMask().

Referenced by Corpse::Create(), and DynamicObject::CreateDynamicObject().

◆ _IsWithinDist()

bool WorldObject::_IsWithinDist ( WorldObject const *  obj,
float  dist2compare,
bool  is3D,
bool  incOwnRadius = true,
bool  incTargetRadius = true 
) const
privatevirtual

Reimplemented in GameObject.

1262{
1263 float maxdist = dist2compare;
1264 if (incOwnRadius)
1265 maxdist += GetObjectSize();
1266
1267 if (incTargetRadius)
1268 maxdist += obj->GetObjectSize();
1269
1270 if (m_transport && obj->GetTransport() && obj->GetTransport()->GetGUID() == m_transport->GetGUID())
1271 {
1272 float dtx = m_movementInfo.transport.pos.m_positionX - obj->m_movementInfo.transport.pos.m_positionX;
1273 float dty = m_movementInfo.transport.pos.m_positionY - obj->m_movementInfo.transport.pos.m_positionY;
1274 float disttsq = dtx * dtx + dty * dty;
1275 if (is3D)
1276 {
1277 float dtz = m_movementInfo.transport.pos.m_positionZ - obj->m_movementInfo.transport.pos.m_positionZ;
1278 disttsq += dtz * dtz;
1279 }
1280 return disttsq < (maxdist * maxdist);
1281 }
1282
1283 float dx = GetPositionX() - obj->GetPositionX();
1284 float dy = GetPositionY() - obj->GetPositionY();
1285 float distsq = dx * dx + dy * dy;
1286 if (is3D)
1287 {
1288 float dz = GetPositionZ() - obj->GetPositionZ();
1289 distsq += dz * dz;
1290 }
1291
1292 return distsq < maxdist * maxdist;
1293}
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:120
Transport * GetTransport() const
Definition Object.h:701
MovementInfo m_movementInfo
Definition Object.h:711
float GetObjectSize() const
Definition Object.cpp:2897
Position pos
Definition Object.h:316
struct MovementInfo::TransportInfo transport
float m_positionZ
Definition Position.h:57
float m_positionX
Definition Position.h:55
float GetPositionZ() const
Definition Position.h:123
float m_positionY
Definition Position.h:56
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122

References Object::GetGUID(), GetObjectSize(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), GetTransport(), m_movementInfo, Position::m_positionX, Position::m_positionY, Position::m_positionZ, m_transport, MovementInfo::TransportInfo::pos, and MovementInfo::transport.

Referenced by IsWithinDist(), and IsWithinDistInMap().

◆ AddAllowedLooter()

void WorldObject::AddAllowedLooter ( ObjectGuid  guid)
3213{
3214 _allowedLooters.insert(guid);
3215}
GuidUnorderedSet _allowedLooters
Definition Object.h:851

References _allowedLooters.

Referenced by GameObject::SetLootRecipient(), and Creature::SetLootRecipient().

◆ AddObjectToRemoveList()

void WorldObject::AddObjectToRemoveList ( )
2233{
2235
2236 Map* map = FindMap();
2237 if (!map)
2238 {
2239 LOG_ERROR("entities.object", "Object {} at attempt add to move list not have valid map (Id: {}).", GetGUID().ToString(), GetMapId());
2240 return;
2241 }
2242
2243 map->AddObjectToRemoveList(this);
2244}
#define ASSERT
Definition Errors.h:68
#define LOG_ERROR(filterType__,...)
Definition Log.h:145
Definition Map.h:168
void AddObjectToRemoveList(WorldObject *obj)
Definition Map.cpp:1823
uint32 * m_uint32Values
Definition Object.h:267
ObjectGuid GetGUID() const
Definition Object.h:121
uint32 GetMapId() const
Definition Position.h:281
Map * FindMap() const
Definition Object.h:638
std::string ToString() const
Definition Position.cpp:59

References Map::AddObjectToRemoveList(), ASSERT, FindMap(), Object::GetGUID(), WorldLocation::GetMapId(), LOG_ERROR, Object::m_uint32Values, and Position::ToString().

Referenced by MotionTransport::DelayedTeleportTransport(), Battleground::DelCreature(), OPvPCapturePoint::DelCreature(), GameObject::Delete(), OPvPCapturePointNA::DespawnCreatures(), ResetEncounterEvent::Execute(), npc_commandscript::HandleNpcDeleteCommand(), SmartScript::ProcessAction(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::ProcessEvent(), DynamicObject::Remove(), Creature::RemoveCorpse(), Player::RemovePet(), Creature::Respawn(), go_firework_show::SpawnNextFirework(), npc_midsummer_bonfire::StampOut(), MotionTransport::UnloadStaticPassengers(), TempSummon::UnSummon(), Totem::UnSummon(), and outdoorpvp_na_halaa_creatures::UpdateAI().

◆ AddToMapVisibilityOverrideContainers()

void WorldObject::AddToMapVisibilityOverrideContainers ( )
private
1152{
1154 return;
1155
1156 if (!IsInWorld())
1157 return;
1158
1159 if (IsFarVisible())
1161 else if (IsZoneWideVisible())
1163}
void AddWorldObjectToFarVisibleMap(WorldObject *obj)
Definition Map.cpp:636
void AddWorldObjectToZoneWideVisibleMap(uint32 zoneId, WorldObject *obj)
Definition Map.cpp:675
bool IsInWorld() const
Definition Object.h:115
Map * GetMap() const
Definition Object.h:637
bool IsVisibilityOverridden() const
Definition Object.h:687
bool IsFarVisible() const
Definition Object.h:689
bool IsZoneWideVisible() const
Definition Object.h:688

References _zoneId, Map::AddWorldObjectToFarVisibleMap(), Map::AddWorldObjectToZoneWideVisibleMap(), GetMap(), IsFarVisible(), Object::IsInWorld(), IsVisibilityOverridden(), and IsZoneWideVisible().

Referenced by SetVisibilityDistanceOverride().

◆ AddToNotify()

void WorldObject::AddToNotify ( uint16  f)
3080{
3081 if (!(m_notifyflags & f))
3082 if (Unit* u = ToUnit())
3083 {
3085 {
3086 uint32 EVENT_VISIBILITY_DELAY = u->FindMap() ? DynamicVisibilityMgr::GetVisibilityNotifyDelay(u->FindMap()->GetEntry()->map_type) : 1000;
3087
3088 uint32 diff = getMSTimeDiff(u->m_last_notify_mstime, GameTime::GetGameTimeMS().count());
3089 if (diff >= EVENT_VISIBILITY_DELAY / 2)
3090 EVENT_VISIBILITY_DELAY /= 2;
3091 else
3092 EVENT_VISIBILITY_DELAY -= diff;
3093 u->m_delayed_unit_relocation_timer = EVENT_VISIBILITY_DELAY;
3094 u->m_last_notify_mstime = GameTime::GetGameTimeMS().count() + EVENT_VISIBILITY_DELAY - 1;
3095 }
3096 else if (f & NOTIFY_AI_RELOCATION)
3097 {
3098 u->m_delayed_unit_ai_notify_timer = u->FindMap() ? DynamicVisibilityMgr::GetAINotifyDelay(u->FindMap()->GetEntry()->map_type) : 500;
3099 }
3100
3101 m_notifyflags |= f;
3102 }
3103}
std::uint32_t uint32
Definition Define.h:107
@ NOTIFY_AI_RELOCATION
Definition Object.h:71
@ NOTIFY_VISIBILITY_CHANGED
Definition Object.h:72
uint32 getMSTimeDiff(uint32 oldMSTime, uint32 newMSTime)
Definition Timer.h:110
static uint32 GetAINotifyDelay(uint32 map_type)
Definition DynamicVisibility.h:52
static uint32 GetVisibilityNotifyDelay(uint32 map_type)
Definition DynamicVisibility.h:51
Unit * ToUnit()
Definition Object.h:216
Definition Unit.h:667
Milliseconds GetGameTimeMS()
Definition GameTime.cpp:43

References DynamicVisibilityMgr::GetAINotifyDelay(), GameTime::GetGameTimeMS(), getMSTimeDiff(), DynamicVisibilityMgr::GetVisibilityNotifyDelay(), m_notifyflags, NOTIFY_AI_RELOCATION, NOTIFY_VISIBILITY_CHANGED, and Object::ToUnit().

Referenced by Unit::ExecuteDelayedUnitRelocationEvent(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnCreatureCreate(), Unit::SetContestedPvP(), Player::UpdateObjectVisibility(), and Unit::UpdateObjectVisibility().

◆ AddToObjectUpdate()

void WorldObject::AddToObjectUpdate ( )
overridevirtual

Implements Object.

3128{
3129 GetMap()->AddUpdateObject(this);
3130}
void AddUpdateObject(Object *obj)
Definition Map.h:536

References Map::AddUpdateObject(), and GetMap().

◆ AddToWorld()

void WorldObject::AddToWorld ( )
overridevirtual

Reimplemented from Object.

1224{
1228
1229 if (IsZoneWideVisible())
1231}
void GetZoneAndAreaId(uint32 phaseMask, uint32 &zoneid, uint32 &areaid, float x, float y, float z) const
Definition Map.cpp:1328
void AddObjectToPendingUpdateList(WorldObject *obj)
Definition Map.cpp:583
virtual void AddToWorld()
Definition Object.cpp:150
uint32 GetPhaseMask() const
Definition Object.h:523

References _areaId, _zoneId, Map::AddObjectToPendingUpdateList(), Object::AddToWorld(), Map::AddWorldObjectToZoneWideVisibleMap(), GetMap(), GetPhaseMask(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Map::GetZoneAndAreaId(), and IsZoneWideVisible().

Referenced by DynamicObject::AddToWorld(), GameObject::AddToWorld(), and Unit::AddToWorld().

◆ BuildUpdate()

void WorldObject::BuildUpdate ( UpdateDataMapType &  data_map)
overridevirtual

Reimplemented from Object.

3106{
3107 // Build update for self
3108 if (IsPlayer())
3109 BuildFieldsUpdate(ToPlayer(), data_map);
3110
3111 // Build update for visible players
3112 DoForAllVisiblePlayers([this, &data_map](Player* player)
3113 {
3114 BuildFieldsUpdate(player, data_map);
3115 });
3116
3117 ClearUpdateMask(false);
3118}
bool IsPlayer() const
Definition Object.h:207
Player * ToPlayer()
Definition Object.h:208
void BuildFieldsUpdate(Player *, UpdateDataMapType &)
Definition Object.cpp:543
void ClearUpdateMask(bool remove)
Definition Object.cpp:531
Definition Player.h:1086
void DoForAllVisiblePlayers(Worker &&worker)
Definition Object.h:586

References Object::BuildFieldsUpdate(), Object::ClearUpdateMask(), DoForAllVisiblePlayers(), Object::IsPlayer(), and Object::ToPlayer().

◆ CalcSpellDuration()

int32 WorldObject::CalcSpellDuration ( SpellInfo const *  spellProto) const
3377{
3378 uint8 comboPoints = 0;
3379 if (Unit const* unitCaster = ToUnit())
3380 comboPoints = unitCaster->GetComboPoints();
3381
3382 int32 minduration = spellProto->GetDuration();
3383 int32 maxduration = spellProto->GetMaxDuration();
3384
3385 int32 duration;
3386
3387 if (comboPoints && minduration != -1 && minduration != maxduration)
3388 duration = minduration + int32((maxduration - minduration) * comboPoints / 5);
3389 else
3390 duration = minduration;
3391
3392 return duration;
3393}
std::int32_t int32
Definition Define.h:103
std::uint8_t uint8
Definition Define.h:109

References SpellInfo::GetDuration(), SpellInfo::GetMaxDuration(), and Object::ToUnit().

Referenced by Aura::CalcMaxDuration(), Spell::EffectInterruptCast(), Spell::EffectSchoolDMG(), and Aura::HandleAuraSpecificMods().

◆ CalculateSpellDamage()

int32 WorldObject::CalculateSpellDamage ( Unit const *  target,
SpellInfo const *  spellProto,
uint8  effect_index,
int32 const *  basePoints = nullptr 
) const

◆ CanAlwaysSee()

virtual bool WorldObject::CanAlwaysSee ( WorldObject const *  ) const
inlineprivatevirtual

Reimplemented in Creature, and Player.

841{ return false; }

Referenced by CanSeeOrDetect().

◆ CanBeAddedToMapUpdateList()

bool WorldObject::CanBeAddedToMapUpdateList ( )
3256{
3257 switch (GetTypeId())
3258 {
3259 case TYPEID_UNIT:
3260 return IsCreature();
3262 case TYPEID_GAMEOBJECT:
3263 return true;
3264 default:
3265 return false;
3266 }
3267
3268 return false;
3269}
@ TYPEID_DYNAMICOBJECT
Definition ObjectGuid.h:41
@ TYPEID_GAMEOBJECT
Definition ObjectGuid.h:40
@ TYPEID_UNIT
Definition ObjectGuid.h:38
TypeID GetTypeId() const
Definition Object.h:135
bool IsCreature() const
Definition Object.h:211

References Object::GetTypeId(), Object::IsCreature(), TYPEID_DYNAMICOBJECT, TYPEID_GAMEOBJECT, and TYPEID_UNIT.

Referenced by Map::AddObjectToPendingUpdateList(), and Map::RemoveObjectFromMapUpdateList().

◆ CanDetect()

bool WorldObject::CanDetect ( WorldObject const *  obj,
bool  ignoreStealth,
bool  checkClient,
bool  checkAlert = false 
) const
private
1972{
1973 WorldObject const* seer = this;
1974
1975 // Pets don't have detection, they use the detection of their masters
1976 if (Unit const* thisUnit = ToUnit())
1977 if (Unit* controller = thisUnit->GetCharmerOrOwner())
1978 seer = controller;
1979
1980 if (obj->IsAlwaysDetectableFor(seer) || GetEntry() == WORLD_TRIGGER) // xinef: World Trigger can detect all objects, used for wild gameobjects without owner!
1981 return true;
1982
1983 if (!ignoreStealth)
1984 {
1985 if (!seer->CanDetectInvisibilityOf(obj)) // xinef: added ignoreStealth, allow AoE spells to hit invisible targets!
1986 {
1987 return false;
1988 }
1989
1990 if (!seer->CanDetectStealthOf(obj, checkAlert))
1991 {
1992 // xinef: ignore units players have at client, this cant be cheated!
1993 if (checkClient)
1994 {
1995 if (!IsPlayer() || !ToPlayer()->HaveAtClient(obj))
1996 return false;
1997 }
1998 else
1999 return false;
2000 }
2001 }
2002
2003 return true;
2004}
#define WORLD_TRIGGER
Definition Unit.h:38
uint32 GetEntry() const
Definition Object.h:123
Unit * GetCharmerOrOwner() const
Definition Unit.h:1293
Definition Object.h:482
bool CanDetectStealthOf(WorldObject const *obj, bool checkAlert=false) const
Definition Object.cpp:2069
bool CanDetectInvisibilityOf(WorldObject const *obj) const
Definition Object.cpp:2006

References CanDetectInvisibilityOf(), CanDetectStealthOf(), Unit::GetCharmerOrOwner(), Object::GetEntry(), IsAlwaysDetectableFor(), Object::IsPlayer(), Object::ToPlayer(), Object::ToUnit(), and WORLD_TRIGGER.

Referenced by CanSeeOrDetect().

◆ CanDetectInvisibilityOf()

bool WorldObject::CanDetectInvisibilityOf ( WorldObject const *  obj) const
private
2007{
2008 uint32 mask = obj->m_invisibility.GetFlags() & m_invisibilityDetect.GetFlags();
2009 // xinef: include invisible flags of caster in the mask, 2 invisible objects should be able to detect eachother
2010 mask |= obj->m_invisibility.GetFlags() & m_invisibility.GetFlags();
2011
2012 // Check for not detected types
2013 if (mask != obj->m_invisibility.GetFlags())
2014 return false;
2015
2016 // It isn't possible in invisibility to detect something that can't detect the invisible object
2017 // (it's at least true for spell: 66)
2018 // It seems like that only Units are affected by this check (couldn't see arena doors with preparation invisibility)
2019 if (obj->ToUnit())
2020 {
2021 // Permanently invisible creatures should be able to engage non-invisible targets.
2022 // ex. Skulking Witch (20882) / Greater Invisibility (16380)
2023 bool isPermInvisibleCreature = false;
2024 if (Creature const* baseObj = ToCreature())
2025 {
2026 Unit::AuraEffectList const& auraEffects = baseObj->GetAuraEffectsByType(SPELL_AURA_MOD_INVISIBILITY);
2027 for (AuraEffect* const effect : auraEffects)
2028 {
2029 if (SpellInfo const* spell = effect->GetSpellInfo())
2030 {
2031 if (spell->GetMaxDuration() == -1)
2032 {
2033 isPermInvisibleCreature = true;
2034 }
2035 }
2036 }
2037 }
2038
2039 if (!isPermInvisibleCreature)
2040 {
2041 uint32 objMask = m_invisibility.GetFlags() & obj->m_invisibilityDetect.GetFlags();
2042 // xinef: include invisible flags of caster in the mask, 2 invisible objects should be able to detect eachother
2043 objMask |= m_invisibility.GetFlags() & obj->m_invisibility.GetFlags();
2044 if (objMask != m_invisibility.GetFlags())
2045 return false;
2046 }
2047 }
2048
2049 for (uint32 i = 0; i < TOTAL_INVISIBILITY_TYPES; ++i)
2050 {
2051 if (!(mask & (1 << i)))
2052 continue;
2053
2054 // xinef: visible for the same invisibility type:
2055 if (m_invisibility.GetValue(InvisibilityType(i)) && obj->m_invisibility.GetValue(InvisibilityType(i)))
2056 continue;
2057
2058 int32 objInvisibilityValue = obj->m_invisibility.GetValue(InvisibilityType(i));
2059 int32 ownInvisibilityDetectValue = m_invisibilityDetect.GetValue(InvisibilityType(i));
2060
2061 // Too low value to detect
2062 if (ownInvisibilityDetectValue < objInvisibilityValue)
2063 return false;
2064 }
2065
2066 return true;
2067}
InvisibilityType
Definition SharedDefines.h:1242
@ TOTAL_INVISIBILITY_TYPES
Definition SharedDefines.h:1256
@ SPELL_AURA_MOD_INVISIBILITY
Definition SpellAuraDefines.h:81
Definition SpellAuraEffects.h:39
Definition Creature.h:47
T_FLAGS GetFlags() const
Definition Object.h:399
T_VALUES GetValue(FLAG_TYPE flag) const
Definition Object.h:404
Creature * ToCreature()
Definition Object.h:212
Definition SpellInfo.h:340
std::vector< AuraEffect * > AuraEffectList
Definition Unit.h:683
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibility
Definition Object.h:626
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPES > m_invisibilityDetect
Definition Object.h:627

References FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::GetFlags(), FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::GetValue(), m_invisibility, m_invisibilityDetect, SPELL_AURA_MOD_INVISIBILITY, Object::ToCreature(), TOTAL_INVISIBILITY_TYPES, and Object::ToUnit().

Referenced by CanDetect().

◆ CanDetectStealthOf()

bool WorldObject::CanDetectStealthOf ( WorldObject const *  obj,
bool  checkAlert = false 
) const
private
2070{
2071 // Combat reach is the minimal distance (both in front and behind),
2072 // and it is also used in the range calculation.
2073 // One stealth point increases the visibility range by 0.3 yard.
2074
2075 if (!obj->m_stealth.GetFlags())
2076 return true;
2077
2078 // dead players shouldnt be able to detect stealth on arenas
2080 if (!ToPlayer()->IsAlive())
2081 return false;
2082
2083 float distance = GetExactDist(obj);
2084 float combatReach = 0.0f;
2085
2086 if (IsUnit())
2087 combatReach = ((Unit*)this)->GetCombatReach();
2088
2089 if (distance < combatReach)
2090 return true;
2091
2092 if (!HasInArc(M_PI, obj))
2093 return false;
2094
2095 for (uint32 i = 0; i < TOTAL_STEALTH_TYPES; ++i)
2096 {
2097 if (!(obj->m_stealth.GetFlags() & (1 << i)))
2098 continue;
2099
2100 if (IsUnit())
2101 if (((Unit*)this)->HasAuraTypeWithMiscvalue(SPELL_AURA_DETECT_STEALTH, i))
2102 return true;
2103
2104 // Starting points
2105 int32 detectionValue = 30;
2106
2107 // Level difference: 5 point / level, starting from level 1.
2108 // There may be spells for this and the starting points too, but
2109 // not in the DBCs of the client.
2110 detectionValue += int32(getLevelForTarget(obj) - 1) * 5;
2111
2112 // Apply modifiers
2113 detectionValue += m_stealthDetect.GetValue(StealthType(i));
2114 if (obj->isType(TYPEMASK_GAMEOBJECT))
2115 {
2116 detectionValue += 30; // pussywizard: increase detection range for gameobjects (ie. traps)
2117 if (Unit* owner = ((GameObject*)obj)->GetOwner())
2118 detectionValue -= int32(owner->getLevelForTarget(this) - 1) * 5;
2119 }
2120
2121 detectionValue -= obj->m_stealth.GetValue(StealthType(i));
2122
2123 // Calculate max distance
2124 float visibilityRange = float(detectionValue) * 0.3f + combatReach;
2125
2126 Unit const* unit = ToUnit();
2127
2128 // If this unit is an NPC then player detect range doesn't apply
2129 if (unit && unit->IsPlayer() && visibilityRange > MAX_PLAYER_STEALTH_DETECT_RANGE)
2130 visibilityRange = MAX_PLAYER_STEALTH_DETECT_RANGE;
2131
2132 if (checkAlert)
2133 visibilityRange += (visibilityRange * 0.08f) + 1.5f;
2134
2135 Unit const* targetUnit = obj->ToUnit();
2136
2137 // If checking for alert, and creature's visibility range is greater than aggro distance, No alert
2138 if (checkAlert && unit && unit->ToCreature() && visibilityRange >= unit->ToCreature()->GetAttackDistance(targetUnit) + unit->ToCreature()->m_CombatDistance)
2139 return false;
2140
2141 if (distance > visibilityRange)
2142 return false;
2143 }
2144
2145 return true;
2146}
@ TYPEMASK_GAMEOBJECT
Definition ObjectGuid.h:54
@ TYPEMASK_PLAYER
Definition ObjectGuid.h:53
StealthType
Definition SharedDefines.h:1234
@ TOTAL_STEALTH_TYPES
Definition SharedDefines.h:1238
@ SPELL_AURA_DETECT_STEALTH
Definition SpellAuraDefines.h:291
#define MAX_PLAYER_STEALTH_DETECT_RANGE
Definition Unit.h:642
float GetAttackDistance(Unit const *player) const
Definition Creature.cpp:3671
float m_CombatDistance
Definition Creature.h:393
Definition GameObject.h:120
bool IsUnit() const
Definition Object.h:215
bool isType(uint16 mask) const
Definition Object.h:136
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPES > m_stealthDetect
Definition Object.h:624
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPES > m_stealth
Definition Object.h:623
virtual uint8 getLevelForTarget(WorldObject const *) const
Definition Object.h:576
float GetExactDist(float x, float y, float z) const
Definition Position.h:182
bool HasInArc(float arcangle, Position const *pos, float targetRadius=0.0f) const
Definition Position.cpp:148

References Creature::GetAttackDistance(), Position::GetExactDist(), FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::GetFlags(), getLevelForTarget(), FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::GetValue(), Position::HasInArc(), Object::IsPlayer(), Object::isType(), Object::IsUnit(), Creature::m_CombatDistance, m_stealth, m_stealthDetect, MAX_PLAYER_STEALTH_DETECT_RANGE, SPELL_AURA_DETECT_STEALTH, Object::ToCreature(), Object::ToPlayer(), TOTAL_STEALTH_TYPES, Object::ToUnit(), TYPEMASK_GAMEOBJECT, and TYPEMASK_PLAYER.

Referenced by CanDetect().

◆ CanNeverSee()

bool WorldObject::CanNeverSee ( WorldObject const *  obj) const
private
1959{
1960 if (!IsInWorld())
1961 return true;
1962
1963 if (obj->IsNeverVisible())
1964 return true;
1965
1966 if (IsCreature() && obj->IsCreature())
1967 return GetMap() != obj->GetMap() || (!InSamePhase(obj) && ToUnit()->GetVehicleBase() != obj && this != obj->ToUnit()->GetVehicleBase());
1968 return GetMap() != obj->GetMap() || !InSamePhase(obj);
1969}
Unit * GetVehicleBase() const
Definition Unit.cpp:14630
bool InSamePhase(WorldObject const *obj) const
Definition Object.h:524

References GetMap(), Unit::GetVehicleBase(), InSamePhase(), Object::IsCreature(), Object::IsInWorld(), IsNeverVisible(), and Object::ToUnit().

Referenced by CanSeeOrDetect().

◆ CanSeeOrDetect()

bool WorldObject::CanSeeOrDetect ( WorldObject const *  obj,
bool  ignoreStealth = false,
bool  distanceCheck = false,
bool  checkAlert = false 
) const
1816{
1817 if (this == obj)
1818 return true;
1819
1820 if (CanNeverSee(obj))
1821 return false;
1822
1823 if (obj->IsAlwaysVisibleFor(this) || CanAlwaysSee(obj))
1824 return true;
1825
1826 // Creature scripts
1827 if (Creature const* cObj = obj->ToCreature())
1828 {
1829 if (Player const* player = ToPlayer())
1830 {
1831 if (cObj->IsAIEnabled && !cObj->AI()->CanBeSeen(player))
1832 return false;
1833
1834 if (!player->CanSeeObjectByVisibilityConditions(obj))
1835 return false;
1836 }
1837 }
1838
1839 // Gameobject scripts
1840 if (GameObject const* goObj = obj->ToGameObject())
1841 {
1842 if (Player const* player = ToPlayer())
1843 {
1844 if (!goObj->AI()->CanBeSeen(player))
1845 return false;
1846
1847 if (!player->CanSeeObjectByVisibilityConditions(obj))
1848 return false;
1849 }
1850 }
1851
1852 // pussywizard: arena spectator
1853 if (obj->IsPlayer())
1854 if (((Player const*)obj)->IsSpectator() && ((Player const*)obj)->FindMap() && ((Player const*)obj)->FindMap()->IsBattleArena())
1855 return false;
1856
1857 bool corpseVisibility = false;
1858 if (distanceCheck)
1859 {
1860 bool corpseCheck = false;
1861 Position const* sightPosition = this;
1862 if (Player const* thisPlayer = ToPlayer())
1863 {
1864 sightPosition = &thisPlayer->GetSightPosition();
1865
1866 if (Creature const* creature = obj->ToCreature())
1867 {
1868 if (TempSummon const* tempSummon = creature->ToTempSummon())
1869 {
1870 if (tempSummon->IsVisibleBySummonerOnly() && GetGUID() != tempSummon->GetSummonerGUID())
1871 {
1872 return false;
1873 }
1874 }
1875 }
1876
1877 if (thisPlayer->isDead() && thisPlayer->GetHealth() > 0 && // Cheap way to check for ghost state
1879 {
1880 if (Corpse* corpse = thisPlayer->GetCorpse())
1881 {
1882 corpseCheck = true;
1883 if (corpse->IsWithinDist(thisPlayer, GetSightRange(obj), false))
1884 if (corpse->IsWithinDist(obj, GetSightRange(obj), false))
1885 corpseVisibility = true;
1886 }
1887 }
1888
1889 // our additional checks
1890 if (Unit const* target = obj->ToUnit())
1891 {
1892 // xinef: don't allow to detect vehicle accessory if you can't see vehicle base!
1893 if (Unit const* vehicle = target->GetVehicleBase())
1894 if (!thisPlayer->HaveAtClient(vehicle))
1895 return false;
1896
1897 // pussywizard: during arena preparation, don't allow to detect pets if can't see its owner (spoils enemy arena frames)
1898 if (Map* targetMap = target->FindMap())
1899 if (target->IsPet() && target->GetOwnerGUID() && targetMap->IsBattleArena() && GetGUID() != target->GetOwnerGUID())
1900 if (BattlegroundMap* bgmap = targetMap->ToBattlegroundMap())
1901 if (Battleground* bg = bgmap->GetBG())
1902 if (bg->GetStatus() < STATUS_IN_PROGRESS && !thisPlayer->HaveAtClient(target->GetOwnerGUID()))
1903 return false;
1904 }
1905
1906 if (thisPlayer->GetFarSightDistance() && !thisPlayer->isInFront(obj))
1907 return false;
1908 }
1909
1910 if (!corpseCheck && !obj->IsWithinSightRange(*sightPosition, GetSightRange(obj)))
1911 return false;
1912 }
1913
1914 // GM visibility off or hidden NPC
1916 {
1917 // Stop checking other things for GMs
1919 return true;
1920 }
1921 else
1923
1924 // Ghost players, Spirit Healers, and some other NPCs
1926 {
1927 // Alive players can see dead players in some cases, but other objects can't do that
1928 if (Player const* thisPlayer = ToPlayer())
1929 {
1930 if (Player const* objPlayer = obj->ToPlayer())
1931 {
1932 if (thisPlayer->GetTeamId() != objPlayer->GetTeamId() || !thisPlayer->IsGroupVisibleFor(objPlayer))
1933 return false;
1934 }
1935 else
1936 return false;
1937 }
1938 else
1939 return false;
1940 }
1941
1942 if (obj->IsInvisibleDueToDespawn())
1943 return false;
1944
1945 // pussywizard: arena spectator
1946 if (this->IsPlayer())
1947 if (((Player const*)this)->IsSpectator() && ((Player const*)this)->FindMap() && ((Player const*)this)->FindMap()->IsBattleArena() && (obj->m_invisibility.GetFlags() || obj->m_stealth.GetFlags()))
1948 return false;
1949
1950 if (!CanDetect(obj, ignoreStealth, !distanceCheck, checkAlert))
1951 {
1952 return false;
1953 }
1954
1955 return true;
1956}
@ STATUS_IN_PROGRESS
Definition Battleground.h:193
@ SERVERSIDE_VISIBILITY_GM
Definition SharedDefines.h:1261
Definition Map.h:761
Definition Battleground.h:304
Definition Corpse.h:49
BattlegroundMap * ToBattlegroundMap()
Definition Map.h:393
GameObject * ToGameObject()
Definition Object.h:220
Definition TemporarySummon.h:50
TempSummon * ToTempSummon()
Definition Unit.h:734
virtual bool IsWithinSightRange(Position const &pos, float dist) const
Definition Object.cpp:1375
virtual bool IsInvisibleDueToDespawn() const
Definition Object.h:823
virtual float GetSightRange(WorldObject const *target=nullptr) const
Definition Object.cpp:1727
bool CanNeverSee(WorldObject const *obj) const
Definition Object.cpp:1958
bool CanDetect(WorldObject const *obj, bool ignoreStealth, bool checkClient, bool checkAlert=false) const
Definition Object.cpp:1971
virtual bool CanAlwaysSee(WorldObject const *) const
Definition Object.h:841
Definition Position.h:27

References CanAlwaysSee(), CanDetect(), CanNeverSee(), FindMap(), FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::GetFlags(), Object::GetGUID(), GetSightRange(), FlaggedValuesArray32< T_VALUES, T_FLAGS, FLAG_TYPE, ARRAY_SIZE >::GetValue(), Unit::GetVehicleBase(), GHOST_VISIBILITY_GHOST, IsAlwaysVisibleFor(), IsInvisibleDueToDespawn(), Object::IsPlayer(), IsWithinSightRange(), m_invisibility, m_serverSideVisibility, m_serverSideVisibilityDetect, m_stealth, SERVERSIDE_VISIBILITY_GHOST, SERVERSIDE_VISIBILITY_GM, STATUS_IN_PROGRESS, Map::ToBattlegroundMap(), Object::ToCreature(), Object::ToGameObject(), Object::ToPlayer(), Unit::ToTempSummon(), and Object::ToUnit().

Referenced by Unit::_IsValidAssistTarget(), Unit::_IsValidAttackTarget(), Creature::CanAssistTo(), SpellInfo::CheckTarget(), CreatureUnitRelocationWorker(), npc_icc_vengeful_fleshreaper::npc_icc_vengeful_fleshreaperAI::MoveInLineOfSight(), npc_pet_dk_ebon_gargoyle::MySelectNextTarget(), npc_pet_mage_mirror_image::MySelectNextTarget(), Acore::NearestAttackableUnitInObjectRangeCheck::operator()(), Acore::NearestVisibleDetectableContestedGuardUnitCheck::operator()(), Acore::VisibleNotifier::SendToSelf(), ThreatReference::ShouldBeOffline(), TotemAI::UpdateAI(), npc_pet_mage_mirror_image::UpdateAI(), Player::UpdateVisibilityOf(), and Player::UpdateVisibilityOf().

◆ CastSpell() [1/2]

SpellCastResult WorldObject::CastSpell ( CastSpellTargetArg const &  targets,
SpellInfo const *  info,
CastSpellExtraArgs const &  args = {} 
)
3286{
3287 if (!info)
3289
3290 if (!targets.Targets)
3291 {
3292 LOG_ERROR("spells", "CastSpell: invalid target passed to spell {} by caster {}",
3293 info->Id, GetGUID().ToString());
3295 }
3296
3297 // some scripts rely on the triggering aura's caster being the original caster
3298 ObjectGuid originalCaster = args.OriginalCaster;
3299 if (!originalCaster && args.TriggeringAura)
3300 originalCaster = args.TriggeringAura->GetCasterGUID();
3301
3302 Spell* spell = new Spell(this, info, args.TriggerFlags, originalCaster);
3303 for (auto const& kv : args.SpellValueOverrides)
3304 spell->SetSpellValue(kv.first, kv.second);
3305 spell->m_CastItem = args.CastItem;
3306 return spell->prepare(&*targets.Targets, args.TriggeringAura);
3307}
@ SPELL_FAILED_BAD_TARGETS
Definition SharedDefines.h:949
@ SPELL_FAILED_SPELL_UNAVAILABLE
Definition SharedDefines.h:1044
Definition ObjectGuid.h:121
Definition Spell.h:298
SpellCastResult prepare(SpellCastTargets const *targets, AuraEffect const *triggeredByAura=nullptr)
Definition Spell.cpp:3556
Item * m_CastItem
Definition Spell.h:536

References CastSpellExtraArgs::CastItem, AuraEffect::GetCasterGUID(), Object::GetGUID(), SpellInfo::Id, LOG_ERROR, Spell::m_CastItem, CastSpellExtraArgs::OriginalCaster, Spell::prepare(), Spell::SetSpellValue(), SPELL_FAILED_BAD_TARGETS, SPELL_FAILED_SPELL_UNAVAILABLE, CastSpellExtraArgs::SpellValueOverrides, CastSpellTargetArg::Targets, Position::ToString(), CastSpellExtraArgs::TriggerFlags, and CastSpellExtraArgs::TriggeringAura.

◆ CastSpell() [2/2]

SpellCastResult WorldObject::CastSpell ( CastSpellTargetArg const &  targets,
uint32  spellId,
CastSpellExtraArgs const &  args = {} 
)
3273{
3274 SpellInfo const* info = sSpellMgr->GetSpellInfo(spellId);
3275 if (!info)
3276 {
3277 LOG_ERROR("spells", "CastSpell: unknown spell {} by caster {}",
3278 spellId, GetGUID().ToString());
3280 }
3281 return CastSpell(targets, info, args);
3282}
#define sSpellMgr
Definition SpellMgr.h:847
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={})
Definition Object.cpp:3271

References CastSpell(), Object::GetGUID(), LOG_ERROR, SPELL_FAILED_SPELL_UNAVAILABLE, sSpellMgr, and Position::ToString().

Referenced by Spell::_cast(), CastSpell(), Spell::DoTriggersOnSpellHit(), Spell::EffectForceCast(), Spell::EffectTriggerMissileSpell(), Spell::EffectTriggerRitualOfSummoning(), and Spell::EffectTriggerSpell().

◆ CleanupsBeforeDelete()

void WorldObject::CleanupsBeforeDelete ( bool  finalCleanup = true)
virtual

Reimplemented in DynamicObject, GameObject, Player, MotionTransport, StaticTransport, and Unit.

1166{
1167 if (IsInWorld())
1169
1170 m_Events.KillAllEvents(false); // non-delatable (currently cast spells) will not deleted now but it will deleted at call in Map::RemoveAllObjectsInRemoveList
1171}
void KillAllEvents(bool force)
Definition EventProcessor.cpp:82
void RemoveFromWorld() override
Definition Object.cpp:1233
EventProcessor m_Events
Definition Object.h:749

References Object::IsInWorld(), EventProcessor::KillAllEvents(), m_Events, and RemoveFromWorld().

Referenced by Map::AddObjectToRemoveList(), and DynamicObject::CleanupsBeforeDelete().

◆ ClearZoneScript()

void WorldObject::ClearZoneScript ( )
2449{
2450 m_zoneScript = nullptr;
2451}

References m_zoneScript.

◆ DestroyForVisiblePlayers()

void WorldObject::DestroyForVisiblePlayers ( )
3056{
3057 if (!IsInWorld())
3058 return;
3059
3061 for (VisiblePlayersMap::iterator itr = visiblePlayerMap.begin(); itr != visiblePlayerMap.end();)
3062 {
3063 Player* player = itr->second;
3064
3065 DestroyForPlayer(player);
3066
3067 // Clean up visibility references now
3069 }
3070}
std::unordered_map< ObjectGuid, Player * > VisiblePlayersMap
Definition ObjectVisibilityContainer.h:30
VisiblePlayersMap::iterator UnlinkVisibilityFromWorldObject(Player *player, VisiblePlayersMap::iterator itr)
Definition ObjectVisibilityContainer.cpp:98
VisiblePlayersMap & GetVisiblePlayersMap()
Definition ObjectVisibilityContainer.h:54
virtual void DestroyForPlayer(Player *target, bool onDeath=false) const
Definition Object.cpp:272
ObjectVisibilityContainer & GetObjectVisibilityContainer()
Definition Object.h:744

References Object::DestroyForPlayer(), GetObjectVisibilityContainer(), ObjectVisibilityContainer::GetVisiblePlayersMap(), Object::IsInWorld(), and ObjectVisibilityContainer::UnlinkVisibilityFromWorldObject().

Referenced by Creature::DisappearAndDie(), boss_cyanigosa::JustDied(), Creature::RemoveCorpse(), Map::RemoveCorpse(), RemoveFromWorld(), boss_urom::boss_uromAI::SpellHit(), GameObject::Update(), and go_witherbark_totem_bundle::go_witherbark_totem_bundleAI::UpdateAI().

◆ DoForAllVisiblePlayers()

template<typename Worker >
void WorldObject::DoForAllVisiblePlayers ( Worker &&  worker)
inline
587 {
588 for (auto const& kvPair : GetObjectVisibilityContainer().GetVisiblePlayersMap())
589 worker(kvPair.second);
590 }

References GetObjectVisibilityContainer(), and ObjectVisibilityContainer::GetVisiblePlayersMap().

Referenced by BuildUpdate().

◆ DoForAllVisibleWorldObjects()

template<typename Worker >
void WorldObject::DoForAllVisibleWorldObjects ( Worker &&  worker)
inline
595 {
596 // Not a player, no access to this map
598 if (!visibleWorldObjectsMap)
599 return;
600
601 for (auto const& kvPair : *visibleWorldObjectsMap)
602 worker(kvPair.second);
603 }
std::unordered_map< ObjectGuid, WorldObject * > VisibleWorldObjectsMap
Definition ObjectVisibilityContainer.h:29
VisibleWorldObjectsMap * GetVisibleWorldObjectsMap()
Definition ObjectVisibilityContainer.h:59

References GetObjectVisibilityContainer(), and ObjectVisibilityContainer::GetVisibleWorldObjectsMap().

Referenced by Player::SendQuestGiverStatusMultiple(), Player::SendTaxiNodeStatusMultiple(), Player::UpdateForQuestWorldObjects(), and Player::UpdateTriggerVisibility().

◆ FindMap()

Map * WorldObject::FindMap ( ) const
inline
638{ return m_currMap; }

References m_currMap.

Referenced by Player::_AddSpellCooldown(), Group::_cancelHomebindIfInstance(), Group::_homebindIfInstance(), Player::_SaveCharacter(), HomeMovementGenerator< Creature >::_setTargetLocation(), FormationMgr::AddCreatureToGroup(), AddObjectToRemoveList(), Pet::AddToWorld(), Vehicle::ApplyAllImmunities(), Spell::cancel(), CanSeeOrDetect(), Spell::CheckCast(), ScriptedAI::DoPlayMusic(), Spell::EffectPersistentAA(), AuraMunchingQueue::Execute(), Spell::finish(), lfg::LFGMgr::FinishDungeon(), spell_dk_scourge_strike::HandleAfterHit(), WorldSession::HandleCastSpellOpcode(), WorldSession::HandleEnterPlayerVehicle(), WorldSession::HandlePlayerLoginOpcode(), spell_dk_blood_caked_blade::HandleProc(), ArenaSpectator::HandleResetCommand(), spell_temple_of_atal_hakkar_awaken_the_soulflayer::HandleSendEvent(), WorldSession::HandleSetDungeonDifficultyOpcode(), WorldSession::HandleSetRaidDifficultyOpcode(), misc_commandscript::HandleSkirmishCommand(), spectator_commandscript::HandleSpectatorLeaveCommand(), ArenaSpectator::HandleSpectatorSpectateCommand(), ArenaSpectator::HandleSpectatorWatchCommand(), Unit::HandleSpellClick(), IsInMap(), GameObject::IsInstanceGameobject(), boss_headless_horseman::JustDied(), Player::LoadFromDB(), Pet::LoadPetFromDB(), LogCommandUsage(), WorldSession::LogoutPlayer(), Map::MoveAllCreaturesInMoveList(), Map::MoveAllDynamicObjectsInMoveList(), Map::MoveAllGameObjectsInMoveList(), Player::NeedSendSpectatorData(), achievement_once_bitten_twice_shy::OnCheck(), spell_hor_shared_suffering_aura::OnRemove(), Unit::PatchValuesUpdate(), spell_blood_queen_pact_of_the_darkfallen_dmg_aura::PeriodicTick(), SmartScript::ProcessAction(), FormationMgr::RemoveCreatureFromGroup(), Player::RemovePet(), Player::ResetInstances(), KillRewarder::Reward(), Spell::SendChannelStart(), Player::SendClearCooldown(), Spell::SendSpellStart(), setActive(), Unit::SetHealth(), Unit::SetMaxHealth(), Unit::SetMaxPower(), Player::SetMover(), Unit::SetPower(), Unit::setPowerType(), Player::SetSelection(), SetZoneScript(), SummonCreature(), Player::SummonPet(), OutdoorPvP::TeamCastSpell(), Player::Update(), Unit::Update(), and Spell::~Spell().

◆ FindNearestCreature()

Creature * WorldObject::FindNearestCreature ( uint32  entry,
float  range,
bool  alive = true 
) const
2559{
2560 Creature* creature = nullptr;
2561 Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range);
2563 Cell::VisitObjects(this, searcher, range);
2564 return creature;
2565}
Definition GridNotifiers.h:481
static void VisitObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:165

References Cell::VisitObjects().

Referenced by npc_thrall_bfu::npc_thrall_bfuAI::ActivateValimathrasPortal(), npc_commander_dawnforge::npc_commander_dawnforgeAI::CanStartEvent(), boss_murmur::CastSuppressionOOC(), spell_renew_skirmisher::CheckRequirement(), spell_challenge_veraku::CheckRequirement(), spell_disrupt_summoning_ritual::CheckRequirement(), spell_item_demon_broiled_surprise::CheckRequirement(), spell_item_map_of_the_geyser_fields::CheckSinkholes(), npc_q24545_lich_king::npc_q24545_lich_kingAI::CleanAll(), boss_grand_champion::boss_grand_championAI::DamageTaken(), npc_gunship::npc_gunshipAI::DamageTaken(), npc_terenas_menethil::npc_terenas_menethilAI::DamageTaken(), boss_the_lich_king::boss_the_lich_kingAI::DamageTaken(), boss_jarien::DoAction(), boss_sothos::DoAction(), npc_high_overlord_saurfang_igb::npc_high_overlord_saurfang_igbAI::DoAction(), npc_muradin_bronzebeard_igb::npc_muradin_bronzebeard_igbAI::DoAction(), npc_razorscale_harpoon_fire_state::DoAction(), boss_krik_thir::boss_krik_thirAI::DoAction(), npc_blade_of_azzinoth::DoAction(), boss_kelidan_the_breaker::DoAction(), boss_hodir::DoHelperVictoryEmotes(), go_sister_mercy::EventInform(), go_transport_the_iron_eagle::EventInform(), go_transport_the_thundercaller::EventInform(), go_transport_the_purple_princess::EventInform(), go_transport_westguard_zeppelin::EventInform(), UtherBatteredHiltEvent::Execute(), DelayedCastMincharEvent::Execute(), spell_the_lich_king_restore_soul::FilterTargets(), npc_dark_iron_guzzler::FindNextKeg(), npc_dark_iron_attack_generator::FinishAttackDueToWin(), npc_dark_iron_attack_generator::FinishEventDueToLoss(), GetClosestCreatureWithEntry(), npc_shattered_hand_scout::GetPorung(), npc_dark_iron_attack_generator::GetRandomBartender(), npc_anachronos_the_ancient::npc_anachronos_the_ancientAI::HandleAnimation(), spell_igb_on_gunship_deck_aura::HandleApply(), HandleBothDead(), npc_echo_of_medivh::HandleCellInitialData(), npc_echo_of_medivh::HandleCheat(), spell_panther_cage_key::HandleDummy(), spell_sorlofs_booty_big_gun_assault::HandleDummy(), spell_q12589_shoot_rjr::HandleDummy(), spell_valanar_kinetic_bomb_aura::HandleDummyTick(), spell_q11719_bloodspore_ruination_45997::HandleEffect(), spell_midsummer_ribbon_pole::HandleEffectPeriodic(), spell_pursuing_spikes_aura::HandleEffectPeriodic(), spell_gen_haunted_aura::HandleOnEffectRemove(), aura_class_call_siphon_blessing::HandlePeriodic(), spell_q13413_wyrmrest_skytalon_ride_periodic::HandlePeriodic(), spell_brewfest_toss_mug::HandleScriptEffect(), spell_q12943_shadow_vault_decree::HandleScriptEffect(), spell_q12620_the_lifewarden_wrath::HandleSendEvent(), boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::HealReceived(), npc_hourglass_of_eternity::npc_hourglass_of_eternityAI::HideNozdormu(), instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::InstanceCleanup(), npc_flame_of_azzinoth::IsSummonedBy(), npc_vaelastrasz_the_red::IsSummonedBy(), npc_oculus_drake::npc_oculus_drakeAI::IsSummonedBy(), npc_maiev_illidan::IsSummonedBy(), boss_rend_blackhand::JustDied(), boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::JustDied(), npc_gunship::npc_gunshipAI::JustDied(), gunship_npc_AI::JustDied(), boss_thorim_runic_colossus::JustDied(), npc_q24545_vegard::npc_q24545_vegardAI::JustDied(), npc_sorlof::JustDied(), npc_enraged_spirit::npc_enraged_spiritAI::JustDied(), boss_jarien::JustDied(), boss_sothos::JustDied(), boss_cthun::JustDied(), boss_porung::JustDied(), npc_blackhand_incarcerator::JustEngagedWith(), boss_eregos::boss_eregosAI::JustEngagedWith(), boss_thorim_gauntlet_npcs::JustEngagedWith(), npc_ulduar_storm_tempered_keeper::JustEngagedWith(), boss_warlord_kalithresh::JustEngagedWith(), boss_thaddius_summon::boss_thaddius_summonAI::JustEngagedWith(), boss_devourer_of_souls::JustEngagedWith(), boss_festergut::boss_festergutAI::JustEngagedWith(), npc_sindragosa_trash::npc_sindragosa_trashAI::JustEngagedWith(), npc_kalecgos_kj::JustSummoned(), npc_overlord_drakuru_betrayal::JustSummoned(), npc_grand_magister_rommath::npc_grand_magister_rommathAI::MoveInLineOfSight(), npc_cw_area_trigger::npc_cw_area_triggerAI::MoveInLineOfSight(), npc_black_knight_graveyard::npc_black_knight_graveyardAI::MoveInLineOfSight(), npc_daranelle::npc_daranelleAI::MoveInLineOfSight(), npc_sentinel_leader::MovementInform(), npc_sentinel_infiltrator::MovementInform(), npc_acherus_necromancer::MovementInform(), npc_gothik_the_harvester::MovementInform(), boss_felmyst::MovementInform(), boss_ymiron::boss_ymironAI::MovementInform(), npc_janalai_hatcher::MovementInform(), npc_attracted_reef_bull::npc_attracted_reef_bullAI::MovementInform(), spell_q12987_read_pronouncement::OnApply(), go_ulduar_tower::OnDestroyed(), spell_bh_cleanse_quel_delar::OnEffect(), go_gong_of_bethekk::OnGossipHello(), go_razorscale_harpoon::OnGossipHello(), go_resonite_cask::OnGossipHello(), go_duskwither_spire_power_source::OnGossipHello(), go_manticron_cube::OnGossipHello(), go_ravager_cage::OnGossipHello(), go_bristlelimb_cage::OnGossipHello(), go_the_pearl_of_the_depths::OnGossipHello(), go_pressure_valve::OnGossipHello(), go_brazier::OnGossipHello(), go_finklestein_cauldron::OnGossipHello(), go_scourge_enclosure::OnGossipHello(), go_simon_cluster::OnGossipHello(), go_warmaul_prison::OnGossipHello(), go_scourge_cage::OnGossipHello(), go_arcane_prison::OnGossipHello(), go_jotunheim_cage::OnGossipHello(), go_dragonflayer_cage::OnGossipHello(), go_hive_pod::OnGossipHello(), npc_mcmanus::OnGossipSelect(), go_pumpkin_shrine::OnGossipSelect(), npc_tyrion::OnQuestAccept(), npc_mikhail::OnQuestAccept(), go_crystal_prison::OnQuestAccept(), go_crystalline_tear::OnQuestAccept(), go_loosely_turned_soil::OnQuestReward(), spell_item_instant_statue::OnRemove(), at_blackrock_stadium::OnTrigger(), near_scarshield_infiltrator::OnTrigger(), at_scarshield_infiltrator::OnTrigger(), at_malfurion_stormrage::OnTrigger(), at_cthun_stomach_exit::OnTrigger(), at_q24545_frostmourne_cavern::OnTrigger(), at_commander_dawnforge::OnTrigger(), AreaTrigger_at_scent_larkorwi::OnTrigger(), AreaTrigger_at_nats_landing::OnTrigger(), AreaTrigger_at_sentry_point::OnTrigger(), AreaTrigger_at_brewfest::OnTrigger(), item_incendiary_explosives::OnUse(), item_captured_frog::OnUse(), npc_akama_illidan::PathEndReached(), spell_quest_test_flight_charging::PerformKick(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::ProcessEvent(), npc_blackhand_incarcerator::Reset(), boss_rend_blackhand::Reset(), boss_victor_nefarius::Reset(), boss_nefarian::Reset(), boss_jarien::Reset(), boss_sothos::Reset(), npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::Reset(), boss_eye_of_cthun::Reset(), boss_festergut::boss_festergutAI::Reset(), boss_thaddius_summon::boss_thaddius_summonAI::Reset(), npc_freya_ward::Reset(), go_razorscale_harpoon::go_razorscale_harpoonAI::Reset(), npc_cosmetic_toy_plane::Reset(), npc_rodin_lightning_enabler::Reset(), boss_yoggsaron_lich_king::Say(), boss_yoggsaron_llane::Say(), boss_yoggsaron_neltharion::Say(), boss_razuvious_minion::boss_razuvious_minionAI::ScheduleAttackDummy(), boss_rend_blackhand::SetData(), npc_highlord_tirion_fordring_lh::npc_highlord_tirion_fordringAI::SetData(), npc_q24545_lich_king::npc_q24545_lich_kingAI::SetData(), npc_shandy_dalaran::npc_shandy_dalaranAI::SetData(), npc_tharnarian::npc_tharnarianAI::SetGUID(), npc_hourglass_of_eternity::npc_hourglass_of_eternityAI::ShowNozdormu(), npc_midsummer_ribbon_pole_target::SpawnFireSpiralBunny(), npc_shadowmoon_tuber_node::npc_shadowmoon_tuber_nodeAI::SpellHit(), npc_razorscale_harpoon_fire_state::SpellHit(), boss_thorim_pillar::SpellHit(), npc_living_constellation::SpellHit(), npc_enslaved_netherwing_drake::SpellHit(), npc_ulduar_flames_initial::SpreadFlame(), npc_crate_helper::npc_crate_helperAI::StartCitizenRP(), boss_thorim_start_npcs::StartMockBattle(), npc_commander_eligor_dawnbringer::npc_commander_eligor_dawnbringerAI::StoreTargets(), spell_midsummer_fling_torch::ThrowNextTorch(), instance_stratholme::instance_stratholme_InstanceMapScript::Update(), instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::Update(), go_bear_trap::go_bear_trapAI::UpdateAI(), npc_blackhand_incarcerator::UpdateAI(), npc_vaelastrasz_the_red::UpdateAI(), boss_victor_nefarius::UpdateAI(), npc_balance_of_light_and_shadow::npc_balance_of_light_and_shadowAI::UpdateAI(), npc_cameron::UpdateAI(), npc_eastvale_peasent::UpdateAI(), npc_sentinel_leader::UpdateAI(), npc_sentinel_infiltrator::UpdateAI(), npc_grand_magister_rommath::npc_grand_magister_rommathAI::UpdateAI(), npc_acherus_necromancer::UpdateAI(), npc_gothik_the_harvester::UpdateAI(), npc_lady_sylvanas_windrunner::npc_lady_sylvanas_windrunnerAI::UpdateAI(), npc_thrall_bfu::npc_thrall_bfuAI::UpdateAI(), npc_alexstraza_the_lifebinder::UpdateAI(), npc_cos_stratholme_citizien::npc_cos_stratholme_citizienAI::UpdateAI(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::UpdateAI(), npc_medivh_bm::UpdateAI(), npc_murkdeep::npc_murkdeepAI::UpdateAI(), npc_giant_spotlight::npc_giant_spotlightAI::UpdateAI(), npc_qiraj_war_spawn::npc_qiraj_war_spawnAI::UpdateAI(), boss_elder_nadox::UpdateAI(), boss_grand_champion::boss_grand_championAI::UpdateAI(), npc_high_overlord_saurfang_igb::npc_high_overlord_saurfang_igbAI::UpdateAI(), npc_muradin_bronzebeard_igb::npc_muradin_bronzebeard_igbAI::UpdateAI(), boss_professor_putricide::boss_professor_putricideAI::UpdateAI(), boss_the_lich_king::boss_the_lich_kingAI::UpdateAI(), npc_tirion_fordring_tft::npc_tirion_fordringAI::UpdateAI(), npc_terenas_menethil::npc_terenas_menethilAI::UpdateAI(), npc_frostwing_vrykul::npc_frostwing_vrykulAI::UpdateAI(), boss_thaddius_summon::boss_thaddius_summonAI::UpdateAI(), boss_malygos::UpdateAI(), boss_varos::boss_varosAI::UpdateAI(), boss_flame_leviathan::UpdateAI(), npc_freya_ward::UpdateAI(), npc_ulduar_iron_construct::UpdateAI(), boss_kologarn::UpdateAI(), npc_ulduar_emergency_fire_bot::UpdateAI(), boss_thorim_start_npcs::UpdateAI(), npc_ulduar_storm_tempered_keeper::UpdateAI(), boss_skadi::boss_skadiAI::UpdateAI(), npc_sinkhole_kill_credit::npc_sinkhole_kill_creditAI::UpdateAI(), npc_hourglass_of_eternity::npc_hourglass_of_eternityAI::UpdateAI(), npc_q24545_lich_king::npc_q24545_lich_kingAI::UpdateAI(), npc_lord_arete::npc_lord_areteAI::UpdateAI(), go_wg_vehicle_teleporter::go_wg_vehicle_teleporterAI::UpdateAI(), npc_fel_guard_hound::npc_fel_guard_houndAI::UpdateAI(), npc_captain_saeed::npc_captain_saeedAI::UpdateAI(), npc_spring_rabbit::npc_spring_rabbitAI::UpdateAI(), npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI::UpdateAI(), npc_tyrion_spybot::npc_tyrion_spybotAI::UpdateAI(), npc_magwin::npc_magwinAI::UpdateEscortAI(), npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::UpdateEscortAI(), SmartAI::UpdateFollow(), npc_ranger_lilatha::WaypointReached(), npc_deathstalker_erland::npc_deathstalker_erlandAI::WaypointReached(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::WaypointReached(), npc_magwin::npc_magwinAI::WaypointReached(), npc_ancestral_wolf::npc_ancestral_wolfAI::WaypointReached(), and npc_bessy::npc_bessyAI::WaypointReached().

◆ FindNearestGameObject()

GameObject * WorldObject::FindNearestGameObject ( uint32  entry,
float  range,
bool  onlySpawned = false 
) const
2568{
2569 GameObject* go = nullptr;
2570 Acore::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range, onlySpawned);
2572 Cell::VisitObjects(this, searcher, range);
2573 return go;
2574}
Definition GridNotifiers.h:358

References Cell::VisitObjects().

Referenced by spell_q12237_rescue_villager::CheckCast(), spell_q9452_cast_net::CheckCast(), npc_q24545_lich_king::npc_q24545_lich_kingAI::CleanAll(), boss_mimiron::CloseDoorAndButton(), npc_ulduar_toasty_fire::DoAction(), npc_thrall_warchief::npc_thrall_warchiefAI::DoAction(), npc_icc_orb_controller::DoAction(), DarkFallenAI::DoAction(), npc_razorscale_harpoon_fire_state::DoAction(), npc_overlord_drakuru_betrayal::DoAction(), boss_yoggsaron_brain::DoAction(), Spell::EffectScriptEffect(), boss_ouro::EnterEvadeMode(), npc_dirt_mound::EnterEvadeMode(), spell_tsh_shoot_flame_arrow::FilterTargets(), GetClosestGameObjectWithEntry(), spell_halion_twilight_division::HandleDummy(), npc_midsummer_bonfire::Ignite(), boss_kologarn::JustDied(), boss_fathomlord_karathress::JustDied(), npc_midsummer_ribbon_pole_target::LocateRibbonPole(), npc_andorhal_tower::npc_andorhal_towerAI::MoveInLineOfSight(), npc_ulduar_snow_mound::MoveInLineOfSight(), npc_overlord_drakuru_betrayal::MoveInLineOfSight(), npc_pos_leader_second::npc_pos_leader_secondAI::MovementInform(), npc_dragonmaw_peon::npc_dragonmaw_peonAI::MovementInform(), go_thorim_lever::OnGossipHello(), npc_lurgglbr::OnQuestAccept(), npc_simon_bunny::npc_simon_bunnyAI::PrepareClusters(), instance_stratholme::instance_stratholme_InstanceMapScript::ProcessSlaughterEvent(), npc_ranger_lilatha::Reset(), npc_stillpine_capitive::npc_stillpine_capitiveAI::Reset(), boss_thaddius::boss_thaddiusAI::Reset(), go_razorscale_harpoon::go_razorscale_harpoonAI::Reset(), npc_wounded_blood_elf::npc_wounded_blood_elfAI::Reset(), boss_mimiron::ResetGameObjects(), npc_simon_bunny::npc_simon_bunnyAI::ResetNode(), npc_shadowmoon_tuber_node::npc_shadowmoon_tuber_nodeAI::SetData(), boss_rend_blackhand::SetData(), npc_q24545_lich_king::npc_q24545_lich_kingAI::SetData(), npc_simon_bunny::npc_simon_bunnyAI::SetUpPreGame(), npc_crate_helper::npc_crate_helperAI::SpellHit(), npc_rabid_thistle_bear::npc_rabid_thistle_bearAI::SpellHit(), npc_icc_orb_controller::SpellHit(), npc_rinji::npc_rinjiAI::sQuestAccept(), npc_simon_bunny::npc_simon_bunnyAI::StartGame(), boss_ouro::Submerge(), npc_grimstone::SummonBoss(), boss_ambassador_flamelash::TurnRunes(), boss_gyth::UpdateAI(), boss_victor_nefarius::UpdateAI(), npc_partygoer::UpdateAI(), npc_grand_magister_rommath::npc_grand_magister_rommathAI::UpdateAI(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::UpdateAI(), npc_giant_spotlight::npc_giant_spotlightAI::UpdateAI(), boss_thaddius::boss_thaddiusAI::UpdateAI(), boss_mimiron::UpdateAI(), npc_ulduar_aerial_command_unit::UpdateAI(), npc_sinkhole_kill_credit::npc_sinkhole_kill_creditAI::UpdateAI(), npc_valiance_keep_cannoneer::npc_valiance_keep_cannoneerAI::UpdateAI(), npc_q24545_lich_king::npc_q24545_lich_kingAI::UpdateAI(), npc_mature_netherwing_drake::npc_mature_netherwing_drakeAI::UpdateAI(), npc_dragonmaw_peon::npc_dragonmaw_peonAI::UpdateAI(), npc_pet_gen_plump_turkey::UpdateAI(), npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::UpdateEscortAI(), npc_ranger_lilatha::WaypointReached(), npc_wounded_blood_elf::npc_wounded_blood_elfAI::WaypointReached(), and npc_isla_starmane::npc_isla_starmaneAI::WaypointReached().

◆ FindNearestGameObjectOfType()

GameObject * WorldObject::FindNearestGameObjectOfType ( GameobjectTypes  type,
float  range 
) const
2577{
2578 GameObject* go = nullptr;
2579 Acore::NearestGameObjectTypeInObjectRangeCheck checker(*this, type, range);
2581 Cell::VisitObjects(this, searcher, range);
2582 return go;
2583}

References Cell::VisitObjects().

Referenced by Map::GetTransportForPos(), WorldSession::HandleAlterAppearance(), and misc_commandscript::HandleOpenDoorCommand().

◆ GetAffectingPlayer()

Player * WorldObject::GetAffectingPlayer ( ) const
3341{
3342 if (!GetCharmerOrOwnerGUID())
3343 return const_cast<WorldObject*>(this)->ToPlayer();
3344
3345 if (Unit* owner = GetCharmerOrOwnerUnit())
3347
3348 return nullptr;
3349}
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition Unit.cpp:7503
Unit * GetCharmerOrOwnerUnit() const
Definition Object.cpp:3314
virtual ObjectGuid GetCharmerOrOwnerGUID() const
Definition Object.h:761

References GetCharmerOrOwnerGUID(), Unit::GetCharmerOrOwnerPlayerOrPlayerItself(), GetCharmerOrOwnerUnit(), and Object::ToPlayer().

Referenced by GetFactionReactionTo(), and GetReactionTo().

◆ GetAllowedLooters()

GuidUnorderedSet const & WorldObject::GetAllowedLooters ( ) const

◆ GetAreaId()

uint32 WorldObject::GetAreaId ( ) const
3180{
3182 const_cast<WorldObject*>(this)->UpdatePositionData();
3183
3184 return _areaId;
3185}
void UpdatePositionData()
Definition Object.cpp:1188

References _areaId, _updatePositionData, and UpdatePositionData().

Referenced by Player::AddQuest(), Player::CheckAreaExploreAndOutdoor(), Spell::CheckCast(), Player::CompleteQuest(), ScriptedAI::DoPlayMusic(), ScriptedAI::DoRewardPlayersInArea(), Spell::EffectBind(), Spell::EffectDuel(), npc_costumed_orphan_matron::GetInitXYZ(), go_bells::go_bellsAI::go_bellsAI(), spell_item_socrethars_stone::HandleDummy(), WorldSession::HandleHearthAndResurrect(), OutdoorPvPNA::HandleKill(), misc_commandscript::HandlePInfoCommand(), WorldSession::HandlePlayerLoginFromDB(), spell_gen_teleporting::HandleScript(), spell_q12735_song_of_cleansing::HandleScript(), Player::IncompleteQuest(), DisableMgr::IsDisabledFor(), SpellArea::IsFitToRequirements(), npc_gilthares::npc_giltharesAI::JustEngagedWith(), LogCommandUsage(), npc_the_scourge_cauldron::npc_the_scourge_cauldronAI::MoveInLineOfSight(), npc_mageguard_dalaran::npc_mageguard_dalaranAI::MoveInLineOfSight(), npc_guardian_pavilion::npc_guardian_pavilionAI::MoveInLineOfSight(), achievement_tilted::OnCheck(), BattlefieldWG::OnCreatureCreate(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnPlayerAreaUpdate(), instance_hyjal::instance_mount_hyjal_InstanceMapScript::OnPlayerInWaterStateUpdate(), instance_ulduar::instance_ulduar_InstanceMapScript::OnUnitDeath(), item_only_for_flight::OnUse(), item_petrov_cluster_bombs::OnUse(), FlameLeviathanPursuedTargetSelector::operator()(), SmartScript::ProcessAction(), Player::RemoveActiveQuest(), Player::RepopAtGraveyard(), Player::RewardHonor(), Player::RewardQuest(), CreatureTextMgr::SendChatPacket(), BattlefieldWG::SendInitWorldStatesTo(), CreatureTextMgr::SendNonChatPacket(), Creature::SendZoneUnderAttackMessage(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::SetData(), npc_freed_protodrake::npc_freed_protodrakeAI::UpdateAI(), go_brewfest_music::go_brewfest_musicAI::UpdateAI(), and lfg::LFGMgr::UpdateRaidBrowser().

◆ GetChargeContactPoint()

void WorldObject::GetChargeContactPoint ( WorldObject const *  obj,
float &  x,
float &  y,
float &  z,
float  distance2d = CONTACT_DISTANCE 
) const
2884{
2885 // angle to face `obj` to `this` using distance includes size of `obj`
2886 GetNearPoint(obj, x, y, z, obj->GetObjectSize(), distance2d, GetAngle(obj));
2887
2888 if (std::fabs(this->GetPositionZ() - z) > 3.0f || !IsWithinLOS(x, y, z))
2889 {
2890 x = this->GetPositionX();
2891 y = this->GetPositionY();
2892 z = this->GetPositionZ();
2893 obj->UpdateGroundPositionZ(x, y, z);
2894 }
2895}
void GetNearPoint(WorldObject const *searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle, float controlZ=0, Position const *startPos=nullptr) const
Definition Object.cpp:2752
bool IsWithinLOS(float x, float y, float z, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS) const
Definition Object.cpp:1391
float GetAngle(Position const *pos) const
Definition Position.cpp:85

References Position::GetAngle(), GetNearPoint(), GetObjectSize(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), IsWithinLOS(), and UpdateGroundPositionZ().

◆ GetCharmerOrOwnerGUID()

virtual ObjectGuid WorldObject::GetCharmerOrOwnerGUID ( ) const
inlinevirtual

Reimplemented in Unit.

761{ return GetOwnerGUID(); }
virtual ObjectGuid GetOwnerGUID() const
Definition Object.h:760

References GetOwnerGUID().

Referenced by GetAffectingPlayer(), and GetCharmerOrOwnerPlayerOrPlayerItself().

◆ GetCharmerOrOwnerOrSelfUnit()

Unit * WorldObject::GetCharmerOrOwnerOrSelfUnit ( ) const
3324{
3325 if (Unit* u = GetCharmerOrOwnerUnit())
3326 return u;
3327
3328 return const_cast<WorldObject*>(this)->ToUnit();
3329}

References GetCharmerOrOwnerUnit(), and Object::ToUnit().

Referenced by GetReactionTo().

◆ GetCharmerOrOwnerPlayerOrPlayerItself()

Player * WorldObject::GetCharmerOrOwnerPlayerOrPlayerItself ( ) const
3332{
3334 if (guid.IsPlayer())
3335 return ObjectAccessor::GetPlayer(*this, guid);
3336
3337 return const_cast<WorldObject*>(this)->ToPlayer();
3338}
bool IsPlayer() const
Definition ObjectGuid.h:172
Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:244

References GetCharmerOrOwnerGUID(), ObjectAccessor::GetPlayer(), ObjectGuid::IsPlayer(), and Object::ToPlayer().

Referenced by Creature::UpdateEntry().

◆ GetCharmerOrOwnerUnit()

Unit * WorldObject::GetCharmerOrOwnerUnit ( ) const
3315{
3316 if (Unit const* unit = ToUnit())
3317 return unit->GetCharmerOrOwner();
3318
3319 // GameObject, DynamicObject and Corpse all resolve their owner from the guid
3320 return GetOwnerUnit();
3321}
Unit * GetOwnerUnit() const
Definition Object.cpp:3309

References Unit::GetCharmerOrOwner(), GetOwnerUnit(), and Object::ToUnit().

Referenced by GetAffectingPlayer(), GetCharmerOrOwnerOrSelfUnit(), IsValidAssistTarget(), IsValidAttackTarget(), and Spell::SelectImplicitCasterObjectTargets().

◆ GetClosePoint()

bool WorldObject::GetClosePoint ( float &  x,
float &  y,
float &  z,
float  size,
float  distance2d = 0,
float  angle = 0,
WorldObject const *  forWho = nullptr,
bool  force = false 
) const
2826{
2827 // angle calculated from current orientation
2828 GetNearPoint(forWho, x, y, z, size, distance2d, GetOrientation() + angle);
2829
2830 if (std::fabs(this->GetPositionZ() - z) > 3.0f || !IsWithinLOS(x, y, z))
2831 {
2832 x = this->GetPositionX();
2833 y = this->GetPositionY();
2834 z = this->GetPositionZ();
2835 if (forWho)
2836 if (Unit const* u = forWho->ToUnit())
2837 u->UpdateAllowedPositionZ(x, y, z);
2838 }
2839 float maxDist = GetObjectSize() + size + distance2d + 1.0f;
2840 if (GetExactDistSq(x, y, z) >= maxDist * maxDist)
2841 {
2842 if (force)
2843 {
2844 x = this->GetPositionX();
2845 y = this->GetPositionY();
2846 z = this->GetPositionZ();
2847 return true;
2848 }
2849 return false;
2850 }
2851 return true;
2852}
float GetOrientation() const
Definition Position.h:124
float GetExactDistSq(float x, float y, float z) const
Definition Position.h:174

References Position::GetExactDistSq(), GetNearPoint(), GetObjectSize(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), IsWithinLOS(), and Object::ToUnit().

Referenced by FollowMovementGenerator< T >::DoUpdate(), Spell::EffectResurrectPet(), Spell::EffectSummonObject(), Spell::EffectSummonObjectWild(), Spell::EffectSummonPet(), Spell::EffectTransmitted(), cast_commandscript::HandleCastDistCommand(), debug_commandscript::HandleDebugSpawnVehicleCommand(), misc_commandscript::HandleGroupSummonCommand(), spell_item_draenic_pale_ale::HandleSummon(), misc_commandscript::HandleSummonCommand(), Pet::LoadPetFromDB(), MotionMaster::MoveJumpTo(), npc_released_offspring_harkoa::npc_released_offspring_harkoaAI::Reset(), npc_dragonmaw_peon::npc_dragonmaw_peonAI::SpellHit(), SummonCreature(), npc_acherus_necromancer::UpdateAI(), npc_gothik_the_harvester::UpdateAI(), npc_valkyr_battle_maiden::UpdateAI(), npc_toc_dk::npc_toc_dkAI::UpdateAI(), and npc_muradin_bronzebeard_icc::npc_muradin_bronzebeard_iccAI::UpdateAI().

◆ GetCollisionHeight()

◆ GetCollisionRadius()

virtual float WorldObject::GetCollisionRadius ( ) const
inlinevirtual

Reimplemented in Unit.

730{ return GetObjectSize() / 2; }

References GetObjectSize().

◆ GetCollisionWidth()

virtual float WorldObject::GetCollisionWidth ( ) const
inlinevirtual

Reimplemented in Unit.

729{ return GetObjectSize(); }

References GetObjectSize().

Referenced by GetMinHeightInWater().

◆ GetCombatReach()

virtual float WorldObject::GetCombatReach ( ) const
inlinevirtual

◆ GetContactPoint()

void WorldObject::GetContactPoint ( WorldObject const *  obj,
float &  x,
float &  y,
float &  z,
float  distance2d = CONTACT_DISTANCE 
) const
2869{
2870 // angle to face `obj` to `this` using distance includes size of `obj`
2871 GetNearPoint(obj, x, y, z, obj->GetObjectSize(), distance2d, GetAngle(obj));
2872
2873 // Exclude gameobjects from LoS calculations
2874 if (std::fabs(this->GetPositionZ() - z) > 3.0f || (!IsGameObject() && !IsWithinLOS(x, y, z)))
2875 {
2876 x = this->GetPositionX();
2877 y = this->GetPositionY();
2878 z = this->GetPositionZ();
2879 obj->UpdateAllowedPositionZ(x, y, z);
2880 }
2881}
bool IsGameObject() const
Definition Object.h:219

References Position::GetAngle(), GetNearPoint(), GetObjectSize(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Object::IsGameObject(), IsWithinLOS(), and UpdateAllowedPositionZ().

Referenced by Unit::JumpTo().

◆ GetCreatureListWithEntryInGrid() [1/2]

void WorldObject::GetCreatureListWithEntryInGrid ( std::list< Creature * > &  creatureList,
std::vector< uint32 > const &  entries,
float  maxSearchRange 
) const
2627{
2628 Acore::AllCreaturesMatchingOneEntryInRange check(this, entries, maxSearchRange);
2629 Acore::CreatureListSearcher searcher(this, creatureList, check);
2630 Cell::VisitObjects(this, searcher, maxSearchRange);
2631}
Definition GridNotifiers.h:1523
Definition GridNotifiers.h:496

References Cell::VisitObjects().

◆ GetCreatureListWithEntryInGrid() [2/2]

void WorldObject::GetCreatureListWithEntryInGrid ( std::list< Creature * > &  lList,
uint32  uiEntry,
float  fMaxSearchRange 
) const
2620{
2621 Acore::AllCreaturesOfEntryInRange check(this, entry, maxSearchRange);
2622 Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
2623 Cell::VisitObjects(this, searcher, maxSearchRange);
2624}
Definition GridNotifiers.h:1505

References Cell::VisitObjects().

Referenced by at_hol_hall_of_watchers::_OnTrigger(), npc_anubisath_sentinel::aqsentinelAI::AddSentinelsNear(), npc_minion_spawner::CanSpawnRareMinion(), spell_q12237_rescue_villager::CheckCast(), npc_akama_shade::DamageTaken(), boss_thorim_start_npcs::DamageTaken(), npc_necrotic_shard::DespawnCultists(), npc_necrotic_shard::DespawnEventDoodads(), npc_necrotic_shard::DespawnShadowsOfDoom(), boss_apothecary_hummel::boss_apothecary_hummelAI::DoAction(), npc_overlord_drakuru_betrayal::DoAction(), npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI::DoGuardsDisappearAndDie(), boss_razorscale::EnterEvadeMode(), spell_the_lich_king_restore_soul::FilterTargets(), boss_the_beast::FindNearbyOrcs(), GetCreatureListWithEntryInGrid(), spell_xt002_heart_overload_periodic::GetRandomToyPile(), spell_apothecary_lingering_fumes::HandleAfterCast(), npc_anachronos_the_ancient::npc_anachronos_the_ancientAI::HandleAnimation(), spell_q12243_fire_upon_the_waters_aura::HandleApplyEffect(), BattlegroundIC::HandleCapturedNodes(), BattlegroundIC::HandleContestedNodes(), spell_dred_raptor_call::HandleDummy(), spell_warhead_detonate::HandleDummy(), spell_icc_sprit_alarm::HandleEvent(), spell_kiljaeden_armageddon_periodic_aura::HandlePeriodic(), spell_q12243_fire_upon_the_waters_aura::HandleRemoveEffect(), spell_q12620_the_lifewarden_wrath::HandleSendEvent(), npc_necrotic_shard::HasMinion(), boss_twilight_corrupter::InitializeAI(), boss_rajaxx::JustDied(), boss_flame_leviathan::JustDied(), npc_lava_spawn::JustEngagedWith(), boss_elder_nadox::JustEngagedWith(), npc_hadronox_crusherPackAI::JustEngagedWith(), npc_akama_shade::MovementInform(), SmartScript::ProcessEvent(), boss_jaraxxus::boss_jaraxxusAI::Reset(), npc_necrotic_shard::ScheduleTasks(), npc_gothik_trigger::npc_gothik_triggerAI::SelectRandomSkullPile(), boss_hydross_the_unstable::SetBeams(), npc_harrison_jones::SpellHit(), boss_shade_of_akama::SpellHit(), boss_thorim_runic_colossus::SpellHit(), npc_expedition_commander::StopControllers(), go_firework_show::StopShow(), boss_ouro::Submerge(), npc_thrall_bfu::npc_thrall_bfuAI::SummonedCreatureDies(), npc_varian_wrynn::npc_varian_wrynnAI::UpdateAI(), npc_thrall_bfu::npc_thrall_bfuAI::UpdateAI(), npc_overlord_drakuru_betrayal::UpdateAI(), outdoorpvp_na_halaa_creatures::UpdateAI(), and npc_necrotic_shard::UpdateFindersAmount().

◆ GetCreaturesWithEntryInRange()

void WorldObject::GetCreaturesWithEntryInRange ( std::list< Creature * > &  creatureList,
float  radius,
uint32  entry 
)
3121{
3122 Acore::AllCreaturesOfEntryInRange check(this, entry, radius);
3123 Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
3124 Cell::VisitObjects(this, searcher, radius);
3125}

References Cell::VisitObjects().

Referenced by boss_kelthuzad_minion::boss_kelthuzad_minionAI::AttackStart(), npc_midsummer_ribbon_pole_target::DoDancingFLameChecks(), npc_midsummer_ribbon_pole_target::DoGroundFlowerChecks(), FixOrientation::Execute(), boss_alyson_antille::GetNearbyFriendlies(), spell_black_template_harpooners_mark_aura::HandleEffectApply(), spell_botanica_call_of_the_falcon_aura::HandleEffectApply(), spell_mc_play_dead_aura::HandleEffectRemove(), spell_winter_veil_racer_rocket_slam::HandleTriggerSpell(), boss_janalai::HatchAllEggs(), boss_headless_horseman::JustDied(), boss_malchezaar::JustEngagedWith(), boss_ignis::JustEngagedWith(), boss_buru::ManipulateEggs(), boss_nalorakk::MoveInLineOfSight(), go_beacon::go_beaconAI::OnStateChanged(), spell_dreamwalker_summon_suppresser_aura::PeriodicTick(), spell_midsummer_ribbon_pole_visual::PrepareSpellScript(), boss_grobbulus::boss_grobbulusAI::PullChamberAdds(), npc_hallows_end_soh::Reset(), boss_watchkeeper_gargolmar::Reset(), npc_captain_saeed::npc_captain_saeedAI::SetGUID(), boss_hodir::SpellHitTarget(), npc_icc_putricades_trap::npc_icc_putricades_trapAI::UpdateAI(), boss_sjonnir_malformed_ooze::boss_sjonnir_malformed_oozeAI::UpdateAI(), npc_ulduar_hodir_mage::UpdateAI(), boss_ignis::UpdateAI(), npc_expedition_engineer::UpdateAI(), boss_svala::boss_svalaAI::UpdateAI(), and npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::UpdateEscortAI().

◆ GetDeadCreatureListInGrid()

void WorldObject::GetDeadCreatureListInGrid ( std::list< Creature * > &  lList,
float  maxSearchRange,
bool  alive = false 
) const
2634{
2635 Acore::AllDeadCreaturesInRange check(this, maxSearchRange, alive);
2636 Acore::CreatureListSearcher<Acore::AllDeadCreaturesInRange> searcher(this, creaturedeadList, check);
2637 Cell::VisitObjects(this, searcher, maxSearchRange);
2638}
Definition GridNotifiers.h:1590

References Cell::VisitObjects().

Referenced by GetDeadCreatureListInGrid().

◆ GetDebugInfo()

std::string WorldObject::GetDebugInfo ( ) const
overridevirtual

Reimplemented from Object.

2597{
2598 std::stringstream sstr;
2599 sstr << WorldLocation::GetDebugInfo() << "\n"
2600 << Object::GetDebugInfo() << "\n"
2601 << "Name: " << GetName();
2602 return sstr.str();
2603}
virtual std::string GetDebugInfo() const
Definition Object.cpp:1000
std::string GetDebugInfo() const
Definition Position.cpp:220
std::string const & GetName() const
Definition Object.h:535

References Object::GetDebugInfo(), WorldLocation::GetDebugInfo(), and GetName().

Referenced by Aura::GetDebugInfo(), GameObject::GetDebugInfo(), and Unit::GetDebugInfo().

◆ GetDistance() [1/3]

float WorldObject::GetDistance ( float  x,
float  y,
float  z 
) const
1317{
1318 float d = GetExactDist(x, y, z) - GetObjectSize();
1319 return d > 0.0f ? d : 0.0f;
1320}

References Position::GetExactDist(), and GetObjectSize().

◆ GetDistance() [2/3]

float WorldObject::GetDistance ( Position const &  pos) const
1311{
1312 float d = GetExactDist(&pos) - GetObjectSize();
1313 return d > 0.0f ? d : 0.0f;
1314}

References Position::GetExactDist(), and GetObjectSize().

◆ GetDistance() [3/3]

float WorldObject::GetDistance ( WorldObject const *  obj) const
1305{
1306 float d = GetExactDist(obj) - GetObjectSize() - obj->GetObjectSize();
1307 return d > 0.0f ? d : 0.0f;
1308}

References Position::GetExactDist(), and GetObjectSize().

Referenced by Spell::AddGOTarget(), Spell::AddUnitTarget(), boss_urom::boss_uromAI::AttackStart(), boss_midnight::CanMeleeHit(), Pet::CastPendingSpell(), Spell::CheckCast(), boss_priestess_delrissa::CheckInRoom(), boss_kalecgos::CheckInRoom(), boss_isle_of_conquest::boss_isle_of_conquestAI::CheckRageBuff(), brann_bronzebeard::DoMarnakDarkMatter(), Spell::EffectChargeDest(), Spell::EffectPullTowards(), boss_sapphiron::boss_sapphironAI::EnterCombatSelfFunction(), boss_magmadar::ExecuteEvent(), boss_xevozz::ExecuteEvent(), boss_nightbane::FlyToClosestPreFlyWayPoint(), Unit::GetMagicHitRedirectTarget(), boss_urom::boss_uromAI::GetPhaseByCurrentPosition(), FleeingMovementGenerator< T >::GetPoint(), OutdoorPvPSI::HandleDropFlag(), spell_image_of_drakuru_reagent_check::HandleDummyEffect(), spell_herald_volzaj_insanity::HandleDummyEffect(), spell_egg_explosion::HandleDummyHitTarget(), misc_commandscript::HandleGetDistanceCommand(), spell_yogg_saron_brain_link_aura::HandleOnEffectApply(), spell_garr_separation_anxiety_aura::HandlePeriodic(), spell_majordomo_separation_anxiety_aura::HandlePeriodic(), spell_entropius_black_hole_effect::HandlePull(), spell_boss_magus_telestra_gravity_well::HandlePull(), spell_gen_ds_flush_knockback::HandleScript(), boss_yoggsaron_sara::InformCloud(), Player::IsAtGroupRewardDistance(), Player::IsAtRecruitAFriendDistance(), SmartAI::IsEscortInvokerInRange(), Player::IsInAreaTriggerRadius(), boss_shirrak_the_dead_watcher::JustEngagedWith(), boss_hadronox::JustSummoned(), npc_lady_sylvanas_windrunner::npc_lady_sylvanas_windrunnerAI::JustSummoned(), Condition::Meets(), npc_brewfest_keg_thrower::MoveInLineOfSight(), npc_brewfest_keg_reciver::MoveInLineOfSight(), npc_brewfest_bark_trigger::MoveInLineOfSight(), npc_love_in_air_supply_sentry::MoveInLineOfSight(), npc_love_in_air_snivel::MoveInLineOfSight(), boss_kelthuzad::boss_kelthuzadAI::MoveInLineOfSight(), npc_black_knight_graveyard::npc_black_knight_graveyardAI::MoveInLineOfSight(), npc_captain_saeed::npc_captain_saeedAI::MoveInLineOfSight(), boss_felmyst::MovementInform(), spell_yogg_saron_brain_link_aura::OnPeriodic(), ICCOrbControllerMinionSearch::operator()(), Acore::NearestAssistCreatureInCreatureRangeCheck::operator()(), Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck::operator()(), Acore::NearestGameObjectFishingHole::operator()(), Acore::NearestGameObjectCheck::operator()(), Acore::NearestGameObjectEntryInObjectRangeCheck::operator()(), Acore::NearestGameObjectTypeInObjectRangeCheck::operator()(), Acore::NearestPlayerInObjectRangeCheck::operator()(), Acore::NearestAttackableUnitInObjectRangeCheck::operator()(), Acore::NearestHostileUnitCheck::operator()(), Acore::NearestHostileUnitInAttackDistanceCheck::operator()(), ManaVoidSelector::operator()(), CatsTargetSelector::operator()(), LeechingThrowSelector::operator()(), spell_quest_test_flight_charging::PerformKick(), SmartScript::ProcessAction(), Creature::reachWithSpellAttack(), Creature::reachWithSpellCure(), Map::ScriptsProcess(), boss_yoggsaron_constrictor_tentacle::SelectConstrictTarget(), boss_yoggsaron_corruptor_tentacle::SelectCorruptionTarget(), npc_enslaved_proto_drake::SetData(), BattlefieldWG::SetupBattlefield(), boss_broodlord::UpdateAI(), npc_core_rager::UpdateAI(), npc_kernobee::npc_kernobeeAI::UpdateAI(), npc_acherus_necromancer::UpdateAI(), npc_gothik_the_harvester::UpdateAI(), npc_lady_sylvanas_windrunner::npc_lady_sylvanas_windrunnerAI::UpdateAI(), npc_highborne_lamenter::npc_highborne_lamenterAI::UpdateAI(), npc_black_knight_ghoul::npc_black_knight_ghoulAI::UpdateAI(), npc_dark_nucleus::npc_dark_nucleusAI::UpdateAI(), boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::UpdateAI(), npc_frostwing_vrykul::npc_frostwing_vrykulAI::UpdateAI(), npc_icc_vengeful_fleshreaper::npc_icc_vengeful_fleshreaperAI::UpdateAI(), npc_icc_gauntlet_controller::npc_icc_gauntlet_controllerAI::UpdateAI(), npc_icc_putricades_trap::npc_icc_putricades_trapAI::UpdateAI(), boss_volkhan::UpdateAI(), boss_stormcaller_brundir::UpdateAI(), npc_auriaya_sanctum_sentry::UpdateAI(), boss_freya::UpdateAI(), boss_thorim_start_npcs::UpdateAI(), npc_ulduar_arachnopod_destroyer::UpdateAI(), npc_battle_at_valhalas::npc_battle_at_valhalasAI::UpdateAI(), npc_pet_gen_target_following_bomb::UpdateAI(), and Player::UpdateCharmedAI().

◆ GetDistance2d() [1/2]

float WorldObject::GetDistance2d ( float  x,
float  y 
) const
1329{
1330 float d = GetExactDist2d(x, y) - GetObjectSize();
1331 return d > 0.0f ? d : 0.0f;
1332}
float GetExactDist2d(const float x, const float y) const
Definition Position.h:170

References Position::GetExactDist2d(), and GetObjectSize().

◆ GetDistance2d() [2/2]

float WorldObject::GetDistance2d ( WorldObject const *  obj) const
1323{
1324 float d = GetExactDist2d(obj) - GetObjectSize() - obj->GetObjectSize();
1325 return d > 0.0f ? d : 0.0f;
1326}

References Position::GetExactDist2d(), and GetObjectSize().

Referenced by spell_krystallus_shatter_effect::CalculateDamage(), spell_gruul_shatter_effect::CalculateDamage(), spell_loken_pulsing_shockwave::CalculateDamage(), boss_shade_of_aran::CheckAranInRoom(), npc_cork_gizelton::npc_cork_gizeltonAI::CheckCaravan(), spell_baltharus_enervating_brand_trigger::CheckDistance(), boss_onyxia::CheckInRoom(), npc_argent_captainAI::DoAction(), Spell::EffectSummonType(), boss_faction_championsAI::EnemiesInRange(), BattlegroundAB::EventPlayerClickedOnFlag(), spell_blade_dance_targeting::FilterTargets(), BfGraveyard::GetDistance(), npc_spiritual_insight::npc_spiritual_insightAI::GetSpeachId(), GetVelocity(), spell_shadowblink::HandleDummy(), misc_commandscript::HandleGetDistanceCommand(), boss_balinda::JustEngagedWith(), boss_aeonus::JustReachedHome(), npc_winterfin_playmate::MoveInLineOfSight(), npc_snowfall_glade_playmate::MoveInLineOfSight(), npc_the_biggest_tree::MoveInLineOfSight(), npc_high_oracle_soo_roo::MoveInLineOfSight(), npc_elder_kekek::MoveInLineOfSight(), npc_the_etymidian::MoveInLineOfSight(), npc_alexstraza_the_lifebinder::MoveInLineOfSight(), npc_cw_area_trigger::npc_cw_area_triggerAI::MoveInLineOfSight(), npc_grizzlemaw_cw_trigger::npc_grizzlemaw_cw_triggerAI::MoveInLineOfSight(), npc_jungle_punch_target::npc_jungle_punch_targetAI::MoveInLineOfSight(), boss_reliquary_of_souls::boss_reliquary_of_soulsAI::MoveInLineOfSight(), instance_blackrock_depths::OnCreatureCreate(), ChargeTargetSelector::operator()(), Acore::WorldObjectSpellNearbyTargetCheck::operator()(), spell_algalon_cosmic_smash_damage::RecalculateDamage(), boss_priestess_lackey_commonAI::RecalculateThreat(), boss_faction_championsAI::RecalculateThreat(), BattlefieldWG::RelocateDeadPlayers(), RevivePlayer(), boss_razuvious::boss_razuviousAI::ScheduleRP(), npc_kiljaeden_controller::SummonedCreatureDies(), Player::TeleportTo(), npc_av_marshal_or_warmaster::npc_av_marshal_or_warmasterAI::UpdateAI(), boss_drekthar::boss_drektharAI::UpdateAI(), boss_galvangar::boss_galvangarAI::UpdateAI(), boss_vanndar::boss_vanndarAI::UpdateAI(), boss_gorosh_the_dervish::UpdateAI(), boss_grizzle::UpdateAI(), boss_hedrum::UpdateAI(), boss_okthor::UpdateAI(), npc_rookery_hatcher::UpdateAI(), npc_eris_hevenfire::npc_eris_hevenfireAI::UpdateAI(), npc_rabid_thistle_bear::npc_rabid_thistle_bearAI::UpdateAI(), npc_twiggy_flathead::npc_twiggy_flatheadAI::UpdateAI(), npc_toc_hunter::npc_toc_hunterAI::UpdateAI(), npc_toc_warrior::npc_toc_warriorAI::UpdateAI(), npc_toc_dk::npc_toc_dkAI::UpdateAI(), npc_toc_rogue::npc_toc_rogueAI::UpdateAI(), npc_auriaya_feral_defender::UpdateAI(), npc_preparations_for_war_vehicle::UpdateAI(), npc_boneguard_footman::npc_boneguard_footmanAI::UpdateAI(), npc_pet_gen_fetch_ball::UpdateAI(), BattlefieldWG::UpdatedDestroyedTowerCount(), boss_netherspite::UpdatePortals(), and GameObject::Use().

◆ GetDistanceOrder()

bool WorldObject::GetDistanceOrder ( WorldObject const *  obj1,
WorldObject const *  obj2,
bool  is3D = true 
) const
1447{
1448 float dx1 = GetPositionX() - obj1->GetPositionX();
1449 float dy1 = GetPositionY() - obj1->GetPositionY();
1450 float distsq1 = dx1 * dx1 + dy1 * dy1;
1451 if (is3D)
1452 {
1453 float dz1 = GetPositionZ() - obj1->GetPositionZ();
1454 distsq1 += dz1 * dz1;
1455 }
1456
1457 float dx2 = GetPositionX() - obj2->GetPositionX();
1458 float dy2 = GetPositionY() - obj2->GetPositionY();
1459 float distsq2 = dx2 * dx2 + dy2 * dy2;
1460 if (is3D)
1461 {
1462 float dz2 = GetPositionZ() - obj2->GetPositionZ();
1463 distsq2 += dz2 * dz2;
1464 }
1465
1466 return distsq1 < distsq2;
1467}

References Position::GetPositionX(), Position::GetPositionY(), and Position::GetPositionZ().

Referenced by Acore::ObjectDistanceOrderPred::operator()(), Spell::SearchChainTargets(), and Player::SelectCharmedAIGroupTarget().

◆ GetDistanceZ()

float WorldObject::GetDistanceZ ( WorldObject const *  obj) const
1254{
1255 float dz = std::fabs(GetPositionZ() - obj->GetPositionZ());
1256 float sizefactor = GetObjectSize() + obj->GetObjectSize();
1257 float dist = dz - sizefactor;
1258 return (dist > 0 ? dist : 0);
1259}

References GetObjectSize(), and Position::GetPositionZ().

Referenced by Creature::CanStartAttack(), and npc_living_constellation::SpellHit().

◆ GetFaction()

virtual uint32 WorldObject::GetFaction ( ) const
inlinevirtual

Reimplemented in Corpse, DynamicObject, GameObject, and Unit.

769{ return 0; }

Referenced by Spell::EffectSummonType(), GetFactionTemplateEntry(), and SummonTrigger().

◆ GetFactionReactionTo()

ReputationRank WorldObject::GetFactionReactionTo ( FactionTemplateEntry const *  factionTemplateEntry,
WorldObject const *  target 
)
static
3921{
3922 // always neutral when no template entry found
3923 if (!factionTemplateEntry)
3924 return REP_NEUTRAL;
3925
3926 FactionTemplateEntry const* targetFactionTemplateEntry = target->GetFactionTemplateEntry();
3927 if (!targetFactionTemplateEntry)
3928 return REP_NEUTRAL;
3929
3930 if (Player const* targetPlayerOwner = target->GetAffectingPlayer())
3931 {
3932 // check contested flags
3933 if (factionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_ATTACK_PVP_ACTIVE_PLAYERS
3934 && targetPlayerOwner->HasPlayerFlag(PLAYER_FLAGS_CONTESTED_PVP))
3935 return REP_HOSTILE;
3936 if (ReputationRank const* repRank = targetPlayerOwner->GetReputationMgr().GetForcedRankIfAny(factionTemplateEntry))
3937 return *repRank;
3938 if (Unit const* targetUnit = target->ToUnit(); !targetUnit || !targetUnit->HasUnitFlag2(UNIT_FLAG2_IGNORE_REPUTATION))
3939 {
3940 if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->faction))
3941 {
3942 if (factionEntry->CanHaveReputation())
3943 {
3944 // CvP case - check reputation, don't allow state higher than neutral when at war
3945 ReputationRank repRank = targetPlayerOwner->GetReputationMgr().GetRank(factionEntry);
3946 if (targetPlayerOwner->GetReputationMgr().IsAtWar(factionEntry))
3947 repRank = std::min(REP_NEUTRAL, repRank);
3948 return repRank;
3949 }
3950 }
3951 }
3952 }
3953
3954 // common faction based check
3955 if (factionTemplateEntry->IsHostileTo(*targetFactionTemplateEntry))
3956 return REP_HOSTILE;
3957 if (factionTemplateEntry->IsFriendlyTo(*targetFactionTemplateEntry))
3958 return REP_FRIENDLY;
3959 if (targetFactionTemplateEntry->IsFriendlyTo(*factionTemplateEntry))
3960 return REP_FRIENDLY;
3961 if (factionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_HATES_ALL_EXCEPT_FRIENDS)
3962 return REP_HOSTILE;
3963 // neutral by default
3964 return REP_NEUTRAL;
3965}
@ FACTION_TEMPLATE_FLAG_HATES_ALL_EXCEPT_FRIENDS
Definition DBCEnums.h:332
@ FACTION_TEMPLATE_FLAG_ATTACK_PVP_ACTIVE_PLAYERS
Definition DBCEnums.h:331
DBCStorage< FactionEntry > sFactionStore(FactionEntryfmt)
@ PLAYER_FLAGS_CONTESTED_PVP
Definition Player.h:467
ReputationRank
Definition SharedDefines.h:156
@ REP_FRIENDLY
Definition SharedDefines.h:161
@ REP_NEUTRAL
Definition SharedDefines.h:160
@ REP_HOSTILE
Definition SharedDefines.h:158
@ UNIT_FLAG2_IGNORE_REPUTATION
Definition UnitDefines.h:298
Player * GetAffectingPlayer() const
Definition Unit.cpp:7512
Definition DBCStructure.h:943
Definition DBCStructure.h:975
bool IsFriendlyTo(FactionTemplateEntry const &entry) const
Definition DBCStructure.h:987

References FactionTemplateEntry::faction, FACTION_TEMPLATE_FLAG_ATTACK_PVP_ACTIVE_PLAYERS, FACTION_TEMPLATE_FLAG_HATES_ALL_EXCEPT_FRIENDS, FactionTemplateEntry::factionFlags, GetAffectingPlayer(), GetFactionTemplateEntry(), FactionTemplateEntry::IsFriendlyTo(), FactionTemplateEntry::IsHostileTo(), PLAYER_FLAGS_CONTESTED_PVP, REP_FRIENDLY, REP_HOSTILE, REP_NEUTRAL, sFactionStore, Object::ToUnit(), and UNIT_FLAG2_IGNORE_REPUTATION.

Referenced by GetReactionTo().

◆ GetFactionTemplateEntry()

FactionTemplateEntry const * WorldObject::GetFactionTemplateEntry ( ) const
3872{
3873 uint32 factionId = GetFaction();
3874 FactionTemplateEntry const* entry = sFactionTemplateStore.LookupEntry(factionId);
3875 if (!entry)
3876 {
3877 // gameobjects may legitimately have no faction (faction template id 0)
3878 if (!IsGameObject() || factionId)
3879 LOG_ERROR("entities", "WorldObject::GetFactionTemplateEntry: {} has invalid faction template id {}",
3880 GetGUID().ToString(), factionId);
3881 }
3882
3883 return entry;
3884}
DBCStorage< FactionTemplateEntry > sFactionTemplateStore(FactionTemplateEntryfmt)
virtual uint32 GetFaction() const
Definition Object.h:769

References GetFaction(), Object::GetGUID(), Object::IsGameObject(), LOG_ERROR, sFactionTemplateStore, and Position::ToString().

Referenced by GetFactionReactionTo(), and GetReactionTo().

◆ GetFirstCollisionPosition() [1/3]

Position WorldObject::GetFirstCollisionPosition ( float  destX,
float  destY,
float  destZ 
)
2963{
2964 Position pos = GetPosition();
2965 auto distance = GetExactDistSq(destX,destY,destZ);
2966
2967 auto dx = destX - pos.GetPositionX();
2968 auto dy = destY - pos.GetPositionY();
2969
2970 auto ang = std::atan2(dy, dx);
2971 ang = (ang >= 0) ? ang : 2 * M_PI + ang;
2972
2973 MovePositionToFirstCollision(pos, distance, ang);
2974 return pos;
2975}
void MovePositionToFirstCollision(Position &pos, float dist, float angle)
Definition Object.cpp:2984
Position GetPosition() const
Definition Position.h:147

References Position::GetExactDistSq(), Position::GetPosition(), Position::GetPositionX(), Position::GetPositionY(), and MovePositionToFirstCollision().

◆ GetFirstCollisionPosition() [2/3]

Position WorldObject::GetFirstCollisionPosition ( float  dist,
float  angle 
)
2978{
2979 Position pos = GetPosition();
2980 MovePositionToFirstCollision(pos, dist, angle);
2981 return pos;
2982}

References Position::GetPosition(), and MovePositionToFirstCollision().

◆ GetFirstCollisionPosition() [3/3]

Position WorldObject::GetFirstCollisionPosition ( float  startX,
float  startY,
float  startZ,
float  destX,
float  destY 
)
2948{
2949 auto dx = destX - startX;
2950 auto dy = destY - startY;
2951
2952 auto ang = std::atan2(dy, dx);
2953 ang = (ang >= 0) ? ang : 2 * M_PI + ang;
2954 Position pos = Position(startX, startY, startZ, ang);
2955
2956 auto distance = pos.GetExactDist2d(destX,destY);
2957
2958 MovePositionToFirstCollision(pos, distance, ang);
2959 return pos;
2960}

References Position::GetExactDist2d(), and MovePositionToFirstCollision().

Referenced by Spell::EffectCharge(), Spell::EffectChargeDest(), and spell_class_call_handler::HandleOnHitRogue().

◆ GetFloorZ()

float WorldObject::GetFloorZ ( ) const
3161{
3163 const_cast<WorldObject*>(this)->UpdatePositionData();
3164
3165 if (!IsInWorld())
3166 return _floorZ;
3167
3168 return std::max<float>(_floorZ, GetMap()->GetGameObjectFloor(GetPhaseMask(), GetPositionX(), GetPositionY(), GetPositionZ() + std::max(GetCollisionHeight(), Z_OFFSET_FIND_HEIGHT)));
3169}
constexpr float Z_OFFSET_FIND_HEIGHT
Definition SharedDefines.h:27
virtual float GetCollisionHeight() const
Definition Object.h:728

References _floorZ, _updatePositionData, GetCollisionHeight(), GetMap(), GetPhaseMask(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Object::IsInWorld(), UpdatePositionData(), and Z_OFFSET_FIND_HEIGHT.

Referenced by npc_icc_nerubar_broodkeeper::npc_icc_nerubar_broodkeeperAI::MoveInLineOfSight(), and Creature::UpdateMovementFlags().

◆ GetGameObjectListWithEntryInGrid() [1/2]

void WorldObject::GetGameObjectListWithEntryInGrid ( std::list< GameObject * > &  gameobjectList,
std::vector< uint32 > const &  entries,
float  maxSearchRange 
) const
2613{
2614 Acore::AllGameObjectsMatchingOneEntryInRange check(this, entries, maxSearchRange);
2615 Acore::GameObjectListSearcher searcher(this, gameobjectList, check);
2616 Cell::VisitObjects(this, searcher, maxSearchRange);
2617}
Definition GridNotifiers.h:1487
Definition GridNotifiers.h:373

References Cell::VisitObjects().

◆ GetGameObjectListWithEntryInGrid() [2/2]

◆ GetGridActivationRange()

float WorldObject::GetGridActivationRange ( ) const
1689{
1690 if (ToPlayer())
1691 {
1692 if (ToPlayer()->GetCinematicMgr().IsOnCinematic())
1693 {
1695 }
1697 }
1698 else if (ToCreature())
1699 {
1700 return ToCreature()->m_SightDistance;
1701 }
1702 else if (((IsGameObject() && ToGameObject()->IsTransport()) || IsDynamicObject()) && isActiveObject())
1703 {
1704 return GetMap()->GetVisibilityRange();
1705 }
1706
1707 return 0.0f;
1708}
#define VISIBILITY_DIST_WINTERGRASP
Definition ObjectDefines.h:41
#define DEFAULT_VISIBILITY_INSTANCE
Definition ObjectDefines.h:40
float m_SightDistance
Definition Creature.h:393
float GetVisibilityRange() const
Definition Map.h:200
bool IsDynamicObject() const
Definition Object.h:227
bool IsInWintergrasp() const
Definition Object.h:693
bool isActiveObject() const
Definition Object.h:684

References DEFAULT_VISIBILITY_INSTANCE, GetMap(), Map::GetVisibilityRange(), isActiveObject(), Object::IsDynamicObject(), Object::IsGameObject(), IsInWintergrasp(), Creature::m_SightDistance, Object::ToCreature(), Object::ToGameObject(), Object::ToPlayer(), and VISIBILITY_DIST_WINTERGRASP.

Referenced by misc_commandscript::HandleRespawnAllCommand(), and Map::MarkNearbyCellsOf().

◆ GetHitSpherePointFor() [1/2]

void WorldObject::GetHitSpherePointFor ( Position const &  dest,
float &  x,
float &  y,
float &  z,
Optional< float >  collisionHeight = { },
Optional< float >  combatReach = { } 
) const
1439{
1440 Position pos = GetHitSpherePointFor(dest, collisionHeight, combatReach);
1441 x = pos.GetPositionX();
1442 y = pos.GetPositionY();
1443 z = pos.GetPositionZ();
1444}
Position GetHitSpherePointFor(Position const &dest, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
Definition Object.cpp:1295

References GetHitSpherePointFor(), Position::GetPositionX(), Position::GetPositionY(), and Position::GetPositionZ().

◆ GetHitSpherePointFor() [2/2]

Position WorldObject::GetHitSpherePointFor ( Position const &  dest,
Optional< float >  collisionHeight = { },
Optional< float >  combatReach = { } 
) const
1296{
1297 G3D::Vector3 vThis(GetPositionX(), GetPositionY(), GetPositionZ() + (collisionHeight ? *collisionHeight : GetCollisionHeight()));
1298 G3D::Vector3 vObj(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ());
1299 G3D::Vector3 contactPoint = vThis + (vObj - vThis).directionOrZero() * std::min(dest.GetExactDist(this), (combatReach ? *combatReach : GetCombatReach()));
1300
1301 return Position(contactPoint.x, contactPoint.y, contactPoint.z, GetAngle(contactPoint.x, contactPoint.y));
1302}
virtual float GetCombatReach() const
Definition Object.h:513

References Position::GetAngle(), GetCollisionHeight(), GetCombatReach(), Position::GetExactDist(), Position::GetPositionX(), Position::GetPositionY(), and Position::GetPositionZ().

Referenced by GetHitSpherePointFor(), IsWithinLOS(), IsWithinLOSInMap(), and PathGenerator::ShortenPathUntilDist().

◆ GetInstanceId()

◆ GetInstanceScript()

InstanceScript * WorldObject::GetInstanceScript ( ) const
1248{
1249 Map* map = GetMap();
1250 return map->IsDungeon() ? map->ToInstanceMap()->GetInstanceScript() : nullptr;
1251}
InstanceScript * GetInstanceScript()
Definition Map.h:739
bool IsDungeon() const
Definition Map.h:299
InstanceMap * ToInstanceMap()
Definition Map.h:390

References InstanceMap::GetInstanceScript(), GetMap(), Map::IsDungeon(), and Map::ToInstanceMap().

Referenced by CreatureAI::_EnterEvadeMode(), at_karazhan_side_entrance::_OnTrigger(), at_sunwell_madrigosa::_OnTrigger(), at_sunwell_eredar_twins::_OnTrigger(), at_zulgurub_entrance_speech::_OnTrigger(), at_zulgurub_bridge_speech::_OnTrigger(), at_zulgurub_temple_speech::_OnTrigger(), at_zulgurub_bloodfire_pit_speech::_OnTrigger(), at_zulgurub_edge_of_madness_speech::_OnTrigger(), at_twin_emperors::_OnTrigger(), at_thaddius_entrance::_OnTrigger(), at_underbog_ghazan::_OnTrigger(), at_rp_nethekurse::_OnTrigger(), at_icc_spire_frostwyrm::_OnTrigger(), Pet::AddToWorld(), boss_algalon_the_observer::boss_algalon_the_observer(), boss_anubarak_trial::boss_anubarak_trialAI::boss_anubarak_trialAI(), boss_archavon::boss_archavonAI::boss_archavonAI(), boss_bigbadwolf::boss_bigbadwolf(), boss_bjarngrim::boss_bjarngrim(), boss_black_knight::boss_black_knightAI::boss_black_knightAI(), boss_blindeye_the_seer::boss_blindeye_the_seer(), boss_crone::boss_crone(), boss_dalronn_the_controller::boss_dalronn_the_controller(), boss_doomrel::boss_doomrel(), boss_dorothee::boss_dorothee(), boss_drakos::boss_drakosAI::boss_drakosAI(), boss_eadric::boss_eadricAI::boss_eadricAI(), boss_emalon::boss_emalonAI::boss_emalonAI(), boss_eregos::boss_eregosAI::boss_eregosAI(), boss_faction_championsAI::boss_faction_championsAI(), boss_fathomguard_caribdis::boss_fathomguard_caribdis(), boss_fathomguard_sharkkis::boss_fathomguard_sharkkis(), boss_fathomguard_tidalvess::boss_fathomguard_tidalvess(), boss_flame_leviathan_defense_turret::boss_flame_leviathan_defense_turret(), boss_frostsworn_general::boss_frostsworn_general(), boss_garfrost::boss_garfrostAI::boss_garfrostAI(), boss_gormok::boss_gormokAI::boss_gormokAI(), boss_grand_champion::boss_grand_championAI::boss_grand_championAI(), boss_icehowl::boss_icehowlAI::boss_icehowlAI(), boss_ick::boss_ickAI::boss_ickAI(), boss_illidari_council_memberAI::boss_illidari_council_memberAI(), boss_ingvar_the_plunderer::boss_ingvar_the_plunderer(), boss_jaraxxus::boss_jaraxxusAI::boss_jaraxxusAI(), boss_jormungarAI::boss_jormungarAI(), boss_julianne::boss_julianne(), boss_kiggler_the_crazed::boss_kiggler_the_crazed(), boss_kirtonos_the_herald::boss_kirtonos_the_heraldAI::boss_kirtonos_the_heraldAI(), boss_kologarn_eyebeam::boss_kologarn_eyebeam(), boss_koralon::boss_koralonAI::boss_koralonAI(), boss_krick::boss_krickAI::boss_krickAI(), boss_krosh_firehand::boss_krosh_firehand(), boss_krystallus::boss_krystallusAI::boss_krystallusAI(), boss_maiden_of_grief::boss_maiden_of_griefAI::boss_maiden_of_griefAI(), boss_olm_the_summoner::boss_olm_the_summoner(), boss_palehoof::boss_palehoofAI::boss_palehoofAI(), boss_paletress::boss_paletressAI::boss_paletressAI(), boss_priestess_lackey_commonAI::boss_priestess_lackey_commonAI(), boss_roar::boss_roar(), boss_romulo::boss_romulo(), boss_runemaster_molgeim::boss_runemaster_molgeim(), boss_sathrovarr::boss_sathrovarr(), boss_skadi_grauf::boss_skadi_graufAI::boss_skadi_graufAI(), boss_skadi::boss_skadiAI::boss_skadiAI(), boss_skarvald_the_constructor::boss_skarvald_the_constructor(), boss_steelbreaker::boss_steelbreaker(), boss_stormcaller_brundir::boss_stormcaller_brundir(), boss_strawman::boss_strawman(), boss_svala::boss_svalaAI::boss_svalaAI(), boss_thaddius_summon::boss_thaddius_summonAI::boss_thaddius_summonAI(), boss_tinhead::boss_tinhead(), boss_toravon::boss_toravonAI::boss_toravonAI(), boss_twin_valkyrAI::boss_twin_valkyrAI(), boss_tyrannus::boss_tyrannusAI::boss_tyrannusAI(), boss_urom::boss_uromAI::boss_uromAI(), boss_varos::boss_varosAI::boss_varosAI(), boss_ymiron::boss_ymironAI::boss_ymironAI(), boss_yoggsaron::boss_yoggsaron(), boss_yoggsaron_sara::boss_yoggsaron_sara(), brann_bronzebeard::brann_bronzebeard(), spell_igb_rocket_pack_useable_aura::CheckAreaTarget(), Spell::CheckCast(), spell_putricide_mutation_init::CheckRequirementInternal(), GameObject::Create(), boss_kologarn_eyebeam::DamageDealt(), boss_illidari_council_memberAI::DamageTaken(), boss_thorim_start_npcs::DamageTaken(), boss_mal_ganis::boss_mal_ganisAI::DamageTaken(), boss_kologarn_arms::DamageTaken(), boss_yoggsaron_brain::DamageTaken(), boss_razuvious_minion::boss_razuvious_minionAI::DoAction(), boss_thorim_sif::DoAction(), boss_yoggsaron_sara::DoAction(), boss_yoggsaron_brain::DoAction(), Spell::EffectSendEvent(), boss_kiljaeden::EnterEvadeMode(), boss_entropius::EnterEvadeMode(), npc_ghostly_priest::EnterEvadeMode(), npc_phantom_mage::EnterEvadeMode(), npc_shadowy_mercenary::EnterEvadeMode(), npc_spectral_footman::EnterEvadeMode(), npc_tortured_rifleman::EnterEvadeMode(), SendEncounterUnit::Execute(), UtherBatteredHiltEvent::Execute(), FaceBarrageArc(), spell_blood_queen_pact_of_the_darkfallen::FilterTargets(), spell_igb_teleport_players_on_victory::FilterTargets(), spell_tsh_shoot_flame_arrow::FilterTargets(), SmartScript::GetTargets(), go_shadowforge_brazier::GossipHello(), go_brazier_of_madness::GossipHello(), go_orb_of_domination::GossipHello(), go_blood_drenched_door::go_blood_drenched_doorAI::GossipHello(), go_celestial_planetarium_access::go_celestial_planetarium_accessAI::GossipHello(), spell_felmyst_open_brutallus_back_doors::HandleAfterCast(), spell_kelthuzad_void_blast::HandleAfterHit(), spell_thaddius_pos_neg_charge::HandleDamage(), spell_halion_twilight_division::HandleDummy(), spell_skadi_reset_check::HandleDummy(), spell_teron_gorefiend_shadow_of_death::HandleEffectRemove(), AuraEffect::HandleFeignDeath(), spell_hadronox_summon_periodic_aura::HandlePeriodic(), spell_serpentshrine_cavern_coilfang_water::HandlePeriodic(), spell_xt002_321_boombot_aura::HandleProc(), spell_ignis_brittle_aura::HandleProc(), spell_festergut_pungent_blight::HandleScript(), spell_putricide_unbound_plague::HandleScript(), spell_malygos_vortex_dummy::HandleScript(), spell_auto_repair::HandleScript(), spell_temple_of_atal_hakkar_awaken_the_soulflayer::HandleSendEvent(), spell_uldaman_boss_agro_archaedas::HandleSendEvent(), spell_illidari_council_circle_of_healing::HandleSharedRule(), spell_putricide_mutated_transformation::HandleSummon(), go_eredar_twins_blaze::InitializeAI(), npc_toxic_slime::InitializeAI(), SmartAI::IsEscortInvokerInRange(), npc_hyjal_jaina::hyjalJainaAI::IsSummonedBy(), npc_living_inferno::npc_living_infernoAI::IsSummonedBy(), npc_kinetic_bomb::npc_kinetic_bombAI::IsSummonedBy(), npc_putricide_oozeAI::IsSummonedBy(), boss_yoggsaron_constrictor_tentacle::IsSummonedBy(), boss_kalec::JustDied(), boss_entropius::JustDied(), boss_headless_horseman::JustDied(), npc_hyjal_jaina::hyjalJainaAI::JustDied(), npc_hyjal_thrall::hyjalThrallAI::JustDied(), npc_hyjal_tyrande::hyjalTyrandeAI::JustDied(), boss_infinite_corruptor::boss_infinite_corruptorAI::JustDied(), npc_stinky_icc::npc_stinky_iccAI::JustDied(), npc_precious_icc::npc_precious_iccAI::JustDied(), DarkFallenAI::JustDied(), boss_kelthuzad_minion::boss_kelthuzad_minionAI::JustDied(), npc_mr_bigglesworth::JustDied(), boss_sjonnir_iron_sludge::boss_sjonnir_iron_sludgeAI::JustDied(), npc_auriaya_sanctum_sentry::JustDied(), npc_auriaya_feral_defender::JustDied(), boss_freya_summons::JustDied(), npc_ulduar_iron_construct::JustDied(), boss_kologarn_arms::JustDied(), boss_thorim_runic_colossus::JustDied(), boss_thorim_ancient_rune_giant::JustDied(), boss_epoch_hunter::JustDied(), boss_freya_elder_stonebark::JustDied(), boss_freya_elder_brightleaf::JustDied(), boss_freya_elder_ironbranch::JustDied(), npc_frost_tomb::JustDied(), npc_crystalline_frayer::JustEngagedWith(), npc_auriaya_sanctum_sentry::JustEngagedWith(), boss_thaddius_summon::boss_thaddius_summonAI::JustEngagedWith(), boss_razuvious_minion::boss_razuvious_minionAI::JustEngagedWith(), boss_headless_horseman::JustReachedHome(), boss_yoggsaron_cloud::JustSummoned(), npc_frozen_orb_stalker::npc_frozen_orb_stalkerAI::JustSummoned(), npc_warchief_portal::JustSummoned(), boss_captain_skarloc::JustSummoned(), npc_gluttonous_abomination::npc_gluttonous_abominationAI::JustSummoned(), npc_gothik_trigger::npc_gothik_triggerAI::JustSummoned(), boss_yoggsaron_death_orb::JustSummoned(), npc_boss_gothik_minion::npc_boss_gothik_minionAI::KilledUnit(), boss_grobbulus_poison_cloud::boss_grobbulus_poison_cloudAI::KilledUnit(), boss_kelthuzad_minion::boss_kelthuzad_minionAI::KilledUnit(), boss_razuvious_minion::boss_razuvious_minionAI::KilledUnit(), boss_thaddius_summon::boss_thaddius_summonAI::KilledUnit(), spell_felmyst_open_brutallus_back_doors::Load(), spell_igb_rocket_pack_useable_aura::Load(), spell_igb_gunship_fall_teleport::Load(), spell_igb_teleport_players_on_victory::Load(), spell_the_lich_king_quake::Load(), spell_the_lich_king_harvest_soul_aura::Load(), spell_the_lich_king_restore_soul::Load(), spell_dreamwalker_nightmare_cloud_aura::Load(), npc_ouro_spawner::MoveInLineOfSight(), npc_announcer_toc5::npc_announcer_toc5AI::MovementInform(), npc_ahune_bunny::npc_ahune_bunny(), npc_akama_illidan::npc_akama_illidan(), npc_akama_shade::npc_akama_shade(), npc_ancient_wisp::npc_ancient_wisp(), npc_argent_soldier::npc_argent_soldierAI::npc_argent_soldierAI(), npc_arthas::npc_arthasAI::npc_arthasAI(), npc_azure_saboteur::npc_azure_saboteur(), npc_barnes::npc_barnesAI::npc_barnesAI(), npc_belnistrasz::npc_belnistraszAI::npc_belnistraszAI(), npc_black_knight_ghoul::npc_black_knight_ghoulAI::npc_black_knight_ghoulAI(), npc_blood_queen_lana_thel::npc_blood_queen_lana_thelAI::npc_blood_queen_lana_thelAI(), npc_buru_egg::npc_buru_egg(), npc_chained_spirit::npc_chained_spirit(), npc_chesspiece::npc_chesspiece(), npc_creature_generator_akama::npc_creature_generator_akama(), npc_dirt_mound::npc_dirt_mound(), npc_dragonflayer_forge_master::npc_dragonflayer_forge_master(), npc_earthen_ring_flamecaller::npc_earthen_ring_flamecaller(), npc_echo_of_medivh::npc_echo_of_medivh(), npc_erekem_guard::npc_erekem_guard(), npc_ferocious_rhino::npc_ferocious_rhinoAI::npc_ferocious_rhinoAI(), npc_forest_frog::npc_forest_frog(), npc_fos_corrupted_soul_fragment::npc_fos_corrupted_soul_fragment(), npc_frenzied_worgen::npc_frenzied_worgenAI::npc_frenzied_worgenAI(), npc_frost_tomb::npc_frost_tomb(), npc_frozen_core::npc_frozen_core(), npc_general_andorov::npc_general_andorov(), npc_grimstone::npc_grimstone(), npc_harrison_jones::npc_harrison_jones(), npc_healing_ward::npc_healing_ward(), npc_high_overlord_saurfang_icc::npc_high_overlord_saurfangAI::npc_high_overlord_saurfangAI(), npc_hive_zara_larva::npc_hive_zara_larva(), npc_hor_leader_second::npc_hor_leader_secondAI::npc_hor_leader_secondAI(), npc_hor_leader::npc_hor_leaderAI::npc_hor_leaderAI(), npc_hor_lich_king::npc_hor_lich_king(), npc_icc_gauntlet_controller::npc_icc_gauntlet_controllerAI::npc_icc_gauntlet_controllerAI(), npc_icc_putricades_trap::npc_icc_putricades_trapAI::npc_icc_putricades_trapAI(), npc_ichor_globule::npc_ichor_globule(), npc_image_of_medivh::npc_image_of_medivhAI::npc_image_of_medivhAI(), npc_kalecgos_kj::npc_kalecgos_kj(), npc_kiljaeden_controller::npc_kiljaeden_controller(), npc_kilrek::npc_kilrek(), npc_madrigosa::npc_madrigosa(), npc_maiev_illidan::npc_maiev_illidan(), npc_massive_jormungar::npc_massive_jormungarAI::npc_massive_jormungarAI(), npc_medivh_bm::npc_medivh_bm(), npc_memory::npc_memoryAI::npc_memoryAI(), npc_millhouse_manastorm::npc_millhouse_manastormAI::npc_millhouse_manastormAI(), npc_molten_golem::npc_molten_golem(), npc_muradin_bronzebeard_icc::npc_muradin_bronzebeard_iccAI::npc_muradin_bronzebeard_iccAI(), npc_nerubian_burrower::npc_nerubian_burrowerAI::npc_nerubian_burrowerAI(), npc_oculus_drake::npc_oculus_drakeAI::npc_oculus_drakeAI(), npc_oculus_drakegiver::npc_oculus_drakegiverAI::npc_oculus_drakegiverAI(), npc_pos_after_first_boss::npc_pos_after_first_bossAI::npc_pos_after_first_bossAI(), npc_pos_collapsing_icicle::npc_pos_collapsing_icicleAI::npc_pos_collapsing_icicleAI(), npc_pos_deathwhisper_necrolyte::npc_pos_deathwhisper_necrolyteAI::npc_pos_deathwhisper_necrolyteAI(), npc_pos_icicle_trigger::npc_pos_icicle_triggerAI::npc_pos_icicle_triggerAI(), npc_pos_leader_second::npc_pos_leader_secondAI::npc_pos_leader_secondAI(), npc_pos_leader::npc_pos_leaderAI::npc_pos_leaderAI(), npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI::npc_pos_martin_or_gorkun_secondAI(), npc_pos_tyrannus_events::npc_pos_tyrannus_eventsAI::npc_pos_tyrannus_eventsAI(), npc_power_spark::npc_power_spark(), npc_ravenous_furbolg::npc_ravenous_furbolgAI::npc_ravenous_furbolgAI(), npc_risen_guardian::npc_risen_guardianAI::npc_risen_guardianAI(), npc_rocknot::npc_rocknot(), npc_scholomance_occultist::npc_scholomance_occultistAI::npc_scholomance_occultistAI(), npc_sergeant_bly::npc_sergeant_blyAI::npc_sergeant_blyAI(), npc_sindragosa_trash::npc_sindragosa_trashAI::npc_sindragosa_trashAI(), npc_snobold_vassal::npc_snobold_vassalAI::npc_snobold_vassalAI(), npc_taretha::npc_tarethaAI::npc_tarethaAI(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::npc_thrall_old_hillsbradAI(), npc_time_rift::npc_time_rift(), npc_tito::npc_tito(), npc_toc5_grand_champion_minion::npc_toc5_grand_champion_minionAI::npc_toc5_grand_champion_minionAI(), npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unit(), npc_ulduar_flash_freeze::npc_ulduar_flash_freeze(), npc_ulduar_hodir_druid::npc_ulduar_hodir_druid(), npc_ulduar_hodir_mage::npc_ulduar_hodir_mage(), npc_ulduar_hodir_priest::npc_ulduar_hodir_priest(), npc_ulduar_hodir_shaman::npc_ulduar_hodir_shaman(), npc_ulduar_leviathan_mkii::npc_ulduar_leviathan_mkii(), npc_ulduar_saronite_animus::npc_ulduar_saronite_animus(), npc_ulduar_saronite_vapors::npc_ulduar_saronite_vapors(), npc_ulduar_vx001::npc_ulduar_vx001(), npc_vh_teleportation_portal::npc_vh_teleportation_portal(), npc_vh_void_sentry::npc_vh_void_sentry(), npc_vrykul_skeleton::npc_vrykul_skeleton(), npc_weegli_blastfuse::npc_weegli_blastfuseAI::npc_weegli_blastfuseAI(), npc_zealot_lorkhan::npc_zealot_lorkhan(), npc_zealot_zath::npc_zealot_zath(), spell_blood_queen_vampiric_bite::OnCast(), achievement_cant_do_that_while_stunned::OnCheck(), achievement_auriaya_crazy_cat_lady::OnCheck(), achievement_auriaya_nine_lives::OnCheck(), achievement_kologarn_looks_could_kill::OnCheck(), achievement_kologarn_rubble_and_roll::OnCheck(), achievement_kologarn_with_open_arms::OnCheck(), achievement_flame_leviathan_unbroken::OnCheck(), achievement_thorim_stand_in_the_lightning::OnCheck(), achievement_thorim_lose_your_illusion::OnCheck(), achievement_yogg_saron_darkness::OnCheck(), achievement_yogg_saron_he_waits_dreaming::OnCheck(), go_blackened_urn::OnGossipHello(), go_gong_of_bethekk::OnGossipHello(), go_palehoof_sphere::OnGossipHello(), go_main_chambers_access_panel::OnGossipHello(), go_broggok_lever::OnGossipHello(), npc_barnes::OnGossipHello(), npc_arthas::OnGossipHello(), npc_cos_chromie_middle::OnGossipHello(), npc_thrall_old_hillsbrad::OnGossipHello(), npc_announcer_toc5::OnGossipHello(), npc_announcer_toc10::OnGossipHello(), npc_hor_leader::OnGossipHello(), npc_high_overlord_saurfang_icc::OnGossipHello(), npc_muradin_bronzebeard_icc::OnGossipHello(), npc_alchemist_adrianna::OnGossipHello(), npc_oculus_drakegiver::OnGossipHello(), icecrown_citadel_teleport::OnGossipHello(), go_ulduar_do_not_push_this_button::OnGossipHello(), go_strange_pool::OnGossipHello(), npc_hyjal_jaina::OnGossipSelect(), npc_hyjal_thrall::OnGossipSelect(), npc_zulaman_hostage::OnGossipSelect(), npc_high_overlord_saurfang_icc::OnGossipSelect(), npc_muradin_bronzebeard_icc::OnGossipSelect(), npc_announcer_toc5::OnGossipSelect(), npc_announcer_toc10::OnGossipSelect(), npc_hor_leader::OnGossipSelect(), npc_cos_chromie_start::OnGossipSelect(), npc_cos_chromie_middle::OnGossipSelect(), npc_thrall_old_hillsbrad::OnGossipSelect(), npc_hor_leader_second::OnGossipSelect(), npc_icc_buff_switcher::OnGossipSelect(), go_pumpkin_shrine::OnGossipSelect(), go_enchanted_scarlet_thread::OnLootStateChanged(), npc_cos_chromie_middle::OnQuestAccept(), npc_cos_chromie_start::OnQuestAccept(), spell_blood_queen_frenzied_bloodthirst_aura::OnRemove(), spell_malygos_vortex_visual::OnRemove(), boss_yoggsaron_brain::OnSpellCast(), go_father_flame::OnStateChanged(), OnlyOnceAreaTriggerScript::OnTrigger(), at_ring_of_law::OnTrigger(), at_trigger_the_beast_movement::OnTrigger(), at_the_beast_room::OnTrigger(), at_dragonspire_hall::OnTrigger(), at_blackrock_stadium::OnTrigger(), at_karazhan_atiesh_aran::OnTrigger(), at_karazhan_mirkblood_approach::OnTrigger(), at_karazhan_mirkblood_entrance::OnTrigger(), at_malfurion_stormrage::OnTrigger(), at_cthun_stomach_exit::OnTrigger(), at_cthun_center::OnTrigger(), at_battleguard_sartura::OnTrigger(), at_baltharus_plateau::OnTrigger(), at_hor_shadow_throne::OnTrigger(), at_hor_battered_hilt_start::OnTrigger(), at_hor_battered_hilt_throw::OnTrigger(), at_tyrannus_event_starter::OnTrigger(), at_lady_deathwhisper_entrance::OnTrigger(), at_sindragosa_lair::OnTrigger(), at_icc_saurfang_portal::OnTrigger(), at_icc_shutdown_traps::OnTrigger(), at_icc_start_blood_quickening::OnTrigger(), at_icc_start_frostwing_gauntlet::OnTrigger(), at_icc_gauntlet_event::OnTrigger(), at_icc_putricide_trap::OnTrigger(), at_frozen_throne_teleport::OnTrigger(), at_naxxramas_hub_portal::OnTrigger(), at_quagmirran_lair::OnTrigger(), at_shattered_halls_execution::OnTrigger(), ValithriaDespawner::operator()(), npc_hyjal_jaina::hyjalJainaAI::PathEndReached(), SmartScript::ProcessAction(), spell_igb_gunship_fall_teleport::RelocateDest(), npc_dark_fiend::Reset(), npc_hyjal_jaina::hyjalJainaAI::Reset(), npc_hyjal_thrall::hyjalThrallAI::Reset(), boss_infinite_corruptor::boss_infinite_corruptorAI::Reset(), go_sand_trap::Reset(), npc_xerestrasza::npc_xerestraszaAI::Reset(), npc_announcer_toc5::npc_announcer_toc5AI::Reset(), OnlyOnceAreaTriggerScript::ResetAreaTriggerDone(), boss_freya_summons::ReviveWithAllies(), GameObject::SaveStateToDB(), spell_the_lich_king_valkyr_target_search::SelectTarget(), spell_igb_gunship_fall_teleport::SelectTransport(), Player::SendInitWorldStates(), Player::SendLoot(), Unit::setDeathState(), Player::SetInWater(), boss_gloomrel::sGossipSelect(), boss_victor_nefarius::sGossipSelect(), npc_expedition_commander::sGossipSelect(), npc_ulduar_iron_construct::SpellHit(), npc_ulduar_keeper::npc_ulduar_keeperAI::SpellHit(), npc_living_constellation::SpellHit(), npc_ulduar_rocket_strike_trigger::SpellHitTarget(), boss_yoggsaron_voice::SpellHitTarget(), npc_gothik_trigger::npc_gothik_triggerAI::SummonedCreatureDespawn(), TriggerBurningPitch(), npc_bone_spike::npc_bone_spikeAI::UpdateAI(), npc_frost_freeze_trap::npc_frost_freeze_trapAI::UpdateAI(), boss_thaddius_summon::boss_thaddius_summonAI::UpdateAI(), npc_brann_bronzebeard_algalon::UpdateAI(), boss_freya_summons::UpdateAI(), npc_ulduar_flash_freeze::UpdateAI(), npc_ulduar_bot_summon_trigger::UpdateAI(), npc_ulduar_flames_initial::UpdateAI(), boss_yoggsaron_sara::UpdateAI(), Player::UpdateArea(), Map::UpdateEncounterState(), SmartAI::UpdateFollow(), violet_hold_trashAI::violet_hold_trashAI(), and npc_black_knight_skeletal_gryphon::npc_black_knight_skeletal_gryphonAI::WaypointReached().

◆ GetLeewayBonusRadius()

float WorldObject::GetLeewayBonusRadius ( ) const
1792{
1793 if (Player const* player = ToPlayer())
1794 {
1795 bool hasLeewayMovement = false;
1796
1797 if (player->HasUnitState(UNIT_STATE_JUMPING) || player->HasUnitMovementFlag(MOVEMENTFLAG_FALLING))
1798 hasLeewayMovement = true;
1799 else
1800 {
1801 float speedXY = (player->m_movementInfo.jump.xyspeed > 0.0f)
1802 ? player->m_movementInfo.jump.xyspeed
1803 : player->GetSpeed(player->IsWalking() ? MOVE_WALK : MOVE_RUN);
1804
1805 hasLeewayMovement = speedXY > LEEWAY_MIN_MOVE_SPEED;
1806 }
1807
1808 if (hasLeewayMovement)
1809 return LEEWAY_BONUS_RANGE;
1810 }
1811
1812 return 0.0f;
1813}
#define LEEWAY_BONUS_RANGE
Definition ObjectDefines.h:51
#define LEEWAY_MIN_MOVE_SPEED
Definition ObjectDefines.h:50
@ MOVEMENTFLAG_FALLING
Definition UnitDefines.h:384
@ UNIT_STATE_JUMPING
Definition UnitDefines.h:191
@ MOVE_RUN
Definition UnitDefines.h:357
@ MOVE_WALK
Definition UnitDefines.h:356

References LEEWAY_BONUS_RANGE, LEEWAY_MIN_MOVE_SPEED, MOVE_RUN, MOVE_WALK, MOVEMENTFLAG_FALLING, Object::ToPlayer(), and UNIT_STATE_JUMPING.

Referenced by Spell::CheckRange(), Spell::SelectImplicitAreaTargets(), and Spell::SelectImplicitConeTargets().

◆ GetLeewayBonusRange()

float WorldObject::GetLeewayBonusRange ( Unit const *  target) const
1778{
1779 if (!target)
1780 return 0.0f;
1781
1782 if (Player const* player = ToPlayer())
1783 return GetLeewayBonusRangeForTargets(player, target);
1784
1785 if (Player const* playerTarget = target->ToPlayer())
1786 return GetLeewayBonusRangeForTargets(playerTarget, ToUnit());
1787
1788 return 0.0f;
1789}
static float GetLeewayBonusRangeForTargets(Player const *player, Unit const *target)
Definition Object.cpp:1765

References GetLeewayBonusRangeForTargets(), Object::ToPlayer(), and Object::ToUnit().

Referenced by Spell::CheckRange(), and Unit::IsWithinMeleeRange().

◆ GetLeewayBonusRangeForTargets()

float WorldObject::GetLeewayBonusRangeForTargets ( Player const *  player,
Unit const *  target 
)
static
1766{
1767 if (!player || !target)
1768 return 0.0f;
1769
1771 if (player->HasUnitMovementFlag(leewayMoveFlags) && !player->IsWalking() && target->HasUnitMovementFlag(leewayMoveFlags) && !target->IsWalking())
1772 return LEEWAY_BONUS_RANGE;
1773
1774 return 0.0f;
1775}
@ MOVEMENTFLAG_FORWARD
Definition UnitDefines.h:372
@ MOVEMENTFLAG_STRAFE_LEFT
Definition UnitDefines.h:374
@ MOVEMENTFLAG_STRAFE_RIGHT
Definition UnitDefines.h:375

References Unit::HasUnitMovementFlag(), Unit::IsWalking(), LEEWAY_BONUS_RANGE, MOVEMENTFLAG_FALLING, MOVEMENTFLAG_FORWARD, MOVEMENTFLAG_STRAFE_LEFT, and MOVEMENTFLAG_STRAFE_RIGHT.

Referenced by GetLeewayBonusRange().

◆ getLevelForTarget()

virtual uint8 WorldObject::getLevelForTarget ( WorldObject const *  ) const
inlinevirtual

Reimplemented in Unit, Creature, and GameObject.

576{ return 1; }

Referenced by CanDetectStealthOf(), Spell::DoAllEffectOnTarget(), and MagicSpellHitResult().

◆ GetLiquidData()

◆ GetMagicHitRedirectTarget()

Unit * WorldObject::GetMagicHitRedirectTarget ( Unit *  victim,
SpellInfo const *  spellInfo 
)
4042{
4043 // non-Unit casters cannot have their spells redirected
4044 if (Unit* unitSelf = ToUnit())
4045 return unitSelf->GetMagicHitRedirectTarget(victim, spellInfo);
4046
4047 return victim;
4048}

References Unit::GetMagicHitRedirectTarget(), and Object::ToUnit().

Referenced by Spell::SelectExplicitTargets().

◆ GetMap()

Map * WorldObject::GetMap ( ) const
inline
637{ ASSERT(m_currMap); return m_currMap; }

References ASSERT, and m_currMap.

Referenced by Unit::_ExitVehicle(), Map::_FindGameObject(), Battleground::_ProcessResurrect(), RandomMovementGenerator< T >::_setRandomLocation(), boss_sjonnir::boss_sjonnirAI::ActivatePipe(), Map::AddPlayerToMap(), AddToMapVisibilityOverrideContainers(), AddToObjectUpdate(), GameObject::AddToSkillupList(), Corpse::AddToWorld(), Creature::AddToWorld(), DynamicObject::AddToWorld(), GameObject::AddToWorld(), AddToWorld(), Pet::AddToWorld(), Map::ApplyDynamicModeRespawnScaling(), npc_ritual_channeler::npc_ritual_channelerAI::AttackStart(), npc_av_marshal_or_warmaster::npc_av_marshal_or_warmasterAI::AttackStart(), boss_drekthar::boss_drektharAI::AttackStart(), boss_vanndar::boss_vanndarAI::AttackStart(), DynamicObject::BindToCaster(), Player::BuildPlayerRepop(), PathGenerator::BuildPolyPath(), MotionTransport::BuildUpdate(), StaticTransport::BuildUpdate(), spell_svala_ritual_strike_aura::CalculateAmount(), CombatManager::CanBeginCombat(), Creature::CanCreatureAttack(), Unit::CanHaveThreatList(), CanNeverSee(), Creature::CanPeriodicallyCallForAssistance(), Player::CanRollForItemInLFG(), boss_professor_putricide::boss_professor_putricideAI::ChangePhase(), Spell::CheckCast(), Player::CheckDuelDistance(), Spell::CheckEffectTarget(), spell_sha_fire_nova::CheckFireTotem(), boss_gothik::boss_gothikAI::CheckGroupSplitted(), Player::CheckInstanceLoginValid(), boss_volazj::CheckPhaseMinions(), BattlegroundRV::CheckPositionForUnit(), boss_heigan::CheckSafetyDance(), Spell::CheckSpellFocus(), Creature::Create(), Pet::CreateBaseAtCreature(), Pet::CreateBaseAtCreatureInfo(), Player::CreateCorpse(), DynamicObject::CreateDynamicObject(), Creature::CreateFromProto(), MotionTransport::CreateGOPassenger(), MotionTransport::CreateNPCPassenger(), Player::CreatePet(), Player::CreatePet(), TransportMgr::CreateTransport(), boss_eregos::boss_eregosAI::DamageTaken(), boss_eadric::boss_eadricAI::DamageTaken(), boss_ick::boss_ickAI::DamageTaken(), boss_freya::DamageTaken(), npc_molten_golem::DamageTaken(), boss_the_lich_king::boss_the_lich_kingAI::DamageTaken(), boss_thorim::DamageTaken(), MotionTransport::DelayedTeleportTransport(), GameObject::Delete(), Creature::DeleteFromDB(), GameObject::DeleteFromDB(), Creature::DespawnOnEvade(), GameObject::DespawnOrUnsummon(), boss_twin_valkyrAI::DoAction(), boss_nightbane::DoAction(), npc_harrison_jones::DoAction(), boss_ayamiss::DoAction(), npc_thrall_warchief::npc_thrall_warchiefAI::DoAction(), npc_orb_carrier::npc_orb_carrierAI::DoAction(), npc_high_overlord_saurfang_igb::npc_high_overlord_saurfang_igbAI::DoAction(), npc_muradin_bronzebeard_igb::npc_muradin_bronzebeard_igbAI::DoAction(), boss_the_lich_king::boss_the_lich_kingAI::DoAction(), npc_strangulate_vehicle::npc_strangulate_vehicleAI::DoAction(), npc_arthas::npc_arthasAI::DoAction(), boss_yoggsaron_sara::DoAction(), boss_illidari_council::DoAction(), Spell::DoAllEffectOnTarget(), boss_algalon_the_observer::DoCheckHeraldOfTheTitans(), MotionTransport::DoEventIfAny(), FlightPathMovementGenerator::DoEventIfAny(), WorldSession::DoLootRelease(), ScriptedAI::DoPlayMusic(), ScriptedAI::DoRewardPlayersInArea(), npc_forest_frog::DoSpawnRandom(), ScriptedAI::DoTeleportAll(), boss_icehowl::boss_icehowlAI::DoTrampleIfValid(), WaypointMovementGenerator< Creature >::DoUpdate(), CreatureAI::DoZoneInCombat(), Player::DuelComplete(), DynObjAura::DynObjAura(), Spell::EffectAddFarsight(), Spell::EffectCreateTamedPet(), Spell::EffectDestroyAllTotems(), Spell::EffectDuel(), Spell::EffectDummy(), Spell::EffectPersistentAA(), Spell::EffectSanctuary(), Spell::EffectScriptEffect(), Spell::EffectSendEvent(), Spell::EffectSummonObject(), Spell::EffectSummonObjectWild(), Spell::EffectSummonPet(), Spell::EffectSummonType(), Spell::EffectTameCreature(), Spell::EffectTeleportUnits(), Spell::EffectTransmitted(), brann_bronzebeard::EndTribunalFight(), boss_sapphiron::boss_sapphironAI::EnterCombatSelfFunction(), npc_av_marshal_or_warmaster::npc_av_marshal_or_warmasterAI::EnterEvadeMode(), boss_drekthar::boss_drektharAI::EnterEvadeMode(), boss_vanndar::boss_vanndarAI::EnterEvadeMode(), boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::EnterEvadeMode(), boss_malygos::EnterEvadeMode(), UnitAI::EvadeTimerExpired(), BattleExperienceEvent::Execute(), Unit::ExecuteDelayedUnitRelocationEvent(), SmartScript::FillScript(), npc_singularity::FindAndFollowTarget(), SmartScript::FindCreatureNear(), SmartScript::FindGameObjectNear(), Creature::ForcedDespawn(), boss_thorim::GetArenaPlayer(), Player::GetCorpse(), ObjectAccessor::GetCorpse(), ObjectAccessor::GetCreature(), ChatHandler::GetCreatureFromPlayerMapByDbGuid(), ObjectAccessor::GetDynamicObject(), GetFloorZ(), ObjectAccessor::GetGameObject(), Player::GetGameObjectIfCanInteractWith(), GetGridActivationRange(), GetInstanceScript(), GetMapHeight(), GetMapWaterOrGroundLevel(), Unit::GetMeleeAttackPoint(), PathGenerator::GetNavTerrain(), Player::GetNextQuest(), ChatHandler::GetObjectFromPlayerMapByDbGuid(), ObjectAccessor::GetPet(), ObjectAccessor::GetPlayer(), GetSightRange(), npc_ranshalla::npc_ranshallaAI::GetSpeakerByEntry(), SpellMgr::GetSpellIdForDifficulty(), SmartScript::GetTargets(), ObjectAccessor::GetTransport(), GetVisibilityRange(), go_celestial_planetarium_access::go_celestial_planetarium_accessAI::GossipHello(), misc_commandscript::HandleAppearCommand(), WorldSession::HandleAreaSpiritHealerQueryOpcode(), WorldSession::HandleAreaSpiritHealerQueueOpcode(), WorldSession::HandleAreaTriggerOpcode(), AuraEffect::HandleAuraDummy(), WorldSession::HandleAutostoreLootItemOpcode(), WorldSession::HandleBattlemasterHelloOpcode(), WorldSession::HandleBattlemasterJoinArena(), misc_commandscript::HandleChangeWeather(), spell_freezing_circle::HandleDamage(), debug_commandscript::HandleDebugMapDataCommand(), debug_commandscript::HandleDebugSpawnVehicleCommand(), debug_commandscript::HandleDebugVisibilityDataCommand(), debug_commandscript::HandleDebugZoneStatsCommand(), deserter_commandscript::HandleDeserterAdd(), OutdoorPvPSI::HandleDropFlag(), spell_item_nitro_boots::HandleDummy(), spell_sha_fire_nova::HandleDummy(), spell_teron_gorefiend_shadowy_construct::HandleEffectApply(), spell_valkyr_touch_aura::HandleEffectPeriodic(), AuraEffect::HandleFeignDeath(), MotionTransport::HandleFirstDepartureSync(), gobject_commandscript::HandleGameObjectAddCommand(), gobject_commandscript::HandleGameObjectDespawnGroupCommand(), WorldSession::HandleGameobjectReportUse(), gobject_commandscript::HandleGameObjectSpawnGroupCommand(), gobject_commandscript::HandleGameObjectTargetCommand(), WorldSession::HandleGossipSelectOptionOpcode(), misc_commandscript::HandleGPSCommand(), misc_commandscript::HandleGroupSummonCommand(), instance_commandscript::HandleInstanceSaveDataCommand(), list_commandscript::HandleListCreatureCommand(), list_commandscript::HandleListObjectCommand(), list_commandscript::HandleListRespawnsCommand(), WorldSession::HandleLootMasterGiveOpcode(), WorldSession::HandleLootMoneyOpcode(), mmaps_commandscript::HandleMmapLoadedTilesCommand(), mmaps_commandscript::HandleMmapLocCommand(), mmaps_commandscript::HandleMmapPathCommand(), mmaps_commandscript::HandleMmapStatsCommand(), AuraEffect::HandleModInvisibility(), AuraEffect::HandleModPossessPet(), AuraEffect::HandleModStealth(), WorldSession::HandleMoverRelocation(), WorldSession::HandleMoveTeleportAck(), WorldSession::HandleMoveWorldportAck(), npc_commandscript::HandleNpcAddCommand(), npc_commandscript::HandleNpcDespawnGroupCommand(), npc_commandscript::HandleNpcSpawnGroupCommand(), spell_yogg_saron_brain_link_aura::HandleOnEffectApply(), WorldSession::HandlePetAction(), AuraEffect::HandlePhase(), WorldSession::HandlePlayerLoginFromDB(), WorldSession::HandlePlayerLoginToCharInWorld(), pool_commandscript::HandlePoolLookupCommand(), AuraEffect::HandlePreventResurrection(), misc_commandscript::HandleRespawnAllCommand(), misc_commandscript::HandleRespawnCreatureByEntryCommand(), misc_commandscript::HandleRespawnCreatureByGuidCommand(), misc_commandscript::HandleRespawnGameObjectByEntryCommand(), misc_commandscript::HandleRespawnGameObjectByGuidCommand(), spell_dreamwalker_summon_portal::HandleScript(), spell_prince_taldaram_conjure_flame_sphere::HandleScript(), spell_sha_stoneclaw_totem::HandleScriptEffect(), WorldSession::HandleSetDungeonDifficultyOpcode(), WorldSession::HandleSetRaidDifficultyOpcode(), misc_commandscript::HandleSkirmishCommand(), spell_halion_damage_aoe_summon::HandleSummon(), spell_putricide_mutated_transformation::HandleSummon(), spell_q13010_jokkum_summon::HandleSummon(), spell_wintergrasp_create_vehicle::HandleSummon(), misc_commandscript::HandleSummonCommand(), WorldSession::HandleTotemDestroyed(), spell_winter_veil_racer_rocket_slam::HandleTriggerSpell(), wp_commandscript::HandleWpModifyCommand(), wp_commandscript::HandleWpShowCommand(), boss_yoggsaron_sara::HasAlivePlayerInIllusion(), Player::HasQuestForGO(), Player::HasQuestForItem(), boss_ichoron::IchoronDoCastToAllHostilePlayers(), Creature::InitEntry(), TempSummon::InitStats(), Player::inRandomLfgDungeon(), InstanceHasScript(), boss_halion::boss_halionAI::IsAnyPlayerValid(), Player::IsAtGroupRewardDistance(), Unit::isAttackingPlayer(), npc_valkyr_shadowguard::npc_valkyr_shadowguardAI::IsHeroic(), npc_strangulate_vehicle::npc_strangulate_vehicleAI::IsHeroic(), Unit::isInAccessiblePlaceFor(), IsInsideWMOGroups(), PathGenerator::IsSwimmableSegment(), Creature::IsUpdateNeeded(), GameObject::IsUpdateNeeded(), IsWithinLOS(), IsWithinLOSInMap(), npc_ranshalla::npc_ranshallaAI::JustDidDialogueStep(), boss_rend_blackhand::JustDied(), boss_apothecary_hummel::boss_apothecary_hummelAI::JustDied(), npc_coren_direbrew::JustDied(), boss_headless_horseman::JustDied(), boss_azuregos::boss_azuregosAI::JustDied(), boss_rajaxx::JustDied(), boss_skeram::JustDied(), boss_sartharion_dragonAI::JustDied(), boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::JustDied(), npc_gunship::npc_gunshipAI::JustDied(), boss_sjonnir::boss_sjonnirAI::JustDied(), boss_yoggsaron::JustDied(), boss_ahune::JustDied(), boss_four_horsemen::boss_four_horsemenAI::JustDied(), boss_alar::JustDied(), boss_krystallus::boss_krystallusAI::JustEngagedWith(), boss_sjonnir::boss_sjonnirAI::JustEngagedWith(), boss_shirrak_the_dead_watcher::JustEngagedWith(), boss_alyson_antille::JustEngagedWith(), boss_ossirian::JustEngagedWith(), boss_devourer_of_souls::JustEngagedWith(), npc_tirion_fordring_tft::npc_tirion_fordringAI::JustReachedHome(), boss_lady_deathwhisper::boss_lady_deathwhisperAI::JustSummoned(), boss_gothik::boss_gothikAI::JustSummoned(), Unit::Kill(), Player::KilledMonsterCredit(), Player::KilledPlayerCredit(), spell_svalna_revive_champion::Land(), boss_felblood_kaelthas::LapseAction(), spell_the_lich_king_vile_spirits_aura::Load(), Creature::LoadCreatureFromDB(), GameObject::LoadGameObjectFromDB(), StaticTransport::LoadGameObjectFromDB(), Pet::LoadPetFromDB(), MotionTransport::LoadStaticPassengers(), WorldSession::LogoutPlayer(), AchievementCriteriaData::Meets(), CreatureGroup::MemberEvaded(), spell_mimiron_magnetic_core_summon::ModDest(), MotionMaster::MoveBackwards(), MotionMaster::MoveFall(), MotionMaster::MoveForwards(), npc_ulduar_snow_mound::MoveInLineOfSight(), npc_tirion_fordring_tft::npc_tirion_fordringAI::MovementInform(), npc_valkyr_shadowguard::npc_valkyr_shadowguardAI::MovementInform(), boss_malygos::MovementInform(), boss_the_lich_king::boss_the_lich_kingAI::MovementInform(), MovePositionToFirstCollision(), npc_image_of_medivh::npc_image_of_medivhAI::NextStep(), npc_alexstrasza::npc_alexstrasza(), npc_frost_sphere::npc_frost_sphereAI::npc_frost_sphereAI(), npc_scion_of_eternity::npc_scion_of_eternity(), achievement_once_bitten_twice_shy::OnCheck(), npc_essence_of_twin::OnGossipHello(), npc_harrowmeiser::OnGossipHello(), npc_bombardier_petrov::OnGossipHello(), lfg::LFGPlayerScript::OnPlayerMapChanged(), spell_malygos_vortex_visual::OnRemove(), at_ancient_leaf::OnTrigger(), at_icc_saurfang_portal::OnTrigger(), AreaTrigger_at_celestial_planetarium_enterance::OnTrigger(), at_shattered_halls_execution::OnTrigger(), boss_pyroguard_emberseer::OpenDoors(), boss_nightbane::PathEndReached(), PathGenerator::PathGenerator(), Unit::PetSpellFail(), spell_halion_twilight_phasing::Phase(), Player::PrepareQuestMenu(), spell_fire_festival_fortitude::PrepareSpellScript(), SmartScript::ProcessAction(), WorldSession::ProcessMovementInfo(), ProcessPositionDataChanged(), WaypointMovementGenerator< Creature >::ProcessWaypointArrival(), spell_entropius_black_hole_effect::RaycastToObstacle(), GameObject::Refresh(), Vehicle::RelocatePassengers(), Player::RemovedInsignia(), RemoveFromMapVisibilityOverrideContainers(), RemoveFromObjectUpdate(), Corpse::RemoveFromWorld(), Creature::RemoveFromWorld(), DynamicObject::RemoveFromWorld(), GameObject::RemoveFromWorld(), Pet::RemoveFromWorld(), boss_krystallus::boss_krystallusAI::RemoveStonedEffect(), boss_sartharion_dragonAI::RemoveTwilightPortal(), Player::RepopAtGraveyard(), boss_rend_blackhand::Reset(), boss_azuregos::boss_azuregosAI::Reset(), boss_ossirian::Reset(), npc_tirion_fordring_tft::npc_tirion_fordringAI::Reset(), npc_raging_spirit::npc_raging_spiritAI::Reset(), npc_frostwing_vrykul::npc_frostwing_vrykulAI::Reset(), boss_sjonnir::boss_sjonnirAI::Reset(), boss_flame_leviathan_seat::Reset(), boss_kologarn_pit_kill_bunny::Reset(), boss_yoggsaron_sara::Reset(), Player::ResetMap(), boss_volazj::ResetPlayersPhaseMask(), GameObject::Respawn(), Creature::Respawn(), Player::RewardQuest(), Player::RewardReputation(), Creature::SaveRespawnTime(), GameObject::SaveRespawnTime(), brann_bronzebeard::SchedulePhaseAbilities(), ScriptedAI::ScriptedAI(), Map::ScriptsProcess(), Spell::SearchTargets(), boss_yoggsaron_constrictor_tentacle::SelectConstrictTarget(), boss_yoggsaron_corruptor_tentacle::SelectCorruptionTarget(), Spell::SelectImplicitCasterDestTargets(), boss_gluth::boss_gluthAI::SelectPlayerInRoom(), boss_thorim_arena_npcs::SelectT(), spell_gen_rallying_cry_of_the_dragonslayer::SelectTarget(), ScriptedAI::SelectTargetFromPlayerList(), npc_minigob_manabonk::SelectTargetInDalaran(), CreatureTextMgr::SendChatPacket(), Player::SendInitialPacketsAfterAddToMap(), Player::SendInitialPacketsBeforeAddToMap(), Player::SendLoot(), CreatureTextMgr::SendNonChatPacket(), SendPacketToPlayers(), Acore::VisibleNotifier::SendToSelf(), npc_highlord_darion_mograine::SendUpdateWorldState(), npc_pos_tyrannus_events::npc_pos_tyrannus_eventsAI::SetData(), boss_pyroguard_emberseer::SetData(), Creature::setDeathState(), spell_blood_council_summon_shadow_resonance::SetDest(), spell_spawn_blood_pool::SetDest(), GameObject::SetDestructibleState(), Player::SetEntryPoint(), npc_gunship::npc_gunshipAI::SetGUID(), Unit::SetHover(), Creature::SetLootRecipient(), Unit::SetPhaseMask(), Creature::SetPosition(), GameObject::SetPosition(), boss_akilzon::SetWeather(), npc_tirion_fordring_tft::npc_tirion_fordringAI::sGossipSelect(), PathGenerator::ShortenPathUntilDist(), Player::SpawnCorpseBones(), boss_hodir::SpawnHelpers(), boss_yoggsaron_sara::SpawnTentacle(), boss_jaraxxus::boss_jaraxxusAI::SpellHit(), boss_flame_leviathan::SpellHit(), boss_the_lich_king::boss_the_lich_kingAI::SpellHitTarget(), CinematicMgr::StartCinematicCamera(), Player::StoreRaidMapDifficulty(), boss_majordomo::SummonedCreatureDies(), npc_kiljaeden_controller::SummonedCreatureDies(), npc_varian_wrynn::npc_varian_wrynnAI::SummonedCreatureDies(), npc_thrall_bfu::npc_thrall_bfuAI::SummonedCreatureDies(), SummonGameObject(), Spell::SummonGuardian(), Player::SummonPet(), boss_rend_blackhand::SummonWave(), brann_bronzebeard::SwitchHeadVisual(), lfg::LFGMgr::TeleportPlayer(), Player::TeleportTo(), MotionTransport::TeleportTransport(), Vehicle::TeleportVehicle(), Unit::UnsummonAllTotems(), Pet::Update(), MotionTransport::Update(), DynamicObject::Update(), GameObject::Update(), Creature::Update(), Player::Update(), AchievementMgr::UpdateAchievementCriteria(), boss_rend_blackhand::UpdateAI(), boss_chromaggus::UpdateAI(), boss_nefarian::UpdateAI(), boss_vaelastrasz::UpdateAI(), npc_highlord_darion_mograine::UpdateAI(), npc_varian_wrynn::npc_varian_wrynnAI::UpdateAI(), npc_thrall_bfu::npc_thrall_bfuAI::UpdateAI(), npc_forest_frog::UpdateAI(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::UpdateAI(), npc_time_rift::UpdateAI(), npc_belnistrasz::npc_belnistraszAI::UpdateAI(), boss_cthun::UpdateAI(), npc_toc5_grand_champion_minion::npc_toc5_grand_champion_minionAI::UpdateAI(), boss_grand_champion::boss_grand_championAI::UpdateAI(), npc_snobold_vassal::npc_snobold_vassalAI::UpdateAI(), boss_gormok::boss_gormokAI::UpdateAI(), boss_twin_valkyrAI::UpdateAI(), npc_pos_tyrannus_events::npc_pos_tyrannus_eventsAI::UpdateAI(), boss_prince_valanar_icc::boss_prince_valanarAI::UpdateAI(), boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::UpdateAI(), boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::UpdateAI(), npc_high_overlord_saurfang_igb::npc_high_overlord_saurfang_igbAI::UpdateAI(), npc_muradin_bronzebeard_igb::npc_muradin_bronzebeard_igbAI::UpdateAI(), npc_gunship_boarding_addAI::UpdateAI(), npc_gunship_gunner::npc_gunship_gunnerAI::UpdateAI(), boss_lady_deathwhisper::boss_lady_deathwhisperAI::UpdateAI(), boss_the_lich_king::boss_the_lich_kingAI::UpdateAI(), npc_tirion_fordring_tft::npc_tirion_fordringAI::UpdateAI(), npc_raging_spirit::npc_raging_spiritAI::UpdateAI(), npc_icc_valkyr_herald::npc_icc_valkyr_heraldAI::UpdateAI(), npc_icc_gauntlet_controller::npc_icc_gauntlet_controllerAI::UpdateAI(), npc_icc_putricades_trap::npc_icc_putricades_trapAI::UpdateAI(), npc_ioc_gunship_captain::npc_ioc_gunship_captainAI::UpdateAI(), boss_gothik::boss_gothikAI::UpdateAI(), boss_sapphiron::boss_sapphironAI::UpdateAI(), boss_malygos::UpdateAI(), boss_keristrasza::UpdateAI(), npc_brann_bronzebeard_algalon::UpdateAI(), boss_freya::UpdateAI(), boss_freya_nature_bomb::UpdateAI(), boss_vezax::UpdateAI(), boss_hodir::UpdateAI(), boss_ignis::UpdateAI(), boss_mimiron::UpdateAI(), npc_ulduar_leviathan_mkii::UpdateAI(), npc_ulduar_flames_initial::UpdateAI(), boss_yoggsaron_death_ray::UpdateAI(), npc_preparations_for_war_vehicle::UpdateAI(), npc_pet_gen_plump_turkey::UpdateAI(), npc_gunship::npc_gunshipAI::UpdateAI(), npc_midsummer_bonfire::UpdateBonfireBlessingBuffs(), Player::UpdateCharmedAI(), CinematicMgr::UpdateCinematic(), npc_grimstone::UpdateEscortAI(), GameObject::UpdateModel(), GameObject::UpdateModelPosition(), StaticTransport::UpdatePassengerPositions(), MotionTransport::UpdatePassengerPositions(), boss_netherspite::UpdatePortals(), Unit::UpdatePosition(), MotionTransport::UpdatePosition(), StaticTransport::UpdatePosition(), UpdatePositionData(), boss_pyroguard_emberseer::UpdateRunes(), Player::UpdateVisibilityForPlayer(), Player::UpdateVisibilityOf(), npc_herald_of_the_lich_king::UpdateWeather(), npc_pallid_horror::UpdateWeather(), Player::UpdateZone(), GameObject::Use(), Cell::VisitFarVisibleObjects(), Cell::VisitObjects(), npc_ranshalla::npc_ranshallaAI::WaypointReached(), npc_grimstone::WaypointReached(), npc_thrall_bfu::npc_thrall_bfuAI::WaypointReached(), and npc_cork_gizelton::npc_cork_gizeltonAI::WaypointReached().

◆ GetMapHeight()

◆ GetMapWaterOrGroundLevel() [1/2]

float WorldObject::GetMapWaterOrGroundLevel ( float  x,
float  y,
float  z,
float *  ground = nullptr 
) const
3154{
3155 return GetMap()->GetWaterOrGroundLevel(GetPhaseMask(), x, y, z, ground,
3156 IsUnit() ? !static_cast<Unit const*>(this)->HasWaterWalkAura() : false,
3158}
float GetWaterOrGroundLevel(uint32 phasemask, float x, float y, float z, float *ground=nullptr, bool swim=false, float collisionHeight=DEFAULT_COLLISION_HEIGHT) const
Definition Map.cpp:1140
STL namespace.

References GetCollisionHeight(), GetMap(), GetPhaseMask(), Map::GetWaterOrGroundLevel(), Object::IsUnit(), and Z_OFFSET_FIND_HEIGHT.

◆ GetMapWaterOrGroundLevel() [2/2]

float WorldObject::GetMapWaterOrGroundLevel ( Position  pos,
float *  ground = nullptr 
) const
inline

◆ GetMeleeHitRedirectTarget()

Unit * WorldObject::GetMeleeHitRedirectTarget ( Unit *  victim,
SpellInfo const *  spellInfo 
)
4051{
4052 // non-Unit casters cannot have their spells redirected
4053 if (Unit* unitSelf = ToUnit())
4054 return unitSelf->GetMeleeHitRedirectTarget(victim, spellInfo);
4055
4056 return victim;
4057}

References Unit::GetMeleeHitRedirectTarget(), and Object::ToUnit().

Referenced by Spell::SelectExplicitTargets().

◆ GetMinHeightInWater()

float WorldObject::GetMinHeightInWater ( ) const

Get the minimum height of a object that should be in water to start floating/swim.

Returns
float
1609{
1610 // have a fun with Archimedes' formula
1611 auto height = GetCollisionHeight();
1612 auto width = GetCollisionWidth();
1613 auto weight = getWeight(height, width, 1040); // avg human specific weight
1614 auto heightOutOfWater = getOutOfWater(width, weight, 10202) * 4.0f; // avg human density
1615 auto heightInWater = height - heightOutOfWater;
1616 return (height > heightInWater ? heightInWater : (height - (height / 3)));
1617}
float getWeight(float height, float width, float specificWeight)
Definition Physics.h:31
float getOutOfWater(float width, float weight, float density)
Get the height immersed in water.
Definition Physics.h:46
virtual float GetCollisionWidth() const
Definition Object.h:729

References GetCollisionHeight(), GetCollisionWidth(), getOutOfWater(), and getWeight().

Referenced by Map::HasEnoughWater(), and UpdateAllowedPositionZ().

◆ GetName()

std::string const & WorldObject::GetName ( ) const
inline
535{ return m_name; }

References m_name.

Referenced by Player::_LoadActions(), Player::_LoadHomeBind(), Player::_LoadInventory(), Player::_LoadItem(), Player::_LoadMailedItem(), Player::_LoadQuestStatus(), Player::_LoadSkills(), Player::_SaveCharacter(), Player::_SaveInventory(), Guild::_SendBankList(), Group::AddLeaderInvite(), Guild::AddMember(), ArenaTeam::AddMember(), Group::AddMember(), Vehicle::AddPassenger(), Battleground::AddPlayer(), InstanceMap::AddPlayerToMap(), Player::ApplyBaseModPctValue(), Group::BroadcastGroupUpdate(), WorldSession::BuildPartyMemberStatsChangedPacket(), Player::BuildPlayerRepop(), Player::BuyItemFromVendorSlot(), Player::CanBankItem(), InstanceMap::CannotEnter(), WorldSession::CanOpenMailBox(), Player::CastItemCombatSpell(), Group::ChangeLeader(), Player::CheckAreaExploreAndOutdoor(), Player::CheckSkillLearnedBySpell(), Corpse::Create(), Group::Create(), Guild::Create(), TransportMgr::CreateTransport(), FlightPathMovementGenerator::DoEventIfAny(), WaypointMovementGenerator< Creature >::DoInitialize(), Player::DuelComplete(), Spell::EffectEnchantItemPerm(), Spell::EffectEnchantItemPrismatic(), Spell::EffectEnchantItemTmp(), Player::EnvironmentalDamage(), ChatHandler::extractPlayerTarget(), Pet::FillPetInfo(), GetDebugInfo(), Unit::GetFactionTemplateEntry(), Player::GetGameObjectIfCanInteractWith(), Creature::GetNameForLocaleIdx(), GameObject::GetNameForLocaleIdx(), ChatHandler::GetNameLink(), WorldSession::GetPlayerInfo(), GetPlayerInfo(), Player::GetPlayerName(), WorldSession::GetPlayerName(), ReputationMgr::GetReputation(), Creature::GetSummonerGUID(), GmTicket::GmTicket(), WorldSession::HandleAcceptTradeOpcode(), account_commandscript::HandleAccountCreateCommand(), spell_rog_deadly_poison::HandleAfterHit(), WorldSession::HandleAreaTriggerOpcode(), WorldSession::HandleArenaTeamAcceptOpcode(), WorldSession::HandleArenaTeamInviteOpcode(), WorldSession::HandleArenaTeamLeaderOpcode(), WorldSession::HandleArenaTeamLeaveOpcode(), WorldSession::HandleArenaTeamRemoveOpcode(), WorldSession::HandleAuctionPlaceBid(), WorldSession::HandleAuctionRemoveItem(), WorldSession::HandleAuctionSellItem(), Player::HandleBaseModFlatValue(), WorldSession::HandleBattlefieldListOpcode(), WorldSession::HandleBattleFieldPortOpcode(), WorldSession::HandleBattlemasterJoinArena(), debug_commandscript::HandleDebugCombatListCommand(), debug_commandscript::HandleDebugGetLootRecipientCommand(), debug_commandscript::HandleDebugHostileRefListCommand(), debug_commandscript::HandleDebugLoSCommand(), debug_commandscript::HandleDebugSendOpcodeCommand(), debug_commandscript::HandleDebugThreatInfoCommand(), debug_commandscript::HandleDebugThreatListCommand(), deserter_commandscript::HandleDeserterAdd(), WorldSession::HandleDuelAcceptedOpcode(), WorldSession::HandleFarSightOpcode(), WorldSession::HandleForceSpeedChangeAck(), ticket_commandscript::HandleGMTicketCloseByIdCommand(), ticket_commandscript::HandleGMTicketCommentCommand(), ticket_commandscript::HandleGMTicketCompleteCommand(), ticket_commandscript::HandleGMTicketDeleteByIdCommand(), ticket_commandscript::HandleGMTicketResponseDeleteCommand(), ticket_commandscript::HandleGMTicketUnAssignCommand(), WorldSession::HandleGrantLevel(), WorldSession::HandleGroupDeclineOpcode(), WorldSession::HandleGroupInviteOpcode(), group_commandscript::HandleGroupJoinCommand(), WorldSession::HandleInstanceLockResponse(), inventory_commandscript::HandleInventoryCountCommand(), Guild::HandleInviteMember(), Guild::HandleLeaveMember(), lookup_commandscript::HandleLookupTitleCommand(), WorldSession::HandleLootMasterGiveOpcode(), WorldSession::HandleMailTakeItem(), WorldSession::HandleMailTakeMoney(), Guild::HandleMemberDepositMoney(), Guild::HandleMemberLogout(), Guild::HandleMemberWithdrawMoney(), WorldSession::HandleMessagechatOpcode(), mmaps_commandscript::HandleMmapPathCommand(), misc_commandscript::HandleMovegensCommand(), npc_commandscript::HandleNpcDoActionCommand(), npc_commandscript::HandleNpcFollowCommand(), npc_commandscript::HandleNpcSetDataCommand(), npc_commandscript::HandleNpcShowLootCommand(), npc_commandscript::HandleNpcUnFollowCommand(), WorldSession::HandleOfferPetitionOpcode(), WorldSession::HandleOpenItemOpcode(), misc_commandscript::HandlePacketLog(), WorldSession::HandlePetitionBuyOpcode(), WorldSession::HandlePetitionSignOpcode(), OutdoorPvP::HandlePlayerLeaveZone(), WorldSession::HandlePlayerLoginFromDB(), pool_commandscript::HandlePoolLookupCommand(), WorldSession::HandleQuestgiverChooseRewardOpcode(), WorldSession::HandleQuestgiverCompleteQuest(), Guild::HandleRemoveMember(), WorldSession::HandleReportPvPAFK(), WorldSession::HandleRequestPartyMemberStatsOpcode(), ArenaSpectator::HandleResetCommand(), spell_the_flag_of_ownership::HandleScript(), WorldSession::HandleSendMail(), WorldSession::HandleSetActionButtonOpcode(), Guild::HandleSetLeader(), misc_commandscript::HandleSkirmishCommand(), misc_commandscript::HandleSummonCommand(), titles_commandscript::HandleTitlesAddCommand(), titles_commandscript::HandleTitlesCurrentCommand(), titles_commandscript::HandleTitlesRemoveCommand(), WorldSession::HandleTurnInPetitionOpcode(), Guild::HandleUpdateMemberRank(), npc_pet_gen_imp_in_a_bottle::InitializeAI(), PlayerNameMapHolder::Insert(), Channel::Invite(), BattlegroundQueue::InviteGroupToBG(), Player::IsActionButtonDataValid(), ReputationMgr::IsAtWar(), WorldSession::KickPlayer(), Player::LearnCustomSpells(), Player::LoadFromDB(), LogCommandUsage(), WorldSession::LogoutPlayer(), MotionMaster::MovePath(), MotionMaster::MoveTaxiFlight(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnCreatureCreate(), ChatLogScript::OnPlayerCanUseChat(), ChatLogScript::OnPlayerCanUseChat(), ChatLogScript::OnPlayerCanUseChat(), ChatLogScript::OnPlayerCanUseChat(), ChatLogScript::OnPlayerCanUseChat(), lfg::LFGPlayerScript::OnPlayerMapChanged(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnUnitDeath(), Unit::OutDebugInfo(), MapMgr::PlayerCannotEnter(), Player::PrepareGossipMenu(), SmartScript::ProcessAction(), PlayerNameMapHolder::Remove(), Map::RemoveAllPlayers(), Player::RemoveFromWorld(), Vehicle::RemovePassenger(), Creature::Respawn(), Pet::SavePetToDB(), AchievementMgr::SendAchievementEarned(), AuctionHouseMgr::SendAuctionExpiredMail(), AuctionHouseMgr::SendAuctionSuccessfulMail(), AuctionHouseMgr::SendAuctionWonMail(), CreatureTextMgr::SendChat(), Guild::SendLoginInfo(), Spell::SendLoot(), WorldSession::SendPetNameQuery(), BattlegroundMgr::SendToBattleground(), Unit::SetCharm(), Player::SetClientControl(), Player::setDeathState(), Player::SetEquipmentSet(), Channel::SetMode(), Guild::Member::SetStats(), Creature::SetTextRepeatId(), Player::SetViewpoint(), npc_chesspiece::sGossipHello(), FollowerAI::StartFollow(), Player::StopCastingCharm(), lfg::LFGMgr::TeleportPlayer(), Player::TeleportTo(), Channel::UnBan(), Pet::Update(), Player::Update(), boss_archavon::boss_archavonAI::UpdateAI(), Player::UpdateHomebindTime(), GameObject::Use(), and Player::Whisper().

◆ GetNameForLocaleIdx()

virtual std::string const & WorldObject::GetNameForLocaleIdx ( LocaleConstant  ) const
inlinevirtual

◆ GetNearPoint()

void WorldObject::GetNearPoint ( WorldObject const *  searcher,
float &  x,
float &  y,
float &  z,
float  searcher_size,
float  distance2d,
float  absAngle,
float  controlZ = 0,
Position const *  startPos = nullptr 
) const
2753{
2754 GetNearPoint2D(x, y, distance2d + searcher_size, absAngle, startPos);
2755 z = GetPositionZ();
2756
2757 if (searcher)
2758 {
2759 if (Unit const* unit = searcher->ToUnit(); Unit const* target = ToUnit())
2760 {
2761 if (unit && target && unit->IsInWater() && target->IsInWater())
2762 {
2763 // if the searcher is in water
2764 // we have no ground so we can
2765 // set the target height to the
2766 // z-coord to keep the searcher
2767 // at the correct height (face to face)
2768 z += GetCollisionHeight() - unit->GetCollisionHeight();
2769 }
2770 }
2771 searcher->UpdateAllowedPositionZ(x, y, z);
2772 }
2773 else
2774 {
2775 UpdateAllowedPositionZ(x, y, z);
2776 }
2777
2778 // if detection disabled, return first point
2779 if (!sWorld->getBoolConfig(CONFIG_DETECT_POS_COLLISION))
2780 return;
2781
2782 // return if the point is already in LoS
2783 if (!controlZ && IsWithinLOS(x, y, z))
2784 return;
2785
2786 // remember first point
2787 float first_x = x;
2788 float first_y = y;
2789 float first_z = z;
2790
2791 // loop in a circle to look for a point in LoS using small steps
2792 for (float angle = float(M_PI) / 8; angle < float(M_PI) * 2; angle += float(M_PI) / 8)
2793 {
2794 GetNearPoint2D(x, y, distance2d + searcher_size, absAngle + angle, startPos);
2795 z = GetPositionZ();
2796 UpdateAllowedPositionZ(x, y, z);
2797 if (controlZ && fabsf(GetPositionZ() - z) > controlZ)
2798 continue;
2799
2800 if (IsWithinLOS(x, y, z))
2801 return;
2802 }
2803
2804 // still not in LoS, give up and return first position found
2805 if (startPos)
2806 {
2807 x = searcher->GetPositionX();
2808 y = searcher->GetPositionY();
2809 z = searcher->GetPositionZ();
2810 }
2811 else
2812 {
2813 x = first_x;
2814 y = first_y;
2815 z = first_z;
2816 }
2817}
@ CONFIG_DETECT_POS_COLLISION
Definition WorldConfig.h:54
virtual bool IsInWater() const
Definition Unit.cpp:4286
void UpdateAllowedPositionZ(float x, float y, float &z, float *groundZ=nullptr) const
Definition Object.cpp:1619
void GetNearPoint2D(WorldObject const *searcher, float &x, float &y, float distance, float absAngle, Position const *startPos=nullptr) const
Definition Object.cpp:2715
#define sWorld
Definition World.h:318

References CONFIG_DETECT_POS_COLLISION, GetCollisionHeight(), GetNearPoint2D(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::IsInWater(), IsWithinLOS(), sWorld, Object::ToUnit(), and UpdateAllowedPositionZ().

Referenced by npc_maiev_illidan::DoAction(), ChaseMovementGenerator< T >::DoUpdate(), GetChargeContactPoint(), GetClosePoint(), GetContactPoint(), Unit::GetMeleeAttackPoint(), Unit::GetRandomContactPoint(), GetVoidClosePoint(), npc_hourglass_of_eternity::npc_hourglass_of_eternityAI::InitializeAI(), npc_akama_shade::JustSummoned(), npc_akama_illidan::MovementInform(), SmartScript::ProcessAction(), npc_pallid_horror::ScheduleTasks(), Spell::SelectImplicitCasterDestTargets(), boss_quartermaster_zigris::SpellHitTarget(), and npc_hourglass_of_eternity::npc_hourglass_of_eternityAI::UpdateAI().

◆ GetNearPoint2D() [1/2]

void WorldObject::GetNearPoint2D ( float &  x,
float &  y,
float  distance,
float  absAngle,
Position const *  startPos = nullptr 
) const
2748{
2749 GetNearPoint2D(nullptr, x, y, distance2d, absAngle, startPos);
2750}

References GetNearPoint2D().

◆ GetNearPoint2D() [2/2]

void WorldObject::GetNearPoint2D ( WorldObject const *  searcher,
float &  x,
float &  y,
float  distance,
float  absAngle,
Position const *  startPos = nullptr 
) const
2716{
2717 float effectiveReach = GetCombatReach();
2718
2719 if (searcher)
2720 {
2721 effectiveReach += searcher->GetCombatReach();
2722
2723 if (this != searcher)
2724 {
2725 float myHover = 0.0f, searcherHover = 0.0f;
2726 if (Unit const* unit = ToUnit())
2727 myHover = unit->GetHoverHeight();
2728 if (Unit const* searchUnit = searcher->ToUnit())
2729 searcherHover = searchUnit->GetHoverHeight();
2730
2731 float hoverDelta = myHover - searcherHover;
2732 if (hoverDelta != 0.0f)
2733 effectiveReach = std::sqrt(std::max(effectiveReach * effectiveReach - hoverDelta * hoverDelta, 0.0f));
2734 }
2735 }
2736
2737 float positionX = startPos ? startPos->GetPositionX() : GetPositionX();
2738 float positionY = startPos ? startPos->GetPositionY() : GetPositionY();
2739
2740 x = positionX + (effectiveReach + distance2d) * std::cos(absAngle);
2741 y = positionY + (effectiveReach + distance2d) * std::sin(absAngle);
2742
2745}
void NormalizeMapCoord(float &c)
Definition GridDefines.h:202

References GetCombatReach(), Position::GetPositionX(), Position::GetPositionY(), Acore::NormalizeMapCoord(), and Object::ToUnit().

Referenced by Spell::CheckCast(), GetNearPoint(), GetNearPoint2D(), and npc_frostbrood_skytalon::npc_frostbrood_skytalonAI::UpdateAI().

◆ GetNearPosition()

◆ GetNotifyFlags()

uint16 WorldObject::GetNotifyFlags ( ) const
inline
679{ return m_notifyflags; }

References m_notifyflags.

◆ GetObjectSize()

float WorldObject::GetObjectSize ( ) const
2898{
2900}
#define DEFAULT_WORLD_OBJECT_SIZE
Definition ObjectDefines.h:44
@ UNIT_FIELD_COMBATREACH
Definition UpdateFields.h:123
float GetObjectScale() const
Definition Object.h:126
uint16 m_valuesCount
Definition Object.h:273
float * m_floatValues
Definition Object.h:268

References DEFAULT_WORLD_OBJECT_SIZE, Object::GetObjectScale(), Object::m_floatValues, Object::m_valuesCount, and UNIT_FIELD_COMBATREACH.

Referenced by _IsWithinDist(), GameObject::_IsWithinDist(), Creature::CanCreatureAttack(), Spell::EffectSummonPet(), GetChargeContactPoint(), GetClosePoint(), GetCollisionRadius(), GetCollisionWidth(), Unit::GetCollisionWidth(), GetContactPoint(), GetDistance(), GetDistance(), GetDistance(), GetDistance2d(), GetDistance2d(), GetDistanceZ(), Unit::GetMeleeAttackPoint(), GetVelocity(), misc_commandscript::HandleGroupSummonCommand(), spell_marrowgar_coldflame::HandleScriptEffect(), IsInBetween(), IsInRange(), IsInRange2d(), IsInRange3d(), IsWithinDist2d(), IsWithinDist2d(), IsWithinDist3d(), IsWithinDist3d(), IsWithinSightRange(), MotionMaster::MoveJumpTo(), Acore::WorldObjectSpellConeTargetCheck::operator()(), npc_released_offspring_harkoa::npc_released_offspring_harkoaAI::Reset(), npc_dragonmaw_peon::npc_dragonmaw_peonAI::SpellHit(), SummonCreature(), npc_acherus_necromancer::UpdateAI(), npc_gothik_the_harvester::UpdateAI(), npc_valkyr_battle_maiden::UpdateAI(), and npc_muradin_bronzebeard_icc::npc_muradin_bronzebeard_iccAI::UpdateAI().

◆ GetObjectVisibilityContainer() [1/2]

◆ GetObjectVisibilityContainer() [2/2]

ObjectVisibilityContainer const & WorldObject::GetObjectVisibilityContainer ( ) const
inline

◆ GetOwnerGUID()

virtual ObjectGuid WorldObject::GetOwnerGUID ( ) const
inlinevirtual

Reimplemented in Corpse, DynamicObject, GameObject, and Unit.

760{ return ObjectGuid::Empty; }
static ObjectGuid const Empty
Definition ObjectGuid.h:123

References ObjectGuid::Empty.

Referenced by GetCharmerOrOwnerGUID(), and GetOwnerUnit().

◆ GetOwnerUnit()

Unit * WorldObject::GetOwnerUnit ( ) const
3310{
3311 return ObjectAccessor::GetUnit(*this, GetOwnerGUID());
3312}
Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:223

References GetOwnerGUID(), and ObjectAccessor::GetUnit().

Referenced by GetCharmerOrOwnerUnit().

◆ GetPhaseMask()

uint32 WorldObject::GetPhaseMask ( ) const
inline
523{ return m_phaseMask; }

References m_phaseMask.

Referenced by Unit::_ExitVehicle(), RandomMovementGenerator< T >::_setRandomLocation(), AddToWorld(), PathGenerator::BuildPolyPath(), Map::CheckCollisionAndGetValidCoords(), boss_volazj::CheckPhaseMinions(), BattlegroundRV::CheckPositionForUnit(), Map::ConvertCorpseToBones(), Creature::Create(), Corpse::Create(), Pet::CreateBaseAtCreature(), Pet::CreateBaseAtCreatureInfo(), DynamicObject::CreateDynamicObject(), Spell::EffectDuel(), Spell::EffectSummonObject(), Spell::EffectSummonObjectWild(), Spell::EffectTransmitted(), GameObject::EnableCollision(), GetFloorZ(), GetMapHeight(), GetMapWaterOrGroundLevel(), PathGenerator::GetNavTerrain(), GameObjectModelOwnerImpl::GetPhaseMask(), Player::GetPhaseMaskForSpawn(), debug_commandscript::HandleDebugSpawnVehicleCommand(), OutdoorPvPSI::HandleDropFlag(), gobject_commandscript::HandleGameObjectInfoCommand(), gobject_commandscript::HandleGameObjectNearCommand(), misc_commandscript::HandleGPSCommand(), npc_commandscript::HandleNpcInfoCommandShowCreature(), npc_commandscript::HandleNpcNearCommand(), misc_commandscript::HandlePInfoCommand(), Map::HasEnoughWater(), InSamePhase(), InSamePhase(), IsInsideWMOGroups(), PathGenerator::IsSwimmableSegment(), IsWithinLOS(), IsWithinLOSInMap(), npc_the_lich_king_controller::npc_the_lich_king_controllerAI::JustSummoned(), spell_svalna_revive_champion::Land(), Creature::LoadCreatureFromDB(), Pet::LoadPetFromDB(), instance_old_hillsbrad::instance_old_hillsbrad_InstanceMapScript::OnGameObjectCreate(), at_q24545_frostmourne_cavern::OnTrigger(), WorldSession::ProcessMovementInfo(), Corpse::SaveToDB(), Creature::SaveToDB(), Creature::SaveToDB(), GameObject::SaveToDB(), Spell::SelectImplicitCasterDestTargets(), Creature::setDeathState(), spell_blood_council_summon_shadow_resonance::SetDest(), spell_spawn_blood_pool::SetDest(), Unit::SetHover(), Unit::SetPhaseMask(), PathGenerator::ShortenPathUntilDist(), boss_yoggsaron_sara::SpawnTentacle(), Map::SummonCreature(), SummonGameObject(), Player::SummonPet(), SummonTrigger(), Creature::Update(), boss_yoggsaron_death_ray::UpdateAI(), and UpdatePositionData().

◆ GetRandomNearPosition()

Position WorldObject::GetRandomNearPosition ( float  radius)
2862{
2863 Position pos = GetPosition();
2864 MovePosition(pos, radius * (float) rand_norm(), (float) rand_norm() * static_cast<float>(2 * M_PI));
2865 return pos;
2866}
double rand_norm()
Definition Random.cpp:85

References Position::GetPosition(), MovePosition(), and rand_norm().

Referenced by CreatureAI::DoSummon(), CreatureAI::DoSummonFlyer(), npc_cyclone::JustEngagedWith(), npc_enslaved_netherwing_drake::SpellHit(), and npc_minigob_manabonk::UpdateAI().

◆ GetRandomPoint() [1/2]

Position WorldObject::GetRandomPoint ( Position const &  srcPos,
float  distance 
) const
1589{
1590 float x, y, z;
1591 GetRandomPoint(srcPos, distance, x, y, z);
1592 return Position(x, y, z, GetOrientation());
1593}
void GetRandomPoint(Position const &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const
Definition Object.cpp:1567

References Position::GetOrientation(), and GetRandomPoint().

◆ GetRandomPoint() [2/2]

void WorldObject::GetRandomPoint ( Position const &  srcPos,
float  distance,
float &  rand_x,
float &  rand_y,
float &  rand_z 
) const
1568{
1569 if (!distance)
1570 {
1571 pos.GetPosition(rand_x, rand_y, rand_z);
1572 return;
1573 }
1574
1575 // angle to face `obj` to `this`
1576 float angle = (float)rand_norm() * static_cast<float>(2 * M_PI);
1577 float new_dist = (float)rand_norm() * static_cast<float>(distance);
1578
1579 rand_x = pos.m_positionX + new_dist * cos(angle);
1580 rand_y = pos.m_positionY + new_dist * std::sin(angle);
1581 rand_z = pos.m_positionZ;
1582
1585 UpdateGroundPositionZ(rand_x, rand_y, rand_z); // update to LOS height if available
1586}
void UpdateGroundPositionZ(float x, float y, float &z) const
Definition Object.cpp:1595

References Position::GetPosition(), Position::m_positionX, Position::m_positionY, Position::m_positionZ, Acore::NormalizeMapCoord(), rand_norm(), and UpdateGroundPositionZ().

Referenced by boss_isalien::DamageTaken(), instance_stratholme::instance_stratholme_InstanceMapScript::DoSpawnPlaguedCritters(), Spell::EffectSummonType(), OrcMoveEvent::Execute(), GetRandomPoint(), SmartScript::ProcessAction(), Spell::SummonGuardian(), and boss_fankriss::SummonHatchlingWaves().

◆ GetReactionTo()

ReputationRank WorldObject::GetReactionTo ( WorldObject const *  target) const
3887{
3888 // always friendly to self
3889 if (this == target)
3890 return REP_FRIENDLY;
3891
3892 // when both sides are units use the Unit reaction logic (duel, FFA, group, ...)
3893 if (Unit const* unitSelf = ToUnit())
3894 if (Unit const* unitTarget = target->ToUnit())
3895 return unitSelf->GetReactionTo(unitTarget);
3896
3897 // always friendly to charmer or owner
3898 if (Unit* selfOwner = GetCharmerOrOwnerOrSelfUnit())
3899 if (selfOwner == target->GetCharmerOrOwnerOrSelfUnit())
3900 return REP_FRIENDLY;
3901
3902 // check forced reputation to support SPELL_AURA_FORCE_REACTION
3903 if (Player const* selfPlayerOwner = GetAffectingPlayer())
3904 {
3905 if (FactionTemplateEntry const* targetFactionTemplateEntry = target->GetFactionTemplateEntry())
3906 if (ReputationRank const* repRank = selfPlayerOwner->GetReputationMgr().GetForcedRankIfAny(targetFactionTemplateEntry))
3907 return *repRank;
3908 }
3909 else if (Player const* targetPlayerOwner = target->GetAffectingPlayer())
3910 {
3911 if (FactionTemplateEntry const* selfFactionTemplateEntry = GetFactionTemplateEntry())
3912 if (ReputationRank const* repRank = targetPlayerOwner->GetReputationMgr().GetForcedRankIfAny(selfFactionTemplateEntry))
3913 return *repRank;
3914 }
3915
3916 // do checks dependant only on our faction
3918}
static ReputationRank GetFactionReactionTo(FactionTemplateEntry const *factionTemplateEntry, WorldObject const *target)
Definition Object.cpp:3920
Unit * GetCharmerOrOwnerOrSelfUnit() const
Definition Object.cpp:3323
Player * GetAffectingPlayer() const
Definition Object.cpp:3340
FactionTemplateEntry const * GetFactionTemplateEntry() const
Definition Object.cpp:3871

References GetAffectingPlayer(), GetCharmerOrOwnerOrSelfUnit(), GetFactionReactionTo(), GetFactionTemplateEntry(), REP_FRIENDLY, and Object::ToUnit().

Referenced by IsFriendlyTo(), and IsHostileTo().

◆ GetSightRange()

float WorldObject::GetSightRange ( WorldObject const *  target = nullptr) const
virtual

Reimplemented in Player.

1728{
1729 if (ToUnit())
1730 {
1731 if (ToPlayer())
1732 {
1733 if (target)
1734 {
1735 if (target->IsCreature() && target->IsVisibilityOverridden())
1736 return target->GetVisibilityOverrideDistance();
1737 else if (target->IsGameObject())
1738 {
1739 if (IsInWintergrasp() && target->IsInWintergrasp())
1741 else if (target->IsVisibilityOverridden())
1742 return target->GetVisibilityOverrideDistance();
1743 else if (ToPlayer()->GetCinematicMgr().IsOnCinematic())
1745 else
1746 return GetMap()->GetVisibilityRange();
1747 }
1748
1749 return IsInWintergrasp() && target->IsInWintergrasp() ? VISIBILITY_DIST_WINTERGRASP : GetMap()->GetVisibilityRange();
1750 }
1752 }
1753 else if (ToCreature())
1754 return ToCreature()->m_SightDistance;
1755 else
1756 return SIGHT_RANGE_UNIT;
1757 }
1758
1759 if (ToDynObject() && isActiveObject())
1760 return GetMap()->GetVisibilityRange();
1761
1762 return 0.0f;
1763}
#define SIGHT_RANGE_UNIT
Definition ObjectDefines.h:31
DynamicObject * ToDynObject()
Definition Object.h:228

References DEFAULT_VISIBILITY_INSTANCE, GetMap(), GetVisibilityOverrideDistance(), Map::GetVisibilityRange(), isActiveObject(), Object::IsCreature(), Object::IsGameObject(), IsInWintergrasp(), IsVisibilityOverridden(), Creature::m_SightDistance, SIGHT_RANGE_UNIT, Object::ToCreature(), Object::ToDynObject(), Object::ToPlayer(), Object::ToUnit(), and VISIBILITY_DIST_WINTERGRASP.

Referenced by CanSeeOrDetect(), and Player::GetSightRange().

◆ GetSpellMaxRangeForTarget()

float WorldObject::GetSpellMaxRangeForTarget ( Unit const *  target,
SpellInfo const *  spellInfo 
) const
3968{
3969 if (!spellInfo->RangeEntry)
3970 return 0;
3971
3972 if (spellInfo->RangeEntry->RangeMax[1] == spellInfo->RangeEntry->RangeMax[0])
3973 return spellInfo->GetMaxRange();
3974
3975 if (!target)
3976 return spellInfo->GetMaxRange(true);
3977
3978 return spellInfo->GetMaxRange(!IsHostileTo(target));
3979}
bool IsHostileTo(WorldObject const *target) const
Definition Object.cpp:3992

References SpellInfo::GetMaxRange(), IsHostileTo(), SpellInfo::RangeEntry, and SpellRangeEntry::RangeMax.

Referenced by Spell::CheckRange().

◆ GetSpellMinRangeForTarget()

float WorldObject::GetSpellMinRangeForTarget ( Unit const *  target,
SpellInfo const *  spellInfo 
) const
3982{
3983 if (!spellInfo->RangeEntry)
3984 return 0;
3985
3986 if (spellInfo->RangeEntry->RangeMin[1] == spellInfo->RangeEntry->RangeMin[0])
3987 return spellInfo->GetMinRange();
3988
3989 return spellInfo->GetMinRange(!IsHostileTo(target));
3990}

References SpellInfo::GetMinRange(), IsHostileTo(), SpellInfo::RangeEntry, and SpellRangeEntry::RangeMin.

Referenced by Spell::CheckRange().

◆ GetSpellModOwner()

Player * WorldObject::GetSpellModOwner ( ) const
virtual

Reimplemented in Unit.

3352{
3353 if (Player* player = const_cast<WorldObject*>(this)->ToPlayer())
3354 return player;
3355
3356 if (Creature const* creature = ToCreature())
3357 {
3358 if (creature->IsPet() || creature->IsTotem())
3359 if (Unit* owner = creature->GetOwner())
3360 return owner->ToPlayer();
3361 }
3362 else if (GameObject const* go = ToGameObject())
3363 {
3364 if (Unit* owner = go->GetOwner())
3365 return owner->ToPlayer();
3366 }
3367
3368 return nullptr;
3369}
Unit * GetOwner() const
Definition Unit.cpp:7487

References Unit::GetOwner(), Object::ToCreature(), Object::ToGameObject(), and Object::ToPlayer().

Referenced by Spell::_cast(), SpellEffectInfo::CalcDamageMultiplier(), SpellEffectInfo::CalcRadius(), SpellEffectInfo::CalcValueMultiplier(), Spell::cancel(), Spell::cast(), Spell::CheckRange(), Spell::finish(), SpellInfo::GetMaxRange(), Spell::handle_delayed(), Spell::handle_immediate(), MagicSpellHitResult(), ModSpellCastTime(), Spell::SelectImplicitChainTargets(), Spell::UpdateChanneledTargetList(), and Spell::~Spell().

◆ GetStationaryO()

virtual float WorldObject::GetStationaryO ( ) const
inlinevirtual

Reimplemented in GameObject.

716{ return GetOrientation(); }

References Position::GetOrientation().

◆ GetStationaryX()

virtual float WorldObject::GetStationaryX ( ) const
inlinevirtual

Reimplemented in GameObject.

713{ return GetPositionX(); }

References Position::GetPositionX().

◆ GetStationaryY()

virtual float WorldObject::GetStationaryY ( ) const
inlinevirtual

Reimplemented in GameObject.

714{ return GetPositionY(); }

References Position::GetPositionY().

◆ GetStationaryZ()

virtual float WorldObject::GetStationaryZ ( ) const
inlinevirtual

Reimplemented in GameObject.

715{ return GetPositionZ(); }

References Position::GetPositionZ().

◆ GetTransGUID()

ObjectGuid WorldObject::GetTransGUID ( ) const
virtual

◆ GetTransOffsetO()

◆ GetTransOffsetX()

◆ GetTransOffsetY()

◆ GetTransOffsetZ()

◆ GetTransport()

Transport * WorldObject::GetTransport ( ) const
inline
701{ return m_transport; }

References m_transport.

Referenced by _IsWithinDist(), Player::_SaveCharacter(), MotionTransport::AddPassenger(), StaticTransport::AddPassenger(), Unit::BuildMovementPacket(), Object::BuildMovementUpdate(), npc_high_overlord_saurfang_igb::npc_high_overlord_saurfang_igbAI::CanAIAttack(), npc_muradin_bronzebeard_igb::npc_muradin_bronzebeard_igbAI::CanAIAttack(), npc_igb_ship_crew::npc_igb_ship_crewAI::CanAIAttack(), npc_gunship_boarding_addAI::CanAIAttack(), npc_gunship_gunner::npc_gunship_gunnerAI::CanAIAttack(), DynamicObject::CleanupsBeforeDelete(), GameObject::CleanupsBeforeDelete(), Unit::CleanupsBeforeDelete(), npc_gunship::npc_gunshipAI::DamageTaken(), go_commandscript::DoTeleportToTransport(), DelayedMovementEvent::Execute(), ResetEncounterEvent::Execute(), npc_gunship::GetAI(), Unit::GetDirectTransport(), GameObject::GetFinalWorldRotation(), Creature::GetRespawnPosition(), GetTransGUID(), Unit::GetTransGUID(), misc_commandscript::HandleAppearCommand(), WorldSession::HandleForceSpeedChangeAck(), misc_commandscript::HandleGPSCommand(), WorldSession::HandleMoverRelocation(), WorldSession::HandleMoveWorldportAck(), npc_commandscript::HandleNpcAddCommand(), WorldSession::HandlePlayerLoginFromDB(), Unit::isInAccessiblePlaceFor(), npc_gunship::npc_gunshipAI::JustDied(), Player::KillPlayer(), npc_gunship_boarding_addAI::MovementInform(), npc_high_overlord_saurfang_igb::npc_high_overlord_saurfang_igbAI::npc_high_overlord_saurfang_igbAI(), npc_muradin_bronzebeard_igb::npc_muradin_bronzebeard_igbAI::npc_muradin_bronzebeard_igbAI(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnCreatureCreate(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnUnitDeath(), item_petrov_cluster_bombs::OnUse(), IgbExplosionCheck::operator()(), BurningPitchFilterCheck::operator()(), IgbArtilleryCheck::operator()(), Player::ProcessTerrainStatusUpdate(), spell_igb_teleport_to_enemy_ship::RelocateTransportOffset(), Creature::RemoveFromWorld(), DynamicObject::RemoveFromWorld(), GameObject::RemoveFromWorld(), Vehicle::RemovePassenger(), Creature::SaveToDB(), Creature::SaveToDB(), spell_igb_gunship_fall_teleport::SelectTransport(), Map::SendInitSelf(), Map::SendInitTransports(), Map::SendRemoveTransports(), Unit::SetCharmedBy(), gunship_npc_AI::SetData(), Movement::MoveSplineInit::SetFacing(), npc_high_overlord_saurfang_igb::npc_high_overlord_saurfang_igbAI::sGossipSelect(), npc_muradin_bronzebeard_igb::npc_muradin_bronzebeard_igbAI::sGossipSelect(), Map::SummonCreature(), Player::TeleportTo(), Creature::Update(), npc_high_overlord_saurfang_igb::npc_high_overlord_saurfang_igbAI::UpdateAI(), npc_muradin_bronzebeard_igb::npc_muradin_bronzebeard_igbAI::UpdateAI(), UpdateAllowedPositionZ(), and UpdateHomePosition().

◆ GetTransSeat()

◆ GetTransTime()

uint32 WorldObject::GetTransTime ( ) const
inline

◆ GetVisibilityOverrideDistance()

float WorldObject::GetVisibilityOverrideDistance ( ) const
1112{
1115}
constexpr float VisibilityDistances[AsUnderlyingType(VisibilityDistanceType::Max)]
Definition Object.cpp:66
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
Definition Util.h:610

References _visibilityDistanceOverrideType, ASSERT, AsUnderlyingType(), Max, and VisibilityDistances.

Referenced by GetSightRange(), and GetVisibilityRange().

◆ GetVisibilityOverrideType()

VisibilityDistanceType WorldObject::GetVisibilityOverrideType ( ) const
inline

◆ GetVisibilityRange()

◆ GetVoidClosePoint()

void WorldObject::GetVoidClosePoint ( float &  x,
float &  y,
float &  z,
float  size,
float  distance2d = 0,
float  relAngle = 0,
float  controlZ = 0 
) const
2820{
2821 // angle calculated from current orientation
2822 GetNearPoint(nullptr, x, y, z, size, distance2d, GetOrientation() + relAngle, controlZ);
2823}

References GetNearPoint(), and Position::GetOrientation().

◆ GetZoneAndAreaId()

◆ GetZoneId()

uint32 WorldObject::GetZoneId ( ) const
3172{
3174 const_cast<WorldObject*>(this)->UpdatePositionData();
3175
3176 return _zoneId;
3177}

References _updatePositionData, _zoneId, and UpdatePositionData().

Referenced by Player::_LoadInventory(), Player::_SaveCharacter(), Player::AddQuest(), Vehicle::ApplyAllImmunities(), Map::ApplyDynamicModeRespawnScaling(), WorldSession::BuildPartyMemberStatsChangedPacket(), npc_herald_of_the_lich_king::ChangeZoneEventStatus(), Spell::CheckCast(), spell_gen_weapon_coating_enchant::CheckProc(), Player::CompleteQuest(), ScriptedAI::DoPlayMusic(), Spell::EffectSummonPlayer(), Spell::EffectSummonRaFFriend(), Acore::XP::Gain(), SocialMgr::GetFriendInfo(), Player::GetOutdoorPvP(), Player::GiveXP(), go_bells::go_bellsAI::go_bellsAI(), WorldSession::HandleAreaSpiritHealerQueryOpcode(), WorldSession::HandleAreaSpiritHealerQueueOpcode(), WorldSession::HandleBfEntryInviteResponse(), misc_commandscript::HandleChangeWeather(), debug_commandscript::HandleDebugVisibilityDataCommand(), debug_commandscript::HandleDebugZoneStatsCommand(), spell_midsummer_summon_ahune_lieutenant::HandleDummy(), go_commandscript::HandleGoZoneXYCommand(), WorldSession::HandleHearthAndResurrect(), misc_commandscript::HandleLinkGraveCommand(), WorldSession::HandleMoveTeleportAck(), misc_commandscript::HandleNearGraveCommand(), spell_wintergrasp_hide_small_elementals_aura::HandlePeriodicDummy(), WorldSession::HandlePlayerLoginFromDB(), WorldSession::HandleRequestPartyMemberStatsOpcode(), misc_commandscript::HandleSummonCommand(), Player::InBattlefield(), Player::IncompleteQuest(), go_firework_show::InitShow(), SpellArea::IsFitToRequirements(), Player::IsWorldObjectOutOfSightRange(), boss_azuregos::boss_azuregosAI::JustDied(), npc_necropolis_health::JustDied(), npc_pallid_horror::JustDied(), Battlefield::KickAfkPlayers(), Unit::Kill(), Player::KilledPlayerCredit(), LogCommandUsage(), WorldSession::LogoutPlayer(), npc_mageguard_dalaran::npc_mageguard_dalaranAI::MoveInLineOfSight(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnPlayerAreaUpdate(), item_only_for_flight::OnUse(), item_petrov_cluster_bombs::OnUse(), spell_fire_festival_fortitude::PrepareSpellScript(), SmartScript::ProcessAction(), Player::RemoveActiveQuest(), Player::RemovedInsignia(), Map::RemovePlayerFromMap(), Player::RepopAtGraveyard(), boss_azuregos::boss_azuregosAI::Reset(), Player::RewardQuest(), npc_minigob_manabonk::SelectTargetInDalaran(), CreatureTextMgr::SendChatPacket(), CreatureTextMgr::SendNonChatPacket(), Acore::VisibleNotifier::SendToSelf(), Map::SendZoneMessage(), Guild::Member::SetStats(), boss_akilzon::SetWeather(), SetZoneScript(), npc_midsummer_bonfire::UpdateBonfireBlessingBuffs(), npc_herald_of_the_lich_king::UpdateWeather(), and npc_pallid_horror::UpdateWeather().

◆ GetZoneScript()

◆ HasAllowedLooter()

bool WorldObject::HasAllowedLooter ( ObjectGuid  guid) const
3228{
3229 if (_allowedLooters.empty())
3230 {
3231 return true;
3232 }
3233
3234 return _allowedLooters.find(guid) != _allowedLooters.end();
3235}

References _allowedLooters.

Referenced by Group::GroupLoot(), Player::IsAtLootRewardDistance(), GameObject::IsLootAllowedFor(), Group::MasterLoot(), and Group::NeedBeforeGreed().

◆ InSamePhase() [1/2]

bool WorldObject::InSamePhase ( uint32  phasemask) const
inline
525{ return m_useCombinedPhases ? GetPhaseMask() & phasemask : GetPhaseMask() == phasemask; }

References GetPhaseMask(), and m_useCombinedPhases.

◆ InSamePhase() [2/2]

◆ isActiveObject()

◆ IsAlwaysDetectableFor()

virtual bool WorldObject::IsAlwaysDetectableFor ( WorldObject const *  ) const
inlineprotectedvirtual

Reimplemented in Creature, Player, and Unit.

825{ return false; }

Referenced by CanDetect(), and Unit::IsAlwaysDetectableFor().

◆ IsAlwaysVisibleFor()

virtual bool WorldObject::IsAlwaysVisibleFor ( WorldObject const *  ) const
inlineprotectedvirtual

Reimplemented in GameObject, and Unit.

822{ return false; }

Referenced by CanSeeOrDetect(), GameObject::IsAlwaysVisibleFor(), and Unit::IsAlwaysVisibleFor().

◆ IsFarVisible()

◆ IsFriendlyTo()

bool WorldObject::IsFriendlyTo ( WorldObject const *  target) const
3998{
3999 return GetReactionTo(target) >= REP_FRIENDLY;
4000}
ReputationRank GetReactionTo(WorldObject const *target) const
Definition Object.cpp:3886

References GetReactionTo(), and REP_FRIENDLY.

Referenced by Spell::DoSpellHitOnUnit(), IsValidAssistTarget(), Acore::WorldObjectSpellTargetCheck::operator()(), and Spell::SelectExplicitTargets().

◆ IsHostileTo()

bool WorldObject::IsHostileTo ( WorldObject const *  target) const

◆ isInBack()

bool WorldObject::isInBack ( WorldObject const *  target,
float  arc = M_PI 
) const
1563{
1564 return !HasInArc(2 * M_PI - arc, target);
1565}

References Position::HasInArc().

Referenced by Acore::WorldObjectSpellConeTargetCheck::operator()().

◆ IsInBetween()

bool WorldObject::IsInBetween ( WorldObject const *  obj1,
WorldObject const *  obj2,
float  size = 0 
) const
1536{
1537 if (!obj1 || !obj2)
1538 return false;
1539
1540 if (!size)
1541 size = GetObjectSize() / 2;
1542
1543 float pdist = obj1->GetExactDist2dSq(obj2) + size / 2.0f;
1544 if (GetExactDist2dSq(obj1) >= pdist || GetExactDist2dSq(obj2) >= pdist)
1545 return false;
1546
1547 if (G3D::fuzzyEq(obj1->GetPositionX(), obj2->GetPositionX()))
1548 return GetPositionX() >= obj1->GetPositionX() - size && GetPositionX() <= obj1->GetPositionX() + size;
1549
1550 float A = (obj2->GetPositionY() - obj1->GetPositionY()) / (obj2->GetPositionX() - obj1->GetPositionX());
1551 float B = -1;
1552 float C = obj1->GetPositionY() - A * obj1->GetPositionX();
1553 float dist = std::fabs(A * GetPositionX() + B * GetPositionY() + C) / std::sqrt(A * A + B * B);
1554 return dist <= size;
1555}
float GetExactDist2dSq(const float x, const float y) const
Definition Position.h:161

References Position::GetExactDist2dSq(), GetObjectSize(), Position::GetPositionX(), and Position::GetPositionY().

Referenced by TwilightCutterSelector::operator()().

◆ isInFront()

◆ IsInMap()

◆ IsInRange()

bool WorldObject::IsInRange ( WorldObject const *  obj,
float  minRange,
float  maxRange,
bool  is3D = true 
) const
1470{
1471 float dx = GetPositionX() - obj->GetPositionX();
1472 float dy = GetPositionY() - obj->GetPositionY();
1473 float distsq = dx * dx + dy * dy;
1474 if (is3D)
1475 {
1476 float dz = GetPositionZ() - obj->GetPositionZ();
1477 distsq += dz * dz;
1478 }
1479
1480 float sizefactor = GetObjectSize() + obj->GetObjectSize();
1481
1482 // check only for real range
1483 if (minRange > 0.0f)
1484 {
1485 float mindist = minRange + sizefactor;
1486 if (distsq < mindist * mindist)
1487 return false;
1488 }
1489
1490 float maxdist = maxRange + sizefactor;
1491 return distsq < maxdist * maxdist;
1492}

References GetObjectSize(), Position::GetPositionX(), Position::GetPositionY(), and Position::GetPositionZ().

Referenced by SmartScript::GetTargets(), npc_anachronos_the_ancient::npc_anachronos_the_ancientAI::HandleAnimation(), RangeSelector::operator()(), SmartScript::ProcessEvent(), npc_varian_wrynn::npc_varian_wrynnAI::UpdateAI(), npc_thrall_bfu::npc_thrall_bfuAI::UpdateAI(), boss_grand_champion::boss_grand_championAI::UpdateAI(), and boss_gathios_the_shatterer::UpdateAI().

◆ IsInRange2d()

bool WorldObject::IsInRange2d ( float  x,
float  y,
float  minRange,
float  maxRange 
) const
1495{
1496 float dx = GetPositionX() - x;
1497 float dy = GetPositionY() - y;
1498 float distsq = dx * dx + dy * dy;
1499
1500 float sizefactor = GetObjectSize();
1501
1502 // check only for real range
1503 if (minRange > 0.0f)
1504 {
1505 float mindist = minRange + sizefactor;
1506 if (distsq < mindist * mindist)
1507 return false;
1508 }
1509
1510 float maxdist = maxRange + sizefactor;
1511 return distsq < maxdist * maxdist;
1512}

References GetObjectSize(), Position::GetPositionX(), and Position::GetPositionY().

◆ IsInRange3d()

bool WorldObject::IsInRange3d ( float  x,
float  y,
float  z,
float  minRange,
float  maxRange 
) const
1515{
1516 float dx = GetPositionX() - x;
1517 float dy = GetPositionY() - y;
1518 float dz = GetPositionZ() - z;
1519 float distsq = dx * dx + dy * dy + dz * dz;
1520
1521 float sizefactor = GetObjectSize();
1522
1523 // check only for real range
1524 if (minRange > 0.0f)
1525 {
1526 float mindist = minRange + sizefactor;
1527 if (distsq < mindist * mindist)
1528 return false;
1529 }
1530
1531 float maxdist = maxRange + sizefactor;
1532 return distsq < maxdist * maxdist;
1533}

References GetObjectSize(), Position::GetPositionX(), Position::GetPositionY(), and Position::GetPositionZ().

◆ IsInvisibleDueToDespawn()

virtual bool WorldObject::IsInvisibleDueToDespawn ( ) const
inlineprotectedvirtual

Reimplemented in Creature, and GameObject.

823{ return false; }

Referenced by CanSeeOrDetect(), Creature::IsInvisibleDueToDespawn(), and GameObject::IsInvisibleDueToDespawn().

◆ IsInWintergrasp()

bool WorldObject::IsInWintergrasp ( ) const
inline
694 {
695 return GetMapId() == MAP_NORTHREND && GetPositionX() > 3733.33331f && GetPositionX() < 5866.66663f && GetPositionY() > 1599.99999f && GetPositionY() < 4799.99997f;
696 }
@ MAP_NORTHREND
Definition AreaDefines.h:246

References WorldLocation::GetMapId(), Position::GetPositionX(), Position::GetPositionY(), and MAP_NORTHREND.

Referenced by GetGridActivationRange(), GetSightRange(), and GetVisibilityRange().

◆ isNeedNotify()

bool WorldObject::isNeedNotify ( uint16  f) const
inline

◆ IsNeverVisible()

virtual bool WorldObject::IsNeverVisible ( ) const
inlineprotectedvirtual

Reimplemented in GameObject, and Player.

821{ return !IsInWorld(); }

References Object::IsInWorld().

Referenced by CanNeverSee(), GameObject::IsNeverVisible(), and Player::IsNeverVisible().

◆ IsOutdoors()

bool WorldObject::IsOutdoors ( ) const

◆ IsPositionDataUpdatePending()

bool WorldObject::IsPositionDataUpdatePending ( ) const
inline
670{ return _updatePositionData; }

References _updatePositionData.

Referenced by Creature::Update().

◆ IsSelfOrInSameMap()

bool WorldObject::IsSelfOrInSameMap ( WorldObject const *  obj) const
1335{
1336 if (this == obj)
1337 {
1338 return true;
1339 }
1340
1341 return IsInMap(obj);
1342}
bool IsInMap(WorldObject const *obj) const
Definition Object.cpp:1344

References IsInMap().

Referenced by Aura::UpdateTargetMap().

◆ IsUpdateNeeded()

bool WorldObject::IsUpdateNeeded ( )
virtual

Reimplemented in Creature, DynamicObject, and GameObject.

3248{
3249 if (isActiveObject())
3250 return true;
3251
3252 return false;
3253}

References isActiveObject().

Referenced by Creature::IsUpdateNeeded(), DynamicObject::IsUpdateNeeded(), GameObject::IsUpdateNeeded(), and Map::UpdateNonPlayerObjects().

◆ IsValidAssistTarget()

bool WorldObject::IsValidAssistTarget ( WorldObject const *  target,
SpellInfo const *  bySpell = nullptr 
) const
4023{
4024 if (!target)
4025 return false;
4026
4027 if (target == this)
4028 return true;
4029
4030 Unit const* unitTarget = target->ToUnit();
4031
4032 if (Unit const* unitSelf = ToUnit())
4033 return unitTarget && unitSelf->_IsValidAssistTarget(unitTarget, bySpell);
4034
4035 if (Unit* owner = GetCharmerOrOwnerUnit())
4036 return unitTarget && owner->_IsValidAssistTarget(unitTarget, bySpell);
4037
4038 return unitTarget && IsFriendlyTo(unitTarget);
4039}
bool _IsValidAssistTarget(Unit const *target, SpellInfo const *bySpell) const
Definition Unit.cpp:10635
bool IsFriendlyTo(WorldObject const *target) const
Definition Object.cpp:3997

References Unit::_IsValidAssistTarget(), GetCharmerOrOwnerUnit(), IsFriendlyTo(), and Object::ToUnit().

Referenced by SpellInfo::CheckExplicitTarget(), and Acore::WorldObjectSpellTargetCheck::operator()().

◆ IsValidAttackTarget()

bool WorldObject::IsValidAttackTarget ( WorldObject const *  target,
SpellInfo const *  bySpell = nullptr 
) const
4003{
4004 if (!target || target == this)
4005 return false;
4006
4007 Unit const* unitTarget = target->ToUnit();
4008
4009 // a unit caster uses the Unit validation directly
4010 if (Unit const* unitSelf = ToUnit())
4011 return unitTarget && unitSelf->_IsValidAttackTarget(unitTarget, bySpell);
4012
4013 // non-Unit caster owned by a unit (trap, dynobj): validate as the owner,
4014 // passing ourselves so visibility resolves from this object
4015 if (Unit* owner = GetCharmerOrOwnerUnit())
4016 return unitTarget && owner->_IsValidAttackTarget(unitTarget, bySpell, this);
4017
4018 // ownerless world object: faction reaction decides
4019 return unitTarget && IsHostileTo(unitTarget);
4020}
bool _IsValidAttackTarget(Unit const *target, SpellInfo const *bySpell, WorldObject const *obj=nullptr) const
Definition Unit.cpp:10497

References Unit::_IsValidAttackTarget(), GetCharmerOrOwnerUnit(), IsHostileTo(), and Object::ToUnit().

Referenced by SpellInfo::CheckExplicitTarget(), Spell::DoSpellHitOnUnit(), and Acore::WorldObjectSpellTargetCheck::operator()().

◆ IsVisibilityOverridden()

◆ IsWithinDist()

bool WorldObject::IsWithinDist ( WorldObject const *  obj,
float  dist2compare,
bool  is3D = true,
bool  incOwnRadius = true,
bool  incTargetRadius = true 
) const

◆ IsWithinDist2d() [1/2]

◆ IsWithinDist2d() [2/2]

bool WorldObject::IsWithinDist2d ( Position const *  pos,
float  dist 
) const
1370{
1371 return IsInDist2d(pos, dist + GetObjectSize());
1372}

References GetObjectSize(), and Position::IsInDist2d().

◆ IsWithinDist3d() [1/2]

bool WorldObject::IsWithinDist3d ( float  x,
float  y,
float  z,
float  dist 
) const

◆ IsWithinDist3d() [2/2]

bool WorldObject::IsWithinDist3d ( Position const *  pos,
float  dist 
) const
1360{
1361 return IsInDist(pos, dist + GetObjectSize());
1362}

References GetObjectSize(), and Position::IsInDist().

◆ IsWithinDistInMap()

bool WorldObject::IsWithinDistInMap ( WorldObject const *  obj,
float  dist2compare,
bool  is3D = true,
bool  incOwnRadius = true,
bool  incTargetRadius = true 
) const
1387{
1388 return obj && IsInMap(obj) && InSamePhase(obj) && _IsWithinDist(obj, dist2compare, is3D, incOwnRadius, incTargetRadius);
1389}

References _IsWithinDist(), InSamePhase(), and IsInMap().

Referenced by npc_escortAI::AssistPlayerInCombatAgainst(), FollowerAI::AssistPlayerInCombatAgainst(), SmartAI::AssistPlayerInCombatAgainst(), Creature::CanStartAttack(), Player::CheckDuelDistance(), npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI::CheckEventFail(), npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI::CheckEventFail(), spell_sha_fire_nova::CheckFireTotem(), WorldSession::DoLootRelease(), CreatureAI::DoZoneInCombat(), CombatManager::EndCombatBeyondRange(), boss_halazzi::EnterPhase(), BattlegroundEY::EventPlayerClickedOnFlag(), BattlegroundWS::EventPlayerClickedOnFlag(), BattlegroundAB::EventPlayerClickedOnFlag(), FollowerAI::GetLeaderForFollower(), Player::GetNextRandomRaidMember(), Unit::GetNextRandomRaidMemberOrPet(), Player::GetNPCIfCanInteractWith(), WorldSession::HandleAcceptTradeOpcode(), Unit::HandleAuraRaidProcFromChargeWithValue(), WorldSession::HandleAutostoreLootItemOpcode(), WorldSession::HandleInitiateTradeOpcode(), WorldSession::HandleLootMoneyOpcode(), AuraEffect::HandleModPossessPet(), Unit::isInBackInMap(), Unit::isInFrontInMap(), npc_escortAI::IsPlayerOrGroupInRange(), boss_gothik::boss_gothikAI::JustSummoned(), boss_muru::MoveInLineOfSight(), npc_dkc1_gothik::MoveInLineOfSight(), boss_aeonus::MoveInLineOfSight(), boss_chrono_lord_deja::MoveInLineOfSight(), boss_temporus::MoveInLineOfSight(), npc_medivh_bm::MoveInLineOfSight(), npc_general_andorov::MoveInLineOfSight(), npc_ouro_spawner::MoveInLineOfSight(), npc_draenei_survivor::npc_draenei_survivorAI::MoveInLineOfSight(), npc_kerlonian::npc_kerlonianAI::MoveInLineOfSight(), npc_aged_dying_ancient_kodo::MoveInLineOfSight(), npc_custodian_of_time::npc_custodian_of_timeAI::MoveInLineOfSight(), npc_tooga::npc_toogaAI::MoveInLineOfSight(), npc_twiggy_flathead::npc_twiggy_flatheadAI::MoveInLineOfSight(), npc_ringo::npc_ringoAI::MoveInLineOfSight(), npc_hadronox_crusherPackAI::MoveInLineOfSight(), boss_gluth::boss_gluthAI::MoveInLineOfSight(), boss_loken::MoveInLineOfSight(), npc_khunok_the_behemoth::npc_khunok_the_behemothAI::MoveInLineOfSight(), npc_jenny::MoveInLineOfSight(), boss_exarch_maladaar::MoveInLineOfSight(), boss_nexusprince_shaffar::MoveInLineOfSight(), boss_warlord_kalithresh::MoveInLineOfSight(), npc_daranelle::npc_daranelleAI::MoveInLineOfSight(), npc_ancestral_wolf::npc_ancestral_wolfAI::MoveInLineOfSight(), npc_air_force_bots::npc_air_force_botsAI::MoveInLineOfSight(), boss_leotheras_the_blind::MoveToTargetIfOutOfRange(), Acore::AnyDeadUnitObjectInRangeCheck::operator()(), Acore::AnyDeadUnitObjectInRangeCheck::operator()(), Acore::CallOfHelpCreatureInRangeDo::operator()(), Acore::AnyAssistCreatureInRangeCheck::operator()(), Acore::NearestAssistCreatureInCreatureRangeCheck::operator()(), Acore::NearestGameObjectFishingHole::operator()(), Acore::NearestGameObjectCheck::operator()(), Acore::NearestGameObjectEntryInObjectRangeCheck::operator()(), Acore::NearestGameObjectTypeInObjectRangeCheck::operator()(), Acore::AnyDeadUnitObjectInRangeCheck::operator()(), Acore::AnyPlayerInObjectRangeCheck::operator()(), Acore::NearestPlayerInObjectRangeCheck::operator()(), Acore::AnyPlayerInObjectRangeCheck::operator()(), Acore::MostHPMissingInRange::operator()(), Acore::MostHPPercentMissingInRange::operator()(), Acore::FriendlyCCedInRange::operator()(), Acore::FriendlyMissingBuffInRange::operator()(), Acore::AnyUnfriendlyUnitInObjectRangeCheck::operator()(), Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck::operator()(), Acore::NearestAttackableNoTotemUnitInObjectRangeCheck::operator()(), Acore::AnyFriendlyUnitInObjectRangeCheck::operator()(), Acore::AnyFriendlyNotSelfUnitInObjectRangeCheck::operator()(), Acore::AnyGroupedUnitInObjectRangeCheck::operator()(), Acore::AnyUnitInObjectRangeCheck::operator()(), Acore::NearestAttackableUnitInObjectRangeCheck::operator()(), Acore::AnyAoETargetUnitInObjectRangeCheck::operator()(), Acore::AnyAttackableUnitExceptForOriginalCasterInObjectRangeCheck::operator()(), Acore::NearestHostileUnitCheck::operator()(), Acore::NearestHostileUnitInAttackDistanceCheck::operator()(), Acore::MostHPMissingGroupInRange::operator()(), Acore::AllDeadCreaturesInRange::operator()(), Acore::AnyUnfriendlyAttackableVisibleUnitInObjectRangeCheck::operator()(), SmartScript::ProcessEvent(), npc_lake_frog::npc_lake_frogAI::ReceiveEmote(), npc_dancing_flames::npc_dancing_flamesAI::ReceiveEmote(), Map::ScriptsProcess(), Player::SelectCharmedAIGroupTarget(), ScriptedAI::SelectSpell(), ScriptedAI::SelectTargetFromPlayerList(), Player::SendLoot(), npc_corrupted_totem::SetAura(), Pet::Update(), Creature::Update(), Player::Update(), TotemAI::UpdateAI(), npc_highlord_darion_mograine::UpdateAI(), boss_four_horsemen::boss_four_horsemenAI::UpdateAI(), npc_pet_hunter_snake_trap::UpdateAI(), FollowerAI::UpdateAI(), Spell::UpdateChanneledTargetList(), and SmartAI::UpdateFollow().

◆ IsWithinLOS()

bool WorldObject::IsWithinLOS ( float  x,
float  y,
float  z,
VMAP::ModelIgnoreFlags  ignoreFlags = VMAP::ModelIgnoreFlags::Nothing,
LineOfSightChecks  checks = LINEOFSIGHT_ALL_CHECKS 
) const

◆ IsWithinLOSInMap()

bool WorldObject::IsWithinLOSInMap ( WorldObject const *  obj,
VMAP::ModelIgnoreFlags  ignoreFlags = VMAP::ModelIgnoreFlags::Nothing,
LineOfSightChecks  checks = LINEOFSIGHT_ALL_CHECKS,
Optional< float >  collisionHeight = { },
Optional< float >  combatReach = { } 
) const
1413{
1414 if (!IsInMap(obj))
1415 return false;
1416
1417 float ox, oy, oz;
1418 if (obj->IsPlayer())
1419 {
1420 obj->GetPosition(ox, oy, oz);
1421 oz += obj->GetCollisionHeight();
1422 }
1423 else
1424 obj->GetHitSpherePointFor({ GetPositionX(), GetPositionY(), GetPositionZ() + (collisionHeight ? *collisionHeight : GetCollisionHeight()) }, ox, oy, oz);
1425
1426 float x, y, z;
1427 if (IsPlayer())
1428 {
1429 GetPosition(x, y, z);
1430 z += GetCollisionHeight();
1431 }
1432 else
1433 GetHitSpherePointFor({ obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ() + obj->GetCollisionHeight() }, x, y, z, collisionHeight, combatReach);
1434
1435 return GetMap()->isInLineOfSight(x, y, z, ox, oy, oz, GetPhaseMask(), checks, ignoreFlags);
1436}

References GetCollisionHeight(), GetHitSpherePointFor(), GetMap(), GetPhaseMask(), Position::GetPosition(), Position::GetPosition(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Map::isInLineOfSight(), IsInMap(), and Object::IsPlayer().

Referenced by at_hol_hall_of_watchers::_OnTrigger(), npc_escortAI::AssistPlayerInCombatAgainst(), FollowerAI::AssistPlayerInCombatAgainst(), SmartAI::AssistPlayerInCombatAgainst(), Unit::AttackerStateUpdate(), npc_freya_ward_summon::CanAIAttack(), boss_swamplord_muselek::CanShootVictim(), Creature::CanStartAttack(), Pet::CastPendingSpell(), Spell::CheckCast(), Spell::CheckEffectTarget(), spell_hun_masters_call::DoCheckCast(), DynObjAura::FillTargetMap(), spell_yogg_saron_lunatic_gaze::FilterTargets(), npc_singularity::FindAndFollowTarget(), debug_commandscript::HandleDebugLoSCommand(), spell_sorlofs_booty_big_gun_assault::HandleDummy(), boss_halion::boss_halionAI::IsAnyPlayerValid(), npc_amanishi_lookout::MoveInLineOfSight(), boss_eye_of_cthun::MoveInLineOfSight(), boss_reliquary_of_souls::boss_reliquary_of_soulsAI::MoveInLineOfSight(), Acore::CallOfHelpCreatureInRangeDo::operator()(), Acore::AnyAssistCreatureInRangeCheck::operator()(), Acore::NearestAssistCreatureInCreatureRangeCheck::operator()(), Acore::NearestAttackableNoTotemUnitInObjectRangeCheck::operator()(), NecroticPlagueTargetCheck::operator()(), CatsTargetSelector::operator()(), RangeSelector::operator()(), ShadowTrapLKTargetSelector::operator()(), NonTankLKTargetSelector::operator()(), DefileTargetSelector::operator()(), MysticBuffetTargetFilter::operator()(), SmartScript::ProcessAction(), SmartScript::ProcessEvent(), Spell::SearchChainTargets(), Player::SelectCharmedAIGroupTarget(), Unit::SelectNearbyNoTotemTarget(), Unit::SelectNearbyTarget(), ScriptedAI::SelectTargetFromPlayerList(), CreatureAI::TriggerAlert(), boss_quartermaster_zigris::UpdateAI(), boss_mandokir::boss_mandokirAI::UpdateAI(), boss_sindragosa::boss_sindragosaAI::UpdateAI(), and boss_the_lich_king::boss_the_lich_kingAI::UpdateAI().

◆ IsWithinSightRange()

bool WorldObject::IsWithinSightRange ( Position const &  pos,
float  dist 
) const
virtual

Reimplemented in GameObject.

1376{
1377 return IsInDist2d(&pos, dist + GetObjectSize());
1378}

References GetObjectSize(), and Position::IsInDist2d().

Referenced by CanSeeOrDetect(), and Player::IsWorldObjectOutOfSightRange().

◆ IsZoneWideVisible()

◆ MagicSpellHitResult()

SpellMissInfo WorldObject::MagicSpellHitResult ( Unit *  victim,
SpellInfo const *  spellInfo 
)
3535{
3536 // Can`t miss on dead target (on skinning for example)
3537 if (!victim->IsAlive() && !victim->IsPlayer())
3538 return SPELL_MISS_NONE;
3539
3540 Unit const* unitCaster = ToUnit();
3541
3542 // vehicles cant miss
3543 if (unitCaster && unitCaster->IsVehicle())
3544 return SPELL_MISS_NONE;
3545
3546 // Spells with SPELL_ATTR3_ALWAYS_HIT will additionally fully ignore
3547 // resist and deflect chances
3548 // xinef: skip all calculations, proof: Toxic Tolerance quest
3549 if (spellInfo->HasAttribute(SPELL_ATTR3_ALWAYS_HIT))
3550 return SPELL_MISS_NONE;
3551
3552 if (spellInfo->HasAttribute(SPELL_ATTR7_NO_ATTACK_MISS))
3553 {
3554 return SPELL_MISS_NONE;
3555 }
3556
3557 SpellSchoolMask schoolMask = spellInfo->GetSchoolMask();
3558 int32 thisLevel = getLevelForTarget(victim);
3559 if (IsCreature() && ToCreature()->IsTrigger())
3560 thisLevel = std::max<int32>(thisLevel, spellInfo->SpellLevel);
3561 int32 levelDiff = int32(victim->getLevelForTarget(this)) - thisLevel;
3562
3563 int32 MISS_CHANCE_MULTIPLIER;
3564 if (sWorld->getBoolConfig(CONFIG_MISS_CHANCE_MULTIPLIER_ONLY_FOR_PLAYERS) && !IsPlayer()) // keep it as it was originally (7 and 11)
3565 {
3566 MISS_CHANCE_MULTIPLIER = victim->IsPlayer() ? 7 : 11;
3567 }
3568 else
3569 {
3570 MISS_CHANCE_MULTIPLIER = sWorld->getRate(
3571 victim->IsPlayer()
3574 }
3575
3576 // Base hit chance from attacker and victim levels
3577 int32 modHitChance = levelDiff < 3
3578 ? 96 - levelDiff
3579 : 94 - (levelDiff - 2) * MISS_CHANCE_MULTIPLIER;
3580
3581 // Spellmod from SPELLMOD_RESIST_MISS_CHANCE
3582 if (Player* modOwner = GetSpellModOwner())
3583 modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_RESIST_MISS_CHANCE, modHitChance);
3584
3585 // Increase from attacker SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT auras
3586 if (unitCaster)
3587 modHitChance += unitCaster->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT, schoolMask);
3588
3589 // Spells with SPELL_ATTR3_ALWAYS_HIT will ignore target's avoidance effects
3590 // xinef: imo it should completly ignore all calculations, eg: 14792. Hits 80 level players on blizz without any problems
3591 //if (!spell->HasAttribute(SPELL_ATTR3_ALWAYS_HIT))
3592 {
3593 // Chance hit from victim SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE auras
3595 // Reduce spell hit chance for Area of effect spells from victim SPELL_AURA_MOD_AOE_AVOIDANCE aura
3596 if (spellInfo->IsAffectingArea())
3597 modHitChance -= victim->GetTotalAuraModifier(SPELL_AURA_MOD_AOE_AVOIDANCE);
3598
3599 // Decrease hit chance from victim rating bonus
3600 if (victim->IsPlayer())
3601 modHitChance -= int32(victim->ToPlayer()->GetRatingBonusValue(CR_HIT_TAKEN_SPELL));
3602 }
3603
3604 int32 HitChance = modHitChance * 100;
3605 // Increase hit chance from attacker SPELL_AURA_MOD_SPELL_HIT_CHANCE and attacker ratings
3606 if (unitCaster)
3607 {
3608 // Xinef: Totems should inherit casters ratings?
3609 if (unitCaster->IsTotem())
3610 {
3611 if (Unit* owner = unitCaster->GetOwner())
3612 HitChance += int32(owner->m_modSpellHitChance * 100.0f);
3613 }
3614 else
3615 HitChance += int32(unitCaster->m_modSpellHitChance * 100.0f);
3616 }
3617
3618 if (HitChance < 100)
3619 HitChance = 100;
3620 else if (HitChance > 10000)
3621 HitChance = 10000;
3622
3623 int32 tmp = 10000 - HitChance;
3624
3625 int32 rand = irand(1, 10000); // Needs to be 1 to 10000 to avoid the 1/10000 chance to miss on 100% hit rating
3626
3627 if (rand < tmp)
3628 return SPELL_MISS_MISS;
3629
3630 // Chance resist mechanic (select max value from every mechanic spell effect)
3631 int32 resist_chance = victim->GetMechanicResistChance(spellInfo) * 100;
3632 tmp += resist_chance;
3633
3634 // Chance resist debuff
3635 if (!spellInfo->IsPositive() && !spellInfo->HasAttribute(SPELL_ATTR4_NO_CAST_LOG))
3636 {
3637 bool bNegativeAura = true;
3638 for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
3639 {
3640 // Xinef: Check if effect exists!
3641 if (spellInfo->Effects[i].IsEffect() && spellInfo->Effects[i].ApplyAuraName == 0)
3642 {
3643 bNegativeAura = false;
3644 break;
3645 }
3646 }
3647
3648 if (bNegativeAura)
3649 {
3650 tmp += victim->GetMaxPositiveAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(spellInfo->Dispel)) * 100;
3651 tmp += victim->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(spellInfo->Dispel)) * 100;
3652 }
3653
3654 if (spellInfo->HasAttribute(SPELL_ATTR0_CU_BINARY_SPELL) && (spellInfo->GetSchoolMask() & (SPELL_SCHOOL_MASK_NORMAL | SPELL_SCHOOL_MASK_HOLY)) == 0)
3655 tmp += int32(Unit::GetEffectiveResistChance(unitCaster, spellInfo->GetSchoolMask(), victim, spellInfo) * 10000.0f);
3656 }
3657
3658 // Roll chance
3659 if (rand < tmp)
3660 return SPELL_MISS_RESIST;
3661
3662 // cast by caster in front of victim
3663 if (!victim->HasUnitState(UNIT_STATE_STUNNED) && (victim->HasInArc(M_PI, this) || victim->HasIgnoreHitDirectionAura()))
3664 {
3665 int32 deflect_chance = victim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS) * 100;
3666 tmp += deflect_chance;
3667 if (rand < tmp)
3668 return SPELL_MISS_DEFLECT;
3669 }
3670
3671 return SPELL_MISS_NONE;
3672}
#define MAX_SPELL_EFFECTS
Definition DBCStructure.h:1673
int32 irand(int32 min, int32 max)
Definition Random.cpp:37
@ SPELL_ATTR7_NO_ATTACK_MISS
Definition SharedDefines.h:654
@ SPELL_ATTR3_ALWAYS_HIT
Definition SharedDefines.h:499
@ SPELL_MISS_NONE
Definition SharedDefines.h:1523
@ SPELL_MISS_RESIST
Definition SharedDefines.h:1525
@ SPELL_MISS_MISS
Definition SharedDefines.h:1524
@ SPELL_MISS_DEFLECT
Definition SharedDefines.h:1532
@ SPELL_ATTR4_NO_CAST_LOG
Definition SharedDefines.h:518
SpellSchoolMask
Definition SharedDefines.h:283
@ SPELL_SCHOOL_MASK_NORMAL
Definition SharedDefines.h:285
@ SPELL_SCHOOL_MASK_HOLY
Definition SharedDefines.h:286
@ SPELL_AURA_MOD_DEBUFF_RESISTANCE
Definition SpellAuraDefines.h:241
@ SPELL_AURA_DEFLECT_SPELLS
Definition SpellAuraDefines.h:350
@ SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT
Definition SpellAuraDefines.h:262
@ SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE
Definition SpellAuraDefines.h:249
@ SPELL_AURA_MOD_AOE_AVOIDANCE
Definition SpellAuraDefines.h:223
@ SPELLMOD_RESIST_MISS_CHANCE
Definition SpellDefines.h:100
@ SPELL_ATTR0_CU_BINARY_SPELL
Definition SpellInfo.h:197
@ UNIT_STATE_STUNNED
Definition UnitDefines.h:176
@ CR_HIT_TAKEN_SPELL
Definition Unit.h:239
@ CONFIG_MISS_CHANCE_MULTIPLIER_ONLY_FOR_PLAYERS
Definition WorldConfig.h:133
@ RATE_MISS_CHANCE_MULTIPLIER_TARGET_PLAYER
Definition WorldConfig.h:503
@ RATE_MISS_CHANCE_MULTIPLIER_TARGET_CREATURE
Definition WorldConfig.h:502
float GetRatingBonusValue(CombatRating cr) const
Definition Player.cpp:5365
bool IsVehicle() const
Definition Unit.h:803
bool HasIgnoreHitDirectionAura() const
Definition Unit.h:1817
uint8 getLevelForTarget(WorldObject const *) const override
Definition Unit.h:1112
int32 GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const
Definition Unit.cpp:6070
bool IsAlive() const
Definition Unit.h:1798
static float GetEffectiveResistChance(Unit const *owner, SpellSchoolMask schoolMask, Unit const *victim, SpellInfo const *spellInfo=nullptr, uint8 casterLevel=0)
Definition Unit.cpp:2302
int32 GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const
Definition Unit.cpp:6140
int32 GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const
Definition Unit.cpp:6130
int32 GetMechanicResistChance(SpellInfo const *spell)
Definition Unit.cpp:3320
bool HasUnitState(const uint32 f) const
Definition Unit.h:739
int32 GetTotalAuraModifier(AuraType auratype) const
Definition Unit.cpp:6050
bool IsTotem() const
Definition Unit.h:802
float m_modSpellHitChance
Definition Unit.h:2090
virtual Player * GetSpellModOwner() const
Definition Object.cpp:3351

References CONFIG_MISS_CHANCE_MULTIPLIER_ONLY_FOR_PLAYERS, CR_HIT_TAKEN_SPELL, SpellInfo::Dispel, SpellInfo::Effects, Unit::GetEffectiveResistChance(), getLevelForTarget(), Unit::getLevelForTarget(), Unit::GetMaxNegativeAuraModifierByMiscValue(), Unit::GetMaxPositiveAuraModifierByMiscValue(), Unit::GetMechanicResistChance(), Unit::GetOwner(), Player::GetRatingBonusValue(), SpellInfo::GetSchoolMask(), GetSpellModOwner(), Unit::GetTotalAuraModifier(), Unit::GetTotalAuraModifierByMiscMask(), SpellInfo::HasAttribute(), Unit::HasIgnoreHitDirectionAura(), Position::HasInArc(), Unit::HasUnitState(), SpellInfo::Id, irand(), SpellInfo::IsAffectingArea(), Unit::IsAlive(), Object::IsCreature(), Object::IsPlayer(), SpellInfo::IsPositive(), Unit::IsTotem(), Unit::IsVehicle(), Unit::m_modSpellHitChance, MAX_SPELL_EFFECTS, RATE_MISS_CHANCE_MULTIPLIER_TARGET_CREATURE, RATE_MISS_CHANCE_MULTIPLIER_TARGET_PLAYER, SPELL_ATTR0_CU_BINARY_SPELL, SPELL_ATTR3_ALWAYS_HIT, SPELL_ATTR4_NO_CAST_LOG, SPELL_ATTR7_NO_ATTACK_MISS, SPELL_AURA_DEFLECT_SPELLS, SPELL_AURA_MOD_AOE_AVOIDANCE, SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE, SPELL_AURA_MOD_DEBUFF_RESISTANCE, SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT, SPELL_MISS_DEFLECT, SPELL_MISS_MISS, SPELL_MISS_NONE, SPELL_MISS_RESIST, SPELL_SCHOOL_MASK_HOLY, SPELL_SCHOOL_MASK_NORMAL, SpellInfo::SpellLevel, SPELLMOD_RESIST_MISS_CHANCE, sWorld, Object::ToCreature(), Object::ToPlayer(), Object::ToUnit(), and UNIT_STATE_STUNNED.

Referenced by SpellHitResult(), and SpellHitResult().

◆ MeleeSpellHitResult()

virtual SpellMissInfo WorldObject::MeleeSpellHitResult ( Unit *  ,
SpellInfo const *   
)
inlinevirtual

Reimplemented in Unit.

791{ return SPELL_MISS_NONE; }

References SPELL_MISS_NONE.

Referenced by SpellHitResult(), and SpellHitResult().

◆ ModSpellCastTime()

void WorldObject::ModSpellCastTime ( SpellInfo const *  spellProto,
int32 &  castTime,
Spell *  spell = nullptr 
) const
Todo:
:(MadAgos) Eventually check and delete the bool argument
3496{
3497 if (!spellInfo || castTime < 0)
3498 return;
3499
3500 if (spellInfo->IsChanneled() && spellInfo->HasAura(SPELL_AURA_MOUNTED))
3501 return;
3502
3503 Unit const* unitCaster = ToUnit();
3504
3505 // called from caster
3506 if (Player* modOwner = GetSpellModOwner())
3508 modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CASTING_TIME, castTime, spell, bool(modOwner != this && !(unitCaster && unitCaster->IsPet())));
3509
3510 if (!unitCaster)
3511 return;
3512
3513 switch (spellInfo->DmgClass)
3514 {
3516 if (spellInfo->AttributesEx5 & SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC) // required double check
3517 castTime = int32(float(castTime) * unitCaster->GetFloatValue(UNIT_MOD_CAST_SPEED));
3518 else if (spellInfo->SpellVisual[0] == 3881 && unitCaster->HasAura(67556)) // cooking with Chef Hat.
3519 castTime = 500;
3520 break;
3522 break; // no known cases
3524 castTime = unitCaster->CanInstantCast() ? 0 : int32(float(castTime) * unitCaster->GetFloatValue(UNIT_MOD_CAST_SPEED));
3525 break;
3527 castTime = int32(float(castTime) * unitCaster->m_modAttackSpeedPct[RANGED_ATTACK]);
3528 break;
3529 default:
3530 break;
3531 }
3532}
@ SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC
Definition SharedDefines.h:568
@ SPELL_DAMAGE_CLASS_RANGED
Definition SharedDefines.h:1552
@ SPELL_DAMAGE_CLASS_MAGIC
Definition SharedDefines.h:1550
@ SPELL_DAMAGE_CLASS_NONE
Definition SharedDefines.h:1549
@ SPELL_DAMAGE_CLASS_MELEE
Definition SharedDefines.h:1551
@ SPELL_AURA_MOUNTED
Definition SpellAuraDefines.h:141
@ SPELLMOD_CASTING_TIME
Definition SpellDefines.h:94
@ RANGED_ATTACK
Definition Unit.h:220
@ UNIT_MOD_CAST_SPEED
Definition UpdateFields.h:137
float GetFloatValue(uint16 index) const
Definition Object.cpp:315
float m_modAttackSpeedPct[3]
Definition Unit.h:2093
bool IsPet() const
Definition Unit.h:800
bool CanInstantCast() const
Definition Unit.h:1594
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5764

References SpellInfo::AttributesEx5, Unit::CanInstantCast(), SpellInfo::DmgClass, Object::GetFloatValue(), GetSpellModOwner(), SpellInfo::HasAura(), Unit::HasAura(), SpellInfo::Id, SpellInfo::IsChanneled(), Unit::IsPet(), Unit::m_modAttackSpeedPct, RANGED_ATTACK, SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC, SPELL_AURA_MOUNTED, SPELL_DAMAGE_CLASS_MAGIC, SPELL_DAMAGE_CLASS_MELEE, SPELL_DAMAGE_CLASS_NONE, SPELL_DAMAGE_CLASS_RANGED, SPELLMOD_CASTING_TIME, SpellInfo::SpellVisual, Object::ToUnit(), and UNIT_MOD_CAST_SPEED.

Referenced by SpellInfo::CalcCastTime().

◆ ModSpellDuration()

int32 WorldObject::ModSpellDuration ( SpellInfo const *  spellProto,
Unit const *  target,
int32  duration,
bool  positive,
uint32  effectMask 
) const
3396{
3397 // don't mod permanent auras duration
3398 if (duration < 0)
3399 return duration;
3400
3401 // some auras are not affected by duration modifiers
3402 if (spellProto->HasAttribute(SPELL_ATTR7_NO_TARGET_DURATION_MOD))
3403 return duration;
3404
3405 // cut duration only of negative effects
3406 // xinef: also calculate self casts, spell can be reflected for example
3407 if (!positive)
3408 {
3409 uint64 mechanic = spellProto->GetSpellMechanicMaskByEffectMask(effectMask);
3410
3411 int32 durationMod;
3412 int32 durationMod_always = 0;
3413 int32 durationMod_not_stack = 0;
3414
3415 for (uint8 i = 1; i <= MECHANIC_ENRAGED; ++i)
3416 {
3417 if (!(mechanic & (1ULL << i)))
3418 continue;
3419
3420 // Xinef: spells affecting movement imparing effects should not reduce duration if disoriented mechanic is present
3421 if (i == MECHANIC_SNARE && (mechanic & (1ULL << MECHANIC_DISORIENTED)))
3422 continue;
3423
3424 // Find total mod value (negative bonus)
3425 int32 new_durationMod_always = target->GetTotalAuraModifierByMiscValue(SPELL_AURA_MECHANIC_DURATION_MOD, i);
3426 // Find max mod (negative bonus)
3427 int32 new_durationMod_not_stack = target->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK, i);
3428 // Check if mods applied before were weaker
3429 if (new_durationMod_always < durationMod_always)
3430 durationMod_always = new_durationMod_always;
3431 if (new_durationMod_not_stack < durationMod_not_stack)
3432 durationMod_not_stack = new_durationMod_not_stack;
3433 }
3434
3435 // Select strongest negative mod
3436 if (durationMod_always > durationMod_not_stack)
3437 durationMod = durationMod_not_stack;
3438 else
3439 durationMod = durationMod_always;
3440
3441 if (durationMod != 0)
3442 AddPct(duration, durationMod);
3443
3444 // there are only negative mods currently
3445 durationMod_always = target->GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL, spellProto->Dispel);
3446 durationMod_not_stack = target->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK, spellProto->Dispel);
3447
3448 durationMod = 0;
3449 if (durationMod_always > durationMod_not_stack)
3450 durationMod += durationMod_not_stack;
3451 else
3452 durationMod += durationMod_always;
3453
3454 if (durationMod != 0)
3455 AddPct(duration, durationMod);
3456 }
3457 else
3458 {
3459 // else positive mods here, there are no currently
3460 // when there will be, change GetTotalAuraModifierByMiscValue to GetTotalPositiveAuraModifierByMiscValue
3461 }
3462
3463 // Glyphs which increase duration of selfcasted buffs
3464 if (target == this)
3465 {
3466 switch (spellProto->SpellFamilyName)
3467 {
3468 case SPELLFAMILY_DRUID:
3469 if (spellProto->SpellFamilyFlags[0] & 0x100)
3470 {
3471 // Glyph of Thorns
3472 if (AuraEffect* aurEff = target->GetAuraEffect(57862, 0))
3473 duration += aurEff->GetAmount() * MINUTE * IN_MILLISECONDS;
3474 }
3475 break;
3477 if ((spellProto->SpellFamilyFlags[0] & 0x00000002) && spellProto->SpellIconID == 298)
3478 {
3479 // Glyph of Blessing of Might
3480 if (AuraEffect* aurEff = target->GetAuraEffect(57958, 0))
3481 duration += aurEff->GetAmount() * MINUTE * IN_MILLISECONDS;
3482 }
3483 else if ((spellProto->SpellFamilyFlags[0] & 0x00010000) && spellProto->SpellIconID == 306)
3484 {
3485 // Glyph of Blessing of Wisdom
3486 if (AuraEffect* aurEff = target->GetAuraEffect(57979, 0))
3487 duration += aurEff->GetAmount() * MINUTE * IN_MILLISECONDS;
3488 }
3489 break;
3490 }
3491 }
3492 return std::max(duration, 0);
3493}
constexpr auto IN_MILLISECONDS
Definition Common.h:53
constexpr auto MINUTE
Definition Common.h:47
std::uint64_t uint64
Definition Define.h:106
@ SPELL_ATTR7_NO_TARGET_DURATION_MOD
Definition SharedDefines.h:630
@ MECHANIC_ENRAGED
Definition SharedDefines.h:1344
@ MECHANIC_DISORIENTED
Definition SharedDefines.h:1315
@ MECHANIC_SNARE
Definition SharedDefines.h:1324
@ SPELLFAMILY_PALADIN
Definition SharedDefines.h:3794
@ SPELLFAMILY_DRUID
Definition SharedDefines.h:3791
@ SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK
Definition SpellAuraDefines.h:309
@ SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK
Definition SpellAuraDefines.h:297
@ SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL
Definition SpellAuraDefines.h:308
@ SPELL_AURA_MECHANIC_DURATION_MOD
Definition SpellAuraDefines.h:295
T AddPct(T &base, U pct)
Definition Util.h:58

References AddPct(), SpellInfo::Dispel, Unit::GetAuraEffect(), Unit::GetMaxNegativeAuraModifierByMiscValue(), SpellInfo::GetSpellMechanicMaskByEffectMask(), Unit::GetTotalAuraModifierByMiscValue(), SpellInfo::HasAttribute(), IN_MILLISECONDS, MECHANIC_DISORIENTED, MECHANIC_ENRAGED, MECHANIC_SNARE, MINUTE, SPELL_ATTR7_NO_TARGET_DURATION_MOD, SPELL_AURA_MECHANIC_DURATION_MOD, SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK, SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL, SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL_NOT_STACK, SPELLFAMILY_DRUID, SPELLFAMILY_PALADIN, SpellInfo::SpellFamilyFlags, SpellInfo::SpellFamilyName, and SpellInfo::SpellIconID.

Referenced by Spell::DoSpellHitOnUnit(), and Spell::EffectInterruptCast().

◆ MovePosition()

void WorldObject::MovePosition ( Position &  pos,
float  dist,
float  angle 
)
2903{
2904 angle += GetOrientation();
2905 float destx, desty, destz, ground, floor;
2906 destx = pos.m_positionX + dist * cos(angle);
2907 desty = pos.m_positionY + dist * std::sin(angle);
2908
2909 // Prevent invalid coordinates here, position is unchanged
2910 if (!Acore::IsValidMapCoord(destx, desty))
2911 {
2912 LOG_FATAL("entities.object", "WorldObject::MovePosition invalid coordinates X: {} and Y: {} were passed!", destx, desty);
2913 return;
2914 }
2915
2916 ground = GetMapHeight(destx, desty, MAX_HEIGHT);
2917 floor = GetMapHeight(destx, desty, pos.m_positionZ);
2918 destz = std::fabs(ground - pos.m_positionZ) <= std::fabs(floor - pos.m_positionZ) ? ground : floor;
2919
2920 float step = dist / 10.0f;
2921
2922 for (uint8 j = 0; j < 10; ++j)
2923 {
2924 // do not allow too big z changes
2925 if (std::fabs(pos.m_positionZ - destz) > 6.0f)
2926 {
2927 destx -= step * cos(angle);
2928 desty -= step * std::sin(angle);
2929 ground = GetMapHeight(destx, desty, MAX_HEIGHT);
2930 floor = GetMapHeight(destx, desty, pos.m_positionZ);
2931 destz = std::fabs(ground - pos.m_positionZ) <= std::fabs(floor - pos.m_positionZ) ? ground : floor;
2932 }
2933 // we have correct destz now
2934 else
2935 {
2936 pos.Relocate(destx, desty, destz);
2937 break;
2938 }
2939 }
2940
2945}
#define LOG_FATAL(filterType__,...)
Definition Log.h:141
float GetMapHeight(float x, float y, float z, bool vmap=true, float distanceToSearch=50.0f) const
Definition Object.cpp:3145
bool IsValidMapCoord(float c)
Definition GridDefines.h:210
void SetOrientation(float orientation)
Definition Position.h:116
void Relocate(float x, float y)
Definition Position.h:77

References GetMapHeight(), Position::GetOrientation(), Acore::IsValidMapCoord(), LOG_FATAL, Position::m_positionX, Position::m_positionY, Position::m_positionZ, MAX_HEIGHT, Acore::NormalizeMapCoord(), Position::Relocate(), Position::SetOrientation(), and UpdateGroundPositionZ().

Referenced by GetNearPosition(), GetRandomNearPosition(), and Spell::SelectImplicitDestDestTargets().

◆ MovePositionToFirstCollision()

void WorldObject::MovePositionToFirstCollision ( Position &  pos,
float  dist,
float  angle 
)

◆ NotifyExecuted()

bool WorldObject::NotifyExecuted ( uint16  f) const
inline
680{ return m_executed_notifies & f;}

References m_executed_notifies.

◆ PlayDirectMusic()

void WorldObject::PlayDirectMusic ( uint32  music_id,
Player *  target = nullptr 
)
3036{
3037 if (target)
3038 target->SendDirectMessage(WorldPackets::Misc::PlayMusic(music_id).Write());
3039 else
3040 SendMessageToSet(WorldPackets::Misc::PlayMusic(music_id).Write(), true);
3041}
void SendDirectMessage(WorldPacket const *data) const
Definition Player.cpp:5864
virtual void SendMessageToSet(WorldPacket const *data, bool self) const
Definition Object.cpp:2171
Definition MiscPackets.h:58

References Player::SendDirectMessage(), and SendMessageToSet().

Referenced by debug_commandscript::HandleDebugPlayMusicCommand(), go_l70_etc_music::go_l70_etc_musicAI::UpdateAI(), go_brewfest_music::go_brewfest_musicAI::UpdateAI(), go_pirate_day_music::go_pirate_day_musicAI::UpdateAI(), go_darkmoon_faire_music::go_darkmoon_faire_musicAI::UpdateAI(), and go_midsummer_music::go_midsummer_musicAI::UpdateAI().

◆ PlayDirectSound()

◆ PlayDistanceSound()

◆ PlayRadiusMusic()

void WorldObject::PlayRadiusMusic ( uint32  music_id,
float  radius 
)
3044{
3045 std::vector<Player*> targets;
3046 Acore::AnyPlayerInObjectRangeCheck check(this, radius, false);
3048 Cell::VisitObjects(this, searcher, radius);
3049
3050 for (Player* player : targets)
3051 player->SendDirectMessage(WorldPackets::Misc::PlayMusic(music_id).Write());
3052}
Misc
Definition boss_gyth.cpp:38
Definition GridNotifiers.h:1380
Definition Guild.h:31
Definition GridNotifiers.h:548

References Cell::VisitObjects(), and WorldPackets::Misc::PlayMusic::Write().

◆ PlayRadiusSound()

void WorldObject::PlayRadiusSound ( uint32  sound_id,
float  radius 
)
3025{
3026 std::vector<Player*> targets;
3027 Acore::AnyPlayerInObjectRangeCheck check(this, radius, false);
3029 Cell::VisitObjects(this, searcher, radius);
3030
3031 for (Player* player : targets)
3032 player->SendDirectMessage(WorldPackets::Misc::Playsound(sound_id).Write());
3033}

References Cell::VisitObjects(), and WorldPackets::Misc::Playsound::Write().

Referenced by npc_blade_of_azzinoth::IsSummonedBy().

◆ ProcessPositionDataChanged()

void WorldObject::ProcessPositionDataChanged ( PositionFullTerrainStatus const &  data)
protectedvirtual

Reimplemented in Unit.

1198{
1199 uint32 const oldZoneId = _zoneId;
1200
1201 _zoneId = _areaId = data.areaId;
1202
1203 if (AreaTableEntry const* area = sAreaTableStore.LookupEntry(_areaId))
1204 if (area->zone)
1205 _zoneId = area->zone;
1206
1207 _outdoors = data.outdoors;
1208 _floorZ = data.floorZ;
1209 _liquidData = data.liquidInfo;
1210
1211 // Has zone ID changed?
1212 if (oldZoneId != _zoneId)
1213 {
1214 // If so, check if we are far visibility overridden object and refresh maps if needed.
1215 if (IsZoneWideVisible())
1216 {
1219 }
1220 }
1221}
DBCStorage< AreaTableEntry > sAreaTableStore(AreaTableEntryfmt)
void RemoveWorldObjectFromZoneWideVisibleMap(uint32 zoneId, WorldObject *obj)
Definition Map.cpp:680
Definition DBCStructure.h:519

References _areaId, _floorZ, _liquidData, _outdoors, _zoneId, Map::AddWorldObjectToZoneWideVisibleMap(), PositionFullTerrainStatus::areaId, PositionFullTerrainStatus::floorZ, GetMap(), IsZoneWideVisible(), PositionFullTerrainStatus::liquidInfo, PositionFullTerrainStatus::outdoors, Map::RemoveWorldObjectFromZoneWideVisibleMap(), and sAreaTableStore.

Referenced by Unit::ProcessPositionDataChanged(), and UpdatePositionData().

◆ RemoveAllowedLooter()

void WorldObject::RemoveAllowedLooter ( ObjectGuid  guid)
3243{
3244 _allowedLooters.erase(guid);
3245}

References _allowedLooters.

◆ RemoveFromMapVisibilityOverrideContainers()

void WorldObject::RemoveFromMapVisibilityOverrideContainers ( )
private

◆ RemoveFromNotify()

void WorldObject::RemoveFromNotify ( uint16  f)
inline

◆ RemoveFromObjectUpdate()

void WorldObject::RemoveFromObjectUpdate ( )
overridevirtual

Implements Object.

3133{
3134 GetMap()->RemoveUpdateObject(this);
3135}
void RemoveUpdateObject(Object *obj)
Definition Map.h:541

References GetMap(), and Map::RemoveUpdateObject().

◆ RemoveFromWorld()

void WorldObject::RemoveFromWorld ( )
overridevirtual

Reimplemented from Object.

1234{
1235 if (!IsInWorld())
1236 return;
1237
1239
1241
1243
1245}
void CleanVisibilityReferences()
Definition ObjectVisibilityContainer.cpp:47
virtual void RemoveFromWorld()
Definition Object.cpp:164
void DestroyForVisiblePlayers()
Definition Object.cpp:3055
void RemoveFromMapVisibilityOverrideContainers()
Definition Object.cpp:1137

References ObjectVisibilityContainer::CleanVisibilityReferences(), DestroyForVisiblePlayers(), GetObjectVisibilityContainer(), Object::IsInWorld(), RemoveFromMapVisibilityOverrideContainers(), and Object::RemoveFromWorld().

Referenced by CleanupsBeforeDelete(), Corpse::RemoveFromWorld(), DynamicObject::RemoveFromWorld(), GameObject::RemoveFromWorld(), and Unit::RemoveFromWorld().

◆ ResetAllNotifies()

void WorldObject::ResetAllNotifies ( )
inline

◆ ResetAllowedLooters()

void WorldObject::ResetAllowedLooters ( )
3223{
3224 _allowedLooters.clear();
3225}

References _allowedLooters.

Referenced by GameObject::SetLootRecipient(), and Creature::SetLootRecipient().

◆ ResetMap()

void WorldObject::ResetMap ( )
virtual

Reimplemented in Player.

2220{
2222 ASSERT(!IsInWorld());
2223
2224 sScriptMgr->OnWorldObjectResetMap(this);
2225
2226 m_currMap = nullptr;
2227 //maybe not for corpse
2228 //m_mapId = 0;
2229 //m_InstanceId = 0;
2230}

References ASSERT, Object::IsInWorld(), m_currMap, and sScriptMgr.

Referenced by Map::RemoveCorpse(), Map::RemoveFromMap(), and Player::ResetMap().

◆ SaveRespawnTime()

virtual void WorldObject::SaveRespawnTime ( )
inlinevirtual

Reimplemented in Creature, and GameObject.

609{}

◆ SelectNearestPlayer()

Player * WorldObject::SelectNearestPlayer ( float  distance = 0) const
2586{
2587 Player* target = nullptr;
2588
2589 Acore::NearestPlayerInObjectRangeCheck checker(this, distance);
2591 Cell::VisitObjects(this, searcher, distance);
2592
2593 return target;
2594}
Definition GridNotifiers.h:1431
Definition GridNotifiers.h:580

References Cell::VisitObjects().

Referenced by spell_blade_dance_targeting::FilterTargets(), spell_tsh_shoot_flame_arrow::FilterTargets(), SmartScript::GetTargets(), spell_valkyr_ball_periodic_dummy_aura::HandleEffectPeriodic(), npc_big_ooze::npc_big_oozeAI::IsSummonedBy(), boss_kiggler_the_crazed::JustEngagedWith(), boss_krosh_firehand::JustEngagedWith(), npc_hor_lich_king::JustSummoned(), boss_devourer_of_souls::JustSummoned(), npc_hover_disk::MovementInform(), npc_shattered_hand_scout::MovementInform(), npc_omen::npc_omenAI::MovementInform(), npc_gunship_mage::npc_gunship_mageAI::MovementInform(), npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI::npc_pos_martin_or_gorkun_secondAI(), instance_eye_of_eternity::ProcessEvent(), boss_headless_horseman_pumpkin::Reset(), npc_ahnqiraji_critter::Reset(), boss_grand_warlock_nethekurse::SetData(), npc_cork_gizelton::npc_cork_gizeltonAI::SetData(), npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::SetData(), npc_argent_captainAI::SpellHit(), boss_headless_horseman_head::SpellHit(), npc_giant_claw_tentacle::Submerge(), instance_blackrock_depths::TombOfSevenEvent(), boss_rend_blackhand::UpdateAI(), boss_victor_nefarius::UpdateAI(), npc_hallows_end_soh::UpdateAI(), npc_murkdeep::npc_murkdeepAI::UpdateAI(), npc_high_overlord_saurfang_icc::npc_high_overlord_saurfangAI::UpdateAI(), npc_muradin_bronzebeard_icc::npc_muradin_bronzebeard_iccAI::UpdateAI(), npc_big_ooze::npc_big_oozeAI::UpdateAI(), npc_valithria_cloud::npc_valithria_cloudAI::UpdateAI(), boss_four_horsemen::boss_four_horsemenAI::UpdateAI(), npc_hor_raging_ghoul::UpdateAI(), and npc_grimstone::UpdateEscortAI().

◆ SendMessageToSet() [1/2]

void WorldObject::SendMessageToSet ( WorldPacket const *  data,
bool  self 
) const
virtual

Reimplemented in Player.

2172{
2173 if (IsInWorld())
2174 SendMessageToSetInRange(data, 0.0f, self);
2175}
virtual void SendMessageToSetInRange(WorldPacket const *data, float dist, bool self) const
Definition Object.cpp:2177

References Object::IsInWorld(), and SendMessageToSetInRange().

Referenced by AuraApplication::ClientUpdate(), Unit::DealDamageShieldDamage(), Spell::Delayed(), Unit::Dismount(), Spell::EffectDispel(), Spell::EffectInstaKill(), Spell::EffectStealBeneficialBuff(), AuraEffect::HandleAuraSetVehicle(), Unit::HandleEmoteCommand(), WorldSession::HandleForceSpeedChangeAck(), WorldSession::HandleMoveFlagChangeOpcode(), WorldSession::HandleMovementOpcodes(), WorldSession::HandleMoveRootAck(), WorldSession::HandleMoveSplineDoneOpcode(), WorldSession::HandleUpdateProjectilePosition(), npc_gunship::npc_gunshipAI::JustDied(), Movement::MoveSplineInit::Launch(), Unit::Mount(), PlayDirectMusic(), PlayDirectSound(), PlayDistanceSound(), Unit::SendAttackStateUpdate(), Spell::SendChannelStart(), Spell::SendChannelUpdate(), ThreatManager::SendClearAllThreatToClients(), Unit::SendClearTarget(), GameObject::SendCustomAnim(), Unit::SendEnergizeSpellLog(), Unit::SendHealSpellLog(), Spell::SendInterrupted(), Spell::SendLogExecute(), Unit::SendMeleeAttackStart(), Unit::SendMeleeAttackStop(), Unit::SendMonsterMove(), Unit::SendMovementFlagUpdate(), Unit::SendMoveRoot(), SendObjectDeSpawnAnim(), Unit::SendPeriodicAuraLog(), Unit::SendPetActionSound(), Unit::SendPetDismissSound(), SendPlayMusic(), Unit::SendPlaySpellImpact(), Unit::SendPlaySpellVisual(), ThreatManager::SendRemoveToClients(), Unit::SendSpellDamageImmune(), Unit::SendSpellDamageResist(), Spell::SendSpellGo(), SendSpellMiss(), Unit::SendSpellNonMeleeDamageLog(), SendSpellNonMeleeDamageLog(), Spell::SendSpellStart(), Unit::SendTeleportPacket(), ThreatManager::SendThreatListToClients(), Unit::SetCanFly(), Unit::SetDisableGravity(), Unit::SetFeatherFall(), Unit::SetHover(), Unit::SetPower(), Unit::SetSpeed(), Creature::SetSwim(), Creature::SetWalk(), Unit::SetWaterWalking(), Movement::MoveSplineInit::Stop(), and boss_svala::boss_svalaAI::UpdateAI().

◆ SendMessageToSet() [2/2]

void WorldObject::SendMessageToSet ( WorldPacket const *  data,
Player const *  skipped_rcvr 
) const
virtual

Reimplemented in Player.

2184{
2185 Acore::MessageDistDeliverer notifier(this, data, 0.0f, Acore::TeamFilter::All, skipped_rcvr);
2186 notifier.Visit(GetObjectVisibilityContainer().GetVisiblePlayersMap());
2187}
Definition GridNotifiers.h:109

References Acore::All, GetObjectVisibilityContainer(), and Acore::MessageDistDeliverer::Visit().

◆ SendMessageToSetInRange()

void WorldObject::SendMessageToSetInRange ( WorldPacket const *  data,
float  dist,
bool  self 
) const
virtual

Reimplemented in Player.

2178{
2179 Acore::MessageDistDeliverer notifier(this, data, dist);
2180 notifier.Visit(GetObjectVisibilityContainer().GetVisiblePlayersMap());
2181}

References GetObjectVisibilityContainer(), and Acore::MessageDistDeliverer::Visit().

Referenced by SendMessageToSet(), and CreatureTextMgr::SendNonChatPacket().

◆ SendObjectDeSpawnAnim()

void WorldObject::SendObjectDeSpawnAnim ( ObjectGuid  guid)
2190{
2192 data << guid;
2193 SendMessageToSet(&data, true);
2194}
Definition WorldPacket.h:26
@ SMSG_GAMEOBJECT_DESPAWN_ANIM
Definition Opcodes.h:563

References SendMessageToSet(), and SMSG_GAMEOBJECT_DESPAWN_ANIM.

Referenced by GameObject::Delete(), GameObject::DespawnOrUnsummon(), DynamicObject::Remove(), and GameObject::Update().

◆ SendPlayMusic()

void WorldObject::SendPlayMusic ( uint32  Music,
bool  OnlySelf 
)
2149{
2151 data << Music;
2152 if (OnlySelf && IsPlayer())
2153 ToPlayer()->SendDirectMessage(&data);
2154 else
2155 SendMessageToSet(&data, true); // ToSelf ignored in this case
2156}
@ SMSG_PLAY_MUSIC
Definition Opcodes.h:661

References Object::IsPlayer(), Player::SendDirectMessage(), SendMessageToSet(), SMSG_PLAY_MUSIC, and Object::ToPlayer().

◆ SendSpellMiss()

void WorldObject::SendSpellMiss ( Unit *  target,
uint32  spellID,
SpellMissInfo  missInfo 
)
3831{
3832 WorldPacket data(SMSG_SPELLLOGMISS, (4 + 8 + 1 + 4 + 8 + 1));
3833 data << uint32(spellID);
3834 data << GetGUID();
3835 data << uint8(0); // can be 0 or 1
3836 data << uint32(1); // target count
3837 // for (i = 0; i < target count; ++i)
3838 data << target->GetGUID(); // target GUID
3839 data << uint8(missInfo);
3840 // end loop
3841 SendMessageToSet(&data, true);
3842}
@ SMSG_SPELLLOGMISS
Definition Opcodes.h:617

References Object::GetGUID(), Object::GetGUID(), SendMessageToSet(), and SMSG_SPELLLOGMISS.

Referenced by Unit::DealDamageShieldDamage(), and Spell::DoAllEffectOnTarget().

◆ SendSpellNonMeleeDamageLog()

void WorldObject::SendSpellNonMeleeDamageLog ( Unit *  target,
SpellInfo const *  spellInfo,
uint32  damage,
SpellSchoolMask  schoolMask,
uint32  absorb,
uint32  resist 
)
3845{
3846 // in cheat mode swap absorb with damage, this way damage stays visible while the hp bar will not drop
3847 if (target->IsPlayer() && target->ToPlayer()->GetCommandStatus(CHEAT_GOD))
3848 {
3849 absorb = damage;
3850 damage = 0;
3851 }
3852
3853 WorldPacket data(SMSG_SPELLNONMELEEDAMAGELOG, (16 + 4 + 4 + 4 + 1 + 4 + 4 + 1 + 1 + 4 + 4 + 1));
3854 data << target->GetPackGUID();
3855 data << GetPackGUID();
3856 data << uint32(spellInfo->Id);
3857 data << uint32(damage);
3858 int32 overkill = int32(damage) - int32(target->GetHealth());
3859 data << uint32(overkill > 0 ? overkill : 0);
3860 data << uint8(schoolMask);
3861 data << uint32(absorb);
3862 data << uint32(resist);
3863 data << uint8(0); // physicalLog - 0: target suffers x school damage from caster's spell
3864 data << uint8(0); // unused
3865 data << uint32(0); // blocked
3866 data << uint32(0); // HitInfo
3867 data << uint8(0); // debug flags
3868 SendMessageToSet(&data, true);
3869}
@ CHEAT_GOD
Definition Player.h:997
PackedGuid const & GetPackGUID() const
Definition Object.h:122
bool GetCommandStatus(uint32 command) const
Definition Player.h:1202
uint32 GetHealth() const
Definition Unit.h:1116
@ SMSG_SPELLNONMELEEDAMAGELOG
Definition Opcodes.h:622

References CHEAT_GOD, Player::GetCommandStatus(), Unit::GetHealth(), Object::GetPackGUID(), SpellInfo::Id, Object::IsPlayer(), SendMessageToSet(), SMSG_SPELLNONMELEEDAMAGELOG, and Object::ToPlayer().

Referenced by Spell::DoAllEffectOnTarget().

◆ setActive()

void WorldObject::setActive ( bool  isActiveObject)
1092{
1093 if (m_isActive == on)
1094 return;
1095
1096 if (IsPlayer())
1097 return;
1098
1099 m_isActive = on;
1100
1101 if (!on || !IsInWorld())
1102 return;
1103
1104 Map* map = FindMap();
1105 if (!map)
1106 return;
1107
1109}

References Map::AddObjectToPendingUpdateList(), FindMap(), Object::IsInWorld(), Object::IsPlayer(), and m_isActive.

Referenced by BossAI::_JustEngagedWith(), BossAI::_JustReachedHome(), Unit::AddPlayerToVision(), boss_twilight_halion::boss_twilight_halionAI::boss_twilight_halionAI(), npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::DamageTaken(), npc_warden_mellichar::npc_warden_mellicharAI::DamageTaken(), npc_grand_magister_rommath::npc_grand_magister_rommathAI::DoAction(), boss_krick::boss_krickAI::DoAction(), npc_hyjal_ground_trash::DoAction(), npc_hyjal_gargoyle::DoAction(), npc_hyjal_frost_wyrm::DoAction(), npc_xerestrasza::npc_xerestraszaAI::DoAction(), boss_sindragosa::boss_sindragosaAI::DoAction(), npc_spinestalker::npc_spinestalkerAI::DoAction(), npc_rimefang::npc_rimefangAI::DoAction(), npc_terenas_menethil::npc_terenas_menethilAI::DoAction(), npc_crok_scourgebane::npc_crok_scourgebaneAI::DoAction(), boss_sister_svalna::boss_sister_svalnaAI::DoAction(), npc_icc_gauntlet_controller::npc_icc_gauntlet_controllerAI::DoAction(), npc_icc_putricades_trap::npc_icc_putricades_trapAI::DoAction(), boss_skadi::boss_skadiAI::DoAction(), boss_skadi_grauf::boss_skadi_graufAI::DoAction(), npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::DoAction(), boss_illidari_council::DoAction(), boss_magtheridon::EnterEvadeMode(), ValithriaDespawner::Execute(), go_necropolis::go_necropolis(), boss_yoggsaron_sara::HandleWipeRecovery(), boss_yoggsaron_sara::InitFight(), npc_cork_gizelton::npc_cork_gizeltonAI::Initialize(), npc_lord_arete::npc_lord_areteAI::InitializeAI(), npc_herald_of_the_lich_king::InitializeAI(), Totem::InitSummon(), npc_warden_mellichar::npc_warden_mellicharAI::JustDied(), boss_sartharion_dragonAI::JustEngagedWith(), boss_servant_quarters::JustEngagedWith(), boss_hadronox::JustEngagedWith(), boss_anubarak_trial::boss_anubarak_trialAI::JustEngagedWith(), boss_jaraxxus::boss_jaraxxusAI::JustEngagedWith(), boss_gormok::boss_gormokAI::JustEngagedWith(), boss_jormungarAI::JustEngagedWith(), boss_icehowl::boss_icehowlAI::JustEngagedWith(), boss_twin_valkyrAI::JustEngagedWith(), npc_stinky_icc::npc_stinky_iccAI::JustEngagedWith(), boss_lord_marrowgar::JustEngagedWith(), npc_precious_icc::npc_precious_iccAI::JustEngagedWith(), npc_icc_valkyr_herald::npc_icc_valkyr_heraldAI::JustEngagedWith(), boss_algalon_the_observer::JustEngagedWith(), boss_flame_leviathan::JustEngagedWith(), boss_freya::JustEngagedWith(), boss_vezax::JustEngagedWith(), boss_ignis::JustEngagedWith(), boss_kologarn::JustEngagedWith(), boss_mimiron::JustEngagedWith(), boss_thorim::JustEngagedWith(), boss_the_lich_king::boss_the_lich_kingAI::JustEngagedWith(), boss_trollgore::boss_trollgoreAI::JustEngagedWith(), boss_prince_keleseth_icc::boss_prince_kelesethAI::JustEngagedWith(), boss_prince_taldaram_icc::boss_prince_taldaramAI::JustEngagedWith(), boss_prince_valanar_icc::boss_prince_valanarAI::JustEngagedWith(), boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::JustEngagedWith(), boss_deathbringer_saurfang::boss_deathbringer_saurfangAI::JustEngagedWith(), boss_festergut::boss_festergutAI::JustEngagedWith(), boss_lady_deathwhisper::boss_lady_deathwhisperAI::JustEngagedWith(), boss_professor_putricide::boss_professor_putricideAI::JustEngagedWith(), boss_rotface::boss_rotfaceAI::JustEngagedWith(), boss_sindragosa::boss_sindragosaAI::JustEngagedWith(), boss_steelbreaker::JustEngagedWith(), boss_runemaster_molgeim::JustEngagedWith(), boss_stormcaller_brundir::JustEngagedWith(), npc_green_dragon_combat_trigger::npc_green_dragon_combat_triggerAI::JustEnteredCombat(), npc_green_dragon_combat_trigger::npc_green_dragon_combat_triggerAI::JustExitedCombat(), boss_anubarak_trial::boss_anubarak_trialAI::JustReachedHome(), boss_jaraxxus::boss_jaraxxusAI::JustReachedHome(), boss_gormok::boss_gormokAI::JustReachedHome(), boss_jormungarAI::JustReachedHome(), boss_icehowl::boss_icehowlAI::JustReachedHome(), boss_twin_valkyrAI::JustReachedHome(), boss_prince_keleseth_icc::boss_prince_kelesethAI::JustReachedHome(), boss_prince_taldaram_icc::boss_prince_taldaramAI::JustReachedHome(), npc_icc_valkyr_herald::npc_icc_valkyr_heraldAI::JustReachedHome(), npc_icc_gauntlet_controller::npc_icc_gauntlet_controllerAI::JustReachedHome(), npc_icc_putricades_trap::npc_icc_putricades_trapAI::JustReachedHome(), boss_algalon_the_observer::JustReachedHome(), boss_steelbreaker::JustReachedHome(), boss_runemaster_molgeim::JustReachedHome(), boss_stormcaller_brundir::JustReachedHome(), boss_flame_leviathan::JustReachedHome(), boss_freya::JustReachedHome(), boss_vezax::JustReachedHome(), boss_ignis::JustReachedHome(), boss_mimiron::JustReachedHome(), boss_thorim::JustReachedHome(), npc_highlord_darion_mograine::JustRespawned(), npc_time_lost_proto_drake::npc_time_lost_proto_drakeAI::JustRespawned(), npc_kiljaeden_controller::JustSummoned(), boss_hydross_the_unstable::JustSummoned(), npc_pos_tyrannus_events::npc_pos_tyrannus_eventsAI::MovementInform(), boss_sister_svalna::boss_sister_svalnaAI::MovementInform(), boss_sindragosa::boss_sindragosaAI::MovementInform(), npc_spinestalker::npc_spinestalkerAI::MovementInform(), npc_rimefang::npc_rimefangAI::MovementInform(), npc_minigob_manabonk::npc_minigob_manabonk(), npc_necropolis::npc_necropolis(), npc_necropolis_proxy::npc_necropolis_proxy(), npc_necropolis_relay::npc_necropolis_relay(), npc_necrotic_shard::npc_necrotic_shard(), npc_wg_spirit_guide::npc_wg_spirit_guideAI::npc_wg_spirit_guideAI(), npc_vehicle_d16_propelled_delivery::npc_vehicle_d16_propelled_deliveryAI::PassengerBoarded(), Unit::RemovePlayerFromVision(), npc_koltira_deathweaver::Reset(), npc_valkyr_battle_maiden::Reset(), npc_prophet_velen::Reset(), npc_razorscale_spawner::Reset(), npc_q24545_lich_king::npc_q24545_lich_kingAI::Reset(), npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::Reset(), npc_akama_illidan::Reset(), npc_warden_mellichar::npc_warden_mellicharAI::Reset(), boss_prince_valanar_icc::boss_prince_valanarAI::ResetPrince(), boss_svala::boss_svalaAI::SetData(), npc_highlord_tirion_fordring_lh::npc_highlord_tirion_fordringAI::SetData(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::SetData(), npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::SetData(), npc_pos_leader::npc_pos_leaderAI::SetData(), npc_q24545_lich_king::npc_q24545_lich_kingAI::SetGUID(), BattlegroundIC::SetupBattleground(), npc_high_overlord_saurfang_igb::npc_high_overlord_saurfang_igbAI::sGossipSelect(), npc_muradin_bronzebeard_igb::npc_muradin_bronzebeard_igbAI::sGossipSelect(), npc_akama_illidan::sGossipSelect(), Battlefield::SpawnCreature(), Battlefield::SpawnGameObject(), go_firework_show::SpawnNextFirework(), npc_koltira_deathweaver::StartEvent(), go_firework_show::StartShow(), go_firework_show::StopShow(), npc_warden_mellichar::npc_warden_mellicharAI::SummonedCreatureDies(), npc_kalecgos_kj::UpdateAI(), npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::UpdateAI(), npc_grand_magister_rommath::npc_grand_magister_rommathAI::UpdateAI(), npc_varian_wrynn::npc_varian_wrynnAI::UpdateAI(), npc_thrall_bfu::npc_thrall_bfuAI::UpdateAI(), npc_xerestrasza::npc_xerestraszaAI::UpdateAI(), npc_hor_leader_second::npc_hor_leader_secondAI::UpdateAI(), boss_krick::boss_krickAI::UpdateAI(), npc_pos_leader::npc_pos_leaderAI::UpdateAI(), npc_pos_tyrannus_events::npc_pos_tyrannus_eventsAI::UpdateAI(), npc_highlord_tirion_fordring_lh::npc_highlord_tirion_fordringAI::UpdateAI(), boss_yoggsaron_sara::UpdateAI(), boss_svala::boss_svalaAI::UpdateAI(), and instance_halls_of_reflection::UpdateOutro().

◆ SetAllowedLooters()

void WorldObject::SetAllowedLooters ( GuidUnorderedSet const  looters)
3218{
3219 _allowedLooters = looters;
3220}

References _allowedLooters.

Referenced by GameObject::SetLootRecipient().

◆ SetLocationInstanceId()

void WorldObject::SetLocationInstanceId ( uint32  _instanceId)
inlineprotected
819{ m_InstanceId = _instanceId; }

References m_InstanceId.

Referenced by Corpse::LoadCorpseFromDB().

◆ SetLocationMapId()

void WorldObject::SetLocationMapId ( uint32  _mapId)
inlineprotected
818{ m_mapId = _mapId; }
uint32 m_mapId
Definition Position.h:324

References WorldLocation::m_mapId.

Referenced by Corpse::LoadCorpseFromDB().

◆ SetMap()

void WorldObject::SetMap ( Map *  map)
virtual

Reimplemented in Player.

2197{
2198 ASSERT(map);
2199 ASSERT(!IsInWorld());
2200
2201 if (m_currMap == map) // command add npc: first create, than loadfromdb
2202 {
2203 return;
2204 }
2205
2206 if (m_currMap)
2207 {
2208 LOG_FATAL("entities.object", "WorldObject::SetMap: obj {} new map {} {}, old map {} {}", (uint32)GetTypeId(), map->GetId(), map->GetInstanceId(), m_currMap->GetId(), m_currMap->GetInstanceId());
2209 ABORT();
2210 }
2211
2212 m_currMap = map;
2213 m_mapId = map->GetId();
2214 m_InstanceId = map->GetInstanceId();
2215
2216 sScriptMgr->OnWorldObjectSetMap(this, map);
2217}
#define ABORT
Definition Errors.h:76
uint32 GetId() const
Definition Map.h:234
uint32 GetInstanceId() const
Definition Map.h:270

References ABORT, ASSERT, Map::GetId(), Map::GetInstanceId(), Object::GetTypeId(), Object::IsInWorld(), LOG_FATAL, m_currMap, m_InstanceId, WorldLocation::m_mapId, and sScriptMgr.

Referenced by Map::AddCorpse(), Pet::Create(), Creature::Create(), GameObject::Create(), StaticTransport::Create(), DynamicObject::CreateDynamicObject(), TransportMgr::CreateTransport(), MotionTransport::DelayedTeleportTransport(), Player::SetMap(), and TestCreature::SetTestMap().

◆ SetName()

◆ SetNotified()

void WorldObject::SetNotified ( uint16  f)
inline
681{ m_executed_notifies |= f;}

References m_executed_notifies.

◆ SetPhaseMask()

void WorldObject::SetPhaseMask ( uint32  newPhaseMask,
bool  update 
)
virtual

Reimplemented in GameObject, and Unit.

3000{
3001 sScriptMgr->OnBeforeWorldObjectSetPhaseMask(this, m_phaseMask, newPhaseMask, m_useCombinedPhases, update);
3002 m_phaseMask = newPhaseMask;
3003
3004 if (update && IsInWorld())
3006}
virtual void UpdateObjectVisibility(bool forced=true, bool fromUpdate=false)
Definition Object.cpp:3072

References Object::IsInWorld(), m_phaseMask, m_useCombinedPhases, sScriptMgr, and UpdateObjectVisibility().

Referenced by _Create(), Map::ConvertCorpseToBones(), Corpse::LoadCorpseFromDB(), GameObject::SetPhaseMask(), and Unit::SetPhaseMask().

◆ SetPositionDataUpdate()

void WorldObject::SetPositionDataUpdate ( )
1180{
1181 _updatePositionData = true;
1182
1183 // Calls immediately for charmed units
1184 if (IsCreature() && ToUnit()->IsCharmedOwnedByPlayerOrPlayer())
1186}

References _updatePositionData, Object::IsCreature(), Object::ToUnit(), and UpdatePositionData().

Referenced by Map::CreatureRelocation(), Map::DynamicObjectRelocation(), and Map::GameObjectRelocation().

◆ SetTransport()

◆ SetVisibilityDistanceOverride()

void WorldObject::SetVisibilityDistanceOverride ( VisibilityDistanceType  type)
1118{
1120
1121 if (type == GetVisibilityOverrideType())
1122 return;
1123
1124 if (!IsCreature() && !IsGameObject() && !IsDynamicObject())
1125 return;
1126
1127 // Important to remove from old visibility override containers first
1129
1130 // Always update _visibilityDistanceOverrideType, even when not in world
1132
1133 // Finally, add to new visibility override containers
1135}
void AddToMapVisibilityOverrideContainers()
Definition Object.cpp:1151
VisibilityDistanceType GetVisibilityOverrideType() const
Definition Object.h:686

References _visibilityDistanceOverrideType, AddToMapVisibilityOverrideContainers(), ASSERT, GetVisibilityOverrideType(), Object::IsCreature(), Object::IsDynamicObject(), Object::IsGameObject(), Max, and RemoveFromMapVisibilityOverrideContainers().

Referenced by GameObject::Create(), Totem::InitSummon(), and Creature::LoadCreaturesAddon().

◆ SetZoneScript()

void WorldObject::SetZoneScript ( )
2432{
2433 if (Map* map = FindMap())
2434 {
2435 if (InstanceMap* instanceMap = map->ToInstanceMap())
2436 m_zoneScript = reinterpret_cast<ZoneScript*>(instanceMap->GetInstanceScript());
2437 else if (!map->IsBattlegroundOrArena())
2438 {
2439 uint32 zoneId = GetZoneId();
2440 if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(zoneId))
2441 m_zoneScript = bf;
2442 else
2443 m_zoneScript = sOutdoorPvPMgr->GetZoneScript(zoneId);
2444 }
2445 }
2446}
#define sBattlefieldMgr
Definition BattlefieldMgr.h:79
#define sOutdoorPvPMgr
Definition OutdoorPvPMgr.h:102
Definition Battlefield.h:196
Definition Map.h:727
uint32 GetZoneId() const
Definition Object.cpp:3171
Definition ZoneScript.h:26

References FindMap(), GetZoneId(), m_zoneScript, sBattlefieldMgr, sOutdoorPvPMgr, and Map::ToInstanceMap().

Referenced by GameObject::Create(), StaticTransport::Create(), and Creature::CreateFromProto().

◆ SpellHitResult() [1/2]

SpellMissInfo WorldObject::SpellHitResult ( Unit *  victim,
Spell const *  spell,
bool  canReflect = false 
)
Todo:
: client not show miss log for this spells - so need find info for this in dbc and use it!
3744{
3745 SpellInfo const* spellInfo = spell->GetSpellInfo();
3746
3747 // Check for immune
3748 if (victim->IsImmunedToSpell(spellInfo, spell))
3749 {
3750 return SPELL_MISS_IMMUNE;
3751 }
3752
3753 // All positive spells can`t miss
3755 if ((spellInfo->IsPositive() || spellInfo->HasEffect(SPELL_EFFECT_DISPEL))
3756 && (!IsHostileTo(victim))) // prevent from affecting enemy by "positive" spell
3757 {
3758 return SPELL_MISS_NONE;
3759 }
3760
3761 // Check for immune to spell effects (includes school, mechanics, state, dispel immunities)
3762 if (victim->IsImmunedToSpell(spellInfo, MAX_EFFECT_MASK, ToUnit()))
3763 {
3764 return SPELL_MISS_IMMUNE;
3765 }
3766
3767 // Damage immunity is only checked if the spell has damage effects, this immunity must not prevent aura apply
3768 // returns SPELL_MISS_IMMUNE in that case, for other spells, the SMSG_SPELL_GO must show hit
3769 if (spellInfo->HasOnlyDamageEffects() && victim->IsImmunedToDamage(ToUnit(), spellInfo))
3770 return SPELL_MISS_IMMUNE;
3771
3772 if (this == victim)
3773 {
3774 return SPELL_MISS_NONE;
3775 }
3776
3777 // Return evade for units in evade mode
3778 if (victim->IsCreature() && victim->ToCreature()->IsEvadingAttacks() && !spellInfo->HasAura(SPELL_AURA_CONTROL_VEHICLE) &&
3780 {
3781 return SPELL_MISS_EVADE;
3782 }
3783
3784 // Try victim reflect spell
3785 if (canReflect)
3786 {
3787 int32 reflectchance = victim->GetTotalAuraModifier(SPELL_AURA_REFLECT_SPELLS);
3789
3790 if (reflectchance > 0 && roll_chance_i(reflectchance))
3791 {
3792 // Start triggers for remove charges if need (trigger only for victim, and mark as active spell)
3793 //ProcSkillsAndAuras(victim, PROC_FLAG_NONE, PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG, PROC_EX_REFLECT, 1, BASE_ATTACK, spell);
3794 return SPELL_MISS_REFLECT;
3795 }
3796 }
3797
3798 switch (spellInfo->DmgClass)
3799 {
3802 return MeleeSpellHitResult(victim, spellInfo);
3804 {
3805 if (spellInfo->SpellFamilyName)
3806 {
3807 return SPELL_MISS_NONE;
3808 }
3809
3810 // Xinef: apply DAMAGE_CLASS_MAGIC conditions to damaging DAMAGE_CLASS_NONE spells
3811 for (uint8 i = EFFECT_0; i < MAX_SPELL_EFFECTS; ++i)
3812 {
3813 if (spellInfo->Effects[i].Effect && spellInfo->Effects[i].Effect != SPELL_EFFECT_SCHOOL_DAMAGE)
3814 {
3815 if (spellInfo->Effects[i].ApplyAuraName != SPELL_AURA_PERIODIC_DAMAGE)
3816 {
3817 return SPELL_MISS_NONE;
3818 }
3819 }
3820 }
3821 [[fallthrough]];
3822 }
3824 return MagicSpellHitResult(victim, spellInfo);
3825 }
3826
3827 return SPELL_MISS_NONE;
3828}
#define MAX_EFFECT_MASK
Definition DBCStructure.h:1674
bool roll_chance_i(int chance)
Definition Random.h:63
@ EFFECT_0
Definition SharedDefines.h:31
@ SPELL_EFFECT_DISPEL
Definition SharedDefines.h:804
@ SPELL_EFFECT_SCHOOL_DAMAGE
Definition SharedDefines.h:768
@ SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT
Definition SharedDefines.h:432
@ SPELL_MISS_IMMUNE
Definition SharedDefines.h:1530
@ SPELL_MISS_EVADE
Definition SharedDefines.h:1529
@ SPELL_MISS_REFLECT
Definition SharedDefines.h:1534
@ SPELL_AURA_PERIODIC_DAMAGE
Definition SpellAuraDefines.h:66
@ SPELL_AURA_REFLECT_SPELLS
Definition SpellAuraDefines.h:91
@ SPELL_AURA_CONTROL_VEHICLE
Definition SpellAuraDefines.h:299
@ SPELL_AURA_REFLECT_SPELLS_SCHOOL
Definition SpellAuraDefines.h:137
@ SPELL_ATTR0_CU_IGNORE_EVADE
Definition SpellInfo.h:188
bool IsEvadingAttacks() const
Definition Creature.h:139
bool HasOnlyDamageEffects() const
Definition SpellInfo.cpp:930
SpellSchoolMask GetSchoolMask() const
Definition SpellInfo.cpp:1921
bool HasAttribute(SpellAttr0 attribute) const
Definition SpellInfo.h:441
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > Effects
Definition SpellInfo.h:417
bool HasEffect(SpellEffects effect) const
Definition SpellInfo.cpp:889
bool IsPositive() const
Definition SpellInfo.cpp:1282
uint32 DmgClass
Definition SpellInfo.h:413
bool HasAura(AuraType aura) const
Definition SpellInfo.cpp:906
uint32 SpellFamilyName
Definition SpellInfo.h:411
bool IsImmunedToDamage(SpellSchoolMask schoolMask) const
Definition Unit.cpp:9654
virtual bool IsImmunedToSpell(SpellInfo const *spellInfo, Spell const *spell=nullptr)
Definition Unit.cpp:9848
SpellMissInfo MagicSpellHitResult(Unit *victim, SpellInfo const *spellInfo)
Definition Object.cpp:3534
virtual SpellMissInfo MeleeSpellHitResult(Unit *, SpellInfo const *)
Definition Object.h:791

References SpellInfo::DmgClass, EFFECT_0, SpellInfo::Effects, SpellInfo::GetSchoolMask(), Spell::GetSpellInfo(), Unit::GetTotalAuraModifier(), Unit::GetTotalAuraModifierByMiscMask(), SpellInfo::HasAttribute(), SpellInfo::HasAura(), SpellInfo::HasEffect(), SpellInfo::HasOnlyDamageEffects(), Object::IsCreature(), Creature::IsEvadingAttacks(), IsHostileTo(), Unit::IsImmunedToDamage(), Unit::IsImmunedToSpell(), SpellInfo::IsPositive(), MagicSpellHitResult(), MAX_EFFECT_MASK, MAX_SPELL_EFFECTS, MeleeSpellHitResult(), roll_chance_i(), SPELL_ATTR0_CU_IGNORE_EVADE, SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT, SPELL_AURA_CONTROL_VEHICLE, SPELL_AURA_PERIODIC_DAMAGE, SPELL_AURA_REFLECT_SPELLS, SPELL_AURA_REFLECT_SPELLS_SCHOOL, SPELL_DAMAGE_CLASS_MAGIC, SPELL_DAMAGE_CLASS_MELEE, SPELL_DAMAGE_CLASS_NONE, SPELL_DAMAGE_CLASS_RANGED, SPELL_EFFECT_DISPEL, SPELL_EFFECT_SCHOOL_DAMAGE, SPELL_MISS_EVADE, SPELL_MISS_IMMUNE, SPELL_MISS_NONE, SPELL_MISS_REFLECT, SpellInfo::SpellFamilyName, Object::ToCreature(), and Object::ToUnit().

◆ SpellHitResult() [2/2]

SpellMissInfo WorldObject::SpellHitResult ( Unit *  victim,
SpellInfo const *  spellInfo,
bool  canReflect = false 
)
Todo:
: client not show miss log for this spells - so need find info for this in dbc and use it!
3683{
3684 if (spell->HasAttribute(SPELL_ATTR3_ALWAYS_HIT))
3685 return SPELL_MISS_NONE;
3686
3687 // Check for immune
3688 if (victim->IsImmunedToSpell(spell))
3689 return SPELL_MISS_IMMUNE;
3690
3691 // All positive spells can`t miss
3693 if ((spell->IsPositive() || spell->HasEffect(SPELL_EFFECT_DISPEL))
3694 && (!IsHostileTo(victim))) // prevent from affecting enemy by "positive" spell
3695 return SPELL_MISS_NONE;
3696
3697 if (this == victim)
3698 return SPELL_MISS_NONE;
3699
3700 // Return evade for units in evade mode
3701 if (victim->IsCreature() && victim->ToCreature()->IsEvadingAttacks() && !spell->HasAura(SPELL_AURA_CONTROL_VEHICLE)
3702 && !spell->HasAttribute(SPELL_ATTR0_CU_IGNORE_EVADE) && !spell->HasAttribute(SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT))
3703 return SPELL_MISS_EVADE;
3704
3705 // Try victim reflect spell
3706 if (canReflect)
3707 {
3708 int32 reflectchance = victim->GetTotalAuraModifier(SPELL_AURA_REFLECT_SPELLS);
3709 reflectchance += victim->GetTotalAuraModifierByMiscMask(SPELL_AURA_REFLECT_SPELLS_SCHOOL, spell->GetSchoolMask());
3710
3711 if (reflectchance > 0 && roll_chance_i(reflectchance))
3712 {
3713 // Start triggers for remove charges if need (trigger only for victim, and mark as active spell)
3714 //ProcSkillsAndAuras(victim, PROC_FLAG_NONE, PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG, PROC_EX_REFLECT, 1, BASE_ATTACK, spell);
3715 return SPELL_MISS_REFLECT;
3716 }
3717 }
3718
3719 switch (spell->DmgClass)
3720 {
3723 return MeleeSpellHitResult(victim, spell);
3725 {
3726 if (spell->SpellFamilyName)
3727 {
3728 return SPELL_MISS_NONE;
3729 }
3730 // Xinef: apply DAMAGE_CLASS_MAGIC conditions to damaging DAMAGE_CLASS_NONE spells
3731 for (uint8 i = EFFECT_0; i < MAX_SPELL_EFFECTS; ++i)
3732 if (spell->Effects[i].Effect && spell->Effects[i].Effect != SPELL_EFFECT_SCHOOL_DAMAGE)
3733 if (spell->Effects[i].ApplyAuraName != SPELL_AURA_PERIODIC_DAMAGE)
3734 return SPELL_MISS_NONE;
3735 [[fallthrough]];
3736 }
3738 return MagicSpellHitResult(victim, spell);
3739 }
3740 return SPELL_MISS_NONE;
3741}

References SpellInfo::DmgClass, EFFECT_0, SpellInfo::Effects, SpellInfo::GetSchoolMask(), Unit::GetTotalAuraModifier(), Unit::GetTotalAuraModifierByMiscMask(), SpellInfo::HasAttribute(), SpellInfo::HasAura(), SpellInfo::HasEffect(), Object::IsCreature(), Creature::IsEvadingAttacks(), IsHostileTo(), Unit::IsImmunedToSpell(), SpellInfo::IsPositive(), MagicSpellHitResult(), MAX_SPELL_EFFECTS, MeleeSpellHitResult(), roll_chance_i(), SPELL_ATTR0_CU_IGNORE_EVADE, SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT, SPELL_ATTR3_ALWAYS_HIT, SPELL_AURA_CONTROL_VEHICLE, SPELL_AURA_PERIODIC_DAMAGE, SPELL_AURA_REFLECT_SPELLS, SPELL_AURA_REFLECT_SPELLS_SCHOOL, SPELL_DAMAGE_CLASS_MAGIC, SPELL_DAMAGE_CLASS_MELEE, SPELL_DAMAGE_CLASS_NONE, SPELL_DAMAGE_CLASS_RANGED, SPELL_EFFECT_DISPEL, SPELL_EFFECT_SCHOOL_DAMAGE, SPELL_MISS_EVADE, SPELL_MISS_IMMUNE, SPELL_MISS_NONE, SPELL_MISS_REFLECT, SpellInfo::SpellFamilyName, and Object::ToCreature().

Referenced by Spell::AddUnitTarget(), Unit::DealDamageShieldDamage(), AuraEffect::HandlePeriodicDamageAurasTick(), AuraEffect::HandlePeriodicHealthLeechAuraTick(), and AuraEffect::HandlePeriodicManaLeechAuraTick().

◆ SummonCreature() [1/2]

TempSummon * WorldObject::SummonCreature ( uint32  id,
float  x,
float  y,
float  z,
float  ang = 0,
TempSummonType  spwtype = TEMPSUMMON_MANUAL_DESPAWN,
uint32  despwtime = 0,
SummonPropertiesEntry const *  properties = nullptr,
bool  visibleBySummonerOnly = false 
)
2389{
2390 if (!x && !y && !z)
2391 {
2392 GetClosePoint(x, y, z, GetObjectSize());
2393 ang = GetOrientation();
2394 }
2395 Position pos;
2396 pos.Relocate(x, y, z, ang);
2397 return SummonCreature(id, pos, spwtype, despwtime, 0, properties, visibleBySummonerOnly);
2398}
bool GetClosePoint(float &x, float &y, float &z, float size, float distance2d=0, float angle=0, WorldObject const *forWho=nullptr, bool force=false) const
Definition Object.cpp:2825
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2453

References GetClosePoint(), GetObjectSize(), Position::GetOrientation(), Position::Relocate(), and SummonCreature().

◆ SummonCreature() [2/2]

TempSummon * WorldObject::SummonCreature ( uint32  id,
Position const &  pos,
TempSummonType  spwtype = TEMPSUMMON_MANUAL_DESPAWN,
uint32  despwtime = 0,
uint32  vehId = 0,
SummonPropertiesEntry const *  properties = nullptr,
bool  visibleBySummonerOnly = false 
) const
2454{
2455 if (Map* map = FindMap())
2456 {
2457 if (TempSummon* summon = map->SummonCreature(entry, pos, properties, duration, (WorldObject*)this, 0, 0, visibleBySummonerOnly))
2458 {
2459 summon->SetTempSummonType(spwtype);
2460 return summon;
2461 }
2462 }
2463
2464 return nullptr;
2465}

References FindMap(), TempSummon::SetTempSummonType(), and SummonCreature().

Referenced by at_icc_spire_frostwyrm::_OnTrigger(), Battleground::AddCreature(), boss_yoggsaron_sara::AddPortals(), boss_eydis::boss_eydisAI::boss_eydisAI(), boss_fjola::boss_fjolaAI::boss_fjolaAI(), boss_headless_horseman::DamageTaken(), boss_algalon_the_observer::DamageTaken(), npc_ulduar_arachnopod_destroyer::DamageTaken(), boss_yoggsaron_sara::DamageTaken(), brann_bronzebeard::DoAbedneumSearingGaze(), npc_grand_magister_rommath::npc_grand_magister_rommathAI::DoAction(), boss_victor_nefarius::DoAction(), boss_archimonde::DoAction(), npc_thrall_warchief::npc_thrall_warchiefAI::DoAction(), npc_ahune_bunny::DoAction(), boss_cthun::DoAction(), npc_costumed_orphan_matron::DoAction(), npc_arthas::npc_arthasAI::DoAction(), boss_palehoof::boss_palehoofAI::DoAction(), boss_skadi::boss_skadiAI::DoAction(), boss_archimonde::DoCastDoomFire(), boss_bug_trio::DoFinalSpell(), brann_bronzebeard::DoMarnakDarkMatter(), npc_rinji::npc_rinjiAI::DoSpawnAmbush(), npc_lakota_windsong::npc_lakota_windsongAI::DoSpawnBandits(), ScriptedAI::DoSpawnCreature(), instance_stratholme::instance_stratholme_InstanceMapScript::DoSpawnPlaguedCritters(), npc_paoka_swiftmountain::npc_paoka_swiftmountainAI::DoSpawnWyvern(), npc_midsummer_ribbon_pole_target::DoSpewLavaChecks(), CreatureAI::DoSummon(), CreatureAI::DoSummon(), npc_time_rift::DoSummonAtRift(), CreatureAI::DoSummonFlyer(), npc_ranshalla::npc_ranshallaAI::DoSummonPriestess(), npc_muglash::npc_muglashAI::DoWaveSummon(), Spell::EffectDummy(), Spell::EffectSummonType(), npc_giant_claw_tentacle::Emerge(), DelayedSummonEvent::Execute(), IceTombSummonEvent::Execute(), boss_sartharion_tenebron::ExecuteEvent(), boss_sartharion_shadron::ExecuteEvent(), boss_sartharion_vesperon::ExecuteEvent(), boss_kaelthas::ExecuteMiddleEvent(), npc_highlord_darion_mograine::FinishFight(), boss_janalai::FireWall(), npc_simon_bunny::npc_simon_bunnyAI::GivePunishment(), go_brazier_of_madness::GossipHello(), go_celestial_planetarium_access::go_celestial_planetarium_accessAI::GossipHello(), spell_rotface_unstable_ooze_explosion_init::HandleCast(), debug_commandscript::HandleDebugSpawnVehicleCommand(), spell_midsummer_summon_ahune_lieutenant::HandleDummy(), spell_q11010_q11102_q11023_choose_loc::HandleDummy(), spell_herald_volzaj_insanity::HandleDummyEffect(), spell_hor_gunship_cannon_fire_aura::HandleEffectPeriodic(), spell_gen_haunted_aura::HandleEffectPeriodic(), spell_hodir_flash_freeze_aura::HandleEffectPeriodic(), spell_ignis_scorch_aura::HandleEffectPeriodic(), spell_dtk_raise_dead_aura::HandleEffectRemove(), spell_icc_geist_alarm::HandleEvent(), spell_grobbulus_slime_spray::HandleHit(), mmaps_commandscript::HandleMmapPathCommand(), npc_commandscript::HandleNpcAddTempSpawnCommand(), spell_gen_haunted::HandleOnEffectHit(), spell_mimiron_rocket_strike_target_select::HandleScript(), spell_kaelthas_summon_nether_vapor::HandleScriptEffect(), spell_q12478_frostmourne_cavern::HandleSendEvent(), spell_q9847_a_spirit_ally::HandleSendEvent(), spell_item_draenic_pale_ale::HandleSummon(), boss_priestess_delrissa::InitializeAI(), npc_general_andorov::InitializeAI(), boss_prince_keleseth_icc::boss_prince_kelesethAI::InitializeAI(), boss_prince_taldaram_icc::boss_prince_taldaramAI::InitializeAI(), boss_prince_valanar_icc::boss_prince_valanarAI::InitializeAI(), npc_hourglass_of_eternity::npc_hourglass_of_eternityAI::InitializeAI(), brann_bronzebeard::InitializeEvent(), boss_moroes::InitializeGuests(), Vehicle::InstallAccessory(), instance_trial_of_the_champion::instance_trial_of_the_champion_InstanceMapScript::InstanceCleanup(), instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::InstanceCleanup(), npc_ranshalla::npc_ranshallaAI::JustDidDialogueStep(), boss_halycon::JustDied(), boss_kologarn_arms::JustDied(), boss_exarch_maladaar::JustDied(), npc_necrotic_shard::JustDied(), boss_jarien::JustDied(), boss_sothos::JustDied(), boss_felmyst::JustDied(), boss_kurinnaxx::JustDied(), boss_shade_of_aran::JustEngagedWith(), boss_mandokir::boss_mandokirAI::JustEngagedWith(), boss_anubarak_trial::boss_anubarak_trialAI::JustEngagedWith(), boss_mimiron::JustEngagedWith(), boss_keleseth::JustEngagedWith(), boss_exarch_maladaar::JustEngagedWith(), boss_shirrak_the_dead_watcher::JustEngagedWith(), boss_blackheart_the_inciter::JustEngagedWith(), boss_sacrolash::JustEngagedWith(), boss_kalecgos::JustEngagedWith(), boss_hexlord_malacrass::JustEngagedWith(), boss_janalai::JustEngagedWith(), boss_onyxia::JustEngagedWith(), boss_ossirian::JustEngagedWith(), boss_novos::JustEngagedWith(), boss_devourer_of_souls::JustEngagedWith(), boss_anubrekhan::JustEngagedWith(), boss_xt002::JustEngagedWith(), boss_high_astromancer_solarian::JustEngagedWith(), boss_halion::boss_halionAI::JustSummoned(), npc_akama_illidan::KilledUnit(), npc_the_scourge_cauldron::npc_the_scourge_cauldronAI::MoveInLineOfSight(), npc_ulduar_snow_mound::MoveInLineOfSight(), npc_black_knight_graveyard::npc_black_knight_graveyardAI::MoveInLineOfSight(), npc_koltira_deathweaver::MovementInform(), boss_captain_skarloc::MovementInform(), boss_malygos::MovementInform(), boss_vazruden_the_herald::MovementInform(), boss_flame_leviathan_safety_container::MovementInform(), npc_claw_tentacle::npc_claw_tentacle(), npc_eye_tentacle::npc_eye_tentacle(), npc_giant_claw_tentacle::npc_giant_claw_tentacle(), npc_giant_eye_tentacle::npc_giant_eye_tentacle(), npc_ulduar_flames_initial::npc_ulduar_flames_initial(), npc_vh_void_sentry::npc_vh_void_sentry(), go_gong_of_bethekk::OnGossipHello(), go_resonite_cask::OnGossipHello(), go_strange_pool::OnGossipHello(), go_ethereum_prison::OnGossipHello(), go_ethereum_stasis::OnGossipHello(), go_sacred_fire_of_life::OnGossipHello(), go_southfury_moonstone::OnGossipHello(), go_arcane_prison::OnGossipHello(), go_hive_pod::OnGossipHello(), npc_grandmother::OnGossipSelect(), go_pumpkin_shrine::OnGossipSelect(), go_apexis_relic::OnGossipSelect(), instance_ruins_of_ahnqiraj::instance_ruins_of_ahnqiraj_InstanceMapScript::OnPlayerEnter(), npc_maghar_captive::OnQuestAccept(), npc_karynaku::OnQuestAccept(), go_crystalline_tear::OnQuestAccept(), go_loosely_turned_soil::OnQuestReward(), at_malfurion_stormrage::OnTrigger(), at_twilight_grove::OnTrigger(), AreaTrigger_at_scent_larkorwi::OnTrigger(), AreaTrigger_at_nats_landing::OnTrigger(), AreaTrigger_at_sentry_point::OnTrigger(), AreaTrigger_at_area_52_entrance::OnTrigger(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnUnitDeath(), boss_jeklik::PathEndReached(), npc_akama_illidan::PathEndReached(), boss_yoggsaron_brain::PrepareChamberIllusion(), npc_barnes::npc_barnesAI::PrepareEncounter(), npc_dark_iron_attack_generator::PrepareEvent(), boss_yoggsaron_brain::PrepareIceCrownIllusion(), boss_yoggsaron_brain::PrepareStormwindIllusion(), npc_battle_at_valhalas::npc_battle_at_valhalasAI::PrepareSummons(), SmartScript::ProcessAction(), boss_flame_leviathan::RadioSay(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::ReorderInstance(), boss_majordomo::Reset(), boss_malchezaar::Reset(), npc_image_of_medivh::npc_image_of_medivhAI::Reset(), boss_garaxxas::Reset(), npc_kiljaeden_controller::Reset(), npc_coren_direbrew::Reset(), boss_archimonde::Reset(), boss_infinite_corruptor::boss_infinite_corruptorAI::Reset(), boss_anubarak_trial::boss_anubarak_trialAI::Reset(), boss_drakkari_colossus::boss_drakkari_colossusAI::Reset(), boss_slad_ran::boss_slad_ranAI::Reset(), boss_the_lich_king::boss_the_lich_kingAI::Reset(), go_empowering_blood_orb::Reset(), boss_thaddius::boss_thaddiusAI::Reset(), boss_bjarngrim::Reset(), boss_sjonnir::boss_sjonnirAI::Reset(), npc_ulduar_leviathan_mkii::Reset(), boss_skadi::boss_skadiAI::Reset(), boss_vazruden_the_herald::Reset(), npc_oscillating_frequency_scanner_master_bunny::npc_oscillating_frequency_scanner_master_bunnyAI::Reset(), npc_firework::npc_fireworkAI::Reset(), npc_minion_spawner::Reset(), boss_emalon::boss_emalonAI::ResetSummons(), boss_warchief_kargath_bladefist::RespawnAssassins(), boss_alar::ScheduleAbilities(), boss_illidan_stormrage::ScheduleAbilities(), boss_kiljaeden::ScheduleBasicAbilities(), boss_the_lurker_below::SchedulerPhaseOne(), npc_darkfallen_noble::ScheduleSpells(), npc_pallid_horror::ScheduleTasks(), boss_cthun::ScheduleTasks(), boss_sjonnir::boss_sjonnirAI::ScheduleTasks(), boss_svala::boss_svalaAI::SetData(), npc_pos_tyrannus_events::npc_pos_tyrannus_eventsAI::SetData(), instance_eye_of_eternity::SetData(), npc_idol_room_spawner::npc_idol_room_spawnerAI::SetData(), npc_lady_sylvanas_windrunner::npc_lady_sylvanas_windrunnerAI::SetGUID(), npc_kurenai_captive::npc_kurenai_captiveAI::SetGUID(), npc_echo_of_medivh::SetupBoard(), boss_hexlord_malacrass::SpawnAdds(), boss_zuljin::SpawnAdds(), boss_thorim::SpawnAllNPCs(), boss_thorim::SpawnAnArenaNPC(), boss_yoggsaron_sara::SpawnClouds(), boss_selin_fireheart::SpawnCrystals(), boss_skadi::boss_skadiAI::SpawnFirstWave(), boss_kelthuzad::boss_kelthuzadAI::SpawnHelpers(), boss_razuvious::boss_razuviousAI::SpawnHelpers(), boss_hodir::SpawnHelpers(), boss_malchezaar::SpawnInfernal(), boss_darkmaster_gandling::boss_darkmaster_gandlingAI::SpawnMobsInRoom(), boss_ossirian::SpawnNextCrystal(), boss_alar::SpawnPhoenixes(), boss_yoggsaron_sara::SpawnTentacle(), npc_arthas::npc_arthasAI::SpawnTimeRift(), boss_grandmaster_vorpil::spawnVoidTraveler(), npc_grimstone::SpawnWave(), npc_varian_wrynn::npc_varian_wrynnAI::SpawnWave(), npc_thrall_bfu::npc_thrall_bfuAI::SpawnWave(), boss_julianne::SpellHit(), boss_urom::boss_uromAI::SpellHit(), boss_headless_horseman_pumpkin::SpellHit(), boss_sister_svalna::boss_sister_svalnaAI::SpellHitTarget(), npc_icc_valkyr_herald::npc_icc_valkyr_heraldAI::SpellHitTarget(), boss_freya::SpellHitTarget(), boss_lethon::boss_lethonAI::SpellHitTarget(), boss_ionar::Split(), npc_ulduar_flames_initial::SpreadFlame(), boss_lady_deathwhisper::boss_lady_deathwhisperAI::Summon(), npc_eris_hevenfire::npc_eris_hevenfireAI::SummonArchers(), npc_grimstone::SummonBoss(), npc_icc_gauntlet_controller::npc_icc_gauntlet_controllerAI::SummonBroodling(), boss_anzu::SummonBroods(), SummonCreature(), SummonCreature(), SummonCreatureGroup(), PassengerController::SummonCreatures(), npc_deathstalker_fearleia::SummonCreatureWithRandomTarget(), SummonCroneIfReady(), npc_ravenclaw_apparition::npc_ravenclaw_apparitionAI::SummonCrowd(), boss_anubrekhan::SummonCryptGuards(), npc_necrotic_shard::SummonCultists(), boss_akilzon::SummonEagles(), boss_cthun::SummonedCreatureDies(), npc_kiljaeden_controller::SummonedCreatureDies(), boss_jedoga_shadowseeker::SummonedCreatureDies(), npc_pallid_horror::SummonFlameshockers(), npc_icc_gauntlet_controller::npc_icc_gauntlet_controllerAI::SummonFrostwardens(), npc_air_force_bots::npc_air_force_botsAI::SummonGuard(), boss_fankriss::SummonHatchlingWaves(), boss_kelthuzad::boss_kelthuzadAI::SummonHelper(), boss_noth::boss_nothAI::SummonHelper(), npc_cork_gizelton::npc_cork_gizeltonAI::SummonHelpers(), boss_faerlina::boss_faerlinaAI::SummonHelpers(), boss_gothik::boss_gothikAI::SummonHelpers(), boss_yoggsaron::SummonImmortalGuardian(), npc_invis_infernal_caster::npc_invis_infernal_casterAI::SummonInfernal(), boss_sartharion::SummonLavaWaves(), instance_ulduar::instance_ulduar_InstanceMapScript::SummonLeviathanVehicle(), boss_razorscale::SummonMinions(), boss_amanitar::SummonMushroom(), npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI::SummonNextWave(), npc_lord_illidan_stormrage::npc_lord_illidan_stormrageAI::SummonNextWave(), go_wind_stone::go_wind_stoneAI::SummonNPC(), npc_medivh_bm::SummonOrcs(), npc_eris_hevenfire::npc_eris_hevenfireAI::SummonPeasants(), boss_netherspite::SummonPortals(), boss_grandmaster_vorpil::summonPortals(), npc_coren_direbrew::SummonSister(), npc_icc_gauntlet_controller::npc_icc_gauntlet_controllerAI::SummonSpiders(), boss_ambassador_flamelash::SummonSpirits(), boss_anzu::SummonSpirits(), boss_sartharion::SummonStartingTriggers(), go_tadpole_cage::go_tadpole_cageAI::SummonTadpoles(), boss_dorothee::SummonTito(), boss_flame_leviathan::SummonTowerHelpers(), SummonTrigger(), instance_trial_of_the_champion::instance_trial_of_the_champion_InstanceMapScript::Update(), instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::Update(), instance_violet_hold::instance_violet_hold_InstanceMapScript::Update(), boss_overlord_wyrmthalak::UpdateAI(), boss_rend_blackhand::UpdateAI(), boss_victor_nefarius::UpdateAI(), boss_vaelastrasz::UpdateAI(), npc_kalecgos_kj::UpdateAI(), npc_bh_thalorien_dawnseeker::npc_bh_thalorien_dawnseekerAI::UpdateAI(), npc_highlord_darion_mograine::UpdateAI(), npc_thrall_bfu::npc_thrall_bfuAI::UpdateAI(), npc_dark_iron_attack_generator::UpdateAI(), npc_dark_iron_attack_mole_machine::UpdateAI(), npc_pilgrims_bounty_chair::UpdateAI(), npc_arthas::npc_arthasAI::UpdateAI(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::UpdateAI(), npc_medivh_bm::UpdateAI(), npc_time_rift::UpdateAI(), boss_onyxia::UpdateAI(), npc_belnistrasz::npc_belnistraszAI::UpdateAI(), npc_murkdeep::npc_murkdeepAI::UpdateAI(), npc_clintar_spirit::npc_clintar_spiritAI::UpdateAI(), npc_twiggy_flathead::npc_twiggy_flatheadAI::UpdateAI(), npc_shadowpriest_sezziz::npc_shadowpriest_sezzizAI::UpdateAI(), npc_twilight_volunteer::UpdateAI(), boss_anubarak_trial::boss_anubarak_trialAI::UpdateAI(), npc_snobold_vassal::npc_snobold_vassalAI::UpdateAI(), boss_jormungarAI::UpdateAI(), boss_twin_valkyrAI::UpdateAI(), npc_phantom_mage::UpdateAI(), npc_pos_leader::npc_pos_leaderAI::UpdateAI(), npc_pos_after_first_boss::npc_pos_after_first_bossAI::UpdateAI(), npc_pos_tyrannus_events::npc_pos_tyrannus_eventsAI::UpdateAI(), npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI::UpdateAI(), npc_pos_leader_second::npc_pos_leader_secondAI::UpdateAI(), npc_muradin_bronzebeard_icc::npc_muradin_bronzebeard_iccAI::UpdateAI(), npc_high_overlord_saurfang_igb::npc_high_overlord_saurfang_igbAI::UpdateAI(), npc_muradin_bronzebeard_igb::npc_muradin_bronzebeard_igbAI::UpdateAI(), boss_rotface::boss_rotfaceAI::UpdateAI(), npc_icc_putricades_trap::npc_icc_putricades_trapAI::UpdateAI(), boss_gluth::boss_gluthAI::UpdateAI(), boss_kelthuzad::boss_kelthuzadAI::UpdateAI(), boss_maexxna::boss_maexxnaAI::UpdateAI(), boss_sapphiron::boss_sapphironAI::UpdateAI(), npc_naxxramas_trigger::UpdateAI(), boss_malygos::UpdateAI(), boss_ormorok::UpdateAI(), boss_drakos::boss_drakosAI::UpdateAI(), boss_eregos::boss_eregosAI::UpdateAI(), boss_varos::boss_varosAI::UpdateAI(), boss_sjonnir_malformed_ooze::boss_sjonnir_malformed_oozeAI::UpdateAI(), boss_algalon_the_observer::UpdateAI(), npc_hodirs_fury::UpdateAI(), npc_mimirons_inferno::UpdateAI(), npc_thorims_hammer::UpdateAI(), npc_storm_beacon_spawn::UpdateAI(), boss_mimiron::UpdateAI(), npc_ulduar_vx001::UpdateAI(), npc_ulduar_aerial_command_unit::UpdateAI(), npc_ulduar_bot_summon_trigger::UpdateAI(), boss_thorim::UpdateAI(), boss_thorim_sif::UpdateAI(), boss_thorim_ancient_rune_giant::UpdateAI(), boss_yoggsaron_sara::UpdateAI(), npc_massive_jormungar::npc_massive_jormungarAI::UpdateAI(), boss_svala::boss_svalaAI::UpdateAI(), boss_ymiron::boss_ymironAI::UpdateAI(), boss_emalon::boss_emalonAI::UpdateAI(), boss_toravon::boss_toravonAI::UpdateAI(), npc_archmage_landalock::npc_archmage_landalockAI::UpdateAI(), npc_conversing_with_the_depths_trigger::npc_conversing_with_the_depths_triggerAI::UpdateAI(), npc_hourglass_of_eternity::npc_hourglass_of_eternityAI::UpdateAI(), npc_q24545_lich_king::npc_q24545_lich_kingAI::UpdateAI(), npc_llod_generic::npc_llod_genericAI::UpdateAI(), npc_overlord_drakuru_betrayal::UpdateAI(), npc_ahune_bunny::UpdateAI(), npc_warden_mellichar::npc_warden_mellicharAI::UpdateAI(), npc_deaths_door_fell_cannon_target_bunny::npc_deaths_door_fell_cannon_target_bunnyAI::UpdateAI(), npc_commander_dawnforge::npc_commander_dawnforgeAI::UpdateAI(), npc_doctor::npc_doctorAI::UpdateAI(), npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI::UpdateEscortAI(), npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::UpdateEscortAI(), boss_yoggsaron_sara::UpdateKeeperSpawns(), boss_netherspite::UpdatePortals(), CreatureAI::VisualizeBoundary(), npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::WaypointReached(), npc_arthas::npc_arthasAI::WaypointReached(), npc_barnes::npc_barnesAI::WaypointReached(), npc_professor_phizzlethorpe::npc_professor_phizzlethorpeAI::WaypointReached(), npc_ranger_lilatha::WaypointReached(), npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI::WaypointReached(), npc_daphne_stilwell::npc_daphne_stilwellAI::WaypointReached(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::WaypointReached(), npc_cork_gizelton::npc_cork_gizeltonAI::WaypointReached(), npc_kaya_flathoof::npc_kaya_flathoofAI::WaypointReached(), npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI::WaypointReached(), npc_ame::npc_ameAI::WaypointReached(), npc_emily::npc_emilyAI::WaypointReached(), npc_maghar_captive::npc_maghar_captiveAI::WaypointReached(), npc_kurenai_captive::npc_kurenai_captiveAI::WaypointReached(), and npc_bessy::npc_bessyAI::WaypointReached().

◆ SummonCreatureGroup()

void WorldObject::SummonCreatureGroup ( uint8  group,
std::list< TempSummon * > *  list = nullptr 
)

Summons group of creatures. Should be called only by instances of Creature and GameObject classes.

Parameters
groupId of group to summon.
listList to store pointers to summoned creatures.
2531{
2532 ASSERT((IsGameObject() || IsCreature()) && "Only GOs and creatures can summon npc groups!");
2533
2534 std::vector<TempSummonData> const* data = sObjectMgr->GetSummonGroup(GetEntry(), IsGameObject() ? SUMMONER_TYPE_GAMEOBJECT : SUMMONER_TYPE_CREATURE, group);
2535 if (!data)
2536 return;
2537
2538 for (std::vector<TempSummonData>::const_iterator itr = data->begin(); itr != data->end(); ++itr)
2539 if (TempSummon* summon = SummonCreature(itr->entry, itr->pos, itr->type, itr->time))
2540 if (list)
2541 list->push_back(summon);
2542}
#define sObjectMgr
Definition ObjectMgr.h:1731
@ SUMMONER_TYPE_CREATURE
Definition TemporarySummon.h:26
@ SUMMONER_TYPE_GAMEOBJECT
Definition TemporarySummon.h:27

References ASSERT, Object::GetEntry(), Object::IsCreature(), Object::IsGameObject(), sObjectMgr, SummonCreature(), SUMMONER_TYPE_CREATURE, and SUMMONER_TYPE_GAMEOBJECT.

Referenced by boss_eye_of_cthun::DoAction(), boss_majordomo::InitializeAI(), boss_taldaram::InitializeAI(), boss_jedoga_shadowseeker::JustEngagedWith(), boss_anub_arak::JustEngagedWith(), npc_highlord_darion_mograine::JustRespawned(), npc_akama_shade::MovementInform(), npc_hyjal_thrall::OnGossipSelect(), boss_yoggsaron_brain::PrepareChamberIllusion(), boss_yoggsaron_brain::PrepareIceCrownIllusion(), boss_yoggsaron_brain::PrepareStormwindIllusion(), SmartScript::ProcessAction(), boss_apothecary_hummel::boss_apothecary_hummelAI::Reset(), boss_jedoga_shadowseeker::Reset(), boss_hadronox::Reset(), npc_green_dragon_combat_trigger::npc_green_dragon_combat_triggerAI::Reset(), boss_razorscale::Reset(), brann_bronzebeard::SummonCreatures(), boss_hadronox::SummonCrusherPack(), boss_rend_blackhand::SummonWave(), npc_highlord_darion_mograine::UpdateAI(), npc_blessed_banner::npc_blessed_bannerAI::UpdateAI(), npc_overlord_drakuru_betrayal::UpdateAI(), and npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::UpdateEscortAI().

◆ SummonGameObject()

GameObject * WorldObject::SummonGameObject ( uint32  entry,
float  x,
float  y,
float  z,
float  ang,
float  rotation0,
float  rotation1,
float  rotation2,
float  rotation3,
uint32  respawnTime,
bool  checkTransport = true,
GOSummonType  summonType = GO_SUMMON_TIMED_OR_CORPSE_DESPAWN 
)
2468{
2469 if (!IsInWorld())
2470 return nullptr;
2471
2472 GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(entry);
2473 if (!goinfo)
2474 {
2475 LOG_ERROR("sql.sql", "Gameobject template {} not found in database!", entry);
2476 return nullptr;
2477 }
2478
2479 Map* map = GetMap();
2480 GameObject* go = sObjectMgr->IsGameObjectStaticTransport(entry) ? new StaticTransport() : new GameObject();
2481 if (!go->Create(map->GenerateLowGuid<HighGuid::GameObject>(), entry, map, GetPhaseMask(), x, y, z, ang, G3D::Quat(rotation0, rotation1, rotation2, rotation3), 100, GO_STATE_READY))
2482 {
2483 delete go;
2484 return nullptr;
2485 }
2486
2487 go->SetRespawnTime(respawnTime);
2488
2489 // Xinef: if gameobject is temporary, set custom spellid
2490 if (respawnTime)
2491 go->SetSpellId(1);
2492
2493 if (IsPlayer() || (IsCreature() && summonType == GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)) //not sure how to handle this
2494 ToUnit()->AddGameObject(go);
2495 else
2496 go->SetSpawnedByDefault(false);
2497
2498 map->AddToMap(go, checkTransport);
2499 return go;
2500}
@ GO_STATE_READY
Definition GameObjectData.h:709
@ GO_SUMMON_TIMED_OR_CORPSE_DESPAWN
Definition Object.h:78
virtual bool Create(ObjectGuid::LowType guidlow, uint32 name_id, Map *map, uint32 phaseMask, float x, float y, float z, float ang, G3D::Quat const &rotation, uint32 animprogress, GOState go_state, uint32 artKit=0)
Definition GameObject.cpp:271
void SetRespawnTime(int32 respawn)
Definition GameObject.cpp:1288
void SetSpawnedByDefault(bool b)
Definition GameObject.h:198
void SetSpellId(uint32 id)
Definition GameObject.h:178
ObjectGuid::LowType GenerateLowGuid()
Definition Map.h:530
bool AddToMap(T *, bool checkTransport=false)
Definition Map.cpp:307
Definition Transport.h:120
void AddGameObject(GameObject *gameObj)
Definition Unit.cpp:6330
Definition GameObjectData.h:32

References Unit::AddGameObject(), Map::AddToMap(), GameObject::Create(), GameObject, Map::GenerateLowGuid(), GetMap(), GetPhaseMask(), GO_STATE_READY, GO_SUMMON_TIMED_OR_CORPSE_DESPAWN, Object::IsCreature(), Object::IsInWorld(), Object::IsPlayer(), LOG_ERROR, GameObject::SetRespawnTime(), GameObject::SetSpawnedByDefault(), GameObject::SetSpellId(), sObjectMgr, and Object::ToUnit().

Referenced by npc_expedition_commander::BuildBrokenHarpoons(), npc_expedition_commander::BuildHarpoon(), npc_grand_magister_rommath::npc_grand_magister_rommathAI::DoAction(), instance_obsidian_sanctum::instance_obsidian_sanctum_InstanceMapScript::DoAction(), npc_overlord_drakuru_betrayal::DoAction(), npc_ahune_bunny::DoAction(), npc_medivh_bm::DoAction(), brann_bronzebeard::EndTribunalFight(), IceTombSummonEvent::Execute(), boss_sartharion_tenebron::ExecuteEvent(), boss_sartharion_shadron::ExecuteEvent(), boss_sartharion_vesperon::ExecuteEvent(), npc_anachronos_the_ancient::npc_anachronos_the_ancientAI::HandleAnimation(), HandleBothDead(), spell_q12014_steady_as_a_rock::HandleFinish(), gobject_commandscript::HandleGameObjectAddTempCommand(), boss_sapphiron::boss_sapphironAI::InitializeAI(), boss_eregos::boss_eregosAI::JustDied(), boss_kologarn::JustDied(), npc_alexstrasza::npc_alexstrasza(), spell_pagles_point_cast::OnEffect(), instance_sunken_temple::instance_sunken_temple_InstanceMapScript::OnGameObjectCreate(), npc_zulaman_hostage::OnGossipSelect(), spell_silithyst::OnRemove(), SmartScript::ProcessAction(), npc_brewfest_super_brew_trigger::Reset(), boss_ossirian::Reset(), npc_crystal_spike::Reset(), boss_freya_nature_bomb::Reset(), npc_oscillating_frequency_scanner_master_bunny::npc_oscillating_frequency_scanner_master_bunnyAI::Reset(), instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::SetData(), boss_ossirian::SpawnNextCrystal(), go_firework_show::SpawnNextFirework(), npc_thrall_bfu::npc_thrall_bfuAI::SpawnWave(), npc_deaths_door_fell_cannon_target_bunny::npc_deaths_door_fell_cannon_target_bunnyAI::SpellHit(), SummonGameObjectGroup(), instance_trial_of_the_crusader::instance_trial_of_the_crusader_InstanceMapScript::Update(), npc_thrall_bfu::npc_thrall_bfuAI::UpdateAI(), npc_dark_iron_attack_mole_machine::UpdateAI(), npc_pos_leader_second::npc_pos_leader_secondAI::UpdateAI(), boss_sapphiron::boss_sapphironAI::UpdateAI(), boss_algalon_the_observer::UpdateAI(), npc_shandy_dalaran::npc_shandy_dalaranAI::UpdateAI(), npc_still_at_it_trigger::npc_still_at_it_triggerAI::UpdateAI(), npc_grimstone::UpdateEscortAI(), npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::UpdateEscortAI(), instance_halls_of_reflection::UpdateOutro(), and npc_engineer_helice::npc_engineer_heliceAI::WaypointReached().

◆ SummonGameObjectGroup()

void WorldObject::SummonGameObjectGroup ( uint8  group,
std::list< GameObject * > *  list = nullptr 
)
2545{
2546 ASSERT((IsGameObject() || IsCreature()) && "Only GOs and creatures can summon gameobject groups!");
2547
2548 std::vector<GameObjectSummonData> const* data = sObjectMgr->GetGameObjectSummonGroup(GetEntry(), IsGameObject() ? SUMMONER_TYPE_GAMEOBJECT : SUMMONER_TYPE_CREATURE, group);
2549 if (!data)
2550 return;
2551
2552 for (std::vector<GameObjectSummonData>::const_iterator itr = data->begin(); itr != data->end(); ++itr)
2553 if (GameObject* go = SummonGameObject(itr->entry, itr->pos.GetPositionX(), itr->pos.GetPositionY(), itr->pos.GetPositionZ(), itr->pos.GetOrientation(), itr->rot.x, itr->rot.y, itr->rot.z, itr->rot.w, itr->respawnTime))
2554 if (list)
2555 list->push_back(go);
2556}
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition Object.cpp:2467

References ASSERT, Object::GetEntry(), Object::IsCreature(), Object::IsGameObject(), sObjectMgr, SUMMONER_TYPE_CREATURE, SUMMONER_TYPE_GAMEOBJECT, and SummonGameObject().

Referenced by SmartScript::ProcessAction().

◆ SummonTrigger()

Creature * WorldObject::SummonTrigger ( float  x,
float  y,
float  z,
float  ang,
uint32  dur,
bool  setLevel = false,
CreatureAI *(*)(Creature *)  GetAI = nullptr 
)
2503{
2504 TempSummonType summonType = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;
2505 Creature* summon = SummonCreature(WORLD_TRIGGER, x, y, z, ang, summonType, duration);
2506 if (!summon)
2507 return nullptr;
2508
2509 //summon->SetName(GetName());
2510 if (setLevel && (IsPlayer() || IsCreature()))
2511 {
2512 summon->SetFaction(((Unit*)this)->GetFaction());
2513 summon->SetLevel(((Unit*)this)->GetLevel());
2514 }
2515
2516 // Xinef: correctly set phase mask in case of gameobjects
2517 summon->SetPhaseMask(GetPhaseMask(), false);
2518
2519 if (GetAI)
2520 summon->AIM_Initialize(GetAI(summon));
2521 return summon;
2522}
TempSummonType
Definition Object.h:49
@ TEMPSUMMON_DEAD_DESPAWN
Definition Object.h:56
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:52
bool AIM_Initialize(CreatureAI *ai=nullptr)
Definition Creature.cpp:1120
void SetFaction(uint32 faction)
Definition Unit.cpp:6850
void SetLevel(uint8 lvl, bool showLevelChange=true)
Definition Unit.cpp:11936
void SetPhaseMask(uint32 newPhaseMask, bool update) override
Definition Unit.cpp:14937

References Creature::AIM_Initialize(), GetFaction(), GetPhaseMask(), Object::IsCreature(), Object::IsPlayer(), Unit::SetFaction(), Unit::SetLevel(), Unit::SetPhaseMask(), SummonCreature(), TEMPSUMMON_DEAD_DESPAWN, TEMPSUMMON_TIMED_DESPAWN, and WORLD_TRIGGER.

Referenced by GameObject::CastSpell(), boss_kiljaeden::EmpowerOrb(), spell_q10612_10613_the_fel_and_the_furious::HandleScriptEffect(), go_wg_vehicle_teleporter::go_wg_vehicle_teleporterAI::IsValidVehicle(), boss_kologarn_arms::JustDied(), SmartScript::ProcessAction(), Map::ScriptsProcess(), boss_headless_horseman::UpdateAI(), boss_ymiron::boss_ymironAI::UpdateAI(), go_flames::go_flamesAI::UpdateAI(), and go_heat::go_heatAI::UpdateAI().

◆ Update()

void WorldObject::Update ( uint32  diff)
virtual

Reimplemented in Pet, MotionTransport, StaticTransport, DynamicObject, GameObject, Creature, TempSummon, Puppet, Player, Totem, and Unit.

1078{
1079 m_Events.Update(diff);
1080
1082 while (_heartbeatTimer <= 0ms)
1083 {
1085 Heartbeat();
1086 }
1087
1088 sScriptMgr->OnWorldObjectUpdate(this, diff);
1089}
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:27
void Update(uint32 p_time)
Definition EventProcessor.cpp:40
virtual void Heartbeat()
Definition Object.h:233

References _heartbeatTimer, Object::Heartbeat(), HEARTBEAT_INTERVAL, m_Events, sScriptMgr, and EventProcessor::Update().

Referenced by GameObject::Update(), Unit::Update(), and Map::UpdateNonPlayerObjects().

◆ UpdateAllowedPositionZ()

void WorldObject::UpdateAllowedPositionZ ( float  x,
float  y,
float &  z,
float *  groundZ = nullptr 
) const
1620{
1621 if (GetTransport())
1622 {
1623 if (groundZ)
1624 *groundZ = z;
1625
1626 return;
1627 }
1628
1629 if (Unit const* unit = ToUnit())
1630 {
1631 if (!unit->CanFly())
1632 {
1633 Creature const* c = unit->ToCreature();
1634 bool canSwim = c ? c->CanSwim() : true;
1635 float ground_z = z;
1636 float max_z;
1637 if (canSwim)
1638 max_z = GetMapWaterOrGroundLevel(x, y, z, &ground_z);
1639 else
1640 max_z = ground_z = GetMapHeight(x, y, z);
1641
1642 if (max_z > INVALID_HEIGHT)
1643 {
1644 if (canSwim && unit->GetMap()->IsInWater(unit->GetPhaseMask(), x, y, max_z - Z_OFFSET_FIND_HEIGHT, unit->GetCollisionHeight()))
1645 {
1646 // do not allow creatures to walk on
1647 // water level while swimming
1648 max_z = std::max(max_z - GetMinHeightInWater(), ground_z);
1649 }
1650 else
1651 {
1652 // hovering units cannot go below their hover height
1653 float hoverOffset = unit->GetHoverHeight();
1654 max_z += hoverOffset;
1655 ground_z += hoverOffset;
1656 }
1657
1658 if (z > max_z)
1659 z = max_z;
1660 else if (z < ground_z)
1661 z = ground_z;
1662 }
1663
1664 if (groundZ)
1665 *groundZ = ground_z;
1666 }
1667 else
1668 {
1669 float ground_z = GetMapHeight(x, y, z) + unit->GetHoverHeight();
1670 if (z < ground_z)
1671 z = ground_z;
1672
1673 if (groundZ)
1674 *groundZ = ground_z;
1675 }
1676 }
1677 else
1678 {
1679 float ground_z = GetMapHeight(x, y, z);
1680 if (ground_z > INVALID_HEIGHT)
1681 z = ground_z;
1682
1683 if (groundZ)
1684 *groundZ = ground_z;
1685 }
1686}
bool CanSwim() const override
This method check the current flag/status of a creature and its inhabit type.
Definition Creature.cpp:3427
float GetMinHeightInWater() const
Get the minimum height of a object that should be in water to start floating/swim.
Definition Object.cpp:1608

References Creature::CanSwim(), GetMapHeight(), GetMapWaterOrGroundLevel(), GetMinHeightInWater(), GetTransport(), INVALID_HEIGHT, Object::ToCreature(), Object::ToUnit(), and Z_OFFSET_FIND_HEIGHT.

Referenced by RandomMovementGenerator< T >::_setRandomLocation(), HomeMovementGenerator< Creature >::_setTargetLocation(), Spell::CheckCast(), Map::CheckCollisionAndGetValidCoords(), GetContactPoint(), GetNearPoint(), Unit::GetRandomContactPoint(), PathGenerator::NormalizePath(), CharmInfo::SaveStayPosition(), spell_valanar_kinetic_bomb_summon::SelectDest(), Unit::SetHover(), and WaypointMovementGenerator< Creature >::StartMove().

◆ UpdateGroundPositionZ()

void WorldObject::UpdateGroundPositionZ ( float  x,
float  y,
float &  z 
) const

◆ UpdateObjectVisibility()

void WorldObject::UpdateObjectVisibility ( bool  forced = true,
bool  fromUpdate = false 
)
virtual

Reimplemented in Player, Unit, TestCreature, and TestPlayer.

3073{
3074 //updates object's visibility for nearby players
3075 Acore::VisibleChangesNotifier notifier(*this);
3076 Cell::VisitObjects(this, notifier, GetVisibilityRange());
3077}
float GetVisibilityRange() const
Definition Object.cpp:1710
Definition GridNotifiers.h:63

References GetVisibilityRange(), and Cell::VisitObjects().

Referenced by Map::DynamicObjectRelocation(), Map::GameObjectRelocation(), SetPhaseMask(), GameObject::SetRespawnTime(), GameObject::Update(), Unit::UpdateObjectVisibility(), UpdateObjectVisibilityOnCreate(), and TempSummon::UpdateObjectVisibilityOnCreate().

◆ UpdateObjectVisibilityOnCreate()

virtual void WorldObject::UpdateObjectVisibilityOnCreate ( )
inlinevirtual

Reimplemented in TempSummon.

664{ UpdateObjectVisibility(true); }

References UpdateObjectVisibility().

◆ UpdatePositionData()

Member Data Documentation

◆ _allowedLooters

◆ _areaId

uint32 WorldObject::_areaId
protected

◆ _floorZ

float WorldObject::_floorZ
protected

◆ _heartbeatTimer

Milliseconds WorldObject::_heartbeatTimer
private

Referenced by Update().

◆ _liquidData

LiquidData WorldObject::_liquidData
protected

◆ _objectVisibilityContainer

ObjectVisibilityContainer WorldObject::_objectVisibilityContainer
private

◆ _outdoors

bool WorldObject::_outdoors
protected

◆ _updatePositionData

◆ _visibilityDistanceOverrideType

◆ _zoneId

◆ ALEEvents

ALEEventProcessor* WorldObject::ALEEvents

◆ LastUsedScriptID

◆ m_currMap

Map* WorldObject::m_currMap
private

Referenced by FindMap(), GetMap(), ResetMap(), and SetMap().

◆ m_Events

EventProcessor WorldObject::m_Events

Referenced by Unit::_ExitVehicle(), at_hol_hall_of_watchers::_OnTrigger(), BossAI::_Reset(), npc_q24545_wretched_ghoul::npc_q24545_wretched_ghoulAI::Activate(), CharmInfo::AddSpellToActionBar(), Spell::AddUnitTarget(), spell_sindragosa_ice_tomb_trap_aura::AfterApply(), npc_time_lost_proto_drake::npc_time_lost_proto_drakeAI::ArmHiddenState(), boss_yoggsaron_crusher_tentacle::boss_yoggsaron_crusher_tentacle(), Creature::CallAssistance(), boss_krik_thir::boss_krik_thirAI::CallWatcher(), boss_high_nethermancer_zerevor::CastDampenMagicIfPossible(), Unit::CastDelayedSpellWithPeriodicAmount(), boss_murmur::CastSuppressionOOC(), spell_botanica_shift_form_aura::CheckProc(), spell_mage_burning_determination::CheckProc(), spell_mage_combustion::CheckProc(), Unit::CleanupBeforeRemoveFromMap(), CleanupsBeforeDelete(), boss_romulo::DamageTaken(), boss_muru::DamageTaken(), boss_yoggsaron::DamageTaken(), boss_felblood_kaelthas::DamageTaken(), boss_the_lich_king::boss_the_lich_kingAI::DamageTaken(), boss_kiljaeden::DamageTaken(), npc_q24545_wretched_ghoul::npc_q24545_wretched_ghoulAI::DoAction(), boss_julianne::DoAction(), boss_baltharus_the_warborn::boss_baltharus_the_warbornAI::DoAction(), boss_falric::DoAction(), boss_marwyn::DoAction(), boss_prince_keleseth_icc::boss_prince_kelesethAI::DoAction(), boss_prince_taldaram_icc::boss_prince_taldaramAI::DoAction(), boss_prince_valanar_icc::boss_prince_valanarAI::DoAction(), boss_sindragosa::boss_sindragosaAI::DoAction(), npc_spinestalker::npc_spinestalkerAI::DoAction(), npc_rimefang::npc_rimefangAI::DoAction(), npc_green_dragon_combat_trigger::npc_green_dragon_combat_triggerAI::DoAction(), brann_bronzebeard::DoAction(), boss_felblood_kaelthas::DoAction(), boss_akilzon::DoAction(), boss_cthun::DoAction(), boss_krik_thir::boss_krik_thirAI::DoAction(), boss_kalecgos::DoAction(), npc_ulduar_aerial_command_unit::DoAction(), boss_illidan_stormrage::DoAction(), npc_akama_illidan::DoAction(), npc_maiev_illidan::DoAction(), npc_blade_of_azzinoth::DoAction(), brann_bronzebeard::DoMarnakDarkMatter(), boss_ouro::Emerge(), brann_bronzebeard::EndTribunalFight(), boss_illidan_stormrage::EnterEvadeMode(), boss_zuljin::EnterPhase(), SpellEvent::Execute(), BattleExperienceEvent::Execute(), UtherBatteredHiltEvent::Execute(), TriggerWickedSpirit::Execute(), lapseTeleport::Execute(), PartyTimeEmoteEvent::Execute(), Creature::ForcedDespawn(), spell_forgiveness_dummy_visual::HandleDummy(), spell_item_party_time::HandleEffectApply(), spell_chapter2_persuasive_strike::HandleHit(), spell_alar_flame_quills::HandlePeriodic(), WorldSession::HandlePlayerLoginFromDB(), spell_ayamiss_swarmer_teleport_trigger::HandleScript(), boss_akilzon::HandleStormSequence(), WorldSession::HandleTC9PrepareForRedirect(), boss_kiljaeden::InitializeAI(), boss_ambassador_hellmaw::InitializeAI(), npc_pet_mage_mirror_image::InitializeAI(), Totem::InitSummon(), npc_freya_ward_summon::IsSummonedBy(), npc_blade_of_azzinoth::IsSummonedBy(), npc_flame_of_azzinoth::IsSummonedBy(), npc_demonic_vapor::IsSummonedBy(), npc_eoe_wyrmrest_skytalon::IsSummonedBy(), npc_maiev_illidan::IsSummonedBy(), boss_akilzon::JustDied(), npc_swarm_scarab::npc_swarm_scarabAI::JustDied(), npc_nerubian_burrower::npc_nerubian_burrowerAI::JustDied(), npc_gunship::npc_gunshipAI::JustDied(), boss_freya_summons::JustDied(), npc_q24545_wretched_ghoul::npc_q24545_wretched_ghoulAI::JustDied(), boss_felmyst::JustDied(), boss_mother_shahraz::JustDied(), boss_najentus::JustDied(), boss_akilzon::JustEngagedWith(), boss_zuljin::JustEngagedWith(), boss_loken::JustEngagedWith(), boss_keleseth::JustEngagedWith(), npc_flame_of_azzinoth::JustEngagedWith(), boss_essence_of_suffering::boss_essence_of_sufferingAI::JustEngagedWith(), boss_swamplord_muselek::JustEngagedWith(), boss_felmyst::JustEngagedWith(), boss_muru::JustEngagedWith(), boss_janalai::JustEngagedWith(), boss_krik_thir::boss_krik_thirAI::JustEngagedWith(), boss_novos::JustEngagedWith(), boss_anubrekhan::JustEngagedWith(), boss_murmur::JustEngagedWith(), boss_gurtogg_bloodboil::JustEngagedWith(), boss_illidan_stormrage::JustEngagedWith(), boss_mother_shahraz::JustEngagedWith(), boss_najentus::JustEngagedWith(), boss_hydross_the_unstable::JustEngagedWith(), npc_akama_illidan::JustReachedHome(), npc_kiljaeden_controller::JustSummoned(), boss_kiljaeden::JustSummoned(), boss_hazzarah::JustSummoned(), boss_baltharus_the_warborn::boss_baltharus_the_warbornAI::JustSummoned(), boss_drakkari_colossus::boss_drakkari_colossusAI::JustSummoned(), boss_prince_valanar_icc::boss_prince_valanarAI::JustSummoned(), boss_sindragosa::boss_sindragosaAI::JustSummoned(), boss_the_lich_king::boss_the_lich_kingAI::JustSummoned(), boss_valithria_dreamwalker::boss_valithria_dreamwalkerAI::JustSummoned(), npc_risen_archmage::npc_risen_archmageAI::JustSummoned(), boss_algalon_the_observer::JustSummoned(), boss_reliquary_of_souls::boss_reliquary_of_soulsAI::JustSummoned(), Creature::ModifyThreatPercentTemp(), boss_ebonroc::MovementInform(), npc_koltira_deathweaver::MovementInform(), boss_zuljin::MovementInform(), boss_captain_skarloc::MovementInform(), boss_ayamiss::MovementInform(), brann_bronzebeard::MovementInform(), boss_illidan_stormrage::MovementInform(), npc_akama_illidan::MovementInform(), boss_essence_of_suffering::boss_essence_of_sufferingAI::MovementInform(), boss_essence_of_desire::boss_essence_of_desireAI::MovementInform(), boss_felmyst::MovementInform(), gunship_npc_AI::MovementInform(), npc_gunship_boarding_addAI::MovementInform(), boss_ghazan::MovementInform(), spell_halion_twilight_realm_aura::OnApply(), boss_taldaram::OnAuraRemove(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnCreatureCreate(), go_main_chambers_access_panel::OnGossipHello(), spell_halion_leave_twilight_realm_aura::OnRemove(), spell_q12937_relief_for_the_fallen::OnRemove(), at_cthun_stomach_exit::OnTrigger(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::OnUnitDeath(), npc_dusk::PassengerBoarded(), boss_anetheron::PathEndReached(), boss_rage_winterchill::PathEndReached(), npc_hyjal_ground_trash::PathEndReached(), npc_hyjal_frost_wyrm::PathEndReached(), boss_ambassador_hellmaw::PathEndReached(), npc_akama_illidan::PathEndReached(), npc_hyjal_gargoyle::PathEndReached(), npc_hive_zara_swarmer::PathEndReached(), boss_reliquary_of_souls::boss_reliquary_of_soulsAI::PhaseTransitionSpawns(), Spell::prepare(), SmartScript::ProcessAction(), Spell::RecalculateDelayMomentForDst(), boss_vexallus::Reset(), boss_brutallus::Reset(), boss_kiljaeden::Reset(), boss_muru::Reset(), boss_entropius::Reset(), npc_dark_fiend::Reset(), npc_singularity::Reset(), npc_koltira_deathweaver::Reset(), boss_akilzon::Reset(), boss_janalai::Reset(), boss_zuljin::Reset(), brann_bronzebeard::Reset(), boss_runemaster_molgeim::Reset(), boss_freya_summons::Reset(), boss_illidan_stormrage::Reset(), npc_akama_illidan::Reset(), npc_maiev_illidan::Reset(), boss_mother_shahraz::Reset(), boss_najentus::Reset(), boss_alar::Reset(), brann_bronzebeard::ResetEvent(), NPCStaveQuestAI::ResetState(), boss_alar::ScheduleAbilities(), boss_illidan_stormrage::ScheduleAbilities(), BossAI::ScheduleEnrageTimer(), boss_gal_darah::ScheduleEvents(), brann_bronzebeard::SchedulePhaseTalks(), brann_bronzebeard::SchedulePostFightConversation(), boss_loken::ScheduleTasks(), npc_gunship_boarding_addAI::SetData(), boss_gal_darah::SpellHit(), npc_koltira_deathweaver::StartEvent(), boss_felmyst::StartIntro(), npc_highlord_darion_mograine::SummonedCreatureDies(), boss_hydross_the_unstable::SummonMovementInform(), boss_hydross_the_unstable::SummonTaintedElementalOOC(), boss_krik_thir::boss_krik_thirAI::SummonWatcher(), CreatureAI::Talk(), brann_bronzebeard::TransitionToPhase(), TempSummon::UnSummon(), Totem::UnSummon(), spell_illidari_council_deadly_strike_aura::Update(), Update(), npc_kalecgos_kj::UpdateAI(), boss_malygos::UpdateAI(), boss_anomalus::UpdateAI(), npc_dark_fiend::UpdateAI(), and npc_dusk::WaypointReached().

◆ m_executed_notifies

uint16 WorldObject::m_executed_notifies
private

◆ m_InstanceId

uint32 WorldObject::m_InstanceId
private

◆ m_invisibility

◆ m_invisibilityDetect

◆ m_isActive

bool WorldObject::m_isActive
protected

◆ m_movementInfo

MovementInfo WorldObject::m_movementInfo

Referenced by _IsWithinDist(), Unit::AddExtraUnitMovementFlag(), Vehicle::AddPassenger(), MotionTransport::AddPassenger(), StaticTransport::AddPassenger(), Unit::AddUnitMovementFlag(), Unit::BuildMovementPacket(), Object::BuildMovementUpdate(), WorldSession::BuildPartyMemberStatsChangedPacket(), Player::CanFly(), DynamicObject::CleanupsBeforeDelete(), GameObject::CleanupsBeforeDelete(), MotionTransport::CleanupsBeforeDelete(), StaticTransport::CleanupsBeforeDelete(), Unit::CleanupsBeforeDelete(), MotionTransport::CreateGOPassenger(), MotionTransport::CreateNPCPassenger(), MotionTransport::DelayedTeleportTransport(), Unit::DisableSpline(), go_commandscript::DoTeleportToTransport(), npc_escortAI::GenerateWaypointArray(), SmartAI::GenerateWayPointArray(), Unit::GetExtraUnitMovementFlags(), GetTargetSpeedInMotion(), GetTransOffsetO(), GetTransOffsetX(), GetTransOffsetY(), GetTransOffsetZ(), GetTransSeat(), GetTransTime(), Unit::GetUnitMovementFlags(), misc_commandscript::HandleAppearCommand(), WorldSession::HandleChangeSeatsOnControlledVehicle(), misc_commandscript::HandleGPSCommand(), WorldSession::HandleMoveFlagChangeOpcode(), WorldSession::HandleMoveNotActiveMover(), WorldSession::HandleMoveRootAck(), WorldSession::HandleMoverRelocation(), WorldSession::HandleMoveSplineDoneOpcode(), WorldSession::HandleMoveTimeSkippedOpcode(), WorldSession::HandleMoveWorldportAck(), WorldSession::HandlePlayerLoginFromDB(), WorldSession::HandlePlayerLoginToCharInWorld(), WorldSession::HandleRequestPartyMemberStatsOpcode(), Unit::HasExtraUnitMovementFlag(), Unit::HasUnitMovementFlag(), Unit::IsFalling(), Unit::IsFlying(), Creature::IsFreeToMove(), Unit::IsHovering(), Unit::IsLevitating(), Unit::isMoving(), Unit::IsRooted(), Unit::isSwimming(), Unit::isTurning(), Unit::IsWalking(), Movement::MoveSplineInit::Launch(), Player::LoadFromDB(), MotionMaster::MoveFall(), Movement::MoveSplineInit::MoveSplineInit(), FollowMovementGenerator< T >::PositionOkay(), PredictPosition(), WorldSession::ProcessMovementInfo(), spell_igb_teleport_to_enemy_ship::RelocateTransportOffset(), Unit::RemoveExtraUnitMovementFlag(), Vehicle::RemovePassenger(), MotionTransport::RemovePassenger(), StaticTransport::RemovePassenger(), Unit::RemoveUnitMovementFlag(), Unit::SendMoveRoot(), Unit::SetCanFly(), Unit::SetDisableGravity(), Unit::SetExtraUnitMovementFlags(), Unit::SetFeatherFall(), Unit::SetHover(), Unit::SetUnitMovementFlags(), Unit::SetWaterWalking(), Movement::MoveSplineInit::Stop(), Player::TeleportTo(), Creature::UpdateMovementFlags(), StaticTransport::UpdatePassengerPositions(), MotionTransport::UpdatePassengerPositions(), and Unit::UpdateSplinePosition().

◆ m_name

◆ m_notifyflags

uint16 WorldObject::m_notifyflags
private

◆ m_phaseMask

uint32 WorldObject::m_phaseMask
private

Referenced by GetPhaseMask(), and SetPhaseMask().

◆ m_serverSideVisibility

◆ m_serverSideVisibilityDetect

◆ m_stealth

◆ m_stealthDetect

◆ m_transport

◆ m_useCombinedPhases

bool WorldObject::m_useCombinedPhases
private

Referenced by InSamePhase(), and SetPhaseMask().

◆ m_zoneScript


The documentation for this class was generated from the following files: