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 "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
150{
151 if (!u->IsAlive() || !c->IsAlive() || c == u || u->IsInFlight())
152 {
153 return;
154 }
155
157 {
158 if (c->IsAIEnabled && c->CanSeeOrDetect(u, false, true))
159 {
160 c->AI()->MoveInLineOfSight_Safe(u);
161 }
162 else if (u->IsPlayer() && u->HasStealthAura() && c->IsAIEnabled && c->CanSeeOrDetect(u, false, true, true))
163 {
164 c->AI()->TriggerAlert(u);
165 }
166 }
167}
@ UNIT_STATE_SIGHTLESS
Definition: UnitDefines.h:192
void TriggerAlert(Unit const *who) const
Definition: CreatureAI.cpp:175
void MoveInLineOfSight_Safe(Unit *who)
== Reactions At =================================
Definition: CreatureAI.cpp:147
CreatureAI * AI() const
Definition: Creature.h:143
bool IsPlayer() const
Definition: Object.h:197
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:1151
bool HasStealthAura() const
Definition: Unit.h:1050
bool IsInFlight() const
Definition: Unit.h:1020
bool IsAIEnabled
Definition: Unit.h:1693
bool HasUnitState(const uint32 f) const
Definition: Unit.h:739

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().