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 "TemporarySummon.h"
#include "Vehicle.h"
#include "ZoneScript.h"
#include <functional>

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)
43{ return &CreatureAI::AISpellInfo[i]; }
static AISpellInfoType * AISpellInfo
Definition UnitAI.h:405

References UnitAI::AISpellInfo.

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

◆ IsValidCombatTarget()

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

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

Referenced by CreatureAI::DoZoneInCombat().