AzerothCore 3.3.5a
OpenSource WoW Emulator
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
npc_escortAI Struct Referenceabstract

#include "ScriptedEscortAI.h"

Inheritance diagram for npc_escortAI:
ScriptedAI CreatureAI UnitAI boss_bjarngrim::boss_bjarngrimAI 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_frosthoundAI 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, bool run=false, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
 
void SetRun (bool on=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)
 
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=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, 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=0s)
 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 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)
 
- 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, 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_bIsRunning
 
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),
36 m_bIsRunning(false),
39 DespawnAtEnd(true),
40 DespawnAtFar(true),
41 ScriptWP(false),
43{}
#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:125
bool m_bCanReturnToStart
Definition ScriptedEscortAI.h:135
uint32 m_uiPlayerCheckTimer
Definition ScriptedEscortAI.h:123
uint32 m_uiEscortState
Definition ScriptedEscortAI.h:124
bool DespawnAtFar
Definition ScriptedEscortAI.h:137
bool m_bIsActiveAttacker
Definition ScriptedEscortAI.h:132
uint32 m_uiWPWaitTimer
Definition ScriptedEscortAI.h:122
bool ScriptWP
Definition ScriptedEscortAI.h:138
bool m_bCanInstantRespawn
Definition ScriptedEscortAI.h:134
bool m_bIsRunning
Definition ScriptedEscortAI.h:133
bool DespawnAtEnd
Definition ScriptedEscortAI.h:136
bool HasImmuneToNPCFlags
Definition ScriptedEscortAI.h:139
Quest const * m_pQuestForEscort
Definition ScriptedEscortAI.h:127

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

References ScriptWP, and WaypointList.

Referenced by npc_onyx_flamecaller::npc_onyx_flamecallerAI::AddWaypoints(), boss_bjarngrim::boss_bjarngrimAI::boss_bjarngrimAI(), 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
67{
68 if (!who || !who->GetVictim())
69 {
70 return false;
71 }
72
74 {
75 return false;
76 }
77
78 //experimental (unknown) flag not present
80 {
81 return false;
82 }
83
84 //not a player
86 {
87 return false;
88 }
89
90 if (!who->isInAccessiblePlaceFor(me))
91 {
92 return false;
93 }
94
95 if (!CanAIAttack(who))
96 {
97 return false;
98 }
99
100 // we cannot attack in evade mode
101 if (me->IsInEvadeMode())
102 {
103 return false;
104 }
105
106 // or if enemy is in evade mode
107 if (who->IsCreature() && who->ToCreature()->IsInEvadeMode())
108 {
109 return false;
110 }
111
112 //never attack friendly
113 if (!me->IsValidAttackTarget(who))
114 {
115 return false;
116 }
117
118 //too far away and no free sight?
120 {
121 AttackStart(who);
122 return true;
123 }
124
125 return false;
126}
@ CREATURE_TYPE_FLAG_CAN_ASSIST
Definition SharedDefines.h:2707
@ REACT_PASSIVE
Definition Unit.h:549
bool HasReactState(ReactStates state) const
Definition Creature.h:97
CreatureTemplate const * GetCreatureTemplate() const
Definition Creature.h:209
bool IsInEvadeMode() const
Definition Creature.h:135
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:10669
bool isInAccessiblePlaceFor(Creature const *c) const
Definition Unit.cpp:4227
Unit * GetVictim() const
Definition Unit.h:846
bool IsValidAttackTarget(Unit const *target, SpellInfo const *bySpell=nullptr) const
Definition Unit.cpp:13931
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:1359
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition Object.cpp:1333
uint32 type_flags
Definition CreatureData.h:223
Creature * me
Definition ScriptedCreature.h:280
float GetMaxPlayerDistance()
Definition ScriptedEscortAI.h:102
void AttackStart(Unit *who) override
Definition ScriptedEscortAI.cpp:45

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

46{
47 if (!who)
48 return;
49
50 if (me->Attack(who, true))
51 {
53 if (type == ESCORT_MOTION_TYPE || type == POINT_MOTION_TYPE)
54 {
56 //me->DisableSpline();
57 me->StopMoving();
58 }
59
62 }
63}
@ 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:435
MovementGeneratorType GetMotionSlotType(int slot) const
Definition MotionMaster.cpp:921
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:180
MotionMaster * GetMotionMaster()
Definition Unit.h:1664
void StopMoving()
Definition Unit.cpp:16692
bool Attack(Unit *victim, bool meleeAttack)
Definition Unit.cpp:10321

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

195{
197 me->CombatStop(true);
198 me->SetLootRecipient(nullptr);
199
201 {
204 LOG_DEBUG("scripts.ai", "EscortAI has left combat and is now returning to last point");
205 }
206 else
207 {
210 me->SetImmuneToNPC(true);
211 Reset();
212 }
213}
#define LOG_DEBUG(filterType__,...)
Definition Log.h:169
@ STATE_ESCORT_ESCORTING
Definition ScriptedEscortAI.h:47
@ STATE_ESCORT_RETURNING
Definition ScriptedEscortAI.h:48
void SetLootRecipient(Unit *unit, bool withGroup=true)
Definition Creature.cpp:1332
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:10489
void SetImmuneToNPC(bool apply, bool keepCombat=false)
Definition Unit.cpp:13670
ThreatMgr & GetThreatMgr()
Definition Unit.h:896
void Reset() override
Definition ScriptedCreature.h:287
bool HasEscortState(uint32 escortState)
Definition ScriptedEscortAI.h:98
void AddEscortState(uint32 escortState)
Definition ScriptedEscortAI.h:110
void ReturnToLastPoint()
Definition ScriptedEscortAI.cpp:186

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
408{
409 ScriptPointVector const& movePoints = sScriptSystemMgr->GetPointMoveList(me->GetEntry());
410 if (movePoints.empty())
411 return;
412
413 ScriptPointVector::const_iterator itrEnd = movePoints.end();
414 for (ScriptPointVector::const_iterator itr = movePoints.begin(); itr != itrEnd; ++itr)
415 {
416 Escort_Waypoint point(itr->uiPointId, itr->fX, itr->fY, itr->fZ, itr->uiWaitTime);
417 WaypointList.push_back(point);
418 }
419}
#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)
578{
579 if (WaypointList.empty())
580 return;
581
582 uint32 startingWaypointId = CurrentWP->id;
583
584 // Flying unit, just fill array
586 {
587 // xinef: first point in vector is unit real position
588 points->clear();
589 points->push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
590 for (std::list<Escort_Waypoint>::const_iterator itr = CurrentWP; itr != WaypointList.end(); ++itr)
591 points->push_back(G3D::Vector3(itr->x, itr->y, itr->z));
592 }
593 else
594 {
595 for (float size = 1.0f; size; size *= 0.5f)
596 {
597 std::vector<G3D::Vector3> pVector;
598 // xinef: first point in vector is unit real position
599 pVector.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
600 uint32 length = (WaypointList.size() - startingWaypointId) * size;
601
602 uint32 cnt = 0;
603 for (std::list<Escort_Waypoint>::const_iterator itr = CurrentWP; itr != WaypointList.end() && cnt <= length; ++itr, ++cnt)
604 pVector.push_back(G3D::Vector3(itr->x, itr->y, itr->z));
605
606 if (pVector.size() > 2) // more than source + dest
607 {
608 G3D::Vector3 middle = (pVector[0] + pVector[pVector.size() - 1]) / 2.f;
609 G3D::Vector3 offset;
610
611 bool continueLoop = false;
612 for (uint32 i = 1; i < pVector.size() - 1; ++i)
613 {
614 offset = middle - pVector[i];
615 if (std::fabs(offset.x) >= 0xFF || std::fabs(offset.y) >= 0xFF || std::fabs(offset.z) >= 0x7F)
616 {
617 // offset is too big, split points
618 continueLoop = true;
619 break;
620 }
621 }
622 if (continueLoop)
623 continue;
624 }
625 // everything ok
626 *points = pVector;
627 break;
628 }
629 }
630}
std::uint32_t uint32
Definition Define.h:107
MovementFlags
Definition UnitDefines.h:363
@ MOVEMENTFLAG_DISABLE_GRAVITY
Definition UnitDefines.h:375
@ MOVEMENTFLAG_CAN_FLY
Definition UnitDefines.h:389
MovementInfo m_movementInfo
Definition Object.h:660
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:130

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

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::npc_frosthoundAI::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 
)
558{
559 ScriptPointVector const& waypoints = sScriptSystemMgr->GetPointMoveList(me->GetEntry());
560 if (waypoints.empty())
561 return false;
562
563 for (ScriptPointVector::const_iterator itr = waypoints.begin(); itr != waypoints.end(); ++itr)
564 {
565 if (itr->uiPointId == pointId)
566 {
567 x = itr->fX;
568 y = itr->fY;
569 z = itr->fZ;
570 return true;
571 }
572 }
573
574 return false;
575}

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
216{
217 if (Player* player = GetPlayerForEscort())
218 {
219 if (Group* group = player->GetGroup())
220 {
221 for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
222 if (Player* member = groupRef->GetSource())
223 if (me->IsWithinDistInMap(member, GetMaxPlayerDistance(), true, false))
224 return true;
225 }
226 else if (me->IsWithinDistInMap(player, GetMaxPlayerDistance(), true, false))
227 return true;
228 }
229
230 return false;
231}
Definition GroupReference.h:27
Definition Group.h:169
Definition Player.h:1083
Player * GetPlayerForEscort()
Definition ScriptedEscortAI.h:114

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_frosthoundAI, 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.

149{
151 return;
152
153 if (Player* player = GetPlayerForEscort())
154 {
155 if (Group* group = player->GetGroup())
156 {
157 for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
158 if (Player* member = groupRef->GetSource())
159 if (member->IsInMap(player) && member->GetQuestStatus(m_pQuestForEscort->GetQuestId()) == QUEST_STATUS_INCOMPLETE)
160 member->FailQuest(m_pQuestForEscort->GetQuestId());
161 }
162 else
163 {
164 if (player->GetQuestStatus(m_pQuestForEscort->GetQuestId()) == QUEST_STATUS_INCOMPLETE)
165 player->FailQuest(m_pQuestForEscort->GetQuestId());
166 }
167 }
168}
@ 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.

171{
173
175 me->SetCombatMovement(true);
176
177 //add a small delay before going to first waypoint, normal in near all cases
178 m_uiWPWaitTimer = 1000;
179
182
183 Reset();
184}
@ STATE_ESCORT_PAUSED
Definition ScriptedEscortAI.h:49
void SetCombatMovement(bool allowMovement)
Definition Creature.cpp:3873
void RestoreFaction()
Definition Unit.cpp:18751
uint32 GetFaction() const
Definition Unit.h:801
uint32 faction
Definition CreatureData.h:198
void RemoveEscortState(uint32 escortState)
Definition ScriptedEscortAI.h:111

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.

129{
130 if (me->GetVictim())
131 return;
132
135 return;
136
138 {
140 {
143 }
144 AttackStart(who);
145 }
146}
@ UNIT_STATE_DISTRACTED
Definition UnitDefines.h:182
@ UNIT_STATE_STUNNED
Definition UnitDefines.h:173
@ REACT_AGGRESSIVE
Definition Unit.h:551
bool CanStartAttack(Unit const *u) const
Definition Creature.cpp:1920
void Clear(bool reset=true)
Definition MotionMaster.h:167
void ClearUnitState(uint32 f)
Definition Unit.h:692
bool HasUnitState(const uint32 f) const
Definition Unit.h:691
bool isTargetableForAttack(bool checkFakeDeath=true, Unit const *byWho=nullptr) const
Definition Unit.cpp:13914
bool AssistPlayerInCombatAgainst(Unit *who)
Definition ScriptedEscortAI.cpp:66

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

320{
321 // xinef: no action allowed if there is no escort
323 return;
324
325 if (moveType == POINT_MOTION_TYPE)
326 {
327 //Combat start position reached, continue waypoint movement
328 if (pointId == POINT_LAST_POINT)
329 {
330 LOG_DEBUG("scripts.ai", "EscortAI has returned to original position before combat");
331
334
335 if (!m_uiWPWaitTimer)
336 m_uiWPWaitTimer = 1;
337 }
338 else if (pointId == POINT_HOME)
339 {
340 LOG_DEBUG("scripts.ai", "EscortAI has returned to original home location and will continue from beginning of waypoint list.");
341
342 CurrentWP = WaypointList.begin();
343 m_uiWPWaitTimer = 1;
344 }
345 }
346 else if (moveType == ESCORT_MOTION_TYPE)
347 {
349 {
350 //Call WP function
354
355 m_uiWPWaitTimer = CurrentWP->WaitTimeMs + 1;
356
357 ++CurrentWP;
358
360 {
365 }
366 }
367 }
368}
@ 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:3171
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition Creature.cpp:3208
void MoveIdle()
Definition MotionMaster.cpp:232
void StopMovingOnCurrentPos()
Definition Unit.cpp:16731
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_bIsRunning, m_uiWPWaitTimer, ScriptedAI::me, MOTION_SLOT_ACTIVE, MotionMaster::MoveIdle(), MotionMaster::MovementExpired(), POINT_HOME, POINT_LAST_POINT, POINT_MOTION_TYPE, RemoveEscortState(), Creature::SetHomePosition(), Creature::SetPosition(), Creature::SetWalk(), 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 ( )
187{
188 float x, y, z, o;
189 me->SetWalk(false);
190 me->GetHomePosition(x, y, z, o);
192}
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition Creature.h:342
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition MotionMaster.h:213

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

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

References m_bIsActiveAttacker.

◆ SetDespawnAtEnd()

◆ SetDespawnAtFar()

◆ SetEscortPaused()

void npc_escortAI::SetEscortPaused ( bool  on)
517{
519 return;
520
521 if (on)
523 else
525}

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
101{ MaxPlayerDistance = newMax; }

References MaxPlayerDistance.

◆ SetNextWaypoint() [1/2]

bool npc_escortAI::SetNextWaypoint ( uint32  pointId,
bool  setPosition = true 
)
534{
535 if (!WaypointList.empty())
536 WaypointList.clear();
537
539
540 if (WaypointList.empty())
541 return false;
542
543 Escort_Waypoint waypoint(0, 0, 0, 0, 0);
544 for (CurrentWP = WaypointList.begin(); CurrentWP != WaypointList.end(); ++CurrentWP)
545 {
546 if (CurrentWP->id == pointId)
547 {
548 if (setPosition)
550 return true;
551 }
552 }
553
554 return false;
555}
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition Unit.cpp:19814
void FillPointMovementListForCreature()
Definition ScriptedEscortAI.cpp:407

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 
)
528{
529 me->UpdatePosition(x, y, z, orientation);
530 return SetNextWaypoint(pointId, false);
531}
bool SetNextWaypoint(uint32 pointId, float x, float y, float z, float orientation)
Definition ScriptedEscortAI.cpp:527

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

◆ SetRun()

void npc_escortAI::SetRun ( bool  on = true)
422{
423 if (on)
424 {
425 if (!m_bIsRunning)
426 me->SetWalk(false);
427 else
428 LOG_DEBUG("scripts.ai", "EscortAI attempt to set run mode, but is already running.");
429 }
430 else
431 {
432 if (m_bIsRunning)
433 me->SetWalk(true);
434 else
435 LOG_DEBUG("scripts.ai", "EscortAI attempt to set walk mode, but is already walking.");
436 }
437
438 m_bIsRunning = on;
439}

References LOG_DEBUG, m_bIsRunning, ScriptedAI::me, and Creature::SetWalk().

Referenced by npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI::DamageTaken(), npc_arthas::npc_arthasAI::DoAction(), npc_thrall_bfu::npc_thrall_bfuAI::SummonedCreatureDies(), 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_arthas::npc_arthasAI::WaypointReached(), npc_scarlet_miner::npc_scarlet_minerAI::WaypointReached(), npc_professor_phizzlethorpe::npc_professor_phizzlethorpeAI::WaypointReached(), npc_rinji::npc_rinjiAI::WaypointReached(), npc_daphne_stilwell::npc_daphne_stilwellAI::WaypointReached(), npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI::WaypointReached(), npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI::WaypointReached(), npc_taretha::npc_tarethaAI::WaypointReached(), npc_magwin::npc_magwinAI::WaypointReached(), npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI::WaypointReached(), npc_mootoo_the_younger::npc_mootoo_the_youngerAI::WaypointReached(), npc_apothecary_hanes::npc_Apothecary_HanesAI::WaypointReached(), npc_maghar_captive::npc_maghar_captiveAI::WaypointReached(), npc_kurenai_captive::npc_kurenai_captiveAI::WaypointReached(), and npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI::WaypointStart().

◆ Start()

void npc_escortAI::Start ( bool  isActiveAttacker = true,
bool  run = false,
ObjectGuid  playerGUID = ObjectGuid::Empty,
Quest const *  quest = nullptr,
bool  instantRespawn = false,
bool  canLoopPath = false,
bool  resetWaypoints = true 
)
443{
444 if (me->GetVictim())
445 {
446 LOG_ERROR("entities.unit.ai", "ERROR: EscortAI (script: {}, creature entry: {}) attempts to Start while in combat", me->GetScriptName(), me->GetEntry());
447 return;
448 }
449
451 {
452 LOG_ERROR("entities.unit.ai", "EscortAI (script: {}, creature entry: {}) attempts to Start while already escorting", me->GetScriptName(), me->GetEntry());
453 return;
454 }
455
456 if (!ScriptWP && resetWaypoints) // sd2 never adds wp in script, but tc does
457 {
458 if (!WaypointList.empty())
459 WaypointList.clear();
461 }
462
463 if (WaypointList.empty())
464 {
465 LOG_ERROR("sql.sql", "EscortAI (script: {}, creature entry: {}) starts with 0 waypoints (possible missing entry in script_waypoint. Quest: {}).",
466 me->GetScriptName(), me->GetEntry(), quest ? quest->GetQuestId() : 0);
467 return;
468 }
469
470 //set variables
471 m_bIsActiveAttacker = isActiveAttacker;
472 m_bIsRunning = run;
473
474 m_uiPlayerGUID = playerGUID;
475 m_pQuestForEscort = quest;
476
477 m_bCanInstantRespawn = instantRespawn;
478 m_bCanReturnToStart = canLoopPath;
479
481 LOG_DEBUG("scripts.ai", "EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn.");
482
484 {
487 LOG_DEBUG("scripts.ai", "EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle.");
488 }
489
490 //disable npcflags
492 if (me->IsImmuneToNPC())
493 {
494 HasImmuneToNPCFlags = true;
495 me->SetImmuneToNPC(false);
496 }
497
498 LOG_DEBUG("scripts.ai", "EscortAI started with {} waypoints. ActiveAttacker = {}, Run = {}, PlayerGUID = {}",
500
501 CurrentWP = WaypointList.begin();
502
503 //Set initial speed
504 if (m_bIsRunning)
505 me->SetWalk(false);
506 else
507 me->SetWalk(true);
508
512 me->DisableSpline();
514}
std::uint64_t uint64
Definition Define.h:106
#define LOG_ERROR(filterType__,...)
Definition Log.h:157
@ WAYPOINT_MOTION_TYPE
Definition MotionMaster.h:41
@ UNIT_NPC_FLAG_NONE
Definition UnitDefines.h:314
std::string GetScriptName() const
Definition Creature.cpp:3055
MovementGeneratorType GetCurrentMovementGeneratorType() const
Definition MotionMaster.cpp:913
std::string ToString() const
Definition ObjectGuid.cpp:47
void DisableSpline()
Definition Unit.cpp:637
bool IsImmuneToNPC() const
Definition Unit.h:872
void ReplaceAllNpcFlags(NPCFlags flags)
Definition Unit.h:721

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_bIsRunning, m_pQuestForEscort, m_uiPlayerGUID, ScriptedAI::me, MOTION_SLOT_ACTIVE, MotionMaster::MoveIdle(), MotionMaster::MovementExpired(), Unit::ReplaceAllNpcFlags(), ScriptWP, Unit::SetImmuneToNPC(), Creature::SetWalk(), STATE_ESCORT_ESCORTING, ObjectGuid::ToString(), UNIT_NPC_FLAG_NONE, WAYPOINT_MOTION_TYPE, and WaypointList.

Referenced by boss_bjarngrim::boss_bjarngrimAI::boss_bjarngrimAI(), 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::npc_frosthoundAI::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_frosthoundAI, 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.

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

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::npc_frosthoundAI::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::boss_bjarngrimAI, 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_frosthoundAI, 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_bIsRunning

bool npc_escortAI::m_bIsRunning
private

Referenced by MovementInform(), SetRun(), 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: