AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
CreatureAI.cpp File Reference
#include "CreatureAI.h"
#include "AreaBoundary.h"
#include "Creature.h"
#include "CreatureAIImpl.h"
#include "CreatureGroups.h"
#include "CreatureTextMgr.h"
#include "GameObjectAI.h"
#include "Log.h"
#include "MapReference.h"
#include "Player.h"
#include "ScriptMgr.h"
#include "Vehicle.h"
#include "ZoneScript.h"

Go to the source code of this file.

Functions

AISpellInfoTypeGetAISpellInfo (uint32 i)
 
bool IsValidCombatTarget (Creature *source, Player *target)
 

Function Documentation

◆ GetAISpellInfo()

AISpellInfoType * GetAISpellInfo ( uint32  i)
41{ return &CreatureAI::AISpellInfo[i]; }
static AISpellInfoType * AISpellInfo
Definition UnitAI.h:407

References UnitAI::AISpellInfo.

Referenced by CasterAI::InitializeAI(), CasterAI::JustEngagedWith(), and CasterAI::UpdateAI().

◆ IsValidCombatTarget()

bool IsValidCombatTarget ( Creature source,
Player target 
)
inline
77{
78 if (target->IsGameMaster())
79 {
80 return false;
81 }
82
83 if (!source->IsInWorld() || !target->IsInWorld())
84 {
85 return false;
86 }
87
88 if (!source->IsAlive() || !target->IsAlive())
89 {
90 return false;
91 }
92
93 if (!source->InSamePhase(target))
94 {
95 return false;
96 }
97
99 {
100 return false;
101 }
102
103 return true;
104}
@ UNIT_STATE_IN_FLIGHT
Definition UnitDefines.h:178
bool IsInWorld() const
Definition Object.h:107
bool IsGameMaster() const
Definition Player.h:1175
bool IsAlive() const
Definition Unit.h:1707
bool HasUnitState(const uint32 f) const
Definition Unit.h:707
bool InSamePhase(WorldObject const *obj) const
Definition Object.h:452

References Unit::HasUnitState(), WorldObject::InSamePhase(), Unit::IsAlive(), Player::IsGameMaster(), Object::IsInWorld(), and UNIT_STATE_IN_FLIGHT.

Referenced by CreatureAI::DoZoneInCombat().