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

Public Member Functions

 boss_yoggsaron_saraAI (Creature *pCreature)
 
void AttackStart (Unit *) override
 
void MoveInLineOfSight (Unit *) override
 
void JustSummoned (Creature *cr) override
 
void SpawnClouds ()
 
void SpawnWeels ()
 
void EnterEvadeMode (EvadeReason why) override
 
void EnableSara (bool apply)
 
void Reset () override
 
void InitFight (Unit *target)
 
void SaveKeepers ()
 
void InformCloud ()
 
void SpawnTentacle (uint32 entry)
 
void SummonDeathOrbs ()
 
void AddPortals ()
 
void KilledUnit (Unit *who) override
 
void SpellHitTarget (Unit *target, SpellInfo const *spellInfo) override
 
uint32 GetData (uint32 param) const override
 
void DoAction (int32 param) override
 
void DamageTaken (Unit *who, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 
void UpdateAI (uint32 diff) override
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () const
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged.
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat (NOTE: Creature engage logic should NOT be here, but in JustEngagedWith, which happens once threat is established!)
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the max threat target, which may not always be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Public Attributes

InstanceScriptm_pInstance
 
EventMap events
 
SummonList summons
 
uint32 _initFight
 
ObjectGuid _keepersGUID [4]
 
uint8 _summonedGuardiansCount
 
uint32 _p2TalkTimer
 
bool _secondPhase
 
float _summonSpeed
 
uint8 _currentIllusion
 
bool _isIllusionReversed
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
bool IsFleeing
 

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
  AXIS_Y
}
 
- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES ,
  EVADE_REASON_BOUNDARY ,
  EVADE_REASON_SEQUENCE_BREAK ,
  EVADE_REASON_NO_PATH ,
  EVADE_REASON_OTHER
}
 
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_yoggsaron_saraAI()

boss_yoggsaron_sara::boss_yoggsaron_saraAI::boss_yoggsaron_saraAI ( Creature pCreature)
inline
364 : ScriptedAI(pCreature), summons(pCreature)
365 {
366 m_pInstance = pCreature->GetInstanceScript();
367 }
Definition: ScriptedCreature.h:192
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
InstanceScript * m_pInstance
Definition: boss_yoggsaron.cpp:369
SummonList summons
Definition: boss_yoggsaron.cpp:371

References WorldObject::GetInstanceScript(), and m_pInstance.

Member Function Documentation

◆ AddPortals()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::AddPortals ( )
inline
584 {
585 _summonSpeed -= 0.1f;
586 Creature* cr = nullptr;
587
588 // Spawn Portals
589 for (uint8 i = 0; i < RAID_MODE(4, 10); ++i)
590 {
592 {
595 }
596 }
597
600
603 else
605 }
std::uint8_t uint8
Definition: Define.h:110
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:44
@ UNIT_FLAG_NON_ATTACKABLE
Definition: Unit.h:449
@ UNIT_FLAG_DISABLE_MOVE
Definition: Unit.h:450
static LocationsXY yoggPortalLoc[]
Definition: boss_yoggsaron.cpp:274
@ NPC_DESCEND_INTO_MADNESS
Definition: boss_yoggsaron.cpp:196
@ NPC_BRAIN_OF_YOGG_SARON
Definition: ulduar.h:128
void DoAction(int32 info, uint16 max=0)
Definition: ScriptedCreature.h:104
Definition: ScriptedCreature.h:169
Creature * me
Definition: ScriptedCreature.h:282
const T & RAID_MODE(const T &normal10, const T &normal25) const
Definition: ScriptedCreature.h:416
Definition: Creature.h:46
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition: Object.cpp:2343
void SetArmor(int32 val)
Definition: Unit.h:1447
void SetUnitFlag(UnitFlags flags)
Definition: Unit.h:1495
float y
Definition: boss_yoggsaron.cpp:271
float x
Definition: boss_yoggsaron.cpp:271
float z
Definition: boss_yoggsaron.cpp:271
bool _isIllusionReversed
Definition: boss_yoggsaron.cpp:380
uint8 _currentIllusion
Definition: boss_yoggsaron.cpp:379
float _summonSpeed
Definition: boss_yoggsaron.cpp:378

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

Referenced by UpdateAI().

◆ AttackStart()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::AttackStart ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

382{ }

Referenced by InitFight().

◆ DamageTaken()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::DamageTaken ( Unit who,
uint32 damage,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

693 {
694 if (who && who->GetEntry() == NPC_GUARDIAN_OF_YS && !_secondPhase)
695 {
696 damage = 25000;
697
698 // START PHASE 2
699 if (me->GetHealth() <= damage)
700 {
701 _secondPhase = true;
702 damage = 0;
703
704 events.SetPhase(EVENT_PHASE_TWO);
706
708 cr->SetVisible(false);
709
710 _p2TalkTimer++;
712 }
713 return;
714 }
715
716 damage = 0;
717 }
events
Definition: boss_sartura.cpp:43
@ EVENT_PHASE_TWO
Definition: boss_yoggsaron.cpp:255
@ SAY_SARA_TRANSFORM_1
Definition: boss_yoggsaron.cpp:297
@ NPC_GUARDIAN_OF_YS
Definition: boss_yoggsaron.cpp:184
@ NPC_YOGG_SARON
Definition: boss_yoggsaron.cpp:186
Talk
Definition: boss_fathomlord_karathress.cpp:25
uint32 GetEntry() const
Definition: Object.h:109
float GetPositionZ() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
uint32 GetMaxHealth() const
Definition: Unit.h:1455
void SetHealth(uint32 val)
Definition: Unit.cpp:15464
uint32 GetHealth() const
Definition: Unit.h:1454
bool _secondPhase
Definition: boss_yoggsaron.cpp:377
uint32 _p2TalkTimer
Definition: boss_yoggsaron.cpp:376

References _p2TalkTimer, _secondPhase, EVENT_PHASE_TWO, Object::GetEntry(), Unit::GetHealth(), Unit::GetMaxHealth(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), ScriptedAI::me, NPC_GUARDIAN_OF_YS, NPC_YOGG_SARON, SAY_SARA_TRANSFORM_1, Unit::SetHealth(), and WorldObject::SummonCreature().

◆ DoAction()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

640 {
641 if (param == ACTION_BRAIN_DAMAGED)
642 {
644
647
650
651 if (!(_keepersGUID[0] && _keepersGUID[1] && _keepersGUID[2] && _keepersGUID[3]) && me->GetMap()->Is25ManRaid())
653
655 events.SetPhase(EVENT_PHASE_THREE);
656
658 me->SetVisible(false);
659 return;
660 }
661 else if (param == ACTION_YOGG_SARON_DEATH)
662 {
670 me->KillSelf();
671 return;
672 }
673
674 // Determine shatter duration
675 if (param <= 0)
676 return;
677
678 // Illusion shatters (param - stun time)
680 {
681 yoggb->AI()->Talk(EMOTE_YOGG_SARON_BRAIN_SHATTERED);
682 }
683
684 uint32 timer = events.GetNextEventTime(EVENT_SARA_P2_OPEN_PORTALS);
685 uint32 portalTime = (timer > events.GetTimer() ? timer - events.GetTimer() : 0);
686 events.DelayEvents(param + 100);
687 events.RescheduleEvent(EVENT_SARA_P2_OPEN_PORTALS, portalTime, 0, EVENT_PHASE_TWO);
688 events.ScheduleEvent(EVENT_SARA_P2_REMOVE_STUN, param, 0, EVENT_PHASE_TWO);
690 }
std::uint32_t uint32
Definition: Define.h:108
@ SPELL_SHATTERED_ILLUSION
Definition: boss_yoggsaron.cpp:120
@ ACTION_THORIM_START_STORM
Definition: boss_yoggsaron.cpp:247
@ ACTION_YOGG_SARON_DEATH
Definition: boss_yoggsaron.cpp:238
@ EVENT_PHASE_THREE
Definition: boss_yoggsaron.cpp:256
@ ACTION_YOGG_SARON_HARD_MODE
Definition: boss_yoggsaron.cpp:245
@ ACTION_REMOVE_STUN
Definition: boss_yoggsaron.cpp:243
@ ACTION_BRAIN_DAMAGED
Definition: boss_yoggsaron.cpp:242
@ ACTION_YOGG_SARON_START_P3
Definition: boss_yoggsaron.cpp:244
@ EVENT_SARA_P2_REMOVE_STUN
Definition: boss_yoggsaron.cpp:171
@ EVENT_SARA_P2_OPEN_PORTALS
Definition: boss_yoggsaron.cpp:170
@ EMOTE_YOGG_SARON_BRAIN_SHATTERED
Definition: boss_yoggsaron.cpp:309
@ NPC_SANITY_WELL
Definition: boss_yoggsaron.cpp:185
@ NPC_VOICE_OF_YOGG_SARON
Definition: boss_yoggsaron.cpp:187
@ NPC_DEATH_ORB
Definition: boss_yoggsaron.cpp:195
@ NPC_FREYA_KEEPER
Definition: ulduar.h:149
@ NPC_MIMIRON_KEEPER
Definition: ulduar.h:151
@ NPC_HODIR_KEEPER
Definition: ulduar.h:150
@ NPC_THORIM_KEEPER
Definition: ulduar.h:152
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
void DespawnEntry(uint32 entry)
Definition: ScriptedCreature.cpp:54
Map * GetMap() const
Definition: Object.h:517
void SetVisible(bool x)
Definition: Unit.cpp:14220
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1169
void RemoveAllAuras()
Definition: Unit.cpp:5259
void KillSelf(bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition: Unit.h:1565
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:94
bool Is25ManRaid() const
Definition: Map.h:453
ObjectGuid _keepersGUID[4]
Definition: boss_yoggsaron.cpp:374

References _keepersGUID, ACTION_BRAIN_DAMAGED, ACTION_REMOVE_STUN, ACTION_THORIM_START_STORM, ACTION_YOGG_SARON_DEATH, ACTION_YOGG_SARON_HARD_MODE, ACTION_YOGG_SARON_START_P3, Unit::CastSpell(), 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, ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), WorldObject::GetInstanceScript(), WorldObject::GetMap(), Map::Is25ManRaid(), Unit::KillSelf(), ScriptedAI::me, NPC_BRAIN_OF_YOGG_SARON, NPC_DEATH_ORB, NPC_FREYA_KEEPER, NPC_HODIR_KEEPER, NPC_MIMIRON_KEEPER, NPC_SANITY_WELL, NPC_THORIM_KEEPER, NPC_VOICE_OF_YOGG_SARON, NPC_YOGG_SARON, Unit::RemoveAllAuras(), Unit::SetVisible(), SPELL_SHATTERED_ILLUSION, and summons.

◆ EnableSara()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::EnableSara ( bool  apply)
inline
432 {
433 if (apply)
434 {
436 me->DisableRotate(false);
438 }
439 else
440 {
442 me->DisableRotate(true);
444 }
445 }
@ UNIT_STATE_ROOT
Definition: Unit.h:335
void ClearUnitState(uint32 f)
Definition: Unit.h:1411
void AddUnitState(uint32 f)
Definition: Unit.h:1409
void DisableRotate(bool apply)
Definition: Unit.cpp:18529
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:1496

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

Reimplemented from CreatureAI.

420 {
421 if (!_EnterEvadeMode(why))
422 return;
423
424 Position pos;
425 pos = me->GetHomePosition();
427 Reset();
428 me->setActive(false);
429 }
bool _EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:291
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:332
void setActive(bool isActiveObject)
Definition: Object.cpp:1085
Definition: Position.h:28
float GetOrientation() const
Definition: Position.h:120
void NearTeleportTo(Position &pos, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
Definition: Unit.cpp:20250
void Reset() override
Definition: boss_yoggsaron.cpp:447

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

Referenced by UpdateAI().

◆ GetData()

uint32 boss_yoggsaron_sara::boss_yoggsaron_saraAI::GetData ( uint32  param) const
inlineoverridevirtual

Reimplemented from UnitAI.

623 {
624 if (param == DATA_GET_KEEPERS_COUNT)
625 {
626 uint8 _count = 0;
627 for (uint8 i = 0; i < 4; ++i)
628 if (_keepersGUID[i])
629 ++_count;
630
631 return _count;
632 }
633 else if (param == DATA_GET_SARA_PHASE)
634 return _secondPhase;
635
636 return 4; // just to be sure, return max numer of keepers
637 }
@ DATA_GET_KEEPERS_COUNT
Definition: boss_yoggsaron.cpp:263
@ DATA_GET_SARA_PHASE
Definition: boss_yoggsaron.cpp:265

References _keepersGUID, _secondPhase, DATA_GET_KEEPERS_COUNT, and DATA_GET_SARA_PHASE.

◆ InformCloud()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::InformCloud ( )
inline
542 {
543 Creature* cloud = nullptr;
544 for (SummonList::const_iterator itr = summons.begin(); itr != summons.end();)
545 {
546 Creature* summon = ObjectAccessor::GetCreature(*me, *itr);
547 ++itr;
548 if (!summon || summon->GetEntry() != NPC_OMINOUS_CLOUD || me->GetDistance(summon) < 20)
549 continue;
550
551 if ((!cloud || (urand(0, 1) && !summon->HasAura(SPELL_SUMMON_GUARDIAN_OF_YS))))
552 cloud = summon;
553 }
554
555 if (cloud)
557 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ SPELL_SUMMON_GUARDIAN_OF_YS
Definition: boss_yoggsaron.cpp:57
@ ACTION_START_SUMMONING
Definition: boss_yoggsaron.cpp:236
@ NPC_OMINOUS_CLOUD
Definition: boss_yoggsaron.cpp:183
virtual void DoAction(int32)
Definition: UnitAI.h:201
iterator begin()
Definition: ScriptedCreature.h:50
StorageType::const_iterator const_iterator
Definition: ScriptedCreature.h:39
iterator end()
Definition: ScriptedCreature.h:60
CreatureAI * AI() const
Definition: Creature.h:136
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1245
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5636

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::boss_yoggsaron_saraAI::InitFight ( Unit target)
inline
493 {
494 if (!m_pInstance)
495 return;
496
497 // some simple hack checks
499 return;
500
504 AttackStart(target);
505
507
508 SaveKeepers();
509
510 events.ScheduleEvent(EVENT_SARA_P1_DOORS_CLOSE, 15s, 0, EVENT_PHASE_ONE);
511 events.ScheduleEvent(EVENT_SARA_P1_BERSERK, 15min, 0, 0);
512 events.ScheduleEvent(EVENT_SARA_P1_SUMMON, 0ms, 0, EVENT_PHASE_ONE);
513 events.SetPhase(EVENT_PHASE_ONE);
514
516 me->setActive(true);
517 }
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ DONE
Definition: InstanceScript.h:60
@ SPELL_SANITY_BASE
Definition: boss_yoggsaron.cpp:53
@ CRITERIA_NOT_GETTING_OLDER
Definition: boss_yoggsaron.cpp:258
@ EVENT_PHASE_ONE
Definition: boss_yoggsaron.cpp:254
@ EVENT_SARA_P1_SUMMON
Definition: boss_yoggsaron.cpp:158
@ EVENT_SARA_P1_DOORS_CLOSE
Definition: boss_yoggsaron.cpp:157
@ EVENT_SARA_P1_BERSERK
Definition: boss_yoggsaron.cpp:160
@ SAY_SARA_AGGRO
Definition: boss_yoggsaron.cpp:293
@ TYPE_VEZAX
Definition: ulduar.h:46
@ TYPE_XT002
Definition: ulduar.h:38
@ TYPE_YOGGSARON
Definition: ulduar.h:47
@ ACHIEVEMENT_TIMED_TYPE_EVENT
Definition: DBCEnums.h:118
void SetInCombatWithZone()
Definition: Creature.cpp:2732
void DoStartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition: InstanceScript.cpp:620
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:52
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53
void AttackStart(Unit *) override
Definition: boss_yoggsaron.cpp:382
void SaveKeepers()
Definition: boss_yoggsaron.cpp:519

References ACHIEVEMENT_TIMED_TYPE_EVENT, AttackStart(), Unit::CastSpell(), CRITERIA_NOT_GETTING_OLDER, DONE, InstanceScript::DoStartTimedAchievement(), EVENT_PHASE_ONE, EVENT_SARA_P1_BERSERK, EVENT_SARA_P1_DOORS_CLOSE, EVENT_SARA_P1_SUMMON, ZoneScript::GetData(), IN_PROGRESS, m_pInstance, ScriptedAI::me, SaveKeepers(), SAY_SARA_AGGRO, WorldObject::setActive(), ZoneScript::SetData(), Creature::SetInCombatWithZone(), SPELL_SANITY_BASE, TYPE_VEZAX, TYPE_XT002, and TYPE_YOGGSARON.

Referenced by UpdateAI().

◆ JustSummoned()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::JustSummoned ( Creature cr)
inlineoverridevirtual

Reimplemented from ScriptedAI.

386 {
387 summons.Summon(cr);
388 if (cr->GetEntry() >= NPC_FREYA_KEEPER && cr->GetEntry() <= NPC_THORIM_KEEPER)
389 {
390 if (cr->GetEntry() == NPC_FREYA_KEEPER)
391 cr->CastSpell(cr, SPELL_CONJURE_SANITY_WELL, false);
393 }
394 else if (cr->GetEntry() == NPC_SANITY_WELL)
396 }
@ SPELL_AURA_MOD_SCALE
Definition: SpellAuraDefines.h:124
@ SPELL_CONJURE_SANITY_WELL
Definition: boss_yoggsaron.cpp:47
@ IMMUNITY_STATE
Definition: SharedDefines.h:1395
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:90
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition: Unit.cpp:13383

References _keepersGUID, Unit::ApplySpellImmune(), Unit::CastSpell(), Object::GetEntry(), Object::GetGUID(), IMMUNITY_STATE, NPC_FREYA_KEEPER, NPC_SANITY_WELL, NPC_THORIM_KEEPER, SPELL_AURA_MOD_SCALE, SPELL_CONJURE_SANITY_WELL, SummonList::Summon(), and summons.

◆ KilledUnit()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::KilledUnit ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

608 {
609 if (who->IsPlayer())
610 {
612 }
613 }
@ SAY_SARA_KILL
Definition: boss_yoggsaron.cpp:296
bool IsPlayer() const
Definition: Object.h:194

References Object::IsPlayer(), and SAY_SARA_KILL.

◆ MoveInLineOfSight()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

383{ }

◆ Reset()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

448 {
449 if (!_secondPhase) // Phase 1 wipe
450 {
451 me->GetMap()->DoForAllPlayers([&](Player* player)
452 {
454 {
455 voice->AI()->Talk(WHISPER_VOICE_PHASE_1_WIPE, player);
456 }
457 });
458 }
459
461 events.Reset();
463
464 me->SetVisible(true);
466 me->SetDisableGravity(true);
467 EnableSara(false);
468 SpawnClouds();
469
470 _initFight = 1;
471
472 for (uint8 i = 0; i < 4; ++i)
473 _keepersGUID[i].Clear();
474
476 _p2TalkTimer = 0;
477 _secondPhase = false;
478 _summonSpeed = 1.0f;
479 _currentIllusion = urand(1, 3);
481
482 if (m_pInstance)
483 {
488 go->SetGoState(GO_STATE_ACTIVE);
489 }
490 }
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:690
@ NOT_STARTED
Definition: InstanceScript.h:57
@ SPELL_SANITY
Definition: boss_yoggsaron.cpp:54
@ ACTION_DESPAWN_ADDS
Definition: boss_yoggsaron.cpp:235
@ GO_YOGG_SARON_DOORS
Definition: ulduar.h:240
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:187
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
void SetDisplayId(uint32 modelId) override
Definition: Creature.cpp:3422
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Definition: Creature.cpp:3109
Definition: GameObject.h:122
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2434
Definition: Player.h:1056
uint32 GetNativeDisplayId() const
Definition: Unit.h:2184
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:638
void DoStopTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition: InstanceScript.cpp:629
void DoForAllPlayers(std::function< void(Player *)> exec)
Definition: Map.cpp:3817
uint32 _initFight
Definition: boss_yoggsaron.cpp:373
void EnableSara(bool apply)
Definition: boss_yoggsaron.cpp:431
uint8 _summonedGuardiansCount
Definition: boss_yoggsaron.cpp:375
void SpawnClouds()
Definition: boss_yoggsaron.cpp:398

References _currentIllusion, _initFight, _isIllusionReversed, _keepersGUID, _p2TalkTimer, _secondPhase, _summonedGuardiansCount, _summonSpeed, ACHIEVEMENT_TIMED_TYPE_EVENT, ACTION_DESPAWN_ADDS, CRITERIA_NOT_GETTING_OLDER, SummonList::DespawnAll(), SummonList::DoAction(), Map::DoForAllPlayers(), InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), InstanceScript::DoStopTimedAchievement(), EnableSara(), WorldObject::FindNearestCreature(), ObjectAccessor::GetGameObject(), InstanceScript::GetGuidData(), WorldObject::GetMap(), Unit::GetNativeDisplayId(), GO_STATE_ACTIVE, GO_YOGG_SARON_DOORS, m_pInstance, ScriptedAI::me, NOT_STARTED, NPC_VOICE_OF_YOGG_SARON, ZoneScript::SetData(), Creature::SetDisableGravity(), Creature::SetDisplayId(), Unit::SetVisible(), SpawnClouds(), SPELL_SANITY, summons, TYPE_YOGGSARON, and urand().

Referenced by EnterEvadeMode().

◆ SaveKeepers()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::SaveKeepers ( )
inline
520 {
521 for (uint8 i = 0; i < 4; ++i)
522 if (m_pInstance->GetData(TYPE_WATCHERS) & (1 << i))
523 switch (i)
524 {
525 case KEEPER_FREYA:
526 SpawnWeels();
527 me->SummonCreature(NPC_FREYA_KEEPER, 1939.32f, 42.165f, 338.415f, 5.17955f);
528 break;
529 case KEEPER_HODIR:
530 me->SummonCreature(NPC_HODIR_KEEPER, 1939.13f, -90.8332f, 338.415f, 1.00123f);
531 break;
532 case KEEPER_MIMIRON:
533 me->SummonCreature(NPC_MIMIRON_KEEPER, 2036.81f, 25.6646f, 338.415f, 3.74227f);
534 break;
535 case KEEPER_THORIM:
536 me->SummonCreature(NPC_THORIM_KEEPER, 2036.59f, -73.8499f, 338.415f, 2.34819f);
537 break;
538 }
539 }
@ KEEPER_THORIM
Definition: ulduar.h:290
@ KEEPER_MIMIRON
Definition: ulduar.h:289
@ KEEPER_HODIR
Definition: ulduar.h:288
@ KEEPER_FREYA
Definition: ulduar.h:287
@ TYPE_WATCHERS
Definition: ulduar.h:49
void SpawnWeels()
Definition: boss_yoggsaron.cpp:410

References ZoneScript::GetData(), KEEPER_FREYA, KEEPER_HODIR, KEEPER_MIMIRON, KEEPER_THORIM, m_pInstance, ScriptedAI::me, NPC_FREYA_KEEPER, NPC_HODIR_KEEPER, NPC_MIMIRON_KEEPER, NPC_THORIM_KEEPER, SpawnWeels(), WorldObject::SummonCreature(), and TYPE_WATCHERS.

Referenced by InitFight().

◆ SpawnClouds()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::SpawnClouds ( )
inline
399 {
400 for (uint8 i = 0; i < 6; ++i)
401 {
402 float Zplus = i > 2 ? (i - 2) * 1.6f : 0;
403 if (i % 2)
404 me->SummonCreature(NPC_OMINOUS_CLOUD, me->GetPositionX() + 8 + i * 7, me->GetPositionY() + 8 + i * 7, 326 + Zplus, 0);
405 else
406 me->SummonCreature(NPC_OMINOUS_CLOUD, me->GetPositionX() - 8 - i * 7, me->GetPositionY() - 8 - i * 7, 326 + Zplus, 0);
407 }
408 }

References Position::GetPositionX(), Position::GetPositionY(), ScriptedAI::me, NPC_OMINOUS_CLOUD, and WorldObject::SummonCreature().

Referenced by Reset().

◆ SpawnTentacle()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::SpawnTentacle ( uint32  entry)
inline
560 {
561 uint32 dist = urand(38, 48);
562 float o = rand_norm() * M_PI * 2;
563 float Zplus = (dist - 38) / 6.5f;
564 if (Creature* cr = me->SummonCreature(entry, me->GetPositionX() + dist * cos(o), me->GetPositionY() + dist * std::sin(o), 327.2 + Zplus, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
565 {
566 cr->CastSpell(cr, SPELL_TENTACLE_ERUPT, true);
567 cr->CastSpell(cr, SPELL_VOID_ZONE_SMALL, true);
568 cr->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
569 }
570 }
double rand_norm()
Definition: Random.cpp:77
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition: Object.h:47
@ SPELL_TENTACLE_ERUPT
Definition: boss_yoggsaron.cpp:97
@ SPELL_VOID_ZONE_SMALL
Definition: boss_yoggsaron.cpp:95
@ EMOTE_ONESHOT_EMERGE
Definition: SharedDefines.h:2043

References EMOTE_ONESHOT_EMERGE, 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().

◆ SpawnWeels()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::SpawnWeels ( )
inline
411 {
412 me->SummonCreature(NPC_SANITY_WELL, 2042.56f, -40.3667f, 329.274f, 0.0f);
413 me->SummonCreature(NPC_SANITY_WELL, 1975.89f, 40.0216f, 331.1f, 0.0f);
414 me->SummonCreature(NPC_SANITY_WELL, 1987.12f, -91.2702f, 330.186f, 0.0f);
415 me->SummonCreature(NPC_SANITY_WELL, 1900.48f, -51.2386f, 332.13f, 0.0f);
416 me->SummonCreature(NPC_SANITY_WELL, 1899.94f, 0.330621f, 332.296f, 0.0f);
417 }

References ScriptedAI::me, NPC_SANITY_WELL, and WorldObject::SummonCreature().

Referenced by SaveKeepers().

◆ SpellHitTarget()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::SpellHitTarget ( Unit target,
SpellInfo const *  spellInfo 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

616 {
617 if (spellInfo->Id == SPELL_SANITY)
618 if (Aura* aur = target->GetAura(SPELL_SANITY))
619 aur->SetStackAmount(100);
620 }
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5519
Definition: SpellAuras.h:87

References Unit::GetAura(), SpellInfo::Id, and SPELL_SANITY.

◆ SummonDeathOrbs()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::SummonDeathOrbs ( )
inline
573 {
574 for (uint8 i = 0; i < 4; ++i)
575 {
576 uint32 dist = urand(38, 48);
577 float o = rand_norm() * M_PI * 2;
578 float Zplus = (dist - 38) / 6.5f;
579 me->SummonCreature(NPC_DEATH_ORB, me->GetPositionX() + dist * cos(o), me->GetPositionY() + dist * std::sin(o), 327.2 + Zplus, 0, TEMPSUMMON_TIMED_DESPAWN, 20000);
580 }
581 }

References Position::GetPositionX(), Position::GetPositionY(), ScriptedAI::me, NPC_DEATH_ORB, rand_norm(), WorldObject::SummonCreature(), TEMPSUMMON_TIMED_DESPAWN, and urand().

Referenced by UpdateAI().

◆ UpdateAI()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

720 {
721 if (_initFight)
722 {
723 _initFight += diff;
724 if (_initFight > 5000)
725 {
726 if (Unit* target = SelectTargetFromPlayerList(90))
727 {
728 _initFight = 0;
729 InitFight(target);
730 }
731 else
732 _initFight = 1;
733 }
734 return;
735 }
736
738 {
741 return;
742 }
743
744 if (_p2TalkTimer)
745 {
746 _p2TalkTimer += diff;
747 if (_p2TalkTimer >= 4000 && _p2TalkTimer < 20000)
748 {
752 _p2TalkTimer = 20000;
753 }
754 else if (_p2TalkTimer >= 25000 && _p2TalkTimer < 40000)
755 {
758 _p2TalkTimer = 40000;
759 }
760 else if (_p2TalkTimer >= 44500 && _p2TalkTimer < 60000)
761 {
763 _p2TalkTimer = 60000;
764 }
765 else if (_p2TalkTimer >= 64000)
766 {
769 _p2TalkTimer = 0;
770 events.ScheduleEvent(EVENT_SARA_P2_START, 500ms, 0, EVENT_PHASE_TWO);
771 }
772 return;
773 }
774
775 events.Update(diff);
777 return;
778
779 switch(events.ExecuteEvent())
780 {
782 // Whispers of YS
784
785 if (m_pInstance)
787 go->SetGoState(GO_STATE_READY);
788
789 events.ScheduleEvent(EVENT_SARA_P1_SPELLS, 0ms, 1, EVENT_PHASE_ONE);
790 break;
792 events.RepeatEvent(20000 - (std::min(_summonedGuardiansCount, (uint8)5) * 2000));
794 InformCloud();
795 break;
797 {
799 if (urand(0, 2))
800 {
802 {
804 }
805 else if (spell == SPELL_SARAS_FAVOR_TARGET_SELECTOR)
806 {
808 }
809 }
810
811 me->CastCustomSpell(spell, SPELLVALUE_MAX_TARGETS, 1, nullptr, false);
812 events.RepeatEvent(me->GetMap()->Is25ManRaid() ? urand(0, 3000) : 4000 + urand(0, 2000));
813 break;
814 }
816 {
820
821 // Spawn Brain!
822 me->SummonCreature(NPC_BRAIN_OF_YOGG_SARON, 1981.3f, -25.43f, 265);
823 break;
824 }
827 events.Repeat(20s);
828 break;
830 if ((urand(0, 9)) == 0) // Rarely said (as it's casted every 3.5s)
831 {
833 }
835 events.Repeat(3500ms);
836 break;
840 events.Repeat(20s);
841 break;
842 case EVENT_SARA_P2_SUMMON_T1: // CRUSHER
844 events.RepeatEvent((50000 + urand(0, 10000)) * _summonSpeed);
845 break;
846 case EVENT_SARA_P2_SUMMON_T2: // CONSTRICTOR
848 events.RepeatEvent((15000 + urand(0, 5000)) * _summonSpeed);
849 break;
850 case EVENT_SARA_P2_SUMMON_T3: // CORRUPTOR
852 events.RepeatEvent((30000 + urand(0, 10000)) * _summonSpeed);
853 break;
856 events.Repeat(30s);
857 break;
859 {
860 AddPortals();
863 events.Repeat(80s);
864 break;
865 }
867 {
870 break;
871 }
873 me->SetOrientation(M_PI);
875
878
883
884 events.ScheduleEvent(EVENT_SARA_P2_MALADY, 7s, 0, EVENT_PHASE_TWO);
885 events.ScheduleEvent(EVENT_SARA_P2_PSYCHOSIS, 3s, 0, EVENT_PHASE_TWO);
886 events.ScheduleEvent(EVENT_SARA_P2_DEATH_RAY, 15s, 0, EVENT_PHASE_TWO);
887 events.ScheduleEvent(EVENT_SARA_P2_SUMMON_T1, 50s, 60s, 0, EVENT_PHASE_TWO);
888 events.ScheduleEvent(EVENT_SARA_P2_SUMMON_T2, 15s, 20s, 0, EVENT_PHASE_TWO);
889 events.ScheduleEvent(EVENT_SARA_P2_SUMMON_T3, 30000 + urand(0, 10000), 0, EVENT_PHASE_TWO);
890 events.ScheduleEvent(EVENT_SARA_P2_BRAIN_LINK, 0, 0, EVENT_PHASE_TWO);
891 events.ScheduleEvent(EVENT_SARA_P2_OPEN_PORTALS, 60000, 0, EVENT_PHASE_TWO);
892 break;
894 if (me->GetInstanceScript())
895 {
897 {
898 yogg->AI()->Talk(EMOTE_YOGG_SARON_BERSERK);
899 }
900 }
902 events.Repeat(5s);
903 break;
904 }
905 }
static First const & RAND(First const &first, Second const &second, Rest const &... rest)
Definition: CreatureAIImpl.h:30
@ GO_STATE_READY
Definition: GameObjectData.h:691
@ UNIT_STATE_CASTING
Definition: Unit.h:340
@ SPELLVALUE_MAX_TARGETS
Definition: SpellDefines.h:118
@ SPELL_SARAS_FAVOR_TARGET_SELECTOR
Definition: boss_yoggsaron.cpp:64
@ SPELL_EXTINGUISH_ALL_LIFE
Definition: boss_yoggsaron.cpp:55
@ SPELL_MALADY_OF_THE_MIND
Definition: boss_yoggsaron.cpp:78
@ SPELL_INSANE1
Definition: boss_yoggsaron.cpp:58
@ SPELL_BRAIN_LINK
Definition: boss_yoggsaron.cpp:80
@ SPELL_SARAS_ANGER_TARGET_SELECTOR
Definition: boss_yoggsaron.cpp:68
@ SPELL_SARAS_BLESSING_TARGET_SELECTOR
Definition: boss_yoggsaron.cpp:66
@ ACTION_YOGG_SARON_START_YELL
Definition: boss_yoggsaron.cpp:239
@ ACTION_YOGG_SARON_APPEAR
Definition: boss_yoggsaron.cpp:237
@ ACTION_UNSUMMON_CLOUDS
Definition: boss_yoggsaron.cpp:234
@ ACTION_YOGG_SARON_OPEN_PORTAL_YELL
Definition: boss_yoggsaron.cpp:240
@ EVENT_SARA_P2_PSYCHOSIS
Definition: boss_yoggsaron.cpp:169
@ EVENT_SARA_P2_SUMMON_T1
Definition: boss_yoggsaron.cpp:163
@ EVENT_SARA_P2_BRAIN_LINK
Definition: boss_yoggsaron.cpp:166
@ EVENT_SARA_P2_SPAWN_START_TENTACLES
Definition: boss_yoggsaron.cpp:172
@ EVENT_SARA_P2_SUMMON_T3
Definition: boss_yoggsaron.cpp:165
@ EVENT_SARA_P2_DEATH_RAY
Definition: boss_yoggsaron.cpp:167
@ EVENT_SARA_P2_START
Definition: boss_yoggsaron.cpp:162
@ EVENT_SARA_P2_MALADY
Definition: boss_yoggsaron.cpp:168
@ EVENT_SARA_P2_SUMMON_T2
Definition: boss_yoggsaron.cpp:164
@ EVENT_SARA_P1_SPELLS
Definition: boss_yoggsaron.cpp:159
@ SAY_SARA_DEATH_RAY
Definition: boss_yoggsaron.cpp:301
@ SAY_SARA_FERVOR_HIT
Definition: boss_yoggsaron.cpp:294
@ EMOTE_YOGG_SARON_BERSERK
Definition: boss_yoggsaron.cpp:320
@ SAY_SARA_PSYCHOSIS_HIT
Definition: boss_yoggsaron.cpp:302
@ SAY_SARA_TRANSFORM_2
Definition: boss_yoggsaron.cpp:298
@ SAY_SARA_TRANSFORM_3
Definition: boss_yoggsaron.cpp:299
@ SAY_SARA_ANGER
Definition: boss_yoggsaron.cpp:295
@ SAY_SARA_TRANSFORM_4
Definition: boss_yoggsaron.cpp:300
#define SPELL_PSYCHOSIS
Definition: boss_yoggsaron.cpp:151
@ NPC_CONSTRICTOR_TENTACLE
Definition: boss_yoggsaron.cpp:191
@ NPC_CORRUPTOR_TENTACLE
Definition: boss_yoggsaron.cpp:192
@ SARA_TRANSFORM_MODEL
Definition: boss_yoggsaron.cpp:229
@ NPC_CRUSHER_TENTACLE
Definition: boss_yoggsaron.cpp:190
@ EVADE_REASON_OTHER
Definition: CreatureAI.h:94
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition: ScriptedCreature.cpp:553
void SetPosition(float x, float y, float z, float o)
Definition: Creature.cpp:3072
void SetOrientation(float orientation)
Definition: Position.h:112
Definition: Unit.h:1302
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4722
SpellCastResult CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1226
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1410
void InitFight(Unit *target)
Definition: boss_yoggsaron.cpp:492
void SpawnTentacle(uint32 entry)
Definition: boss_yoggsaron.cpp:559
void EnterEvadeMode(EvadeReason why) override
Definition: boss_yoggsaron.cpp:419
void InformCloud()
Definition: boss_yoggsaron.cpp:541
void AddPortals()
Definition: boss_yoggsaron.cpp:583
void SummonDeathOrbs()
Definition: boss_yoggsaron.cpp:572

References _initFight, _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(), Unit::CastCustomSpell(), Unit::CastSpell(), 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, ObjectAccessor::GetCreature(), ObjectAccessor::GetGameObject(), InstanceScript::GetGuidData(), WorldObject::GetInstanceScript(), WorldObject::GetMap(), Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), GO_STATE_READY, GO_YOGG_SARON_DOORS, Unit::HasUnitState(), InformCloud(), InitFight(), Map::Is25ManRaid(), m_pInstance, ScriptedAI::me, Unit::NearTeleportTo(), NPC_BRAIN_OF_YOGG_SARON, NPC_CONSTRICTOR_TENTACLE, NPC_CORRUPTOR_TENTACLE, NPC_CRUSHER_TENTACLE, NPC_OMINOUS_CLOUD, NPC_VOICE_OF_YOGG_SARON, NPC_YOGG_SARON, RAND(), Unit::RemoveAura(), SARA_TRANSFORM_MODEL, SAY_SARA_ANGER, SAY_SARA_DEATH_RAY, SAY_SARA_FERVOR_HIT, SAY_SARA_PSYCHOSIS_HIT, SAY_SARA_TRANSFORM_2, SAY_SARA_TRANSFORM_3, SAY_SARA_TRANSFORM_4, ScriptedAI::SelectTargetFromPlayerList(), Creature::SetDisplayId(), Position::SetOrientation(), Creature::SetPosition(), SpawnTentacle(), SPELL_BRAIN_LINK, SPELL_EXTINGUISH_ALL_LIFE, SPELL_INSANE1, SPELL_MALADY_OF_THE_MIND, SPELL_PSYCHOSIS, SPELL_SARAS_ANGER_TARGET_SELECTOR, SPELL_SARAS_BLESSING_TARGET_SELECTOR, SPELL_SARAS_FAVOR_TARGET_SELECTOR, SPELL_SHATTERED_ILLUSION, SPELLVALUE_MAX_TARGETS, WorldObject::SummonCreature(), SummonDeathOrbs(), summons, TYPE_YOGGSARON, UNIT_STATE_CASTING, and urand().

Member Data Documentation

◆ _currentIllusion

uint8 boss_yoggsaron_sara::boss_yoggsaron_saraAI::_currentIllusion

Referenced by AddPortals(), and Reset().

◆ _initFight

uint32 boss_yoggsaron_sara::boss_yoggsaron_saraAI::_initFight

Referenced by Reset(), and UpdateAI().

◆ _isIllusionReversed

bool boss_yoggsaron_sara::boss_yoggsaron_saraAI::_isIllusionReversed

Referenced by AddPortals(), and Reset().

◆ _keepersGUID

ObjectGuid boss_yoggsaron_sara::boss_yoggsaron_saraAI::_keepersGUID[4]

Referenced by DoAction(), GetData(), JustSummoned(), and Reset().

◆ _p2TalkTimer

uint32 boss_yoggsaron_sara::boss_yoggsaron_saraAI::_p2TalkTimer

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

◆ _secondPhase

bool boss_yoggsaron_sara::boss_yoggsaron_saraAI::_secondPhase

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

◆ _summonedGuardiansCount

uint8 boss_yoggsaron_sara::boss_yoggsaron_saraAI::_summonedGuardiansCount

Referenced by Reset(), and UpdateAI().

◆ _summonSpeed

float boss_yoggsaron_sara::boss_yoggsaron_saraAI::_summonSpeed

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

◆ events

EventMap boss_yoggsaron_sara::boss_yoggsaron_saraAI::events

◆ m_pInstance

InstanceScript* boss_yoggsaron_sara::boss_yoggsaron_saraAI::m_pInstance

◆ summons

SummonList boss_yoggsaron_sara::boss_yoggsaron_saraAI::summons