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

References UnitAI::AISpellInfo.

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

◆ IsValidCombatTarget()

bool IsValidCombatTarget ( Creature source,
Player target 
)
inline
84{
85 if (target->IsGameMaster())
86 return false;
87
88 if (!source->IsInWorld() || !target->IsInWorld())
89 return false;
90
91 if (!source->IsAlive() || !target->IsAlive())
92 return false;
93
94 if (!source->InSamePhase(target))
95 return false;
96
97 if (source->IsInFlight() || target->IsInFlight())
98 return false;
99
100 return true;
101}
bool IsInWorld() const
Definition Object.h:108
bool IsGameMaster() const
Definition Player.h:1161
bool IsAlive() const
Definition Unit.h:1773
bool IsInFlight() const
Definition Unit.h:1685
bool InSamePhase(WorldObject const *obj) const
Definition Object.h:513

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

Referenced by CreatureAI::DoZoneInCombat().