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

References UnitAI::AISpellInfo.

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

◆ IsValidCombatTarget()

bool IsValidCombatTarget ( Creature source,
Player target 
)
inline
65{
66 if (target->IsGameMaster())
67 {
68 return false;
69 }
70
71 if (!source->IsInWorld() || !target->IsInWorld())
72 {
73 return false;
74 }
75
76 if (!source->IsAlive() || !target->IsAlive())
77 {
78 return false;
79 }
80
81 if (!source->InSamePhase(target))
82 {
83 return false;
84 }
85
87 {
88 return false;
89 }
90
91 return true;
92}
@ UNIT_STATE_IN_FLIGHT
Definition: Unit.h:333
bool IsInWorld() const
Definition: Object.h:101
bool InSamePhase(WorldObject const *obj) const
Definition: Object.h:435
bool IsGameMaster() const
Definition: Player.h:1148
bool IsAlive() const
Definition: Unit.h:1822
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1410

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

Referenced by CreatureAI::DoZoneInCombat().