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

Public Member Functions

 boss_algalon_the_observerAI (Creature *creature)
 
bool IsValidHeraldItem (ItemTemplate const *item)
 
bool DoCheckHeraldOfTheTitans ()
 
void AttackStart (Unit *who) override
 
uint32 GetData (uint32 param) const override
 
void CallConstellations ()
 
void EnterEvadeMode (EvadeReason why) override
 
void Reset () override
 
void KilledUnit (Unit *victim) override
 
void DoAction (int32 action) override
 
void JustReachedHome () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void MovementInform (uint32 movementType, uint32 pointId) override
 
void JustSummoned (Creature *summon) override
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 
bool IsInRoom ()
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 
void UpdateAI (uint32 diff) override
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void 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)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () const
 
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.
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged.
 
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 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
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
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 *)
 
- 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
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 
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)
 
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 (NOTE: Creature engage logic should NOT be here, but in JustEngagedWith, which happens once threat is established!)
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 
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)
 
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)
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the max threat target, which may not always 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)
 
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

EventMap events
 
SummonList summons
 
InstanceScriptm_pInstance
 
bool _firstPull
 
bool _fightWon
 
bool _phaseTwo
 
bool _fedOnTears
 
bool _heraldOfTheTitans
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
bool IsFleeing
 

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

◆ boss_algalon_the_observerAI()

boss_algalon_the_observer::boss_algalon_the_observerAI::boss_algalon_the_observerAI ( Creature creature)
inline
271 : ScriptedAI(creature), summons(me)
272 {
273 _fedOnTears = true;
274 _firstPull = true;
275 _fightWon = false;
277 }
Definition: ScriptedCreature.h:192
Creature * me
Definition: ScriptedCreature.h:282
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
bool _firstPull
Definition: boss_algalon_the_observer.cpp:283
bool _fedOnTears
Definition: boss_algalon_the_observer.cpp:286
bool _fightWon
Definition: boss_algalon_the_observer.cpp:284
InstanceScript * m_pInstance
Definition: boss_algalon_the_observer.cpp:281
SummonList summons
Definition: boss_algalon_the_observer.cpp:280

References _fedOnTears, _fightWon, _firstPull, WorldObject::GetInstanceScript(), m_pInstance, and ScriptedAI::me.

Member Function Documentation

◆ AttackStart()

void boss_algalon_the_observer::boss_algalon_the_observerAI::AttackStart ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

325 {
326 if (_fightWon)
327 return;
329 }
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:210

References _fightWon, and ScriptedAI::AttackStart().

Referenced by UpdateAI().

◆ CallConstellations()

void boss_algalon_the_observer::boss_algalon_the_observerAI::CallConstellations ( )
inline
341 {
342 uint8 _count = 0;
344 {
345 Creature* summon = ObjectAccessor::GetCreature(*me, *i++);
346 if (summon && summon->GetEntry() == NPC_LIVING_CONSTELLATION && !summon->AI()->GetData(0))
347 {
348 ++_count;
349 summon->AI()->DoAction(ACTION_ACTIVATE_STAR);
350 if (_count >= 3)
351 break;
352 }
353 }
354 }
std::uint8_t uint8
Definition: Define.h:110
@ ACTION_ACTIVATE_STAR
Definition: boss_algalon_the_observer.cpp:84
@ NPC_LIVING_CONSTELLATION
Definition: ulduar.h:165
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
virtual void DoAction(int32)
Definition: UnitAI.h:201
virtual uint32 GetData(uint32) const
Definition: UnitAI.h:202
iterator begin()
Definition: ScriptedCreature.h:50
StorageType::const_iterator const_iterator
Definition: ScriptedCreature.h:39
iterator end()
Definition: ScriptedCreature.h:60
Definition: Creature.h:46
CreatureAI * AI() const
Definition: Creature.h:136
uint32 GetEntry() const
Definition: Object.h:109

References ACTION_ACTIVATE_STAR, Creature::AI(), SummonList::begin(), UnitAI::DoAction(), SummonList::end(), ObjectAccessor::GetCreature(), UnitAI::GetData(), Object::GetEntry(), ScriptedAI::me, NPC_LIVING_CONSTELLATION, and summons.

Referenced by UpdateAI().

◆ DamageTaken()

void boss_algalon_the_observer::boss_algalon_the_observerAI::DamageTaken ( Unit ,
uint32 damage,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

590 {
591 if (_fightWon)
592 {
593 damage = 0;
594 return;
595 }
596
597 if (!_phaseTwo && me->HealthBelowPctDamaged(20, damage))
598 {
599 _phaseTwo = true;
607
608 for (uint32 i = 0; i < COLLAPSING_STAR_COUNT; ++i)
610 }
611 else if (me->HealthBelowPctDamaged(2, damage) && !_fightWon)
612 {
613 _fightWon = true;
614 damage = 0;
616 me->AttackStop();
619 events.Reset();
622 events.SetPhase(PHASE_ROLE_PLAY);
623 events.ScheduleEvent(EVENT_OUTRO_START, 1500ms);
624 events.ScheduleEvent(EVENT_OUTRO_1, 7200ms);
625 events.ScheduleEvent(EVENT_OUTRO_2, 8700ms);
626 }
627 }
std::uint32_t uint32
Definition: Define.h:108
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: Object.h:49
@ REACT_PASSIVE
Definition: Unit.h:1035
@ UNIT_FLAG_NOT_SELECTABLE
Definition: Unit.h:473
events
Definition: boss_sartura.cpp:43
Position const CollapsingStarPos[COLLAPSING_STAR_COUNT]
Definition: boss_algalon_the_observer.cpp:232
@ PHASE_ROLE_PLAY
Definition: boss_algalon_the_observer.cpp:161
#define COLLAPSING_STAR_COUNT
Definition: boss_algalon_the_observer.cpp:231
@ SAY_ALGALON_PHASE_TWO
Definition: boss_algalon_the_observer.cpp:185
@ EVENT_OUTRO_2
Definition: boss_algalon_the_observer.cpp:135
@ EVENT_OUTRO_START
Definition: boss_algalon_the_observer.cpp:133
@ EVENT_OUTRO_1
Definition: boss_algalon_the_observer.cpp:134
@ EVENT_ACTIVATE_LIVING_CONSTELLATION
Definition: boss_algalon_the_observer.cpp:145
@ EVENT_SUMMON_COLLAPSING_STAR
Definition: boss_algalon_the_observer.cpp:126
@ NPC_BLACK_HOLE
Definition: ulduar.h:168
@ NPC_COLLAPSING_STAR
Definition: ulduar.h:167
@ NPC_WORM_HOLE
Definition: ulduar.h:169
@ NPC_ALGALON_VOID_ZONE_VISUAL_STALKER
Definition: ulduar.h:170
Talk
Definition: boss_fathomlord_karathress.cpp:25
@ FACTION_FRIENDLY
Definition: SharedDefines.h:201
void DespawnEntry(uint32 entry)
Definition: ScriptedCreature.cpp:54
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
void SetReactState(ReactStates st)
Definition: Creature.h:90
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:2343
void SetFaction(uint32 faction)
Definition: Unit.cpp:10064
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4081
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:1459
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:1495
bool AttackStop()
Definition: Unit.cpp:10407
bool _phaseTwo
Definition: boss_algalon_the_observer.cpp:285

References _fightWon, _phaseTwo, Unit::AttackStop(), COLLAPSING_STAR_COUNT, CollapsingStarPos, SummonList::DespawnAll(), SummonList::DespawnEntry(), EVENT_ACTIVATE_LIVING_CONSTELLATION, EVENT_OUTRO_1, EVENT_OUTRO_2, EVENT_OUTRO_START, EVENT_SUMMON_COLLAPSING_STAR, FACTION_FRIENDLY, Unit::HealthBelowPctDamaged(), Unit::InterruptNonMeleeSpells(), ScriptedAI::me, NPC_ALGALON_VOID_ZONE_VISUAL_STALKER, NPC_BLACK_HOLE, NPC_COLLAPSING_STAR, NPC_LIVING_CONSTELLATION, NPC_WORM_HOLE, PHASE_ROLE_PLAY, REACT_PASSIVE, SAY_ALGALON_PHASE_TWO, Unit::SetFaction(), Creature::SetReactState(), Unit::SetUnitFlag(), WorldObject::SummonCreature(), summons, TEMPSUMMON_MANUAL_DESPAWN, and UNIT_FLAG_NOT_SELECTABLE.

◆ DoAction()

void boss_algalon_the_observer::boss_algalon_the_observerAI::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

412 {
413 switch (action)
414 {
416 {
417 me->SetImmuneToPC(true);
419 me->SetDisableGravity(true);
420 me->CastSpell(me, SPELL_ARRIVAL, true);
426 init.SetOrientationFixed(true);
427 init.Launch();
428 events.Reset();
429 events.SetPhase(PHASE_ROLE_PLAY);
430 events.ScheduleEvent(EVENT_INTRO_1, 5s, 0, PHASE_ROLE_PLAY);
431 events.ScheduleEvent(EVENT_INTRO_2, 15s, 0, PHASE_ROLE_PLAY);
432 events.ScheduleEvent(EVENT_INTRO_3, 23s, 0, PHASE_ROLE_PLAY);
433 events.ScheduleEvent(EVENT_INTRO_FINISH, 36s, 0, PHASE_ROLE_PLAY);
434 break;
435 }
437 _fightWon = true;
438 events.Reset();
440 events.SetPhase(PHASE_ROLE_PLAY);
441 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_1, 5s);
442 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_2, 17s);
443 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_3, 26s);
444 if (me->IsInCombat())
445 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_4, 26s);
446 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_5, 32s);
447 me->DespawnOrUnsummon(39000);
448
450 me->AttackStop();
454 if (m_pInstance)
456 break;
458 _firstPull = false;
459 _fedOnTears = false;
460 me->SetImmuneToPC(false);
461 break;
462 case ACTION_ASCEND:
464 events.SetPhase(PHASE_BIG_BANG);
465 events.ScheduleEvent(EVENT_ASCEND_TO_THE_HEAVENS, 1500ms);
466 break;
468 _fedOnTears = false;
469 }
470 }
@ UNIT_FLAG2_DO_NOT_FADE_IN
Definition: Unit.h:493
@ NOT_STARTED
Definition: InstanceScript.h:57
@ ACTION_ASCEND
Definition: boss_algalon_the_observer.cpp:86
@ ACTION_START_INTRO
Definition: boss_algalon_the_observer.cpp:82
@ POINT_ALGALON_LAND
Definition: boss_algalon_the_observer.cpp:97
@ SPELL_RIDE_THE_LIGHTNING
Definition: boss_algalon_the_observer.cpp:36
@ SPELL_ARRIVAL
Definition: boss_algalon_the_observer.cpp:35
@ PHASE_BIG_BANG
Definition: boss_algalon_the_observer.cpp:162
@ EVENT_INTRO_1
Definition: boss_algalon_the_observer.cpp:118
@ EVENT_INTRO_2
Definition: boss_algalon_the_observer.cpp:119
@ EVENT_DESPAWN_ALGALON_3
Definition: boss_algalon_the_observer.cpp:150
@ EVENT_DESPAWN_ALGALON_5
Definition: boss_algalon_the_observer.cpp:152
@ EVENT_DESPAWN_ALGALON_2
Definition: boss_algalon_the_observer.cpp:149
@ EVENT_INTRO_FINISH
Definition: boss_algalon_the_observer.cpp:121
@ EVENT_DESPAWN_ALGALON_4
Definition: boss_algalon_the_observer.cpp:151
@ EVENT_DESPAWN_ALGALON_1
Definition: boss_algalon_the_observer.cpp:148
@ EVENT_INTRO_3
Definition: boss_algalon_the_observer.cpp:120
@ EVENT_ASCEND_TO_THE_HEAVENS
Definition: boss_algalon_the_observer.cpp:129
Position const AlgalonLandPos
Definition: ulduar.h:297
@ ACTION_DESPAWN_ALGALON
Definition: ulduar.h:281
@ ACTION_FEEDS_ON_TEARS_FAILED
Definition: ulduar.h:279
@ ACTION_INIT_ALGALON
Definition: ulduar.h:280
@ TYPE_ALGALON
Definition: ulduar.h:48
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:330
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Definition: Creature.cpp:3109
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2117
float GetPositionZ() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
MotionMaster * GetMotionMaster()
Definition: Unit.h:2276
void SetUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:1501
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:1169
void SetImmuneToPC(bool apply, bool keepCombat=false)
Definition: Unit.cpp:13601
bool IsInCombat() const
Definition: Unit.h:1702
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:211
Definition: MoveSplineInit.h:71

References _fedOnTears, _fightWon, _firstPull, ACTION_ASCEND, ACTION_DESPAWN_ALGALON, ACTION_FEEDS_ON_TEARS_FAILED, ACTION_INIT_ALGALON, ACTION_START_INTRO, AlgalonLandPos, Unit::AttackStop(), Unit::CastSpell(), SummonList::DespawnAll(), Creature::DespawnOrUnsummon(), EVENT_ASCEND_TO_THE_HEAVENS, EVENT_DESPAWN_ALGALON_1, EVENT_DESPAWN_ALGALON_2, EVENT_DESPAWN_ALGALON_3, EVENT_DESPAWN_ALGALON_4, EVENT_DESPAWN_ALGALON_5, EVENT_INTRO_1, EVENT_INTRO_2, EVENT_INTRO_3, EVENT_INTRO_FINISH, FACTION_FRIENDLY, Unit::GetMotionMaster(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::InterruptNonMeleeSpells(), Unit::IsInCombat(), Movement::MoveSplineInit::Launch(), m_pInstance, ScriptedAI::me, MotionMaster::MovePoint(), Movement::MoveSplineInit::MoveTo(), NOT_STARTED, PHASE_BIG_BANG, PHASE_ROLE_PLAY, POINT_ALGALON_LAND, REACT_PASSIVE, ZoneScript::SetData(), Creature::SetDisableGravity(), Unit::SetFaction(), Creature::SetHomePosition(), Unit::SetImmuneToPC(), Movement::MoveSplineInit::SetOrientationFixed(), Creature::SetReactState(), Unit::SetUnitFlag(), Unit::SetUnitFlag2(), SPELL_ARRIVAL, SPELL_RIDE_THE_LIGHTNING, summons, TYPE_ALGALON, UNIT_FLAG2_DO_NOT_FADE_IN, and UNIT_FLAG_NOT_SELECTABLE.

Referenced by EnterEvadeMode(), and IsInRoom().

◆ DoCheckHeraldOfTheTitans()

bool boss_algalon_the_observer::boss_algalon_the_observerAI::DoCheckHeraldOfTheTitans ( )
inline
303 {
305 return true;
306
307 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
308 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
309 if (Player* plr = itr->GetSource())
310 if (!plr->IsGameMaster() && plr->IsInCombat() /*performance*/)
311 {
312 for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i) // loop through equipped items
313 if (Item* item = plr->GetItemByPos(INVENTORY_SLOT_BAG_0, i))
314 if (!IsValidHeraldItem(item->GetTemplate()))
315 {
316 _heraldOfTheTitans = false;
317 return true;
318 }
319 }
320
321 return false;
322 }
@ EQUIPMENT_SLOT_END
Definition: Player.h:695
@ EQUIPMENT_SLOT_START
Definition: Player.h:675
#define INVENTORY_SLOT_BAG_0
Definition: Player.h:671
Definition: LinkedList.h:139
Definition: Item.h:214
Map * GetMap() const
Definition: Object.h:517
Definition: Player.h:1056
PlayerList const & GetPlayers() const
Definition: Map.h:485
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37
bool _heraldOfTheTitans
Definition: boss_algalon_the_observer.cpp:287
bool IsValidHeraldItem(ItemTemplate const *item)
Definition: boss_algalon_the_observer.cpp:289

References _heraldOfTheTitans, MapRefMgr::begin(), MapRefMgr::end(), EQUIPMENT_SLOT_END, EQUIPMENT_SLOT_START, WorldObject::GetMap(), Map::GetPlayers(), INVENTORY_SLOT_BAG_0, IsValidHeraldItem(), and ScriptedAI::me.

Referenced by JustEngagedWith(), and UpdateAI().

◆ EnterEvadeMode()

void boss_algalon_the_observer::boss_algalon_the_observerAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

357 {
358 if (_fightWon)
359 return;
360
361 if (SelectTargetFromPlayerList(120.0f))
362 {
364 return;
365 }
366 else if (events.GetPhaseMask() & PHASE_NORMAL)
367 {
369 return;
370 }
371
372 if (m_pInstance)
374
376 }
@ FAIL
Definition: InstanceScript.h:59
@ PHASE_NORMAL
Definition: boss_algalon_the_observer.cpp:160
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:196
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition: ScriptedCreature.cpp:553
void SetInCombatWithZone()
Definition: Creature.cpp:2732
void DoAction(int32 action) override
Definition: boss_algalon_the_observer.cpp:411

References _fightWon, ACTION_ASCEND, DoAction(), CreatureAI::EnterEvadeMode(), FAIL, m_pInstance, ScriptedAI::me, PHASE_NORMAL, ScriptedAI::SelectTargetFromPlayerList(), ZoneScript::SetData(), Creature::SetInCombatWithZone(), and TYPE_ALGALON.

Referenced by JustEngagedWith().

◆ GetData()

uint32 boss_algalon_the_observer::boss_algalon_the_observerAI::GetData ( uint32  param) const
inlineoverridevirtual

Reimplemented from UnitAI.

332 {
333 if (param == DATA_HAS_FED_ON_TEARS)
334 return _fedOnTears;
335 if (param == DATA_HERALD_OF_THE_TITANS)
336 return _heraldOfTheTitans;
337 return 0;
338 }
@ DATA_HERALD_OF_THE_TITANS
Definition: boss_algalon_the_observer.cpp:103
@ DATA_HAS_FED_ON_TEARS
Definition: boss_algalon_the_observer.cpp:102

References _fedOnTears, _heraldOfTheTitans, DATA_HAS_FED_ON_TEARS, and DATA_HERALD_OF_THE_TITANS.

◆ IsInRoom()

bool boss_algalon_the_observer::boss_algalon_the_observerAI::IsInRoom ( )
inline
630 {
631 if (me->GetExactDist2d(&me->GetHomePosition()) > 45.f || me->GetPositionZ() < 410.f)
632 {
634 return false;
635 }
636
637 return true;
638 }
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:332
float GetExactDist2d(const float x, const float y) const
Definition: Position.h:166

References ACTION_ASCEND, DoAction(), Position::GetExactDist2d(), Creature::GetHomePosition(), Position::GetPositionZ(), and ScriptedAI::me.

Referenced by UpdateAI().

◆ IsValidHeraldItem()

bool boss_algalon_the_observer::boss_algalon_the_observerAI::IsValidHeraldItem ( ItemTemplate const *  item)
inline
290 {
291 if (!item) // should not happen, but checked in GetAverageItemLevel()
292 return true;
293 if (item->ItemLevel <= 226 || (item->ItemLevel <= 232 && (
294 item->InventoryType == INVTYPE_SHIELD ||
295 item->Class == ITEM_CLASS_WEAPON ||
296 (item->Class == ITEM_CLASS_ARMOR && (item->InventoryType == INVTYPE_RELIC || item->InventoryType == INVTYPE_HOLDABLE))
297 )))
298 return true;
299 return false;
300 }
@ INVTYPE_HOLDABLE
Definition: ItemTemplate.h:288
@ INVTYPE_RELIC
Definition: ItemTemplate.h:293
@ INVTYPE_SHIELD
Definition: ItemTemplate.h:279
@ ITEM_CLASS_ARMOR
Definition: ItemTemplate.h:304
@ ITEM_CLASS_WEAPON
Definition: ItemTemplate.h:302

References ItemTemplate::Class, ItemTemplate::InventoryType, INVTYPE_HOLDABLE, INVTYPE_RELIC, INVTYPE_SHIELD, ITEM_CLASS_ARMOR, ITEM_CLASS_WEAPON, and ItemTemplate::ItemLevel.

Referenced by DoCheckHeraldOfTheTitans().

◆ JustEngagedWith()

void boss_algalon_the_observer::boss_algalon_the_observerAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

478 {
479 if (_fightWon)
480 return;
481
482 if (!m_pInstance)
483 {
485 return;
486 }
487
488 uint32 introDelay = 0;
489 me->setActive(true);
492 me->SetImmuneToNPC(true);
493 events.Reset();
494 events.SetPhase(PHASE_ROLE_PLAY);
495
496 if (!_firstPull)
497 {
498 events.ScheduleEvent(EVENT_START_COMBAT, 0ms);
499 introDelay = 8000;
500 }
501 else
502 {
504 _firstPull = false;
506 introDelay = 22000;
507 events.ScheduleEvent(EVENT_START_COMBAT, 14s);
509 }
510
511 events.ScheduleEvent(EVENT_REMOVE_UNNATTACKABLE, introDelay - 500);
512 events.ScheduleEvent(EVENT_INTRO_TIMER_DONE, introDelay);
513 events.ScheduleEvent(EVENT_QUANTUM_STRIKE, 3500 + introDelay);
514 events.ScheduleEvent(EVENT_PHASE_PUNCH, 15500 + introDelay);
515 events.ScheduleEvent(EVENT_SUMMON_COLLAPSING_STAR, 16500 + introDelay);
516 events.ScheduleEvent(EVENT_COSMIC_SMASH, 25000 + introDelay);
517 events.ScheduleEvent(EVENT_ACTIVATE_LIVING_CONSTELLATION, 50500 + introDelay);
518 events.ScheduleEvent(EVENT_BIG_BANG, 90000 + introDelay);
519 events.ScheduleEvent(EVENT_ASCEND_TO_THE_HEAVENS, 360000 + introDelay);
520
521 events.ScheduleEvent(EVENT_CHECK_HERALD_ITEMS, 5s);
523 }
@ SAY_ALGALON_START_TIMER
Definition: boss_algalon_the_observer.cpp:177
@ EVENT_REMOVE_UNNATTACKABLE
Definition: boss_algalon_the_observer.cpp:147
@ EVENT_START_COMBAT
Definition: boss_algalon_the_observer.cpp:122
@ EVENT_COSMIC_SMASH
Definition: boss_algalon_the_observer.cpp:131
@ EVENT_BIG_BANG
Definition: boss_algalon_the_observer.cpp:127
@ EVENT_CHECK_HERALD_ITEMS
Definition: boss_algalon_the_observer.cpp:146
@ EVENT_INTRO_TIMER_DONE
Definition: boss_algalon_the_observer.cpp:123
@ EVENT_QUANTUM_STRIKE
Definition: boss_algalon_the_observer.cpp:124
@ EVENT_PHASE_PUNCH
Definition: boss_algalon_the_observer.cpp:125
@ DATA_DESPAWN_ALGALON
Definition: ulduar.h:94
@ NPC_AZEROTH
Definition: ulduar.h:164
@ EVADE_REASON_OTHER
Definition: CreatureAI.h:94
void setActive(bool isActiveObject)
Definition: Object.cpp:1085
void SetImmuneToNPC(bool apply, bool keepCombat=false)
Definition: Unit.cpp:13610
bool DoCheckHeraldOfTheTitans()
Definition: boss_algalon_the_observer.cpp:302
void EnterEvadeMode(EvadeReason why) override
Definition: boss_algalon_the_observer.cpp:356

References _fightWon, _firstPull, DATA_DESPAWN_ALGALON, SummonList::DespawnEntry(), DoCheckHeraldOfTheTitans(), EnterEvadeMode(), CreatureAI::EVADE_REASON_OTHER, EVENT_ACTIVATE_LIVING_CONSTELLATION, EVENT_ASCEND_TO_THE_HEAVENS, EVENT_BIG_BANG, EVENT_CHECK_HERALD_ITEMS, EVENT_COSMIC_SMASH, EVENT_INTRO_TIMER_DONE, EVENT_PHASE_PUNCH, EVENT_QUANTUM_STRIKE, EVENT_REMOVE_UNNATTACKABLE, EVENT_START_COMBAT, EVENT_SUMMON_COLLAPSING_STAR, m_pInstance, ScriptedAI::me, NPC_AZEROTH, PHASE_ROLE_PLAY, SAY_ALGALON_START_TIMER, WorldObject::setActive(), ZoneScript::SetData(), Unit::SetImmuneToNPC(), Creature::SetInCombatWithZone(), Unit::SetUnitFlag(), summons, and UNIT_FLAG_NOT_SELECTABLE.

◆ JustReachedHome()

void boss_algalon_the_observer::boss_algalon_the_observerAI::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

473 {
474 me->setActive(false);
475 }

References ScriptedAI::me, and WorldObject::setActive().

◆ JustSummoned()

void boss_algalon_the_observer::boss_algalon_the_observerAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from ScriptedAI.

548 {
549 summons.Summon(summon);
550 switch (summon->GetEntry())
551 {
552 case NPC_AZEROTH:
553 me->CastSpell(summon, SPELL_REORIGINATION, true);
554 break;
555 case NPC_BLACK_HOLE:
556 summon->CastSpell((Unit*)nullptr, SPELL_BLACK_HOLE_TRIGGER, true);
557 summon->CastSpell(summon, SPELL_CONSTELLATION_PHASE_TRIGGER, true);
558 summon->CastSpell((Unit*)nullptr, SPELL_BLACK_HOLE_EXPLOSION, false);
559 summon->CastSpell(summon, SPELL_SUMMON_VOID_ZONE_VISUAL, true);
560 break;
562 summon->CastSpell(summon, SPELL_VOID_ZONE_VISUAL, true);
563 break;
565 summon->CastSpell(summon, SPELL_COSMIC_SMASH_VISUAL_STATE, true);
566 break;
568 {
569 float x = summon->GetPositionX();
570 float y = summon->GetPositionY();
571 float z = summon->GetPositionZ() + 35.0f;
572 float o = summon->GetOrientation();
573
574 summon->GetMotionMaster()->Clear();
575 summon->SetHomePosition(x, y, z, o);
576 summon->UpdatePosition(x, y, z, o, true);
577 summon->StopMovingOnCurrentPos();
578 summon->m_Events.AddEvent(new CosmicSmashDamageEvent(summon), summon->m_Events.CalculateTime(4000));
579 break;
580 }
582 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
583 if (summon->Attack(target, true))
584 summon->GetMotionMaster()->MoveChase(target);
585 break;
586 }
587 }
@ SPELL_VOID_ZONE_VISUAL
Definition: boss_algalon_the_observer.cpp:69
@ SPELL_BLACK_HOLE_TRIGGER
Definition: boss_algalon_the_observer.cpp:64
@ SPELL_BLACK_HOLE_EXPLOSION
Definition: boss_algalon_the_observer.cpp:67
@ SPELL_CONSTELLATION_PHASE_TRIGGER
Definition: boss_algalon_the_observer.cpp:65
@ SPELL_REORIGINATION
Definition: boss_algalon_the_observer.cpp:38
@ SPELL_SUMMON_VOID_ZONE_VISUAL
Definition: boss_algalon_the_observer.cpp:68
@ SPELL_COSMIC_SMASH_VISUAL_STATE
Definition: boss_algalon_the_observer.cpp:46
@ NPC_ALGALON_STALKER_ASTEROID_TARGET_01
Definition: ulduar.h:171
@ NPC_UNLEASHED_DARK_MATTER
Definition: ulduar.h:173
@ NPC_ALGALON_STALKER_ASTEROID_TARGET_02
Definition: ulduar.h:172
void AddEvent(BasicEvent *Event, uint64 e_time, bool set_addtime=true)
Definition: EventProcessor.h:104
uint64 CalculateTime(uint64 t_offset) const
Definition: EventProcessor.cpp:159
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:90
float GetOrientation() const
Definition: Position.h:120
Definition: Unit.h:1302
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition: Unit.cpp:20296
EventProcessor m_Events
Definition: Unit.h:2108
bool Attack(Unit *victim, bool meleeAttack)
Definition: Unit.cpp:10280
void StopMovingOnCurrentPos()
Definition: Unit.cpp:16957
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Definition: MotionMaster.cpp:300
void Clear(bool reset=true)
Definition: MotionMaster.h:165
Definition: boss_algalon_the_observer.cpp:248

References EventProcessor::AddEvent(), Unit::Attack(), EventProcessor::CalculateTime(), Unit::CastSpell(), MotionMaster::Clear(), Object::GetEntry(), Unit::GetMotionMaster(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::m_Events, ScriptedAI::me, MotionMaster::MoveChase(), NPC_ALGALON_STALKER_ASTEROID_TARGET_01, NPC_ALGALON_STALKER_ASTEROID_TARGET_02, NPC_ALGALON_VOID_ZONE_VISUAL_STALKER, NPC_AZEROTH, NPC_BLACK_HOLE, NPC_UNLEASHED_DARK_MATTER, UnitAI::SelectTarget(), Creature::SetHomePosition(), SPELL_BLACK_HOLE_EXPLOSION, SPELL_BLACK_HOLE_TRIGGER, SPELL_CONSTELLATION_PHASE_TRIGGER, SPELL_COSMIC_SMASH_VISUAL_STATE, SPELL_REORIGINATION, SPELL_SUMMON_VOID_ZONE_VISUAL, SPELL_VOID_ZONE_VISUAL, Unit::StopMovingOnCurrentPos(), SummonList::Summon(), summons, and Unit::UpdatePosition().

◆ KilledUnit()

void boss_algalon_the_observer::boss_algalon_the_observerAI::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from ScriptedAI.

404 {
405 if (victim->GetTypeId() != TYPEID_PLAYER || urand(0, 2))
406 return;
407
409 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ TYPEID_PLAYER
Definition: ObjectGuid.h:38
@ SAY_ALGALON_KILL
Definition: boss_algalon_the_observer.cpp:194
TypeID GetTypeId() const
Definition: Object.h:121

References Object::GetTypeId(), SAY_ALGALON_KILL, TYPEID_PLAYER, and urand().

◆ MovementInform()

void boss_algalon_the_observer::boss_algalon_the_observerAI::MovementInform ( uint32  movementType,
uint32  pointId 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

526 {
527 if (movementType != POINT_MOTION_TYPE)
528 return;
529
530 if (pointId == POINT_ALGALON_LAND)
531 me->SetDisableGravity(false);
532 else if (pointId == POINT_ALGALON_OUTRO)
533 {
534 me->SetFacingTo(1.605703f);
535 events.ScheduleEvent(EVENT_OUTRO_3, 1200ms);
536 events.ScheduleEvent(EVENT_OUTRO_4, 2400ms);
537 events.ScheduleEvent(EVENT_OUTRO_5, 8500ms);
538 events.ScheduleEvent(EVENT_OUTRO_6, 15s + 500ms);
539 events.ScheduleEvent(EVENT_OUTRO_7, 55s + 500ms);
540 events.ScheduleEvent(EVENT_OUTRO_8, 73s + 500ms);
541 events.ScheduleEvent(EVENT_OUTRO_9, 85s + 500ms);
542 events.ScheduleEvent(EVENT_OUTRO_10, 101s + 500ms);
543 events.ScheduleEvent(EVENT_OUTRO_11, 117s + 500ms);
544 }
545 }
@ POINT_MOTION_TYPE
Definition: MotionMaster.h:46
@ POINT_ALGALON_OUTRO
Definition: boss_algalon_the_observer.cpp:98
@ EVENT_OUTRO_9
Definition: boss_algalon_the_observer.cpp:142
@ EVENT_OUTRO_3
Definition: boss_algalon_the_observer.cpp:136
@ EVENT_OUTRO_11
Definition: boss_algalon_the_observer.cpp:144
@ EVENT_OUTRO_7
Definition: boss_algalon_the_observer.cpp:140
@ EVENT_OUTRO_5
Definition: boss_algalon_the_observer.cpp:138
@ EVENT_OUTRO_8
Definition: boss_algalon_the_observer.cpp:141
@ EVENT_OUTRO_6
Definition: boss_algalon_the_observer.cpp:139
@ EVENT_OUTRO_10
Definition: boss_algalon_the_observer.cpp:143
@ EVENT_OUTRO_4
Definition: boss_algalon_the_observer.cpp:137
void SetFacingTo(float ori)
Definition: Unit.cpp:20884

References EVENT_OUTRO_10, EVENT_OUTRO_11, EVENT_OUTRO_3, EVENT_OUTRO_4, EVENT_OUTRO_5, EVENT_OUTRO_6, EVENT_OUTRO_7, EVENT_OUTRO_8, EVENT_OUTRO_9, ScriptedAI::me, POINT_ALGALON_LAND, POINT_ALGALON_OUTRO, POINT_MOTION_TYPE, Creature::SetDisableGravity(), and Unit::SetFacingTo().

◆ Reset()

void boss_algalon_the_observer::boss_algalon_the_observerAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

379 {
380 if (_fightWon)
381 return;
382
383 events.Reset();
386 me->SetImmuneToPC(false);
388 me->SetFaction(190);
390
391 _phaseTwo = false;
392 _heraldOfTheTitans = true;
393
395 {
396 _firstPull = false;
397 }
398
399 if (m_pInstance)
401 }
@ SHEATH_STATE_UNARMED
Definition: Unit.h:126
@ SPELL_DUAL_WIELD
Definition: boss_algalon_the_observer.cpp:50
virtual void SetSheath(SheathState sheathed)
Definition: Unit.h:1506
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:52

References _fightWon, _firstPull, _heraldOfTheTitans, _phaseTwo, Unit::CastSpell(), SummonList::DespawnAll(), FAIL, ZoneScript::GetData(), m_pInstance, ScriptedAI::me, NOT_STARTED, REACT_PASSIVE, ZoneScript::SetData(), Unit::SetFaction(), Unit::SetImmuneToPC(), Creature::SetReactState(), Unit::SetSheath(), SHEATH_STATE_UNARMED, SPELL_DUAL_WIELD, summons, and TYPE_ALGALON.

◆ UpdateAI()

void boss_algalon_the_observer::boss_algalon_the_observerAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

641 {
642 if (!(events.GetPhaseMask() & PHASE_MASK_NO_UPDATE) && (!UpdateVictim() || !IsInRoom()))
643 return;
644
645 events.Update(diff);
647 return;
648
649 switch (events.ExecuteEvent())
650 {
651 case EVENT_INTRO_1:
654 break;
655 case EVENT_INTRO_2:
656 me->CastSpell((Unit*)nullptr, SPELL_SUMMON_AZEROTH, true);
658 break;
659 case EVENT_INTRO_3:
661 break;
663 events.Reset();
664 me->SetImmuneToPC(false);
666 brann->AI()->DoAction(ACTION_FINISH_INTRO);
667 break;
671 break;
675 me->SetImmuneToNPC(false);
676 break;
678 events.SetPhase(PHASE_NORMAL);
679 me->CastSpell((Unit*)nullptr, SPELL_SUPERMASSIVE_FAIL, true);
680 // Hack: _IsValidTarget failed earlier due to flags, call AttackStart again
683 if (Player* target = SelectTargetFromPlayerList(150.0f))
684 AttackStart(target);
686
687 for (uint32 i = 0; i < LIVING_CONSTELLATION_COUNT; ++i)
689 break;
692 events.Repeat(3000ms, 4500ms);
693 break;
696 events.Repeat(15s + 500ms);
697 break;
701 for (uint8 i = 0; i < COLLAPSING_STAR_COUNT; ++i)
703 events.Repeat(1min);
704 break;
708 events.Repeat(25s + 500ms);
709 break;
711 {
712 if (events.GetPhaseMask() & PHASE_MASK_NO_UPDATE)
713 {
714 events.Repeat(4s);
715 break;
716 }
718 //me->CastSpell(me, SPELL_TRIGGER_3_ADDS, true);
719 events.Repeat(50s);
720 break;
721 }
722 case EVENT_BIG_BANG:
723 {
726
729
730 me->CastSpell((Unit*)nullptr, SPELL_BIG_BANG, false);
731 events.Repeat(90s + 500ms);
732 break;
733 }
736 me->CastSpell((Unit*)nullptr, SPELL_ASCEND_TO_THE_HEAVENS, false);
737 events.ScheduleEvent(EVENT_EVADE, 2500ms);
738 break;
739 case EVENT_EVADE:
740 events.Reset();
742 return;
744 if (m_pInstance)
745 {
748 }
749 break;
750 case EVENT_OUTRO_1:
753 break;
754 case EVENT_OUTRO_2:
755 {
756 Player* lootRecipent = me->GetLootRecipient();
758 // LootRecipent is cleared in _EnterEvadeMode, restore it
759 me->SetLootRecipient(lootRecipent);
761 break;
762 }
763 case EVENT_OUTRO_3:
764 me->CastSpell((Unit*)nullptr, SPELL_KILL_CREDIT);
765 // Summon Chest
766 if (GameObject* go = me->SummonGameObject(RAID_MODE(GO_ALGALON_CHEST, GO_ALGALON_CHEST_HERO), 1632.1f, -306.561f, 417.321f, 4.69494f, 0, 0, 0, 1, 0))
767 {
768 go->ReplaceAllGameObjectFlags((GameObjectFlags)0);
769 go->SetLootRecipient(me);
770 }
771 break;
772 case EVENT_OUTRO_4:
775 break;
776 case EVENT_OUTRO_5:
778 brann->AI()->DoAction(ACTION_OUTRO);
779 break;
780 case EVENT_OUTRO_6:
783 break;
784 case EVENT_OUTRO_7:
786 break;
787 case EVENT_OUTRO_8:
789 break;
790 case EVENT_OUTRO_9:
792 break;
793 case EVENT_OUTRO_10:
795 break;
796 case EVENT_OUTRO_11:
798 me->CastSpell(me, SPELL_TELEPORT, false);
799 me->DespawnOrUnsummon(3000);
800 break;
803 break;
806 break;
809 break;
811 me->CastSpell((Unit*)nullptr, SPELL_ASCEND_TO_THE_HEAVENS, false);
812 break;
815 me->CastSpell(me, SPELL_TELEPORT, false);
816 me->DespawnOrUnsummon(3000);
817 break;
820 events.Repeat(5s);
821 break;
822 }
823
825 }
@ TEMPSUMMON_DEAD_DESPAWN
Definition: Object.h:48
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:44
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition: Object.h:47
@ REACT_AGGRESSIVE
Definition: Unit.h:1037
@ UNIT_STAND_STATE_KNEEL
Definition: Unit.h:61
@ UNIT_STAND_STATE_STAND
Definition: Unit.h:53
@ SHEATH_STATE_MELEE
Definition: Unit.h:127
@ UNIT_STATE_CASTING
Definition: Unit.h:340
@ UNIT_FLAG_RENAME
Definition: Unit.h:452
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ DONE
Definition: InstanceScript.h:60
@ SPELLVALUE_MAX_TARGETS
Definition: SpellDefines.h:118
@ ACTION_FINISH_INTRO
Definition: boss_algalon_the_observer.cpp:83
@ ACTION_OUTRO
Definition: boss_algalon_the_observer.cpp:87
@ ACTION_BIG_BANG
Definition: boss_algalon_the_observer.cpp:85
Position const AlgalonOutroPos
Definition: boss_algalon_the_observer.cpp:239
@ SPELL_PHASE_PUNCH
Definition: boss_algalon_the_observer.cpp:41
@ SPELL_SUPERMASSIVE_FAIL
Definition: boss_algalon_the_observer.cpp:39
@ SPELL_SUMMON_AZEROTH
Definition: boss_algalon_the_observer.cpp:37
@ SPELL_QUANTUM_STRIKE
Definition: boss_algalon_the_observer.cpp:40
@ SPELL_KILL_CREDIT
Definition: boss_algalon_the_observer.cpp:48
@ SPELL_TELEPORT
Definition: boss_algalon_the_observer.cpp:49
@ SPELL_COSMIC_SMASH
Definition: boss_algalon_the_observer.cpp:44
@ SPELL_ASCEND_TO_THE_HEAVENS
Definition: boss_algalon_the_observer.cpp:43
@ SPELL_BIG_BANG
Definition: boss_algalon_the_observer.cpp:42
@ PHASE_MASK_NO_CAST_CHECK
Definition: boss_algalon_the_observer.cpp:165
@ PHASE_MASK_NO_UPDATE
Definition: boss_algalon_the_observer.cpp:164
#define LIVING_CONSTELLATION_COUNT
Definition: boss_algalon_the_observer.cpp:215
Position const ConstellationPos[LIVING_CONSTELLATION_COUNT]
Definition: boss_algalon_the_observer.cpp:216
@ SAY_ALGALON_OUTRO_2
Definition: boss_algalon_the_observer.cpp:187
@ SAY_ALGALON_INTRO_2
Definition: boss_algalon_the_observer.cpp:175
@ EMOTE_ALGALON_COSMIC_SMASH
Definition: boss_algalon_the_observer.cpp:184
@ SAY_ALGALON_AGGRO
Definition: boss_algalon_the_observer.cpp:178
@ SAY_ALGALON_OUTRO_3
Definition: boss_algalon_the_observer.cpp:188
@ SAY_ALGALON_DESPAWN_1
Definition: boss_algalon_the_observer.cpp:191
@ SAY_ALGALON_INTRO_3
Definition: boss_algalon_the_observer.cpp:176
@ SAY_ALGALON_COLLAPSING_STAR
Definition: boss_algalon_the_observer.cpp:179
@ SAY_ALGALON_INTRO_1
Definition: boss_algalon_the_observer.cpp:174
@ EMOTE_ALGALON_COLLAPSING_STAR
Definition: boss_algalon_the_observer.cpp:180
@ SAY_ALGALON_OUTRO_5
Definition: boss_algalon_the_observer.cpp:190
@ SAY_ALGALON_BIG_BANG
Definition: boss_algalon_the_observer.cpp:181
@ SAY_ALGALON_ASCEND
Definition: boss_algalon_the_observer.cpp:183
@ SAY_ALGALON_DESPAWN_3
Definition: boss_algalon_the_observer.cpp:193
@ SAY_ALGALON_DESPAWN_2
Definition: boss_algalon_the_observer.cpp:192
@ SAY_ALGALON_OUTRO_4
Definition: boss_algalon_the_observer.cpp:189
@ SAY_ALGALON_OUTRO_1
Definition: boss_algalon_the_observer.cpp:186
@ EMOTE_ALGALON_BIG_BANG
Definition: boss_algalon_the_observer.cpp:182
Position const BrannOutroPos[3]
Definition: boss_algalon_the_observer.cpp:240
@ EVENT_EVADE
Definition: boss_algalon_the_observer.cpp:130
@ DATA_ALGALON_DEFEATED
Definition: ulduar.h:95
@ GO_ALGALON_CHEST
Definition: ulduar.h:193
@ GO_ALGALON_CHEST_HERO
Definition: ulduar.h:194
@ NPC_BRANN_BRONZBEARD_ALG
Definition: ulduar.h:163
GameObjectFlags
Definition: SharedDefines.h:1602
@ FACTION_MONSTER
Definition: SharedDefines.h:195
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
bool _EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:291
bool UpdateVictim()
Definition: CreatureAI.cpp:268
void DoAction(int32 info, uint16 max=0)
Definition: ScriptedCreature.h:104
Definition: ScriptedCreature.h:169
const T & RAID_MODE(const T &normal10, const T &normal25) const
Definition: ScriptedCreature.h:416
void SetLootRecipient(Unit *unit, bool withGroup=true)
Definition: Creature.cpp:1258
Player * GetLootRecipient() const
Definition: Creature.cpp:1244
Definition: GameObject.h:122
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:2357
SpellCastResult CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1226
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4855
Unit * GetVictim() const
Definition: Unit.h:1398
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1410
void RemoveAllAuras()
Definition: Unit.cpp:5259
void SetStandState(uint8 state)
Definition: Unit.cpp:16994
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:1496
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:94
void AttackStart(Unit *who) override
Definition: boss_algalon_the_observer.cpp:324
void CallConstellations()
Definition: boss_algalon_the_observer.cpp:340
bool IsInRoom()
Definition: boss_algalon_the_observer.cpp:629

References CreatureAI::_EnterEvadeMode(), ACTION_BIG_BANG, ACTION_FINISH_INTRO, ACTION_OUTRO, AlgalonOutroPos, AttackStart(), BrannOutroPos, CallConstellations(), Unit::CastCustomSpell(), Unit::CastSpell(), COLLAPSING_STAR_COUNT, CollapsingStarPos, ConstellationPos, DATA_ALGALON_DEFEATED, Creature::DespawnOrUnsummon(), SummonList::DoAction(), DoCheckHeraldOfTheTitans(), UnitAI::DoMeleeAttackIfReady(), DONE, EMOTE_ALGALON_BIG_BANG, EMOTE_ALGALON_COLLAPSING_STAR, EMOTE_ALGALON_COSMIC_SMASH, CreatureAI::EnterEvadeMode(), EVENT_ACTIVATE_LIVING_CONSTELLATION, EVENT_ASCEND_TO_THE_HEAVENS, EVENT_BIG_BANG, EVENT_CHECK_HERALD_ITEMS, EVENT_COSMIC_SMASH, EVENT_DESPAWN_ALGALON_1, EVENT_DESPAWN_ALGALON_2, EVENT_DESPAWN_ALGALON_3, EVENT_DESPAWN_ALGALON_4, EVENT_DESPAWN_ALGALON_5, EVENT_EVADE, EVENT_INTRO_1, EVENT_INTRO_2, EVENT_INTRO_3, EVENT_INTRO_FINISH, EVENT_INTRO_TIMER_DONE, EVENT_OUTRO_1, EVENT_OUTRO_10, EVENT_OUTRO_11, EVENT_OUTRO_2, EVENT_OUTRO_3, EVENT_OUTRO_4, EVENT_OUTRO_5, EVENT_OUTRO_6, EVENT_OUTRO_7, EVENT_OUTRO_8, EVENT_OUTRO_9, EVENT_OUTRO_START, EVENT_PHASE_PUNCH, EVENT_QUANTUM_STRIKE, EVENT_REMOVE_UNNATTACKABLE, EVENT_START_COMBAT, EVENT_SUMMON_COLLAPSING_STAR, FACTION_MONSTER, ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), Creature::GetLootRecipient(), Unit::GetMotionMaster(), Unit::GetVictim(), GO_ALGALON_CHEST, GO_ALGALON_CHEST_HERO, Unit::HasUnitState(), IN_PROGRESS, IsInRoom(), LIVING_CONSTELLATION_COUNT, m_pInstance, ScriptedAI::me, MotionMaster::MovePoint(), NPC_BRANN_BRONZBEARD_ALG, NPC_COLLAPSING_STAR, NPC_LIVING_CONSTELLATION, PHASE_MASK_NO_CAST_CHECK, PHASE_MASK_NO_UPDATE, PHASE_NORMAL, POINT_ALGALON_OUTRO, ScriptedAI::RAID_MODE(), REACT_AGGRESSIVE, Unit::RemoveAllAuras(), Unit::RemoveAurasDueToSpell(), Unit::RemoveUnitFlag(), SAY_ALGALON_AGGRO, SAY_ALGALON_ASCEND, SAY_ALGALON_BIG_BANG, SAY_ALGALON_COLLAPSING_STAR, SAY_ALGALON_DESPAWN_1, SAY_ALGALON_DESPAWN_2, SAY_ALGALON_DESPAWN_3, SAY_ALGALON_INTRO_1, SAY_ALGALON_INTRO_2, SAY_ALGALON_INTRO_3, SAY_ALGALON_OUTRO_1, SAY_ALGALON_OUTRO_2, SAY_ALGALON_OUTRO_3, SAY_ALGALON_OUTRO_4, SAY_ALGALON_OUTRO_5, ScriptedAI::SelectTargetFromPlayerList(), ZoneScript::SetData(), Unit::SetFaction(), Unit::SetImmuneToNPC(), Unit::SetImmuneToPC(), Creature::SetInCombatWithZone(), Creature::SetLootRecipient(), Creature::SetReactState(), Unit::SetSheath(), Unit::SetStandState(), Unit::SetUnitFlag(), SHEATH_STATE_MELEE, SPELL_ASCEND_TO_THE_HEAVENS, SPELL_BIG_BANG, SPELL_COSMIC_SMASH, SPELL_KILL_CREDIT, SPELL_PHASE_PUNCH, SPELL_QUANTUM_STRIKE, SPELL_RIDE_THE_LIGHTNING, SPELL_SUMMON_AZEROTH, SPELL_SUPERMASSIVE_FAIL, SPELL_TELEPORT, SPELLVALUE_MAX_TARGETS, WorldObject::SummonCreature(), WorldObject::SummonGameObject(), summons, TEMPSUMMON_CORPSE_TIMED_DESPAWN, TEMPSUMMON_DEAD_DESPAWN, TEMPSUMMON_TIMED_DESPAWN, TYPE_ALGALON, UNIT_FLAG_NOT_SELECTABLE, UNIT_FLAG_RENAME, UNIT_STAND_STATE_KNEEL, UNIT_STAND_STATE_STAND, UNIT_STATE_CASTING, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ _fedOnTears

bool boss_algalon_the_observer::boss_algalon_the_observerAI::_fedOnTears

◆ _fightWon

bool boss_algalon_the_observer::boss_algalon_the_observerAI::_fightWon

◆ _firstPull

bool boss_algalon_the_observer::boss_algalon_the_observerAI::_firstPull

◆ _heraldOfTheTitans

bool boss_algalon_the_observer::boss_algalon_the_observerAI::_heraldOfTheTitans

◆ _phaseTwo

bool boss_algalon_the_observer::boss_algalon_the_observerAI::_phaseTwo

Referenced by DamageTaken(), and Reset().

◆ events

EventMap boss_algalon_the_observer::boss_algalon_the_observerAI::events

◆ m_pInstance

InstanceScript* boss_algalon_the_observer::boss_algalon_the_observerAI::m_pInstance

◆ summons

SummonList boss_algalon_the_observer::boss_algalon_the_observerAI::summons