AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_arthas::npc_arthasAI Struct Reference
Inheritance diagram for npc_arthas::npc_arthasAI:
npc_escortAI ScriptedAI CreatureAI UnitAI

Public Member Functions

 npc_arthasAI (Creature *creature)
 
Creature * GetEventNpc (uint32 entry)
 
void ScheduleNextEvent (uint32 currentEvent, Milliseconds time)
 
void SummonNextWave ()
 
void ReorderInstance (uint32 data)
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void SendNextWave (uint32 entry)
 
void SpawnTimeRift ()
 
void ResetEngagedBosses ()
 
void JustDied (Unit *) override
 
void JustSummoned (Creature *cr) override
 
void SummonedCreatureDespawn (Creature *cr) override
 
void SummonedCreatureDies (Creature *cr, Unit *) override
 
void DoAction (int32 param) override
 
void Reset () override
 
void WaypointReached (uint32 uiPointId) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
virtual void WaypointReached (uint32, uint32)
 
- Public Member Functions inherited from npc_escortAI
 npc_escortAI (Creature *creature)
 
 ~npc_escortAI () override
 
void AttackStart (Unit *who) override
 
void MoveInLineOfSight (Unit *who) override
 
void JustDied (Unit *) override
 
void JustRespawned () override
 
bool IsEscortNPC (bool=true) const override
 
void ReturnToLastPoint ()
 
void EnterEvadeMode (EvadeReason=EVADE_REASON_OTHER) override
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
virtual void UpdateEscortAI (uint32 diff)
 
void MovementInform (uint32, uint32) override
 
void AddWaypoint (uint32 id, float x, float y, float z, uint32 waitTime=0)
 
bool SetNextWaypoint (uint32 pointId, float x, float y, float z, float orientation)
 
bool SetNextWaypoint (uint32 pointId, bool setPosition=true)
 
bool GetWaypointPosition (uint32 pointId, float &x, float &y, float &z)
 
void GenerateWaypointArray (Movement::PointsArray *points)
 
virtual void WaypointStart (uint32)
 
void Start (bool isActiveAttacker=true, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
 
void SetEscortPaused (bool on)
 
bool HasEscortState (uint32 escortState)
 
bool IsEscorted () override
 
void SetMaxPlayerDistance (float newMax)
 
float GetMaxPlayerDistance ()
 
void SetDespawnAtEnd (bool despawn)
 
void SetDespawnAtFar (bool despawn)
 
bool GetAttack ()
 
void SetCanAttack (bool attack)
 
ObjectGuid GetEventStarterGUID ()
 
void AddEscortState (uint32 escortState)
 
void RemoveEscortState (uint32 escortState)
 
virtual void WaypointReached (uint32, uint32)
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (Position const *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
Unit * DoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
Player * GetPlayerAtMinimumRange (float minRange)
 
Creature * DoSpawnCreature (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 >
T const & DUNGEON_MODE (T const &normal5, T const &heroic10) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25, T const &heroic10, T const &heroic25) const
 
Player * SelectTargetFromPlayerList (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)
 
WorldObject * GetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void OnSpellCast (SpellInfo const *)
 
virtual void OnSpellFailed (SpellInfo const *)
 
virtual void OnChannelFinished (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void OnDespawn ()
 Called when the unit is about to be removed from the world (despawn, grid unload, corpse disappearing, player logging out etc.)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast.
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true, int32 aura=0)
 Cast the spell on a random unit from the threat list.
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished.
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Public Attributes

InstanceScript * pInstance
 
SummonList summons
 
bool eventInRun
 
EventMap actionEvents
 
EventMap combatEvents
 
uint8 waveGroupId
 
uint8 waveKillCount
 
uint8 timeRiftId
 
- Public Attributes inherited from ScriptedAI
Creature * me
 

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 ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoType * AISpellInfo
 
- Protected Member Functions inherited from npc_escortAI
Player * GetPlayerForEscort ()
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
Creature * DoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ npc_arthasAI()

npc_arthas::npc_arthasAI::npc_arthasAI ( Creature *  creature)
inline
389 : npc_escortAI(creature), summons(me)
390 {
391 pInstance = creature->GetInstanceScript();
392 }
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1247
Creature * me
Definition ScriptedCreature.h:281
InstanceScript * pInstance
Definition culling_of_stratholme.cpp:394
SummonList summons
Definition culling_of_stratholme.cpp:395
Definition ScriptedEscortAI.h:53

References WorldObject::GetInstanceScript(), and pInstance.

Member Function Documentation

◆ DoAction()

void npc_arthas::npc_arthasAI::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

445 {
446 if (param == ACTION_START_EVENT)
447 {
448 // Event
449 eventInRun = true;
451 }
452 else if (param == ACTION_START_CITY)
453 {
456 me->SetWalk(true);
457 eventInRun = true;
458
461 }
462 else if (param == ACTION_KILLED_SALRAMM)
463 {
464 waveGroupId = 10;
465 eventInRun = true;
466 me->SetWalk(false);
468 }
469 else if (param == ACTION_START_TOWN_HALL)
470 {
472 SetEscortPaused(false);
473 me->SetWalk(true);
474
476 {
477 cr->AI()->DoAction(ACTION_FORCE_CHANGE_LOCK);
478 }
480 {
481 cr->AI()->DoAction(ACTION_FORCE_CHANGE_LOCK);
482 }
484 {
485 cr->AI()->DoAction(ACTION_FORCE_CHANGE_LOCK);
486 }
487 }
488 else if (param == ACTION_START_SECRET_PASSAGE)
489 {
491 SetEscortPaused(false);
492 me->SetWalk(true);
493 }
494 else if (param == ACTION_START_LAST_CITY)
495 {
497 SetEscortPaused(false);
498 me->SetWalk(false);
499 }
500 else if (param == ACTION_START_MALGANIS)
501 {
504 {
505 summons.Despawn(cr);
506 summons.Summon(cr);
507 cr->SetImmuneToAll(true);
508 cr->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
509 }
511 SetEscortPaused(false);
512 me->SetWalk(false);
513 }
514 else if (param == ACTION_KILLED_MALGANIS)
515 {
517 eventInRun = true;
519 me->SetFacingTo(1.84f);
520
521 if (!me->GetMap()->GetPlayers().IsEmpty())
522 if (Player* player = me->GetMap()->GetPlayers().getFirst()->GetSource())
523 player->RewardPlayerAndGroupAtEvent(31006, player); // Malganis quest entry required
524 }
525 }
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:258
@ ACTION_START_EVENT
Definition boss_apothecary_hummel.cpp:65
Definition Creature.h:47
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition Creature.cpp:3398
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:48
bool IsEmpty() const
Definition LinkedList.h:97
MapReference * getFirst()
Definition MapRefMgr.h:31
PlayerList const & GetPlayers() const
Definition Map.h:335
Definition Player.h:1086
FROM * GetSource() const
Definition Reference.h:97
void Despawn(Creature const *summon)
Definition ScriptedCreature.h:89
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:72
void SetFacingTo(float ori)
Definition Unit.cpp:16096
Map * GetMap() const
Definition Object.h:637
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2454
@ SAY_PHASE201
Definition culling_of_stratholme.cpp:45
@ SAY_PHASE501
Definition culling_of_stratholme.cpp:76
@ SAY_PHASE401
Definition culling_of_stratholme.cpp:67
@ SAY_PHASE404
Definition culling_of_stratholme.cpp:70
@ SAY_PHASE301
Definition culling_of_stratholme.cpp:53
@ ACTION_FORCE_CHANGE_LOCK
Definition culling_of_stratholme.cpp:176
@ NPC_CITY_MAN
Definition culling_of_stratholme.cpp:135
@ NPC_CITY_MAN2
Definition culling_of_stratholme.cpp:136
@ NPC_CITY_MAN4
Definition culling_of_stratholme.cpp:138
@ NPC_CITY_MAN3
Definition culling_of_stratholme.cpp:137
@ EVENT_ACTION_PHASE2
Definition culling_of_stratholme.cpp:202
@ EVENT_ACTION_PHASE5
Definition culling_of_stratholme.cpp:204
@ EVENT_ACTION_PHASE1
Definition culling_of_stratholme.cpp:201
@ ACTION_START_CITY
Definition culling_of_stratholme.h:152
@ ACTION_START_LAST_CITY
Definition culling_of_stratholme.h:156
@ ACTION_START_TOWN_HALL
Definition culling_of_stratholme.h:154
@ ACTION_KILLED_SALRAMM
Definition culling_of_stratholme.h:153
@ ACTION_KILLED_MALGANIS
Definition culling_of_stratholme.h:159
@ ACTION_START_SECRET_PASSAGE
Definition culling_of_stratholme.h:155
@ ACTION_START_MALGANIS
Definition culling_of_stratholme.h:158
@ NPC_MAL_GANIS
Definition culling_of_stratholme.h:71
@ EVENT_SRC_HALL_CITYMAN1
Definition culling_of_stratholme.h:124
@ EVENT_SRC_HALL_CITYMAN2
Definition culling_of_stratholme.h:125
@ EVENT_SRC_TOWN_CITYMAN1
Definition culling_of_stratholme.h:118
@ EVENT_SRC_HALL_CITYMAN3
Definition culling_of_stratholme.h:126
@ EVENT_SRC_MALGANIS_FINAL
Definition culling_of_stratholme.h:130
@ EVENT_SRC_TOWN_CITYMAN2
Definition culling_of_stratholme.h:119
const Position EventPos[]
Definition culling_of_stratholme.h:170
Talk
Definition hyjal.cpp:82
uint8 waveGroupId
Definition culling_of_stratholme.cpp:399
EventMap actionEvents
Definition culling_of_stratholme.cpp:397
bool eventInRun
Definition culling_of_stratholme.cpp:396
void EnterEvadeMode(EvadeReason=EVADE_REASON_OTHER) override
Definition ScriptedEscortAI.cpp:201
void SetEscortPaused(bool on)
Definition ScriptedEscortAI.cpp:495

References ACTION_FORCE_CHANGE_LOCK, ACTION_KILLED_MALGANIS, ACTION_KILLED_SALRAMM, ACTION_START_CITY, ACTION_START_EVENT, ACTION_START_LAST_CITY, ACTION_START_MALGANIS, ACTION_START_SECRET_PASSAGE, ACTION_START_TOWN_HALL, actionEvents, SummonList::Despawn(), SummonList::DespawnAll(), npc_escortAI::EnterEvadeMode(), EVENT_ACTION_PHASE1, EVENT_ACTION_PHASE2, EVENT_ACTION_PHASE5, EVENT_SRC_HALL_CITYMAN1, EVENT_SRC_HALL_CITYMAN2, EVENT_SRC_HALL_CITYMAN3, EVENT_SRC_MALGANIS_FINAL, EVENT_SRC_TOWN_CITYMAN1, EVENT_SRC_TOWN_CITYMAN2, eventInRun, EventPos, MapRefMgr::getFirst(), WorldObject::GetMap(), Map::GetPlayers(), Reference< TO, FROM >::GetSource(), LinkedListHead::IsEmpty(), ScriptedAI::me, NPC_CITY_MAN, NPC_CITY_MAN2, NPC_CITY_MAN3, NPC_CITY_MAN4, NPC_MAL_GANIS, SAY_PHASE201, SAY_PHASE301, SAY_PHASE401, SAY_PHASE404, SAY_PHASE501, EventMap::ScheduleEvent(), npc_escortAI::SetEscortPaused(), Unit::SetFacingTo(), Creature::SetWalk(), SummonList::Summon(), WorldObject::SummonCreature(), summons, UNIT_FLAG_NON_ATTACKABLE, and waveGroupId.

◆ GetEventNpc()

Creature * npc_arthas::npc_arthasAI::GetEventNpc ( uint32  entry)
1228{
1229 for (SummonList::iterator i = summons.begin(); i != summons.end();)
1230 {
1231 Creature* summon = ObjectAccessor::GetCreature(*me, *i);
1232 if (!summon)
1233 summons.erase(i++);
1234 else if (summon->GetEntry() == entry)
1235 return summon;
1236 else
1237 ++i;
1238 }
1239
1240 return nullptr;
1241}
uint32 GetEntry() const
Definition Object.h:123
iterator erase(iterator i)
Definition ScriptedCreature.h:68
iterator begin()
Definition ScriptedCreature.h:48
iterator end()
Definition ScriptedCreature.h:58
StorageType::iterator iterator
Definition ScriptedCreature.h:36
Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:234

References SummonList::begin(), SummonList::end(), SummonList::erase(), ObjectAccessor::GetCreature(), Object::GetEntry(), ScriptedAI::me, and summons.

Referenced by UpdateAI(), and WaypointReached().

◆ JustDied()

void npc_arthas::npc_arthasAI::JustDied ( Unit *  )
inlineoverridevirtual

Reimplemented from CreatureAI.

423 {
427 if (pInstance)
429 }
@ STATE_ESCORT_ESCORTING
Definition ScriptedEscortAI.h:47
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
@ DATA_ARTHAS_REPOSITION
Definition culling_of_stratholme.h:53
void ResetEngagedBosses()
Definition culling_of_stratholme.cpp:412
void RemoveEscortState(uint32 escortState)
Definition ScriptedEscortAI.h:115

References DATA_ARTHAS_REPOSITION, SummonList::DespawnAll(), pInstance, npc_escortAI::RemoveEscortState(), ResetEngagedBosses(), ZoneScript::SetData(), STATE_ESCORT_ESCORTING, and summons.

◆ JustEngagedWith()

void npc_arthas::npc_arthasAI::JustEngagedWith ( Unit *  )
overridevirtual

Called for reaction when initially engaged - this happens after JustEnteredCombat.

Reimplemented from CreatureAI.

1265{
1267
1268 // Fight
1271}
void RescheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:70
SpellCastResult DoCast(uint32 spellId)
Definition UnitAI.cpp:179
@ SPELL_ARTHAS_AURA
Definition culling_of_stratholme.cpp:144
@ EVENT_COMBAT_HEALTH_CHECK
Definition culling_of_stratholme.cpp:200
@ EVENT_COMBAT_EXORCISM
Definition culling_of_stratholme.cpp:199
EventMap combatEvents
Definition culling_of_stratholme.cpp:398

References EVENT_COMBAT_EXORCISM, EVENT_COMBAT_HEALTH_CHECK, and SPELL_ARTHAS_AURA.

◆ JustSummoned()

void npc_arthas::npc_arthasAI::JustSummoned ( Creature *  cr)
inlineoverridevirtual

Reimplemented from CreatureAI.

432 {
433 summons.Summon(cr);
434 }

References SummonList::Summon(), and summons.

◆ ReorderInstance()

void npc_arthas::npc_arthasAI::ReorderInstance ( uint32  data)
1274{
1275 me->SetWalk(false);
1276 Start(true);
1277 SetEscortPaused(true);
1278 SetDespawnAtEnd(false);
1279
1280 switch (data)
1281 {
1283 SetNextWaypoint(9, false);
1285 break;
1289 SetNextWaypoint(12, false);
1291
1293 {
1294 eventInRun = true;
1296 }
1297 else if (data == COS_PROGRESS_KILLED_MEATHOOK)
1298 {
1299 waveGroupId = 4;
1301 }
1302 else // if (data == COS_PROGRESS_KILLED_SALRAMM)
1303 {
1304 if (pInstance)
1307 }
1308 break;
1310 SetNextWaypoint(21, false);
1312 break;
1314 SetNextWaypoint(32, false);
1316 break;
1318 SetNextWaypoint(46, false);
1320 break;
1322 SetNextWaypoint(55, false);
1324 break;
1325 }
1326
1327 if (data >= COS_PROGRESS_KILLED_EPOCH)
1328 if (pInstance)
1330 pGate->SetGoState(GO_STATE_ACTIVE);
1331
1333}
@ GO_STATE_ACTIVE
Definition GameObjectData.h:708
@ UNIT_NPC_FLAG_GOSSIP
Definition UnitDefines.h:322
@ REACT_DEFENSIVE
Definition Unit.h:570
@ WORLD_STATE_CULLING_OF_STRATHOLME_WAVE_COUNT
Definition WorldStateDefines.h:557
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:100
Definition GameObject.h:125
ObjectGuid GetGuidData(uint32 type) const override
Definition InstanceScript.cpp:121
Map * instance
Definition InstanceScript.h:149
void DoUpdateWorldState(uint32 worldstateId, uint32 worldstateValue)
Definition InstanceScript.cpp:645
GameObject * GetGameObject(ObjectGuid const &guid)
Definition Map.cpp:2447
void SetNpcFlag(NPCFlags flags)
Definition Unit.h:767
@ NPC_MEATHOOK
Definition culling_of_stratholme.h:68
@ DATA_SHKAF_GATE
Definition culling_of_stratholme.h:62
@ COS_PROGRESS_REACHED_TOWN_HALL
Definition culling_of_stratholme.h:142
@ COS_PROGRESS_KILLED_EPOCH
Definition culling_of_stratholme.h:143
@ COS_PROGRESS_LAST_CITY
Definition culling_of_stratholme.h:144
@ COS_PROGRESS_KILLED_MEATHOOK
Definition culling_of_stratholme.h:140
@ COS_PROGRESS_FINISHED_CITY_INTRO
Definition culling_of_stratholme.h:139
@ COS_PROGRESS_FINISHED_INTRO
Definition culling_of_stratholme.h:138
@ COS_PROGRESS_KILLED_SALRAMM
Definition culling_of_stratholme.h:141
@ COS_PROGRESS_BEFORE_MALGANIS
Definition culling_of_stratholme.h:145
@ DATA_SHOW_INFINITE_TIMER
Definition culling_of_stratholme.h:52
void DoAction(int32 param) override
Definition culling_of_stratholme.cpp:444
void SendNextWave(uint32 entry)
Definition culling_of_stratholme.cpp:1335
void Start(bool isActiveAttacker=true, ObjectGuid playerGUID=ObjectGuid::Empty, Quest const *quest=nullptr, bool instantRespawn=false, bool canLoopPath=false, bool resetWaypoints=true)
Definition ScriptedEscortAI.cpp:428
void SetDespawnAtEnd(bool despawn)
Definition ScriptedEscortAI.h:108
bool SetNextWaypoint(uint32 pointId, float x, float y, float z, float orientation)
Definition ScriptedEscortAI.cpp:506

References ACTION_KILLED_SALRAMM, COS_PROGRESS_BEFORE_MALGANIS, COS_PROGRESS_FINISHED_CITY_INTRO, COS_PROGRESS_FINISHED_INTRO, COS_PROGRESS_KILLED_EPOCH, COS_PROGRESS_KILLED_MEATHOOK, COS_PROGRESS_KILLED_SALRAMM, COS_PROGRESS_LAST_CITY, COS_PROGRESS_REACHED_TOWN_HALL, DATA_SHKAF_GATE, DATA_SHOW_INFINITE_TIMER, EVENT_ACTION_PHASE2, GO_STATE_ACTIVE, NPC_MEATHOOK, REACT_DEFENSIVE, UNIT_NPC_FLAG_GOSSIP, and WORLD_STATE_CULLING_OF_STRATHOLME_WAVE_COUNT.

Referenced by Reset().

◆ Reset()

void npc_arthas::npc_arthasAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

528 {
533 eventInRun = false;
534 waveGroupId = 0;
535 waveKillCount = 0;
536 timeRiftId = 0;
537
539
540 if (pInstance)
541 {
544 if (data >= COS_PROGRESS_FINISHED_INTRO)
545 ReorderInstance(data);
546 }
547 }
std::uint32_t uint32
Definition Define.h:107
void Reset()
Definition EventMap.cpp:21
void RemoveNpcFlag(NPCFlags flags)
Definition Unit.h:768
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:51
@ DATA_ARTHAS_EVENT
Definition culling_of_stratholme.h:45
uint8 waveKillCount
Definition culling_of_stratholme.cpp:400
uint8 timeRiftId
Definition culling_of_stratholme.cpp:401
void ReorderInstance(uint32 data)
Definition culling_of_stratholme.cpp:1273

References actionEvents, combatEvents, COS_PROGRESS_FINISHED_INTRO, DATA_ARTHAS_EVENT, DATA_ARTHAS_REPOSITION, SummonList::DespawnAll(), eventInRun, ZoneScript::GetData(), ScriptedAI::me, pInstance, Unit::RemoveNpcFlag(), ReorderInstance(), EventMap::Reset(), ResetEngagedBosses(), ZoneScript::SetData(), summons, timeRiftId, UNIT_NPC_FLAG_GOSSIP, waveGroupId, and waveKillCount.

◆ ResetEngagedBosses()

void npc_arthas::npc_arthasAI::ResetEngagedBosses ( )
inline
413 {
414 if (!pInstance)
415 return;
416
417 for (uint32 bossId = BOSS_MEATHOOK; bossId <= BOSS_MAL_GANIS; ++bossId)
418 if (pInstance->GetBossState(bossId) == IN_PROGRESS)
420 }
@ IN_PROGRESS
Definition InstanceScript.h:59
@ NOT_STARTED
Definition InstanceScript.h:58
virtual bool SetBossState(uint32 id, EncounterState state)
Definition InstanceScript.cpp:406
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:252
@ BOSS_MEATHOOK
Definition culling_of_stratholme.h:28
@ BOSS_MAL_GANIS
Definition culling_of_stratholme.h:31

References BOSS_MAL_GANIS, BOSS_MEATHOOK, InstanceScript::GetBossState(), IN_PROGRESS, NOT_STARTED, pInstance, and InstanceScript::SetBossState().

Referenced by JustDied(), and Reset().

◆ ScheduleNextEvent()

void npc_arthas::npc_arthasAI::ScheduleNextEvent ( uint32  currentEvent,
Milliseconds  time 
)
1244{
1245 actionEvents.ScheduleEvent(currentEvent + 1, time);
1246}

Referenced by UpdateAI().

◆ SendNextWave()

void npc_arthas::npc_arthasAI::SendNextWave ( uint32  entry)
1336{
1337 if (!pInstance)
1338 return;
1339
1340 if (entry == NPC_MEATHOOK)
1341 {
1342 waveKillCount = 4;
1344 }
1345 else if (entry == NPC_SALRAMM)
1346 {
1348 return;
1349 }
1350
1351 // Group is killed
1352 if (++waveKillCount >= 4)
1353 {
1354 waveGroupId++;
1355 if (waveGroupId == 4) // Meathook
1357 else if (waveGroupId == 9) // Salramm
1359 else
1361
1363 }
1364}
@ NPC_SALRAMM
Definition culling_of_stratholme.h:69
@ EVENT_SRC_SALRAMM
Definition culling_of_stratholme.h:123
@ EVENT_SRC_MEATHOOK
Definition culling_of_stratholme.h:122
void SummonNextWave()
Definition culling_of_stratholme.cpp:1248

References COS_PROGRESS_KILLED_MEATHOOK, COS_PROGRESS_KILLED_SALRAMM, DATA_ARTHAS_EVENT, EVENT_SRC_MEATHOOK, EVENT_SRC_SALRAMM, EventPos, NPC_MEATHOOK, NPC_SALRAMM, and WORLD_STATE_CULLING_OF_STRATHOLME_WAVE_COUNT.

Referenced by SummonedCreatureDies().

◆ SpawnTimeRift()

void npc_arthas::npc_arthasAI::SpawnTimeRift ( )
1367{
1368 if (timeRiftId >= 5)
1369 return;
1370
1372 {
1373 // Spawn everyone at time rift pos
1375 {
1376 if (cr->GetEntry() == NPC_TIME_RIFT)
1377 cr->DespawnOrUnsummon(10s);
1378 else // x, y, z (0 is entry)
1379 {
1380 // first infinite
1381 if (i == 1)
1382 AttackStart(cr);
1383
1384 cr->SetInCombatWithZone();
1385 cr->AddThreat(me, 0.0f);
1386 cr->SetReactState(REACT_AGGRESSIVE);
1388 }
1389 }
1390 }
1391
1392 timeRiftId++;
1393}
std::uint8_t uint8
Definition Define.h:109
@ REACT_AGGRESSIVE
Definition Unit.h:571
@ POINT_CHRONOS
Definition culling_of_stratholme.cpp:178
@ ENCOUNTER_CHRONO_MAX_SPAWNS_FIRST
Definition culling_of_stratholme.cpp:172
@ ENCOUNTER_CHRONO_MAX_SPAWNS_SECOND
Definition culling_of_stratholme.cpp:173
float RiftAndSpawnsLocations[ENCOUNTER_CHRONO_NUMBER][ENCOUNTER_CHRONO_MAX_SPAWNS_FIRST][5]
Definition culling_of_stratholme.cpp:261
@ NPC_TIME_RIFT
Definition culling_of_stratholme.h:78
void AttackStart(Unit *who) override
Definition ScriptedEscortAI.cpp:44

References ENCOUNTER_CHRONO_MAX_SPAWNS_FIRST, ENCOUNTER_CHRONO_MAX_SPAWNS_SECOND, NPC_TIME_RIFT, POINT_CHRONOS, REACT_AGGRESSIVE, RiftAndSpawnsLocations, and WorldObject::SummonCreature().

Referenced by WaypointReached().

◆ SummonedCreatureDespawn()

void npc_arthas::npc_arthasAI::SummonedCreatureDespawn ( Creature *  cr)
inlineoverridevirtual

Reimplemented from CreatureAI.

436{ summons.Despawn(cr); }

References SummonList::Despawn(), and summons.

◆ SummonedCreatureDies()

◆ SummonNextWave()

void npc_arthas::npc_arthasAI::SummonNextWave ( )
1249{
1250 Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
1251 if (!PlayerList.IsEmpty())
1252 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
1253 i->GetSource()->PlayerTalkClass->SendPointOfInterest(1000 + waveGroupId);
1254
1255 waveKillCount = 0; // this is forced condition!
1256 uint32 tableId = waveGroupId;
1257 if (tableId > 4)
1258 tableId--;
1259
1260 for (uint32 i = 0; i < ENCOUNTER_WAVES_MAX_SPAWNS; ++i)
1261 me->SummonCreature(/*entry*/(uint32)WavesLocations[tableId][i][0], WavesLocations[tableId][i][1], WavesLocations[tableId][i][2], WavesLocations[tableId][i][3], WavesLocations[tableId][i][4]);
1262}
Definition LinkedList.h:139
Definition MapRefMgr.h:26
iterator begin()
Definition MapRefMgr.h:36
iterator end()
Definition MapRefMgr.h:37
@ ENCOUNTER_WAVES_MAX_SPAWNS
Definition culling_of_stratholme.cpp:168
float WavesLocations[ENCOUNTER_WAVES_NUMBER][ENCOUNTER_WAVES_MAX_SPAWNS][5]
Definition culling_of_stratholme.cpp:208

References MapRefMgr::begin(), ENCOUNTER_WAVES_MAX_SPAWNS, MapRefMgr::end(), LinkedListHead::IsEmpty(), and WavesLocations.

Referenced by UpdateAI().

◆ UpdateAI()

void npc_arthas::npc_arthasAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

699 {
701
702 if (eventInRun)
703 {
704 actionEvents.Update(diff);
705 switch (uint32 currentEvent = actionEvents.ExecuteEvent())
706 {
708 me->SetWalk(true);
711 {
713 uther->SetTarget(me->GetGUID());
714 me->SetTarget(uther->GetGUID());
715 }
716 for (int i = 0; i < 3; ++i)
718 horse->GetMotionMaster()->MovePoint(0, EventPos[EVENT_DST_HORSE1 + i], FORCED_MOVEMENT_NONE, 0.f, false);
719
720 ScheduleNextEvent(currentEvent, 4s);
721 break;
722 case EVENT_ACTION_PHASE1+1:
723 // Start Event
724 me->SetWalk(true);
725 Start(true);
726 SetDespawnAtEnd(false);
727 SetDespawnAtFar(false);
728
729 ScheduleNextEvent(currentEvent, 9s);
730 break;
731 // After waypoint 0
732 case EVENT_ACTION_PHASE1+2:
734 ScheduleNextEvent(currentEvent, 2s);
735 break;
736 case EVENT_ACTION_PHASE1+3:
737 if (Creature* uther = GetEventNpc(NPC_UTHER))
738 uther->AI()->Talk(SAY_PHASE102);
739
740 ScheduleNextEvent(currentEvent, 8s);
741 break;
742 case EVENT_ACTION_PHASE1+4:
743 SetEscortPaused(false);
744 eventInRun = false;
746 ScheduleNextEvent(currentEvent, 2s);
747 break;
748 // After waypoint 1
749 case EVENT_ACTION_PHASE1+5:
750 if (Creature* jaina = GetEventNpc(NPC_JAINA))
751 jaina->SetTarget(me->GetGUID());
752
754 ScheduleNextEvent(currentEvent, 10s);
755 break;
756 case EVENT_ACTION_PHASE1+6:
757 if (Creature* uther = GetEventNpc(NPC_UTHER))
758 uther->AI()->Talk(SAY_PHASE105);
759
760 ScheduleNextEvent(currentEvent, 1s);
761 break;
762 case EVENT_ACTION_PHASE1+7:
764 ScheduleNextEvent(currentEvent, 4s);
765 break;
766 case EVENT_ACTION_PHASE1+8:
767 if (Creature* uther = GetEventNpc(NPC_UTHER))
768 uther->AI()->Talk(SAY_PHASE107);
769
770 ScheduleNextEvent(currentEvent, 6s);
771 break;
772 case EVENT_ACTION_PHASE1+9:
774 ScheduleNextEvent(currentEvent, 4s);
775 break;
776 case EVENT_ACTION_PHASE1+10:
777 if (Creature* uther = GetEventNpc(NPC_UTHER))
778 uther->AI()->Talk(SAY_PHASE109);
779
780 ScheduleNextEvent(currentEvent, 8s);
781 break;
782 case EVENT_ACTION_PHASE1+11:
784 ScheduleNextEvent(currentEvent, 4s);
785 break;
786 case EVENT_ACTION_PHASE1+12:
787 if (Creature* uther = GetEventNpc(NPC_UTHER))
788 uther->AI()->Talk(SAY_PHASE111);
789
790 ScheduleNextEvent(currentEvent, 4s);
791 break;
792 case EVENT_ACTION_PHASE1+13:
794 ScheduleNextEvent(currentEvent, 11s);
795 break;
796 case EVENT_ACTION_PHASE1+14:
797 if (Creature* jaina = GetEventNpc(NPC_JAINA))
798 jaina->AI()->Talk(SAY_PHASE113);
799
800 ScheduleNextEvent(currentEvent, 2500ms);
801 break;
802 case EVENT_ACTION_PHASE1+15:
804 ScheduleNextEvent(currentEvent, 9s);
805 break;
806 case EVENT_ACTION_PHASE1+16:
807 if (Creature* uther = GetEventNpc(NPC_UTHER))
808 uther->AI()->Talk(SAY_PHASE115);
809
810 ScheduleNextEvent(currentEvent, 4s);
811 break;
812 case EVENT_ACTION_PHASE1+17:
813 for (SummonList::const_iterator i = summons.begin(); i != summons.end(); ++i)
814 {
816 if (summon && summon->GetEntry() == NPC_HORSE_ESCORT)
818 }
819
820 ScheduleNextEvent(currentEvent, 1s);
821 break;
822 case EVENT_ACTION_PHASE1+18:
823 if (Creature* uther = GetEventNpc(NPC_UTHER))
824 {
825 uther->SetTarget();
826 uther->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
827 uther->GetMotionMaster()->MovePoint(0, EventPos[EVENT_POS_RETREAT], FORCED_MOVEMENT_NONE, 0.f, false);
828 }
829 ScheduleNextEvent(currentEvent, 1s);
830 break;
831 case EVENT_ACTION_PHASE1+19:
832 if (Creature* jaina = GetEventNpc(NPC_JAINA))
833 {
834 jaina->SetTarget();
835 jaina->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
836 jaina->GetMotionMaster()->MovePoint(0, EventPos[EVENT_POS_RETREAT], FORCED_MOVEMENT_NONE, 0.f, false);
837 }
839 ScheduleNextEvent(currentEvent, 2s);
840 break;
841 case EVENT_ACTION_PHASE1+20:
842 if (Creature* jaina = GetEventNpc(NPC_JAINA))
843 {
844 jaina->GetMotionMaster()->MoveIdle();
845 jaina->AI()->Talk(SAY_PHASE117);
846 }
847
848 ScheduleNextEvent(currentEvent, 2s);
849 break;
850 case EVENT_ACTION_PHASE1+21:
851 if (Creature* jaina = GetEventNpc(NPC_JAINA))
852 {
853 jaina->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
854 jaina->GetMotionMaster()->MovePoint(0, EventPos[EVENT_POS_RETREAT], FORCED_MOVEMENT_NONE, 0.f, false);
855 }
857 ScheduleNextEvent(currentEvent, 4s);
858 break;
859 case EVENT_ACTION_PHASE1+22:
860 SetEscortPaused(false);
861 eventInRun = false;
862 me->SetTarget();
863 // dont schedule next, do it in gossip select!
864 break;
865 //After Gossip 1 (waypoint 8)
867 summons.DespawnEntry(NPC_INVIS_TARGET); // remove trigger
868 me->SetTarget();
869 SetEscortPaused(false);
870 eventInRun = false;
871 ScheduleNextEvent(currentEvent, 1s);
872 break;
873 // After waypoint 9
874 case EVENT_ACTION_PHASE2+1:
875 if (Creature* cityman = GetEventNpc(NPC_CITY_MAN))
876 {
877 cityman->AI()->Talk(SAY_PHASE202);
878 cityman->SetTarget(me->GetGUID());
879 cityman->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
880 cityman->GetMotionMaster()->MovePoint(0, EventPos[EVENT_DST_CITYMAN]);
881 }
882
883 ScheduleNextEvent(currentEvent, 9s);
884 break;
885 case EVENT_ACTION_PHASE2+2:
887 SetEscortPaused(false);
888 eventInRun = false;
889 ScheduleNextEvent(currentEvent, 1500ms);
890 break;
891 // After waypoint 11
892 case EVENT_ACTION_PHASE2+3:
893 if (Creature* stalker = me->SummonCreature(NPC_INVIS_TARGET, 2081.447f, 1287.770f, 141.3241f, 1.37f, TEMPSUMMON_TIMED_DESPAWN, 10000))
894 {
895 me->SetFacingToObject(stalker);
896 stalker->DespawnOrUnsummon(500ms);
897 }
899 ScheduleNextEvent(currentEvent, 4s);
900 break;
901 case EVENT_ACTION_PHASE2+4:
903 {
904 malganis->CastSpell(malganis, SPELL_MALGANIS_APPEAR, true);
905 malganis->AI()->Talk(SAY_PHASE206);
906 malganis->SetTarget(me->GetGUID());
907 me->SetTarget(malganis->GetGUID());
908 malganis->SetReactState(REACT_PASSIVE);
909
910 std::list<Creature*> unitList;
911 malganis->GetCreaturesWithEntryInRange(unitList, 20.0f, NPC_CITY_MAN);
912 malganis->GetCreaturesWithEntryInRange(unitList, 20.0f, NPC_CITY_MAN2);
913
914 for (std::list<Creature*>::const_iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
915 if ((*itr)->ToCreature())
916 {
917 (*itr)->ToCreature()->AI()->DoAction(ACTION_INFECT_CITIZIEN);
918 (*itr)->GetMotionMaster()->MoveFleeing(malganis, 2000);
919 }
920
921 unitList.clear();
922 }
923
924 ScheduleNextEvent(currentEvent, 12s);
925 break;
926 case EVENT_ACTION_PHASE2+5:
927 if (Creature* malganis = GetEventNpc(NPC_MAL_GANIS))
928 malganis->AI()->Talk(SAY_PHASE207);
929
930 ScheduleNextEvent(currentEvent, 15s);
931 break;
932 case EVENT_ACTION_PHASE2+6:
933 if (Creature* malganis = GetEventNpc(NPC_MAL_GANIS))
934 {
935 me->SetTarget();
936 me->SetFacingToObject(malganis);
937 malganis->SetVisible(false);
938 }
939
941 ScheduleNextEvent(currentEvent, 11s);
942 break;
943 case EVENT_ACTION_PHASE2+7:
949 ScheduleNextEvent(currentEvent, 20s);
950 if (pInstance)
952 break;
953 case EVENT_ACTION_PHASE2+8:
954 if (pInstance)
956
958 break;
959 case EVENT_ACTION_PHASE2+9:
960 if (pInstance)
962
964 eventInRun = false;
965 SetEscortPaused(false);
966 break;
967 // After waypoint 22
971 cr->SetTarget(me->GetGUID());
973 cr->SetTarget(me->GetGUID());
975 cr->SetTarget(me->GetGUID());
976 ScheduleNextEvent(currentEvent, 1s);
977 break;
978 case EVENT_ACTION_PHASE3+1:
981 cr->AI()->Talk(SAY_PHASE302);
982
983 ScheduleNextEvent(currentEvent, 7s);
984 break;
985 case EVENT_ACTION_PHASE3+2:
987 SetEscortPaused(false);
988 eventInRun = false;
989 ScheduleNextEvent(currentEvent, 0ms);
990 break;
991 // After waypoint 23
992 case EVENT_ACTION_PHASE3+3:
993 me->SetWalk(false);
996 ScheduleNextEvent(currentEvent, 2s);
997 break;
998 case EVENT_ACTION_PHASE3+4:
1000 ScheduleNextEvent(currentEvent, 2s);
1001 break;
1002 case EVENT_ACTION_PHASE3+5:
1004 cr->AI()->Talk(SAY_PHASE305);
1005 ScheduleNextEvent(currentEvent, 1s);
1006 break;
1007 // Trio citizen transformation right as we enter Town Hall
1008 case EVENT_ACTION_PHASE3+6:
1010 {
1011 cr->UpdateEntry(NPC_INFINITE_HUNTER, nullptr, false);
1012 cr->SetFullHealth();
1013 cr->SetImmuneToAll(true);
1014 cr->SetReactState(REACT_PASSIVE);
1015 }
1016 ScheduleNextEvent(currentEvent, 2s);
1017 break;
1018 case EVENT_ACTION_PHASE3+7:
1020 {
1021 cr->UpdateEntry(NPC_INFINITE_AGENT, nullptr, false);
1022 cr->SetFullHealth();
1023 cr->SetImmuneToAll(true);
1024 cr->SetReactState(REACT_PASSIVE);
1025 }
1026 ScheduleNextEvent(currentEvent, 2s);
1027 break;
1028 case EVENT_ACTION_PHASE3+8:
1030 {
1031 cr->UpdateEntry(NPC_INFINITE_ADVERSARY, nullptr, false);
1032 cr->SetFullHealth();
1033 cr->SetReactState(REACT_AGGRESSIVE);
1034 cr->SetInCombatWithZone();
1035 cr->AddThreat(me, 0.0f);
1036 }
1038 {
1039 cr->SetImmuneToAll(false);
1040 cr->SetReactState(REACT_AGGRESSIVE);
1041 cr->SetInCombatWithZone();
1042 cr->AddThreat(me, 0.0f);
1043 }
1045 {
1046 cr->SetImmuneToAll(false);
1047 cr->SetReactState(REACT_AGGRESSIVE);
1048 cr->SetInCombatWithZone();
1049 cr->AddThreat(me, 0.0f);
1050 }
1051 ScheduleNextEvent(currentEvent, 2s);
1052 break;
1053 case EVENT_ACTION_PHASE3+9:
1054 // Arthas is fighting infinites in town hall
1055 if (me->IsInCombat())
1056 {
1057 actionEvents.Repeat(1s);
1058 return;
1059 }
1060
1063 me->SetFacingTo(0.0f);
1064 ScheduleNextEvent(currentEvent, 5s);
1065 break;
1066 case EVENT_ACTION_PHASE3+10:
1068 ScheduleNextEvent(currentEvent, 5s);
1069 break;
1070 case EVENT_ACTION_PHASE3+11:
1071 SetEscortPaused(false);
1072 eventInRun = false;
1073 ScheduleNextEvent(currentEvent, 1s);
1074 break;
1075 case EVENT_ACTION_PHASE3+12:
1076 // Arthas is fighting first chronos
1077 if (me->IsInCombat())
1078 {
1079 actionEvents.Repeat(1s);
1080 return;
1081 }
1082
1083 eventInRun = false;
1084 SetEscortPaused(false);
1086 me->SetFacingTo(M_PI);
1087 ScheduleNextEvent(currentEvent, 0ms);
1088 break;
1089 case EVENT_ACTION_PHASE3+13:
1090 // Arthas is fighting second chronos
1091 if (me->IsInCombat())
1092 {
1093 actionEvents.Repeat(1s);
1094 return;
1095 }
1096
1097 eventInRun = false;
1098 SetEscortPaused(false);
1100 me->SetFacingTo(M_PI * 3 / 2);
1101 ScheduleNextEvent(currentEvent, 0ms);
1102 break;
1103 case EVENT_ACTION_PHASE3+14:
1104 // Arthas is fighting third chronos
1105 if (me->IsInCombat())
1106 {
1107 actionEvents.Repeat(1s);
1108 return;
1109 }
1110
1111 me->SetFacingTo(M_PI / 2);
1112 ScheduleNextEvent(currentEvent, 8s);
1113 break;
1114 case EVENT_ACTION_PHASE3+15:
1118 {
1119 cr->SetImmuneToAll(true);
1120 cr->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
1121 me->SetTarget(cr->GetGUID());
1122 cr->GetMotionMaster()->MovePoint(0, EventPos[EVENT_DST_EPOCH]);
1123 }
1124
1125 ScheduleNextEvent(currentEvent, 3s);
1126 break;
1127 case EVENT_ACTION_PHASE3+16:
1128 if (Creature* cr = GetEventNpc(NPC_EPOCH))
1129 cr->AI()->Talk(SAY_PHASE314);
1130
1131 ScheduleNextEvent(currentEvent, 14s);
1132 break;
1133 case EVENT_ACTION_PHASE3+17:
1135 ScheduleNextEvent(currentEvent, 7s);
1136 break;
1137 case EVENT_ACTION_PHASE3+18:
1138 if (Creature* cr = GetEventNpc(NPC_EPOCH))
1139 {
1140 cr->SetImmuneToAll(false);
1141 cr->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
1142 cr->SetReactState(REACT_AGGRESSIVE);
1143 cr->AddThreat(me, 0.0f);
1144 cr->SetInCombatWithZone();
1145 }
1146 ScheduleNextEvent(currentEvent, 1s);
1147 break;
1148 case EVENT_ACTION_PHASE3+19:
1149 // Arthas is fighting epoch chronos
1150 if (me->IsInCombat())
1151 {
1152 actionEvents.Repeat(1s);
1153 return;
1154 }
1155
1156 if (pInstance)
1158
1160 eventInRun = false;
1161 break;
1164 {
1165 cr->SetImmuneToAll(false);
1166 cr->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
1167 cr->SetInCombatWithZone();
1168 cr->AddThreat(me, 0.0f);
1169 AttackStart(cr);
1170 }
1171 eventInRun = false;
1172 SetEscortPaused(true);
1173 break;
1174 case EVENT_ACTION_PHASE5+1:
1176 SetEscortPaused(false);
1177 eventInRun = false;
1178 ScheduleNextEvent(currentEvent, 5s);
1179 break;
1180 case EVENT_ACTION_PHASE5+2:
1181 me->SetFacingTo(5.28f);
1183 if (pInstance)
1184 {
1187 go->SetGoState(GO_STATE_ACTIVE);
1188 }
1189 ScheduleNextEvent(currentEvent, 10s);
1190 break;
1191 case EVENT_ACTION_PHASE5+3:
1192 eventInRun = false;
1193 me->SetVisible(false);
1194 break;
1195 }
1196 }
1197
1198 //Battling skills
1199 if (!me->GetVictim())
1200 return;
1201
1202 combatEvents.Update(diff);
1204 return;
1205
1206 switch (combatEvents.ExecuteEvent())
1207 {
1210 me->CastSpell(target, SPELL_ARTHAS_EXORCISM, false);
1211
1212 combatEvents.Repeat(7s, 14s);
1213 break;
1215 if (HealthBelowPct(40))
1217
1218 combatEvents.Repeat(1s);
1219 break;
1220 }
1221
1223 }
@ FORCED_MOVEMENT_NONE
Definition MotionMaster.h:86
@ TEMPSUMMON_DEAD_DESPAWN
Definition Object.h:56
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:52
@ MOVEMENTFLAG_WALKING
Definition UnitDefines.h:380
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ REACT_PASSIVE
Definition Unit.h:569
void SetTarget(ObjectGuid guid=ObjectGuid::Empty) override
Definition Creature.cpp:3619
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:76
EventId ExecuteEvent()
Definition EventMap.cpp:86
void MovePoint(uint32 id, Position const &pos, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE, float speed=0.f, bool generatePath=true, bool forceDestination=true, std::optional< AnimTier > animTier=std::nullopt)
Definition MotionMaster.h:241
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:120
StorageType::const_iterator const_iterator
Definition ScriptedCreature.h:37
void DespawnEntry(uint32 entry)
Definition ScriptedCreature.cpp:55
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:41
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:112
Definition Unit.h:667
void SetVisible(bool x)
Definition Unit.cpp:10876
void SetFacingToObject(WorldObject *object, Milliseconds timed=0ms)
Definition Unit.cpp:16106
MotionMaster * GetMotionMaster()
Definition Unit.h:1766
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition Unit.cpp:1372
Unit * GetVictim() const
Definition Unit.h:907
bool HasUnitState(const uint32 f) const
Definition Unit.h:739
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition Unit.h:935
bool IsInCombat() const
Definition Unit.h:946
@ SAY_PHASE210
Definition culling_of_stratholme.cpp:50
@ SAY_PHASE203
Definition culling_of_stratholme.cpp:46
@ SAY_PHASE302
Definition culling_of_stratholme.cpp:108
@ SAY_PHASE105
Definition culling_of_stratholme.cpp:90
@ SAY_PHASE116
Definition culling_of_stratholme.cpp:41
@ SAY_PHASE202
Definition culling_of_stratholme.cpp:101
@ SAY_PHASE109
Definition culling_of_stratholme.cpp:92
@ SAY_PHASE305_1
Definition culling_of_stratholme.cpp:110
@ SAY_PHASE103
Definition culling_of_stratholme.cpp:34
@ SAY_PHASE205
Definition culling_of_stratholme.cpp:47
@ SAY_PHASE111
Definition culling_of_stratholme.cpp:93
@ SAY_PHASE308
Definition culling_of_stratholme.cpp:58
@ SAY_PHASE306
Definition culling_of_stratholme.cpp:56
@ SAY_PHASE315
Definition culling_of_stratholme.cpp:64
@ SAY_PHASE114
Definition culling_of_stratholme.cpp:40
@ SAY_PHASE303
Definition culling_of_stratholme.cpp:54
@ SAY_PHASE311
Definition culling_of_stratholme.cpp:61
@ SAY_PHASE207
Definition culling_of_stratholme.cpp:83
@ SAY_PHASE113
Definition culling_of_stratholme.cpp:97
@ SAY_PHASE209
Definition culling_of_stratholme.cpp:49
@ SAY_PHASE503
Definition culling_of_stratholme.cpp:78
@ SAY_PHASE206
Definition culling_of_stratholme.cpp:82
@ SAY_PHASE112
Definition culling_of_stratholme.cpp:39
@ SAY_PHASE108
Definition culling_of_stratholme.cpp:37
@ SAY_PHASE104
Definition culling_of_stratholme.cpp:35
@ SAY_PHASE117
Definition culling_of_stratholme.cpp:98
@ SAY_PHASE107
Definition culling_of_stratholme.cpp:91
@ SAY_PHASE504
Definition culling_of_stratholme.cpp:79
@ SAY_PHASE101
Definition culling_of_stratholme.cpp:33
@ SAY_PHASE314
Definition culling_of_stratholme.cpp:86
@ SAY_PHASE208
Definition culling_of_stratholme.cpp:48
@ SAY_PHASE102
Definition culling_of_stratholme.cpp:89
@ SAY_PHASE304
Definition culling_of_stratholme.cpp:55
@ SAY_PHASE313
Definition culling_of_stratholme.cpp:63
@ SAY_PHASE110
Definition culling_of_stratholme.cpp:38
@ SAY_PHASE305
Definition culling_of_stratholme.cpp:109
@ SAY_PHASE115
Definition culling_of_stratholme.cpp:94
@ SAY_PHASE106
Definition culling_of_stratholme.cpp:36
@ ACTION_INFECT_CITIZIEN
Definition culling_of_stratholme.cpp:175
@ SPELL_MALGANIS_APPEAR
Definition culling_of_stratholme.cpp:149
@ SPELL_ARTHAS_CRUSADER_STRIKE
Definition culling_of_stratholme.cpp:151
@ SPELL_ARTHAS_EXORCISM
Definition culling_of_stratholme.cpp:145
@ SPELL_ARTHAS_HOLY_LIGHT
Definition culling_of_stratholme.cpp:146
@ NPC_INVIS_TARGET
Definition culling_of_stratholme.cpp:131
@ NPC_INFINITE_ADVERSARY
Definition culling_of_stratholme.cpp:126
@ NPC_HORSE_ESCORT
Definition culling_of_stratholme.cpp:133
@ NPC_INFINITE_AGENT
Definition culling_of_stratholme.cpp:128
@ NPC_INFINITE_HUNTER
Definition culling_of_stratholme.cpp:127
@ EVENT_ACTION_PHASE3
Definition culling_of_stratholme.cpp:203
@ NPC_EPOCH
Definition culling_of_stratholme.h:70
@ NPC_UTHER
Definition culling_of_stratholme.h:75
@ DATA_EXIT_GATE
Definition culling_of_stratholme.h:63
@ COS_PROGRESS_FINISHED
Definition culling_of_stratholme.h:146
@ EVENT_POS_RETREAT
Definition culling_of_stratholme.h:117
@ EVENT_SRC_UTHER
Definition culling_of_stratholme.h:108
@ EVENT_DST_HORSE1
Definition culling_of_stratholme.h:114
@ EVENT_DST_CITYMAN
Definition culling_of_stratholme.h:120
@ EVENT_SRC_EPOCH
Definition culling_of_stratholme.h:127
@ EVENT_DST_UTHER
Definition culling_of_stratholme.h:113
@ EVENT_SRC_MALGANIS
Definition culling_of_stratholme.h:121
@ EVENT_DST_EPOCH
Definition culling_of_stratholme.h:128
@ EVENT_SRC_HORSE1
Definition culling_of_stratholme.h:110
@ EVENT_SRC_JAINA
Definition culling_of_stratholme.h:109
@ DATA_START_WAVES
Definition culling_of_stratholme.h:51
bool HealthBelowPct(uint32 pct) const
Definition ScriptedCreature.h:368
Creature * GetEventNpc(uint32 entry)
Definition culling_of_stratholme.cpp:1227
void ScheduleNextEvent(uint32 currentEvent, Milliseconds time)
Definition culling_of_stratholme.cpp:1243
void SetDespawnAtFar(bool despawn)
Definition ScriptedEscortAI.h:109
void UpdateAI(uint32 diff) override
Use to start attacking a target. Called just before JustEngagedWith()
Definition ScriptedEscortAI.cpp:240
@ NPC_JAINA
Definition zone_undercity.cpp:353

References ACTION_INFECT_CITIZIEN, actionEvents, npc_escortAI::AttackStart(), SummonList::begin(), Unit::CastSpell(), combatEvents, COS_PROGRESS_FINISHED, COS_PROGRESS_FINISHED_CITY_INTRO, COS_PROGRESS_KILLED_EPOCH, DATA_ARTHAS_EVENT, DATA_EXIT_GATE, DATA_START_WAVES, SummonList::DespawnAll(), SummonList::DespawnEntry(), UnitAI::DoMeleeAttackIfReady(), InstanceScript::DoUpdateWorldState(), SummonList::end(), EVENT_ACTION_PHASE1, EVENT_ACTION_PHASE2, EVENT_ACTION_PHASE3, EVENT_ACTION_PHASE5, EVENT_COMBAT_EXORCISM, EVENT_COMBAT_HEALTH_CHECK, EVENT_DST_CITYMAN, EVENT_DST_EPOCH, EVENT_DST_HORSE1, EVENT_DST_UTHER, EVENT_POS_RETREAT, EVENT_SRC_EPOCH, EVENT_SRC_HORSE1, EVENT_SRC_JAINA, EVENT_SRC_MALGANIS, EVENT_SRC_UTHER, eventInRun, EventPos, EventMap::ExecuteEvent(), FORCED_MOVEMENT_NONE, ObjectAccessor::GetCreature(), Object::GetEntry(), GetEventNpc(), Map::GetGameObject(), Object::GetGUID(), InstanceScript::GetGuidData(), Unit::GetMotionMaster(), Unit::GetVictim(), GO_STATE_ACTIVE, Unit::HasUnitState(), ScriptedAI::HealthBelowPct(), InstanceScript::instance, Unit::IsInCombat(), ScriptedAI::me, MOVEMENTFLAG_WALKING, MotionMaster::MovePoint(), NPC_CITY_MAN, NPC_CITY_MAN2, NPC_CITY_MAN3, NPC_CITY_MAN4, NPC_EPOCH, NPC_HORSE_ESCORT, NPC_INFINITE_ADVERSARY, NPC_INFINITE_AGENT, NPC_INFINITE_HUNTER, NPC_INVIS_TARGET, NPC_JAINA, NPC_MAL_GANIS, NPC_TIME_RIFT, NPC_UTHER, pInstance, Random, REACT_AGGRESSIVE, REACT_DEFENSIVE, REACT_PASSIVE, EventMap::Repeat(), SAY_PHASE101, SAY_PHASE102, SAY_PHASE103, SAY_PHASE104, SAY_PHASE105, SAY_PHASE106, SAY_PHASE107, SAY_PHASE108, SAY_PHASE109, SAY_PHASE110, SAY_PHASE111, SAY_PHASE112, SAY_PHASE113, SAY_PHASE114, SAY_PHASE115, SAY_PHASE116, SAY_PHASE117, SAY_PHASE202, SAY_PHASE203, SAY_PHASE205, SAY_PHASE206, SAY_PHASE207, SAY_PHASE208, SAY_PHASE209, SAY_PHASE210, SAY_PHASE302, SAY_PHASE303, SAY_PHASE304, SAY_PHASE305, SAY_PHASE305_1, SAY_PHASE306, SAY_PHASE308, SAY_PHASE311, SAY_PHASE313, SAY_PHASE314, SAY_PHASE315, SAY_PHASE503, SAY_PHASE504, ScheduleNextEvent(), UnitAI::SelectTarget(), ZoneScript::SetData(), npc_escortAI::SetDespawnAtEnd(), npc_escortAI::SetDespawnAtFar(), npc_escortAI::SetEscortPaused(), Unit::SetFacingTo(), Unit::SetFacingToObject(), Unit::SetImmuneToAll(), Unit::SetNpcFlag(), Creature::SetReactState(), Creature::SetTarget(), Unit::SetVisible(), Creature::SetWalk(), SPELL_ARTHAS_CRUSADER_STRIKE, SPELL_ARTHAS_EXORCISM, SPELL_ARTHAS_HOLY_LIGHT, SPELL_MALGANIS_APPEAR, npc_escortAI::Start(), WorldObject::SummonCreature(), SummonNextWave(), summons, TEMPSUMMON_DEAD_DESPAWN, TEMPSUMMON_TIMED_DESPAWN, UNIT_FLAG_NON_ATTACKABLE, UNIT_NPC_FLAG_GOSSIP, UNIT_STATE_CASTING, EventMap::Update(), npc_escortAI::UpdateAI(), and WORLD_STATE_CULLING_OF_STRATHOLME_WAVE_COUNT.

◆ WaypointReached() [1/2]

void npc_arthas::npc_arthasAI::WaypointReached ( uint32  uiPointId)
inlineoverridevirtual

Implements npc_escortAI.

551 {
552 switch (uiPointId)
553 {
554 // Starting waypoint, After reaching uther and jaina
555 case 0:
556 // On the mountain with uther and jaina
557 case 1:
558 // Reaching city man in city
559 case 9:
560 // Reaching city man in town hall
561 case 23:
562 SetEscortPaused(true);
563 eventInRun = true;
564 break;
565 // After intro, in front of bridge
566 case 3:
567 me->SetWalk(false);
569 summons.DespawnAll(); // uther, jaina and horses
570 break;
571 // Reached City
572 case 8:
574 SetEscortPaused(true);
575 if (pInstance)
577
578 if (Creature* stalker = me->SummonCreature(NPC_INVIS_TARGET, 2026.469f, 1287.088f, 143.596f, 1.37f, TEMPSUMMON_TIMED_DESPAWN, 14000))
579 {
580 me->SetFacingToObject(stalker);
581 stalker->DespawnOrUnsummon(500ms);
582 }
583 break;
584 // Reached first cityman
585 case 10:
586 if (Creature* cityman = GetEventNpc(NPC_CITY_MAN))
587 {
588 cityman->AI()->Talk(SAY_PHASE204);
590 }
591 break;
592 // Reached second cityman
593 case 11:
594 if (Creature* cityman = GetEventNpc(NPC_CITY_MAN2))
595 {
596 cityman->AI()->Talk(SAY_PHASE204_1);
598 }
600 SetEscortPaused(true);
601 eventInRun = true;
602 break;
603 // Reached Town Hall
604 case 20:
605 if (pInstance)
608 me->SetWalk(true);
609 SetEscortPaused(true);
610 break;
611 // Inside Town Hall first scene pos
612 case 22:
614 eventInRun = true;
615 SetEscortPaused(true);
616 break;
617 // Town Hall, upper floor first fight
618 case 26:
619 SetEscortPaused(true);
620 eventInRun = true;
623 break;
624 // Town Hall, upper floor second fight
625 case 29:
629 SetEscortPaused(true);
630 eventInRun = true;
631 break;
632 // Town Hall, upper floor third fight
633 case 31:
634 me->SetWalk(true);
638 SetEscortPaused(true);
639 eventInRun = true;
640 break;
641 // Book Shelf
642 case 34:
644 break;
645 case 35:
647 break;
648 // Reached book shelf
649 case 36:
650 me->SetWalk(false);
651 if (pInstance)
653 pGate->SetGoState(GO_STATE_ACTIVE);
654 break;
655 // Behind secred passage
656 case 45:
657 me->SetWalk(false);
659 SetEscortPaused(true);
660 if (pInstance)
662 break;
663 // Some walk talk
664 case 47:
665 me->SetWalk(true);
667 break;
668 case 48:
669 me->SetWalk(false);
671 break;
672 case 53:
674 break;
675 // Before Malganis event
676 case 54:
677 if (pInstance)
679
681 SetEscortPaused(true);
682 break;
683 // Infront of malganis
684 case 55:
687 SetEscortPaused(true);
688 eventInRun = true;
689 break;
690 // After malganis defeat
691 case 56:
692 SetEscortPaused(true);
693 eventInRun = true;
694 break;
695 }
696 }
@ SAY_PHASE307
Definition culling_of_stratholme.cpp:57
@ SAY_PHASE405
Definition culling_of_stratholme.cpp:71
@ SAY_PHASE312
Definition culling_of_stratholme.cpp:62
@ SAY_PHASE406
Definition culling_of_stratholme.cpp:72
@ SAY_PHASE407
Definition culling_of_stratholme.cpp:73
@ SAY_PHASE502
Definition culling_of_stratholme.cpp:77
@ SAY_PHASE309
Definition culling_of_stratholme.cpp:59
@ SAY_PHASE204_1
Definition culling_of_stratholme.cpp:102
@ SAY_PHASE402
Definition culling_of_stratholme.cpp:68
@ SAY_PHASE118
Definition culling_of_stratholme.cpp:42
@ SAY_PHASE204
Definition culling_of_stratholme.cpp:105
@ SAY_PHASE403
Definition culling_of_stratholme.cpp:69
void SpawnTimeRift()
Definition culling_of_stratholme.cpp:1366

References actionEvents, Unit::CastSpell(), COS_PROGRESS_BEFORE_MALGANIS, COS_PROGRESS_FINISHED_INTRO, COS_PROGRESS_LAST_CITY, COS_PROGRESS_REACHED_TOWN_HALL, DATA_ARTHAS_EVENT, DATA_SHKAF_GATE, SummonList::DespawnAll(), EVENT_ACTION_PHASE3, EVENT_ACTION_PHASE5, eventInRun, GetEventNpc(), Map::GetGameObject(), InstanceScript::GetGuidData(), GO_STATE_ACTIVE, InstanceScript::instance, ScriptedAI::me, NPC_CITY_MAN, NPC_CITY_MAN2, NPC_INVIS_TARGET, pInstance, REACT_DEFENSIVE, SAY_PHASE118, SAY_PHASE204, SAY_PHASE204_1, SAY_PHASE307, SAY_PHASE309, SAY_PHASE312, SAY_PHASE402, SAY_PHASE403, SAY_PHASE405, SAY_PHASE406, SAY_PHASE407, SAY_PHASE502, EventMap::ScheduleEvent(), ZoneScript::SetData(), npc_escortAI::SetEscortPaused(), Unit::SetFacingToObject(), Unit::SetNpcFlag(), Creature::SetReactState(), Creature::SetWalk(), SpawnTimeRift(), SPELL_ARTHAS_CRUSADER_STRIKE, WorldObject::SummonCreature(), summons, TEMPSUMMON_TIMED_DESPAWN, and UNIT_NPC_FLAG_GOSSIP.

◆ WaypointReached() [2/2]

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

Reimplemented from CreatureAI.

196{ }

Member Data Documentation

◆ actionEvents

EventMap npc_arthas::npc_arthasAI::actionEvents

◆ combatEvents

EventMap npc_arthas::npc_arthasAI::combatEvents

Referenced by Reset(), and UpdateAI().

◆ eventInRun

bool npc_arthas::npc_arthasAI::eventInRun

◆ pInstance

◆ summons

◆ timeRiftId

uint8 npc_arthas::npc_arthasAI::timeRiftId

Referenced by Reset().

◆ waveGroupId

uint8 npc_arthas::npc_arthasAI::waveGroupId

Referenced by DoAction(), and Reset().

◆ waveKillCount

uint8 npc_arthas::npc_arthasAI::waveKillCount

Referenced by Reset().


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