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

Public Member Functions

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

Public Attributes

EventMap events
 
SummonList summons
 
InstanceScriptm_pInstance
 
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
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_algalon_the_observerAI()

boss_algalon_the_observer::boss_algalon_the_observerAI::boss_algalon_the_observerAI ( Creature creature)
inline
270 : ScriptedAI(creature), summons(me)
271 {
272 _fedOnTears = true;
273 _firstPull = true;
274 _fightWon = false;
276 }
Definition: ScriptedCreature.h:190
Creature * me
Definition: ScriptedCreature.h:280
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
bool _firstPull
Definition: boss_algalon_the_observer.cpp:282
bool _fedOnTears
Definition: boss_algalon_the_observer.cpp:285
bool _fightWon
Definition: boss_algalon_the_observer.cpp:283
InstanceScript * m_pInstance
Definition: boss_algalon_the_observer.cpp:280
SummonList summons
Definition: boss_algalon_the_observer.cpp:279

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

Member Function Documentation

◆ AttackStart()

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

Reimplemented from ScriptedAI.

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

References _fightWon, and ScriptedAI::AttackStart().

Referenced by UpdateAI().

◆ CallConstellations()

void boss_algalon_the_observer::boss_algalon_the_observerAI::CallConstellations ( )
inline
340 {
341 uint8 _count = 0;
343 {
344 Creature* summon = ObjectAccessor::GetCreature(*me, *i++);
345 if (summon && summon->GetEntry() == NPC_LIVING_CONSTELLATION && !summon->AI()->GetData(0))
346 {
347 ++_count;
348 summon->AI()->DoAction(ACTION_ACTIVATE_STAR);
349 if (_count >= 3)
350 break;
351 }
352 }
353 }
std::uint8_t uint8
Definition: Define.h:109
@ NPC_LIVING_CONSTELLATION
Definition: ulduar.h:162
@ ACTION_ACTIVATE_STAR
Definition: boss_algalon_the_observer.cpp:83
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
virtual void DoAction(int32)
Definition: UnitAI.h:212
virtual uint32 GetData(uint32) const
Definition: UnitAI.h:213
iterator begin()
Definition: ScriptedCreature.h:48
StorageType::const_iterator const_iterator
Definition: ScriptedCreature.h:37
iterator end()
Definition: ScriptedCreature.h:58
Definition: Creature.h:43
CreatureAI * AI() const
Definition: Creature.h:140
uint32 GetEntry() const
Definition: Object.h:115

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

Referenced by UpdateAI().

◆ DamageTaken()

void boss_algalon_the_observer::boss_algalon_the_observerAI::DamageTaken ( Unit ,
uint32 ,
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 ScriptedAI.

589 {
590 if (_fightWon)
591 {
592 damage = 0;
593 return;
594 }
595
596 if (!_phaseTwo && me->HealthBelowPctDamaged(20, damage))
597 {
598 _phaseTwo = true;
606
607 for (uint32 i = 0; i < COLLAPSING_STAR_COUNT; ++i)
609 }
610 else if (me->HealthBelowPctDamaged(2, damage) && !_fightWon)
611 {
612 _fightWon = true;
613 damage = 0;
615 me->AttackStop();
618 events.Reset();
621 events.SetPhase(PHASE_ROLE_PLAY);
622 events.ScheduleEvent(EVENT_OUTRO_START, 1500ms);
623 events.ScheduleEvent(EVENT_OUTRO_1, 7200ms);
624 events.ScheduleEvent(EVENT_OUTRO_2, 8700ms);
625 }
626 }
std::uint32_t uint32
Definition: Define.h:107
events
Definition: boss_sartura.cpp:43
Talk
Definition: hyjal.cpp:82
@ NPC_BLACK_HOLE
Definition: ulduar.h:165
@ NPC_COLLAPSING_STAR
Definition: ulduar.h:164
@ NPC_WORM_HOLE
Definition: ulduar.h:166
@ NPC_ALGALON_VOID_ZONE_VISUAL_STALKER
Definition: ulduar.h:167
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
@ FACTION_FRIENDLY
Definition: SharedDefines.h:201
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: Object.h:53
@ REACT_PASSIVE
Definition: Unit.h:548
@ UNIT_FLAG_NOT_SELECTABLE
Definition: UnitDefines.h:254
void DespawnEntry(uint32 entry)
Definition: ScriptedCreature.cpp:54
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition: Creature.h:94
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:2366
void SetFaction(uint32 faction)
Definition: Unit.cpp:10056
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4129
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:1038
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:713
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition: Unit.cpp:10403
bool _phaseTwo
Definition: boss_algalon_the_observer.cpp:284

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

◆ DoAction()

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

Reimplemented from UnitAI.

411 {
412 switch (action)
413 {
415 {
416 me->SetImmuneToPC(true);
418 me->SetDisableGravity(true);
419 me->CastSpell(me, SPELL_ARRIVAL, true);
425 init.SetOrientationFixed(true);
426 init.Launch();
427 events.Reset();
428 events.SetPhase(PHASE_ROLE_PLAY);
429 events.ScheduleEvent(EVENT_INTRO_1, 5s, 0, PHASE_ROLE_PLAY);
430 events.ScheduleEvent(EVENT_INTRO_2, 15s, 0, PHASE_ROLE_PLAY);
431 events.ScheduleEvent(EVENT_INTRO_3, 23s, 0, PHASE_ROLE_PLAY);
432 events.ScheduleEvent(EVENT_INTRO_FINISH, 36s, 0, PHASE_ROLE_PLAY);
433 break;
434 }
436 _fightWon = true;
437 events.Reset();
439 events.SetPhase(PHASE_ROLE_PLAY);
440 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_1, 5s);
441 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_2, 17s);
442 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_3, 26s);
443 if (me->IsInCombat())
444 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_4, 26s);
445 events.ScheduleEvent(EVENT_DESPAWN_ALGALON_5, 32s);
446 me->DespawnOrUnsummon(39000);
447
449 me->AttackStop();
453 if (m_pInstance)
455 break;
457 _firstPull = false;
458 _fedOnTears = false;
459 me->SetImmuneToPC(false);
460 break;
461 case ACTION_ASCEND:
463 events.SetPhase(PHASE_BIG_BANG);
464 events.ScheduleEvent(EVENT_ASCEND_TO_THE_HEAVENS, 1500ms);
465 break;
467 _fedOnTears = false;
468 }
469 }
Position const AlgalonLandPos
Definition: ulduar.h:314
@ ACTION_DESPAWN_ALGALON
Definition: ulduar.h:286
@ ACTION_FEEDS_ON_TEARS_FAILED
Definition: ulduar.h:284
@ ACTION_INIT_ALGALON
Definition: ulduar.h:285
@ TYPE_ALGALON
Definition: ulduar.h:45
@ 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
@ NOT_STARTED
Definition: InstanceScript.h:57
@ UNIT_FLAG2_DO_NOT_FADE_IN
Definition: UnitDefines.h:273
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:336
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Enable or disable the creature's fly mode by adding or removing: MOVEMENTFLAG_FLYING....
Definition: Creature.cpp:3205
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2178
float GetPositionZ() const
Definition: Position.h:118
float GetPositionX() const
Definition: Position.h:116
float GetPositionY() const
Definition: Position.h:117
MotionMaster * GetMotionMaster()
Definition: Unit.h:1620
void SetUnitFlag2(UnitFlags2 flags)
Definition: Unit.h:719
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:1167
void SetImmuneToPC(bool apply, bool keepCombat=false)
Definition: Unit.cpp:13611
bool IsInCombat() const
Definition: Unit.h:884
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:213
Definition: MoveSplineInit.h:71

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

Referenced by EnterEvadeMode(), and IsInRoom().

◆ DoCheckHeraldOfTheTitans()

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

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

Referenced by JustEngagedWith(), and UpdateAI().

◆ EnterEvadeMode()

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

Reimplemented from CreatureAI.

356 {
357 if (_fightWon)
358 return;
359
360 if (SelectTargetFromPlayerList(120.0f))
361 {
363 return;
364 }
365 else if (events.GetPhaseMask() & PHASE_NORMAL)
366 {
368 return;
369 }
370
371 if (m_pInstance)
373
375 }
@ PHASE_NORMAL
Definition: boss_algalon_the_observer.cpp:159
@ FAIL
Definition: InstanceScript.h:59
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:208
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition: ScriptedCreature.cpp:571
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition: Creature.cpp:2811
void DoAction(int32 action) override
Definition: boss_algalon_the_observer.cpp:410

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

Referenced by JustEngagedWith().

◆ GetData()

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

Reimplemented from UnitAI.

331 {
332 if (param == DATA_HAS_FED_ON_TEARS)
333 return _fedOnTears;
334 if (param == DATA_HERALD_OF_THE_TITANS)
335 return _heraldOfTheTitans;
336 return 0;
337 }
@ 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::boss_algalon_the_observerAI::IsInRoom ( )
inline
629 {
630 if (me->GetExactDist2d(&me->GetHomePosition()) > 45.f || me->GetPositionZ() < 410.f)
631 {
633 return false;
634 }
635
636 return true;
637 }
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:338
float GetExactDist2d(const float x, const float y) const
Definition: Position.h:165

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

Referenced by UpdateAI().

◆ IsValidHeraldItem()

bool boss_algalon_the_observer::boss_algalon_the_observerAI::IsValidHeraldItem ( ItemTemplate const *  item)
inline
289 {
290 if (!item) // should not happen, but checked in GetAverageItemLevel()
291 return true;
292 if (item->ItemLevel <= 226 || (item->ItemLevel <= 232 && (
293 item->InventoryType == INVTYPE_SHIELD ||
294 item->Class == ITEM_CLASS_WEAPON ||
295 (item->Class == ITEM_CLASS_ARMOR && (item->InventoryType == INVTYPE_RELIC || item->InventoryType == INVTYPE_HOLDABLE))
296 )))
297 return true;
298 return false;
299 }
@ 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::boss_algalon_the_observerAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

477 {
478 if (_fightWon)
479 return;
480
481 if (!m_pInstance)
482 {
484 return;
485 }
486
487 uint32 introDelay = 0;
488 me->setActive(true);
491 me->SetImmuneToNPC(true);
492 events.Reset();
493 events.SetPhase(PHASE_ROLE_PLAY);
494
495 if (!_firstPull)
496 {
497 events.ScheduleEvent(EVENT_START_COMBAT, 0ms);
498 introDelay = 8000;
499 }
500 else
501 {
503 _firstPull = false;
505 introDelay = 22000;
506 events.ScheduleEvent(EVENT_START_COMBAT, 14s);
508 }
509
510 events.ScheduleEvent(EVENT_REMOVE_UNNATTACKABLE, introDelay - 500);
511 events.ScheduleEvent(EVENT_INTRO_TIMER_DONE, introDelay);
512 events.ScheduleEvent(EVENT_QUANTUM_STRIKE, 3500 + introDelay);
513 events.ScheduleEvent(EVENT_PHASE_PUNCH, 15500 + introDelay);
514 events.ScheduleEvent(EVENT_SUMMON_COLLAPSING_STAR, 16500 + introDelay);
515 events.ScheduleEvent(EVENT_COSMIC_SMASH, 25000 + introDelay);
516 events.ScheduleEvent(EVENT_ACTIVATE_LIVING_CONSTELLATION, 50500 + introDelay);
517 events.ScheduleEvent(EVENT_BIG_BANG, 90000 + introDelay);
518 events.ScheduleEvent(EVENT_ASCEND_TO_THE_HEAVENS, 360000 + introDelay);
519
520 events.ScheduleEvent(EVENT_CHECK_HERALD_ITEMS, 5s);
522 }
@ DATA_DESPAWN_ALGALON
Definition: ulduar.h:91
@ NPC_AZEROTH
Definition: ulduar.h:161
@ 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:93
void setActive(bool isActiveObject)
Definition: Object.cpp:1094
void SetImmuneToNPC(bool apply, bool keepCombat=false)
Definition: Unit.cpp:13620
bool DoCheckHeraldOfTheTitans()
Definition: boss_algalon_the_observer.cpp:301
void EnterEvadeMode(EvadeReason why) override
Definition: boss_algalon_the_observer.cpp:355

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

◆ JustReachedHome()

void boss_algalon_the_observer::boss_algalon_the_observerAI::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

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

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

◆ JustSummoned()

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

Reimplemented from ScriptedAI.

547 {
548 summons.Summon(summon);
549 switch (summon->GetEntry())
550 {
551 case NPC_AZEROTH:
552 me->CastSpell(summon, SPELL_REORIGINATION, true);
553 break;
554 case NPC_BLACK_HOLE:
555 summon->CastSpell((Unit*)nullptr, SPELL_BLACK_HOLE_TRIGGER, true);
556 summon->CastSpell(summon, SPELL_CONSTELLATION_PHASE_TRIGGER, true);
557 summon->CastSpell((Unit*)nullptr, SPELL_BLACK_HOLE_EXPLOSION, false);
558 summon->CastSpell(summon, SPELL_SUMMON_VOID_ZONE_VISUAL, true);
559 break;
561 summon->CastSpell(summon, SPELL_VOID_ZONE_VISUAL, true);
562 break;
564 summon->CastSpell(summon, SPELL_COSMIC_SMASH_VISUAL_STATE, true);
565 break;
567 {
568 float x = summon->GetPositionX();
569 float y = summon->GetPositionY();
570 float z = summon->GetPositionZ() + 35.0f;
571 float o = summon->GetOrientation();
572
573 summon->GetMotionMaster()->Clear();
574 summon->SetHomePosition(x, y, z, o);
575 summon->UpdatePosition(x, y, z, o, true);
576 summon->StopMovingOnCurrentPos();
577 summon->m_Events.AddEvent(new CosmicSmashDamageEvent(summon), summon->m_Events.CalculateTime(4000));
578 break;
579 }
581 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
582 if (summon->Attack(target, true))
583 summon->GetMotionMaster()->MoveChase(target);
584 break;
585 }
586 }
@ NPC_ALGALON_STALKER_ASTEROID_TARGET_01
Definition: ulduar.h:168
@ NPC_UNLEASHED_DARK_MATTER
Definition: ulduar.h:170
@ NPC_ALGALON_STALKER_ASTEROID_TARGET_02
Definition: ulduar.h:169
@ 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
void AddEvent(BasicEvent *Event, uint64 e_time, bool set_addtime=true)
Definition: EventProcessor.h:103
uint64 CalculateTime(uint64 t_offset) const
Definition: EventProcessor.cpp:159
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88
EventProcessor m_Events
Definition: Object.h:642
float GetOrientation() const
Definition: Position.h:119
Definition: Unit.h:630
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition: Unit.cpp:20025
bool Attack(Unit *victim, bool meleeAttack)
Definition: Unit.cpp:10272
void StopMovingOnCurrentPos()
Definition: Unit.cpp:16689
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:313
void Clear(bool reset=true)
Definition: MotionMaster.h:167
Definition: boss_algalon_the_observer.cpp:247

References EventProcessor::AddEvent(), Unit::Attack(), EventProcessor::CalculateTime(), 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, UnitAI::SelectTarget(), Creature::SetHomePosition(), SPELL_BLACK_HOLE_EXPLOSION, SPELL_BLACK_HOLE_TRIGGER, SPELL_CONSTELLATION_PHASE_TRIGGER, SPELL_COSMIC_SMASH_VISUAL_STATE, SPELL_REORIGINATION, SPELL_SUMMON_VOID_ZONE_VISUAL, SPELL_VOID_ZONE_VISUAL, Unit::StopMovingOnCurrentPos(), SummonList::Summon(), summons, and Unit::UpdatePosition().

◆ KilledUnit()

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

Reimplemented from ScriptedAI.

403 {
404 if (!victim->IsPlayer() || urand(0, 2))
405 return;
406
408 }
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:200

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

◆ MovementInform()

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

Reimplemented from ScriptedAI.

525 {
526 if (movementType != POINT_MOTION_TYPE)
527 return;
528
529 if (pointId == POINT_ALGALON_LAND)
530 me->SetDisableGravity(false);
531 else if (pointId == POINT_ALGALON_OUTRO)
532 {
533 me->SetFacingTo(1.605703f);
534 events.ScheduleEvent(EVENT_OUTRO_3, 1200ms);
535 events.ScheduleEvent(EVENT_OUTRO_4, 2400ms);
536 events.ScheduleEvent(EVENT_OUTRO_5, 8500ms);
537 events.ScheduleEvent(EVENT_OUTRO_6, 15s + 500ms);
538 events.ScheduleEvent(EVENT_OUTRO_7, 55s + 500ms);
539 events.ScheduleEvent(EVENT_OUTRO_8, 73s + 500ms);
540 events.ScheduleEvent(EVENT_OUTRO_9, 85s + 500ms);
541 events.ScheduleEvent(EVENT_OUTRO_10, 101s + 500ms);
542 events.ScheduleEvent(EVENT_OUTRO_11, 117s + 500ms);
543 }
544 }
@ 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
@ POINT_MOTION_TYPE
Definition: MotionMaster.h:48
void SetFacingTo(float ori)
Definition: Unit.cpp:20527

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

◆ Reset()

void boss_algalon_the_observer::boss_algalon_the_observerAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

378 {
379 if (_fightWon)
380 return;
381
382 events.Reset();
385 me->SetImmuneToPC(false);
387 me->SetFaction(190);
389
390 _phaseTwo = false;
391 _heraldOfTheTitans = true;
392
394 {
395 _firstPull = false;
396 }
397
398 if (m_pInstance)
400 }
@ SPELL_DUAL_WIELD
Definition: boss_algalon_the_observer.cpp:49
@ SHEATH_STATE_UNARMED
Definition: UnitDefines.h:105
virtual void SetSheath(SheathState sheathed)
Definition: Unit.h:1639
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51

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

◆ UpdateAI()

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

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

Reimplemented from ScriptedAI.

640 {
641 if (!(events.GetPhaseMask() & PHASE_MASK_NO_UPDATE) && (!UpdateVictim() || !IsInRoom()))
642 return;
643
644 events.Update(diff);
646 return;
647
648 switch (events.ExecuteEvent())
649 {
650 case EVENT_INTRO_1:
653 break;
654 case EVENT_INTRO_2:
655 me->CastSpell((Unit*)nullptr, SPELL_SUMMON_AZEROTH, true);
657 break;
658 case EVENT_INTRO_3:
660 break;
662 events.Reset();
663 me->SetImmuneToPC(false);
665 brann->AI()->DoAction(ACTION_FINISH_INTRO);
666 break;
670 break;
674 me->SetImmuneToNPC(false);
675 break;
677 events.SetPhase(PHASE_NORMAL);
678 me->CastSpell((Unit*)nullptr, SPELL_SUPERMASSIVE_FAIL, true);
679 // Hack: _IsValidTarget failed earlier due to flags, call AttackStart again
682 if (Player* target = SelectTargetFromPlayerList(150.0f))
683 AttackStart(target);
685
686 for (uint32 i = 0; i < LIVING_CONSTELLATION_COUNT; ++i)
688 break;
691 events.Repeat(3000ms, 4500ms);
692 break;
695 events.Repeat(15s + 500ms);
696 break;
700 for (uint8 i = 0; i < COLLAPSING_STAR_COUNT; ++i)
702 events.Repeat(1min);
703 break;
707 events.Repeat(25s + 500ms);
708 break;
710 {
711 if (events.GetPhaseMask() & PHASE_MASK_NO_UPDATE)
712 {
713 events.Repeat(4s);
714 break;
715 }
717 //me->CastSpell(me, SPELL_TRIGGER_3_ADDS, true);
718 events.Repeat(50s);
719 break;
720 }
721 case EVENT_BIG_BANG:
722 {
725
728
729 me->CastSpell((Unit*)nullptr, SPELL_BIG_BANG, false);
730 events.Repeat(90s + 500ms);
731 break;
732 }
735 me->CastSpell((Unit*)nullptr, SPELL_ASCEND_TO_THE_HEAVENS, false);
736 events.ScheduleEvent(EVENT_EVADE, 2500ms);
737 break;
738 case EVENT_EVADE:
739 events.Reset();
741 return;
743 if (m_pInstance)
744 {
747 }
748 break;
749 case EVENT_OUTRO_1:
752 break;
753 case EVENT_OUTRO_2:
754 {
755 Player* lootRecipent = me->GetLootRecipient();
757 // LootRecipent is cleared in _EnterEvadeMode, restore it
758 me->SetLootRecipient(lootRecipent);
760 break;
761 }
762 case EVENT_OUTRO_3:
763 me->CastSpell((Unit*)nullptr, SPELL_KILL_CREDIT);
764 // Summon Chest
765 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))
766 {
767 go->ReplaceAllGameObjectFlags((GameObjectFlags)0);
768 go->SetLootRecipient(me);
769 }
770 break;
771 case EVENT_OUTRO_4:
774 break;
775 case EVENT_OUTRO_5:
777 brann->AI()->DoAction(ACTION_OUTRO);
778 break;
779 case EVENT_OUTRO_6:
782 break;
783 case EVENT_OUTRO_7:
785 break;
786 case EVENT_OUTRO_8:
788 break;
789 case EVENT_OUTRO_9:
791 break;
792 case EVENT_OUTRO_10:
794 break;
795 case EVENT_OUTRO_11:
797 me->CastSpell(me, SPELL_TELEPORT, false);
798 me->DespawnOrUnsummon(3000);
799 break;
802 break;
805 break;
808 break;
810 me->CastSpell((Unit*)nullptr, SPELL_ASCEND_TO_THE_HEAVENS, false);
811 break;
814 me->CastSpell(me, SPELL_TELEPORT, false);
815 me->DespawnOrUnsummon(3000);
816 break;
819 events.Repeat(5s);
820 break;
821 }
822
824 }
@ DATA_ALGALON_DEFEATED
Definition: ulduar.h:92
@ GO_ALGALON_CHEST
Definition: ulduar.h:190
@ GO_ALGALON_CHEST_HERO
Definition: ulduar.h:191
@ NPC_BRANN_BRONZBEARD_ALG
Definition: ulduar.h:160
@ 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
@ SPELL_TELEPORT
Definition: karazhan.cpp:48
GameObjectFlags
Definition: SharedDefines.h:1602
@ FACTION_MONSTER
Definition: SharedDefines.h:195
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ DONE
Definition: InstanceScript.h:60
@ SPELLVALUE_MAX_TARGETS
Definition: SpellDefines.h:117
@ TEMPSUMMON_DEAD_DESPAWN
Definition: Object.h:52
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:48
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition: Object.h:51
@ REACT_AGGRESSIVE
Definition: Unit.h:550
@ UNIT_STAND_STATE_KNEEL
Definition: UnitDefines.h:40
@ UNIT_STAND_STATE_STAND
Definition: UnitDefines.h:32
@ SHEATH_STATE_MELEE
Definition: UnitDefines.h:106
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
@ UNIT_FLAG_RENAME
Definition: UnitDefines.h:233
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
bool _EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:303
bool UpdateVictim()
Definition: CreatureAI.cpp:280
void DoAction(int32 info, uint16 max=0)
Definition: ScriptedCreature.h:102
Definition: ScriptedCreature.h:167
const T & RAID_MODE(const T &normal10, const T &normal25) const
Definition: ScriptedCreature.h:404
void SetLootRecipient(Unit *unit, bool withGroup=true)
Definition: Creature.cpp:1320
Player * GetLootRecipient() const
Definition: Creature.cpp:1306
Definition: GameObject.h:120
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:2380
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:1224
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4909
Unit * GetVictim() const
Definition: Unit.h:853
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
void RemoveAllAuras()
Definition: Unit.cpp:5319
void SetStandState(uint8 state)
Definition: Unit.cpp:16726
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:714
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:98
void AttackStart(Unit *who) override
Definition: boss_algalon_the_observer.cpp:323
void CallConstellations()
Definition: boss_algalon_the_observer.cpp:339
bool IsInRoom()
Definition: boss_algalon_the_observer.cpp:628

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

Member Data Documentation

◆ _fedOnTears

bool boss_algalon_the_observer::boss_algalon_the_observerAI::_fedOnTears

◆ _fightWon

bool boss_algalon_the_observer::boss_algalon_the_observerAI::_fightWon

◆ _firstPull

bool boss_algalon_the_observer::boss_algalon_the_observerAI::_firstPull

◆ _heraldOfTheTitans

bool boss_algalon_the_observer::boss_algalon_the_observerAI::_heraldOfTheTitans

◆ _phaseTwo

bool boss_algalon_the_observer::boss_algalon_the_observerAI::_phaseTwo

Referenced by DamageTaken(), and Reset().

◆ events

EventMap boss_algalon_the_observer::boss_algalon_the_observerAI::events

◆ m_pInstance

InstanceScript* boss_algalon_the_observer::boss_algalon_the_observerAI::m_pInstance

◆ summons

SummonList boss_algalon_the_observer::boss_algalon_the_observerAI::summons