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 "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
149{
150 if (!u->IsAlive() || !c->IsAlive() || c == u || u->IsInFlight())
151 {
152 return;
153 }
154
156 {
157 if (c->IsAIEnabled && c->CanSeeOrDetect(u, false, true))
158 {
159 c->AI()->MoveInLineOfSight_Safe(u);
160 }
161 else if (u->IsPlayer() && u->HasStealthAura() && c->IsAIEnabled && c->CanSeeOrDetect(u, false, true, true))
162 {
163 c->AI()->TriggerAlert(u);
164 }
165 }
166}
@ UNIT_STATE_SIGHTLESS
Definition: UnitDefines.h:192
void TriggerAlert(Unit const *who) const
Definition: CreatureAI.cpp:186
void MoveInLineOfSight_Safe(Unit *who)
== Reactions At =================================
Definition: CreatureAI.cpp:158
CreatureAI * AI() const
Definition: Creature.h:140
bool IsPlayer() const
Definition: Object.h:200
bool CanSeeOrDetect(WorldObject const *obj, bool ignoreStealth=false, bool distanceCheck=false, bool checkAlert=false) const
Definition: Object.cpp:1737
bool IsAlive() const
Definition: Unit.h:1654
bool HasStealthAura() const
Definition: Unit.h:1702
bool IsInFlight() const
Definition: Unit.h:1572
bool IsAIEnabled
Definition: Unit.h:1962
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701

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

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