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
66{
67 if (target->IsGameMaster())
68 {
69 return false;
70 }
71
72 if (!source->IsInWorld() || !target->IsInWorld())
73 {
74 return false;
75 }
76
77 if (!source->IsAlive() || !target->IsAlive())
78 {
79 return false;
80 }
81
82 if (!source->InSamePhase(target))
83 {
84 return false;
85 }
86
88 {
89 return false;
90 }
91
92 return true;
93}
@ UNIT_STATE_IN_FLIGHT
Definition: UnitDefines.h:157
bool IsInWorld() const
Definition: Object.h:104
bool InSamePhase(WorldObject const *obj) const
Definition: Object.h:447
bool IsGameMaster() const
Definition: Player.h:1158
bool IsAlive() const
Definition: Unit.h:1658
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701

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

Referenced by CreatureAI::DoZoneInCombat().