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 (const Position *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 >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=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 ()
 
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)
 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
265 : ScriptedAI(creature), summons(me)
266 {
267 _fedOnTears = true;
268 _firstPull = true;
269 _fightWon = false;
271 }
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1238
Definition ScriptedCreature.h:191
Creature * me
Definition ScriptedCreature.h:281
bool _fightWon
Definition boss_algalon_the_observer.cpp:278
SummonList summons
Definition boss_algalon_the_observer.cpp:274
bool _fedOnTears
Definition boss_algalon_the_observer.cpp:280
InstanceScript * _instance
Definition boss_algalon_the_observer.cpp:275
bool _firstPull
Definition boss_algalon_the_observer.cpp:277

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

Member Function Documentation

◆ AttackStart()

void boss_algalon_the_observer::AttackStart ( Unit who)
inlineoverridevirtual

Reimplemented from UnitAI.

319 {
320 if (_fightWon)
321 return;
323 }
void AttackStart(Unit *) override
Definition ScriptedCreature.cpp:228

References _fightWon, and ScriptedAI::AttackStart().

Referenced by UpdateAI().

◆ CallConstellations()

void boss_algalon_the_observer::CallConstellations ( )
inline
335 {
336 uint8 _count = 0;
338 {
339 Creature* summon = ObjectAccessor::GetCreature(*me, *i++);
340 if (summon && summon->GetEntry() == NPC_LIVING_CONSTELLATION && !summon->AI()->GetData(0))
341 {
342 ++_count;
343 summon->AI()->DoAction(ACTION_ACTIVATE_STAR);
344 if (_count >= 3)
345 break;
346 }
347 }
348 }
std::uint8_t uint8
Definition Define.h:109
@ ACTION_ACTIVATE_STAR
Definition boss_algalon_the_observer.cpp:83
Definition Creature.h:47
CreatureAI * AI() const
Definition Creature.h:143
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:210
@ NPC_LIVING_CONSTELLATION
Definition ulduar.h:210

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.

584 {
585 if (_fightWon)
586 {
587 damage = 0;
588 return;
589 }
590
591 if (!_phaseTwo && me->HealthBelowPctDamaged(20, damage))
592 {
593 _phaseTwo = true;
601
602 for (uint32 i = 0; i < COLLAPSING_STAR_COUNT; ++i)
604 }
605 else if (me->HealthBelowPctDamaged(2, damage) && !_fightWon)
606 {
607 _fightWon = true;
608 damage = 0;
610 me->AttackStop();
613 events.Reset();
616 events.SetPhase(PHASE_ROLE_PLAY);
617 events.ScheduleEvent(EVENT_OUTRO_START, 1500ms);
618 events.ScheduleEvent(EVENT_OUTRO_1, 7200ms);
619 events.ScheduleEvent(EVENT_OUTRO_2, 8700ms);
620 }
621 }
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:566
Position const CollapsingStarPos[COLLAPSING_STAR_COUNT]
Definition boss_algalon_the_observer.cpp:231
@ PHASE_ROLE_PLAY
Definition boss_algalon_the_observer.cpp:160
#define COLLAPSING_STAR_COUNT
Definition boss_algalon_the_observer.cpp:230
@ SAY_ALGALON_PHASE_TWO
Definition boss_algalon_the_observer.cpp:184
@ EVENT_OUTRO_2
Definition boss_algalon_the_observer.cpp:134
@ EVENT_OUTRO_START
Definition boss_algalon_the_observer.cpp:132
@ EVENT_OUTRO_1
Definition boss_algalon_the_observer.cpp:133
@ EVENT_ACTIVATE_LIVING_CONSTELLATION
Definition boss_algalon_the_observer.cpp:144
@ EVENT_SUMMON_COLLAPSING_STAR
Definition boss_algalon_the_observer.cpp:125
events
Definition boss_sartura.cpp:43
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:99
void DespawnEntry(uint32 entry)
Definition ScriptedCreature.cpp:55
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:72
void SetFaction(uint32 faction)
Definition Unit.cpp:7056
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4302
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:1117
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:748
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition Unit.cpp:7436
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:2394
Talk
Definition hyjal.cpp:82
bool _phaseTwo
Definition boss_algalon_the_observer.cpp:279
@ NPC_BLACK_HOLE
Definition ulduar.h:213
@ NPC_COLLAPSING_STAR
Definition ulduar.h:212
@ NPC_WORM_HOLE
Definition ulduar.h:214
@ NPC_ALGALON_VOID_ZONE_VISUAL_STALKER
Definition ulduar.h:215

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.

406 {
407 switch (action)
408 {
410 {
411 me->SetImmuneToPC(true);
413 me->SetDisableGravity(true);
414 me->CastSpell(me, SPELL_ARRIVAL, true);
420 init.SetOrientationFixed(true);
421 init.Launch();
422 events.Reset();
423 events.SetPhase(PHASE_ROLE_PLAY);
424 events.ScheduleEvent(EVENT_INTRO_1, 5s, 0, PHASE_ROLE_PLAY);
425 events.ScheduleEvent(EVENT_INTRO_2, 15s, 0, PHASE_ROLE_PLAY);
426 events.ScheduleEvent(EVENT_INTRO_3, 23s, 0, PHASE_ROLE_PLAY);
427 events.ScheduleEvent(EVENT_INTRO_FINISH, 36s, 0, PHASE_ROLE_PLAY);
428 break;
429 }
431 _fightWon = true;
432 events.Reset();
434 events.SetPhase(PHASE_ROLE_PLAY);
435 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_1, 5s);
436 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_2, 17s);
437 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_3, 26s);
438 if (me->IsInCombat())
439 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_4, 26s);
440 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_5, 32s);
441 me->DespawnOrUnsummon(39s);
442
444 me->AttackStop();
448 if (_instance)
450 break;
452 _firstPull = false;
453 _fedOnTears = false;
454 me->SetImmuneToPC(false);
455 break;
456 case ACTION_ASCEND:
458 events.SetPhase(PHASE_BIG_BANG);
459 events.ScheduleEvent(EVENT_ASCEND_TO_THE_HEAVENS, 1500ms);
460 break;
462 _fedOnTears = false;
463 }
464 }
@ NOT_STARTED
Definition InstanceScript.h:58
@ UNIT_FLAG2_DO_NOT_FADE_IN
Definition UnitDefines.h:301
@ ACTION_ASCEND
Definition boss_algalon_the_observer.cpp:85
@ ACTION_START_INTRO
Definition boss_algalon_the_observer.cpp:81
@ POINT_ALGALON_LAND
Definition boss_algalon_the_observer.cpp:96
@ 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:161
@ EVENT_INTRO_1
Definition boss_algalon_the_observer.cpp:117
@ EVENT_INTRO_2
Definition boss_algalon_the_observer.cpp:118
@ EVENT_DESPAWN_ALGALON_3
Definition boss_algalon_the_observer.cpp:149
@ EVENT_DESPAWN_ALGALON_5
Definition boss_algalon_the_observer.cpp:151
@ EVENT_DESPAWN_ALGALON_2
Definition boss_algalon_the_observer.cpp:148
@ EVENT_INTRO_FINISH
Definition boss_algalon_the_observer.cpp:120
@ EVENT_DESPAWN_ALGALON_4
Definition boss_algalon_the_observer.cpp:150
@ EVENT_DESPAWN_ALGALON_1
Definition boss_algalon_the_observer.cpp:147
@ EVENT_INTRO_3
Definition boss_algalon_the_observer.cpp:119
@ EVENT_ASCEND_TO_THE_HEAVENS
Definition boss_algalon_the_observer.cpp:128
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:345
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2126
void MovePoint(uint32 id, const Position &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
Definition MoveSplineInit.h:63
MotionMaster * GetMotionMaster()
Definition Unit.h:1758
void SetUnitFlag2(UnitFlags2 flags)
Definition Unit.h:754
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:1350
void SetDisableGravity(bool disable)
Definition Unit.cpp:16462
void SetImmuneToPC(bool apply, bool keepCombat=false)
Definition Unit.cpp:10597
bool IsInCombat() const
Definition Unit.h:935
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
float GetPositionZ() const
Definition Position.h:123
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
Position const AlgalonLandPos
Definition ulduar.h:369
@ ACTION_DESPAWN_ALGALON
Definition ulduar.h:341
@ ACTION_FEEDS_ON_TEARS_FAILED
Definition ulduar.h:339
@ ACTION_INIT_ALGALON
Definition ulduar.h:340
@ 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, 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_FINISH, FACTION_FRIENDLY, Unit::GetMotionMaster(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::InterruptNonMeleeSpells(), Unit::IsInCombat(), Movement::MoveSplineInit::Launch(), ScriptedAI::me, MotionMaster::MovePoint(), Movement::MoveSplineInit::MoveTo(), NOT_STARTED, PHASE_BIG_BANG, PHASE_ROLE_PLAY, POINT_ALGALON_LAND, REACT_PASSIVE, ZoneScript::SetData(), Unit::SetDisableGravity(), Unit::SetFaction(), Creature::SetHomePosition(), Unit::SetImmuneToPC(), Movement::MoveSplineInit::SetOrientationFixed(), Creature::SetReactState(), Unit::SetUnitFlag(), Unit::SetUnitFlag2(), SPELL_ARRIVAL, SPELL_RIDE_THE_LIGHTNING, 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
297 {
299 return true;
300
301 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
302 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
303 if (Player* plr = itr->GetSource())
304 if (!plr->IsGameMaster() && plr->IsInCombat() /*performance*/)
305 {
306 for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i) // loop through equipped items
307 if (Item* item = plr->GetItemByPos(INVENTORY_SLOT_BAG_0, i))
308 if (!IsValidHeraldItem(item->GetTemplate()))
309 {
310 _heraldOfTheTitans = false;
311 return true;
312 }
313 }
314
315 return false;
316 }
@ EQUIPMENT_SLOT_END
Definition Player.h:680
@ EQUIPMENT_SLOT_START
Definition Player.h:660
#define INVENTORY_SLOT_BAG_0
Definition Player.h:656
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:326
Definition Player.h:1084
Map * GetMap() const
Definition Object.h:625
bool _heraldOfTheTitans
Definition boss_algalon_the_observer.cpp:281
bool IsValidHeraldItem(ItemTemplate const *item)
Definition boss_algalon_the_observer.cpp:283

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.

351 {
352 if (_fightWon)
353 return;
354
355 if (SelectTargetFromPlayerList(120.0f))
356 {
358 return;
359 }
360 else if (events.GetPhaseMask() & PHASE_NORMAL)
361 {
363 return;
364 }
365
366 if (_instance)
368
370 }
@ FAIL
Definition InstanceScript.h:60
@ PHASE_NORMAL
Definition boss_algalon_the_observer.cpp:159
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:235
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2789
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:405

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

Referenced by JustEngagedWith().

◆ GetData()

uint32 boss_algalon_the_observer::GetData ( uint32  param) const
inlineoverridevirtual

Reimplemented from UnitAI.

326 {
327 if (param == DATA_HAS_FED_ON_TEARS)
328 return _fedOnTears;
329 if (param == DATA_HERALD_OF_THE_TITANS)
330 return _heraldOfTheTitans;
331 return 0;
332 }
@ DATA_HERALD_OF_THE_TITANS
Definition boss_algalon_the_observer.cpp:102
@ DATA_HAS_FED_ON_TEARS
Definition boss_algalon_the_observer.cpp:101

References _fedOnTears, _heraldOfTheTitans, DATA_HAS_FED_ON_TEARS, and DATA_HERALD_OF_THE_TITANS.

◆ IsInRoom()

bool boss_algalon_the_observer::IsInRoom ( )
inline
624 {
625 if (me->GetExactDist2d(&me->GetHomePosition()) > 45.f || me->GetPositionZ() < 410.f)
626 {
628 return false;
629 }
630
631 return true;
632 }
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition Creature.h:347
float GetExactDist2d(const float x, const float y) const
Definition Position.h:170

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
284 {
285 if (!item) // should not happen, but checked in GetAverageItemLevel()
286 return true;
287 if (item->ItemLevel <= 226 || (item->ItemLevel <= 232 && (
288 item->InventoryType == INVTYPE_SHIELD ||
289 item->Class == ITEM_CLASS_WEAPON ||
290 (item->Class == ITEM_CLASS_ARMOR && (item->InventoryType == INVTYPE_RELIC || item->InventoryType == INVTYPE_HOLDABLE))
291 )))
292 return true;
293 return false;
294 }
@ 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.

472 {
473 if (_fightWon)
474 return;
475
476 if (!_instance)
477 {
479 return;
480 }
481
482 Milliseconds introDelay = 0ms;
483 me->setActive(true);
486 me->SetImmuneToNPC(true);
487 events.Reset();
488 events.SetPhase(PHASE_ROLE_PLAY);
489
490 if (!_firstPull)
491 {
492 events.ScheduleEvent(EVENT_START_COMBAT, 0ms);
493 introDelay = 8s;
494 }
495 else
496 {
498 _firstPull = false;
500 introDelay = 22s;
501 events.ScheduleEvent(EVENT_START_COMBAT, 14s);
503 }
504
505 events.ScheduleEvent(EVENT_REMOVE_UNNATTACKABLE, introDelay - 500ms);
506 events.ScheduleEvent(EVENT_INTRO_TIMER_DONE, introDelay);
507 events.ScheduleEvent(EVENT_QUANTUM_STRIKE, 3500ms + introDelay);
508 events.ScheduleEvent(EVENT_PHASE_PUNCH, 15500ms + introDelay);
509 events.ScheduleEvent(EVENT_SUMMON_COLLAPSING_STAR, 16500ms + introDelay);
510 events.ScheduleEvent(EVENT_COSMIC_SMASH, 25s + introDelay);
511 events.ScheduleEvent(EVENT_ACTIVATE_LIVING_CONSTELLATION, 50500ms + introDelay);
512 events.ScheduleEvent(EVENT_BIG_BANG, 90s + introDelay);
513 events.ScheduleEvent(EVENT_ASCEND_TO_THE_HEAVENS, 360s + introDelay);
514
515 events.ScheduleEvent(EVENT_CHECK_HERALD_ITEMS, 5s);
517 }
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:27
@ SAY_ALGALON_START_TIMER
Definition boss_algalon_the_observer.cpp:176
@ EVENT_REMOVE_UNNATTACKABLE
Definition boss_algalon_the_observer.cpp:146
@ EVENT_START_COMBAT
Definition boss_algalon_the_observer.cpp:121
@ EVENT_COSMIC_SMASH
Definition boss_algalon_the_observer.cpp:130
@ EVENT_BIG_BANG
Definition boss_algalon_the_observer.cpp:126
@ EVENT_CHECK_HERALD_ITEMS
Definition boss_algalon_the_observer.cpp:145
@ EVENT_INTRO_TIMER_DONE
Definition boss_algalon_the_observer.cpp:122
@ EVENT_QUANTUM_STRIKE
Definition boss_algalon_the_observer.cpp:123
@ EVENT_PHASE_PUNCH
Definition boss_algalon_the_observer.cpp:124
@ EVADE_REASON_OTHER
Definition CreatureAI.h:92
void SetImmuneToNPC(bool apply, bool keepCombat=false)
Definition Unit.cpp:10618
void setActive(bool isActiveObject)
Definition Object.cpp:1082
bool DoCheckHeraldOfTheTitans()
Definition boss_algalon_the_observer.cpp:296
void EnterEvadeMode(EvadeReason why) override
Definition boss_algalon_the_observer.cpp:350
@ DATA_DESPAWN_ALGALON
Definition ulduar.h:103
@ NPC_AZEROTH
Definition ulduar.h:209

References _fightWon, _firstPull, _instance, 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, 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.

467 {
468 me->setActive(false);
469 }

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

◆ JustSummoned()

void boss_algalon_the_observer::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

542 {
543 summons.Summon(summon);
544 switch (summon->GetEntry())
545 {
546 case NPC_AZEROTH:
547 me->CastSpell(summon, SPELL_REORIGINATION, true);
548 break;
549 case NPC_BLACK_HOLE:
550 summon->CastSpell((Unit*)nullptr, SPELL_BLACK_HOLE_TRIGGER, true);
551 summon->CastSpell(summon, SPELL_CONSTELLATION_PHASE_TRIGGER, true);
552 summon->CastSpell((Unit*)nullptr, SPELL_BLACK_HOLE_EXPLOSION, false);
553 summon->CastSpell(summon, SPELL_SUMMON_VOID_ZONE_VISUAL, true);
554 break;
556 summon->CastSpell(summon, SPELL_VOID_ZONE_VISUAL, true);
557 break;
559 summon->CastSpell(summon, SPELL_COSMIC_SMASH_VISUAL_STATE, true);
560 break;
562 {
563 float x = summon->GetPositionX();
564 float y = summon->GetPositionY();
565 float z = summon->GetPositionZ() + 35.0f;
566 float o = summon->GetOrientation();
567
568 summon->GetMotionMaster()->Clear();
569 summon->SetHomePosition(x, y, z, o);
570 summon->UpdatePosition(x, y, z, o, true);
571 summon->StopMovingOnCurrentPos();
572 summon->m_Events.AddEventAtOffset(new CosmicSmashDamageEvent(summon), 4s);
573 break;
574 }
576 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
577 if (summon->Attack(target, true))
578 summon->GetMotionMaster()->MoveChase(target);
579 break;
580 }
581 }
@ SPELL_VOID_ZONE_VISUAL
Definition boss_algalon_the_observer.cpp:68
@ SPELL_BLACK_HOLE_TRIGGER
Definition boss_algalon_the_observer.cpp:63
@ SPELL_BLACK_HOLE_EXPLOSION
Definition boss_algalon_the_observer.cpp:66
@ SPELL_CONSTELLATION_PHASE_TRIGGER
Definition boss_algalon_the_observer.cpp:64
@ SPELL_REORIGINATION
Definition boss_algalon_the_observer.cpp:38
@ SPELL_SUMMON_VOID_ZONE_VISUAL
Definition boss_algalon_the_observer.cpp:67
@ SPELL_COSMIC_SMASH_VISUAL_STATE
Definition boss_algalon_the_observer.cpp:46
Definition boss_algalon_the_observer.cpp:247
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:315
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:111
Definition Unit.h:664
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition Unit.cpp:15967
bool Attack(Unit *victim, bool meleeAttack)
Definition Unit.cpp:7272
void StopMovingOnCurrentPos()
Definition Unit.cpp:13036
EventProcessor m_Events
Definition Object.h:736
float GetOrientation() const
Definition Position.h:124
@ NPC_ALGALON_STALKER_ASTEROID_TARGET_01
Definition ulduar.h:216
@ NPC_UNLEASHED_DARK_MATTER
Definition ulduar.h:218
@ NPC_ALGALON_STALKER_ASTEROID_TARGET_02
Definition ulduar.h:217

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.

398 {
399 if (!victim->IsPlayer() || urand(0, 2))
400 return;
401
403 }
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ SAY_ALGALON_KILL
Definition boss_algalon_the_observer.cpp:193
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.

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

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, Unit::SetDisableGravity(), and Unit::SetFacingTo().

◆ Reset()

void boss_algalon_the_observer::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

373 {
374 if (_fightWon)
375 return;
376
377 events.Reset();
380 me->SetImmuneToPC(false);
382 me->SetFaction(190);
384
385 _phaseTwo = false;
386 _heraldOfTheTitans = true;
387
389 {
390 _firstPull = false;
391 }
392
393 if (_instance)
395 }
@ SHEATH_STATE_UNARMED
Definition UnitDefines.h:129
@ SPELL_DUAL_WIELD
Definition boss_algalon_the_observer.cpp:49
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:252
virtual void SetSheath(SheathState sheathed)
Definition Unit.h:1777

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

◆ UpdateAI()

void boss_algalon_the_observer::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

635 {
636 if (!(events.GetPhaseMask() & PHASE_MASK_NO_UPDATE) && (!UpdateVictim() || !IsInRoom()))
637 return;
638
639 events.Update(diff);
641 return;
642
643 switch (events.ExecuteEvent())
644 {
645 case EVENT_INTRO_1:
648 break;
649 case EVENT_INTRO_2:
650 me->CastSpell((Unit*)nullptr, SPELL_SUMMON_AZEROTH, true);
652 break;
653 case EVENT_INTRO_3:
655 break;
657 events.Reset();
658 me->SetImmuneToPC(false);
660 brann->AI()->DoAction(ACTION_FINISH_INTRO);
661 break;
665 break;
669 me->SetImmuneToNPC(false);
670 break;
672 events.SetPhase(PHASE_NORMAL);
673 me->CastSpell((Unit*)nullptr, SPELL_SUPERMASSIVE_FAIL, true);
674 // Hack: _IsValidTarget failed earlier due to flags, call AttackStart again
677 if (Player* target = SelectTargetFromPlayerList(150.0f))
678 AttackStart(target);
680
681 for (uint32 i = 0; i < LIVING_CONSTELLATION_COUNT; ++i)
683 break;
686 events.Repeat(3s, 4500ms);
687 break;
690 events.Repeat(15s + 500ms);
691 break;
695 for (uint8 i = 0; i < COLLAPSING_STAR_COUNT; ++i)
697 events.Repeat(1min);
698 break;
702 events.Repeat(25s + 500ms);
703 break;
705 {
706 if (events.GetPhaseMask() & PHASE_MASK_NO_UPDATE)
707 {
708 events.Repeat(4s);
709 break;
710 }
712 //me->CastSpell(me, SPELL_TRIGGER_3_ADDS, true);
713 events.Repeat(50s);
714 break;
715 }
716 case EVENT_BIG_BANG:
717 {
720
723
724 me->CastSpell((Unit*)nullptr, SPELL_BIG_BANG, false);
725 events.Repeat(90s + 500ms);
726 break;
727 }
730 me->CastSpell((Unit*)nullptr, SPELL_ASCEND_TO_THE_HEAVENS, false);
731 events.ScheduleEvent(EVENT_EVADE, 2500ms);
732 break;
733 case EVENT_EVADE:
734 events.Reset();
736 return;
738 if (_instance)
739 {
742 }
743 break;
744 case EVENT_OUTRO_1:
747 break;
748 case EVENT_OUTRO_2:
749 {
750 Player* lootRecipent = me->GetLootRecipient();
752 // LootRecipent is cleared in _EnterEvadeMode, restore it
753 me->SetLootRecipient(lootRecipent);
755 break;
756 }
757 case EVENT_OUTRO_3:
758 me->CastSpell((Unit*)nullptr, SPELL_KILL_CREDIT);
759 // Summon Chest
760 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))
761 {
762 go->ReplaceAllGameObjectFlags((GameObjectFlags)0);
763 go->SetLootRecipient(me);
764 }
765 break;
766 case EVENT_OUTRO_4:
769 break;
770 case EVENT_OUTRO_5:
772 brann->AI()->DoAction(ACTION_OUTRO);
773 break;
774 case EVENT_OUTRO_6:
777 break;
778 case EVENT_OUTRO_7:
780 break;
781 case EVENT_OUTRO_8:
783 break;
784 case EVENT_OUTRO_9:
786 break;
787 case EVENT_OUTRO_10:
789 break;
790 case EVENT_OUTRO_11:
792 me->CastSpell(me, SPELL_TELEPORT, false);
794 break;
797 break;
800 break;
803 break;
805 me->CastSpell((Unit*)nullptr, SPELL_ASCEND_TO_THE_HEAVENS, false);
806 break;
809 me->CastSpell(me, SPELL_TELEPORT, false);
811 break;
814 events.Repeat(5s);
815 break;
816 }
817
819 }
@ 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
GameObjectFlags
Definition SharedDefines.h:1608
@ 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_CASTING
Definition UnitDefines.h:188
@ UNIT_FLAG_RENAME
Definition UnitDefines.h:261
@ REACT_AGGRESSIVE
Definition Unit.h:568
@ ACTION_FINISH_INTRO
Definition boss_algalon_the_observer.cpp:82
@ ACTION_OUTRO
Definition boss_algalon_the_observer.cpp:86
@ ACTION_BIG_BANG
Definition boss_algalon_the_observer.cpp:84
Position const AlgalonOutroPos
Definition boss_algalon_the_observer.cpp:238
@ 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_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:164
@ PHASE_MASK_NO_UPDATE
Definition boss_algalon_the_observer.cpp:163
#define LIVING_CONSTELLATION_COUNT
Definition boss_algalon_the_observer.cpp:214
Position const ConstellationPos[LIVING_CONSTELLATION_COUNT]
Definition boss_algalon_the_observer.cpp:215
@ SAY_ALGALON_OUTRO_2
Definition boss_algalon_the_observer.cpp:186
@ SAY_ALGALON_INTRO_2
Definition boss_algalon_the_observer.cpp:174
@ EMOTE_ALGALON_COSMIC_SMASH
Definition boss_algalon_the_observer.cpp:183
@ SAY_ALGALON_AGGRO
Definition boss_algalon_the_observer.cpp:177
@ SAY_ALGALON_OUTRO_3
Definition boss_algalon_the_observer.cpp:187
@ SAY_ALGALON_DESPAWN_1
Definition boss_algalon_the_observer.cpp:190
@ SAY_ALGALON_INTRO_3
Definition boss_algalon_the_observer.cpp:175
@ SAY_ALGALON_COLLAPSING_STAR
Definition boss_algalon_the_observer.cpp:178
@ SAY_ALGALON_INTRO_1
Definition boss_algalon_the_observer.cpp:173
@ EMOTE_ALGALON_COLLAPSING_STAR
Definition boss_algalon_the_observer.cpp:179
@ SAY_ALGALON_OUTRO_5
Definition boss_algalon_the_observer.cpp:189
@ SAY_ALGALON_BIG_BANG
Definition boss_algalon_the_observer.cpp:180
@ SAY_ALGALON_ASCEND
Definition boss_algalon_the_observer.cpp:182
@ SAY_ALGALON_DESPAWN_3
Definition boss_algalon_the_observer.cpp:192
@ SAY_ALGALON_DESPAWN_2
Definition boss_algalon_the_observer.cpp:191
@ SAY_ALGALON_OUTRO_4
Definition boss_algalon_the_observer.cpp:188
@ SAY_ALGALON_OUTRO_1
Definition boss_algalon_the_observer.cpp:185
@ EMOTE_ALGALON_BIG_BANG
Definition boss_algalon_the_observer.cpp:181
Position const BrannOutroPos[3]
Definition boss_algalon_the_observer.cpp:239
@ EVENT_EVADE
Definition boss_algalon_the_observer.cpp:129
bool _EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:382
bool UpdateVictim()
Definition CreatureAI.cpp:353
void SetLootRecipient(Unit *unit, bool withGroup=true)
Definition Creature.cpp:1282
Player * GetLootRecipient() const
Definition Creature.cpp:1268
Definition ScriptedCreature.h:168
Definition GameObject.h:120
Creature * GetCreature(uint32 type)
Definition InstanceScript.cpp:115
void DoAction(int32 info, uint16 max=0)
Definition ScriptedCreature.h:102
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:40
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:1407
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:5157
Unit * GetVictim() const
Definition Unit.h:903
bool HasUnitState(const uint32 f) const
Definition Unit.h:736
void RemoveAllAuras()
Definition Unit.cpp:5580
void SetStandState(uint8 state)
Definition Unit.cpp:13089
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:749
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:2408
@ SPELL_TELEPORT
Definition karazhan.cpp:36
const T & RAID_MODE(const T &normal10, const T &normal25) const
Definition ScriptedCreature.h:408
void CallConstellations()
Definition boss_algalon_the_observer.cpp:334
bool IsInRoom()
Definition boss_algalon_the_observer.cpp:623
void AttackStart(Unit *who) override
Definition boss_algalon_the_observer.cpp:318
@ DATA_ALGALON_DEFEATED
Definition ulduar.h:104
@ DATA_BRANN_BRONZEBEARD_ALG
Definition ulduar.h:112
@ GO_ALGALON_CHEST
Definition ulduar.h:238
@ GO_ALGALON_CHEST_HERO
Definition ulduar.h:239
@ NPC_BRANN_BRONZBEARD_ALG
Definition ulduar.h:208

References CreatureAI::_EnterEvadeMode(), _instance, ACTION_BIG_BANG, ACTION_FINISH_INTRO, ACTION_OUTRO, AlgalonOutroPos, AttackStart(), BOSS_ALGALON, BrannOutroPos, CallConstellations(), Unit::CastCustomSpell(), Unit::CastSpell(), 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, 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, InstanceScript::GetCreature(), 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_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, 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::_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: