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

Public Member Functions

 npc_thrall_bfuAI (Creature *creature)
 
void EnterEvadeMode (EvadeReason) override
 
void Reset () override
 
void JustSummoned (Creature *summoned) override
 
void SummonedCreatureDies (Creature *summon, Unit *) override
 
void UpdateWorldState (Map *map, uint32 id, uint32 state)
 
void SetHoldState (bool bOnHold)
 
void JumpToNextStep (uint32 uiTimer)
 
void FollowThrall ()
 
void ActivateValimathrasPortal ()
 
void SpawnWave (uint32 waveId)
 
void WaypointReached (uint32 waypointId) override
 
bool CanAIAttack (Unit const *victim) const override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
- 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
 
void ReturnToLastPoint ()
 
void EnterEvadeMode (EvadeReason=EVADE_REASON_OTHER) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
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) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
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. More...
 
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
 
- 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. More...
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged. More...
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed. More...
 
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 ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
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 ()
 
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 AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
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: More...
 
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. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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

bool bStepping
 
bool EnableAttack
 
uint32 step
 
uint32 phaseTimer
 
ObjectGuid sylvanasfollowGUID
 
ObjectGuid allianceForcesGUID [ALLIANCE_FORCE_MAXCOUNT]
 
ObjectGuid ValimathrasGUID
 
ObjectGuid ValimathrasPortalGUID
 
ObjectGuid WrynnGUID
 
ObjectGuid JainaGUID
 
ObjectGuid SaurfangGUID
 
GuidVector hordeGuardsGUID
 
EventMap _events
 
- Public Attributes inherited from ScriptedAI
Creatureme
 

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 AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from npc_escortAI
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)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- 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_thrall_bfuAI()

npc_thrall_bfu::npc_thrall_bfuAI::npc_thrall_bfuAI ( Creature creature)
inline
2316 : npc_escortAI(creature)
2317 {
2318 hordeGuardsGUID.clear();
2319 }
Definition: ScriptedEscortAI.h:53
GuidVector hordeGuardsGUID
Definition: zone_undercity.cpp:2334

References hordeGuardsGUID.

Member Function Documentation

◆ ActivateValimathrasPortal()

void npc_thrall_bfu::npc_thrall_bfuAI::ActivateValimathrasPortal ( )
inline
2557 {
2558 if (Creature* portal = me->FindNearestCreature(NPC_VARIMATHRAS_PORTAL, 500.0f))
2559 {
2560 portal->SummonCreature(NPC_LEGION_OVERLORD, ThrallSpawn[81].x + rand32() % 5, ThrallSpawn[81].y + rand32() % 5, ThrallSpawn[81].z, TEMPSUMMON_DEAD_DESPAWN);
2561 portal->DespawnOrUnsummon();
2562 }
2563 }
uint32 rand32()
Definition: Random.cpp:72
@ TEMPSUMMON_DEAD_DESPAWN
Definition: Object.h:51
@ NPC_LEGION_OVERLORD
Definition: zone_undercity.cpp:695
@ NPC_VARIMATHRAS_PORTAL
Definition: zone_undercity.cpp:640
static LocationXYZO ThrallSpawn[]
Definition: zone_undercity.cpp:809
Creature * me
Definition: ScriptedCreature.h:280
Definition: Creature.h:46
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2446

References WorldObject::FindNearestCreature(), ScriptedAI::me, NPC_LEGION_OVERLORD, NPC_VARIMATHRAS_PORTAL, rand32(), TEMPSUMMON_DEAD_DESPAWN, and ThrallSpawn.

Referenced by UpdateAI().

◆ CanAIAttack()

bool npc_thrall_bfu::npc_thrall_bfuAI::CanAIAttack ( Unit const *  victim) const
inlineoverridevirtual

Reimplemented from UnitAI.

2934 {
2935 return victim->GetEntry() != NPC_BLIGHT_SLINGER;
2936 }
@ NPC_BLIGHT_SLINGER
Definition: zone_undercity.cpp:692

References Object::GetEntry(), and NPC_BLIGHT_SLINGER.

◆ EnterEvadeMode()

void npc_thrall_bfu::npc_thrall_bfuAI::EnterEvadeMode ( EvadeReason  )
inlineoverridevirtual

Reimplemented from npc_escortAI.

2339 {
2342 me->CombatStop(true);
2343 me->SetLootRecipient(nullptr);
2344
2346 {
2349 }
2350 else
2351 {
2353 Reset();
2354 }
2355 }
@ STATE_ESCORT_ESCORTING
Definition: ScriptedEscortAI.h:47
@ STATE_ESCORT_RETURNING
Definition: ScriptedEscortAI.h:48
@ SPELL_HEROIC_VANGUARD
Definition: zone_undercity.cpp:516
bool HasEscortState(uint32 escortState)
Definition: ScriptedEscortAI.h:98
void AddEscortState(uint32 escortState)
Definition: ScriptedEscortAI.h:110
void ReturnToLastPoint()
Definition: ScriptedEscortAI.cpp:193
void ClearAllThreat()
Definition: ThreatMgr.cpp:417
void SetLootRecipient(Unit *unit, bool withGroup=true)
Definition: Creature.cpp:1315
void CombatStop(bool includingCast=false)
Definition: Unit.cpp:10398
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4758
MotionMaster * GetMotionMaster()
Definition: Unit.h:1601
ThreatMgr & GetThreatMgr()
Definition: Unit.h:839
void MoveTargetedHome(bool walk=false)
The unit will return this initial position (owner for pets and summoned creatures)....
Definition: MotionMaster.cpp:259
void Reset() override
Definition: zone_undercity.cpp:2357

References npc_escortAI::AddEscortState(), ThreatMgr::ClearAllThreat(), Unit::CombatStop(), Unit::GetMotionMaster(), Unit::GetThreatMgr(), npc_escortAI::HasEscortState(), ScriptedAI::me, MotionMaster::MoveTargetedHome(), Unit::RemoveAura(), Reset(), npc_escortAI::ReturnToLastPoint(), Creature::SetLootRecipient(), SPELL_HEROIC_VANGUARD, STATE_ESCORT_ESCORTING, and STATE_ESCORT_RETURNING.

◆ FollowThrall()

void npc_thrall_bfu::npc_thrall_bfuAI::FollowThrall ( )
inline
2545 {
2547 {
2548 sylvanas->GetMotionMaster()->Clear();
2549 sylvanas->SetImmuneToAll(false);
2550 sylvanas->SetReactState(REACT_AGGRESSIVE);
2551 sylvanas->SetFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE);
2552 sylvanas->GetMotionMaster()->MoveFollow(me, 1, M_PI * 0.1f);
2553 }
2554 }
@ FACTION_ESCORT_N_NEUTRAL_ACTIVE
Definition: ScriptSystem.h:37
@ REACT_AGGRESSIVE
Definition: Unit.h:550
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
ObjectGuid sylvanasfollowGUID
Definition: zone_undercity.cpp:2327

References FACTION_ESCORT_N_NEUTRAL_ACTIVE, ObjectAccessor::GetCreature(), ScriptedAI::me, REACT_AGGRESSIVE, and sylvanasfollowGUID.

Referenced by SummonedCreatureDies(), and UpdateAI().

◆ JumpToNextStep()

void npc_thrall_bfu::npc_thrall_bfuAI::JumpToNextStep ( uint32  uiTimer)
inline
2539 {
2540 phaseTimer = uiTimer;
2541 ++step;
2542 }
uint32 phaseTimer
Definition: zone_undercity.cpp:2325
uint32 step
Definition: zone_undercity.cpp:2324

References phaseTimer, and step.

Referenced by UpdateAI().

◆ JustSummoned()

void npc_thrall_bfu::npc_thrall_bfuAI::JustSummoned ( Creature summoned)
inlineoverridevirtual

Reimplemented from ScriptedAI.

2418 {
2419 switch (summoned->GetEntry())
2420 {
2422 summoned->AI()->AttackStart(me);
2423 break;
2427 break;
2430 summoned->ApplySpellImmune(0, IMMUNITY_ID, SPELL_THRALL_BUFF, true);
2432 break;
2433 case NPC_CAVE_DUMMY:
2435 summoned->ApplySpellImmune(0, IMMUNITY_ID, SPELL_THRALL_BUFF, true);
2437 summoned->AddAura(SPELL_CYCLONE_FALL, summoned);
2438 break;
2440 case NPC_DOCTOR_H:
2441 case NPC_CHEMIST_H:
2444 summoned->ApplySpellImmune(0, IMMUNITY_ID, SPELL_THRALL_BUFF, true);
2446 if (!EnableAttack)
2447 summoned->SetFaction(FACTION_FRIENDLY);
2448 summoned->AddThreat(me, 100.0f);
2449 me->AddThreat(summoned, 100.0f);
2450 summoned->AI()->AttackStart(me);
2451 break;
2452 case NPC_LEGION_INVADER:
2455 case NPC_DREADLORD:
2456 case NPC_BETRAYER_H:
2457 case NPC_FELBEAST_H:
2460 summoned->AddThreat(me, 100.0f);
2461 me->AddThreat(summoned, 100.0f);
2462 summoned->AI()->AttackStart(me);
2463 break;
2464 default:
2465 break;
2466 }
2467 }
@ UNIT_FLAG_NOT_SELECTABLE
Definition: UnitDefines.h:254
@ UNIT_NPC_EMOTESTATE
Definition: UpdateFields.h:140
@ NPC_DOCTOR_H
Definition: zone_undercity.cpp:690
@ NPC_BETRAYER_H
Definition: zone_undercity.cpp:687
@ NPC_DREADLORD
Definition: zone_undercity.cpp:671
@ NPC_FELBEAST_H
Definition: zone_undercity.cpp:685
@ NPC_LEGION_DREADWHISPER
Definition: zone_undercity.cpp:697
@ NPC_CHEMIST_H
Definition: zone_undercity.cpp:688
@ NPC_LEGION_INVADER
Definition: zone_undercity.cpp:696
@ NPC_TREACHEROUS_GUARDIAN_H
Definition: zone_undercity.cpp:683
@ NPC_FELGUARD_MORADEUR
Definition: zone_undercity.cpp:694
@ SPELL_SYLVANAS_BUFF
Definition: zone_undercity.cpp:562
@ NPC_BLIGHT_ABBERATION
Definition: zone_undercity.cpp:535
@ NPC_CAVE_DUMMY
Definition: zone_undercity.cpp:530
@ NPC_WARSONG_BATTLEGUARD
Definition: zone_undercity.cpp:526
@ SPELL_CYCLONE_FALL
Definition: zone_undercity.cpp:502
@ SPELL_THRALL_BUFF
Definition: zone_undercity.cpp:496
@ EMOTE_STATE_READY2H
Definition: SharedDefines.h:1970
@ SPELL_EFFECT_KNOCK_BACK_DEST
Definition: SharedDefines.h:922
@ SPELL_EFFECT_KNOCK_BACK
Definition: SharedDefines.h:876
@ IMMUNITY_EFFECT
Definition: SharedDefines.h:1394
@ IMMUNITY_ID
Definition: SharedDefines.h:1400
@ FACTION_FRIENDLY
Definition: SharedDefines.h:201
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:27
CreatureAI * AI() const
Definition: Creature.h:143
uint32 GetEntry() const
Definition: Object.h:112
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition: Unit.cpp:13346
void SetFaction(uint32 faction)
Definition: Unit.cpp:10018
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition: Unit.cpp:14608
Aura * AddAura(uint32 spellId, Unit *target)
Definition: Unit.cpp:18819
void SetUInt32Value(uint16 index, uint32 value)
Definition: Unit.cpp:21256
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:683
bool EnableAttack
Definition: zone_undercity.cpp:2322

References Unit::AddAura(), Unit::AddThreat(), Creature::AI(), Unit::ApplySpellImmune(), UnitAI::AttackStart(), EMOTE_STATE_READY2H, EnableAttack, FACTION_FRIENDLY, Object::GetEntry(), IMMUNITY_EFFECT, IMMUNITY_ID, ScriptedAI::me, NPC_BETRAYER_H, NPC_BLIGHT_ABBERATION, NPC_CAVE_DUMMY, NPC_CHEMIST_H, NPC_DOCTOR_H, NPC_DREADLORD, NPC_FELBEAST_H, NPC_FELGUARD_MORADEUR, NPC_LEGION_DREADWHISPER, NPC_LEGION_INVADER, NPC_TREACHEROUS_GUARDIAN_H, NPC_VARIMATHRAS_PORTAL, NPC_WARSONG_BATTLEGUARD, Unit::SetFaction(), Unit::SetUInt32Value(), Unit::SetUnitFlag(), SPELL_CYCLONE_FALL, SPELL_EFFECT_KNOCK_BACK, SPELL_EFFECT_KNOCK_BACK_DEST, SPELL_SYLVANAS_BUFF, SPELL_THRALL_BUFF, UNIT_FLAG_NOT_SELECTABLE, and UNIT_NPC_EMOTESTATE.

◆ Reset()

void npc_thrall_bfu::npc_thrall_bfuAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

2358 {
2360 {
2363 me->SetCorpseDelay(1);
2364 me->SetRespawnTime(1);
2367
2368 bStepping = false;
2369 EnableAttack = false;
2370 step = 0;
2371 phaseTimer = 0;
2378
2380 {
2381 valimathras->DespawnOrUnsummon();
2383 }
2384
2386 {
2387 valimathrasportal->DespawnOrUnsummon();
2389 }
2390
2392 {
2393 wrynn->DespawnOrUnsummon();
2394 WrynnGUID.Clear();
2395 }
2396
2398 {
2399 jaina->DespawnOrUnsummon();
2400 JainaGUID.Clear();
2401 }
2402
2404 {
2405 saurfang->DespawnOrUnsummon();
2407 }
2408
2409 for (ObjectGuid const& guid : hordeGuardsGUID)
2410 if (Creature* temp = ObjectAccessor::GetCreature(*me, guid))
2411 temp->DespawnOrUnsummon();
2412
2413 hordeGuardsGUID.clear();
2414 }
2415 }
@ UNIT_STAND_STATE_STAND
Definition: UnitDefines.h:32
@ UNIT_NPC_FLAG_GOSSIP
Definition: UnitDefines.h:294
@ EVENT_CHAIN_LIGHTNING
Definition: zone_undercity.cpp:519
@ EVENT_THRALL_BUFF
Definition: zone_undercity.cpp:523
@ EVENT_AGGRO_SYLVANAS
Definition: zone_undercity.cpp:522
@ MODEL_WHITE_WULF
Definition: zone_undercity.cpp:543
@ EVENT_THUNDER
Definition: zone_undercity.cpp:521
@ EVENT_LAVA_BURST
Definition: zone_undercity.cpp:520
void ScheduleEvent(uint32 eventId, uint32 time, uint32 group=0, uint32 phase=0)
Definition: EventMap.cpp:56
void SetRespawnTime(uint32 respawn)
Definition: Creature.cpp:3762
void SetCorpseDelay(uint32 delay)
Definition: Creature.h:73
Definition: ObjectGuid.h:118
void Clear()
Definition: ObjectGuid.h:138
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
Definition: Unit.cpp:13422
void SetNpcFlag(NPCFlags flags)
Definition: Unit.h:695
void SetStandState(uint8 state)
Definition: Unit.cpp:16682
bool bStepping
Definition: zone_undercity.cpp:2321
ObjectGuid ValimathrasGUID
Definition: zone_undercity.cpp:2329
ObjectGuid ValimathrasPortalGUID
Definition: zone_undercity.cpp:2330
ObjectGuid SaurfangGUID
Definition: zone_undercity.cpp:2333
ObjectGuid JainaGUID
Definition: zone_undercity.cpp:2332
EventMap _events
Definition: zone_undercity.cpp:2336
ObjectGuid WrynnGUID
Definition: zone_undercity.cpp:2331

References _events, Unit::ApplySpellImmune(), bStepping, ObjectGuid::Clear(), EnableAttack, EVENT_AGGRO_SYLVANAS, EVENT_CHAIN_LIGHTNING, EVENT_LAVA_BURST, EVENT_THRALL_BUFF, EVENT_THUNDER, ObjectAccessor::GetCreature(), npc_escortAI::HasEscortState(), hordeGuardsGUID, IMMUNITY_ID, JainaGUID, ScriptedAI::me, MODEL_WHITE_WULF, Unit::Mount(), phaseTimer, SaurfangGUID, EventMap::ScheduleEvent(), Creature::SetCorpseDelay(), Unit::SetNpcFlag(), Creature::SetRespawnTime(), Unit::SetStandState(), SPELL_SYLVANAS_BUFF, STATE_ESCORT_ESCORTING, step, sylvanasfollowGUID, UNIT_NPC_FLAG_GOSSIP, UNIT_STAND_STATE_STAND, ValimathrasGUID, ValimathrasPortalGUID, and WrynnGUID.

Referenced by EnterEvadeMode().

◆ SetHoldState()

void npc_thrall_bfu::npc_thrall_bfuAI::SetHoldState ( bool  bOnHold)
inline
2534 {
2535 SetEscortPaused(bOnHold);
2536 }
void SetEscortPaused(bool on)
Definition: ScriptedEscortAI.cpp:523

References npc_escortAI::SetEscortPaused().

Referenced by WaypointReached().

◆ SpawnWave()

void npc_thrall_bfu::npc_thrall_bfuAI::SpawnWave ( uint32  waveId)
inline
2566 {
2567 switch (waveId)
2568 {
2569 case 0: // Vortex
2571 whirlwind1->GetMotionMaster()->MovePath(NPC_WHIRLWIND * 10, false);
2573 whirlwind2->GetMotionMaster()->MovePath(NPC_WHIRLWIND * 100, false);
2574 break;
2575 case 1:
2576 // BATTLING_COURTYARD Initial Spawn
2577 for (uint8 i = 0; i < 3; ++i)
2579 for (uint8 i = 0; i < 9; ++i)
2581 for (uint8 i = 0; i < 6; ++i)
2583 for (uint8 i = 0; i < 4; ++i)
2585 break;
2586 case 2:
2587 // Valimathras
2589 {
2590 ValimathrasGUID = temp->GetGUID();
2591 temp->SetImmuneToAll(true);
2592 }
2593 break;
2594 case 3:
2596 ValimathrasPortalGUID = temp->GetGUID();
2597 break;
2598 case 4:
2599 // COURTYARD_FIGHT Spawns
2600 for (uint8 i = 0; i < WAVE_COURTYARD_FIGHT; ++i)
2601 {
2602 switch (urand(0, 2))
2603 {
2604 case 0:
2606 break;
2607 case 1:
2609 break;
2610 case 2:
2612 break;
2613 }
2614 }
2615 break;
2616 case 5:
2617 // Bossspawn 1
2619 {
2620 temp->GetMotionMaster()->MoveJump(ThrallSpawn[62].x, ThrallSpawn[62].y, ThrallSpawn[62].z, 10.0f, 20.0f, 0);
2621 temp->AddThreat(me, 100.0f);
2622 me->AddThreat(temp, 100.0f);
2623 temp->AI()->AttackStart(me);
2624 }
2625 break;
2626 case 6:
2627 // COURTYARD_DONE Spawn
2629 {
2630 hordeGuardsGUID.push_back(temp->GetGUID());
2631 temp->GetMotionMaster()->MovePoint(0, ThrallSpawn[30].x, ThrallSpawn[30].y, ThrallSpawn[30].z);
2632 }
2634 {
2635 hordeGuardsGUID.push_back(temp->GetGUID());
2636 temp->GetMotionMaster()->MovePoint(0, ThrallSpawn[32].x, ThrallSpawn[32].y, ThrallSpawn[32].z);
2637 }
2639 {
2640 hordeGuardsGUID.push_back(temp->GetGUID());
2641 temp->GetMotionMaster()->MovePoint(0, ThrallSpawn[34].x, ThrallSpawn[34].y, ThrallSpawn[34].z);
2642 }
2644 {
2645 hordeGuardsGUID.push_back(temp->GetGUID());
2646 temp->GetMotionMaster()->MovePoint(0, ThrallSpawn[36].x, ThrallSpawn[36].y, ThrallSpawn[36].z);
2647 }
2648 for (uint8 i = 0; i < 2; ++i)
2650 hordeGuardsGUID.push_back(temp->GetGUID());
2651 break;
2652 case 7:
2653 for (uint8 i = 0; i < 9; ++i)
2655 break;
2656 case 8:
2657 for (uint8 i = 0; i < 2; ++i)
2659 hordeGuardsGUID.push_back(temp->GetGUID());
2660 break;
2661 case 9:
2662 // Top of Undercity - Attacktrashpack
2663 for (uint8 i = 0; i < 3; ++i)
2664 {
2665 switch (urand(0, 2))
2666 {
2667 case 0:
2669 break;
2670 case 1:
2672 break;
2673 case 2:
2675 break;
2676 }
2677 }
2678 break;
2679 case 10:
2680 // Top of Undercity - Attacktrashpack
2681 for (uint8 i = 0; i < 3; ++i)
2682 {
2683 switch (urand(0, 1))
2684 {
2685 case 0:
2687 break;
2688 case 1:
2690 break;
2691 }
2692 }
2693 break;
2694 case 11:
2695 // Bottom of Undercity - Attacktrashpack
2696 for (uint8 i = 0; i < 3; ++i)
2697 {
2698 switch (urand(0, 1))
2699 {
2700 case 0:
2702 break;
2703 case 1:
2705 break;
2706 }
2707 }
2708 break;
2709 case 12:
2710 // Valimathras 2
2712 {
2713 ValimathrasGUID = temp->GetGUID();
2714 temp->SetImmuneToAll(true);
2715 }
2716 break;
2717 case 13:
2719 ValimathrasPortalGUID = temp->GetGUID();
2720 break;
2721 // NPC_KHANOK - Inner Sunktum Spawn Left
2722 case 14:
2723 for (uint8 i = 0; i < 4; ++i)
2724 {
2725 switch (urand(0, 6))
2726 {
2727 case 0:
2729 break;
2730 case 1:
2732 break;
2733 case 2:
2735 break;
2736 case 3:
2738 break;
2739 case 4:
2741 break;
2742 case 5:
2744 break;
2745 case 6:
2747 break;
2748 }
2749 }
2750 break;
2751 // NPC_KHANOK - Inner Sunktum Spawn Right
2752 case 15:
2753 for (uint8 i = 0; i < 4; ++i)
2754 {
2755 switch (urand(0, 6))
2756 {
2757 case 0:
2759 break;
2760 case 1:
2762 break;
2763 case 2:
2765 break;
2766 case 3:
2768 break;
2769 case 4:
2771 break;
2772 case 5:
2774 break;
2775 case 6:
2777 break;
2778 }
2779 }
2780 break;
2781 // NPC_KHANOK - Inner Sunktum Spawn Top
2782 case 16:
2784 break;
2785 // NPC_KHANOK - Inner Sunktum Spawn Middle
2786 case 17:
2788 break;
2789 case 18:
2791 {
2792 hordeGuardsGUID.push_back(temp->GetGUID());
2793 temp->AI()->Talk(SAY_FOR_THE_HORDE);
2794 temp->GetMotionMaster()->MovePath(NPC_WARSONG_BATTLEGUARD * 100, false);
2795 }
2796 break;
2797 // Valimathras Room Preparation
2798 case 19:
2799 for (uint8 i = 0; i < 3; ++i)
2800 me->SummonGameObject(GO_BLOCKED_PASSAGE, ThrallSpawn[i + 70].x, ThrallSpawn[i + 70].y, ThrallSpawn[70].z, ThrallSpawn[i + 70].o, 0.0f, 0.0f, 0.0f, 0.0f, 120 * IN_MILLISECONDS);
2801 // Valimathras BossSpawn
2803 {
2804 ValimathrasGUID = temp->GetGUID();
2805 temp->SetImmuneToAll(true);
2806 temp->CastSpell(me, SPELL_AURA_OF_VARIMATHRAS);
2807 temp->CastSpell(me, SPELL_OPENING_LEGION_PORTALS);
2808 temp->AI()->Talk(SAY_CLOSE_DOOR);
2809 }
2810 for (uint8 i = 0; i < 6; ++i)
2811 {
2813 temp->CastSpell(me, SPELL_VALIMATHRAS_PORTAL);
2814 }
2815 break;
2816 case 20:
2817 for (uint8 i = 0; i < 3; ++i)
2818 {
2819 switch (urand(0, 1))
2820 {
2821 case 0:
2823 break;
2824 case 1:
2826 break;
2827 }
2828 }
2829 break;
2830 case 21:
2831 for (uint8 i = 0; i < 3; ++i)
2832 {
2833 switch (urand(0, 1))
2834 {
2835 case 0:
2837 break;
2838 case 1:
2840 break;
2841 }
2842 }
2843 break;
2844 }
2845 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:53
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
std::uint8_t uint8
Definition: Define.h:109
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: Object.h:52
@ TEMPSUMMON_TIMED_OR_DEAD_DESPAWN
Definition: Object.h:45
@ NPC_DOOMGUARD_PILLARGER
Definition: zone_undercity.cpp:691
@ SAY_FOR_THE_HORDE
Definition: zone_undercity.cpp:702
@ NPC_KHANOK
Definition: zone_undercity.cpp:633
@ WAVE_COURTYARD_FIGHT
Definition: zone_undercity.cpp:720
@ NPC_VARIMATHRAS
Definition: zone_undercity.cpp:639
@ SPELL_VALIMATHRAS_PORTAL
Definition: zone_undercity.cpp:658
@ SPELL_OPENING_LEGION_PORTALS
Definition: zone_undercity.cpp:665
@ SPELL_AURA_OF_VARIMATHRAS
Definition: zone_undercity.cpp:663
@ SAY_CLOSE_DOOR
Definition: zone_undercity.cpp:648
@ GO_BLOCKED_PASSAGE
Definition: zone_undercity.cpp:538
@ NPC_VORTEX
Definition: zone_undercity.cpp:527
@ NPC_WHIRLWIND
Definition: zone_undercity.cpp:529
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2355
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true, GOSummonType summonType=GO_SUMMON_TIMED_OR_CORPSE_DESPAWN)
Definition: Object.cpp:2369
Definition: Unit.h:630
void MoveJump(Position const &pos, float speedXY, float speedZ, uint32 id=0)
Definition: MotionMaster.h:227
float o
Definition: zone_undercity.cpp:752
float y
Definition: zone_undercity.cpp:752
float x
Definition: zone_undercity.cpp:752
float z
Definition: zone_undercity.cpp:752

References Unit::AddThreat(), Unit::GetMotionMaster(), GO_BLOCKED_PASSAGE, hordeGuardsGUID, IN_MILLISECONDS, ScriptedAI::me, MotionMaster::MoveJump(), NPC_BETRAYER_H, NPC_BLIGHT_ABBERATION, NPC_BLIGHT_SLINGER, NPC_CAVE_DUMMY, NPC_CHEMIST_H, NPC_DOCTOR_H, NPC_DOOMGUARD_PILLARGER, NPC_DREADLORD, NPC_FELBEAST_H, NPC_FELGUARD_MORADEUR, NPC_KHANOK, NPC_LEGION_DREADWHISPER, NPC_LEGION_INVADER, NPC_TREACHEROUS_GUARDIAN_H, NPC_VARIMATHRAS, NPC_VARIMATHRAS_PORTAL, NPC_VORTEX, NPC_WARSONG_BATTLEGUARD, NPC_WHIRLWIND, LocationXYZO::o, rand32(), SAY_CLOSE_DOOR, SAY_FOR_THE_HORDE, SPELL_AURA_OF_VARIMATHRAS, SPELL_OPENING_LEGION_PORTALS, SPELL_VALIMATHRAS_PORTAL, WorldObject::SummonCreature(), WorldObject::SummonGameObject(), TEMPSUMMON_DEAD_DESPAWN, TEMPSUMMON_MANUAL_DESPAWN, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, ThrallSpawn, urand(), ValimathrasGUID, ValimathrasPortalGUID, WAVE_COURTYARD_FIGHT, LocationXYZO::x, LocationXYZO::y, and LocationXYZO::z.

Referenced by UpdateAI().

◆ SummonedCreatureDies()

void npc_thrall_bfu::npc_thrall_bfuAI::SummonedCreatureDies ( Creature summon,
Unit  
)
inlineoverridevirtual

Reimplemented from CreatureAI.

2470 {
2471 switch (summon->GetEntry())
2472 {
2476 bStepping = true;
2477 break;
2478 case NPC_KHANOK:
2479 {
2482 FollowThrall();
2483 SetEscortPaused(false);
2484 std::list<Creature*> SanktumList;
2486 me->GetCreatureListWithEntryInGrid(SanktumList, NPC_DREADLORD, 1000.0f);
2488 me->GetCreatureListWithEntryInGrid(SanktumList, NPC_DOCTOR_H, 1000.0f);
2489 me->GetCreatureListWithEntryInGrid(SanktumList, NPC_CHEMIST_H, 1000.0f);
2490 me->GetCreatureListWithEntryInGrid(SanktumList, NPC_BETRAYER_H, 1000.0f);
2491 me->GetCreatureListWithEntryInGrid(SanktumList, NPC_FELBEAST_H, 1000.0f);
2493 if (!SanktumList.empty())
2494 for (std::list<Creature*>::iterator itr = SanktumList.begin(); itr != SanktumList.end(); itr++)
2495 (*itr)->DespawnOrUnsummon();
2496 break;
2497 }
2498 case NPC_VARIMATHRAS:
2499 {
2502 std::list<Creature*> ThroneList;
2507 if (!ThroneList.empty())
2508 for (std::list<Creature*>::iterator itr = ThroneList.begin(); itr != ThroneList.end(); itr++)
2509 (*itr)->DespawnOrUnsummon();
2510 SetEscortPaused(false);
2511 SetRun(false);
2512 break;
2513 }
2514 default:
2515 break;
2516 }
2517 }
@ WORLD_STATE_COURTYARD_DONE_H
Definition: zone_undercity.cpp:741
@ WORLD_STATE_INNER_SANKTUM_FIGHT_H
Definition: zone_undercity.cpp:742
@ WORLD_STATE_ROYAL_QUARTER_FIGHT_H
Definition: zone_undercity.cpp:746
@ WORLD_STATE_COURTYARD_FIGHT_H
Definition: zone_undercity.cpp:740
@ WORLD_STATE_ROYAL_QUARTER_DONE_H
Definition: zone_undercity.cpp:747
@ WORLD_STATE_INNER_SANKTUM_DONE_H
Definition: zone_undercity.cpp:743
void SetRun(bool on=true)
Definition: ScriptedEscortAI.cpp:428
Map * GetMap() const
Definition: Object.h:531
void GetCreatureListWithEntryInGrid(std::list< Creature * > &lList, uint32 uiEntry, float fMaxSearchRange) const
Definition: Object.cpp:2500
void FollowThrall()
Definition: zone_undercity.cpp:2544
void UpdateWorldState(Map *map, uint32 id, uint32 state)
Definition: zone_undercity.cpp:2519

References bStepping, FollowThrall(), WorldObject::GetCreatureListWithEntryInGrid(), Object::GetEntry(), WorldObject::GetMap(), ScriptedAI::me, NPC_BETRAYER_H, NPC_BLIGHT_ABBERATION, NPC_CHEMIST_H, NPC_DOCTOR_H, NPC_DOOMGUARD_PILLARGER, NPC_DREADLORD, NPC_FELBEAST_H, NPC_FELGUARD_MORADEUR, NPC_KHANOK, NPC_LEGION_DREADWHISPER, NPC_LEGION_INVADER, NPC_LEGION_OVERLORD, NPC_TREACHEROUS_GUARDIAN_H, NPC_VARIMATHRAS, NPC_VARIMATHRAS_PORTAL, npc_escortAI::SetEscortPaused(), npc_escortAI::SetRun(), UpdateWorldState(), WORLD_STATE_COURTYARD_DONE_H, WORLD_STATE_COURTYARD_FIGHT_H, WORLD_STATE_INNER_SANKTUM_DONE_H, WORLD_STATE_INNER_SANKTUM_FIGHT_H, WORLD_STATE_ROYAL_QUARTER_DONE_H, and WORLD_STATE_ROYAL_QUARTER_FIGHT_H.

◆ UpdateAI()

void npc_thrall_bfu::npc_thrall_bfuAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from npc_escortAI.

2939 {
2941
2942 if (bStepping)
2943 {
2944 if (phaseTimer <= diff)
2945 {
2946 switch (step)
2947 {
2948 //Preparation
2949 case 0:
2950 me->setActive(true);
2952 break;
2953 case 1:
2957 break;
2958 case 2:
2961 break;
2962 case 3:
2963 if (Creature* guard = me->FindNearestCreature(NPC_HORDE_GUARD, 100.0f))
2964 guard->AI()->Talk(SAY_BURN_UC);
2966 break;
2967 case 4:
2968 if (Creature* guard = me->FindNearestCreature(NPC_HORDE_GUARD, 100.0f))
2969 guard->AI()->Talk(SAY_PUTRESS_ANGER);
2971 break;
2972 case 5:
2975 break;
2976 case 6:
2979 break;
2980 case 7:
2983 break;
2984 case 8:
2987 break;
2988 case 9:
2991 break;
2992 case 10:
2995 break;
2996 // Start Event
2997 case 11:
3001 SetEscortPaused(false);
3002 bStepping = false;
3003 JumpToNextStep(0);
3004 SetRun(true);
3006 {
3007 sylvanas->GetMotionMaster()->MovePath(NPC_SYLVANAS * 100, false);
3008 sylvanas->setActive(true);
3009 }
3010 break;
3011 case 12:
3012 me->Dismount();
3014 break;
3015 case 13:
3017 sylvanas->Dismount();
3019 break;
3020 case 14:
3023 break;
3024 case 15:
3026 SpawnWave(0);
3028 break;
3029 case 16:
3030 {
3031 std::list<Creature*> PlagueList;
3033 if (!PlagueList.empty())
3034 for (std::list<Creature*>::iterator itr = PlagueList.begin(); itr != PlagueList.end(); itr++)
3035 (*itr)->DespawnOrUnsummon();
3036 SetEscortPaused(false);
3037 SetRun(false);
3039 sylvanas->GetMotionMaster()->MovePath(NPC_SYLVANAS * 1000, false);
3041 break;
3042 }
3043 case 17:
3044 bStepping = false;
3045 JumpToNextStep(0);
3046 break;
3047 case 18:
3048 SpawnWave(1);
3051 break;
3052 case 19:
3053 {
3054 SpawnWave(2);
3056 break;
3057 }
3058 case 20:
3060 valimathras->AI()->Talk(SAY_VALIMATHRAS_INTRO_0);
3062 break;
3063 case 21:
3065 valimathras->AI()->Talk(SAY_VALIMATHRAS_INTRO_1);
3067 break;
3068 case 22:
3070 valimathras->AI()->Talk(SAY_VALIMATHRAS_INTRO_2);
3072 break;
3073 case 23:
3074 SpawnWave(3);
3076 break;
3077 case 24:
3079 valimathrasportal->CastSpell(valimathrasportal, SPELL_VALIMATHRAS_PORTAL);
3081 break;
3082 case 25:
3084 {
3085 valimathras->GetMotionMaster()->MovePoint(0, 1804.559f, 235.504f, 62.753f);
3086 valimathras->DespawnOrUnsummon(3 * IN_MILLISECONDS);
3087 }
3089 valimathrasportal->DespawnOrUnsummon(6 * IN_MILLISECONDS);
3091 break;
3092 case 26:
3093 {
3096 std::list<Creature*> HelperList;
3098 if (!HelperList.empty())
3099 for (std::list<Creature*>::iterator itr = HelperList.begin(); itr != HelperList.end(); itr++)
3100 (*itr)->DespawnOrUnsummon();
3102 break;
3103 }
3104 // Start COURTYARD_FIGHT
3105 case 27:
3106 FollowThrall();
3107 SetEscortPaused(false);
3108 bStepping = false;
3109 SetRun(true);
3113 JumpToNextStep(0);
3114 break;
3115 case 28:
3116 {
3117 EnableAttack = true;
3119 std::list<Creature*> HostileEndList;
3121 me->GetCreatureListWithEntryInGrid(HostileEndList, NPC_DOCTOR_H, 1000.0f);
3122 me->GetCreatureListWithEntryInGrid(HostileEndList, NPC_CHEMIST_H, 1000.0f);
3123 if (!HostileEndList.empty())
3124 for (std::list<Creature*>::iterator itr = HostileEndList.begin(); itr != HostileEndList.end(); itr++) (*itr)->SetFaction(FACTION_MONSTER);
3125 SpawnWave(4);
3127 break;
3128 }
3129 case 29:
3130 SpawnWave(4);
3132 break;
3133 case 30:
3134 SpawnWave(4);
3136 break;
3137 case 31:
3138 SpawnWave(4);
3140 break;
3141 case 32:
3142 SpawnWave(4);
3144 break;
3145 case 33:
3146 SpawnWave(4);
3148 break;
3149 case 34:
3150 SpawnWave(4);
3152 break;
3153 case 35:
3154 SpawnWave(4);
3156 break;
3157 case 36:
3158 SpawnWave(4);
3160 break;
3161 case 37:
3162 SpawnWave(4);
3164 break;
3165 case 38:
3166 SpawnWave(4);
3168 break;
3169 case 39:
3170 SpawnWave(4);
3172 break;
3173 case 40:
3174 SpawnWave(4);
3176 break;
3177 case 41:
3178 SpawnWave(4);
3180 break;
3181 case 42:
3182 SpawnWave(4);
3184 break;
3185 case 43:
3186 SpawnWave(4);
3188 break;
3189 case 44:
3190 SpawnWave(4);
3192 break;
3193 case 45:
3194 SpawnWave(5);
3195 bStepping = false;
3197 break;
3198 // End COURTYARD_FIGHT
3199 case 46:
3200 {
3201 FollowThrall();
3202 std::list<Creature*> HostileList;
3204 me->GetCreatureListWithEntryInGrid(HostileList, NPC_DOCTOR_H, 1000.0f);
3205 me->GetCreatureListWithEntryInGrid(HostileList, NPC_CHEMIST_H, 1000.0f);
3207 if (!HostileList.empty())
3208 for (std::list<Creature*>::iterator itr = HostileList.begin(); itr != HostileList.end(); itr++)
3209 (*itr)->DespawnOrUnsummon();
3210 for (uint8 i = 0; i < 7; ++i)
3211 me->SummonGameObject(GO_HORDE_BANNER, ThrallSpawn[i + 37].x, ThrallSpawn[i + 37].y, ThrallSpawn[i + 37].z, ThrallSpawn[i + 37].o, 0.0f, 0.0f, 0.0f, 0.0f, 120 * IN_MILLISECONDS);
3212 SpawnWave(6);
3213 SetEscortPaused(false);
3214 bStepping = false;
3215 SetRun(false);
3217 break;
3218 }
3219 case 47:
3222 break;
3223 case 48:
3224 SetEscortPaused(false);
3225 bStepping = false;
3227 break;
3228 // Elevator Event
3229 case 49:
3232 break;
3233 case 50:
3235 sylvanas->AI()->Talk(SYLVANAS_SAY_ELEVATOR_1);
3237 break;
3238 case 51:
3241 SpawnWave(7);
3243 break;
3244 case 52:
3247 break;
3248 case 53:
3249 SpawnWave(8);
3250 me->GetMotionMaster()->MoveJump(ThrallSpawn[55].x, ThrallSpawn[55].y, ThrallSpawn[55].z, 40.0f, 40.0f, 0);
3252 sylvanas->GetMotionMaster()->MoveJump(ThrallSpawn[56].x, ThrallSpawn[56].y, ThrallSpawn[56].z, 40.0f, 40.0f, 0);
3254 break;
3255 case 54:
3256 FollowThrall();
3257 SetEscortPaused(false);
3258 bStepping = false;
3259 SetRun(false);
3261 break;
3262 // Top of Undercity Discussion
3263 case 55:
3265 sylvanas->AI()->Talk(SYLVANAS_SAY_SANCTUM_1);
3267 break;
3268 case 56:
3270 sylvanas->AI()->Talk(SYLVANAS_SAY_SANCTUM_2);
3272 break;
3273 case 57:
3276 break;
3277 case 58:
3279 sylvanas->AI()->Talk(SYLVANAS_SAY_SANCTUM_3);
3281 break;
3282 // Top of Undercity - Fight
3283 case 59:
3284 SpawnWave(9);
3286 break;
3287 case 60:
3288 SpawnWave(9);
3290 break;
3291 case 61:
3292 SpawnWave(9);
3294 break;
3295 case 62:
3296 FollowThrall();
3297 SetEscortPaused(false);
3298 bStepping = false;
3299 SetRun(false);
3301 break;
3302 case 63:
3304 break;
3305 case 64:
3306 SpawnWave(10);
3308 break;
3309 case 65:
3310 SpawnWave(10);
3312 break;
3313 case 66:
3314 FollowThrall();
3315 SetEscortPaused(false);
3316 bStepping = false;
3317 SetRun(false);
3319 break;
3320 case 67:
3321 SpawnWave(11);
3323 break;
3324 case 68:
3325 SpawnWave(11);
3327 break;
3328 case 69:
3329 FollowThrall();
3330 SetEscortPaused(false);
3331 bStepping = false;
3332 SetRun(false);
3334 break;
3335 // KHANOK - Valimathtas Intro
3336 case 70:
3338 break;
3339 case 71:
3341 sylvanas->AI()->Talk(SYLVANAS_SAY_SANCTUM_4);
3342 SpawnWave(12);
3344 break;
3345 case 72:
3347 valimathras->AI()->Talk(SAY_VALIMATHRAS_INNER_SANKTUM_0);
3349 break;
3350 case 73:
3352 valimathras->AI()->Talk(SAY_VALIMATHRAS_INNER_SANKTUM_1);
3353 SpawnWave(13);
3355 break;
3356 case 74:
3358 valimathrasportal->CastSpell(valimathrasportal, SPELL_VALIMATHRAS_PORTAL);
3360 break;
3361 case 75:
3363 {
3364 valimathras->GetMotionMaster()->MovePoint(0, 1596.642f, 429.811f, -46.3429f);
3365 valimathras->DespawnOrUnsummon(3 * IN_MILLISECONDS);
3366 }
3368 valimathrasportal->DespawnOrUnsummon(3 * IN_MILLISECONDS);
3370 break;
3371 // KHANOK - Trashspawn
3372 case 76:
3373 SpawnWave(14);
3375 break;
3376 case 77:
3377 SpawnWave(15);
3379 break;
3380 case 78:
3381 SpawnWave(16);
3383 break;
3384 case 79:
3385 SpawnWave(14);
3387 break;
3388 case 80:
3389 SpawnWave(15);
3391 break;
3392 case 81:
3393 SpawnWave(16);
3395 break;
3396 case 82:
3397 SpawnWave(14);
3399 break;
3400 case 83:
3401 SpawnWave(15);
3403 break;
3404 case 84:
3405 SpawnWave(16);
3407 break;
3408 case 85:
3409 SpawnWave(14);
3411 break;
3412 case 86:
3413 SpawnWave(15);
3415 break;
3416 case 87:
3417 SpawnWave(16);
3419 break;
3420 case 88:
3421 SpawnWave(14);
3423 break;
3424 case 89:
3425 SpawnWave(15);
3427 break;
3428 case 90:
3429 SpawnWave(16);
3431 break;
3432 case 91:
3433 SpawnWave(14);
3435 break;
3436 case 92:
3437 SpawnWave(15);
3439 break;
3440 case 93:
3441 SpawnWave(16);
3443 break;
3444 case 94:
3445 // Spawn Boss 2 KHANOK
3446 SpawnWave(17);
3448 break;
3449 case 95:
3450 SpawnWave(14);
3452 break;
3453 case 96:
3454 SpawnWave(15);
3456 break;
3457 case 97:
3458 SpawnWave(16);
3460 bStepping = false;
3461 break;
3462 case 98:
3463 // KHANOK - Won
3466 break;
3467 case 99:
3468 SpawnWave(18);
3470 break;
3471 case 100:
3472 SpawnWave(18);
3474 break;
3475 case 101:
3476 SpawnWave(18);
3478 break;
3479 case 102:
3480 SpawnWave(18);
3482 break;
3483 case 103:
3484 SpawnWave(18);
3486 break;
3487 case 104:
3488 SpawnWave(18);
3490 break;
3491 case 105:
3492 SpawnWave(18);
3494 break;
3495 case 106:
3496 SpawnWave(18);
3498 break;
3499 case 107:
3500 SpawnWave(18);
3502 break;
3503 case 108:
3505 FollowThrall();
3506 SetEscortPaused(false);
3507 bStepping = false;
3508 SetRun(false);
3510 break;
3511 case 109:
3513 sylvanas->AI()->Talk(SYLVANAS_SAY_SANCTUM_5);
3515 break;
3516 case 110:
3517 SpawnWave(19);
3519 break;
3520 case 111:
3521 FollowThrall();
3522 SetEscortPaused(false);
3523 bStepping = false;
3524 SetRun(true);
3526 break;
3527 case 112:
3529 break;
3530 case 113:
3533 break;
3534 case 114:
3538 break;
3539 case 115:
3540 {
3541 std::list<GameObject*> SaronitList;
3543 for (std::list<GameObject*>::const_iterator itr = SaronitList.begin(); itr != SaronitList.end(); ++itr)
3544 if (GameObject* saronit = (*itr))
3545 saronit->UseDoorOrButton();
3547 break;
3548 }
3549 case 116:
3552 FollowThrall();
3553 SetEscortPaused(false);
3554 bStepping = false;
3556 break;
3557 // Valimathras Intro
3558 case 117:
3561 break;
3562 case 118:
3564 {
3565 valimathras->AI()->Talk(SAY_THRONE_1);
3566 valimathras->CastSpell(me, SPELL_OPENING_LEGION_PORTALS);
3567 }
3569 break;
3570 case 119:
3571 SpawnWave(20);
3573 break;
3574 case 120:
3575 SpawnWave(21);
3577 break;
3578 case 121:
3581 valimathras->AI()->Talk(SAY_THRONE_2);
3583 break;
3584 case 122:
3585 SpawnWave(20);
3587 break;
3588 case 123:
3589 SpawnWave(21);
3591 break;
3592 case 124:
3595 valimathras->AI()->Talk(SAY_THRONE_3);
3597 break;
3598 case 125:
3599 SpawnWave(20);
3601 break;
3602 case 126:
3603 SpawnWave(21);
3605 break;
3606 case 127:
3609 valimathras->AI()->Talk(SAY_THRONE_4);
3611 break;
3612 case 128:
3613 SpawnWave(20);
3615 break;
3616 case 129:
3617 SpawnWave(21);
3619 break;
3620 case 130:
3623 valimathras->AI()->Talk(SAY_THRONE_5);
3625 break;
3626 case 131:
3627 SpawnWave(20);
3629 break;
3630 case 132:
3631 SpawnWave(21);
3633 break;
3634 case 133:
3637 valimathras->AI()->Talk(SAY_THRONE_6);
3639 break;
3640 case 134:
3641 SpawnWave(20);
3643 break;
3644 case 135:
3645 SpawnWave(21);
3647 break;
3648 case 136:
3651 break;
3652 // Valimathras Fight
3653 case 137:
3655 {
3656 valimathras->SetImmuneToAll(false);
3657 valimathras->RemoveAura(SPELL_AURA_OF_VARIMATHRAS);
3658 valimathras->RemoveAura(SPELL_OPENING_LEGION_PORTALS);
3659 valimathras->AI()->Talk(SAY_VALIMATHRAS_ATTACK);
3660 valimathras->AddThreat(me, 100.0f);
3661 me->AddThreat(valimathras, 100.0f);
3662 valimathras->AI()->AttackStart(me);
3663 }
3664 bStepping = false;
3666 break;
3667 // Valimathras Won
3668 case 138:
3671 break;
3672 case 139:
3675 break;
3676 case 140:
3677 SetEscortPaused(false);
3678 bStepping = false;
3680 break;
3681 case 141:
3683 break;
3684 case 142:
3686 me->SetFacingToObject(sylvanas);
3689 break;
3690 case 143:
3692 {
3693 sylvanas->GetMotionMaster()->MovePoint(0, 1289.48f, 314.33f, -57.32f, true);
3694 sylvanas->CastSpell(sylvanas, SPELL_LEAP_TO_PLATFORM);
3695 }
3697 break;
3698 case 144:
3700 {
3701 sylvanas->AI()->Talk(SYLVANAS_SAY_THRONE_1);
3702 me->SetFacingToObject(sylvanas);
3703 sylvanas->SetFacingToObject(me);
3705 }
3707 break;
3708 case 145:
3710 FollowThrall();
3711 SetEscortPaused(false);
3712 bStepping = false;
3714 break;
3715 case 146:
3718 break;
3719 case 147:
3720 for (uint8 i = 0; i < ALLIANCE_FORCE_MAXCOUNT; ++i)
3721 {
3723 {
3724 allianceForcesGUID[i] = temp->GetGUID();
3725 temp->SetImmuneToAll(true);
3726 temp->ApplySpellImmune(0, IMMUNITY_ID, SPELL_SYLVANAS_BUFF, true);
3727 temp->SetReactState(REACT_PASSIVE);
3728 temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
3729 }
3730 }
3731 if (Creature* wrynn = me->SummonCreature(NPC_WRYNN, 1308.862f, 381.809f, -66.044243f, TEMPSUMMON_MANUAL_DESPAWN))
3732 {
3733 WrynnGUID = wrynn->GetGUID();
3734 wrynn->SetImmuneToAll(true);
3735 wrynn->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H);
3736 wrynn->SetReactState(REACT_PASSIVE);
3737 wrynn->GetMotionMaster()->MovePoint(0, 1302.543f, 359.472f, -67.295f, true);
3738 }
3739 if (Creature* jaina = me->SummonCreature(NPC_JAINA, 1308.862f, 381.809f, -66.044243f, TEMPSUMMON_MANUAL_DESPAWN))
3740 {
3741 JainaGUID = jaina->GetGUID();
3742 jaina->SetImmuneToAll(true);
3743 jaina->SetReactState(REACT_PASSIVE);
3744 }
3746 break;
3747 // Wrynn Intro
3748 case 148:
3750 wrynn->AI()->Talk(WRYNN_SAY_THRONE_5);
3752 break;
3753 case 149:
3755 wrynn->AI()->Talk(WRYNN_SAY_THRONE_6);
3757 break;
3758 case 150:
3760 wrynn->AI()->Talk(WRYNN_SAY_THRONE_7);
3762 break;
3763 case 151:
3765 wrynn->AI()->Talk(WRYNN_SAY_THRONE_8);
3767 break;
3768 // Wrynn Fight
3769 case 152:
3770 me->SetImmuneToAll(false);
3772 {
3773 wrynn->SetImmuneToNPC(false);
3774 wrynn->SetImmuneToPC(true);
3775 wrynn->SetReactState(REACT_AGGRESSIVE);
3776 wrynn->AddThreat(me, 100.0f);
3777 me->AddThreat(wrynn, 100.0f);
3778 wrynn->AI()->AttackStart(me);
3779 }
3780
3781 for (uint8 i = 0; i < ALLIANCE_FORCE_MAXCOUNT; ++i)
3782 {
3784 {
3785 temp->SetImmuneToAll(false);
3786 temp->SetReactState(REACT_AGGRESSIVE);
3787 temp->AddThreat(me, 100.0f);
3788 temp->AI()->AttackStart(me);
3789 }
3790 }
3792 break;
3793 case 153:
3795 {
3796 jaina->GetMotionMaster()->MovePoint(0, AllianceWP[9].x, AllianceWP[9].y, AllianceWP[9].z);
3797 jaina->AI()->Talk(JAINA_SAY_THRONE_2);
3798 }
3800 break;
3801 case 154:
3803 {
3804 jaina->AI()->DoCastAOE(SPELL_DEEPFREEZE);
3805 jaina->AI()->Talk(JAINA_SAY_THRONE_3);
3806 }
3808 break;
3809 case 155:
3810 {
3811 std::list<Creature*> HelperList;
3812 me->GetCreatureListWithEntryInGrid(HelperList, NPC_SW_SOLDIER, 100.0f);
3813 me->GetCreatureListWithEntryInGrid(HelperList, NPC_JAINA, 100.0f);
3814 me->GetCreatureListWithEntryInGrid(HelperList, NPC_WRYNN, 100.0f);
3815 if (!HelperList.empty())
3816 for (std::list<Creature*>::iterator itr = HelperList.begin(); itr != HelperList.end(); itr++)
3817 (*itr)->DespawnOrUnsummon();
3819 break;
3820 }
3821 case 156:
3823 SetEscortPaused(false);
3824 bStepping = false;
3826 break;
3827 case 157:
3831 break;
3832 // Ending
3833 case 158:
3834 if (Creature* saurfang = me->SummonCreature(NPC_OVERLORD_SAURFANG, 1297.574f, 347.154f, -65.027f, TEMPSUMMON_MANUAL_DESPAWN))
3835 {
3836 SaurfangGUID = saurfang->GetGUID();
3837 saurfang->SetWalk(true);
3838 saurfang->GetMotionMaster()->MovePoint(0, 1300.862f, 353.670f, -66.187f, true);
3839 }
3841 break;
3842 case 159:
3844 {
3845 saurfang->AI()->Talk(SAY_SAURFANG_ARRIVAL_1);
3846 saurfang->SetStandState(UNIT_STAND_STATE_SIT);
3847 }
3849 break;
3850 case 160:
3852 saurfang->AI()->Talk(SAY_SAURFANG_ARRIVAL_2);
3854 break;
3855 case 161:
3857 saurfang->AI()->Talk(SAY_SAURFANG_ARRIVAL_3);
3858 if (Map* map = me->GetMap())
3859 {
3860 Map::PlayerList const& PlayerList = map->GetPlayers();
3861 for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
3862 {
3863 if (Player* player = i->GetSource())
3864 {
3865 if (me->IsInRange(player, 0.0f, 50.0f))
3866 {
3867 if (player->GetTeamId() == TEAM_HORDE)
3868 {
3869 player->RemoveAura(SPELL_SYLVANAS_BUFF);
3870 player->RemoveAura(SPELL_THRALL_BUFF);
3871 player->CompleteQuest(QUEST_BATTLE_H);
3872 player->CastSpell(player, SPELL_PHASING_HORDE);
3873 }
3874 }
3875 }
3876 }
3877 }
3879 break;
3880 case 162:
3883 break;
3884 case 163:
3891 std::list<Creature*> HelperList;
3892 me->GetCreatureListWithEntryInGrid(HelperList, NPC_SYLVANAS, 100.0f);
3894 if (!HelperList.empty())
3895 for (std::list<Creature*>::iterator itr = HelperList.begin(); itr != HelperList.end(); itr++)
3896 (*itr)->DespawnOrUnsummon(120 * IN_MILLISECONDS);
3898 bStepping = false;
3900 break;
3901 }
3902 }
3903 else phaseTimer -= diff;
3904 }
3905
3906 if (!UpdateVictim())
3907 return;
3908
3909 _events.Update(diff);
3910
3912 return;
3913
3914 while (uint32 eventId = _events.ExecuteEvent())
3915 {
3916 switch (eventId)
3917 {
3921 break;
3922 case EVENT_LAVA_BURST:
3925 break;
3926 case EVENT_THUNDER:
3929 break;
3931 if (me->GetVictim())
3933 sylvanas->AI()->AttackStart(me->GetVictim());
3935 break;
3936 case EVENT_THRALL_BUFF:
3939 break;
3940 default:
3941 break;
3942 }
3943 }
3944
3946 }
std::uint32_t uint32
Definition: Define.h:107
void GetGameObjectListWithEntryInGrid(std::list< GameObject * > &list, WorldObject *source, uint32 entry, float maxSearchRange)
Definition: ScriptedCreature.cpp:832
@ REACT_PASSIVE
Definition: Unit.h:548
@ UNIT_STAND_STATE_SIT
Definition: UnitDefines.h:33
@ UNIT_NPC_FLAG_QUESTGIVER
Definition: UnitDefines.h:295
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
@ WRYNN_SAY_THRONE_5
Definition: zone_undercity.cpp:397
@ NPC_WRYNN
Definition: zone_undercity.cpp:368
@ WRYNN_SAY_THRONE_6
Definition: zone_undercity.cpp:398
@ WRYNN_SAY_THRONE_8
Definition: zone_undercity.cpp:400
@ WRYNN_SAY_THRONE_7
Definition: zone_undercity.cpp:399
@ JAINA_SAY_THRONE_2
Definition: zone_undercity.cpp:424
@ JAINA_SAY_THRONE_3
Definition: zone_undercity.cpp:425
@ NPC_JAINA
Definition: zone_undercity.cpp:418
@ SPELL_DEEPFREEZE
Definition: zone_undercity.cpp:431
@ NPC_SW_SOLDIER
Definition: zone_undercity.cpp:678
@ NPC_HORDE_GUARD
Definition: zone_undercity.cpp:680
@ SAY_PUTRESS_ANGER
Definition: zone_undercity.cpp:701
@ SAY_BURN_UC
Definition: zone_undercity.cpp:700
@ SYLVANAS_SAY_SANCTUM_4
Definition: zone_undercity.cpp:557
@ SPELL_LEAP_TO_PLATFORM
Definition: zone_undercity.cpp:564
@ SYLVANAS_SAY_SANCTUM_3
Definition: zone_undercity.cpp:556
@ SYLVANAS_SAY_THRONE_1
Definition: zone_undercity.cpp:559
@ SYLVANAS_SAY_SANCTUM_1
Definition: zone_undercity.cpp:554
@ SYLVANAS_SAY_SANCTUM_2
Definition: zone_undercity.cpp:555
@ SYLVANAS_SAY_SANCTUM_5
Definition: zone_undercity.cpp:558
@ NPC_SYLVANAS
Definition: zone_undercity.cpp:549
@ SYLVANAS_SAY_ELEVATOR_1
Definition: zone_undercity.cpp:553
@ SPELL_PHASING_HORDE
Definition: zone_undercity.cpp:710
@ ALLIANCE_FORCE_MAXCOUNT
Definition: zone_undercity.cpp:718
@ QUEST_BATTLE_H
Definition: zone_undercity.cpp:708
@ SAY_SAURFANG_ARRIVAL_2
Definition: zone_undercity.cpp:578
@ SAY_SAURFANG_ARRIVAL_3
Definition: zone_undercity.cpp:579
@ SAY_SAURFANG_ARRIVAL_1
Definition: zone_undercity.cpp:577
static LocationXYZO AllianceSpawn[]
Definition: zone_undercity.cpp:755
@ WORLD_STATE_BATTLE_START_H
Definition: zone_undercity.cpp:739
@ WORLD_STATE_BATTLE_COUNTDOWN_H
Definition: zone_undercity.cpp:738
@ SAY_VALIMATHRAS_ATTACK
Definition: zone_undercity.cpp:655
@ SAY_THRONE_2
Definition: zone_undercity.cpp:650
@ SAY_THRONE_1
Definition: zone_undercity.cpp:649
@ SAY_VALIMATHRAS_INTRO_1
Definition: zone_undercity.cpp:644
@ SAY_VALIMATHRAS_INTRO_2
Definition: zone_undercity.cpp:645
@ SAY_THRONE_6
Definition: zone_undercity.cpp:654
@ SAY_VALIMATHRAS_INTRO_0
Definition: zone_undercity.cpp:643
@ SAY_VALIMATHRAS_INNER_SANKTUM_0
Definition: zone_undercity.cpp:646
@ SAY_THRONE_5
Definition: zone_undercity.cpp:653
@ SAY_VALIMATHRAS_INNER_SANKTUM_1
Definition: zone_undercity.cpp:647
@ SAY_THRONE_4
Definition: zone_undercity.cpp:652
@ SAY_THRONE_3
Definition: zone_undercity.cpp:651
@ THRALL_SAY_THRONE_11
Definition: zone_undercity.cpp:489
@ NPC_SLINGER_TRIGGER
Definition: zone_undercity.cpp:531
@ THRALL_SAY_COURTYARD_5
Definition: zone_undercity.cpp:468
@ THRALL_SAY_THRONE_2
Definition: zone_undercity.cpp:480
@ THRALL_SAY_THRONE_4
Definition: zone_undercity.cpp:482
@ THRALL_SAY_SANCTUM_6
Definition: zone_undercity.cpp:477
@ THRALL_SAY_PREP_1
Definition: zone_undercity.cpp:456
@ SPELL_CALL_OF_AIR
Definition: zone_undercity.cpp:501
@ THRALL_SAY_PREP_6
Definition: zone_undercity.cpp:461
@ THRALL_SAY_ELEVATOR_1
Definition: zone_undercity.cpp:469
@ THRALL_SAY_COURTYARD_3
Definition: zone_undercity.cpp:466
@ THRALL_SAY_THRONE_9
Definition: zone_undercity.cpp:487
@ THRALL_SAY_THRONE_7
Definition: zone_undercity.cpp:485
@ THRALL_SAY_SANCTUM_4
Definition: zone_undercity.cpp:475
@ SPELL_LAVA_BURST
Definition: zone_undercity.cpp:514
@ THRALL_SAY_COURTYARD_1
Definition: zone_undercity.cpp:464
@ THRALL_SAY_PREP_5
Definition: zone_undercity.cpp:460
@ GO_HORDE_BANNER
Definition: zone_undercity.cpp:539
@ THRALL_SAY_SANCTUM_3
Definition: zone_undercity.cpp:474
@ SPELL_CALL_OF_EARTH
Definition: zone_undercity.cpp:503
@ THRALL_SAY_THRONE_1
Definition: zone_undercity.cpp:479
@ THRALL_SAY_PREP_7
Definition: zone_undercity.cpp:462
@ THRALL_SAY_SANCTUM_5
Definition: zone_undercity.cpp:476
@ THRALL_SAY_COURTYARD_4
Definition: zone_undercity.cpp:467
@ THRALL_SAY_PREP_3
Definition: zone_undercity.cpp:458
@ SPELL_TIDAL_WAVE_SUMMON
Definition: zone_undercity.cpp:498
@ THRALL_SAY_PREP_8
Definition: zone_undercity.cpp:463
@ THRALL_SAY_ELEVATOR_2
Definition: zone_undercity.cpp:470
@ THRALL_SAY_ELEVATOR_3
Definition: zone_undercity.cpp:471
@ THRALL_SAY_THRONE_3
Definition: zone_undercity.cpp:481
@ THRALL_SAY_PREP_4
Definition: zone_undercity.cpp:459
@ THRALL_SAY_THRONE_5
Definition: zone_undercity.cpp:483
@ THRALL_SAY_SANCTUM_7
Definition: zone_undercity.cpp:478
@ THRALL_SAY_PREP_2
Definition: zone_undercity.cpp:457
@ THRALL_SAY_THRONE_10
Definition: zone_undercity.cpp:488
@ SPELL_CHAIN_LIGHTNING
Definition: zone_undercity.cpp:513
@ THRALL_SAY_THRONE_6
Definition: zone_undercity.cpp:484
@ THRALL_SAY_SANCTUM_2
Definition: zone_undercity.cpp:473
@ NPC_PLAGUE_TRIGGER
Definition: zone_undercity.cpp:534
@ NPC_OVERLORD_SAURFANG
Definition: zone_undercity.cpp:532
@ SPELL_THUNDER
Definition: zone_undercity.cpp:515
@ THRALL_SAY_COURTYARD_2
Definition: zone_undercity.cpp:465
static LocationXYZO AllianceWP[]
Definition: zone_undercity.cpp:790
Talk
Definition: hyjal.cpp:82
@ EMOTE_ONESHOT_SALUTE
Definition: SharedDefines.h:1942
@ TEAM_HORDE
Definition: SharedDefines.h:761
@ FACTION_MONSTER
Definition: SharedDefines.h:195
Definition: LinkedList.h:139
uint32 ExecuteEvent()
Definition: EventMap.cpp:114
void Update(uint32 time)
Definition: EventMap.h:54
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:240
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:177
bool UpdateVictim()
Definition: CreatureAI.cpp:269
void UpdateAI(uint32 diff) override
Use to start attacking a target. Called just before JustEngagedWith()
Definition: ScriptedEscortAI.cpp:240
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2173
Definition: GameObject.h:121
void setActive(bool isActiveObject)
Definition: Object.cpp:1085
bool IsInRange(WorldObject const *obj, float minRange, float maxRange, bool is3D=true) const
Definition: Object.cpp:1404
Definition: Player.h:1064
void Dismount()
Definition: Unit.cpp:13481
void SetFacingToObject(WorldObject *object)
Definition: Unit.cpp:20493
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:1168
Unit * GetVictim() const
Definition: Unit.h:789
bool HasUnitState(const uint32 f) const
Definition: Unit.h:673
void HandleEmoteCommand(uint32 emoteId)
Definition: Unit.cpp:1984
void SetImmuneToAll(bool apply, bool keepCombat=false)
Definition: Unit.h:810
Definition: Map.h:313
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37
void ActivateValimathrasPortal()
Definition: zone_undercity.cpp:2556
ObjectGuid allianceForcesGUID[ALLIANCE_FORCE_MAXCOUNT]
Definition: zone_undercity.cpp:2328
void JumpToNextStep(uint32 uiTimer)
Definition: zone_undercity.cpp:2538
void SpawnWave(uint32 waveId)
Definition: zone_undercity.cpp:2565

References _events, ActivateValimathrasPortal(), Unit::AddThreat(), ALLIANCE_FORCE_MAXCOUNT, allianceForcesGUID, AllianceSpawn, AllianceWP, MapRefMgr::begin(), bStepping, Unit::CastSpell(), Creature::DespawnOrUnsummon(), Unit::Dismount(), UnitAI::DoCast(), UnitAI::DoCastVictim(), UnitAI::DoMeleeAttackIfReady(), EMOTE_ONESHOT_SALUTE, EMOTE_STATE_READY2H, EnableAttack, MapRefMgr::end(), EVENT_AGGRO_SYLVANAS, EVENT_CHAIN_LIGHTNING, EVENT_LAVA_BURST, EVENT_THRALL_BUFF, EVENT_THUNDER, EventMap::ExecuteEvent(), FACTION_MONSTER, WorldObject::FindNearestCreature(), FollowThrall(), ObjectAccessor::GetCreature(), WorldObject::GetCreatureListWithEntryInGrid(), GetGameObjectListWithEntryInGrid(), WorldObject::GetMap(), Unit::GetMotionMaster(), Unit::GetVictim(), GO_BLOCKED_PASSAGE, GO_HORDE_BANNER, Unit::HandleEmoteCommand(), Unit::HasUnitState(), IMMUNITY_ID, IN_MILLISECONDS, WorldObject::IsInRange(), JAINA_SAY_THRONE_2, JAINA_SAY_THRONE_3, JainaGUID, JumpToNextStep(), ScriptedAI::me, MotionMaster::MoveJump(), NPC_BLIGHT_SLINGER, NPC_CHEMIST_H, NPC_DOCTOR_H, NPC_HORDE_GUARD, NPC_JAINA, NPC_OVERLORD_SAURFANG, NPC_PLAGUE_TRIGGER, NPC_SLINGER_TRIGGER, NPC_SW_SOLDIER, NPC_SYLVANAS, NPC_TREACHEROUS_GUARDIAN_H, NPC_WRYNN, LocationXYZO::o, phaseTimer, QUEST_BATTLE_H, REACT_AGGRESSIVE, REACT_PASSIVE, SaurfangGUID, SAY_BURN_UC, SAY_PUTRESS_ANGER, SAY_SAURFANG_ARRIVAL_1, SAY_SAURFANG_ARRIVAL_2, SAY_SAURFANG_ARRIVAL_3, SAY_THRONE_1, SAY_THRONE_2, SAY_THRONE_3, SAY_THRONE_4, SAY_THRONE_5, SAY_THRONE_6, SAY_VALIMATHRAS_ATTACK, SAY_VALIMATHRAS_INNER_SANKTUM_0, SAY_VALIMATHRAS_INNER_SANKTUM_1, SAY_VALIMATHRAS_INTRO_0, SAY_VALIMATHRAS_INTRO_1, SAY_VALIMATHRAS_INTRO_2, EventMap::ScheduleEvent(), WorldObject::setActive(), npc_escortAI::SetEscortPaused(), Unit::SetFacingToObject(), Unit::SetImmuneToAll(), Unit::SetNpcFlag(), npc_escortAI::SetRun(), Unit::SetStandState(), SpawnWave(), SPELL_AURA_OF_VARIMATHRAS, SPELL_CALL_OF_AIR, SPELL_CALL_OF_EARTH, SPELL_CHAIN_LIGHTNING, SPELL_DEEPFREEZE, SPELL_HEROIC_VANGUARD, SPELL_LAVA_BURST, SPELL_LEAP_TO_PLATFORM, SPELL_OPENING_LEGION_PORTALS, SPELL_PHASING_HORDE, SPELL_SYLVANAS_BUFF, SPELL_THRALL_BUFF, SPELL_THUNDER, SPELL_TIDAL_WAVE_SUMMON, SPELL_VALIMATHRAS_PORTAL, step, WorldObject::SummonCreature(), WorldObject::SummonGameObject(), SYLVANAS_SAY_ELEVATOR_1, SYLVANAS_SAY_SANCTUM_1, SYLVANAS_SAY_SANCTUM_2, SYLVANAS_SAY_SANCTUM_3, SYLVANAS_SAY_SANCTUM_4, SYLVANAS_SAY_SANCTUM_5, SYLVANAS_SAY_THRONE_1, sylvanasfollowGUID, TEAM_HORDE, TEMPSUMMON_MANUAL_DESPAWN, THRALL_SAY_COURTYARD_1, THRALL_SAY_COURTYARD_2, THRALL_SAY_COURTYARD_3, THRALL_SAY_COURTYARD_4, THRALL_SAY_COURTYARD_5, THRALL_SAY_ELEVATOR_1, THRALL_SAY_ELEVATOR_2, THRALL_SAY_ELEVATOR_3, THRALL_SAY_PREP_1, THRALL_SAY_PREP_2, THRALL_SAY_PREP_3, THRALL_SAY_PREP_4, THRALL_SAY_PREP_5, THRALL_SAY_PREP_6, THRALL_SAY_PREP_7, THRALL_SAY_PREP_8, THRALL_SAY_SANCTUM_2, THRALL_SAY_SANCTUM_3, THRALL_SAY_SANCTUM_4, THRALL_SAY_SANCTUM_5, THRALL_SAY_SANCTUM_6, THRALL_SAY_SANCTUM_7, THRALL_SAY_THRONE_1, THRALL_SAY_THRONE_10, THRALL_SAY_THRONE_11, THRALL_SAY_THRONE_2, THRALL_SAY_THRONE_3, THRALL_SAY_THRONE_4, THRALL_SAY_THRONE_5, THRALL_SAY_THRONE_6, THRALL_SAY_THRONE_7, THRALL_SAY_THRONE_9, ThrallSpawn, UNIT_NPC_EMOTESTATE, UNIT_NPC_FLAG_GOSSIP, UNIT_NPC_FLAG_QUESTGIVER, UNIT_STAND_STATE_SIT, UNIT_STATE_CASTING, EventMap::Update(), npc_escortAI::UpdateAI(), CreatureAI::UpdateVictim(), UpdateWorldState(), ValimathrasGUID, ValimathrasPortalGUID, WORLD_STATE_BATTLE_COUNTDOWN_H, WORLD_STATE_BATTLE_START_H, WORLD_STATE_COURTYARD_FIGHT_H, WORLD_STATE_INNER_SANKTUM_FIGHT_H, WORLD_STATE_ROYAL_QUARTER_FIGHT_H, WRYNN_SAY_THRONE_5, WRYNN_SAY_THRONE_6, WRYNN_SAY_THRONE_7, WRYNN_SAY_THRONE_8, WrynnGUID, LocationXYZO::x, LocationXYZO::y, and LocationXYZO::z.

◆ UpdateWorldState()

void npc_thrall_bfu::npc_thrall_bfuAI::UpdateWorldState ( Map map,
uint32  id,
uint32  state 
)
inline
2520 {
2521 Map::PlayerList const& players = map->GetPlayers();
2522
2523 if (!players.IsEmpty())
2524 {
2525 for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
2526 {
2527 if (Player* player = itr->GetSource())
2528 player->SendUpdateWorldState(id, state);
2529 }
2530 }
2531 }
bool IsEmpty() const
Definition: LinkedList.h:97
PlayerList const & GetPlayers() const
Definition: Map.h:486

References MapRefMgr::begin(), MapRefMgr::end(), Map::GetPlayers(), and LinkedListHead::IsEmpty().

Referenced by SummonedCreatureDies(), UpdateAI(), and WaypointReached().

◆ WaypointReached()

void npc_thrall_bfu::npc_thrall_bfuAI::WaypointReached ( uint32  waypointId)
inlineoverridevirtual

Implements npc_escortAI.

2848 {
2849 switch (waypointId)
2850 {
2851 case 1:
2852 SetHoldState(true);
2853 bStepping = true;
2854 break;
2855 case 2:
2856 SetHoldState(true);
2857 bStepping = true;
2858 break;
2859 case 11:
2860 SetHoldState(true);
2861 bStepping = true;
2862 break;
2863 case 13:
2864 SetHoldState(true);
2865 bStepping = true;
2866 break;
2867 case 14:
2868 SetHoldState(true);
2869 bStepping = true;
2870 break;
2871 case 34:
2872 SetHoldState(true);
2873 bStepping = true;
2874 break;
2875 case 36:
2878 break;
2879 case 46:
2880 SetHoldState(true);
2881 bStepping = true;
2882 break;
2883 case 57:
2884 SetHoldState(true);
2885 bStepping = true;
2886 break;
2887 case 61:
2888 SetHoldState(true);
2889 bStepping = true;
2890 break;
2891 case 65:
2892 SetHoldState(true);
2893 bStepping = true;
2894 break;
2895 case 66:
2896 SetHoldState(true);
2897 bStepping = true;
2898 break;
2899 case 75:
2900 SetHoldState(true);
2901 bStepping = true;
2902 break;
2903 case 81:
2904 SetHoldState(true);
2905 bStepping = true;
2906 break;
2907 case 104:
2908 SetHoldState(true);
2909 bStepping = true;
2910 break;
2911 case 109:
2912 SetHoldState(true);
2913 bStepping = true;
2914 break;
2915 case 113:
2916 SetHoldState(true);
2917 bStepping = true;
2918 break;
2919 case 117:
2920 SetHoldState(true);
2921 bStepping = true;
2922 break;
2923 case 118:
2925 break;
2926 case 120:
2927 SetHoldState(true);
2928 bStepping = true;
2929 break;
2930 }
2931 }
@ THRALL_SAY_THRONE_8
Definition: zone_undercity.cpp:486
@ THRALL_SAY_SANCTUM_1
Definition: zone_undercity.cpp:472
void SetHoldState(bool bOnHold)
Definition: zone_undercity.cpp:2533

References bStepping, WorldObject::GetMap(), ScriptedAI::me, SetHoldState(), THRALL_SAY_SANCTUM_1, THRALL_SAY_THRONE_8, UpdateWorldState(), and WORLD_STATE_INNER_SANKTUM_FIGHT_H.

Member Data Documentation

◆ _events

EventMap npc_thrall_bfu::npc_thrall_bfuAI::_events

Referenced by Reset(), and UpdateAI().

◆ allianceForcesGUID

ObjectGuid npc_thrall_bfu::npc_thrall_bfuAI::allianceForcesGUID[ALLIANCE_FORCE_MAXCOUNT]

Referenced by UpdateAI().

◆ bStepping

bool npc_thrall_bfu::npc_thrall_bfuAI::bStepping

◆ EnableAttack

bool npc_thrall_bfu::npc_thrall_bfuAI::EnableAttack

Referenced by JustSummoned(), Reset(), and UpdateAI().

◆ hordeGuardsGUID

GuidVector npc_thrall_bfu::npc_thrall_bfuAI::hordeGuardsGUID

Referenced by npc_thrall_bfuAI(), Reset(), and SpawnWave().

◆ JainaGUID

ObjectGuid npc_thrall_bfu::npc_thrall_bfuAI::JainaGUID

Referenced by Reset(), and UpdateAI().

◆ phaseTimer

uint32 npc_thrall_bfu::npc_thrall_bfuAI::phaseTimer

Referenced by JumpToNextStep(), Reset(), and UpdateAI().

◆ SaurfangGUID

ObjectGuid npc_thrall_bfu::npc_thrall_bfuAI::SaurfangGUID

Referenced by Reset(), and UpdateAI().

◆ step

uint32 npc_thrall_bfu::npc_thrall_bfuAI::step

Referenced by JumpToNextStep(), Reset(), and UpdateAI().

◆ sylvanasfollowGUID

ObjectGuid npc_thrall_bfu::npc_thrall_bfuAI::sylvanasfollowGUID

Referenced by FollowThrall(), Reset(), and UpdateAI().

◆ ValimathrasGUID

ObjectGuid npc_thrall_bfu::npc_thrall_bfuAI::ValimathrasGUID

Referenced by Reset(), SpawnWave(), and UpdateAI().

◆ ValimathrasPortalGUID

ObjectGuid npc_thrall_bfu::npc_thrall_bfuAI::ValimathrasPortalGUID

Referenced by Reset(), SpawnWave(), and UpdateAI().

◆ WrynnGUID

ObjectGuid npc_thrall_bfu::npc_thrall_bfuAI::WrynnGUID

Referenced by Reset(), and UpdateAI().