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

Public Member Functions

 boss_yoggsaron_sara (Creature *creature)
 
void AttackStart (Unit *) override
 
void MoveInLineOfSight (Unit *) override
 
void JustSummoned (Creature *summon) override
 
void SpawnClouds ()
 
void EnterEvadeMode (EvadeReason why) override
 
void EnableSara (bool apply)
 
void HandleWipeRecovery ()
 
void Reset () override
 
void InitFight (Unit *target)
 
void DespawnGossipKeepers ()
 
void UpdateKeeperSpawns ()
 
void ActivateKeepers ()
 
void InformCloud ()
 
void SpawnTentacle (uint32 entry)
 
void AddPortals ()
 
void KilledUnit (Unit *who) override
 
uint32 GetData (uint32 param) const override
 
void DoAction (int32 param) override
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
bool HasAlivePlayerInIllusion () const
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (Position const *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
Unit * DoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
Player * GetPlayerAtMinimumRange (float minRange)
 
Creature * DoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
T const & DUNGEON_MODE (T const &normal5, T const &heroic10) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25, T const &heroic10, T const &heroic25) const
 
Player * SelectTargetFromPlayerList (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)
 
WorldObject * GetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual bool IsEscortNPC (bool=true) const
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void OnSpellCast (SpellInfo const *)
 
virtual void OnSpellFailed (SpellInfo const *)
 
virtual void OnChannelFinished (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
virtual void JustReachedHome ()
 
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
 
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
Unit * SelectTarget (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 OnDespawn ()
 Called when the unit is about to be removed from the world (despawn, grid unload, corpse disappearing, player logging out etc.)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast.
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true, int32 aura=0)
 Cast the spell on a random unit from the threat list.
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished.
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Public Attributes

InstanceScript * _instance
 
EventMap events
 
SummonList summons
 
uint32 _initFight
 
uint8 _summonedGuardiansCount
 
uint32 _p2TalkTimer
 
bool _secondPhase = false
 
float _summonSpeed
 
uint8 _currentIllusion
 
bool _isIllusionReversed
 
bool _isWipeRecovering = false
 
bool _deathRayAnnounce = true
 
- Public Attributes inherited from ScriptedAI
Creature * me
 

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 AISpellInfoType * AISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
Creature * DoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
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_yoggsaron_sara()

boss_yoggsaron_sara::boss_yoggsaron_sara ( Creature *  creature)
inline
395 : ScriptedAI(creature), summons(creature)
396 {
397 _instance = creature->GetInstanceScript();
398 }
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1247
Definition ScriptedCreature.h:202
SummonList summons
Definition boss_yoggsaron.cpp:402
InstanceScript * _instance
Definition boss_yoggsaron.cpp:400

References _instance, and WorldObject::GetInstanceScript().

Member Function Documentation

◆ ActivateKeepers()

void boss_yoggsaron_sara::ActivateKeepers ( )
inline
587 {
588 for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
589 {
590 Creature* summon = ObjectAccessor::GetCreature(*me, *itr);
591 if (!summon)
592 continue;
593
594 for (uint8 i = KEEPER_FREYA; i <= KEEPER_THORIM; i++)
595 if (summon->GetEntry() == TABLE_KEEPER_ENTRY[i])
597 }
598 }
std::uint8_t uint8
Definition Define.h:109
@ ACTION_ACTIVATE_KEEPER
Definition boss_yoggsaron.cpp:252
const uint32 TABLE_KEEPER_ENTRY[4]
Definition boss_yoggsaron.cpp:314
Definition Creature.h:47
CreatureAI * AI() const
Definition Creature.h:143
uint32 GetEntry() const
Definition Object.h:123
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
Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:234
Creature * me
Definition ScriptedCreature.h:292
@ KEEPER_THORIM
Definition ulduar.h:442
@ KEEPER_FREYA
Definition ulduar.h:439

References ACTION_ACTIVATE_KEEPER, Creature::AI(), SummonList::begin(), UnitAI::DoAction(), SummonList::end(), ObjectAccessor::GetCreature(), Object::GetEntry(), KEEPER_FREYA, KEEPER_THORIM, ScriptedAI::me, summons, and TABLE_KEEPER_ENTRY.

Referenced by InitFight().

◆ AddPortals()

void boss_yoggsaron_sara::AddPortals ( )
inline
634 {
635 _summonSpeed -= 0.1f;
636 Creature* creature = nullptr;
637
638 // Spawn Portals
639 for (uint8 i = 0; i < RAID_MODE(4, 10); ++i)
640 {
642 {
643 creature->SetArmor(_currentIllusion);
644 creature->CastSpell(creature, SPELL_TELEPORT_PORTAL_VISUAL, true);
645 }
646 }
647
650
653 else
655 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:52
@ SPELL_TELEPORT_PORTAL_VISUAL
Definition boss_yoggsaron.cpp:52
static LocationsXY yoggPortalLoc[]
Definition boss_yoggsaron.cpp:316
@ NPC_DESCEND_INTO_MADNESS
Definition boss_yoggsaron.cpp:214
Definition ScriptedCreature.h:179
void DoAction(int32 info, uint16 max=0)
Definition ScriptedCreature.h:113
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:1378
void SetArmor(int32 val)
Definition Unit.h:1172
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2460
float y
Definition boss_yoggsaron.cpp:303
float x
Definition boss_yoggsaron.cpp:303
float z
Definition boss_yoggsaron.cpp:303
T const & RAID_MODE(T const &normal10, T const &normal25) const
Definition ScriptedCreature.h:419
float _summonSpeed
Definition boss_yoggsaron.cpp:408
bool _isIllusionReversed
Definition boss_yoggsaron.cpp:410
uint8 _currentIllusion
Definition boss_yoggsaron.cpp:409
@ NPC_BRAIN_OF_YOGG_SARON
Definition ulduar.h:185

References _currentIllusion, _isIllusionReversed, _summonSpeed, Unit::CastSpell(), SummonList::DoAction(), ScriptedAI::me, NPC_BRAIN_OF_YOGG_SARON, NPC_DESCEND_INTO_MADNESS, ScriptedAI::RAID_MODE(), Unit::SetArmor(), SPELL_TELEPORT_PORTAL_VISUAL, WorldObject::SummonCreature(), summons, TEMPSUMMON_TIMED_DESPAWN, LocationsXY::x, LocationsXY::y, yoggPortalLoc, and LocationsXY::z.

Referenced by UpdateAI().

◆ AttackStart()

void boss_yoggsaron_sara::AttackStart ( Unit *  )
inlineoverridevirtual

Reimplemented from UnitAI.

414{ }

Referenced by InitFight().

◆ DamageTaken()

void boss_yoggsaron_sara::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.

750 {
751 // Guardians can be spawned by walking into Ominous Clouds even when InitFight
752 if (!_instance || _instance->GetBossState(BOSS_YOGGSARON) != IN_PROGRESS || !attacker || attacker->GetEntry() != NPC_GUARDIAN_OF_YS || _secondPhase)
753 {
754 damage = 0;
755 return;
756 }
757
758 // START PHASE 2
759 if (me->GetHealth() <= damage)
760 {
761 _secondPhase = true;
762 // leave her at 1 health through the transformation dialogue, the client treats 0 health as dead
763 damage = me->GetHealth() - 1;
764
765 events.SetPhase(EVENT_PHASE_TWO);
768
770 creature->SetVisible(false);
771
772 _p2TalkTimer++;
774 }
775 }
@ IN_PROGRESS
Definition InstanceScript.h:59
@ FACTION_MONSTER_2
Definition SharedDefines.h:184
events
Definition boss_sartura.cpp:43
@ EVENT_PHASE_TWO
Definition boss_yoggsaron.cpp:285
@ SAY_SARA_TRANSFORM_1
Definition boss_yoggsaron.cpp:339
@ NPC_GUARDIAN_OF_YS
Definition boss_yoggsaron.cpp:202
@ NPC_YOGG_SARON
Definition boss_yoggsaron.cpp:204
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2887
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:252
void SetFaction(uint32 faction)
Definition Unit.cpp:6886
uint32 GetHealth() const
Definition Unit.h:1122
Talk
Definition hyjal.cpp:82
float GetPositionZ() const
Definition Position.h:123
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
uint32 _p2TalkTimer
Definition boss_yoggsaron.cpp:406
bool _secondPhase
Definition boss_yoggsaron.cpp:407
@ BOSS_YOGGSARON
Definition ulduar.h:43

References _instance, _p2TalkTimer, _secondPhase, BOSS_YOGGSARON, EVENT_PHASE_TWO, FACTION_MONSTER_2, InstanceScript::GetBossState(), Object::GetEntry(), Unit::GetHealth(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), IN_PROGRESS, ScriptedAI::me, NPC_GUARDIAN_OF_YS, NPC_YOGG_SARON, SAY_SARA_TRANSFORM_1, Unit::SetFaction(), Creature::SetInCombatWithZone(), and WorldObject::SummonCreature().

◆ DespawnGossipKeepers()

void boss_yoggsaron_sara::DespawnGossipKeepers ( )
inline
561 {
562 static uint32 const gossipData[] =
563 {
566 };
567 for (uint8 i = KEEPER_FREYA; i <= KEEPER_THORIM; i++)
568 if (Creature* keeper = _instance->GetCreature(gossipData[i]))
569 keeper->DespawnOrUnsummon();
570 }
std::uint32_t uint32
Definition Define.h:107
Creature * GetCreature(uint32 type)
Definition InstanceScript.cpp:126
@ DATA_FREYA_GOSSIP
Definition ulduar.h:152
@ DATA_HODIR_GOSSIP
Definition ulduar.h:153
@ DATA_MIMIRON_GOSSIP
Definition ulduar.h:154
@ DATA_THORIM_GOSSIP
Definition ulduar.h:155

References _instance, DATA_FREYA_GOSSIP, DATA_HODIR_GOSSIP, DATA_MIMIRON_GOSSIP, DATA_THORIM_GOSSIP, InstanceScript::GetCreature(), KEEPER_FREYA, and KEEPER_THORIM.

Referenced by InitFight().

◆ DoAction()

void boss_yoggsaron_sara::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

684 {
686 {
688 return;
689 }
690 else if (param == ACTION_BRAIN_DAMAGED)
691 {
693
696
699
700 // Deafening Roar: 25 man with at least one Keeper down
703
706 events.SetPhase(EVENT_PHASE_THREE);
707
709 me->SetVisible(false);
710 return;
711 }
712 else if (param == ACTION_YOGG_SARON_DEATH)
713 {
714 // Despawn everything but Yogg-Saron's corpse
726 voice->AI()->DoAction(ACTION_VOICE_STOP);
727 me->KillSelf();
728 return;
729 }
730
731 // Determine shatter duration
732 if (param <= 0)
733 return;
734
735 // Illusion shatters (param - stun time)
737 {
738 yoggb->AI()->Talk(EMOTE_YOGG_SARON_BRAIN_SHATTERED);
739 }
740
741 Milliseconds timer = events.GetTimeUntilEvent(EVENT_SARA_P2_OPEN_PORTALS);
742 Milliseconds portalTime = (timer > 0ms ? timer : 0ms);
743 events.DelayEvents(Milliseconds(param + 100));
744 events.RescheduleEvent(EVENT_SARA_P2_OPEN_PORTALS, portalTime, 0, EVENT_PHASE_TWO);
747 }
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:27
@ SPELL_SHATTERED_ILLUSION
Definition boss_yoggsaron.cpp:131
@ DATA_GET_KEEPERS_COUNT
Definition boss_yoggsaron.cpp:294
@ ACTION_THORIM_START_STORM
Definition boss_yoggsaron.cpp:268
@ ACTION_YOGG_SARON_DEATH
Definition boss_yoggsaron.cpp:259
@ EVENT_PHASE_THREE
Definition boss_yoggsaron.cpp:286
@ ACTION_VOICE_STOP
Definition boss_yoggsaron.cpp:253
@ ACTION_YOGG_SARON_HARD_MODE
Definition boss_yoggsaron.cpp:266
@ ACTION_DESPAWN_ADDS
Definition boss_yoggsaron.cpp:256
@ ACTION_REMOVE_STUN
Definition boss_yoggsaron.cpp:264
@ ACTION_BRAIN_DAMAGED
Definition boss_yoggsaron.cpp:263
@ ACTION_YOGG_SARON_START_P3
Definition boss_yoggsaron.cpp:265
@ EVENT_SARA_P2_REMOVE_STUN
Definition boss_yoggsaron.cpp:178
@ EVENT_SARA_P2_OPEN_PORTALS
Definition boss_yoggsaron.cpp:177
@ EMOTE_YOGG_SARON_BRAIN_SHATTERED
Definition boss_yoggsaron.cpp:351
@ NPC_DEATH_RAY
Definition boss_yoggsaron.cpp:212
@ NPC_CONSTRICTOR_TENTACLE
Definition boss_yoggsaron.cpp:208
@ NPC_CORRUPTOR_TENTACLE
Definition boss_yoggsaron.cpp:209
@ NPC_SANITY_WELL
Definition boss_yoggsaron.cpp:203
@ NPC_CRUSHER_TENTACLE
Definition boss_yoggsaron.cpp:207
@ NPC_DEATH_ORB
Definition boss_yoggsaron.cpp:213
bool Is25ManRaid() const
Definition Map.h:304
void DespawnEntry(uint32 entry)
Definition ScriptedCreature.cpp:55
void SetVisible(bool x)
Definition Unit.cpp:10916
void RemoveAllAuras()
Definition Unit.cpp:5393
void KillSelf(bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition Unit.h:1252
Map * GetMap() const
Definition Object.h:637
void UpdateKeeperSpawns()
Definition boss_yoggsaron.cpp:572
void DoAction(int32 param) override
Definition boss_yoggsaron.cpp:683
uint32 GetData(uint32 param) const override
Definition boss_yoggsaron.cpp:665
@ ACTION_SARA_UPDATE_SUMMON_KEEPERS
Definition ulduar.h:438
@ DATA_BRAIN_OF_YOGG_SARON
Definition ulduar.h:130
@ DATA_VOICE_OF_YOGG_SARON
Definition ulduar.h:132
@ NPC_FREYA_KEEPER
Definition ulduar.h:218
@ NPC_MIMIRON_KEEPER
Definition ulduar.h:220
@ NPC_HODIR_KEEPER
Definition ulduar.h:219
@ NPC_THORIM_KEEPER
Definition ulduar.h:221

References _instance, ACTION_BRAIN_DAMAGED, ACTION_DESPAWN_ADDS, ACTION_REMOVE_STUN, ACTION_SARA_UPDATE_SUMMON_KEEPERS, ACTION_THORIM_START_STORM, ACTION_VOICE_STOP, ACTION_YOGG_SARON_DEATH, ACTION_YOGG_SARON_HARD_MODE, ACTION_YOGG_SARON_START_P3, Unit::CastSpell(), DATA_BRAIN_OF_YOGG_SARON, DATA_GET_KEEPERS_COUNT, DATA_VOICE_OF_YOGG_SARON, SummonList::DespawnEntry(), SummonList::DoAction(), EMOTE_YOGG_SARON_BRAIN_SHATTERED, EVENT_PHASE_THREE, EVENT_PHASE_TWO, EVENT_SARA_P2_OPEN_PORTALS, EVENT_SARA_P2_REMOVE_STUN, InstanceScript::GetCreature(), GetData(), WorldObject::GetInstanceScript(), WorldObject::GetMap(), Map::Is25ManRaid(), Unit::KillSelf(), ScriptedAI::me, NPC_BRAIN_OF_YOGG_SARON, NPC_CONSTRICTOR_TENTACLE, NPC_CORRUPTOR_TENTACLE, NPC_CRUSHER_TENTACLE, NPC_DEATH_ORB, NPC_DEATH_RAY, NPC_FREYA_KEEPER, NPC_HODIR_KEEPER, NPC_MIMIRON_KEEPER, NPC_SANITY_WELL, NPC_THORIM_KEEPER, NPC_YOGG_SARON, Unit::RemoveAllAuras(), Unit::SetVisible(), SPELL_SHATTERED_ILLUSION, summons, and UpdateKeeperSpawns().

◆ EnableSara()

void boss_yoggsaron_sara::EnableSara ( bool  apply)
inline
449 {
450 if (apply)
451 {
453 me->DisableRotate(false);
455 }
456 else
457 {
459 me->DisableRotate(true);
461 }
462 }
@ UNIT_STATE_ROOT
Definition UnitDefines.h:183
@ UNIT_FLAG_DISABLE_MOVE
Definition UnitDefines.h:259
void ClearUnitState(uint32 f)
Definition Unit.h:743
void AddUnitState(uint32 f)
Definition Unit.h:741
void DisableRotate(bool apply)
Definition Unit.cpp:14217
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:754
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:755

References Unit::AddUnitState(), Unit::ClearUnitState(), Unit::DisableRotate(), ScriptedAI::me, Unit::RemoveUnitFlag(), Unit::SetUnitFlag(), UNIT_FLAG_DISABLE_MOVE, and UNIT_STATE_ROOT.

Referenced by Reset().

◆ EnterEvadeMode()

void boss_yoggsaron_sara::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

436 {
437 if (!_EnterEvadeMode(why))
438 return;
439
440 // NearTeleportTo does not dismount creatures from vehicles
441 me->ExitVehicle();
442 Position pos = me->GetHomePosition();
444
446 }
bool _EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:383
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition Creature.h:349
void NearTeleportTo(Position &pos, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
Definition Unit.cpp:15650
void ExitVehicle(Position const *exitPosition=nullptr)
Definition Unit.cpp:15393
Definition Position.h:27
float GetOrientation() const
Definition Position.h:124
void HandleWipeRecovery()
Definition boss_yoggsaron.cpp:464

References CreatureAI::_EnterEvadeMode(), Unit::ExitVehicle(), Creature::GetHomePosition(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), HandleWipeRecovery(), ScriptedAI::me, and Unit::NearTeleportTo().

Referenced by UpdateAI().

◆ GetData()

uint32 boss_yoggsaron_sara::GetData ( uint32  param) const
inlineoverridevirtual

Reimplemented from UnitAI.

666 {
667 if (param == DATA_GET_KEEPERS_COUNT)
668 {
669 uint8 _count = 0;
670 uint32 watchersMask = _instance->GetPersistentData(
672 for (uint8 i = 0; i < 4; ++i)
673 if (watchersMask & (1 << i))
674 ++_count;
675 return _count;
676 }
677 else if (param == DATA_GET_SARA_PHASE)
678 return _secondPhase;
679
680 return 4; // just to be sure, return max numer of keepers
681 }
@ DATA_GET_SARA_PHASE
Definition boss_yoggsaron.cpp:296
uint32 GetPersistentData(uint32 index) const
Definition InstanceScript.h:260
@ PERSISTENT_DATA_WATCHERS_MASK
Definition ulduar.h:354

References _instance, _secondPhase, DATA_GET_KEEPERS_COUNT, DATA_GET_SARA_PHASE, InstanceScript::GetPersistentData(), and PERSISTENT_DATA_WATCHERS_MASK.

Referenced by DoAction().

◆ HandleWipeRecovery()

void boss_yoggsaron_sara::HandleWipeRecovery ( )
inline
465 {
466 _isWipeRecovering = true;
467 Reset();
468 me->SetVisible(false);
469
473 me->setActive(true);
474 }
@ EVENT_PHASE_WIPE_RECOVERY
Definition boss_yoggsaron.cpp:287
@ EVENT_SARA_WIPE_OPEN_DOOR
Definition boss_yoggsaron.cpp:190
@ EVENT_SARA_WIPE_RESPAWN
Definition boss_yoggsaron.cpp:191
void setActive(bool isActiveObject)
Definition Object.cpp:1091
bool _isWipeRecovering
Definition boss_yoggsaron.cpp:411
void Reset() override
Definition boss_yoggsaron.cpp:476

References _isWipeRecovering, EVENT_PHASE_WIPE_RECOVERY, EVENT_SARA_WIPE_OPEN_DOOR, EVENT_SARA_WIPE_RESPAWN, ScriptedAI::me, Reset(), WorldObject::setActive(), and Unit::SetVisible().

Referenced by EnterEvadeMode().

◆ HasAlivePlayerInIllusion()

bool boss_yoggsaron_sara::HasAlivePlayerInIllusion ( ) const
inline
782 {
783 bool found = false;
784 me->GetMap()->DoForAllPlayers([&](Player* player)
785 {
786 if (found || !player->IsAlive() || player->IsGameMaster() || player->HasAura(SPELL_INSANE1))
787 return;
788 if (player->GetPositionZ() < 300.0f && me->IsWithinDist2d(player, 200.0f))
789 found = true;
790 });
791 return found;
792 }
@ SPELL_INSANE1
Definition boss_yoggsaron.cpp:60
void DoForAllPlayers(std::function< void(Player *)> exec)
Definition Map.cpp:3364
Definition Player.h:1086
bool IsGameMaster() const
Definition Player.h:1178
bool IsAlive() const
Definition Unit.h:1812
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5798
bool IsWithinDist2d(float x, float y, float dist) const
Definition Object.cpp:1364

References Map::DoForAllPlayers(), WorldObject::GetMap(), Position::GetPositionZ(), Unit::HasAura(), Unit::IsAlive(), Player::IsGameMaster(), WorldObject::IsWithinDist2d(), ScriptedAI::me, and SPELL_INSANE1.

Referenced by UpdateAI().

◆ InformCloud()

void boss_yoggsaron_sara::InformCloud ( )
inline
601 {
602 Creature* cloud = nullptr;
603 for (SummonList::const_iterator itr = summons.begin(); itr != summons.end();)
604 {
605 Creature* summon = ObjectAccessor::GetCreature(*me, *itr);
606 ++itr;
607 if (!summon || summon->GetEntry() != NPC_OMINOUS_CLOUD || me->GetDistance(summon) < 20)
608 continue;
609
610 if ((!cloud || (urand(0, 1) && !summon->HasAura(SPELL_SUMMON_GUARDIAN_OF_YS))))
611 cloud = summon;
612 }
613
614 if (cloud)
616 }
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ SPELL_SUMMON_GUARDIAN_OF_YS
Definition boss_yoggsaron.cpp:59
@ ACTION_START_SUMMONING
Definition boss_yoggsaron.cpp:257
@ NPC_OMINOUS_CLOUD
Definition boss_yoggsaron.cpp:201
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1304

References ACTION_START_SUMMONING, Creature::AI(), SummonList::begin(), UnitAI::DoAction(), SummonList::end(), ObjectAccessor::GetCreature(), WorldObject::GetDistance(), Object::GetEntry(), Unit::HasAura(), ScriptedAI::me, NPC_OMINOUS_CLOUD, SPELL_SUMMON_GUARDIAN_OF_YS, summons, and urand().

Referenced by UpdateAI().

◆ InitFight()

void boss_yoggsaron_sara::InitFight ( Unit *  target)
inline
533 {
534 if (!_instance)
535 return;
536
540 AttackStart(target);
541
544
546 voice->AI()->DoAction(ACTION_VOICE_START);
547
548 // Keepers are friendly to players and never enter combat, activate them directly
550
551 events.ScheduleEvent(EVENT_SARA_P1_DOORS_CLOSE, 15s, 0, EVENT_PHASE_ONE);
552 events.ScheduleEvent(EVENT_SARA_P1_BERSERK, 15min, 0, 0);
553 events.ScheduleEvent(EVENT_SARA_P1_SUMMON, 0ms, 0, EVENT_PHASE_ONE);
554 events.SetPhase(EVENT_PHASE_ONE);
555
557 me->setActive(true);
558 }
@ ACHIEVEMENT_TIMED_TYPE_EVENT
Definition DBCEnums.h:110
@ ACTION_VOICE_START
Definition boss_yoggsaron.cpp:254
@ CRITERIA_NOT_GETTING_OLDER
Definition boss_yoggsaron.cpp:289
@ EVENT_PHASE_ONE
Definition boss_yoggsaron.cpp:284
@ EVENT_SARA_P1_SUMMON
Definition boss_yoggsaron.cpp:165
@ EVENT_SARA_P1_DOORS_CLOSE
Definition boss_yoggsaron.cpp:164
@ EVENT_SARA_P1_BERSERK
Definition boss_yoggsaron.cpp:167
@ SAY_SARA_AGGRO
Definition boss_yoggsaron.cpp:335
virtual bool SetBossState(uint32 id, EncounterState state)
Definition InstanceScript.cpp:406
void DoStartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition InstanceScript.cpp:689
void DoZoneInCombat(uint32 entry=0)
Definition ScriptedCreature.cpp:41
void ActivateKeepers()
Definition boss_yoggsaron.cpp:586
void DespawnGossipKeepers()
Definition boss_yoggsaron.cpp:560
void AttackStart(Unit *) override
Definition boss_yoggsaron.cpp:414

References _instance, ACHIEVEMENT_TIMED_TYPE_EVENT, ACTION_VOICE_START, ActivateKeepers(), AttackStart(), BOSS_YOGGSARON, CRITERIA_NOT_GETTING_OLDER, DATA_VOICE_OF_YOGG_SARON, DespawnGossipKeepers(), InstanceScript::DoStartTimedAchievement(), SummonList::DoZoneInCombat(), EVENT_PHASE_ONE, EVENT_SARA_P1_BERSERK, EVENT_SARA_P1_DOORS_CLOSE, EVENT_SARA_P1_SUMMON, InstanceScript::GetCreature(), IN_PROGRESS, ScriptedAI::me, SAY_SARA_AGGRO, WorldObject::setActive(), InstanceScript::SetBossState(), Creature::SetInCombatWithZone(), and summons.

Referenced by UpdateAI().

◆ JustSummoned()

void boss_yoggsaron_sara::JustSummoned ( Creature *  summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

418 {
419 summons.Summon(summon);
420
421 // Sniffed: the yell accompanies every other Death Ray cast, starting with the first
422 if (summon->GetEntry() == NPC_DEATH_ORB)
423 {
427 }
428 }
@ SAY_SARA_DEATH_RAY
Definition boss_yoggsaron.cpp:343
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88
bool _deathRayAnnounce
Definition boss_yoggsaron.cpp:412

References _deathRayAnnounce, Object::GetEntry(), NPC_DEATH_ORB, SAY_SARA_DEATH_RAY, SummonList::Summon(), and summons.

◆ KilledUnit()

void boss_yoggsaron_sara::KilledUnit ( Unit *  who)
inlineoverridevirtual

Reimplemented from CreatureAI.

658 {
659 if (who->IsPlayer())
660 {
662 }
663 }
@ SAY_SARA_KILL
Definition boss_yoggsaron.cpp:338
bool IsPlayer() const
Definition Object.h:207

References Object::IsPlayer(), and SAY_SARA_KILL.

◆ MoveInLineOfSight()

void boss_yoggsaron_sara::MoveInLineOfSight ( Unit *  )
inlineoverridevirtual

Reimplemented from CreatureAI.

415{ }

◆ Reset()

void boss_yoggsaron_sara::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

477 {
478 // Whisper only on a real phase 1 wipe, not on the initial reset
480 {
482 {
483 me->GetMap()->DoForAllPlayers([&](Player* player)
484 {
485 voice->AI()->Talk(WHISPER_VOICE_PHASE_1_WIPE, player);
486 });
487 }
488 }
489
491 events.Reset();
493
495 {
496 me->SetVisible(true);
497 SpawnClouds();
499 }
500
502 me->SetDisableGravity(true);
504 me->SetFullHealth();
506 EnableSara(false);
507
508 _initFight = 1;
510 _p2TalkTimer = 0;
511 _secondPhase = false;
512 _deathRayAnnounce = true;
513 _summonSpeed = 1.0f;
514 _currentIllusion = urand(1, 3);
516
517 if (_instance)
518 {
522 voice->AI()->DoAction(ACTION_VOICE_STOP);
524 {
527 go->SetGoState(GO_STATE_ACTIVE);
528 }
529 }
530 }
@ GO_STATE_ACTIVE
Definition GameObjectData.h:708
@ NOT_STARTED
Definition InstanceScript.h:58
@ FACTION_FRIENDLY
Definition SharedDefines.h:189
@ UNIT_STATE_EVADE
Definition UnitDefines.h:194
@ SPELL_SANITY
Definition boss_yoggsaron.cpp:56
@ WHISPER_VOICE_PHASE_1_WIPE
Definition boss_yoggsaron.cpp:347
Definition GameObject.h:125
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition InstanceScript.cpp:707
GameObject * GetGameObject(uint32 type)
Definition InstanceScript.cpp:131
void DoStopTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition InstanceScript.cpp:698
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:72
void SetFullHealth()
Definition Unit.h:1140
virtual void SetDisplayId(uint32 modelId, std::optional< float > displayScale={})
Definition Unit.cpp:12837
uint32 GetNativeDisplayId() const
Definition Unit.h:1998
void SetDisableGravity(bool disable)
Definition Unit.cpp:16208
void EnableSara(bool apply)
Definition boss_yoggsaron.cpp:448
void SpawnClouds()
Definition boss_yoggsaron.cpp:430
uint32 _initFight
Definition boss_yoggsaron.cpp:404
uint8 _summonedGuardiansCount
Definition boss_yoggsaron.cpp:405
@ DATA_YOGG_SARON_DOORS
Definition ulduar.h:131

References _currentIllusion, _deathRayAnnounce, _initFight, _instance, _isIllusionReversed, _isWipeRecovering, _p2TalkTimer, _secondPhase, _summonedGuardiansCount, _summonSpeed, ACHIEVEMENT_TIMED_TYPE_EVENT, ACTION_DESPAWN_ADDS, ACTION_VOICE_STOP, BOSS_YOGGSARON, Unit::ClearUnitState(), CRITERIA_NOT_GETTING_OLDER, DATA_VOICE_OF_YOGG_SARON, DATA_YOGG_SARON_DOORS, SummonList::DespawnAll(), SummonList::DoAction(), Map::DoForAllPlayers(), InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), InstanceScript::DoStopTimedAchievement(), EnableSara(), FACTION_FRIENDLY, InstanceScript::GetBossState(), InstanceScript::GetCreature(), InstanceScript::GetGameObject(), WorldObject::GetMap(), Unit::GetNativeDisplayId(), GO_STATE_ACTIVE, IN_PROGRESS, ScriptedAI::me, NOT_STARTED, InstanceScript::SetBossState(), Unit::SetDisableGravity(), Unit::SetDisplayId(), Unit::SetFaction(), Unit::SetFullHealth(), Unit::SetVisible(), SpawnClouds(), SPELL_SANITY, summons, UNIT_STATE_EVADE, UpdateKeeperSpawns(), urand(), and WHISPER_VOICE_PHASE_1_WIPE.

Referenced by HandleWipeRecovery().

◆ SpawnClouds()

void boss_yoggsaron_sara::SpawnClouds ( )
inline
431 {
433 }
@ SUMMON_GROUP_CLOUDS
Definition boss_yoggsaron.cpp:280
void SummonCreatureGroup(uint8 group, std::list< TempSummon * > *list=nullptr)
Definition Object.cpp:2537

References ScriptedAI::me, SUMMON_GROUP_CLOUDS, and WorldObject::SummonCreatureGroup().

Referenced by Reset(), and UpdateAI().

◆ SpawnTentacle()

void boss_yoggsaron_sara::SpawnTentacle ( uint32  entry)
inline
619 {
620 uint32 dist = urand(38, 48);
621 float o = rand_norm() * M_PI * 2;
622 float spawnX = me->GetPositionX() + dist * cos(o);
623 float spawnY = me->GetPositionY() + dist * std::sin(o);
624 float spawnZ = me->GetMap()->GetHeight(me->GetPhaseMask(), spawnX, spawnY, 330.0f);
625 if (Creature* cr = me->SummonCreature(entry, spawnX, spawnY, spawnZ, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
626 {
627 cr->CastSpell(cr, SPELL_TENTACLE_ERUPT, true);
628 cr->CastSpell(cr, SPELL_VOID_ZONE_SMALL, true);
629 cr->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
630 }
631 }
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:55
double rand_norm()
Definition Random.cpp:85
@ EMOTE_ONESHOT_EMERGE
Definition SharedDefines.h:2047
@ SPELL_TENTACLE_ERUPT
Definition boss_yoggsaron.cpp:106
@ SPELL_VOID_ZONE_SMALL
Definition boss_yoggsaron.cpp:104
float GetHeight(float x, float y, float z, bool checkVMap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
Definition Map.cpp:1188
uint32 GetPhaseMask() const
Definition Object.h:523

References EMOTE_ONESHOT_EMERGE, Map::GetHeight(), WorldObject::GetMap(), WorldObject::GetPhaseMask(), Position::GetPositionX(), Position::GetPositionY(), ScriptedAI::me, rand_norm(), SPELL_TENTACLE_ERUPT, SPELL_VOID_ZONE_SMALL, WorldObject::SummonCreature(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, and urand().

Referenced by UpdateAI().

◆ UpdateAI()

void boss_yoggsaron_sara::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

795 {
797 {
798 events.Update(diff);
799 while (uint32 eventId = events.ExecuteEvent())
800 {
801 switch (eventId)
802 {
804 if (_instance)
806 go->SetGoState(GO_STATE_ACTIVE);
807 break;
809 if (_instance)
810 {
812 go->SetGoState(GO_STATE_ACTIVE);
813
815 }
816
817 me->SetVisible(true);
818 SpawnClouds();
820 events.Reset();
821 _isWipeRecovering = false;
822 me->setActive(false);
823 break;
824 }
825 }
826 return;
827 }
828
829 if (_initFight)
830 {
831 _initFight += diff;
832 if (_initFight > 5000)
833 {
834 if (Unit* target = SelectTargetFromPlayerList(90))
835 {
836 _initFight = 0;
837 InitFight(target);
838 }
839 else
840 _initFight = 1;
841 }
842 return;
843 }
844
846 {
849 return;
850 }
851
852 if (_p2TalkTimer)
853 {
854 _p2TalkTimer += diff;
855 if (_p2TalkTimer >= 4000 && _p2TalkTimer < 20000)
856 {
860 _p2TalkTimer = 20000;
861 }
862 else if (_p2TalkTimer >= 25000 && _p2TalkTimer < 40000)
863 {
866 _p2TalkTimer = 40000;
867 }
868 else if (_p2TalkTimer >= 44500 && _p2TalkTimer < 60000)
869 {
871 _p2TalkTimer = 60000;
872 }
873 else if (_p2TalkTimer >= 64000)
874 {
877 _p2TalkTimer = 0;
878 events.ScheduleEvent(EVENT_SARA_P2_START, 500ms, 0, EVENT_PHASE_TWO);
879 }
880 return;
881 }
882
883 events.Update(diff);
885 return;
886
887 switch (events.ExecuteEvent())
888 {
890 if (_instance)
892 go->SetGoState(GO_STATE_READY);
893
894 events.ScheduleEvent(EVENT_SARA_P1_SPELLS, 0ms, 1, EVENT_PHASE_ONE);
895 break;
897 events.Repeat(Milliseconds(20000 - (std::min(_summonedGuardiansCount, (uint8)5) * 2000)));
899 InformCloud();
900 break;
902 {
904 if (urand(0, 2))
905 {
907 {
909 }
910 else if (spell == SPELL_SARAS_FAVOR_TARGET_SELECTOR)
911 {
913 }
914 }
915
916 me->CastCustomSpell(spell, SPELLVALUE_MAX_TARGETS, 1, nullptr, false);
917 // Sniffed: steady ~4.9s start-to-start, the 4s cast plus a ~1s gap
918 events.Repeat(4900ms);
919 break;
920 }
922 {
926
927 // Spawn Brain!
928 me->SummonCreature(NPC_BRAIN_OF_YOGG_SARON, 1981.3f, -25.43f, 265);
929 break;
930 }
933 events.Repeat(20s);
934 break;
936 if ((urand(0, 9)) == 0) // Rarely said (as it's casted every 3.5s)
937 {
939 }
941 events.Repeat(3500ms);
942 break;
944 // Sniffed: the Death Orb is summoned 3 yd above Sara's head
946 events.Repeat(22s);
947 break;
948 case EVENT_SARA_P2_SUMMON_T1: // CRUSHER
950 events.Repeat(Milliseconds(uint32((50000 + urand(0, 10000)) * _summonSpeed)));
951 break;
952 case EVENT_SARA_P2_SUMMON_T2: // CONSTRICTOR
954 events.Repeat(Milliseconds(uint32((15000 + urand(0, 5000))* _summonSpeed)));
955 break;
956 case EVENT_SARA_P2_SUMMON_T3: // CORRUPTOR
958 events.Repeat(Milliseconds(uint32((30000 + urand(0, 10000))* _summonSpeed)));
959 break;
962 events.Repeat(30s);
963 break;
965 {
966 AddPortals();
969 events.Repeat(80s);
970 break;
971 }
973 {
976 break;
977 }
979 {
980 me->SetFullHealth();
981 me->SetOrientation(M_PI);
983
984 // Sniffed: Sara rides Yogg-Saron's vehicle for the rest of the fight
987
991
992 // Sniffed: Psychosis opens with the tentacle wave, Malady follows at 12s, Death Ray at 20s.
993 // Brain Link at 18s comes from OG/Classic references (needs two players, absent from solo sniffs)
994 events.ScheduleEvent(EVENT_SARA_P2_MALADY, 12s, 0, EVENT_PHASE_TWO);
995 events.ScheduleEvent(EVENT_SARA_P2_PSYCHOSIS, 0ms, 0, EVENT_PHASE_TWO);
996 events.ScheduleEvent(EVENT_SARA_P2_DEATH_RAY, 20s, 0, EVENT_PHASE_TWO);
997 events.ScheduleEvent(EVENT_SARA_P2_SUMMON_T1, 50s, 60s, 0, EVENT_PHASE_TWO);
998 events.ScheduleEvent(EVENT_SARA_P2_SUMMON_T2, 15s, 20s, 0, EVENT_PHASE_TWO);
999 events.ScheduleEvent(EVENT_SARA_P2_SUMMON_T3, 30s + randtime(0ms, 10s), 0, EVENT_PHASE_TWO);
1000 events.ScheduleEvent(EVENT_SARA_P2_BRAIN_LINK, 18s, 0, EVENT_PHASE_TWO);
1001 events.ScheduleEvent(EVENT_SARA_P2_OPEN_PORTALS, 60s, 0, EVENT_PHASE_TWO);
1002 break;
1003 }
1005 if (me->GetInstanceScript())
1006 {
1008 {
1009 yogg->AI()->Talk(EMOTE_YOGG_SARON_BERSERK);
1010 }
1011 }
1013 events.Repeat(5s);
1014 break;
1015 }
1016 }
static First const & RAND(First const &first, Second const &second, Rest const &... rest)
Definition CreatureAIImpl.h:25
@ GO_STATE_READY
Definition GameObjectData.h:709
Milliseconds randtime(Milliseconds min, Milliseconds max)
Definition Random.cpp:64
@ SPELLVALUE_MAX_TARGETS
Definition SpellDefines.h:125
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ SPELL_DEATH_RAY
Definition boss_yoggsaron.cpp:88
@ SPELL_SARAS_FAVOR_TARGET_SELECTOR
Definition boss_yoggsaron.cpp:66
@ SPELL_EXTINGUISH_ALL_LIFE
Definition boss_yoggsaron.cpp:57
@ SPELL_MALADY_OF_THE_MIND
Definition boss_yoggsaron.cpp:82
@ SPELL_BRAIN_LINK
Definition boss_yoggsaron.cpp:84
@ SPELL_SARA_PSYCHOSIS_10
Definition boss_yoggsaron.cpp:80
@ SPELL_SARAS_ANGER_TARGET_SELECTOR
Definition boss_yoggsaron.cpp:70
@ SPELL_CONSTRICTOR_TENTACLE
Definition boss_yoggsaron.cpp:115
@ SPELL_RIDE_YOGG_SARON_VEHICLE
Definition boss_yoggsaron.cpp:79
@ SPELL_SARAS_BLESSING_TARGET_SELECTOR
Definition boss_yoggsaron.cpp:68
@ ACTION_YOGG_SARON_START_YELL
Definition boss_yoggsaron.cpp:260
@ ACTION_YOGG_SARON_APPEAR
Definition boss_yoggsaron.cpp:258
@ ACTION_UNSUMMON_CLOUDS
Definition boss_yoggsaron.cpp:255
@ ACTION_YOGG_SARON_OPEN_PORTAL_YELL
Definition boss_yoggsaron.cpp:261
@ EVENT_SARA_P2_PSYCHOSIS
Definition boss_yoggsaron.cpp:176
@ EVENT_SARA_P2_SUMMON_T1
Definition boss_yoggsaron.cpp:170
@ EVENT_SARA_P2_BRAIN_LINK
Definition boss_yoggsaron.cpp:173
@ EVENT_SARA_P2_SPAWN_START_TENTACLES
Definition boss_yoggsaron.cpp:179
@ EVENT_SARA_P2_SUMMON_T3
Definition boss_yoggsaron.cpp:172
@ EVENT_SARA_P2_DEATH_RAY
Definition boss_yoggsaron.cpp:174
@ EVENT_SARA_P2_START
Definition boss_yoggsaron.cpp:169
@ EVENT_SARA_P2_MALADY
Definition boss_yoggsaron.cpp:175
@ EVENT_SARA_P2_SUMMON_T2
Definition boss_yoggsaron.cpp:171
@ EVENT_SARA_P1_SPELLS
Definition boss_yoggsaron.cpp:166
@ SAY_SARA_FERVOR_HIT
Definition boss_yoggsaron.cpp:336
@ EMOTE_YOGG_SARON_BERSERK
Definition boss_yoggsaron.cpp:362
@ SAY_SARA_PSYCHOSIS_HIT
Definition boss_yoggsaron.cpp:344
@ SAY_SARA_TRANSFORM_2
Definition boss_yoggsaron.cpp:340
@ SAY_SARA_TRANSFORM_3
Definition boss_yoggsaron.cpp:341
@ SAY_SARA_ANGER
Definition boss_yoggsaron.cpp:337
@ SAY_SARA_TRANSFORM_4
Definition boss_yoggsaron.cpp:342
@ SARA_TRANSFORM_MODEL
Definition boss_yoggsaron.cpp:247
@ EVADE_REASON_OTHER
Definition CreatureAI.h:92
Definition Unit.h:670
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4830
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:1435
bool HasUnitState(const uint32 f) const
Definition Unit.h:742
void SetOrientation(float orientation)
Definition Position.h:116
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition ScriptedCreature.cpp:591
void SpawnTentacle(uint32 entry)
Definition boss_yoggsaron.cpp:618
bool HasAlivePlayerInIllusion() const
Definition boss_yoggsaron.cpp:781
void AddPortals()
Definition boss_yoggsaron.cpp:633
void InitFight(Unit *target)
Definition boss_yoggsaron.cpp:532
void EnterEvadeMode(EvadeReason why) override
Definition boss_yoggsaron.cpp:435
void InformCloud()
Definition boss_yoggsaron.cpp:600

References _initFight, _instance, _isWipeRecovering, _p2TalkTimer, _summonedGuardiansCount, _summonSpeed, ACTION_REMOVE_STUN, ACTION_UNSUMMON_CLOUDS, ACTION_YOGG_SARON_APPEAR, ACTION_YOGG_SARON_OPEN_PORTAL_YELL, ACTION_YOGG_SARON_START_YELL, AddPortals(), BOSS_YOGGSARON, Unit::CastCustomSpell(), Unit::CastSpell(), DATA_YOGG_SARON_DOORS, SummonList::DespawnEntry(), SummonList::DoAction(), InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), EMOTE_YOGG_SARON_BERSERK, EnterEvadeMode(), CreatureAI::EVADE_REASON_OTHER, EVENT_PHASE_ONE, EVENT_PHASE_TWO, EVENT_SARA_P1_BERSERK, EVENT_SARA_P1_DOORS_CLOSE, EVENT_SARA_P1_SPELLS, EVENT_SARA_P1_SUMMON, EVENT_SARA_P2_BRAIN_LINK, EVENT_SARA_P2_DEATH_RAY, EVENT_SARA_P2_MALADY, EVENT_SARA_P2_OPEN_PORTALS, EVENT_SARA_P2_PSYCHOSIS, EVENT_SARA_P2_REMOVE_STUN, EVENT_SARA_P2_SPAWN_START_TENTACLES, EVENT_SARA_P2_START, EVENT_SARA_P2_SUMMON_T1, EVENT_SARA_P2_SUMMON_T2, EVENT_SARA_P2_SUMMON_T3, EVENT_SARA_WIPE_OPEN_DOOR, EVENT_SARA_WIPE_RESPAWN, InstanceScript::GetCreature(), InstanceScript::GetGameObject(), WorldObject::GetInstanceScript(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), GO_STATE_ACTIVE, GO_STATE_READY, HasAlivePlayerInIllusion(), Unit::HasUnitState(), InformCloud(), InitFight(), ScriptedAI::me, NOT_STARTED, NPC_BRAIN_OF_YOGG_SARON, NPC_CORRUPTOR_TENTACLE, NPC_CRUSHER_TENTACLE, NPC_OMINOUS_CLOUD, NPC_YOGG_SARON, RAND(), randtime(), Unit::RemoveAura(), SARA_TRANSFORM_MODEL, SAY_SARA_ANGER, SAY_SARA_FERVOR_HIT, SAY_SARA_PSYCHOSIS_HIT, SAY_SARA_TRANSFORM_2, SAY_SARA_TRANSFORM_3, SAY_SARA_TRANSFORM_4, ScriptedAI::SelectTargetFromPlayerList(), WorldObject::setActive(), InstanceScript::SetBossState(), Unit::SetDisplayId(), Unit::SetFullHealth(), Position::SetOrientation(), Unit::SetVisible(), SpawnClouds(), SpawnTentacle(), SPELL_BRAIN_LINK, SPELL_CONSTRICTOR_TENTACLE, SPELL_DEATH_RAY, SPELL_EXTINGUISH_ALL_LIFE, SPELL_INSANE1, SPELL_MALADY_OF_THE_MIND, SPELL_RIDE_YOGG_SARON_VEHICLE, SPELL_SARA_PSYCHOSIS_10, SPELL_SARAS_ANGER_TARGET_SELECTOR, SPELL_SARAS_BLESSING_TARGET_SELECTOR, SPELL_SARAS_FAVOR_TARGET_SELECTOR, SPELL_SHATTERED_ILLUSION, SPELLVALUE_MAX_TARGETS, WorldObject::SummonCreature(), summons, UNIT_STATE_CASTING, UpdateKeeperSpawns(), and urand().

◆ UpdateKeeperSpawns()

void boss_yoggsaron_sara::UpdateKeeperSpawns ( )
inline
573 {
574 uint32 watchersMask = _instance->GetPersistentData(
576 for (uint8 i = KEEPER_FREYA; i <= KEEPER_THORIM; i++)
577 {
578 if (watchersMask & (1 << i))
579 {
582 }
583 }
584 }
const Position KeepersPos[4]
Definition boss_yoggsaron.cpp:306
bool HasEntry(uint32 entry) const
Definition ScriptedCreature.cpp:94

References _instance, InstanceScript::GetPersistentData(), SummonList::HasEntry(), KEEPER_FREYA, KEEPER_THORIM, KeepersPos, ScriptedAI::me, PERSISTENT_DATA_WATCHERS_MASK, WorldObject::SummonCreature(), summons, and TABLE_KEEPER_ENTRY.

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

Member Data Documentation

◆ _currentIllusion

uint8 boss_yoggsaron_sara::_currentIllusion

Referenced by AddPortals(), and Reset().

◆ _deathRayAnnounce

bool boss_yoggsaron_sara::_deathRayAnnounce = true

Referenced by JustSummoned(), and Reset().

◆ _initFight

uint32 boss_yoggsaron_sara::_initFight

Referenced by Reset(), and UpdateAI().

◆ _instance

◆ _isIllusionReversed

bool boss_yoggsaron_sara::_isIllusionReversed

Referenced by AddPortals(), and Reset().

◆ _isWipeRecovering

bool boss_yoggsaron_sara::_isWipeRecovering = false

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

◆ _p2TalkTimer

uint32 boss_yoggsaron_sara::_p2TalkTimer

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

◆ _secondPhase

bool boss_yoggsaron_sara::_secondPhase = false

Referenced by DamageTaken(), GetData(), and Reset().

◆ _summonedGuardiansCount

uint8 boss_yoggsaron_sara::_summonedGuardiansCount

Referenced by Reset(), and UpdateAI().

◆ _summonSpeed

float boss_yoggsaron_sara::_summonSpeed

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

◆ events

EventMap boss_yoggsaron_sara::events

◆ summons


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