AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
NullCreatureAI Class Reference

#include "PassiveAI.h"

Inheritance diagram for NullCreatureAI:
CreatureAI UnitAI TriggerAI boss_flame_leviathan_overload_device boss_flame_leviathan_safety_container boss_freya_healthy_spore boss_freya_iron_root boss_freya_lifebinder boss_freya_nature_bomb boss_grobbulus_poison_cloud::boss_grobbulus_poison_cloudAI boss_kologarn_pit_kill_bunny boss_krick::boss_krickAI boss_maexxna_webwrap::boss_maexxna_webwrapAI boss_thorim_pillar boss_thorim_trap boss_yoggsaron_brain boss_yoggsaron_death_orb boss_yoggsaron_death_ray boss_yoggsaron_influence_tentacle boss_yoggsaron_keeper boss_yoggsaron_lich_king boss_yoggsaron_llane boss_yoggsaron_voice npc_algalon_worm_hole npc_amanishi_lookout npc_arthas_teleport_visual::npc_arthas_teleport_visualAI npc_ashtongue_channeler npc_ashtongue_sorcerer npc_attracted_reef_bull::npc_attracted_reef_bullAI npc_balance_of_light_and_shadow::npc_balance_of_light_and_shadowAI npc_bone_spike::npc_bone_spikeAI npc_brew_bubble npc_coldflame::npc_coldflameAI npc_collapsing_star npc_concentrated_ball::npc_concentrated_ballAI npc_crate_helper::npc_crate_helperAI npc_crystal_spike npc_demonic_vapor npc_demonic_vapor_trail npc_expedition_engineer npc_fos_corrupted_soul_fragment npc_four_car_garage::npc_four_car_garageAI npc_freya_ward npc_frost_freeze_trap::npc_frost_freeze_trapAI npc_frost_sphere::npc_frost_sphereAI npc_frost_tomb npc_frozen_orb_stalker::npc_frozen_orb_stalkerAI npc_grand_magister_rommath::npc_grand_magister_rommathAI npc_gunship::npc_gunshipAI npc_halion_controller::npc_halion_controllerAI npc_hallows_end_train_fire npc_hodirs_fury npc_hor_leader::npc_hor_leaderAI npc_hor_leader_second::npc_hor_leader_secondAI npc_hor_lich_king npc_icc_gauntlet_controller::npc_icc_gauntlet_controllerAI npc_icc_putricades_trap::npc_icc_putricades_trapAI npc_ice_tomb::npc_ice_tombAI npc_idol_room_spawner::npc_idol_room_spawnerAI npc_impaling_spear::npc_impaling_spearAI npc_infra_green_bomber_generic::npc_infra_green_bomber_genericAI npc_injured_7th_legion_soldier::npc_injured_7th_legion_soldierAI npc_invisible_tractor_beam_source npc_kalecgos_kj npc_kiljaeden_controller npc_kinetic_bomb::npc_kinetic_bombAI npc_living_poison npc_lk_spirit_bomb::npc_lk_spirit_bombAI npc_love_in_air_snivel npc_madrigosa npc_naxxramas_trigger npc_nerubar_victim npc_nightbane_helper_target npc_orb_carrier::npc_orb_carrierAI npc_pet_darting_hatchling npc_pet_dk_dancing_rune_weapon npc_pet_gen_fetch_ball npc_pet_gen_imp_in_a_bottle npc_pet_gen_moth npc_pet_gen_target_following_bomb npc_pet_gen_wind_rider_cub npc_pilgrims_bounty_plate npc_pool_of_tar npc_pos_after_first_boss::npc_pos_after_first_bossAI npc_pos_collapsing_icicle::npc_pos_collapsing_icicleAI npc_pos_icicle_trigger::npc_pos_icicle_triggerAI npc_pos_leader::npc_pos_leaderAI npc_pos_leader_second::npc_pos_leader_secondAI npc_pos_martin_or_gorkun_second::npc_pos_martin_or_gorkun_secondAI npc_pos_tyrannus_events::npc_pos_tyrannus_eventsAI npc_power_spark npc_q24545_lich_king::npc_q24545_lich_kingAI npc_q24545_vegard_dummy::npc_q24545_vegard_dummyAI npc_ravenclaw_apparition::npc_ravenclaw_apparitionAI npc_razorscale_devouring_flame npc_razorscale_harpoon_fire_state npc_ritual_channeler::npc_ritual_channelerAI npc_shattrath_daily_quest npc_singularity npc_sinkhole_kill_credit::npc_sinkhole_kill_creditAI npc_soh_fire_trigger npc_spiritual_insight::npc_spiritual_insightAI npc_still_at_it_trigger::npc_still_at_it_triggerAI npc_storm_beacon_spawn npc_strangulate_vehicle::npc_strangulate_vehicleAI npc_taldaram_flamesphere npc_thorims_hammer npc_time_rift npc_training_dummy npc_ulduar_bot_summon_trigger npc_ulduar_flames_initial npc_ulduar_flames_spread npc_ulduar_flash_freeze npc_ulduar_icicle npc_ulduar_keeper::npc_ulduar_keeperAI npc_ulduar_mimiron_rocket npc_ulduar_rocket_strike_trigger npc_ulduar_saronite_vapors npc_ulduar_toasty_fire npc_valithria_portal::npc_valithria_portalAI npc_valkyr_shadowguard::npc_valkyr_shadowguardAI npc_vengeful_spirit npc_vh_teleportation_portal npc_vh_void_sentry npc_xt002_heart npc_zafod_boombox::npc_zafod_boomboxAI trigger_periodic::trigger_periodicAI

Public Member Functions

 NullCreatureAI (Creature *c)
 
void MoveInLineOfSight (Unit *) override
 
void AttackStart (Unit *) override
 
void JustStartedThreateningMe (Unit *) override
 
void JustEnteredCombat (Unit *) override
 Called when the unit enters combat.
 
void UpdateAI (uint32) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void EnterEvadeMode (EvadeReason) override
 
void OnCharmed (bool) override
 Called when unit is charmed.
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObject * GetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual bool IsEscortNPC (bool=true) const
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void OnSpellCast (SpellInfo const *)
 
virtual void OnSpellFailed (SpellInfo const *)
 
virtual void OnChannelFinished (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void OnDespawn ()
 Called when the unit is about to be removed from the world (despawn, grid unload, corpse disappearing, player logging out etc.)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast.
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true, int32 aura=0)
 Cast the spell on a random unit from the threat list.
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished.
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Static Public Member Functions

static int32 Permissible (Creature const *creature)
 
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 

Additional Inherited Members

- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES ,
  EVADE_REASON_BOUNDARY ,
  EVADE_REASON_SEQUENCE_BREAK ,
  EVADE_REASON_NO_PATH ,
  EVADE_REASON_OTHER
}
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoType * AISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
Creature * DoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ NullCreatureAI()

NullCreatureAI::NullCreatureAI ( Creature *  c)
explicit
23 : CreatureAI(c)
24{
26 // TODO: Remove once WorldObject spell casting is ported (triggers won't create combat refs from spell casts)
27 if (me->IsTrigger())
29}
@ REACT_PASSIVE
Definition Unit.h:567
Definition CreatureAI.h:69
Creature *const me
Definition CreatureAI.h:71
bool IsTrigger() const
Definition Creature.h:80
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:100
void SetIsCombatDisallowed(bool value)
Definition Unit.h:975

References Creature::IsTrigger(), CreatureAI::me, REACT_PASSIVE, Unit::SetIsCombatDisallowed(), and Creature::SetReactState().

Member Function Documentation

◆ AttackStart()

void NullCreatureAI::AttackStart ( Unit *  )
inlineoverridevirtual

Reimplemented from UnitAI.

61{}

◆ EnterEvadeMode()

void NullCreatureAI::EnterEvadeMode ( EvadeReason  )
inlineoverridevirtual

Reimplemented from CreatureAI.

65{}

◆ JustEnteredCombat()

void NullCreatureAI::JustEnteredCombat ( Unit *  )
inlineoverridevirtual

Called when the unit enters combat.

Note
NOTE: Creature engage logic should NOT be here, but in JustEngagedWith, which happens once threat is established!)
Todo:
Never invoked right now. Preparation for Combat Threat refactor

Reimplemented from CreatureAI.

63{}

◆ JustStartedThreateningMe()

void NullCreatureAI::JustStartedThreateningMe ( Unit *  )
inlineoverridevirtual

Reimplemented from CreatureAI.

62{}

◆ MoveInLineOfSight()

void NullCreatureAI::MoveInLineOfSight ( Unit *  )
inlineoverridevirtual

Reimplemented from CreatureAI.

60{}

◆ OnCharmed()

void NullCreatureAI::OnCharmed ( bool  apply)
inlineoverridevirtual

Called when unit is charmed.

Reimplemented from CreatureAI.

66{}

◆ Permissible()

int32 NullCreatureAI::Permissible ( Creature const *  creature)
static
32{
33 if (creature->HasNpcFlag(UNIT_NPC_FLAG_SPELLCLICK))
34 return PERMIT_BASE_PROACTIVE + 50;
35
36 if (creature->IsTrigger())
38
39 return PERMIT_BASE_IDLE;
40}
@ PERMIT_BASE_PROACTIVE
Definition CreatureAI.h:291
@ PERMIT_BASE_IDLE
Definition CreatureAI.h:289
@ UNIT_NPC_FLAG_SPELLCLICK
Definition UnitDefines.h:346

References Unit::HasNpcFlag(), Creature::IsTrigger(), PERMIT_BASE_IDLE, PERMIT_BASE_PROACTIVE, and UNIT_NPC_FLAG_SPELLCLICK.

◆ UpdateAI()

void NullCreatureAI::UpdateAI ( uint32  )
inlineoverridevirtual

Use to start attacking a target. Called just before JustEngagedWith()

Implements UnitAI.

Reimplemented in trigger_periodic::trigger_periodicAI.

64{}

The documentation for this class was generated from the following files: