AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
GridNotifiers.cpp File Reference
#include "GridNotifiers.h"
#include "Map.h"
#include "ObjectAccessor.h"
#include "SpellInfo.h"
#include "SpellMgr.h"
#include "Transport.h"
#include "UpdateData.h"
#include "WorldPacket.h"

Go to the source code of this file.

Functions

void CreatureUnitRelocationWorker (Creature *c, Unit *u)
 

Function Documentation

◆ CreatureUnitRelocationWorker()

void CreatureUnitRelocationWorker ( Creature c,
Unit u 
)
inline
151{
152 if (!u->IsAlive() || !c->IsAlive() || c == u || u->IsInFlight())
153 {
154 return;
155 }
156
158 {
159 if (c->IsAIEnabled && c->CanSeeOrDetect(u, false, true))
160 {
161 c->AI()->MoveInLineOfSight_Safe(u);
162 }
163 else if (u->GetTypeId() == TYPEID_PLAYER && u->HasStealthAura() && c->IsAIEnabled && c->CanSeeOrDetect(u, false, true, true))
164 {
165 c->AI()->TriggerAlert(u);
166 }
167 }
168}
@ TYPEID_PLAYER
Definition: ObjectGuid.h:38
@ UNIT_STATE_SIGHTLESS
Definition: Unit.h:367
void TriggerAlert(Unit const *who) const
Definition: CreatureAI.cpp:174
void MoveInLineOfSight_Safe(Unit *who)
== Reactions At =================================
Definition: CreatureAI.cpp:146
CreatureAI * AI() const
Definition: Creature.h:136
TypeID GetTypeId() const
Definition: Object.h:121
bool CanSeeOrDetect(WorldObject const *obj, bool ignoreStealth=false, bool distanceCheck=false, bool checkAlert=false) const
Definition: Object.cpp:1726
bool IsAlive() const
Definition: Unit.h:1822
bool HasStealthAura() const
Definition: Unit.h:1720
bool IsInFlight() const
Definition: Unit.h:1690
bool IsAIEnabled
Definition: Unit.h:2364
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1410

References Creature::AI(), WorldObject::CanSeeOrDetect(), Object::GetTypeId(), Unit::HasStealthAura(), Unit::HasUnitState(), Unit::IsAIEnabled, Unit::IsAlive(), Unit::IsInFlight(), CreatureAI::MoveInLineOfSight_Safe(), CreatureAI::TriggerAlert(), TYPEID_PLAYER, and UNIT_STATE_SIGHTLESS.

Referenced by Acore::AIRelocationNotifier::Visit(), and Acore::CreatureRelocationNotifier::Visit().