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_lightning_orbAI boss_thorim_sif_blizzard::boss_thorim_sif_blizzardAI boss_yoggsaron_cloud::boss_yoggsaron_cloudAI 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_azure_saboteurAI 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_grimstoneAI npc_icefang::npc_icefangAI 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_mimirons_infernoAI 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_rocknotAI npc_scarlet_miner::npc_scarlet_minerAI 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_time_lost_proto_drake::npc_time_lost_proto_drakeAI 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
 
void ReturnToLastPoint ()
 
void EnterEvadeMode (EvadeReason=EVADE_REASON_OTHER) override
 
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)
 
- 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)
 
void SetRun (bool run)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
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
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellCastFinished (SpellInfo const *, SpellFinishReason)
 
virtual void AttackedBy (Unit *)
 
virtual void PathEndReached (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 *)
 
virtual void OwnerAttacked (Unit *)
 
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 JustEnteredCombat (Unit *)
 Called when the unit enters combat.
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
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
 
- 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:190
float MaxPlayerDistance
Definition ScriptedEscortAI.h:124
bool m_bCanReturnToStart
Definition ScriptedEscortAI.h:133
uint32 m_uiPlayerCheckTimer
Definition ScriptedEscortAI.h:122
uint32 m_uiEscortState
Definition ScriptedEscortAI.h:123
bool DespawnAtFar
Definition ScriptedEscortAI.h:135
bool m_bIsActiveAttacker
Definition ScriptedEscortAI.h:131
uint32 m_uiWPWaitTimer
Definition ScriptedEscortAI.h:121
bool ScriptWP
Definition ScriptedEscortAI.h:136
bool m_bCanInstantRespawn
Definition ScriptedEscortAI.h:132
bool DespawnAtEnd
Definition ScriptedEscortAI.h:134
bool HasImmuneToNPCFlags
Definition ScriptedEscortAI.h:137
Quest const * m_pQuestForEscort
Definition ScriptedEscortAI.h:126

◆ ~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 
)
387{
388 Escort_Waypoint t(id, x, y, z, waitTime);
389
390 WaypointList.push_back(t);
391
392 // i think SD2 no longer uses this function
393 ScriptWP = true;
394 /*PointMovement wp;
395 wp.m_uiCreatureEntry = me->GetEntry();
396 wp.m_uiPointId = id;
397 wp.m_fX = x;
398 wp.m_fY = y;
399 wp.m_fZ = z;
400 wp.m_uiWaitTime = WaitTimeMs;
401 PointMovementMap[wp.m_uiCreatureEntry].push_back(wp);*/
402}
Definition ScriptedEscortAI.h:27
std::list< Escort_Waypoint > WaypointList
Definition ScriptedEscortAI.h:128

References ScriptWP, and WaypointList.

Referenced by npc_onyx_flamecaller::npc_onyx_flamecallerAI::AddWaypoints(), boss_bjarngrim::boss_bjarngrim(), npc_scarlet_miner::npc_scarlet_minerAI::InitWaypoint(), boss_thorim_lightning_orb::boss_thorim_lightning_orbAI::InitWaypoint(), boss_thorim_sif_blizzard::boss_thorim_sif_blizzardAI::InitWaypoint(), boss_yoggsaron_cloud::boss_yoggsaron_cloudAI::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::npc_azure_saboteurAI::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:2718
@ REACT_PASSIVE
Definition Unit.h:550
bool HasReactState(ReactStates state) const
Definition Creature.h:101
CreatureTemplate const * GetCreatureTemplate() const
Definition Creature.h:209
bool IsInEvadeMode() const
Definition Creature.h:139
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:10692
bool isInAccessiblePlaceFor(Creature const *c) const
Definition Unit.cpp:4261
Unit * GetVictim() const
Definition Unit.h:864
bool IsValidAttackTarget(Unit const *target, SpellInfo const *bySpell=nullptr) const
Definition Unit.cpp:13955
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:1376
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition Object.cpp:1350
uint32 type_flags
Definition CreatureData.h:223
Creature * me
Definition ScriptedCreature.h:282
float GetMaxPlayerDistance()
Definition ScriptedEscortAI.h:101
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_mimirons_infernoAI, npc_frosthound, npc_icefang::npc_icefangAI, 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:64
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:437
MovementGeneratorType GetMotionSlotType(int slot) const
Definition MotionMaster.cpp:953
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:313
void MovementExpired(bool reset=true)
Definition MotionMaster.h:189
MotionMaster * GetMotionMaster()
Definition Unit.h:1691
void StopMoving()
Definition Unit.cpp:16717
bool Attack(Unit *victim, bool meleeAttack)
Definition Unit.cpp:10323

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, npc_frosthound, and npc_icefang::npc_icefangAI.

193{
195 me->CombatStop(true);
196 me->SetLootRecipient(nullptr);
197
199 {
202 LOG_DEBUG("scripts.ai", "EscortAI has left combat and is now returning to last point");
203 }
204 else
205 {
208 me->SetImmuneToNPC(true);
209 Reset();
210 }
211}
#define LOG_DEBUG(filterType__,...)
Definition Log.h:170
@ STATE_ESCORT_ESCORTING
Definition ScriptedEscortAI.h:47
@ STATE_ESCORT_RETURNING
Definition ScriptedEscortAI.h:48
void SetLootRecipient(Unit *unit, bool withGroup=true)
Definition Creature.cpp:1333
void MoveTargetedHome(bool walk=false)
The unit will return this initial position (owner for pets and summoned creatures)....
Definition MotionMaster.cpp:259
void ClearAllThreat()
Definition ThreatMgr.cpp:417
void CombatStop(bool includingCast=false)
Definition Unit.cpp:10512
void SetImmuneToNPC(bool apply, bool keepCombat=false)
Definition Unit.cpp:13694
ThreatMgr & GetThreatMgr()
Definition Unit.h:914
void Reset() override
Definition ScriptedCreature.h:289
bool HasEscortState(uint32 escortState)
Definition ScriptedEscortAI.h:97
void AddEscortState(uint32 escortState)
Definition ScriptedEscortAI.h:109
void ReturnToLastPoint()
Definition ScriptedEscortAI.cpp:185

References AddEscortState(), ThreatMgr::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(), and npc_captain_saeed::npc_captain_saeedAI::EnterEvadeMode().

◆ FillPointMovementListForCreature()

void npc_escortAI::FillPointMovementListForCreature ( )
private
405{
406 ScriptPointVector const& movePoints = sScriptSystemMgr->GetPointMoveList(me->GetEntry());
407 if (movePoints.empty())
408 return;
409
410 ScriptPointVector::const_iterator itrEnd = movePoints.end();
411 for (ScriptPointVector::const_iterator itr = movePoints.begin(); itr != itrEnd; ++itr)
412 {
413 Escort_Waypoint point(itr->uiPointId, itr->fX, itr->fY, itr->fZ, itr->uiWaitTime);
414 WaypointList.push_back(point);
415 }
416}
#define sScriptSystemMgr
Definition ScriptSystem.h:91
std::vector< ScriptPointMove > ScriptPointVector
Definition ScriptSystem.h:59
uint32 GetEntry() const
Definition Object.h:116

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

Referenced by SetNextWaypoint(), and Start().

◆ GenerateWaypointArray()

void npc_escortAI::GenerateWaypointArray ( Movement::PointsArray points)
548{
549 if (WaypointList.empty())
550 return;
551
552 uint32 startingWaypointId = CurrentWP->id;
553
554 // Flying unit, just fill array
556 {
557 // xinef: first point in vector is unit real position
558 points->clear();
559 points->push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
560 for (std::list<Escort_Waypoint>::const_iterator itr = CurrentWP; itr != WaypointList.end(); ++itr)
561 points->push_back(G3D::Vector3(itr->x, itr->y, itr->z));
562 }
563 else
564 {
565 for (float size = 1.0f; size; size *= 0.5f)
566 {
567 std::vector<G3D::Vector3> pVector;
568 // xinef: first point in vector is unit real position
569 pVector.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
570 uint32 length = (WaypointList.size() - startingWaypointId) * size;
571
572 uint32 cnt = 0;
573 for (std::list<Escort_Waypoint>::const_iterator itr = CurrentWP; itr != WaypointList.end() && cnt <= length; ++itr, ++cnt)
574 pVector.push_back(G3D::Vector3(itr->x, itr->y, itr->z));
575
576 if (pVector.size() > 2) // more than source + dest
577 {
578 G3D::Vector3 middle = (pVector[0] + pVector[pVector.size() - 1]) / 2.f;
579 G3D::Vector3 offset;
580
581 bool continueLoop = false;
582 for (uint32 i = 1; i < pVector.size() - 1; ++i)
583 {
584 offset = middle - pVector[i];
585 if (std::fabs(offset.x) >= 0xFF || std::fabs(offset.y) >= 0xFF || std::fabs(offset.z) >= 0x7F)
586 {
587 // offset is too big, split points
588 continueLoop = true;
589 break;
590 }
591 }
592 if (continueLoop)
593 continue;
594 }
595 // everything ok
596 *points = pVector;
597 break;
598 }
599 }
600}
std::uint32_t uint32
Definition Define.h:107
MovementFlags
Definition UnitDefines.h:367
@ MOVEMENTFLAG_DISABLE_GRAVITY
Definition UnitDefines.h:379
@ MOVEMENTFLAG_CAN_FLY
Definition UnitDefines.h:393
MovementInfo m_movementInfo
Definition Object.h:693
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:129

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
107{ return m_uiPlayerGUID; }
ObjectGuid m_uiPlayerGUID
Definition ScriptedEscortAI.h:120

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 
)
528{
529 ScriptPointVector const& waypoints = sScriptSystemMgr->GetPointMoveList(me->GetEntry());
530 if (waypoints.empty())
531 return false;
532
533 for (ScriptPointVector::const_iterator itr = waypoints.begin(); itr != waypoints.end(); ++itr)
534 {
535 if (itr->uiPointId == pointId)
536 {
537 x = itr->fX;
538 y = itr->fY;
539 z = itr->fZ;
540 return true;
541 }
542 }
543
544 return false;
545}

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

◆ HasEscortState()

◆ IsEscorted()

bool npc_escortAI::IsEscorted ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

References m_uiEscortState, and STATE_ESCORT_ESCORTING.

◆ IsPlayerOrGroupInRange()

bool npc_escortAI::IsPlayerOrGroupInRange ( )
private
214{
215 if (Player* player = GetPlayerForEscort())
216 {
217 if (Group* group = player->GetGroup())
218 {
219 for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
220 if (Player* member = groupRef->GetSource())
221 if (me->IsWithinDistInMap(member, GetMaxPlayerDistance(), true, false))
222 return true;
223 }
224 else if (me->IsWithinDistInMap(player, GetMaxPlayerDistance(), true, false))
225 return true;
226 }
227
228 return false;
229}
Definition GroupReference.h:27
Definition Group.h:169
Definition Player.h:1071
Player * GetPlayerForEscort()
Definition ScriptedEscortAI.h:113

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_icefang::npc_icefangAI, 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().

◆ 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:3814
void RestoreFaction()
Definition Unit.cpp:18776
uint32 GetFaction() const
Definition Unit.h:812
uint32 faction
Definition CreatureData.h:198
void RemoveEscortState(uint32 escortState)
Definition ScriptedEscortAI.h:110

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(), 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_mimirons_infernoAI, 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:182
@ UNIT_STATE_STUNNED
Definition UnitDefines.h:173
@ REACT_AGGRESSIVE
Definition Unit.h:552
bool CanStartAttack(Unit const *u) const
Definition Creature.cpp:1921
void Clear(bool reset=true)
Definition MotionMaster.h:176
void ClearUnitState(uint32 f)
Definition Unit.h:700
bool HasUnitState(const uint32 f) const
Definition Unit.h:699
bool isTargetableForAttack(bool checkFakeDeath=true, Unit const *byWho=nullptr) const
Definition Unit.cpp:13938
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.

318{
319 // xinef: no action allowed if there is no escort
321 return;
322
323 if (moveType == POINT_MOTION_TYPE)
324 {
325 //Combat start position reached, continue waypoint movement
326 if (pointId == POINT_LAST_POINT)
327 {
328 LOG_DEBUG("scripts.ai", "EscortAI has returned to original position before combat");
329
331
332 if (!m_uiWPWaitTimer)
333 m_uiWPWaitTimer = 1;
334 }
335 else if (pointId == POINT_HOME)
336 {
337 LOG_DEBUG("scripts.ai", "EscortAI has returned to original home location and will continue from beginning of waypoint list.");
338
339 CurrentWP = WaypointList.begin();
340 m_uiWPWaitTimer = 1;
341 }
342 }
343 else if (moveType == ESCORT_MOTION_TYPE)
344 {
346 {
347 //Call WP function
351
352 m_uiWPWaitTimer = CurrentWP->WaitTimeMs + 1;
353
354 ++CurrentWP;
355
357 {
362 }
363 }
364 }
365}
@ 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:340
void SetPosition(float x, float y, float z, float o)
Definition Creature.cpp:3172
void MoveIdle()
Definition MotionMaster.cpp:232
void StopMovingOnCurrentPos()
Definition Unit.cpp:16756
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:87
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition Creature.h:342
void MovePoint(uint32 id, const Position &pos, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE, float speed=0.f, bool generatePath=true, bool forceDestination=true)
Definition MotionMaster.h:222

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
106{ m_bIsActiveAttacker = attack; }

References m_bIsActiveAttacker.

◆ SetDespawnAtEnd()

◆ SetDespawnAtFar()

◆ SetEscortPaused()

void npc_escortAI::SetEscortPaused ( bool  on)
487{
489 return;
490
491 if (on)
493 else
495}

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::npc_grimstoneAI::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::npc_grimstoneAI::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
100{ MaxPlayerDistance = newMax; }

References MaxPlayerDistance.

◆ SetNextWaypoint() [1/2]

bool npc_escortAI::SetNextWaypoint ( uint32  pointId,
bool  setPosition = true 
)
504{
505 if (!WaypointList.empty())
506 WaypointList.clear();
507
509
510 if (WaypointList.empty())
511 return false;
512
513 Escort_Waypoint waypoint(0, 0, 0, 0, 0);
514 for (CurrentWP = WaypointList.begin(); CurrentWP != WaypointList.end(); ++CurrentWP)
515 {
516 if (CurrentWP->id == pointId)
517 {
518 if (setPosition)
520 return true;
521 }
522 }
523
524 return false;
525}
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition Unit.cpp:19837
void FillPointMovementListForCreature()
Definition ScriptedEscortAI.cpp:404

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 
)
498{
499 me->UpdatePosition(x, y, z, orientation);
500 return SetNextWaypoint(pointId, false);
501}
bool SetNextWaypoint(uint32 pointId, float x, float y, float z, float orientation)
Definition ScriptedEscortAI.cpp:497

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

Referenced by brann_bronzebeard::brann_bronzebeardAI::DoAction(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::ReorderInstance(), npc_time_lost_proto_drake::npc_time_lost_proto_drakeAI::RollPath(), 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 
)
420{
421 if (me->GetVictim())
422 {
423 LOG_ERROR("entities.unit.ai", "ERROR: EscortAI (script: {}, creature entry: {}) attempts to Start while in combat", me->GetScriptName(), me->GetEntry());
424 return;
425 }
426
428 {
429 LOG_ERROR("entities.unit.ai", "EscortAI (script: {}, creature entry: {}) attempts to Start while already escorting", me->GetScriptName(), me->GetEntry());
430 return;
431 }
432
433 if (!ScriptWP && resetWaypoints) // sd2 never adds wp in script, but tc does
434 {
435 if (!WaypointList.empty())
436 WaypointList.clear();
438 }
439
440 if (WaypointList.empty())
441 {
442 LOG_ERROR("sql.sql", "EscortAI (script: {}, creature entry: {}) starts with 0 waypoints (possible missing entry in script_waypoint. Quest: {}).",
443 me->GetScriptName(), me->GetEntry(), quest ? quest->GetQuestId() : 0);
444 return;
445 }
446
447 //set variables
448 m_bIsActiveAttacker = isActiveAttacker;
449
450 m_uiPlayerGUID = playerGUID;
451 m_pQuestForEscort = quest;
452
453 m_bCanInstantRespawn = instantRespawn;
454 m_bCanReturnToStart = canLoopPath;
455
457 LOG_DEBUG("scripts.ai", "EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn.");
458
460 {
463 LOG_DEBUG("scripts.ai", "EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle.");
464 }
465
466 //disable npcflags
468 if (me->IsImmuneToNPC())
469 {
470 HasImmuneToNPCFlags = true;
471 me->SetImmuneToNPC(false);
472 }
473
474 LOG_DEBUG("scripts.ai", "EscortAI started with {} waypoints. ActiveAttacker = {}, PlayerGUID = {}",
476
477 CurrentWP = WaypointList.begin();
478
482 me->DisableSpline();
484}
std::uint64_t uint64
Definition Define.h:106
#define LOG_ERROR(filterType__,...)
Definition Log.h:158
@ WAYPOINT_MOTION_TYPE
Definition MotionMaster.h:41
@ UNIT_NPC_FLAG_NONE
Definition UnitDefines.h:318
std::string GetScriptName() const
Definition Creature.cpp:3056
MovementGeneratorType GetCurrentMovementGeneratorType() const
Definition MotionMaster.cpp:945
std::string ToString() const
Definition ObjectGuid.cpp:47
void DisableSpline()
Definition Unit.cpp:637
bool IsImmuneToNPC() const
Definition Unit.h:890
void ReplaceAllNpcFlags(NPCFlags flags)
Definition Unit.h:729

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_orbAI::boss_thorim_lightning_orbAI(), boss_thorim_sif_blizzard::boss_thorim_sif_blizzardAI::boss_thorim_sif_blizzardAI(), boss_yoggsaron_cloud::boss_yoggsaron_cloudAI::boss_yoggsaron_cloudAI(), brann_bronzebeard::brann_bronzebeardAI::DoAction(), npc_tirions_gambit_tirion::npc_tirions_gambit_tirionAI::DoAction(), npc_taretha::npc_tarethaAI::DoAction(), npc_scarlet_miner::npc_scarlet_minerAI::InitCartQuest(), npc_general_andorov::InitializeAI(), npc_kservant::npc_kservantAI::IsSummonedBy(), npc_custodian_of_time::npc_custodian_of_timeAI::MoveInLineOfSight(), npc_ancestral_wolf::npc_ancestral_wolfAI::npc_ancestral_wolfAI(), npc_frosthound::PassengerBoarded(), npc_icefang::npc_icefangAI::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_plaguehound_tracker::npc_plaguehound_trackerAI::Reset(), npc_time_lost_proto_drake::npc_time_lost_proto_drakeAI::RollPath(), 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_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::npc_azure_saboteurAI::UpdateAI(), npc_grimstone::npc_grimstoneAI::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_rocknotAI, npc_scarlet_miner::npc_scarlet_minerAI, 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::npc_mimirons_infernoAI, violet_hold_trashAI, npc_lurgglbr::npc_lurgglbrAI, npc_frosthound, npc_icefang::npc_icefangAI, 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.

232{
234 {
235 if (m_uiWPWaitTimer <= diff)
236 {
237 if (CurrentWP == WaypointList.end())
238 {
239 if (DespawnAtEnd)
240 {
242 {
243 float fRetX, fRetY, fRetZ;
244 me->GetRespawnPosition(fRetX, fRetY, fRetZ);
245 me->GetMotionMaster()->MovePoint(POINT_HOME, fRetX, fRetY, fRetZ);
246
247 m_uiWPWaitTimer = 0;
248 return;
249 }
250
252 {
254 me->Respawn();
255 }
256 else
258 }
259
260 // xinef: remove escort state, escort was finished (lack of this line resulted in skipping UpdateEscortAI calls after finished escort)
262 return;
263 }
264
266 {
267 // xinef, start escort if there is no spline active
268 if (me->movespline->Finalized())
269 {
270 Movement::PointsArray pathPoints;
271 GenerateWaypointArray(&pathPoints);
272 me->GetMotionMaster()->MoveSplinePath(&pathPoints);
273 }
274
276 m_uiWPWaitTimer = 0;
277 }
278 }
279 else
280 m_uiWPWaitTimer -= diff;
281 }
282
283 //Check if player or any member of his group is within range
285 {
286 m_uiPlayerCheckTimer += diff;
287 if (m_uiPlayerCheckTimer > 1000)
288 {
290 {
292 {
294 me->Respawn();
295 }
296 else
298
299 return;
300 }
301
303 }
304 }
305
306 UpdateEscortAI(diff);
307}
void setDeathState(DeathState s, bool despawn=false) override
A creature can be in 4 different states: Alive, JustDied, Corpse, and JustRespawned....
Definition Creature.cpp:1972
void Respawn(bool force=false)
Definition Creature.cpp:2043
void GetRespawnPosition(float &x, float &y, float &z, float *ori=nullptr, float *dist=nullptr) const
Definition Creature.cpp:2958
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2182
void MoveSplinePath(Movement::PointsArray *path, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE)
Definition MotionMaster.cpp:490
bool Finalized() const
Definition MoveSpline.h:116
Movement::MoveSpline * movespline
Definition Unit.h:2049
std::vector< Vector3 > PointsArray
Definition MoveSplineInitArgs.h:28
bool IsPlayerOrGroupInRange()
Definition ScriptedEscortAI.cpp:213
void GenerateWaypointArray(Movement::PointsArray *points)
Definition ScriptedEscortAI.cpp:547
virtual void WaypointStart(uint32)
Definition ScriptedEscortAI.h:91
virtual void UpdateEscortAI(uint32 diff)
Definition ScriptedEscortAI.cpp:309

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::npc_rocknotAI::UpdateAI(), npc_barnes::npc_barnesAI::UpdateAI(), npc_scarlet_miner::npc_scarlet_minerAI::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::npc_mimirons_infernoAI::UpdateAI(), violet_hold_trashAI::UpdateAI(), npc_azure_saboteur::npc_azure_saboteurAI::UpdateAI(), npc_lurgglbr::npc_lurgglbrAI::UpdateAI(), npc_frosthound::UpdateAI(), npc_icefang::npc_icefangAI::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()

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_azure_saboteur::npc_azure_saboteurAI, npc_grimstone::npc_grimstoneAI, npc_rocknot::npc_rocknotAI, npc_barnes::npc_barnesAI, npc_scarlet_miner::npc_scarlet_minerAI, 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_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::npc_mimirons_infernoAI, boss_thorim_lightning_orb::boss_thorim_lightning_orbAI, boss_thorim_sif_blizzard::boss_thorim_sif_blizzardAI, boss_yoggsaron_cloud::boss_yoggsaron_cloudAI, npc_time_lost_proto_drake::npc_time_lost_proto_drakeAI, npc_icefang::npc_icefangAI, and npc_garments_of_quests::npc_garments_of_questsAI.

Referenced by MovementInform().

◆ 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: