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

Public Attributes

InstanceScriptm_pInstance
 
EventMap events
 
SummonList summons
 
uint32 _initFight
 
uint8 _summonedGuardiansCount
 
uint32 _p2TalkTimer
 
bool _secondPhase
 
float _summonSpeed
 
uint8 _currentIllusion
 
bool _isIllusionReversed
 
- Public Attributes inherited from ScriptedAI
Creatureme
 

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
  AXIS_Y
}
 
- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES ,
  EVADE_REASON_BOUNDARY ,
  EVADE_REASON_SEQUENCE_BREAK ,
  EVADE_REASON_NO_PATH ,
  EVADE_REASON_OTHER
}
 
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
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
379 : ScriptedAI(pCreature), summons(pCreature)
380 {
381 m_pInstance = pCreature->GetInstanceScript();
382 }
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1221
Definition ScriptedCreature.h:190
InstanceScript * m_pInstance
Definition boss_yoggsaron.cpp:384
SummonList summons
Definition boss_yoggsaron.cpp:386

References WorldObject::GetInstanceScript(), and m_pInstance.

Member Function Documentation

◆ AddPortals()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::AddPortals ( )
inline
582 {
583 _summonSpeed -= 0.1f;
584 Creature* cr = nullptr;
585
586 // Spawn Portals
587 for (uint8 i = 0; i < RAID_MODE(4, 10); ++i)
588 {
590 {
593 }
594 }
595
598
601 else
603 }
std::uint8_t uint8
Definition Define.h:109
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:50
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:255
@ UNIT_FLAG_DISABLE_MOVE
Definition UnitDefines.h:256
static LocationsXY yoggPortalLoc[]
Definition boss_yoggsaron.cpp:290
@ NPC_DESCEND_INTO_MADNESS
Definition boss_yoggsaron.cpp:190
Definition Creature.h:47
Definition ScriptedCreature.h:167
void DoAction(int32 info, uint16 max=0)
Definition ScriptedCreature.h:102
void SetArmor(int32 val)
Definition Unit.h:1121
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:733
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:2359
float y
Definition boss_yoggsaron.cpp:267
float x
Definition boss_yoggsaron.cpp:267
float z
Definition boss_yoggsaron.cpp:267
Creature * me
Definition ScriptedCreature.h:280
const T & RAID_MODE(const T &normal10, const T &normal25) const
Definition ScriptedCreature.h:404
bool _isIllusionReversed
Definition boss_yoggsaron.cpp:394
uint8 _currentIllusion
Definition boss_yoggsaron.cpp:393
float _summonSpeed
Definition boss_yoggsaron.cpp:392
@ NPC_BRAIN_OF_YOGG_SARON
Definition ulduar.h:125

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 UnitAI.

396{ }

Referenced by InitFight().

◆ DamageTaken()

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

703 {
704 if (who && who->GetEntry() == NPC_GUARDIAN_OF_YS && !_secondPhase)
705 {
706 damage = 25000;
707
708 // START PHASE 2
709 if (me->GetHealth() <= damage)
710 {
711 _secondPhase = true;
712 damage = 0;
713
714 events.SetPhase(EVENT_PHASE_TWO);
716
718 cr->SetVisible(false);
719
720 _p2TalkTimer++;
722 }
723 return;
724 }
725
726 damage = 0;
727 }
events
Definition boss_sartura.cpp:43
@ EVENT_PHASE_TWO
Definition boss_yoggsaron.cpp:251
@ SAY_SARA_TRANSFORM_1
Definition boss_yoggsaron.cpp:313
@ NPC_GUARDIAN_OF_YS
Definition boss_yoggsaron.cpp:178
@ NPC_YOGG_SARON
Definition boss_yoggsaron.cpp:180
uint32 GetMaxHealth() const
Definition Unit.h:1071
void SetHealth(uint32 val)
Definition Unit.cpp:15507
uint32 GetHealth() const
Definition Unit.h:1070
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
bool _secondPhase
Definition boss_yoggsaron.cpp:391
uint32 _p2TalkTimer
Definition boss_yoggsaron.cpp:390

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().

◆ DespawnGossipKeepers()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::DespawnGossipKeepers ( )
inline
517 {
518 for (uint8 i = KEEPER_FREYA; i <= KEEPER_THORIM; i++)
520 }
const uint32 TABLE_GOSSIP_ENTRY[4]
Definition boss_yoggsaron.cpp:287
void DespawnEntry(uint32 entry)
Definition ScriptedCreature.cpp:54
@ KEEPER_THORIM
Definition ulduar.h:303
@ KEEPER_FREYA
Definition ulduar.h:300

References SummonList::DespawnEntry(), KEEPER_FREYA, KEEPER_THORIM, summons, and TABLE_GOSSIP_ENTRY.

Referenced by InitFight().

◆ DoAction()

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

Reimplemented from UnitAI.

637 {
639 {
641 }
642 else if (param == ACTION_BRAIN_DAMAGED)
643 {
645
648
651
654
656 events.SetPhase(EVENT_PHASE_THREE);
657
659 me->SetVisible(false);
660 return;
661 }
662 else if (param == ACTION_YOGG_SARON_DEATH)
663 {
664 // Despawn everything but Yogg-Saron's corpse
680 me->KillSelf();
681 return;
682 }
683
684 // Determine shatter duration
685 if (param <= 0)
686 return;
687
688 // Illusion shatters (param - stun time)
690 {
691 yoggb->AI()->Talk(EMOTE_YOGG_SARON_BRAIN_SHATTERED);
692 }
693
694 Milliseconds timer = events.GetTimeUntilEvent(EVENT_SARA_P2_OPEN_PORTALS);
695 Milliseconds portalTime = (timer > 0ms ? timer : 0ms);
696 events.DelayEvents(Milliseconds(param + 100));
697 events.RescheduleEvent(EVENT_SARA_P2_OPEN_PORTALS, portalTime, 0, EVENT_PHASE_TWO);
700 }
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:27
@ SPELL_SHATTERED_ILLUSION
Definition boss_yoggsaron.cpp:119
@ DATA_GET_KEEPERS_COUNT
Definition boss_yoggsaron.cpp:259
@ ACTION_THORIM_START_STORM
Definition boss_yoggsaron.cpp:241
@ ACTION_YOGG_SARON_DEATH
Definition boss_yoggsaron.cpp:232
@ EVENT_PHASE_THREE
Definition boss_yoggsaron.cpp:252
@ ACTION_YOGG_SARON_HARD_MODE
Definition boss_yoggsaron.cpp:239
@ ACTION_DESPAWN_ADDS
Definition boss_yoggsaron.cpp:229
@ ACTION_REMOVE_STUN
Definition boss_yoggsaron.cpp:237
@ ACTION_BRAIN_DAMAGED
Definition boss_yoggsaron.cpp:236
@ ACTION_YOGG_SARON_START_P3
Definition boss_yoggsaron.cpp:238
@ EVENT_SARA_P2_REMOVE_STUN
Definition boss_yoggsaron.cpp:165
@ EVENT_SARA_P2_OPEN_PORTALS
Definition boss_yoggsaron.cpp:164
@ EMOTE_YOGG_SARON_BRAIN_SHATTERED
Definition boss_yoggsaron.cpp:325
@ NPC_CONSTRICTOR_TENTACLE
Definition boss_yoggsaron.cpp:185
@ NPC_CORRUPTOR_TENTACLE
Definition boss_yoggsaron.cpp:186
@ NPC_SANITY_WELL
Definition boss_yoggsaron.cpp:179
@ NPC_CRUSHER_TENTACLE
Definition boss_yoggsaron.cpp:184
@ NPC_VOICE_OF_YOGG_SARON
Definition boss_yoggsaron.cpp:181
@ NPC_DEATH_ORB
Definition boss_yoggsaron.cpp:189
ObjectGuid GetGuidData(uint32 type) const override
Definition InstanceScript.cpp:110
bool Is25ManRaid() const
Definition Map.h:300
void SetVisible(bool x)
Definition Unit.cpp:14320
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:1194
void RemoveAllAuras()
Definition Unit.cpp:5387
void KillSelf(bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition Unit.h:1201
Map * GetMap() const
Definition Object.h:621
Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:210
void UpdateKeeperSpawns()
Definition boss_yoggsaron.cpp:522
uint32 GetData(uint32 param) const override
Definition boss_yoggsaron.cpp:620
@ ACTION_SARA_UPDATE_SUMMON_KEEPERS
Definition ulduar.h:299
@ NPC_THORIM_GOSSIP
Definition ulduar.h:144
@ NPC_FREYA_GOSSIP
Definition ulduar.h:142
@ NPC_FREYA_KEEPER
Definition ulduar.h:146
@ NPC_MIMIRON_GOSSIP
Definition ulduar.h:145
@ NPC_MIMIRON_KEEPER
Definition ulduar.h:148
@ NPC_HODIR_GOSSIP
Definition ulduar.h:143
@ NPC_HODIR_KEEPER
Definition ulduar.h:147
@ NPC_THORIM_KEEPER
Definition ulduar.h:149

References ACTION_BRAIN_DAMAGED, ACTION_DESPAWN_ADDS, ACTION_REMOVE_STUN, ACTION_SARA_UPDATE_SUMMON_KEEPERS, ACTION_THORIM_START_STORM, ACTION_YOGG_SARON_DEATH, ACTION_YOGG_SARON_HARD_MODE, ACTION_YOGG_SARON_START_P3, Unit::CastSpell(), DATA_GET_KEEPERS_COUNT, 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(), GetData(), InstanceScript::GetGuidData(), 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_FREYA_GOSSIP, NPC_FREYA_KEEPER, NPC_HODIR_GOSSIP, NPC_HODIR_KEEPER, NPC_MIMIRON_GOSSIP, NPC_MIMIRON_KEEPER, NPC_SANITY_WELL, NPC_THORIM_GOSSIP, NPC_THORIM_KEEPER, NPC_VOICE_OF_YOGG_SARON, NPC_YOGG_SARON, Unit::RemoveAllAuras(), Unit::SetVisible(), SPELL_SHATTERED_ILLUSION, summons, and UpdateKeeperSpawns().

◆ EnableSara()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::EnableSara ( bool  apply)
inline
429 {
430 if (apply)
431 {
433 me->DisableRotate(false);
435 }
436 else
437 {
439 me->DisableRotate(true);
441 }
442 }
@ UNIT_STATE_ROOT
Definition UnitDefines.h:180
void ClearUnitState(uint32 f)
Definition Unit.h:722
void AddUnitState(uint32 f)
Definition Unit.h:720
void DisableRotate(bool apply)
Definition Unit.cpp:18306
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:734

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.

417 {
418 if (!_EnterEvadeMode(why))
419 return;
420
421 Position pos;
422 pos = me->GetHomePosition();
424 Reset();
425 me->setActive(false);
426 }
bool _EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:310
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition Creature.h:341
void NearTeleportTo(Position &pos, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
Definition Unit.cpp:19738
void setActive(bool isActiveObject)
Definition Object.cpp:1065
Definition Position.h:27
float GetOrientation() const
Definition Position.h:124
void Reset() override
Definition boss_yoggsaron.cpp:444

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.

621 {
622 if (param == DATA_GET_KEEPERS_COUNT)
623 {
624 uint8 _count = 0;
625 for (uint8 i = 0; i < 4; ++i)
626 if (m_pInstance->GetData(TYPE_WATCHERS) & (1 << i))
627 ++_count;
628 return _count;
629 }
630 else if (param == DATA_GET_SARA_PHASE)
631 return _secondPhase;
632
633 return 4; // just to be sure, return max numer of keepers
634 }
@ DATA_GET_SARA_PHASE
Definition boss_yoggsaron.cpp:261
virtual uint32 GetData(uint32) const
Definition ZoneScript.h:51
@ TYPE_WATCHERS
Definition ulduar.h:46

References _secondPhase, DATA_GET_KEEPERS_COUNT, DATA_GET_SARA_PHASE, ZoneScript::GetData(), m_pInstance, and TYPE_WATCHERS.

Referenced by DoAction().

◆ InformCloud()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::InformCloud ( )
inline
540 {
541 Creature* cloud = nullptr;
542 for (SummonList::const_iterator itr = summons.begin(); itr != summons.end();)
543 {
544 Creature* summon = ObjectAccessor::GetCreature(*me, *itr);
545 ++itr;
546 if (!summon || summon->GetEntry() != NPC_OMINOUS_CLOUD || me->GetDistance(summon) < 20)
547 continue;
548
549 if ((!cloud || (urand(0, 1) && !summon->HasAura(SPELL_SUMMON_GUARDIAN_OF_YS))))
550 cloud = summon;
551 }
552
553 if (cloud)
555 }
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:230
@ NPC_OMINOUS_CLOUD
Definition boss_yoggsaron.cpp:177
CreatureAI * AI() const
Definition Creature.h:145
uint32 GetEntry() const
Definition Object.h:116
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
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5789
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1278

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
488 {
489 if (!m_pInstance)
490 return;
491
492 // some simple hack checks
494 return;
495
499 AttackStart(target);
500
502 // Engage Keepers
504
506
507 events.ScheduleEvent(EVENT_SARA_P1_DOORS_CLOSE, 15s, 0, EVENT_PHASE_ONE);
508 events.ScheduleEvent(EVENT_SARA_P1_BERSERK, 15min, 0, 0);
509 events.ScheduleEvent(EVENT_SARA_P1_SUMMON, 0ms, 0, EVENT_PHASE_ONE);
510 events.SetPhase(EVENT_PHASE_ONE);
511
513 me->setActive(true);
514 }
@ ACHIEVEMENT_TIMED_TYPE_EVENT
Definition DBCEnums.h:110
@ IN_PROGRESS
Definition InstanceScript.h:59
@ DONE
Definition InstanceScript.h:61
@ SPELL_SANITY_BASE
Definition boss_yoggsaron.cpp:53
@ CRITERIA_NOT_GETTING_OLDER
Definition boss_yoggsaron.cpp:254
@ EVENT_PHASE_ONE
Definition boss_yoggsaron.cpp:250
@ EVENT_SARA_P1_SUMMON
Definition boss_yoggsaron.cpp:152
@ EVENT_SARA_P1_DOORS_CLOSE
Definition boss_yoggsaron.cpp:151
@ EVENT_SARA_P1_BERSERK
Definition boss_yoggsaron.cpp:154
@ SAY_SARA_AGGRO
Definition boss_yoggsaron.cpp:309
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2829
void DoStartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition InstanceScript.cpp:665
void DoZoneInCombat(uint32 entry=0)
Definition ScriptedCreature.cpp:40
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
void AttackStart(Unit *) override
Definition boss_yoggsaron.cpp:396
void DespawnGossipKeepers()
Definition boss_yoggsaron.cpp:516
@ TYPE_VEZAX
Definition ulduar.h:43
@ TYPE_XT002
Definition ulduar.h:35
@ TYPE_YOGGSARON
Definition ulduar.h:44

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

Referenced by UpdateAI().

◆ JustSummoned()

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

Reimplemented from CreatureAI.

400 {
401 summons.Summon(summon);
402 }
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88

References SummonList::Summon(), and summons.

◆ KilledUnit()

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

Reimplemented from CreatureAI.

606 {
607 if (who->IsPlayer())
608 {
610 }
611 }
@ SAY_SARA_KILL
Definition boss_yoggsaron.cpp:312
bool IsPlayer() const
Definition Object.h:201

References Object::IsPlayer(), and SAY_SARA_KILL.

◆ MoveInLineOfSight()

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

Reimplemented from CreatureAI.

397{ }

◆ Reset()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

445 {
446 if (!_secondPhase) // Phase 1 wipe
447 {
448 me->GetMap()->DoForAllPlayers([&](Player* player)
449 {
451 {
452 voice->AI()->Talk(WHISPER_VOICE_PHASE_1_WIPE, player);
453 }
454 });
455 }
456
458 events.Reset();
460
461 me->SetVisible(true);
463 me->SetDisableGravity(true);
464 EnableSara(false);
465 SpawnClouds();
466
467 _initFight = 1;
468
471 _p2TalkTimer = 0;
472 _secondPhase = false;
473 _summonSpeed = 1.0f;
474 _currentIllusion = urand(1, 3);
476
477 if (m_pInstance)
478 {
483 go->SetGoState(GO_STATE_ACTIVE);
484 }
485 }
@ GO_STATE_ACTIVE
Definition GameObjectData.h:691
@ NOT_STARTED
Definition InstanceScript.h:58
@ SPELL_SANITY
Definition boss_yoggsaron.cpp:54
void SetDisplayId(uint32 displayId, float displayScale=1.f) override
Definition Creature.cpp:3412
Definition GameObject.h:120
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition InstanceScript.cpp:683
void DoStopTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition InstanceScript.cpp:674
void DoForAllPlayers(std::function< void(Player *)> exec)
Definition Map.cpp:2911
Definition Player.h:1071
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:71
uint32 GetNativeDisplayId() const
Definition Unit.h:1930
void SetDisableGravity(bool disable)
Definition Unit.cpp:20331
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2450
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:184
uint32 _initFight
Definition boss_yoggsaron.cpp:388
void EnableSara(bool apply)
Definition boss_yoggsaron.cpp:428
uint8 _summonedGuardiansCount
Definition boss_yoggsaron.cpp:389
void SpawnClouds()
Definition boss_yoggsaron.cpp:404
@ GO_YOGG_SARON_DOORS
Definition ulduar.h:245

References _currentIllusion, _initFight, _isIllusionReversed, _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(), Unit::SetDisableGravity(), Creature::SetDisplayId(), Unit::SetVisible(), SpawnClouds(), SPELL_SANITY, summons, TYPE_YOGGSARON, UpdateKeeperSpawns(), and urand().

Referenced by EnterEvadeMode().

◆ SpawnClouds()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::SpawnClouds ( )
inline
405 {
406 for (uint8 i = 0; i < 6; ++i)
407 {
408 float Zplus = i > 2 ? (i - 2) * 1.6f : 0;
409 if (i % 2)
410 me->SummonCreature(NPC_OMINOUS_CLOUD, me->GetPositionX() + 8 + i * 7, me->GetPositionY() + 8 + i * 7, 326 + Zplus, 0);
411 else
412 me->SummonCreature(NPC_OMINOUS_CLOUD, me->GetPositionX() - 8 - i * 7, me->GetPositionY() - 8 - i * 7, 326 + Zplus, 0);
413 }
414 }

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
558 {
559 uint32 dist = urand(38, 48);
560 float o = rand_norm() * M_PI * 2;
561 float Zplus = (dist - 38) / 6.5f;
562 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))
563 {
564 cr->CastSpell(cr, SPELL_TENTACLE_ERUPT, true);
565 cr->CastSpell(cr, SPELL_VOID_ZONE_SMALL, true);
566 cr->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE);
567 }
568 }
std::uint32_t uint32
Definition Define.h:107
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:53
double rand_norm()
Definition Random.cpp:85
@ EMOTE_ONESHOT_EMERGE
Definition SharedDefines.h:2054
@ SPELL_TENTACLE_ERUPT
Definition boss_yoggsaron.cpp:97
@ SPELL_VOID_ZONE_SMALL
Definition boss_yoggsaron.cpp:95

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().

◆ SpellHitTarget()

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

Reimplemented from CreatureAI.

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

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

◆ SummonDeathOrbs()

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

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  )
inlineoverridevirtual

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

Implements UnitAI.

730 {
731 if (_initFight)
732 {
733 _initFight += diff;
734 if (_initFight > 5000)
735 {
736 if (Unit* target = SelectTargetFromPlayerList(90))
737 {
738 _initFight = 0;
739 InitFight(target);
740 }
741 else
742 _initFight = 1;
743 }
744 return;
745 }
746
748 {
751 return;
752 }
753
754 if (_p2TalkTimer)
755 {
756 _p2TalkTimer += diff;
757 if (_p2TalkTimer >= 4000 && _p2TalkTimer < 20000)
758 {
762 _p2TalkTimer = 20000;
763 }
764 else if (_p2TalkTimer >= 25000 && _p2TalkTimer < 40000)
765 {
768 _p2TalkTimer = 40000;
769 }
770 else if (_p2TalkTimer >= 44500 && _p2TalkTimer < 60000)
771 {
773 _p2TalkTimer = 60000;
774 }
775 else if (_p2TalkTimer >= 64000)
776 {
779 _p2TalkTimer = 0;
780 events.ScheduleEvent(EVENT_SARA_P2_START, 500ms, 0, EVENT_PHASE_TWO);
781 }
782 return;
783 }
784
785 events.Update(diff);
787 return;
788
789 switch (events.ExecuteEvent())
790 {
792 // Whispers of YS
794
795 if (m_pInstance)
797 go->SetGoState(GO_STATE_READY);
798
799 events.ScheduleEvent(EVENT_SARA_P1_SPELLS, 0ms, 1, EVENT_PHASE_ONE);
800 break;
802 events.Repeat(Milliseconds(20000 - (std::min(_summonedGuardiansCount, (uint8)5) * 2000)));
804 InformCloud();
805 break;
807 {
809 if (urand(0, 2))
810 {
812 {
814 }
815 else if (spell == SPELL_SARAS_FAVOR_TARGET_SELECTOR)
816 {
818 }
819 }
820
821 me->CastCustomSpell(spell, SPELLVALUE_MAX_TARGETS, 1, nullptr, false);
822 events.Repeat(me->GetMap()->Is25ManRaid() ? randtime(0ms, 3s) : randtime(4s, 6s));
823 break;
824 }
826 {
830
831 // Spawn Brain!
832 me->SummonCreature(NPC_BRAIN_OF_YOGG_SARON, 1981.3f, -25.43f, 265);
833 break;
834 }
837 events.Repeat(20s);
838 break;
840 if ((urand(0, 9)) == 0) // Rarely said (as it's casted every 3.5s)
841 {
843 }
845 events.Repeat(3500ms);
846 break;
850 events.Repeat(20s);
851 break;
852 case EVENT_SARA_P2_SUMMON_T1: // CRUSHER
854 events.Repeat(Milliseconds(uint32((50000 + urand(0, 10000)) * _summonSpeed)));
855 break;
856 case EVENT_SARA_P2_SUMMON_T2: // CONSTRICTOR
858 events.Repeat(Milliseconds(uint32((15000 + urand(0, 5000))* _summonSpeed)));
859 break;
860 case EVENT_SARA_P2_SUMMON_T3: // CORRUPTOR
862 events.Repeat(Milliseconds(uint32((30000 + urand(0, 10000))* _summonSpeed)));
863 break;
866 events.Repeat(30s);
867 break;
869 {
870 AddPortals();
873 events.Repeat(80s);
874 break;
875 }
877 {
880 break;
881 }
883 me->SetOrientation(M_PI);
885
888
893
894 events.ScheduleEvent(EVENT_SARA_P2_MALADY, 7s, 0, EVENT_PHASE_TWO);
895 events.ScheduleEvent(EVENT_SARA_P2_PSYCHOSIS, 3s, 0, EVENT_PHASE_TWO);
896 events.ScheduleEvent(EVENT_SARA_P2_DEATH_RAY, 15s, 0, EVENT_PHASE_TWO);
897 events.ScheduleEvent(EVENT_SARA_P2_SUMMON_T1, 50s, 60s, 0, EVENT_PHASE_TWO);
898 events.ScheduleEvent(EVENT_SARA_P2_SUMMON_T2, 15s, 20s, 0, EVENT_PHASE_TWO);
899 events.ScheduleEvent(EVENT_SARA_P2_SUMMON_T3, 30s + randtime(0ms, 10s), 0, EVENT_PHASE_TWO);
900 events.ScheduleEvent(EVENT_SARA_P2_BRAIN_LINK, 0ms, 0, EVENT_PHASE_TWO);
901 events.ScheduleEvent(EVENT_SARA_P2_OPEN_PORTALS, 60s, 0, EVENT_PHASE_TWO);
902 break;
904 if (me->GetInstanceScript())
905 {
907 {
908 yogg->AI()->Talk(EMOTE_YOGG_SARON_BERSERK);
909 }
910 }
912 events.Repeat(5s);
913 break;
914 }
915 }
static First const & RAND(First const &first, Second const &second, Rest const &... rest)
Definition CreatureAIImpl.h:25
@ GO_STATE_READY
Definition GameObjectData.h:692
Milliseconds randtime(Milliseconds min, Milliseconds max)
Definition Random.cpp:64
@ SPELLVALUE_MAX_TARGETS
Definition SpellDefines.h:117
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
@ 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_SARA_PSYCHOSIS_10
Definition boss_yoggsaron.cpp:76
@ 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:233
@ ACTION_YOGG_SARON_APPEAR
Definition boss_yoggsaron.cpp:231
@ ACTION_UNSUMMON_CLOUDS
Definition boss_yoggsaron.cpp:228
@ ACTION_YOGG_SARON_OPEN_PORTAL_YELL
Definition boss_yoggsaron.cpp:234
@ EVENT_SARA_P2_PSYCHOSIS
Definition boss_yoggsaron.cpp:163
@ EVENT_SARA_P2_SUMMON_T1
Definition boss_yoggsaron.cpp:157
@ EVENT_SARA_P2_BRAIN_LINK
Definition boss_yoggsaron.cpp:160
@ EVENT_SARA_P2_SPAWN_START_TENTACLES
Definition boss_yoggsaron.cpp:166
@ EVENT_SARA_P2_SUMMON_T3
Definition boss_yoggsaron.cpp:159
@ EVENT_SARA_P2_DEATH_RAY
Definition boss_yoggsaron.cpp:161
@ EVENT_SARA_P2_START
Definition boss_yoggsaron.cpp:156
@ EVENT_SARA_P2_MALADY
Definition boss_yoggsaron.cpp:162
@ EVENT_SARA_P2_SUMMON_T2
Definition boss_yoggsaron.cpp:158
@ EVENT_SARA_P1_SPELLS
Definition boss_yoggsaron.cpp:153
@ SAY_SARA_DEATH_RAY
Definition boss_yoggsaron.cpp:317
@ SAY_SARA_FERVOR_HIT
Definition boss_yoggsaron.cpp:310
@ EMOTE_YOGG_SARON_BERSERK
Definition boss_yoggsaron.cpp:336
@ SAY_SARA_PSYCHOSIS_HIT
Definition boss_yoggsaron.cpp:318
@ SAY_SARA_TRANSFORM_2
Definition boss_yoggsaron.cpp:314
@ SAY_SARA_TRANSFORM_3
Definition boss_yoggsaron.cpp:315
@ SAY_SARA_ANGER
Definition boss_yoggsaron.cpp:311
@ SAY_SARA_TRANSFORM_4
Definition boss_yoggsaron.cpp:316
@ SARA_TRANSFORM_MODEL
Definition boss_yoggsaron.cpp:223
@ EVADE_REASON_OTHER
Definition CreatureAI.h:94
void SetPosition(float x, float y, float z, float o)
Definition Creature.cpp:3172
Definition Unit.h:650
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4844
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:1251
bool HasUnitState(const uint32 f) const
Definition Unit.h:721
void SetOrientation(float orientation)
Definition Position.h:116
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition ScriptedCreature.cpp:563
void InitFight(Unit *target)
Definition boss_yoggsaron.cpp:487
void SpawnTentacle(uint32 entry)
Definition boss_yoggsaron.cpp:557
void EnterEvadeMode(EvadeReason why) override
Definition boss_yoggsaron.cpp:416
void InformCloud()
Definition boss_yoggsaron.cpp:539
void AddPortals()
Definition boss_yoggsaron.cpp:581
void SummonDeathOrbs()
Definition boss_yoggsaron.cpp:570

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(), randtime(), 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_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(), SummonDeathOrbs(), summons, TYPE_YOGGSARON, UNIT_STATE_CASTING, and urand().

◆ UpdateKeeperSpawns()

void boss_yoggsaron_sara::boss_yoggsaron_saraAI::UpdateKeeperSpawns ( )
inline
523 {
524 for (uint8 i = KEEPER_FREYA; i <= KEEPER_THORIM; i++)
525 {
526 if (m_pInstance->GetData(TYPE_WATCHERS) & (1 << i))
527 {
530 }
531 else if (m_pInstance->GetData(TABLE_KEEPER_TYPE[i]) == DONE)
532 {
535 }
536 }
537 }
const uint32 TABLE_KEEPER_ENTRY[4]
Definition boss_yoggsaron.cpp:286
Position const GossipKeepersPos[4]
Definition boss_yoggsaron.cpp:270
const Position KeepersPos[4]
Definition boss_yoggsaron.cpp:278
const uint32 TABLE_KEEPER_TYPE[4]
Definition boss_yoggsaron.cpp:288
bool HasEntry(uint32 entry) const
Definition ScriptedCreature.cpp:93

References DONE, ZoneScript::GetData(), GossipKeepersPos, SummonList::HasEntry(), KEEPER_FREYA, KEEPER_THORIM, KeepersPos, m_pInstance, ScriptedAI::me, WorldObject::SummonCreature(), summons, TABLE_GOSSIP_ENTRY, TABLE_KEEPER_ENTRY, TABLE_KEEPER_TYPE, and TYPE_WATCHERS.

Referenced by DoAction(), and Reset().

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().

◆ _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

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