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

Public Member Functions

 boss_algalon_the_observer (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 - this happens after JustEnteredCombat.
 
void MovementInform (uint32 movementType, uint32 pointId) override
 
void JustSummoned (Creature *summon) override
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
bool IsInRoom ()
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (Position const *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
T const & DUNGEON_MODE (T const &normal5, T const &heroic10) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25, T const &heroic10, T const &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual bool IsEscortNPC (bool=true) const
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void OnSpellCast (SpellInfo const *)
 
virtual void OnSpellFailed (SpellInfo const *)
 
virtual void OnChannelFinished (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast.
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true, int32 aura=0)
 Cast the spell on a random unit from the threat list.
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished.
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Public Attributes

EventMap events
 
SummonList summons
 
InstanceScript_instance
 
bool _firstPull
 
bool _fightWon
 
bool _phaseTwo
 
bool _fedOnTears
 
bool _heraldOfTheTitans
 
- 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 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
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_algalon_the_observer()

boss_algalon_the_observer::boss_algalon_the_observer ( Creature creature)
inline
273 : ScriptedAI(creature), summons(me)
274 {
276 _fedOnTears = true;
277 _fightWon = false;
278 if (_instance)
280 else
281 _firstPull = true;
282 }
uint32 GetPersistentData(uint32 index) const
Definition InstanceScript.h:257
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1242
Definition ScriptedCreature.h:191
Creature * me
Definition ScriptedCreature.h:281
bool _fightWon
Definition boss_algalon_the_observer.cpp:289
SummonList summons
Definition boss_algalon_the_observer.cpp:285
bool _fedOnTears
Definition boss_algalon_the_observer.cpp:291
InstanceScript * _instance
Definition boss_algalon_the_observer.cpp:286
bool _firstPull
Definition boss_algalon_the_observer.cpp:288
@ PERSISTENT_DATA_ALGALON_FIRST_PULL
Definition ulduar.h:341

References _fedOnTears, _fightWon, _firstPull, _instance, WorldObject::GetInstanceScript(), InstanceScript::GetPersistentData(), ScriptedAI::me, and PERSISTENT_DATA_ALGALON_FIRST_PULL.

Member Function Documentation

◆ AttackStart()

void boss_algalon_the_observer::AttackStart ( Unit who)
inlineoverridevirtual

Reimplemented from UnitAI.

330 {
331 if (_fightWon)
332 return;
334 }
void AttackStart(Unit *) override
Definition ScriptedCreature.cpp:228

References _fightWon, and ScriptedAI::AttackStart().

Referenced by UpdateAI().

◆ CallConstellations()

void boss_algalon_the_observer::CallConstellations ( )
inline
346 {
347 uint8 _count = 0;
349 {
350 Creature* summon = ObjectAccessor::GetCreature(*me, *i++);
351 if (summon && summon->GetEntry() == NPC_LIVING_CONSTELLATION && !summon->AI()->GetData(0))
352 {
353 ++_count;
354 summon->AI()->DoAction(ACTION_ACTIVATE_STAR);
355 if (_count >= 3)
356 break;
357 }
358 }
359 }
std::uint8_t uint8
Definition Define.h:109
@ ACTION_ACTIVATE_STAR
Definition boss_algalon_the_observer.cpp:84
Definition Creature.h:47
CreatureAI * AI() const
Definition Creature.h:144
uint32 GetEntry() const
Definition Object.h:117
iterator begin()
Definition ScriptedCreature.h:48
StorageType::const_iterator const_iterator
Definition ScriptedCreature.h:37
iterator end()
Definition ScriptedCreature.h:58
virtual void DoAction(int32)
Definition UnitAI.h:217
virtual uint32 GetData(uint32) const
Definition UnitAI.h:218
Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:234
@ NPC_LIVING_CONSTELLATION
Definition ulduar.h:229

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::DamageTaken ( Unit ,
uint32 ,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Called at any Damage from any attacker (before damage apply)

Note
It use for recalculation damage or special reaction at damage for attack reaction use AttackedBy called for non DOT damage in Unit::DealDamage also

Reimplemented from UnitAI.

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:107
@ TEMPSUMMON_MANUAL_DESPAWN
Definition Object.h:56
@ FACTION_FRIENDLY
Definition SharedDefines.h:189
@ UNIT_FLAG_NOT_SELECTABLE
Definition UnitDefines.h:282
@ REACT_PASSIVE
Definition Unit.h:567
Position const CollapsingStarPos[COLLAPSING_STAR_COUNT]
Definition boss_algalon_the_observer.cpp:238
@ PHASE_ROLE_PLAY
Definition boss_algalon_the_observer.cpp:167
#define COLLAPSING_STAR_COUNT
Definition boss_algalon_the_observer.cpp:237
@ SAY_ALGALON_PHASE_TWO
Definition boss_algalon_the_observer.cpp:191
@ EVENT_OUTRO_2
Definition boss_algalon_the_observer.cpp:137
@ EVENT_OUTRO_START
Definition boss_algalon_the_observer.cpp:135
@ EVENT_OUTRO_1
Definition boss_algalon_the_observer.cpp:136
@ EVENT_ACTIVATE_LIVING_CONSTELLATION
Definition boss_algalon_the_observer.cpp:147
@ EVENT_SUMMON_COLLAPSING_STAR
Definition boss_algalon_the_observer.cpp:128
events
Definition boss_sartura.cpp:43
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:100
void DespawnEntry(uint32 entry)
Definition ScriptedCreature.cpp:55
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:72
void SetFaction(uint32 faction)
Definition Unit.cpp:7117
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4312
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:1118
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:749
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition Unit.cpp:7499
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2448
Talk
Definition hyjal.cpp:82
bool _phaseTwo
Definition boss_algalon_the_observer.cpp:290
@ NPC_BLACK_HOLE
Definition ulduar.h:232
@ NPC_COLLAPSING_STAR
Definition ulduar.h:231
@ NPC_WORM_HOLE
Definition ulduar.h:233
@ NPC_ALGALON_VOID_ZONE_VISUAL_STALKER
Definition ulduar.h:234

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::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

426 {
427 switch (action)
428 {
430 {
431 me->SetImmuneToPC(true);
433 me->SetDisableGravity(true);
434 me->CastSpell(me, SPELL_ARRIVAL, true);
438 events.Reset();
439 events.SetPhase(PHASE_ROLE_PLAY);
440 events.ScheduleEvent(EVENT_INTRO_1, 5s, 0, PHASE_ROLE_PLAY);
441 events.ScheduleEvent(EVENT_INTRO_CHANNEL, 6s, 0, PHASE_ROLE_PLAY);
442 events.ScheduleEvent(EVENT_INTRO_SUMMON, 7s, 0, PHASE_ROLE_PLAY);
443 events.ScheduleEvent(EVENT_INTRO_DESCEND, 10s, 0, PHASE_ROLE_PLAY);
444 events.ScheduleEvent(EVENT_INTRO_2, 15s, 0, PHASE_ROLE_PLAY);
445 events.ScheduleEvent(EVENT_INTRO_3, 23s, 0, PHASE_ROLE_PLAY);
446 events.ScheduleEvent(EVENT_INTRO_FINISH, 36s, 0, PHASE_ROLE_PLAY);
447 break;
448 }
450 _fightWon = true;
451 events.Reset();
453 events.SetPhase(PHASE_ROLE_PLAY);
454 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_1, 5s);
455 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_2, 17s);
456 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_3, 26s);
457 if (me->IsInCombat())
458 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_4, 26s);
459 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_5, 32s);
460 me->DespawnOrUnsummon(39s);
461
463 me->AttackStop();
467 if (_instance)
469 break;
471 _firstPull = false;
472 _fedOnTears = false;
473 me->SetImmuneToPC(false);
474 if (_instance)
476 break;
477 case ACTION_ASCEND:
479 events.SetPhase(PHASE_BIG_BANG);
480 events.ScheduleEvent(EVENT_ASCEND_TO_THE_HEAVENS, 1500ms);
481 break;
483 _fedOnTears = false;
484 }
485 }
@ NOT_STARTED
Definition InstanceScript.h:58
@ UNIT_FLAG2_DO_NOT_FADE_IN
Definition UnitDefines.h:301
@ ACTION_ASCEND
Definition boss_algalon_the_observer.cpp:86
@ POINT_ALGALON_FLOAT
Definition boss_algalon_the_observer.cpp:99
@ SPELL_RIDE_THE_LIGHTNING
Definition boss_algalon_the_observer.cpp:37
@ SPELL_ARRIVAL
Definition boss_algalon_the_observer.cpp:36
@ PHASE_BIG_BANG
Definition boss_algalon_the_observer.cpp:168
Position const AlgalonFloatPos
Definition boss_algalon_the_observer.cpp:246
@ EVENT_INTRO_1
Definition boss_algalon_the_observer.cpp:120
@ EVENT_INTRO_2
Definition boss_algalon_the_observer.cpp:121
@ EVENT_DESPAWN_ALGALON_3
Definition boss_algalon_the_observer.cpp:152
@ EVENT_DESPAWN_ALGALON_5
Definition boss_algalon_the_observer.cpp:154
@ EVENT_INTRO_DESCEND
Definition boss_algalon_the_observer.cpp:158
@ EVENT_DESPAWN_ALGALON_2
Definition boss_algalon_the_observer.cpp:151
@ EVENT_INTRO_FINISH
Definition boss_algalon_the_observer.cpp:123
@ EVENT_DESPAWN_ALGALON_4
Definition boss_algalon_the_observer.cpp:153
@ EVENT_INTRO_SUMMON
Definition boss_algalon_the_observer.cpp:157
@ EVENT_DESPAWN_ALGALON_1
Definition boss_algalon_the_observer.cpp:150
@ EVENT_INTRO_CHANNEL
Definition boss_algalon_the_observer.cpp:156
@ EVENT_INTRO_3
Definition boss_algalon_the_observer.cpp:122
@ EVENT_ASCEND_TO_THE_HEAVENS
Definition boss_algalon_the_observer.cpp:131
@ ACTION_START_INTRO
Definition boss_nightbane.cpp:57
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:347
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2199
virtual bool SetBossState(uint32 id, EncounterState state)
Definition InstanceScript.cpp:400
void StorePersistentData(uint32 index, uint32 data)
Definition InstanceScript.cpp:440
void MovePoint(uint32 id, Position const &pos, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE, float speed=0.f, bool generatePath=true, bool forceDestination=true, std::optional< AnimTier > animTier=std::nullopt)
Definition MotionMaster.h:240
MotionMaster * GetMotionMaster()
Definition Unit.h:1758
void SetUnitFlag2(UnitFlags2 flags)
Definition Unit.h:755
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:1361
void SetDisableGravity(bool disable)
Definition Unit.cpp:16506
void SetImmuneToPC(bool apply, bool keepCombat=false)
Definition Unit.cpp:10631
bool IsInCombat() const
Definition Unit.h:936
Position const AlgalonLandPos
Definition ulduar.h:399
@ ACTION_DESPAWN_ALGALON
Definition ulduar.h:370
@ ACTION_FEEDS_ON_TEARS_FAILED
Definition ulduar.h:368
@ ACTION_INIT_ALGALON
Definition ulduar.h:369
@ BOSS_ALGALON
Definition ulduar.h:44

References _fedOnTears, _fightWon, _firstPull, _instance, ACTION_ASCEND, ACTION_DESPAWN_ALGALON, ACTION_FEEDS_ON_TEARS_FAILED, ACTION_INIT_ALGALON, ACTION_START_INTRO, AlgalonFloatPos, AlgalonLandPos, Unit::AttackStop(), BOSS_ALGALON, 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_CHANNEL, EVENT_INTRO_DESCEND, EVENT_INTRO_FINISH, EVENT_INTRO_SUMMON, FACTION_FRIENDLY, Unit::GetMotionMaster(), Unit::InterruptNonMeleeSpells(), Unit::IsInCombat(), ScriptedAI::me, MotionMaster::MovePoint(), NOT_STARTED, PERSISTENT_DATA_ALGALON_FIRST_PULL, PHASE_BIG_BANG, PHASE_ROLE_PLAY, POINT_ALGALON_FLOAT, REACT_PASSIVE, InstanceScript::SetBossState(), Unit::SetDisableGravity(), Unit::SetFaction(), Creature::SetHomePosition(), Unit::SetImmuneToPC(), Creature::SetReactState(), Unit::SetUnitFlag(), Unit::SetUnitFlag2(), SPELL_ARRIVAL, SPELL_RIDE_THE_LIGHTNING, InstanceScript::StorePersistentData(), summons, UNIT_FLAG2_DO_NOT_FADE_IN, and UNIT_FLAG_NOT_SELECTABLE.

Referenced by EnterEvadeMode(), and IsInRoom().

◆ DoCheckHeraldOfTheTitans()

bool boss_algalon_the_observer::DoCheckHeraldOfTheTitans ( )
inline
308 {
310 return true;
311
312 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
313 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
314 if (Player* plr = itr->GetSource())
315 if (!plr->IsGameMaster() && plr->IsInCombat() /*performance*/)
316 {
317 for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i) // loop through equipped items
318 if (Item* item = plr->GetItemByPos(INVENTORY_SLOT_BAG_0, i))
319 if (!IsValidHeraldItem(item->GetTemplate()))
320 {
321 _heraldOfTheTitans = false;
322 return true;
323 }
324 }
325
326 return false;
327 }
@ EQUIPMENT_SLOT_END
Definition Player.h:681
@ EQUIPMENT_SLOT_START
Definition Player.h:661
#define INVENTORY_SLOT_BAG_0
Definition Player.h:657
Definition Item.h:220
Definition LinkedList.h:139
Definition MapRefMgr.h:26
iterator begin()
Definition MapRefMgr.h:36
iterator end()
Definition MapRefMgr.h:37
PlayerList const & GetPlayers() const
Definition Map.h:335
Definition Player.h:1086
Map * GetMap() const
Definition Object.h:631
bool _heraldOfTheTitans
Definition boss_algalon_the_observer.cpp:292
bool IsValidHeraldItem(ItemTemplate const *item)
Definition boss_algalon_the_observer.cpp:294

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::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

362 {
363 if (_fightWon)
364 return;
365
366 if (SelectTargetFromPlayerList(120.0f))
367 {
369 return;
370 }
371 else if (events.GetPhaseMask() & PHASE_NORMAL)
372 {
374 return;
375 }
376
377 if (_instance)
379
380 if (!_EnterEvadeMode(why))
381 return;
382
384
385 Reset();
386
387 sScriptMgr->OnUnitEnterEvadeMode(me, why);
388 }
@ FAIL
Definition InstanceScript.h:60
#define sScriptMgr
Definition ScriptMgr.h:743
@ PHASE_NORMAL
Definition boss_algalon_the_observer.cpp:166
bool _EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:383
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2863
void MoveTargetedHome(bool walk=false)
The unit will return this initial position (owner for pets and summoned creatures)....
Definition MotionMaster.cpp:262
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition ScriptedCreature.cpp:591
void DoAction(int32 action) override
Definition boss_algalon_the_observer.cpp:425
void Reset() override
Definition boss_algalon_the_observer.cpp:390

References CreatureAI::_EnterEvadeMode(), _fightWon, _instance, ACTION_ASCEND, BOSS_ALGALON, DoAction(), FAIL, Unit::GetMotionMaster(), ScriptedAI::me, MotionMaster::MoveTargetedHome(), PHASE_NORMAL, Reset(), ScriptedAI::SelectTargetFromPlayerList(), InstanceScript::SetBossState(), Creature::SetInCombatWithZone(), and sScriptMgr.

Referenced by JustEngagedWith().

◆ GetData()

uint32 boss_algalon_the_observer::GetData ( uint32  param) const
inlineoverridevirtual

Reimplemented from UnitAI.

337 {
338 if (param == DATA_HAS_FED_ON_TEARS)
339 return _fedOnTears;
340 if (param == DATA_HERALD_OF_THE_TITANS)
341 return _heraldOfTheTitans;
342 return 0;
343 }
@ DATA_HERALD_OF_THE_TITANS
Definition boss_algalon_the_observer.cpp:104
@ DATA_HAS_FED_ON_TEARS
Definition boss_algalon_the_observer.cpp:103

References _fedOnTears, _heraldOfTheTitans, DATA_HAS_FED_ON_TEARS, and DATA_HERALD_OF_THE_TITANS.

◆ IsInRoom()

bool boss_algalon_the_observer::IsInRoom ( )
inline
630 {
631 if (me->GetExactDist2d(&me->GetHomePosition()) > 47.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:349
float GetExactDist2d(const float x, const float y) const
Definition Position.h:170
float GetPositionZ() const
Definition Position.h:123

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

Referenced by UpdateAI().

◆ IsValidHeraldItem()

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

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::JustEngagedWith ( Unit )
inlineoverridevirtual

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

Reimplemented from CreatureAI.

493 {
494 if (_fightWon)
495 return;
496
497 if (!_instance)
498 {
500 return;
501 }
502
503 Milliseconds introDelay = 0ms;
504 me->setActive(true);
507 me->SetImmuneToNPC(true);
508 events.Reset();
509 events.SetPhase(PHASE_ROLE_PLAY);
510 events.ScheduleEvent(EVENT_ALGALON_IN_PROGRESS, _firstPull ? 14s : 1500ms);
513
514 if (_firstPull)
515 {
516 _firstPull = false;
518 events.ScheduleEvent(EVENT_SAY_ALGALON_AGGRO, 16s);
519 introDelay = 26s;
520 }
521 else
522 introDelay = 8500ms;
523
524 events.ScheduleEvent(EVENT_INTRO_TIMER_DONE, introDelay);
525 events.ScheduleEvent(EVENT_QUANTUM_STRIKE, 3500ms + introDelay);
526 events.ScheduleEvent(EVENT_PHASE_PUNCH, 15500ms + introDelay);
527 events.ScheduleEvent(EVENT_SUMMON_COLLAPSING_STAR, 16500ms + introDelay);
528 events.ScheduleEvent(EVENT_COSMIC_SMASH, 26s + introDelay);
529 events.ScheduleEvent(EVENT_ACTIVATE_LIVING_CONSTELLATION, 60s + introDelay);
530 events.ScheduleEvent(EVENT_BIG_BANG, 90s + introDelay);
531 events.ScheduleEvent(EVENT_ASCEND_TO_THE_HEAVENS, 360s + introDelay);
532 events.ScheduleEvent(EVENT_CHECK_HERALD_ITEMS, 5s);
534 }
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:27
@ SAY_ALGALON_START_TIMER
Definition boss_algalon_the_observer.cpp:183
@ EVENT_ALGALON_IN_PROGRESS
Definition boss_algalon_the_observer.cpp:149
@ EVENT_COSMIC_SMASH
Definition boss_algalon_the_observer.cpp:133
@ EVENT_BIG_BANG
Definition boss_algalon_the_observer.cpp:129
@ EVENT_CHECK_HERALD_ITEMS
Definition boss_algalon_the_observer.cpp:148
@ EVENT_SAY_ALGALON_AGGRO
Definition boss_algalon_the_observer.cpp:124
@ EVENT_INTRO_TIMER_DONE
Definition boss_algalon_the_observer.cpp:125
@ EVENT_QUANTUM_STRIKE
Definition boss_algalon_the_observer.cpp:126
@ EVENT_PHASE_PUNCH
Definition boss_algalon_the_observer.cpp:127
@ EVADE_REASON_OTHER
Definition CreatureAI.h:92
void SetImmuneToNPC(bool apply, bool keepCombat=false)
Definition Unit.cpp:10652
void setActive(bool isActiveObject)
Definition Object.cpp:1086
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
bool DoCheckHeraldOfTheTitans()
Definition boss_algalon_the_observer.cpp:307
void EnterEvadeMode(EvadeReason why) override
Definition boss_algalon_the_observer.cpp:361
@ DATA_DESPAWN_ALGALON
Definition ulduar.h:102
@ NPC_AZEROTH
Definition ulduar.h:228

References _fightWon, _firstPull, _instance, DATA_DESPAWN_ALGALON, SummonList::DespawnEntry(), DoCheckHeraldOfTheTitans(), EnterEvadeMode(), CreatureAI::EVADE_REASON_OTHER, EVENT_ACTIVATE_LIVING_CONSTELLATION, EVENT_ALGALON_IN_PROGRESS, 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_SAY_ALGALON_AGGRO, EVENT_SUMMON_COLLAPSING_STAR, 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::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

488 {
489 me->setActive(false);
490 }

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

◆ JustSummoned()

void boss_algalon_the_observer::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

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.AddEventAtOffset(new CosmicSmashDamageEvent(summon), 4s);
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:39
@ SPELL_SUMMON_VOID_ZONE_VISUAL
Definition boss_algalon_the_observer.cpp:68
@ SPELL_COSMIC_SMASH_VISUAL_STATE
Definition boss_algalon_the_observer.cpp:47
Definition boss_algalon_the_observer.cpp:255
void AddEventAtOffset(BasicEvent *event, Milliseconds offset, uint8 eventGroup=0)
Definition EventProcessor.h:108
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Force the unit to chase this target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:316
void Clear(bool reset=true)
Definition MotionMaster.h:193
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:112
Definition Unit.h:665
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition Unit.cpp:16005
bool Attack(Unit *victim, bool meleeAttack)
Definition Unit.cpp:7333
void StopMovingOnCurrentPos()
Definition Unit.cpp:13073
EventProcessor m_Events
Definition Object.h:742
float GetOrientation() const
Definition Position.h:124
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
@ NPC_ALGALON_STALKER_ASTEROID_TARGET_01
Definition ulduar.h:235
@ NPC_UNLEASHED_DARK_MATTER
Definition ulduar.h:237
@ NPC_ALGALON_STALKER_ASTEROID_TARGET_02
Definition ulduar.h:236

References EventProcessor::AddEventAtOffset(), Unit::Attack(), Unit::CastSpell(), MotionMaster::Clear(), Object::GetEntry(), Unit::GetMotionMaster(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), WorldObject::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, Random, 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::KilledUnit ( Unit victim)
inlineoverridevirtual

Reimplemented from CreatureAI.

418 {
419 if (!victim->IsPlayer() || urand(0, 2))
420 return;
421
423 }
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ SAY_ALGALON_KILL
Definition boss_algalon_the_observer.cpp:200
bool IsPlayer() const
Definition Object.h:201

References Object::IsPlayer(), SAY_ALGALON_KILL, and urand().

◆ MovementInform()

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

Reimplemented from CreatureAI.

537 {
538 if (movementType != POINT_MOTION_TYPE)
539 return;
540
541 if (pointId == POINT_ALGALON_LAND)
542 me->SetDisableGravity(false);
543 else if (pointId == POINT_ALGALON_OUTRO)
545 }
@ POINT_MOTION_TYPE
Definition MotionMaster.h:48
Position const AlgalonOutroPos
Definition boss_algalon_the_observer.cpp:245
@ POINT_ALGALON_LAND
Definition boss_algalon_the_observer.cpp:97
@ POINT_ALGALON_OUTRO
Definition boss_algalon_the_observer.cpp:98
void SetFacingTo(float ori)
Definition Unit.cpp:16455

References AlgalonOutroPos, Position::GetOrientation(), ScriptedAI::me, POINT_ALGALON_LAND, POINT_ALGALON_OUTRO, POINT_MOTION_TYPE, Unit::SetDisableGravity(), and Unit::SetFacingTo().

◆ Reset()

void boss_algalon_the_observer::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

391 {
392 if (_fightWon)
393 return;
394
395 events.Reset();
398 me->SetImmuneToPC(false);
400 me->SetFaction(190);
402 _phaseTwo = false;
403 _heraldOfTheTitans = true;
404 if (_instance)
405 {
407 {
408 _firstPull = false;
411 me->DespawnOrUnsummon(1ms);
412 }
414 }
415 }
@ SHEATH_STATE_UNARMED
Definition UnitDefines.h:129
@ SPELL_DUAL_WIELD
Definition boss_algalon_the_observer.cpp:50
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:252
virtual void SetSheath(SheathState sheathed)
Definition Unit.h:1777
@ DATA_RESUMMON_ALGALON
Definition ulduar.h:112

References _fightWon, _firstPull, _heraldOfTheTitans, _instance, _phaseTwo, BOSS_ALGALON, Unit::CastSpell(), DATA_RESUMMON_ALGALON, SummonList::DespawnAll(), Creature::DespawnOrUnsummon(), FAIL, InstanceScript::GetBossState(), ScriptedAI::me, NOT_STARTED, PERSISTENT_DATA_ALGALON_FIRST_PULL, REACT_PASSIVE, InstanceScript::SetBossState(), ZoneScript::SetData(), Unit::SetFaction(), Unit::SetImmuneToPC(), Creature::SetReactState(), Unit::SetSheath(), SHEATH_STATE_UNARMED, SPELL_DUAL_WIELD, InstanceScript::StorePersistentData(), and summons.

Referenced by EnterEvadeMode().

◆ UpdateAI()

void boss_algalon_the_observer::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

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:
653 if (_firstPull)
655 break;
658 break;
660 me->CastSpell((Unit*)nullptr, SPELL_SUMMON_AZEROTH, true);
662 break;
665 break;
666 case EVENT_INTRO_2:
667 if (_firstPull)
669 break;
670 case EVENT_INTRO_3:
671 if (_firstPull)
673 break;
675 events.Reset();
676 me->SetImmuneToPC(false);
678 brann->AI()->DoAction(ACTION_FINISH_INTRO);
679 break;
682 break;
684 if (_instance)
686 break;
690 me->SetImmuneToNPC(false);
691 events.SetPhase(PHASE_NORMAL);
692 me->CastSpell((Unit*)nullptr, SPELL_SUPERMASSIVE_FAIL, true);
693 // Hack: _IsValidTarget failed earlier due to flags, call AttackStart again
696 if (Player* target = SelectTargetFromPlayerList(150.0f))
697 AttackStart(target);
699 for (uint32 i = 0; i < LIVING_CONSTELLATION_COUNT; ++i)
701 break;
704 events.Repeat(3s, 4500ms);
705 break;
708 events.Repeat(15s + 500ms);
709 break;
711 {
715 if (activeStars < COLLAPSING_STAR_COUNT)
716 for (uint8 i = activeStars; i < COLLAPSING_STAR_COUNT; ++i)
718
719 events.Repeat(1min);
720 break;
721 }
725 events.Repeat(25s + 500ms);
726 break;
728 {
729 if (events.GetPhaseMask() & PHASE_MASK_NO_UPDATE)
730 {
731 events.Repeat(4s);
732 break;
733 }
735 //me->CastSpell(me, SPELL_TRIGGER_3_ADDS, true);
736 events.Repeat(50s);
737 break;
738 }
739 case EVENT_BIG_BANG:
740 {
743
746
747 me->CastSpell((Unit*)nullptr, SPELL_BIG_BANG, false);
748 events.Repeat(90s + 500ms);
749 break;
750 }
753 me->CastSpell((Unit*)nullptr, SPELL_ASCEND_TO_THE_HEAVENS, false);
754 events.ScheduleEvent(EVENT_EVADE, 2500ms);
755 break;
756 case EVENT_EVADE:
757 events.Reset();
759 return;
761 if (_instance)
762 {
765 }
766 break;
767 case EVENT_OUTRO_1:
770 break;
771 case EVENT_OUTRO_2:
772 {
773 Player* lootRecipent = me->GetLootRecipient();
776 // LootRecipent is cleared in _EnterEvadeMode, restore it
777 me->SetLootRecipient(lootRecipent);
778 me->GetMotionMaster()->Clear(false);
780 events.ScheduleEvent(EVENT_OUTRO_3, 3200ms);
781 events.ScheduleEvent(EVENT_OUTRO_4, 4400ms);
782 events.ScheduleEvent(EVENT_OUTRO_5, 10500ms);
783 events.ScheduleEvent(EVENT_OUTRO_6, 17s + 500ms);
784 events.ScheduleEvent(EVENT_OUTRO_7, 57s + 500ms);
785 events.ScheduleEvent(EVENT_OUTRO_8, 75s + 500ms);
786 events.ScheduleEvent(EVENT_OUTRO_9, 87s + 500ms);
787 events.ScheduleEvent(EVENT_OUTRO_10, 113s);
788 events.ScheduleEvent(EVENT_OUTRO_11, 119s + 500ms);
789 break;
790 }
791 case EVENT_OUTRO_3:
792 me->CastSpell((Unit*)nullptr, SPELL_KILL_CREDIT);
793 // Summon Chest
794 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))
795 {
796 go->ReplaceAllGameObjectFlags((GameObjectFlags)0);
797 go->SetLootRecipient(me);
798 }
799 break;
800 case EVENT_OUTRO_4:
803 break;
804 case EVENT_OUTRO_5:
806 brann->AI()->DoAction(ACTION_OUTRO);
807 break;
808 case EVENT_OUTRO_6:
811 break;
812 case EVENT_OUTRO_7:
814 break;
815 case EVENT_OUTRO_8:
817 break;
818 case EVENT_OUTRO_9:
820 break;
821 case EVENT_OUTRO_10:
823 break;
824 case EVENT_OUTRO_11:
826 me->CastSpell(me, SPELL_TELEPORT, false);
828 break;
831 break;
834 break;
837 break;
839 me->CastSpell((Unit*)nullptr, SPELL_ASCEND_TO_THE_HEAVENS, false);
840 break;
843 me->CastSpell(me, SPELL_TELEPORT, false);
845 break;
848 events.Repeat(5s);
849 break;
850 }
851
853 }
@ IN_PROGRESS
Definition InstanceScript.h:59
@ DONE
Definition InstanceScript.h:61
@ TEMPSUMMON_DEAD_DESPAWN
Definition Object.h:55
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:51
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:54
@ EMOTE_STATE_SPELL_CHANNEL_OMNI
Definition SharedDefines.h:2065
GameObjectFlags
Definition SharedDefines.h:1606
@ FACTION_MONSTER
Definition SharedDefines.h:183
@ SPELLVALUE_MAX_TARGETS
Definition SpellDefines.h:117
@ UNIT_STAND_STATE_KNEEL
Definition UnitDefines.h:43
@ UNIT_STAND_STATE_STAND
Definition UnitDefines.h:35
@ SHEATH_STATE_MELEE
Definition UnitDefines.h:130
@ UNIT_STATE_EVADE
Definition UnitDefines.h:194
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ UNIT_FLAG_RENAME
Definition UnitDefines.h:261
@ REACT_AGGRESSIVE
Definition Unit.h:569
@ 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
@ SPELL_PHASE_PUNCH
Definition boss_algalon_the_observer.cpp:42
@ SPELL_SUPERMASSIVE_FAIL
Definition boss_algalon_the_observer.cpp:40
@ SPELL_SUMMON_AZEROTH
Definition boss_algalon_the_observer.cpp:38
@ SPELL_QUANTUM_STRIKE
Definition boss_algalon_the_observer.cpp:41
@ SPELL_KILL_CREDIT
Definition boss_algalon_the_observer.cpp:49
@ SPELL_COSMIC_SMASH
Definition boss_algalon_the_observer.cpp:45
@ SPELL_ASCEND_TO_THE_HEAVENS
Definition boss_algalon_the_observer.cpp:44
@ SPELL_BIG_BANG
Definition boss_algalon_the_observer.cpp:43
@ PHASE_MASK_NO_CAST_CHECK
Definition boss_algalon_the_observer.cpp:171
@ PHASE_MASK_NO_UPDATE
Definition boss_algalon_the_observer.cpp:170
#define LIVING_CONSTELLATION_COUNT
Definition boss_algalon_the_observer.cpp:221
Position const ConstellationPos[LIVING_CONSTELLATION_COUNT]
Definition boss_algalon_the_observer.cpp:222
@ SAY_ALGALON_OUTRO_2
Definition boss_algalon_the_observer.cpp:193
@ SAY_ALGALON_INTRO_2
Definition boss_algalon_the_observer.cpp:181
@ EMOTE_ALGALON_COSMIC_SMASH
Definition boss_algalon_the_observer.cpp:190
@ SAY_ALGALON_AGGRO
Definition boss_algalon_the_observer.cpp:184
@ SAY_ALGALON_OUTRO_3
Definition boss_algalon_the_observer.cpp:194
@ SAY_ALGALON_DESPAWN_1
Definition boss_algalon_the_observer.cpp:197
@ SAY_ALGALON_INTRO_3
Definition boss_algalon_the_observer.cpp:182
@ SAY_ALGALON_COLLAPSING_STAR
Definition boss_algalon_the_observer.cpp:185
@ SAY_ALGALON_INTRO_1
Definition boss_algalon_the_observer.cpp:180
@ EMOTE_ALGALON_COLLAPSING_STAR
Definition boss_algalon_the_observer.cpp:186
@ SAY_ALGALON_OUTRO_5
Definition boss_algalon_the_observer.cpp:196
@ SAY_ALGALON_BIG_BANG
Definition boss_algalon_the_observer.cpp:187
@ SAY_ALGALON_ASCEND
Definition boss_algalon_the_observer.cpp:189
@ SAY_ALGALON_DESPAWN_3
Definition boss_algalon_the_observer.cpp:199
@ SAY_ALGALON_DESPAWN_2
Definition boss_algalon_the_observer.cpp:198
@ SAY_ALGALON_OUTRO_4
Definition boss_algalon_the_observer.cpp:195
@ SAY_ALGALON_OUTRO_1
Definition boss_algalon_the_observer.cpp:192
@ EMOTE_ALGALON_BIG_BANG
Definition boss_algalon_the_observer.cpp:188
Position const BrannOutroPos[3]
Definition boss_algalon_the_observer.cpp:247
@ EVENT_OUTRO_9
Definition boss_algalon_the_observer.cpp:144
@ EVENT_OUTRO_3
Definition boss_algalon_the_observer.cpp:138
@ EVENT_OUTRO_11
Definition boss_algalon_the_observer.cpp:146
@ EVENT_OUTRO_7
Definition boss_algalon_the_observer.cpp:142
@ EVENT_OUTRO_5
Definition boss_algalon_the_observer.cpp:140
@ EVENT_OUTRO_8
Definition boss_algalon_the_observer.cpp:143
@ EVENT_OUTRO_6
Definition boss_algalon_the_observer.cpp:141
@ EVENT_OUTRO_10
Definition boss_algalon_the_observer.cpp:145
@ EVENT_EVADE
Definition boss_algalon_the_observer.cpp:132
@ EVENT_OUTRO_4
Definition boss_algalon_the_observer.cpp:139
bool UpdateVictim()
Definition CreatureAI.cpp:350
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:235
void SetLootRecipient(Unit *unit, bool withGroup=true)
Definition Creature.cpp:1307
Player * GetLootRecipient() const
Definition Creature.cpp:1293
Definition ScriptedCreature.h:168
Definition GameObject.h:120
Creature * GetCreature(uint32 type)
Definition InstanceScript.cpp:120
uint32 GetEntryCount(uint32 entry) const
Definition ScriptedCreature.cpp:106
void DoAction(int32 info, uint16 max=0)
Definition ScriptedCreature.h:102
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:41
void ClearUnitState(uint32 f)
Definition Unit.h:738
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:1418
void SetEmoteState(Emote emoteState)
Definition Unit.h:759
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:5189
Unit * GetVictim() const
Definition Unit.h:904
bool HasUnitState(const uint32 f) const
Definition Unit.h:737
void RemoveAllAuras()
Definition Unit.cpp:5612
void SetStandState(uint8 state)
Definition Unit.cpp:13126
void ClearEmoteState()
Sets emote state (looping emote). Emotes available in SharedDefines.h.
Definition Unit.h:760
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:750
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:2462
@ SPELL_TELEPORT
Definition karazhan.cpp:36
T const & RAID_MODE(T const &normal10, T const &normal25) const
Definition ScriptedCreature.h:408
void CallConstellations()
Definition boss_algalon_the_observer.cpp:345
bool IsInRoom()
Definition boss_algalon_the_observer.cpp:629
void AttackStart(Unit *who) override
Definition boss_algalon_the_observer.cpp:329
@ DATA_ALGALON_DEFEATED
Definition ulduar.h:103
@ DATA_BRANN_BRONZEBEARD_ALG
Definition ulduar.h:111
@ GO_ALGALON_CHEST
Definition ulduar.h:255
@ GO_ALGALON_CHEST_HERO
Definition ulduar.h:256
@ NPC_BRANN_BRONZBEARD_ALG
Definition ulduar.h:227

References CreatureAI::_EnterEvadeMode(), _firstPull, _instance, ACTION_BIG_BANG, ACTION_FINISH_INTRO, ACTION_OUTRO, AlgalonLandPos, AlgalonOutroPos, AttackStart(), BOSS_ALGALON, BrannOutroPos, CallConstellations(), Unit::CastCustomSpell(), Unit::CastSpell(), MotionMaster::Clear(), Unit::ClearEmoteState(), Unit::ClearUnitState(), COLLAPSING_STAR_COUNT, CollapsingStarPos, ConstellationPos, DATA_ALGALON_DEFEATED, DATA_BRANN_BRONZEBEARD_ALG, Creature::DespawnOrUnsummon(), SummonList::DoAction(), DoCheckHeraldOfTheTitans(), UnitAI::DoMeleeAttackIfReady(), DONE, EMOTE_ALGALON_BIG_BANG, EMOTE_ALGALON_COLLAPSING_STAR, EMOTE_ALGALON_COSMIC_SMASH, EMOTE_STATE_SPELL_CHANNEL_OMNI, CreatureAI::EnterEvadeMode(), EVENT_ACTIVATE_LIVING_CONSTELLATION, EVENT_ALGALON_IN_PROGRESS, 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_CHANNEL, EVENT_INTRO_DESCEND, EVENT_INTRO_FINISH, EVENT_INTRO_SUMMON, 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_SAY_ALGALON_AGGRO, EVENT_SUMMON_COLLAPSING_STAR, FACTION_MONSTER, InstanceScript::GetCreature(), SummonList::GetEntryCount(), Creature::GetLootRecipient(), Unit::GetMotionMaster(), Unit::GetVictim(), GO_ALGALON_CHEST, GO_ALGALON_CHEST_HERO, Unit::HasUnitState(), IN_PROGRESS, IsInRoom(), LIVING_CONSTELLATION_COUNT, 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_LAND, 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(), InstanceScript::SetBossState(), ZoneScript::SetData(), Unit::SetEmoteState(), 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, UNIT_FLAG_NOT_SELECTABLE, UNIT_FLAG_RENAME, UNIT_STAND_STATE_KNEEL, UNIT_STAND_STATE_STAND, UNIT_STATE_CASTING, UNIT_STATE_EVADE, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ _fedOnTears

bool boss_algalon_the_observer::_fedOnTears

◆ _fightWon

bool boss_algalon_the_observer::_fightWon

◆ _firstPull

bool boss_algalon_the_observer::_firstPull

◆ _heraldOfTheTitans

bool boss_algalon_the_observer::_heraldOfTheTitans

◆ _instance

InstanceScript* boss_algalon_the_observer::_instance

◆ _phaseTwo

bool boss_algalon_the_observer::_phaseTwo

Referenced by DamageTaken(), and Reset().

◆ events

EventMap boss_algalon_the_observer::events

◆ summons

SummonList boss_algalon_the_observer::summons

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