AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
CreatureAIImpl.h File Reference
#include "Define.h"
#include "TemporarySummon.h"

Go to the source code of this file.

Classes

struct  AISpellInfoType
 

Macros

#define AI_DEFAULT_COOLDOWN   5000
 

Enumerations

enum  AITarget {
  AITARGET_SELF ,
  AITARGET_VICTIM ,
  AITARGET_ENEMY ,
  AITARGET_ALLY ,
  AITARGET_BUFF ,
  AITARGET_DEBUFF
}
 
enum  AICondition {
  AICOND_AGGRO ,
  AICOND_COMBAT ,
  AICOND_DIE
}
 

Functions

template<typename First , typename Second , typename... Rest>
static First const & RAND (First const &first, Second const &second, Rest const &... rest)
 
AISpellInfoTypeGetAISpellInfo (uint32 i)
 
bool InstanceHasScript (WorldObject const *obj, char const *scriptName)
 
template<class AI , class T >
AI * GetInstanceAI (T *obj, char const *scriptName)
 

Macro Definition Documentation

◆ AI_DEFAULT_COOLDOWN

#define AI_DEFAULT_COOLDOWN   5000

Enumeration Type Documentation

◆ AICondition

Enumerator
AICOND_AGGRO 
AICOND_COMBAT 
AICOND_DIE 
42{
46};
@ AICOND_COMBAT
Definition: CreatureAIImpl.h:44
@ AICOND_AGGRO
Definition: CreatureAIImpl.h:43
@ AICOND_DIE
Definition: CreatureAIImpl.h:45

◆ AITarget

enum AITarget
Enumerator
AITARGET_SELF 
AITARGET_VICTIM 
AITARGET_ENEMY 
AITARGET_ALLY 
AITARGET_BUFF 
AITARGET_DEBUFF 
32{
39};
@ AITARGET_ALLY
Definition: CreatureAIImpl.h:36
@ AITARGET_BUFF
Definition: CreatureAIImpl.h:37
@ AITARGET_SELF
Definition: CreatureAIImpl.h:33
@ AITARGET_VICTIM
Definition: CreatureAIImpl.h:34
@ AITARGET_ENEMY
Definition: CreatureAIImpl.h:35
@ AITARGET_DEBUFF
Definition: CreatureAIImpl.h:38

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().

◆ GetInstanceAI()

template<class AI , class T >
AI * GetInstanceAI ( T *  obj,
char const *  scriptName 
)
inline
67{
68 return InstanceHasScript(obj, scriptName) ? new AI(obj) : nullptr;
69}
bool InstanceHasScript(WorldObject const *obj, char const *scriptName)
Definition: InstanceScript.cpp:842

References InstanceHasScript().

◆ InstanceHasScript()

bool InstanceHasScript ( WorldObject const *  obj,
char const *  scriptName 
)
843{
844 if (InstanceMap* instance = obj->GetMap()->ToInstanceMap())
845 {
846 return instance->GetScriptName() == scriptName;
847 }
848
849 return false;
850}
InstanceMap * ToInstanceMap()
Definition: Map.h:544
Definition: Map.h:817

References WorldObject::GetMap(), and Map::ToInstanceMap().

Referenced by GetInstanceAI().

◆ RAND()

template<typename First , typename Second , typename... Rest>
static First const & RAND ( First const &  first,
Second const &  second,
Rest const &...  rest 
)
inlinestatic
26{
27 std::reference_wrapper<typename std::add_const<First>::type> const pack[] = { first, second, rest... };
28 return pack[urand(0, sizeof...(rest) + 1)].get();
29}
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44

References urand().

Referenced by boss_gathios_the_shatterer::boss_gathios_the_shatterer(), npc_anubisath_guardian::DamageTaken(), boss_lady_deathwhisper::boss_lady_deathwhisperAI::EmpowerCultist(), PartyTimeEmoteEvent::Execute(), npc_simon_bunny::npc_simon_bunnyAI::GenerateColorSequence(), go_wind_stone::go_wind_stoneAI::GossipSelect(), spell_cataclysm_breath::HandleAfterCast(), spell_voodoo::HandleDummy(), spell_dred_raptor_call::HandleDummy(), spell_item_deviate_fish::HandleDummy(), spell_item_vanquished_clutches::HandleDummy(), Unit::HandleDummyAuraProc(), spell_item_party_time::HandleEffectApply(), spell_q10930_big_bone_worm_aura::HandleEffectRemove(), spell_q10929_fumping_aura::HandleEffectRemove(), spell_halion_meteor_strike_spread_aura::HandlePeriodic(), spell_q10923_evil_draws_near_periodic_aura::HandlePeriodic(), spell_gen_brood_power::HandleScript(), spell_apothecary_validate_area::HandleScript(), spell_winter_veil_mistletoe::HandleScript(), spell_ayamiss_swarmer_start_loop::HandleScript(), spell_q13011_bear_flank_master::HandleScript(), spell_lady_vashj_summon_sporebat::HandleScriptEffect(), spell_dtk_summon_random_drakkari::HandleScriptEffect(), spell_q14112_14145_chum_the_water::HandleScriptEffect(), boss_moroes::InitializeGuests(), npc_anubisath_guardian::JustEngagedWith(), boss_nexusprince_shaffar::JustEngagedWith(), boss_mekgineer_steamrigger::JustEngagedWith(), boss_high_botanist_freywinn::JustEngagedWith(), boss_mechano_lord_capacitus::JustEngagedWith(), boss_curator::JustEngagedWith(), boss_kalecgos::JustEngagedWith(), boss_prince_valanar_icc::boss_prince_valanarAI::JustEngagedWith(), boss_mother_shahraz::JustEngagedWith(), boss_alar::JustEngagedWith(), npc_aged_dying_ancient_kodo::npc_aged_dying_ancient_kodoAI::JustRespawned(), npc_medivh_bm::JustSummoned(), npc_anubisath_guardian::npc_anubisath_guardian(), npc_vh_teleportation_portal::npc_vh_teleportation_portalAI::npc_vh_teleportation_portalAI(), spell_item_ashbringer::OnDummyEffect(), spell_love_is_in_the_air_romantic_picnic::OnPeriodic(), boss_thekal::Reset(), npc_zealot_lorkhan::Reset(), npc_zealot_zath::Reset(), npc_anub_ar_crusher::npc_anub_ar_crusherAI::Reset(), npc_violet_hold_defense_system::Reset(), boss_the_lurker_below::SchedulerPhaseOne(), boss_ayamiss::ScheduleTasks(), boss_gathios_the_shatterer::SelectCouncilMember(), instance_icecrown_citadel::instance_icecrown_citadel_InstanceMapScript::SetBossState(), npc_cameron::SoundPicker(), pyrewood_ambush::pyrewood_ambushAI::SummonCreatureWithRandomTarget(), spell_mother_shahraz_random_periodic_aura::Update(), boss_chromaggus::boss_chromaggusAI::UpdateAI(), npc_time_rift::UpdateAI(), npc_toc_enh_shaman::npc_toc_enh_shamanAI::UpdateAI(), boss_novos::boss_novosAI::UpdateAI(), boss_kelthuzad::boss_kelthuzadAI::UpdateAI(), boss_mimiron::boss_mimironAI::UpdateAI(), npc_ulduar_aerial_command_unit::npc_ulduar_aerial_command_unitAI::UpdateAI(), boss_yoggsaron_sara::boss_yoggsaron_saraAI::UpdateAI(), boss_xevozz::boss_xevozzAI::UpdateAI(), npc_vh_teleportation_portal::npc_vh_teleportation_portalAI::UpdateAI(), npc_violet_hold_defense_system::UpdateAI(), npc_millhouse_manastorm::npc_millhouse_manastormAI::UpdateAI(), npc_warden_mellichar::npc_warden_mellicharAI::UpdateAI(), npc_pet_hunter_snake_trap::UpdateAI(), and boss_yoggsaron_corruptor_tentacle::boss_yoggsaron_corruptor_tentacleAI::UpdateAI().