AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_escortAI Struct Referenceabstract

#include "ScriptedEscortAI.h"

Inheritance diagram for npc_escortAI:
ScriptedAI CreatureAI UnitAI boss_bjarngrim boss_grand_champion::boss_grand_championAI boss_thorim_lightning_orb boss_thorim_sif_blizzard boss_yoggsaron_cloud brann_bronzebeard::brann_bronzebeardAI npc_ame::npc_ameAI npc_ancestral_wolf::npc_ancestral_wolfAI npc_apothecary_hanes::npc_Apothecary_HanesAI npc_argent_soldier::npc_argent_soldierAI npc_arthas::npc_arthasAI npc_azure_saboteur npc_barnes::npc_barnesAI npc_bessy::npc_bessyAI npc_black_knight_skeletal_gryphon::npc_black_knight_skeletal_gryphonAI npc_bonker_togglevolt::npc_bonker_togglevoltAI npc_captain_saeed::npc_captain_saeedAI npc_clintar_spirit::npc_clintar_spiritAI npc_cork_gizelton::npc_cork_gizeltonAI npc_corporal_keeshan::npc_corporal_keeshanAI npc_crok_scourgebane::npc_crok_scourgebaneAI npc_custodian_of_time::npc_custodian_of_timeAI npc_daphne_stilwell::npc_daphne_stilwellAI npc_deathstalker_erland::npc_deathstalker_erlandAI npc_emily::npc_emilyAI npc_engineer_helice::npc_engineer_heliceAI npc_frosthound npc_garments_of_quests::npc_garments_of_questsAI npc_general_andorov npc_gilthares::npc_giltharesAI npc_grimstone npc_isla_starmane::npc_isla_starmaneAI npc_kaya_flathoof::npc_kaya_flathoofAI npc_kservant::npc_kservantAI npc_kurenai_captive::npc_kurenai_captiveAI npc_lakota_windsong::npc_lakota_windsongAI npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI npc_lurgglbr::npc_lurgglbrAI npc_maghar_captive::npc_maghar_captiveAI npc_magwin::npc_magwinAI npc_maxx_a_million_escort::npc_maxx_a_million_escortAI npc_mimirons_inferno npc_mootoo_the_younger::npc_mootoo_the_youngerAI npc_muglash::npc_muglashAI npc_onyx_flamecaller::npc_onyx_flamecallerAI npc_paoka_swiftmountain::npc_paoka_swiftmountainAI npc_plaguehound_tracker::npc_plaguehound_trackerAI npc_professor_phizzlethorpe::npc_professor_phizzlethorpeAI npc_prospector_remtravel::npc_prospector_remtravelAI npc_ranger_lilatha npc_ranshalla::npc_ranshallaAI npc_rinji::npc_rinjiAI npc_rocknot npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI npc_taretha::npc_tarethaAI npc_thrall_bfu::npc_thrall_bfuAI npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI npc_tyrion_spybot::npc_tyrion_spybotAI npc_varian_wrynn::npc_varian_wrynnAI npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI npc_wounded_blood_elf::npc_wounded_blood_elfAI violet_hold_trashAI

Public Member Functions

 npc_escortAI (Creature *creature)
 
 ~npc_escortAI () override
 
void AttackStart (Unit *who) override
 
void MoveInLineOfSight (Unit *who) override
 
void JustDied (Unit *) override
 
void JustRespawned () override
 
bool IsEscortNPC (bool=true) const override
 
void ReturnToLastPoint ()
 
void EnterEvadeMode (EvadeReason=EVADE_REASON_OTHER) override
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
virtual void UpdateEscortAI (uint32 diff)
 
void MovementInform (uint32, uint32) override
 
void AddWaypoint (uint32 id, float x, float y, float z, uint32 waitTime=0)
 
bool SetNextWaypoint (uint32 pointId, float x, float y, float z, float orientation)
 
bool SetNextWaypoint (uint32 pointId, bool setPosition=true)
 
bool GetWaypointPosition (uint32 pointId, float &x, float &y, float &z)
 
void GenerateWaypointArray (Movement::PointsArray *points)
 
virtual void WaypointReached (uint32 pointId)=0
 
virtual void WaypointStart (uint32)
 
void Start (bool isActiveAttacker=true, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
 
void SetEscortPaused (bool on)
 
bool HasEscortState (uint32 escortState)
 
bool IsEscorted () override
 
void SetMaxPlayerDistance (float newMax)
 
float GetMaxPlayerDistance ()
 
void SetDespawnAtEnd (bool despawn)
 
void SetDespawnAtFar (bool despawn)
 
bool GetAttack ()
 
void SetCanAttack (bool attack)
 
ObjectGuid GetEventStarterGUID ()
 
void AddEscortState (uint32 escortState)
 
void RemoveEscortState (uint32 escortState)
 
virtual void WaypointReached (uint32, uint32)
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- 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)
 
WorldObjectGetSummoner () 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 ()
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
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 void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
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 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
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (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 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 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)
 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
 

Protected Member Functions

PlayerGetPlayerForEscort ()
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (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)
 

Private Member Functions

bool AssistPlayerInCombatAgainst (Unit *who)
 
bool IsPlayerOrGroupInRange ()
 
void FillPointMovementListForCreature ()
 

Private Attributes

ObjectGuid m_uiPlayerGUID
 
uint32 m_uiWPWaitTimer
 
uint32 m_uiPlayerCheckTimer
 
uint32 m_uiEscortState
 
float MaxPlayerDistance
 
Quest const * m_pQuestForEscort
 
std::list< Escort_WaypointWaypointList
 
std::list< Escort_Waypoint >::iterator CurrentWP
 
bool m_bIsActiveAttacker
 
bool m_bCanInstantRespawn
 
bool m_bCanReturnToStart
 
bool DespawnAtEnd
 
bool DespawnAtFar
 
bool ScriptWP
 
bool HasImmuneToNPCFlags
 

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
  AXIS_Y
}
 
- 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 Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- 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

◆ npc_escortAI()

npc_escortAI::npc_escortAI ( Creature creature)
explicit
29 : ScriptedAI(creature),
30 m_uiWPWaitTimer(1000),
34 m_pQuestForEscort(nullptr),
38 DespawnAtEnd(true),
39 DespawnAtFar(true),
40 ScriptWP(false),
42{}
#define DEFAULT_MAX_PLAYER_DISTANCE
Definition ScriptedEscortAI.h:24
@ STATE_ESCORT_NONE
Definition ScriptedEscortAI.h:46
Definition ScriptedCreature.h:191
float MaxPlayerDistance
Definition ScriptedEscortAI.h:129
bool m_bCanReturnToStart
Definition ScriptedEscortAI.h:138
uint32 m_uiPlayerCheckTimer
Definition ScriptedEscortAI.h:127
uint32 m_uiEscortState
Definition ScriptedEscortAI.h:128
bool DespawnAtFar
Definition ScriptedEscortAI.h:140
bool m_bIsActiveAttacker
Definition ScriptedEscortAI.h:136
uint32 m_uiWPWaitTimer
Definition ScriptedEscortAI.h:126
bool ScriptWP
Definition ScriptedEscortAI.h:141
bool m_bCanInstantRespawn
Definition ScriptedEscortAI.h:137
bool DespawnAtEnd
Definition ScriptedEscortAI.h:139
bool HasImmuneToNPCFlags
Definition ScriptedEscortAI.h:142
Quest const * m_pQuestForEscort
Definition ScriptedEscortAI.h:131

◆ ~npc_escortAI()

npc_escortAI::~npc_escortAI ( )
inlineoverride
56{}

Member Function Documentation

◆ AddEscortState()

◆ AddWaypoint()

void npc_escortAI::AddWaypoint ( uint32  id,
float  x,
float  y,
float  z,
uint32  waitTime = 0 
)
396{
397 Escort_Waypoint t(id, x, y, z, waitTime);
398
399 WaypointList.push_back(t);
400
401 // i think SD2 no longer uses this function
402 ScriptWP = true;
403 /*PointMovement wp;
404 wp.m_uiCreatureEntry = me->GetEntry();
405 wp.m_uiPointId = id;
406 wp.m_fX = x;
407 wp.m_fY = y;
408 wp.m_fZ = z;
409 wp.m_uiWaitTime = WaitTimeMs;
410 PointMovementMap[wp.m_uiCreatureEntry].push_back(wp);*/
411}
Definition ScriptedEscortAI.h:27
std::list< Escort_Waypoint > WaypointList
Definition ScriptedEscortAI.h:133

References ScriptWP, and WaypointList.

Referenced by npc_onyx_flamecaller::npc_onyx_flamecallerAI::AddWaypoints(), boss_bjarngrim::InitializeWaypoints(), boss_thorim_lightning_orb::InitWaypoint(), boss_thorim_sif_blizzard::InitWaypoint(), boss_yoggsaron_cloud::InitWaypoint(), boss_grand_champion::boss_grand_championAI::SetData(), npc_argent_soldier::npc_argent_soldierAI::SetData(), npc_clintar_spirit::npc_clintar_spiritAI::StartEvent(), violet_hold_trashAI::UpdateAI(), and npc_azure_saboteur::UpdateAI().

◆ AssistPlayerInCombatAgainst()

bool npc_escortAI::AssistPlayerInCombatAgainst ( Unit who)
private
66{
67 if (!who || !who->GetVictim())
68 {
69 return false;
70 }
71
73 {
74 return false;
75 }
76
77 //experimental (unknown) flag not present
79 {
80 return false;
81 }
82
83 //not a player
85 {
86 return false;
87 }
88
89 if (!who->isInAccessiblePlaceFor(me))
90 {
91 return false;
92 }
93
94 if (!CanAIAttack(who))
95 {
96 return false;
97 }
98
99 // we cannot attack in evade mode
100 if (me->IsInEvadeMode())
101 {
102 return false;
103 }
104
105 // or if enemy is in evade mode
106 if (who->IsCreature() && who->ToCreature()->IsInEvadeMode())
107 {
108 return false;
109 }
110
111 //never attack friendly
112 if (!me->IsValidAttackTarget(who))
113 {
114 return false;
115 }
116
117 //too far away and no free sight?
119 {
120 AttackStart(who);
121 return true;
122 }
123
124 return false;
125}
@ CREATURE_TYPE_FLAG_CAN_ASSIST
Definition SharedDefines.h:2701
@ REACT_PASSIVE
Definition Unit.h:566
bool HasReactState(ReactStates state) const
Definition Creature.h:102
CreatureTemplate const * GetCreatureTemplate() const
Definition Creature.h:207
bool IsInEvadeMode() const
Definition Creature.h:138
bool IsCreature() const
Definition Object.h:205
Creature * ToCreature()
Definition Object.h:206
virtual bool CanAIAttack(Unit const *) const
Definition UnitAI.h:205
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
Definition Unit.cpp:7715
bool isInAccessiblePlaceFor(Creature const *c) const
Definition Unit.cpp:4389
Unit * GetVictim() const
Definition Unit.h:903
bool IsValidAttackTarget(Unit const *target, SpellInfo const *bySpell=nullptr) const
Definition Unit.cpp:10731
bool IsWithinLOSInMap(WorldObject const *obj, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
Definition Object.cpp:1403
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition Object.cpp:1377
uint32 type_flags
Definition CreatureData.h:219
Creature * me
Definition ScriptedCreature.h:281
float GetMaxPlayerDistance()
Definition ScriptedEscortAI.h:106
void AttackStart(Unit *who) override
Definition ScriptedEscortAI.cpp:44

References AttackStart(), UnitAI::CanAIAttack(), CREATURE_TYPE_FLAG_CAN_ASSIST, Unit::GetCharmerOrOwnerPlayerOrPlayerItself(), Creature::GetCreatureTemplate(), GetMaxPlayerDistance(), Unit::GetVictim(), Creature::HasReactState(), Object::IsCreature(), Unit::isInAccessiblePlaceFor(), Creature::IsInEvadeMode(), Unit::IsValidAttackTarget(), WorldObject::IsWithinDistInMap(), WorldObject::IsWithinLOSInMap(), ScriptedAI::me, REACT_PASSIVE, Object::ToCreature(), and CreatureTemplate::type_flags.

Referenced by MoveInLineOfSight().

◆ AttackStart()

void npc_escortAI::AttackStart ( Unit who)
overridevirtual

Reimplemented from UnitAI.

Reimplemented in npc_taretha::npc_tarethaAI, npc_mimirons_inferno, npc_frosthound, and violet_hold_trashAI.

45{
46 if (!who)
47 return;
48
49 if (me->Attack(who, true))
50 {
52 if (type == ESCORT_MOTION_TYPE || type == POINT_MOTION_TYPE)
53 {
55 //me->DisableSpline();
56 me->StopMoving();
57 }
58
61 }
62}
@ MOTION_SLOT_ACTIVE
Definition MotionMaster.h:65
MovementGeneratorType
Definition MotionMaster.h:38
@ ESCORT_MOTION_TYPE
Definition MotionMaster.h:57
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
bool IsCombatMovementAllowed() const
Definition Creature.h:452
MovementGeneratorType GetMotionSlotType(int slot) const
Definition MotionMaster.cpp:969
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Force the unit to chase this target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:315
void MovementExpired(bool reset=true)
Definition MotionMaster.h:206
MotionMaster * GetMotionMaster()
Definition Unit.h:1759
void StopMoving()
Definition Unit.cpp:13023
bool Attack(Unit *victim, bool meleeAttack)
Definition Unit.cpp:7289

References Unit::Attack(), ESCORT_MOTION_TYPE, Unit::GetMotionMaster(), MotionMaster::GetMotionSlotType(), Creature::IsCombatMovementAllowed(), ScriptedAI::me, MOTION_SLOT_ACTIVE, MotionMaster::MoveChase(), MotionMaster::MovementExpired(), POINT_MOTION_TYPE, and Unit::StopMoving().

Referenced by AssistPlayerInCombatAgainst(), npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI::AttackedBy(), npc_clintar_spirit::npc_clintar_spiritAI::EnterEvadeMode(), MoveInLineOfSight(), npc_general_andorov::MoveInLineOfSight(), npc_captain_saeed::npc_captain_saeedAI::MoveInLineOfSight(), boss_grand_champion::boss_grand_championAI::MovementInform(), npc_arthas::npc_arthasAI::UpdateAI(), npc_clintar_spirit::npc_clintar_spiritAI::UpdateAI(), boss_grand_champion::boss_grand_championAI::UpdateAI(), npc_captain_saeed::npc_captain_saeedAI::UpdateAI(), npc_ranger_lilatha::WaypointReached(), and npc_cork_gizelton::npc_cork_gizeltonAI::WaypointReached().

◆ EnterEvadeMode()

void npc_escortAI::EnterEvadeMode ( EvadeReason  = EVADE_REASON_OTHER)
overridevirtual

Reimplemented from CreatureAI.

Reimplemented in npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, npc_varian_wrynn::npc_varian_wrynnAI, npc_thrall_bfu::npc_thrall_bfuAI, npc_onyx_flamecaller::npc_onyx_flamecallerAI, violet_hold_trashAI, and npc_frosthound.

202{
204 me->CombatStop(true);
205 me->SetLootRecipient(nullptr);
206
208 {
211 LOG_DEBUG("scripts.ai", "EscortAI has left combat and is now returning to last point");
212 }
213 else
214 {
217 me->SetImmuneToNPC(true);
218 Reset();
219 }
220}
#define LOG_DEBUG(filterType__,...)
Definition Log.h:157
@ STATE_ESCORT_ESCORTING
Definition ScriptedEscortAI.h:47
@ STATE_ESCORT_RETURNING
Definition ScriptedEscortAI.h:48
void SetLootRecipient(Unit *unit, bool withGroup=true)
Definition Creature.cpp:1307
void MoveTargetedHome(bool walk=false)
The unit will return this initial position (owner for pets and summoned creatures)....
Definition MotionMaster.cpp:261
void ClearAllThreat()
Definition ThreatManager.cpp:580
void SetImmuneToNPC(bool apply, bool keepCombat=false)
Definition Unit.cpp:10644
ThreatManager & GetThreatMgr()
Definition Unit.h:951
void CombatStop(bool includingCast=false, bool mutualPvP=true)
Definition Unit.cpp:7486
void Reset() override
Definition ScriptedCreature.h:288
bool HasEscortState(uint32 escortState)
Definition ScriptedEscortAI.h:102
void AddEscortState(uint32 escortState)
Definition ScriptedEscortAI.h:114
void ReturnToLastPoint()
Definition ScriptedEscortAI.cpp:185

References AddEscortState(), ThreatManager::ClearAllThreat(), Unit::CombatStop(), Unit::GetMotionMaster(), Unit::GetThreatMgr(), HasEscortState(), HasImmuneToNPCFlags, LOG_DEBUG, ScriptedAI::me, MotionMaster::MoveTargetedHome(), ScriptedAI::Reset(), ReturnToLastPoint(), Unit::SetImmuneToNPC(), Creature::SetLootRecipient(), STATE_ESCORT_ESCORTING, and STATE_ESCORT_RETURNING.

Referenced by npc_arthas::npc_arthasAI::DoAction(), npc_cork_gizelton::npc_cork_gizeltonAI::EnterEvadeMode(), npc_clintar_spirit::npc_clintar_spiritAI::EnterEvadeMode(), npc_captain_saeed::npc_captain_saeedAI::EnterEvadeMode(), and JustExitedCombat().

◆ FillPointMovementListForCreature()

void npc_escortAI::FillPointMovementListForCreature ( )
private
414{
415 ScriptPointVector const& movePoints = sScriptSystemMgr->GetPointMoveList(me->GetEntry());
416 if (movePoints.empty())
417 return;
418
419 ScriptPointVector::const_iterator itrEnd = movePoints.end();
420 for (ScriptPointVector::const_iterator itr = movePoints.begin(); itr != itrEnd; ++itr)
421 {
422 Escort_Waypoint point(itr->uiPointId, itr->fX, itr->fY, itr->fZ, itr->uiWaitTime);
423 WaypointList.push_back(point);
424 }
425}
#define sScriptSystemMgr
Definition ScriptSystem.h:91
std::vector< ScriptPointMove > ScriptPointVector
Definition ScriptSystem.h:59
uint32 GetEntry() const
Definition Object.h:117

References Object::GetEntry(), ScriptedAI::me, sScriptSystemMgr, and WaypointList.

Referenced by SetNextWaypoint(), and Start().

◆ GenerateWaypointArray()

void npc_escortAI::GenerateWaypointArray ( Movement::PointsArray points)
557{
558 if (WaypointList.empty())
559 return;
560
561 // Flying unit, just fill array
563 {
564 // xinef: first point in vector is unit real position
565 points->clear();
566 points->push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
567 for (std::list<Escort_Waypoint>::const_iterator itr = CurrentWP; itr != WaypointList.end(); ++itr)
568 points->push_back(G3D::Vector3(itr->x, itr->y, itr->z));
569 }
570 else
571 {
572 uint32 remainingWaypoints = std::distance(CurrentWP, WaypointList.end());
573 for (float size = 1.0f; size; size *= 0.5f)
574 {
575 std::vector<G3D::Vector3> pVector;
576 // xinef: first point in vector is unit real position
577 pVector.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
578 uint32 length = remainingWaypoints * size;
579
580 uint32 cnt = 0;
581 for (std::list<Escort_Waypoint>::const_iterator itr = CurrentWP; itr != WaypointList.end() && cnt <= length; ++itr, ++cnt)
582 pVector.push_back(G3D::Vector3(itr->x, itr->y, itr->z));
583
584 if (pVector.size() > 2) // more than source + dest
585 {
586 G3D::Vector3 middle = (pVector[0] + pVector[pVector.size() - 1]) / 2.f;
587 G3D::Vector3 offset;
588
589 bool continueLoop = false;
590 for (uint32 i = 1; i < pVector.size() - 1; ++i)
591 {
592 offset = middle - pVector[i];
593 if (std::fabs(offset.x) >= 0xFF || std::fabs(offset.y) >= 0xFF || std::fabs(offset.z) >= 0x7F)
594 {
595 // offset is too big, split points
596 continueLoop = true;
597 break;
598 }
599 }
600 if (continueLoop)
601 continue;
602 }
603 // everything ok
604 *points = pVector;
605 break;
606 }
607 }
608}
std::uint32_t uint32
Definition Define.h:107
MovementFlags
Definition UnitDefines.h:370
@ MOVEMENTFLAG_DISABLE_GRAVITY
Definition UnitDefines.h:382
@ MOVEMENTFLAG_CAN_FLY
Definition UnitDefines.h:396
MovementInfo m_movementInfo
Definition Object.h:698
bool HasMovementFlag(uint32 flag) const
Definition Object.h:346
float GetPositionZ() const
Definition Position.h:123
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
std::list< Escort_Waypoint >::iterator CurrentWP
Definition ScriptedEscortAI.h:134

References CurrentWP, Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), MovementInfo::HasMovementFlag(), WorldObject::m_movementInfo, ScriptedAI::me, MOVEMENTFLAG_CAN_FLY, MOVEMENTFLAG_DISABLE_GRAVITY, and WaypointList.

Referenced by UpdateAI().

◆ GetAttack()

bool npc_escortAI::GetAttack ( )
inline

◆ GetEventStarterGUID()

ObjectGuid npc_escortAI::GetEventStarterGUID ( )
inline
112{ return m_uiPlayerGUID; }
ObjectGuid m_uiPlayerGUID
Definition ScriptedEscortAI.h:125

References m_uiPlayerGUID.

◆ GetMaxPlayerDistance()

float npc_escortAI::GetMaxPlayerDistance ( )
inline

◆ GetPlayerForEscort()

Player * npc_escortAI::GetPlayerForEscort ( )
inlineprotected
Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:220

References ObjectAccessor::GetPlayer(), m_uiPlayerGUID, and ScriptedAI::me.

Referenced by npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI::DamageTaken(), IsPlayerOrGroupInRange(), npc_ranshalla::npc_ranshallaAI::JustDidDialogueStep(), JustDied(), npc_muglash::npc_muglashAI::JustDied(), npc_ame::npc_ameAI::JustDied(), npc_mootoo_the_younger::npc_mootoo_the_youngerAI::JustDied(), npc_bonker_togglevolt::npc_bonker_togglevoltAI::JustDied(), npc_apothecary_hanes::npc_Apothecary_HanesAI::JustDied(), npc_engineer_helice::npc_engineer_heliceAI::JustDied(), npc_maghar_captive::npc_maghar_captiveAI::JustDied(), npc_kurenai_captive::npc_kurenai_captiveAI::JustDied(), npc_captain_saeed::npc_captain_saeedAI::JustDied(), npc_bessy::npc_bessyAI::JustDied(), npc_maxx_a_million_escort::npc_maxx_a_million_escortAI::JustDied(), npc_isla_starmane::npc_isla_starmaneAI::JustDied(), npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI::JustEngagedWith(), npc_muglash::npc_muglashAI::JustEngagedWith(), npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI::JustSummoned(), npc_captain_saeed::npc_captain_saeedAI::MoveInLineOfSight(), npc_daphne_stilwell::npc_daphne_stilwellAI::SummonedCreatureDies(), npc_varian_wrynn::npc_varian_wrynnAI::UpdateAI(), npc_lurgglbr::npc_lurgglbrAI::UpdateAI(), npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI::UpdateAI(), npc_tyrion_spybot::npc_tyrion_spybotAI::UpdateAI(), npc_rinji::npc_rinjiAI::UpdateEscortAI(), npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI::UpdateEscortAI(), npc_captain_saeed::npc_captain_saeedAI::WaypointReached(), npc_professor_phizzlethorpe::npc_professor_phizzlethorpeAI::WaypointReached(), npc_ranger_lilatha::WaypointReached(), npc_rinji::npc_rinjiAI::WaypointReached(), npc_corporal_keeshan::npc_corporal_keeshanAI::WaypointReached(), npc_deathstalker_erland::npc_deathstalker_erlandAI::WaypointReached(), npc_varian_wrynn::npc_varian_wrynnAI::WaypointReached(), npc_daphne_stilwell::npc_daphne_stilwellAI::WaypointReached(), npc_muglash::npc_muglashAI::WaypointReached(), npc_magwin::npc_magwinAI::WaypointReached(), npc_prospector_remtravel::npc_prospector_remtravelAI::WaypointReached(), npc_kaya_flathoof::npc_kaya_flathoofAI::WaypointReached(), npc_custodian_of_time::npc_custodian_of_timeAI::WaypointReached(), npc_gilthares::npc_giltharesAI::WaypointReached(), npc_lakota_windsong::npc_lakota_windsongAI::WaypointReached(), npc_paoka_swiftmountain::npc_paoka_swiftmountainAI::WaypointReached(), npc_ame::npc_ameAI::WaypointReached(), npc_mootoo_the_younger::npc_mootoo_the_youngerAI::WaypointReached(), npc_bonker_togglevolt::npc_bonker_togglevoltAI::WaypointReached(), npc_emily::npc_emilyAI::WaypointReached(), npc_apothecary_hanes::npc_Apothecary_HanesAI::WaypointReached(), npc_engineer_helice::npc_engineer_heliceAI::WaypointReached(), npc_frosthound::WaypointReached(), npc_wounded_blood_elf::npc_wounded_blood_elfAI::WaypointReached(), npc_maghar_captive::npc_maghar_captiveAI::WaypointReached(), npc_kurenai_captive::npc_kurenai_captiveAI::WaypointReached(), npc_bessy::npc_bessyAI::WaypointReached(), npc_maxx_a_million_escort::npc_maxx_a_million_escortAI::WaypointReached(), npc_kservant::npc_kservantAI::WaypointReached(), npc_isla_starmane::npc_isla_starmaneAI::WaypointReached(), and npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI::WaypointStart().

◆ GetWaypointPosition()

bool npc_escortAI::GetWaypointPosition ( uint32  pointId,
float &  x,
float &  y,
float &  z 
)
537{
538 ScriptPointVector const& waypoints = sScriptSystemMgr->GetPointMoveList(me->GetEntry());
539 if (waypoints.empty())
540 return false;
541
542 for (ScriptPointVector::const_iterator itr = waypoints.begin(); itr != waypoints.end(); ++itr)
543 {
544 if (itr->uiPointId == pointId)
545 {
546 x = itr->fX;
547 y = itr->fY;
548 z = itr->fZ;
549 return true;
550 }
551 }
552
553 return false;
554}

References Object::GetEntry(), ScriptedAI::me, and sScriptSystemMgr.

◆ HasEscortState()

◆ IsEscorted()

bool npc_escortAI::IsEscorted ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

References m_uiEscortState, and STATE_ESCORT_ESCORTING.

◆ IsEscortNPC()

bool npc_escortAI::IsEscortNPC ( bool  = true) const
inlineoverridevirtual

Reimplemented from CreatureAI.

67{ return true; }

◆ IsPlayerOrGroupInRange()

bool npc_escortAI::IsPlayerOrGroupInRange ( )
private
223{
224 if (Player* player = GetPlayerForEscort())
225 {
226 if (Group* group = player->GetGroup())
227 {
228 for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
229 if (Player* member = groupRef->GetSource())
230 if (me->IsWithinDistInMap(member, GetMaxPlayerDistance(), true, false, false))
231 return true;
232 }
233 else if (me->IsWithinDistInMap(player, GetMaxPlayerDistance(), true, false, false))
234 return true;
235 }
236
237 return false;
238}
Definition GroupReference.h:27
Definition Group.h:169
Definition Player.h:1084
Player * GetPlayerForEscort()
Definition ScriptedEscortAI.h:118

References GetMaxPlayerDistance(), GetPlayerForEscort(), WorldObject::IsWithinDistInMap(), and ScriptedAI::me.

Referenced by UpdateAI().

◆ JustDied()

void npc_escortAI::JustDied ( Unit )
overridevirtual

Reimplemented from CreatureAI.

Reimplemented in npc_muglash::npc_muglashAI, violet_hold_trashAI, npc_mootoo_the_younger::npc_mootoo_the_youngerAI, npc_frosthound, npc_maghar_captive::npc_maghar_captiveAI, npc_kurenai_captive::npc_kurenai_captiveAI, npc_maxx_a_million_escort::npc_maxx_a_million_escortAI, npc_isla_starmane::npc_isla_starmaneAI, npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, and npc_general_andorov.

148{
150 return;
151
152 if (Player* player = GetPlayerForEscort())
153 {
154 if (Group* group = player->GetGroup())
155 {
156 for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
157 if (Player* member = groupRef->GetSource())
158 if (member->IsInMap(player) && member->GetQuestStatus(m_pQuestForEscort->GetQuestId()) == QUEST_STATUS_INCOMPLETE)
159 member->FailQuest(m_pQuestForEscort->GetQuestId());
160 }
161 else
162 {
163 if (player->GetQuestStatus(m_pQuestForEscort->GetQuestId()) == QUEST_STATUS_INCOMPLETE)
164 player->FailQuest(m_pQuestForEscort->GetQuestId());
165 }
166 }
167}
@ QUEST_STATUS_INCOMPLETE
Definition QuestDef.h:103
uint32 GetQuestId() const
Definition QuestDef.h:228

References GetPlayerForEscort(), Quest::GetQuestId(), HasEscortState(), m_pQuestForEscort, m_uiPlayerGUID, QUEST_STATUS_INCOMPLETE, and STATE_ESCORT_ESCORTING.

Referenced by npc_cork_gizelton::npc_cork_gizeltonAI::JustDied().

◆ JustExitedCombat()

void npc_escortAI::JustExitedCombat ( )
overridevirtual

Called when the unit leaves combat.

Reimplemented from CreatureAI.

193{
194 // Evade synchronously so UpdateAI does not push a waypoint spline before
195 // SelectVictim's evade fallback fires; stacked motion intents twitch.
197 if (me->IsAlive() && me->IsInWorld() && !me->IsInEvadeMode())
199}
@ EVADE_REASON_NO_HOSTILES
Definition CreatureAI.h:88
void EngagementOver()
Definition CreatureAI.cpp:298
bool IsInWorld() const
Definition Object.h:109
bool IsAlive() const
Definition Unit.h:1794
void EnterEvadeMode(EvadeReason=EVADE_REASON_OTHER) override
Definition ScriptedEscortAI.cpp:201

References CreatureAI::EngagementOver(), EnterEvadeMode(), CreatureAI::EVADE_REASON_NO_HOSTILES, Unit::IsAlive(), Creature::IsInEvadeMode(), Object::IsInWorld(), and ScriptedAI::me.

◆ JustRespawned()

void npc_escortAI::JustRespawned ( )
overridevirtual

Reimplemented from CreatureAI.

Reimplemented in npc_rinji::npc_rinjiAI, and npc_isla_starmane::npc_isla_starmaneAI.

170{
172
174 me->SetCombatMovement(true);
175
176 //add a small delay before going to first waypoint, normal in near all cases
177 m_uiWPWaitTimer = 1000;
178
181
182 Reset();
183}
@ STATE_ESCORT_PAUSED
Definition ScriptedEscortAI.h:49
void SetCombatMovement(bool allowMovement)
Definition Creature.cpp:3877
void RestoreFaction()
Definition Unit.cpp:14949
uint32 GetFaction() const
Definition Unit.h:851
uint32 faction
Definition CreatureData.h:199
void RemoveEscortState(uint32 escortState)
Definition ScriptedEscortAI.h:115

References CreatureTemplate::faction, Creature::GetCreatureTemplate(), Unit::GetFaction(), Creature::IsCombatMovementAllowed(), m_uiWPWaitTimer, ScriptedAI::me, RemoveEscortState(), ScriptedAI::Reset(), Unit::RestoreFaction(), Creature::SetCombatMovement(), STATE_ESCORT_ESCORTING, STATE_ESCORT_PAUSED, and STATE_ESCORT_RETURNING.

Referenced by npc_rinji::npc_rinjiAI::JustRespawned(), npc_cork_gizelton::npc_cork_gizeltonAI::JustRespawned(), boss_bjarngrim::JustRespawned(), and npc_isla_starmane::npc_isla_starmaneAI::JustRespawned().

◆ MoveInLineOfSight()

void npc_escortAI::MoveInLineOfSight ( Unit who)
overridevirtual

Reimplemented from CreatureAI.

Reimplemented in npc_taretha::npc_tarethaAI, npc_mimirons_inferno, npc_general_andorov, and violet_hold_trashAI.

128{
129 if (me->GetVictim())
130 return;
131
134 return;
135
137 {
139 {
142 }
143 AttackStart(who);
144 }
145}
@ UNIT_STATE_DISTRACTED
Definition UnitDefines.h:185
@ UNIT_STATE_STUNNED
Definition UnitDefines.h:176
@ REACT_AGGRESSIVE
Definition Unit.h:568
bool CanStartAttack(Unit const *u, bool force=false) const
Definition Creature.cpp:1900
void Clear(bool reset=true)
Definition MotionMaster.h:193
void ClearUnitState(uint32 f)
Definition Unit.h:737
bool HasUnitState(const uint32 f) const
Definition Unit.h:736
bool isTargetableForAttack(bool checkFakeDeath=true, Unit const *byWho=nullptr) const
Definition Unit.cpp:10714
bool AssistPlayerInCombatAgainst(Unit *who)
Definition ScriptedEscortAI.cpp:65

References AssistPlayerInCombatAgainst(), AttackStart(), Creature::CanStartAttack(), MotionMaster::Clear(), Unit::ClearUnitState(), Unit::GetMotionMaster(), Unit::GetVictim(), HasEscortState(), Creature::HasReactState(), Unit::HasUnitState(), Unit::isInAccessiblePlaceFor(), Unit::isTargetableForAttack(), ScriptedAI::me, REACT_AGGRESSIVE, STATE_ESCORT_ESCORTING, UNIT_STATE_DISTRACTED, and UNIT_STATE_STUNNED.

Referenced by boss_grand_champion::boss_grand_championAI::MoveInLineOfSight(), npc_ancestral_wolf::npc_ancestral_wolfAI::MoveInLineOfSight(), and npc_captain_saeed::npc_captain_saeedAI::MoveInLineOfSight().

◆ MovementInform()

void npc_escortAI::MovementInform ( uint32  moveType,
uint32  pointId 
)
overridevirtual

Reimplemented from CreatureAI.

Reimplemented in npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI.

327{
328 // xinef: no action allowed if there is no escort
330 return;
331
332 if (moveType == POINT_MOTION_TYPE)
333 {
334 //Combat start position reached, continue waypoint movement
335 if (pointId == POINT_LAST_POINT)
336 {
337 LOG_DEBUG("scripts.ai", "EscortAI has returned to original position before combat");
338
340
341 if (!m_uiWPWaitTimer)
342 m_uiWPWaitTimer = 1;
343 }
344 else if (pointId == POINT_HOME)
345 {
346 LOG_DEBUG("scripts.ai", "EscortAI has returned to original home location and will continue from beginning of waypoint list.");
347
348 CurrentWP = WaypointList.begin();
349 m_uiWPWaitTimer = 1;
350 }
351 }
352 else if (moveType == ESCORT_MOTION_TYPE)
353 {
355 {
356 //Call WP function
360
361 m_uiWPWaitTimer = CurrentWP->WaitTimeMs + 1;
362
363 ++CurrentWP;
364
366 {
371 }
372 }
373 }
374}
@ POINT_HOME
Definition ScriptedEscortAI.cpp:26
@ POINT_LAST_POINT
Definition ScriptedEscortAI.cpp:25
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:347
void SetPosition(float x, float y, float z, float o)
Definition Creature.cpp:3273
void MoveIdle()
Definition MotionMaster.cpp:234
void StopMovingOnCurrentPos()
Definition Unit.cpp:13062
float GetOrientation() const
Definition Position.h:124
virtual void WaypointReached(uint32 pointId)=0

References CurrentWP, ESCORT_MOTION_TYPE, Unit::GetMotionMaster(), MotionMaster::GetMotionSlotType(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), HasEscortState(), LOG_DEBUG, m_uiWPWaitTimer, ScriptedAI::me, MOTION_SLOT_ACTIVE, MotionMaster::MoveIdle(), MotionMaster::MovementExpired(), POINT_HOME, POINT_LAST_POINT, POINT_MOTION_TYPE, RemoveEscortState(), Creature::SetHomePosition(), Creature::SetPosition(), STATE_ESCORT_ESCORTING, STATE_ESCORT_PAUSED, STATE_ESCORT_RETURNING, Unit::StopMovingOnCurrentPos(), WaypointList, and WaypointReached().

Referenced by boss_grand_champion::boss_grand_championAI::MovementInform(), and npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::MovementInform().

◆ RemoveEscortState()

◆ ReturnToLastPoint()

void npc_escortAI::ReturnToLastPoint ( )
186{
187 float x, y, z, o;
188 me->GetHomePosition(x, y, z, o);
190}
@ FORCED_MOVEMENT_RUN
Definition MotionMaster.h:88
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition Creature.h:349
void MovePoint(uint32 id, const Position &pos, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE, float speed=0.f, bool generatePath=true, bool forceDestination=true, std::optional< AnimTier > animTier=std::nullopt)
Definition MotionMaster.h:240

References FORCED_MOVEMENT_RUN, Creature::GetHomePosition(), Unit::GetMotionMaster(), ScriptedAI::me, MotionMaster::MovePoint(), and POINT_LAST_POINT.

Referenced by npc_varian_wrynn::npc_varian_wrynnAI::EnterEvadeMode(), npc_thrall_bfu::npc_thrall_bfuAI::EnterEvadeMode(), violet_hold_trashAI::EnterEvadeMode(), and EnterEvadeMode().

◆ SetCanAttack()

void npc_escortAI::SetCanAttack ( bool  attack)
inline
111{ m_bIsActiveAttacker = attack; }

References m_bIsActiveAttacker.

◆ SetDespawnAtEnd()

◆ SetDespawnAtFar()

◆ SetEscortPaused()

void npc_escortAI::SetEscortPaused ( bool  on)
496{
498 return;
499
500 if (on)
502 else
504}

References AddEscortState(), HasEscortState(), RemoveEscortState(), STATE_ESCORT_ESCORTING, and STATE_ESCORT_PAUSED.

Referenced by brann_bronzebeard::brann_bronzebeardAI::DoAction(), npc_arthas::npc_arthasAI::DoAction(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::DoAction(), npc_black_knight_skeletal_gryphon::npc_black_knight_skeletal_gryphonAI::DoAction(), npc_ranshalla::npc_ranshallaAI::DoChannelTorchSpell(), npc_muglash::npc_muglashAI::DoWaveSummon(), npc_captain_saeed::npc_captain_saeedAI::EnterEvadeMode(), npc_ranshalla::npc_ranshallaAI::JustDidDialogueStep(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::ReorderInstance(), npc_crok_scourgebane::npc_crok_scourgebaneAI::SetGUID(), npc_cork_gizelton::npc_cork_gizeltonAI::SetGUID(), npc_captain_saeed::npc_captain_saeedAI::SetGUID(), npc_varian_wrynn::npc_varian_wrynnAI::SetHoldState(), npc_thrall_bfu::npc_thrall_bfuAI::SetHoldState(), npc_general_andorov::sGossipSelect(), npc_thrall_bfu::npc_thrall_bfuAI::SummonedCreatureDies(), npc_barnes::npc_barnesAI::UpdateAI(), npc_corporal_keeshan::npc_corporal_keeshanAI::UpdateAI(), npc_varian_wrynn::npc_varian_wrynnAI::UpdateAI(), npc_thrall_bfu::npc_thrall_bfuAI::UpdateAI(), npc_arthas::npc_arthasAI::UpdateAI(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::UpdateAI(), npc_captain_saeed::npc_captain_saeedAI::UpdateAI(), npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI::UpdateAI(), npc_tyrion_spybot::npc_tyrion_spybotAI::UpdateAI(), npc_maxx_a_million_escort::npc_maxx_a_million_escortAI::UpdateAI(), npc_grimstone::UpdateEscortAI(), npc_cork_gizelton::npc_cork_gizeltonAI::UpdateEscortAI(), npc_ranshalla::npc_ranshallaAI::UpdateEscortAI(), brann_bronzebeard::brann_bronzebeardAI::UpdateEscortAI(), npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::UpdateEscortAI(), npc_black_knight_skeletal_gryphon::npc_black_knight_skeletal_gryphonAI::WaypointReached(), npc_captain_saeed::npc_captain_saeedAI::WaypointReached(), npc_ranshalla::npc_ranshallaAI::WaypointReached(), npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::WaypointReached(), npc_arthas::npc_arthasAI::WaypointReached(), npc_grimstone::WaypointReached(), npc_barnes::npc_barnesAI::WaypointReached(), npc_corporal_keeshan::npc_corporal_keeshanAI::WaypointReached(), npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI::WaypointReached(), npc_tyrion_spybot::npc_tyrion_spybotAI::WaypointReached(), npc_daphne_stilwell::npc_daphne_stilwellAI::WaypointReached(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::WaypointReached(), npc_general_andorov::WaypointReached(), npc_muglash::npc_muglashAI::WaypointReached(), npc_cork_gizelton::npc_cork_gizeltonAI::WaypointReached(), npc_crok_scourgebane::npc_crok_scourgebaneAI::WaypointReached(), and npc_maxx_a_million_escort::npc_maxx_a_million_escortAI::WaypointReached().

◆ SetMaxPlayerDistance()

void npc_escortAI::SetMaxPlayerDistance ( float  newMax)
inline
105{ MaxPlayerDistance = newMax; }

References MaxPlayerDistance.

◆ SetNextWaypoint() [1/2]

bool npc_escortAI::SetNextWaypoint ( uint32  pointId,
bool  setPosition = true 
)
513{
514 if (!WaypointList.empty())
515 WaypointList.clear();
516
518
519 if (WaypointList.empty())
520 return false;
521
522 Escort_Waypoint waypoint(0, 0, 0, 0, 0);
523 for (CurrentWP = WaypointList.begin(); CurrentWP != WaypointList.end(); ++CurrentWP)
524 {
525 if (CurrentWP->id == pointId)
526 {
527 if (setPosition)
529 return true;
530 }
531 }
532
533 return false;
534}
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition Unit.cpp:15996
void FillPointMovementListForCreature()
Definition ScriptedEscortAI.cpp:413

References CurrentWP, FillPointMovementListForCreature(), Position::GetOrientation(), ScriptedAI::me, Unit::UpdatePosition(), and WaypointList.

◆ SetNextWaypoint() [2/2]

bool npc_escortAI::SetNextWaypoint ( uint32  pointId,
float  x,
float  y,
float  z,
float  orientation 
)
507{
508 me->UpdatePosition(x, y, z, orientation);
509 return SetNextWaypoint(pointId, false);
510}
bool SetNextWaypoint(uint32 pointId, float x, float y, float z, float orientation)
Definition ScriptedEscortAI.cpp:506

References ScriptedAI::me, SetNextWaypoint(), and Unit::UpdatePosition().

Referenced by brann_bronzebeard::brann_bronzebeardAI::DoAction(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::ReorderInstance(), and SetNextWaypoint().

◆ Start()

void npc_escortAI::Start ( bool  isActiveAttacker = true,
ObjectGuid  playerGUID = ObjectGuid::Empty,
Quest const *  quest = nullptr,
bool  instantRespawn = false,
bool  canLoopPath = false,
bool  resetWaypoints = true 
)
429{
430 if (me->GetVictim())
431 {
432 LOG_ERROR("entities.unit.ai", "ERROR: EscortAI (script: {}, creature entry: {}) attempts to Start while in combat", me->GetScriptName(), me->GetEntry());
433 return;
434 }
435
437 {
438 LOG_ERROR("entities.unit.ai", "EscortAI (script: {}, creature entry: {}) attempts to Start while already escorting", me->GetScriptName(), me->GetEntry());
439 return;
440 }
441
442 if (!ScriptWP && resetWaypoints) // sd2 never adds wp in script, but tc does
443 {
444 if (!WaypointList.empty())
445 WaypointList.clear();
447 }
448
449 if (WaypointList.empty())
450 {
451 LOG_ERROR("sql.sql", "EscortAI (script: {}, creature entry: {}) starts with 0 waypoints (possible missing entry in script_waypoint. Quest: {}).",
452 me->GetScriptName(), me->GetEntry(), quest ? quest->GetQuestId() : 0);
453 return;
454 }
455
456 //set variables
457 m_bIsActiveAttacker = isActiveAttacker;
458
459 m_uiPlayerGUID = playerGUID;
460 m_pQuestForEscort = quest;
461
462 m_bCanInstantRespawn = instantRespawn;
463 m_bCanReturnToStart = canLoopPath;
464
466 LOG_DEBUG("scripts.ai", "EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn.");
467
469 {
472 LOG_DEBUG("scripts.ai", "EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle.");
473 }
474
475 //disable npcflags
477 if (me->IsImmuneToNPC())
478 {
479 HasImmuneToNPCFlags = true;
480 me->SetImmuneToNPC(false);
481 }
482
483 LOG_DEBUG("scripts.ai", "EscortAI started with {} waypoints. ActiveAttacker = {}, PlayerGUID = {}",
485
486 CurrentWP = WaypointList.begin();
487
491 me->DisableSpline();
493}
std::uint64_t uint64
Definition Define.h:106
#define LOG_ERROR(filterType__,...)
Definition Log.h:145
@ WAYPOINT_MOTION_TYPE
Definition MotionMaster.h:41
@ UNIT_NPC_FLAG_NONE
Definition UnitDefines.h:321
std::string GetScriptName() const
Definition Creature.cpp:3162
MovementGeneratorType GetCurrentMovementGeneratorType() const
Definition MotionMaster.cpp:961
std::string ToString() const
Definition ObjectGuid.cpp:47
void DisableSpline()
Definition Unit.cpp:756
bool IsImmuneToNPC() const
Definition Unit.h:929
void ReplaceAllNpcFlags(NPCFlags flags)
Definition Unit.h:766

References AddEscortState(), CurrentWP, Unit::DisableSpline(), ESCORT_MOTION_TYPE, FillPointMovementListForCreature(), MotionMaster::GetCurrentMovementGeneratorType(), Object::GetEntry(), Unit::GetMotionMaster(), MotionMaster::GetMotionSlotType(), Quest::GetQuestId(), Creature::GetScriptName(), Unit::GetVictim(), HasEscortState(), HasImmuneToNPCFlags, Unit::IsImmuneToNPC(), LOG_DEBUG, LOG_ERROR, m_bCanInstantRespawn, m_bCanReturnToStart, m_bIsActiveAttacker, m_pQuestForEscort, m_uiPlayerGUID, ScriptedAI::me, MOTION_SLOT_ACTIVE, MotionMaster::MoveIdle(), MotionMaster::MovementExpired(), Unit::ReplaceAllNpcFlags(), ScriptWP, Unit::SetImmuneToNPC(), STATE_ESCORT_ESCORTING, ObjectGuid::ToString(), UNIT_NPC_FLAG_NONE, WAYPOINT_MOTION_TYPE, and WaypointList.

Referenced by boss_bjarngrim::boss_bjarngrim(), boss_thorim_lightning_orb::boss_thorim_lightning_orb(), boss_thorim_sif_blizzard::boss_thorim_sif_blizzard(), boss_yoggsaron_cloud::boss_yoggsaron_cloud(), brann_bronzebeard::brann_bronzebeardAI::DoAction(), npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::DoAction(), npc_taretha::npc_tarethaAI::DoAction(), npc_general_andorov::InitializeAI(), npc_kservant::npc_kservantAI::IsSummonedBy(), boss_bjarngrim::JustRespawned(), npc_custodian_of_time::npc_custodian_of_timeAI::MoveInLineOfSight(), npc_ancestral_wolf::npc_ancestral_wolfAI::npc_ancestral_wolfAI(), npc_frosthound::PassengerBoarded(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::ReorderInstance(), npc_onyx_flamecaller::npc_onyx_flamecallerAI::Reset(), npc_black_knight_skeletal_gryphon::npc_black_knight_skeletal_gryphonAI::Reset(), npc_mimirons_inferno::Reset(), npc_plaguehound_tracker::npc_plaguehound_trackerAI::Reset(), boss_grand_champion::boss_grand_championAI::SetData(), npc_argent_soldier::npc_argent_soldierAI::SetData(), npc_kurenai_captive::npc_kurenai_captiveAI::SetGUID(), npc_captain_saeed::npc_captain_saeedAI::SetGUID(), npc_professor_phizzlethorpe::npc_professor_phizzlethorpeAI::sQuestAccept(), npc_ranger_lilatha::sQuestAccept(), npc_rinji::npc_rinjiAI::sQuestAccept(), npc_corporal_keeshan::npc_corporal_keeshanAI::sQuestAccept(), npc_muglash::npc_muglashAI::sQuestAccept(), npc_wounded_blood_elf::npc_wounded_blood_elfAI::sQuestAccept(), npc_rocknot::sQuestReward(), npc_barnes::npc_barnesAI::StartEvent(), npc_clintar_spirit::npc_clintar_spiritAI::StartEvent(), npc_arthas::npc_arthasAI::UpdateAI(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::UpdateAI(), npc_crok_scourgebane::npc_crok_scourgebaneAI::UpdateAI(), violet_hold_trashAI::UpdateAI(), npc_azure_saboteur::UpdateAI(), npc_grimstone::UpdateEscortAI(), npc_magwin::npc_magwinAI::UpdateEscortAI(), and npc_cork_gizelton::npc_cork_gizeltonAI::UpdateEscortAI().

◆ UpdateAI()

void npc_escortAI::UpdateAI ( uint32  )
overridevirtual

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

Implements UnitAI.

Reimplemented in npc_rocknot, npc_professor_phizzlethorpe::npc_professor_phizzlethorpeAI, npc_varian_wrynn::npc_varian_wrynnAI, npc_thrall_bfu::npc_thrall_bfuAI, npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, npc_muglash::npc_muglashAI, npc_mimirons_inferno, violet_hold_trashAI, npc_lurgglbr::npc_lurgglbrAI, npc_frosthound, npc_maghar_captive::npc_maghar_captiveAI, npc_garments_of_quests::npc_garments_of_questsAI, npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, npc_tyrion_spybot::npc_tyrion_spybotAI, and npc_maxx_a_million_escort::npc_maxx_a_million_escortAI.

241{
243 {
244 if (m_uiWPWaitTimer <= diff)
245 {
246 if (CurrentWP == WaypointList.end())
247 {
248 if (DespawnAtEnd)
249 {
251 {
252 float fRetX, fRetY, fRetZ;
253 me->GetRespawnPosition(fRetX, fRetY, fRetZ);
254 me->GetMotionMaster()->MovePoint(POINT_HOME, fRetX, fRetY, fRetZ);
255
256 m_uiWPWaitTimer = 0;
257 return;
258 }
259
261 {
263 me->Respawn();
264 }
265 else
267 }
268
269 // xinef: remove escort state, escort was finished (lack of this line resulted in skipping UpdateEscortAI calls after finished escort)
271 return;
272 }
273
275 {
276 // xinef, start escort if there is no spline active
277 if (me->movespline->Finalized())
278 {
279 Movement::PointsArray pathPoints;
280 GenerateWaypointArray(&pathPoints);
281 me->GetMotionMaster()->MoveSplinePath(&pathPoints);
282 }
283
285 m_uiWPWaitTimer = 0;
286 }
287 }
288 else
289 m_uiWPWaitTimer -= diff;
290 }
291
292 //Check if player or any member of his group is within range
294 {
295 m_uiPlayerCheckTimer += diff;
296 if (m_uiPlayerCheckTimer > 1000)
297 {
299 {
301 {
303 me->Respawn();
304 }
305 else
307
308 return;
309 }
310
312 }
313 }
314
315 UpdateEscortAI(diff);
316}
void setDeathState(DeathState s, bool despawn=false) override
A creature can be in 4 different states: Alive, JustDied, Corpse, and JustRespawned....
Definition Creature.cpp:1946
void Respawn(bool force=false)
Definition Creature.cpp:2017
void GetRespawnPosition(float &x, float &y, float &z, float *ori=nullptr, float *dist=nullptr) const
Definition Creature.cpp:3049
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2186
void MoveSplinePath(Movement::PointsArray *path, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE)
Definition MotionMaster.cpp:503
bool Finalized() const
Definition MoveSpline.h:118
Movement::MoveSpline * movespline
Definition Unit.h:2115
std::vector< Vector3 > PointsArray
Definition MoveSplineInitArgs.h:28
bool IsPlayerOrGroupInRange()
Definition ScriptedEscortAI.cpp:222
void GenerateWaypointArray(Movement::PointsArray *points)
Definition ScriptedEscortAI.cpp:556
virtual void WaypointStart(uint32)
Definition ScriptedEscortAI.h:96
virtual void UpdateEscortAI(uint32 diff)
Definition ScriptedEscortAI.cpp:318

References CurrentWP, DespawnAtEnd, DespawnAtFar, Creature::DespawnOrUnsummon(), Movement::MoveSpline::Finalized(), GenerateWaypointArray(), Unit::GetMotionMaster(), Creature::GetRespawnPosition(), Unit::GetVictim(), HasEscortState(), IsPlayerOrGroupInRange(), JustDied, m_bCanInstantRespawn, m_bCanReturnToStart, m_uiPlayerCheckTimer, m_uiPlayerGUID, m_uiWPWaitTimer, ScriptedAI::me, MotionMaster::MovePoint(), Unit::movespline, MotionMaster::MoveSplinePath(), POINT_HOME, RemoveEscortState(), Creature::Respawn(), Creature::setDeathState(), STATE_ESCORT_ESCORTING, STATE_ESCORT_PAUSED, STATE_ESCORT_RETURNING, UpdateEscortAI(), WaypointList, and WaypointStart().

Referenced by npc_daphne_stilwell::npc_daphne_stilwellAI::Update(), npc_rocknot::UpdateAI(), npc_barnes::npc_barnesAI::UpdateAI(), npc_professor_phizzlethorpe::npc_professor_phizzlethorpeAI::UpdateAI(), npc_corporal_keeshan::npc_corporal_keeshanAI::UpdateAI(), npc_varian_wrynn::npc_varian_wrynnAI::UpdateAI(), npc_thrall_bfu::npc_thrall_bfuAI::UpdateAI(), npc_arthas::npc_arthasAI::UpdateAI(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::UpdateAI(), npc_muglash::npc_muglashAI::UpdateAI(), npc_clintar_spirit::npc_clintar_spiritAI::UpdateAI(), npc_custodian_of_time::npc_custodian_of_timeAI::UpdateAI(), npc_ame::npc_ameAI::UpdateAI(), npc_argent_soldier::npc_argent_soldierAI::UpdateAI(), boss_grand_champion::boss_grand_championAI::UpdateAI(), npc_crok_scourgebane::npc_crok_scourgebaneAI::UpdateAI(), npc_mimirons_inferno::UpdateAI(), violet_hold_trashAI::UpdateAI(), npc_azure_saboteur::UpdateAI(), npc_lurgglbr::npc_lurgglbrAI::UpdateAI(), npc_frosthound::UpdateAI(), npc_maghar_captive::npc_maghar_captiveAI::UpdateAI(), npc_captain_saeed::npc_captain_saeedAI::UpdateAI(), npc_garments_of_quests::npc_garments_of_questsAI::UpdateAI(), npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI::UpdateAI(), npc_tyrion_spybot::npc_tyrion_spybotAI::UpdateAI(), npc_black_knight_skeletal_gryphon::npc_black_knight_skeletal_gryphonAI::UpdateAI(), npc_engineer_helice::npc_engineer_heliceAI::UpdateAI(), and npc_maxx_a_million_escort::npc_maxx_a_million_escortAI::UpdateAI().

◆ UpdateEscortAI()

◆ WaypointReached() [1/2]

virtual void npc_escortAI::WaypointReached ( uint32  pointId)
pure virtual

Implemented in npc_black_knight_skeletal_gryphon::npc_black_knight_skeletal_gryphonAI, boss_grand_champion::boss_grand_championAI, npc_captain_saeed::npc_captain_saeedAI, brann_bronzebeard::brann_bronzebeardAI, violet_hold_trashAI, boss_bjarngrim, npc_ranshalla::npc_ranshallaAI, npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI, npc_argent_soldier::npc_argent_soldierAI, npc_arthas::npc_arthasAI, npc_grimstone, npc_rocknot, npc_barnes::npc_barnesAI, npc_professor_phizzlethorpe::npc_professor_phizzlethorpeAI, npc_ranger_lilatha, npc_rinji::npc_rinjiAI, npc_corporal_keeshan::npc_corporal_keeshanAI, npc_deathstalker_erland::npc_deathstalker_erlandAI, npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, npc_tyrion_spybot::npc_tyrion_spybotAI, npc_varian_wrynn::npc_varian_wrynnAI, npc_thrall_bfu::npc_thrall_bfuAI, npc_daphne_stilwell::npc_daphne_stilwellAI, npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI, npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, npc_taretha::npc_tarethaAI, npc_general_andorov, npc_muglash::npc_muglashAI, npc_magwin::npc_magwinAI, npc_prospector_remtravel::npc_prospector_remtravelAI, npc_cork_gizelton::npc_cork_gizeltonAI, npc_clintar_spirit::npc_clintar_spiritAI, npc_kaya_flathoof::npc_kaya_flathoofAI, npc_custodian_of_time::npc_custodian_of_timeAI, npc_gilthares::npc_giltharesAI, npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI, npc_lakota_windsong::npc_lakota_windsongAI, npc_paoka_swiftmountain::npc_paoka_swiftmountainAI, npc_ame::npc_ameAI, npc_onyx_flamecaller::npc_onyx_flamecallerAI, npc_crok_scourgebane::npc_crok_scourgebaneAI, npc_azure_saboteur, npc_lurgglbr::npc_lurgglbrAI, npc_mootoo_the_younger::npc_mootoo_the_youngerAI, npc_bonker_togglevolt::npc_bonker_togglevoltAI, npc_emily::npc_emilyAI, npc_apothecary_hanes::npc_Apothecary_HanesAI, npc_plaguehound_tracker::npc_plaguehound_trackerAI, npc_engineer_helice::npc_engineer_heliceAI, npc_frosthound, npc_ancestral_wolf::npc_ancestral_wolfAI, npc_wounded_blood_elf::npc_wounded_blood_elfAI, npc_maghar_captive::npc_maghar_captiveAI, npc_kurenai_captive::npc_kurenai_captiveAI, npc_bessy::npc_bessyAI, npc_maxx_a_million_escort::npc_maxx_a_million_escortAI, npc_kservant::npc_kservantAI, npc_isla_starmane::npc_isla_starmaneAI, npc_mimirons_inferno, boss_thorim_lightning_orb, boss_thorim_sif_blizzard, boss_yoggsaron_cloud, and npc_garments_of_quests::npc_garments_of_questsAI.

Referenced by MovementInform().

◆ WaypointReached() [2/2]

virtual void CreatureAI::WaypointReached ( uint32  ,
uint32   
)
inlinevirtual

◆ WaypointStart()

virtual void npc_escortAI::WaypointStart ( uint32  )
inlinevirtual

Member Data Documentation

◆ CurrentWP

std::list<Escort_Waypoint>::iterator npc_escortAI::CurrentWP
private

◆ DespawnAtEnd

bool npc_escortAI::DespawnAtEnd
private

Referenced by SetDespawnAtEnd(), and UpdateAI().

◆ DespawnAtFar

bool npc_escortAI::DespawnAtFar
private

Referenced by SetDespawnAtFar(), and UpdateAI().

◆ HasImmuneToNPCFlags

bool npc_escortAI::HasImmuneToNPCFlags
private

Referenced by EnterEvadeMode(), and Start().

◆ m_bCanInstantRespawn

bool npc_escortAI::m_bCanInstantRespawn
private

Referenced by Start(), and UpdateAI().

◆ m_bCanReturnToStart

bool npc_escortAI::m_bCanReturnToStart
private

Referenced by Start(), and UpdateAI().

◆ m_bIsActiveAttacker

bool npc_escortAI::m_bIsActiveAttacker
private

Referenced by GetAttack(), SetCanAttack(), and Start().

◆ m_pQuestForEscort

Quest const* npc_escortAI::m_pQuestForEscort
private

Referenced by JustDied(), and Start().

◆ m_uiEscortState

uint32 npc_escortAI::m_uiEscortState
private

◆ m_uiPlayerCheckTimer

uint32 npc_escortAI::m_uiPlayerCheckTimer
private

Referenced by UpdateAI().

◆ m_uiPlayerGUID

ObjectGuid npc_escortAI::m_uiPlayerGUID
private

◆ m_uiWPWaitTimer

uint32 npc_escortAI::m_uiWPWaitTimer
private

◆ MaxPlayerDistance

float npc_escortAI::MaxPlayerDistance
private

◆ ScriptWP

bool npc_escortAI::ScriptWP
private

Referenced by AddWaypoint(), and Start().

◆ WaypointList


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