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

Public Member Functions

 boss_sartharion (Creature *creature)
 
void Reset () override
 
void EnterEvadeMode (EvadeReason why) override
 
void DoAction (int32 param) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void JustDied (Unit *) override
 
void SetData (uint32 type, uint32 data) override
 
uint32 GetData (uint32 dataOrGuid) const override
 
void KilledUnit (Unit *victim) override
 
void JustSummoned (Creature *summon) override
 
void DamageTaken (Unit *, 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 BossAI
 BossAI (Creature *creature, uint32 bossId)
 
 ~BossAI () override
 
bool CanRespawn () override
 
void OnSpellCast (SpellInfo const *spell) override
 
void OnChannelFinished (SpellInfo const *spell) override
 
void OnSpellFailed (SpellInfo const *spell) override
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SummonedCreatureDespawnAll () override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
 Executes a function once the creature reaches the defined health point percent.
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
 
void ProcessHealthCheck ()
 
void ScheduleEnrageTimer (uint32 spellId, Milliseconds timer, uint8 textId=0)
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER) override
 
void JustDied (Unit *) override
 
void JustReachedHome () override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (Position const *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
Unit * DoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
Player * GetPlayerAtMinimumRange (float minRange)
 
Creature * DoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
T const & DUNGEON_MODE (T const &normal5, T const &heroic10) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25, T const &heroic10, T const &heroic25) const
 
Player * SelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObject * GetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool IsEscortNPC (bool=true) const
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void SetGUID (ObjectGuid const &, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void OnDespawn ()
 Called when the unit is about to be removed from the world (despawn, grid unload, corpse disappearing, player logging out etc.)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 To specify the caster as target if the spell is self-cast.
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false, bool withTank=true, int32 aura=0)
 Cast the spell on a random unit from the threat list.
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished.
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Private Member Functions

void SummonStartingTriggers ()
 
void SummonLavaWaves ()
 
void SendLavaWaves (bool start)
 

Private Attributes

EventMap extraEvents
 
std::list< uint32 > volcanoBlows
 
uint8 dragonsCount
 
bool usedBerserk
 
bool below11PctReached
 

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 ()
 
- Public Attributes inherited from BossAI
float callForHelpRange
 
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creature * me
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoType * AISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _JustEngagedWith ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
void _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
void TeleportCheaters ()
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
Creature * DoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from BossAI
SummonList summons
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_sartharion()

boss_sartharion::boss_sartharion ( Creature *  creature)
inlineexplicit
306 : BossAI(creature, DATA_SARTHARION),
307 dragonsCount(0),
308 usedBerserk(false),
309 below11PctReached(false)
310 {
311 callForHelpRange = 500.0f;
312 }
Definition ScriptedCreature.h:496
float callForHelpRange
Definition ScriptedCreature.h:501
@ DATA_SARTHARION
Definition obsidian_sanctum.h:30
bool below11PctReached
Definition boss_sartharion.cpp:688
uint8 dragonsCount
Definition boss_sartharion.cpp:686
bool usedBerserk
Definition boss_sartharion.cpp:687

References BossAI::callForHelpRange.

Member Function Documentation

◆ DamageTaken()

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

472 {
473 // Temporal hack, by some case some melee spells can bypass this aura damage reduction
475 {
476 damage = 0;
477 return;
478 }
479
480 if (!usedBerserk && me->HealthBelowPctDamaged(30, damage))
481 {
483 usedBerserk = true;
484 return;
485 }
486
487 // Soft enrage
488 if (!below11PctReached && me->HealthBelowPctDamaged(10, damage))
489 {
491 if (!summons.empty())
492 {
493 for (ObjectGuid const& summonGuid : summons)
494 {
495 Creature* summon = ObjectAccessor::GetCreature(*me, summonGuid);
496 if (summon && summon->GetEntry() == NPC_FIRE_CYCLONE)
497 summon->CastSpell(summon, SPELL_CYCLONE_AURA_PERIODIC, true);
498 }
499 }
501 below11PctReached = true;
502 }
503 }
@ SAY_SARTHARION_BERSERK
Definition boss_sartharion.cpp:29
@ SPELL_SARTHARION_BERSERK
Definition boss_sartharion.cpp:91
@ SPELL_GIFT_OF_TWILIGHT_FIRE
Definition boss_sartharion.cpp:100
@ SPELL_CYCLONE_AURA_PERIODIC
Definition boss_sartharion.cpp:85
SummonList summons
Definition ScriptedCreature.h:550
Definition Creature.h:47
Definition ObjectGuid.h:121
uint32 GetEntry() const
Definition Object.h:123
bool empty() const
Definition ScriptedCreature.h:73
void RemoveNotExisting()
Definition ScriptedCreature.cpp:83
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:399
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5798
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition Unit.cpp:1378
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:1131
Talk
Definition hyjal.cpp:82
Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:234
@ NPC_FIRE_CYCLONE
Definition obsidian_sanctum.h:45
Creature * me
Definition ScriptedCreature.h:292

References below11PctReached, Unit::CastSpell(), UnitAI::DoCastSelf(), SummonList::empty(), ObjectAccessor::GetCreature(), Object::GetEntry(), Unit::HasAura(), Unit::HealthBelowPctDamaged(), ScriptedAI::me, NPC_FIRE_CYCLONE, SummonList::RemoveNotExisting(), SAY_SARTHARION_BERSERK, SPELL_CYCLONE_AURA_PERIODIC, SPELL_GIFT_OF_TWILIGHT_FIRE, SPELL_SARTHARION_BERSERK, BossAI::summons, and usedBerserk.

◆ DoAction()

void boss_sartharion::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

343 {
344 if (param == ACTION_DRAKE_DIED)
346 }
@ ACTION_DRAKE_DIED
Definition boss_sartharion.cpp:132
@ SPELL_SARTHARION_TWILIGHT_REVENGE
Definition boss_sartharion.cpp:93

References ACTION_DRAKE_DIED, UnitAI::DoCastSelf(), and SPELL_SARTHARION_TWILIGHT_REVENGE.

◆ EnterEvadeMode()

void boss_sartharion::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

328 {
330
331 // Despawn drakes
332 for (uint32 i : dragons)
333 {
334 if (instance->GetBossState(i) == DONE)
335 continue;
336
337 if (Creature* boss = instance->GetCreature(i) )
338 boss->DespawnOnEvade();
339 }
340 }
std::uint32_t uint32
Definition Define.h:107
@ DONE
Definition InstanceScript.h:61
const uint32 dragons[MAX_DRAGONS]
Definition boss_sartharion.cpp:281
InstanceScript *const instance
Definition ScriptedCreature.h:503
void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER) override
Definition ScriptedCreature.h:537
Creature * GetCreature(uint32 type)
Definition InstanceScript.cpp:126
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:252

References DONE, dragons, BossAI::EnterEvadeMode(), InstanceScript::GetBossState(), InstanceScript::GetCreature(), and BossAI::instance.

◆ GetData()

uint32 boss_sartharion::GetData ( uint32  dataOrGuid) const
inlineoverridevirtual

Reimplemented from UnitAI.

434 {
435 // it means we want dragons count
436 if (dataOrGuid == DATA_ACHIEVEMENT_DRAGONS_COUNT)
437 return dragonsCount;
438
439 // otherwise it is guid to check if player was hit by lava strike :)
440 if (!volcanoBlows.empty() && std::find(volcanoBlows.begin(), volcanoBlows.end(), dataOrGuid) != volcanoBlows.end())
441 return 1;
442
443 return 0;
444 }
@ DATA_ACHIEVEMENT_DRAGONS_COUNT
Definition obsidian_sanctum.h:37
std::list< uint32 > volcanoBlows
Definition boss_sartharion.cpp:685

References DATA_ACHIEVEMENT_DRAGONS_COUNT, dragonsCount, and volcanoBlows.

◆ JustDied()

void boss_sartharion::JustDied ( Unit *  )
inlineoverridevirtual

Reimplemented from CreatureAI.

409 {
410 _JustDied();
412
413 // Despawn remaining drakes
414 for (uint32 i : dragons)
415 if (Creature* boss = instance->GetCreature(i))
416 boss->DespawnOrUnsummon();
417
420 }
@ SAY_SARTHARION_DEATH
Definition boss_sartharion.cpp:34
void _JustDied()
Definition ScriptedCreature.cpp:668
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition InstanceScript.cpp:707
@ SPELL_TWILIGHT_TORMENT_VESPERON
Definition obsidian_sanctum.h:53
@ SPELL_TWILIGHT_TORMENT_SARTHARION
Definition obsidian_sanctum.h:55

References BossAI::_JustDied(), InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), dragons, InstanceScript::GetCreature(), BossAI::instance, SAY_SARTHARION_DEATH, SPELL_TWILIGHT_TORMENT_SARTHARION, and SPELL_TWILIGHT_TORMENT_VESPERON.

◆ JustEngagedWith()

void boss_sartharion::JustEngagedWith ( Unit *  )
inlineoverridevirtual

Called for reaction when initially engaged - this happens after JustEnteredCombat.

Reimplemented from CreatureAI.

349 {
354
355 // Combat events
356 events.ScheduleEvent(EVENT_SARTHARION_CAST_CLEAVE, 7s);
358 events.ScheduleEvent(EVENT_SARTHARION_CAST_TAIL_LASH, 11s);
359
360 // Extra events
364
365 // Store dragons
366 for (uint8 i = 0; i < MAX_DRAGONS; ++i)
367 {
369 if (!dragon || !dragon->IsAlive() || instance->GetBossState(dragons[i]) == DONE)
370 continue;
371
372 dragon->SetImmuneToNPC(true);
373 dragon->CastSpell(dragon, SPELL_FULL_HEAL, true);
374
375 ++dragonsCount;
377
378 switch (dragons[i])
379 {
380 case DATA_TENEBRON:
381 {
382 dragon->CastSpell(dragon, SPELL_POWER_OF_TENEBRON, true);
384 break;
385 }
386 case DATA_SHADRON:
387 {
388 dragon->CastSpell(dragon, SPELL_POWER_OF_SHADRON, true);
390 break;
391 }
392 case DATA_VESPERON:
393 {
394 dragon->CastSpell(dragon, SPELL_POWER_OF_VESPERON, true);
396 break;
397 }
398 }
399 }
400
401 if (dragonsCount)
402 {
405 }
406 }
std::uint8_t uint8
Definition Define.h:109
@ SAY_SARTHARION_AGGRO
Definition boss_sartharion.cpp:28
@ MAX_DRAGONS
Definition boss_sartharion.cpp:144
@ SPELL_POWER_OF_VESPERON
Definition boss_sartharion.cpp:98
@ SPELL_POWER_OF_SHADRON
Definition boss_sartharion.cpp:99
@ SPELL_SARTHARION_ENRAGE
Definition boss_sartharion.cpp:92
@ SPELL_POWER_OF_TENEBRON
Definition boss_sartharion.cpp:97
@ SPELL_WILL_OF_SARTHARION
Definition boss_sartharion.cpp:96
@ SPELL_FULL_HEAL
Definition boss_sartharion.cpp:109
@ SPELL_SARTHARION_PYROBUFFET
Definition boss_sartharion.cpp:90
@ EVENT_SARTHARION_LAVA_STRIKE
Definition boss_sartharion.cpp:169
@ EVENT_SARTHARION_CALL_TENEBRON
Definition boss_sartharion.cpp:173
@ EVENT_SARTHARION_CAST_TAIL_LASH
Definition boss_sartharion.cpp:165
@ EVENT_SARTHARION_CALL_SHADRON
Definition boss_sartharion.cpp:174
@ EVENT_SARTHARION_CAST_CLEAVE
Definition boss_sartharion.cpp:163
@ EVENT_SARTHARION_SUMMON_LAVA
Definition boss_sartharion.cpp:166
@ EVENT_SARTHARION_CAST_FLAME_BREATH
Definition boss_sartharion.cpp:164
@ EVENT_SARTHARION_CALL_VESPERON
Definition boss_sartharion.cpp:175
@ EVENT_SARTHARION_BERSERK
Definition boss_sartharion.cpp:170
events
Definition boss_sartura.cpp:43
void _JustEngagedWith()
Definition ScriptedCreature.cpp:681
void ScheduleEnrageTimer(uint32 spellId, Milliseconds timer, uint8 textId=0)
Definition ScriptedCreature.cpp:863
void AddLootMode(uint16 lootMode)
Definition Creature.h:248
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:48
ObjectGuid GetGuidData(uint32 type) const override
Definition InstanceScript.cpp:121
virtual void DoAction(int32)
Definition InstanceScript.h:289
void SetImmuneToNPC(bool apply, bool keepCombat=false)
Definition Unit.cpp:10444
bool IsAlive() const
Definition Unit.h:1812
@ DATA_VESPERON
Definition obsidian_sanctum.h:32
@ DATA_TENEBRON
Definition obsidian_sanctum.h:31
@ DATA_SHADRON
Definition obsidian_sanctum.h:33
@ ACTION_START_PATROL
Definition obsidian_sanctum.h:66
EventMap extraEvents
Definition boss_sartharion.cpp:684

References BossAI::_JustEngagedWith(), ACTION_START_PATROL, Creature::AddLootMode(), Unit::CastSpell(), DATA_SHADRON, DATA_TENEBRON, DATA_VESPERON, InstanceScript::DoAction(), UnitAI::DoCastSelf(), DONE, dragons, dragonsCount, EVENT_SARTHARION_BERSERK, EVENT_SARTHARION_CALL_SHADRON, EVENT_SARTHARION_CALL_TENEBRON, EVENT_SARTHARION_CALL_VESPERON, EVENT_SARTHARION_CAST_CLEAVE, EVENT_SARTHARION_CAST_FLAME_BREATH, EVENT_SARTHARION_CAST_TAIL_LASH, EVENT_SARTHARION_LAVA_STRIKE, EVENT_SARTHARION_SUMMON_LAVA, extraEvents, InstanceScript::GetBossState(), ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), BossAI::instance, Unit::IsAlive(), MAX_DRAGONS, ScriptedAI::me, SAY_SARTHARION_AGGRO, BossAI::ScheduleEnrageTimer(), EventMap::ScheduleEvent(), Unit::SetImmuneToNPC(), SPELL_FULL_HEAL, SPELL_POWER_OF_SHADRON, SPELL_POWER_OF_TENEBRON, SPELL_POWER_OF_VESPERON, SPELL_SARTHARION_ENRAGE, SPELL_SARTHARION_PYROBUFFET, and SPELL_WILL_OF_SARTHARION.

◆ JustSummoned()

void boss_sartharion::JustSummoned ( Creature *  summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

453 {
454 switch (summon->GetEntry())
455 {
457 {
458 summon->SetSpeed(MOVE_FLIGHT, 1.5f);
459 break;
460 }
461 case NPC_FIRE_CYCLONE:
462 {
463 summon->GetMotionMaster()->MoveRandom(5.0f);
464 break;
465 }
466 }
467
468 summons.Summon(summon);
469 }
@ MOVE_FLIGHT
Definition UnitDefines.h:362
@ NPC_FLAME_TSUNAMI
Definition boss_sartharion.cpp:123
void MoveRandom(float wanderDistance=0.0f)
Enable a random movement in desired range around the unit. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:245
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88
MotionMaster * GetMotionMaster()
Definition Unit.h:1774
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition Unit.cpp:11114

References Object::GetEntry(), Unit::GetMotionMaster(), MOVE_FLIGHT, MotionMaster::MoveRandom(), NPC_FIRE_CYCLONE, NPC_FLAME_TSUNAMI, Unit::SetSpeed(), SummonList::Summon(), and BossAI::summons.

◆ KilledUnit()

void boss_sartharion::KilledUnit ( Unit *  victim)
inlineoverridevirtual

Reimplemented from CreatureAI.

447 {
448 if (!urand(0, 2) && victim->IsPlayer())
450 }
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ SAY_SARTHARION_SLAY
Definition boss_sartharion.cpp:36
bool IsPlayer() const
Definition Object.h:207

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

◆ Reset()

void boss_sartharion::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

315 {
316 _Reset();
318
320 usedBerserk = false;
321 below11PctReached = false;
322 dragonsCount = 0;
323 volcanoBlows.clear();
325 }
void _Reset()
Definition ScriptedCreature.cpp:648
void Reset()
Definition EventMap.cpp:21
@ SPELL_TWILIGHT_SHIFT
Definition obsidian_sanctum.h:52
void SummonStartingTriggers()
Definition boss_sartharion.cpp:621

References BossAI::_Reset(), below11PctReached, InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), dragonsCount, extraEvents, BossAI::instance, EventMap::Reset(), SPELL_TWILIGHT_SHIFT, SummonStartingTriggers(), usedBerserk, and volcanoBlows.

◆ SendLavaWaves()

void boss_sartharion::SendLavaWaves ( bool  start)
inlineprivate
661 {
662 if (summons.empty())
663 return;
664
665 for (ObjectGuid const& guid : summons)
666 {
667 Creature* tsunami = ObjectAccessor::GetCreature(*me, guid);
668 if (!tsunami || tsunami->GetEntry() != NPC_FLAME_TSUNAMI)
669 continue;
670
671 if (start) // Movement possibly simplified from official, ideally reevaluate in the future.
672 {
673 tsunami->CastSpell(tsunami, SPELL_FLAME_TSUNAMI_DAMAGE_AURA, true);
674 tsunami->GetMotionMaster()->MovePoint(0, ((tsunami->GetPositionX() < 3250.0f) ? 3286.0f : 3211.0f), tsunami->GetPositionY(), tsunami->GetPositionZ());
675 }
676 else
677 {
679 tsunami->SetObjectScale(0.1f);
680 }
681 }
682 }
@ SPELL_FLAME_TSUNAMI_DAMAGE_AURA
Definition boss_sartharion.cpp:107
void SetObjectScale(float scale) override
Definition Creature.cpp:3591
void MovePoint(uint32 id, Position const &pos, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE, float speed=0.f, bool generatePath=true, bool forceDestination=true, std::optional< AnimTier > animTier=std::nullopt)
Definition MotionMaster.h:241
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4830
float GetPositionX() const
Definition Position.h:121

References Unit::CastSpell(), SummonList::empty(), ObjectAccessor::GetCreature(), Object::GetEntry(), Unit::GetMotionMaster(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), ScriptedAI::me, MotionMaster::MovePoint(), NPC_FLAME_TSUNAMI, Unit::RemoveAura(), Creature::SetObjectScale(), SPELL_FLAME_TSUNAMI_DAMAGE_AURA, and BossAI::summons.

Referenced by UpdateAI().

◆ SetData()

void boss_sartharion::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from UnitAI.

423 {
424 if (type == DATA_VOLCANO_BLOWS && data)
425 {
426 if (!volcanoBlows.empty() && std::find(volcanoBlows.begin(), volcanoBlows.end(), data) != volcanoBlows.end())
427 return;
428
429 volcanoBlows.push_back(data);
430 }
431 }
@ DATA_VOLCANO_BLOWS
Definition obsidian_sanctum.h:38

References DATA_VOLCANO_BLOWS, and volcanoBlows.

◆ SummonLavaWaves()

void boss_sartharion::SummonLavaWaves ( )
inlineprivate
631 {
636
637 // Randomly choose which side the wave comes from
639 {
640 for (uint8 i = 0; i < MAX_LEFT_LAVA_TSUNAMIS; ++i)
641 {
642 Creature* tsunami = me->SummonCreature(NPC_FLAME_TSUNAMI, 3211.0f, FlameTsunamiLeftOffsets[i], 57.083332f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 13500);
643
644 if (((i - 1) % 3 == 0) && tsunami) // If center of wave
645 tsunami->CastSpell(tsunami, SPELL_FLAME_TSUNAMI_VISUAL, true);
646 }
647 }
648 else
649 {
650 for (uint8 i = 0; i < MAX_RIGHT_LAVA_TSUNAMIS; ++i)
651 {
652 Creature* tsunami = me->SummonCreature(NPC_FLAME_TSUNAMI, 3286.0f, FlameTsunamiRightOffsets[i], 57.083332f, 3.14f, TEMPSUMMON_TIMED_DESPAWN, 13500);
653
654 if (((i - 1) % 3 == 0) && tsunami) // If center of wave
655 tsunami->CastSpell(tsunami, SPELL_FLAME_TSUNAMI_VISUAL, true);
656 }
657 }
658 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:52
@ WHISPER_LAVA_CHURN
Definition boss_sartharion.cpp:66
float const FlameTsunamiLeftOffsets[MAX_LEFT_LAVA_TSUNAMIS]
Definition boss_sartharion.cpp:266
@ MAX_RIGHT_LAVA_TSUNAMIS
Definition boss_sartharion.cpp:143
@ MAX_LEFT_LAVA_TSUNAMIS
Definition boss_sartharion.cpp:142
@ LAVA_LEFT_SIDE
Definition boss_sartharion.cpp:138
@ LAVA_RIGHT_SIDE
Definition boss_sartharion.cpp:139
float const FlameTsunamiRightOffsets[MAX_RIGHT_LAVA_TSUNAMIS]
Definition boss_sartharion.cpp:273
@ SPELL_FLAME_TSUNAMI_VISUAL
Definition boss_sartharion.cpp:104
@ EVENT_SARTHARION_FINISH_LAVA
Definition boss_sartharion.cpp:168
@ EVENT_SARTHARION_START_LAVA
Definition boss_sartharion.cpp:167
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2460

References Unit::CastSpell(), EVENT_SARTHARION_FINISH_LAVA, EVENT_SARTHARION_START_LAVA, extraEvents, FlameTsunamiLeftOffsets, FlameTsunamiRightOffsets, LAVA_LEFT_SIDE, LAVA_RIGHT_SIDE, MAX_LEFT_LAVA_TSUNAMIS, MAX_RIGHT_LAVA_TSUNAMIS, ScriptedAI::me, NPC_FLAME_TSUNAMI, SummonList::RemoveNotExisting(), EventMap::ScheduleEvent(), SPELL_FLAME_TSUNAMI_VISUAL, WorldObject::SummonCreature(), BossAI::summons, TEMPSUMMON_TIMED_DESPAWN, urand(), and WHISPER_LAVA_CHURN.

Referenced by UpdateAI().

◆ SummonStartingTriggers()

void boss_sartharion::SummonStartingTriggers ( )
inlineprivate
622 {
623 for (auto const& CycloneSummonPo : CycloneSummonPos)
624 me->SummonCreature(NPC_FIRE_CYCLONE, CycloneSummonPo);
625
626 for (auto const& AreaTriggerSummonPo : AreaTriggerSummonPos)
627 me->SummonCreature(NPC_SAFE_AREA_TRIGGER, AreaTriggerSummonPo);
628 }
@ NPC_SAFE_AREA_TRIGGER
Definition boss_sartharion.cpp:124
const Position CycloneSummonPos[MAX_CYCLONE_COUNT]
Definition boss_sartharion.cpp:212
const Position AreaTriggerSummonPos[MAX_AREA_TRIGGER_COUNT]
Definition boss_sartharion.cpp:221

References AreaTriggerSummonPos, CycloneSummonPos, ScriptedAI::me, NPC_FIRE_CYCLONE, NPC_SAFE_AREA_TRIGGER, and WorldObject::SummonCreature().

Referenced by Reset().

◆ UpdateAI()

void boss_sartharion::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

506 {
507 if (!UpdateVictim())
508 return;
509
510 extraEvents.Update(diff);
511
512 // Special events which needs to be fired immediately
513 while (uint32 const eventId = extraEvents.ExecuteEvent())
514 {
515 switch (eventId)
516 {
518 {
520
522 extraEvents.Repeat(25s);
523 return;
524 }
526 {
527 SendLavaWaves(true);
528 return;
529 }
531 {
532 SendLavaWaves(false);
533 return;
534 }
535 // Handling of Drakes Events
536 // Dragon Calls
538 {
541 tenebron->AI()->DoAction(ACTION_CALL_DRAGON);
542 break;
543 }
545 {
548 shadron->AI()->DoAction(ACTION_CALL_DRAGON);
549 break;
550 }
552 {
555 vesperon->AI()->DoAction(ACTION_CALL_DRAGON);
556
557 break;
558 }
560 {
564 summon->CastSpell(summon, SPELL_CYCLONE_AURA_PERIODIC, true);
565
566 extraEvents.Repeat((below11PctReached ? randtime(1400ms, 2s) : 25s));
567 break;
568 }
569 default:
570 break;
571 }
572 }
573
574 // Handle Sartharion combat abilities
575 events.Update(diff);
576
577 scheduler.Update(diff);
578
580 return;
581
582 while (uint32 const eventId = events.ExecuteEvent())
583 {
584 switch (eventId)
585 {
587 {
589 events.Repeat(10s);
590 break;
591 }
593 {
595 events.Repeat(10s);
596 break;
597 }
599 {
601 events.Repeat(18s);
602 break;
603 }
605 {
607 break;
608 }
609 default:
610 break;
611 }
612
614 return;
615 }
616
618 }
Milliseconds randtime(Milliseconds min, Milliseconds max)
Definition Random.cpp:64
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ SAY_SARTHARION_CALL_TENEBRON
Definition boss_sartharion.cpp:32
@ SAY_SARTHARION_CALL_VESPERON
Definition boss_sartharion.cpp:33
@ SAY_SARTHARION_LAVA
Definition boss_sartharion.cpp:37
@ SAY_SARTHARION_CALL_SHADRON
Definition boss_sartharion.cpp:31
@ SAY_SARTHARION_CYCLONE
Definition boss_sartharion.cpp:35
@ ACTION_CALL_DRAGON
Definition boss_sartharion.cpp:131
@ SPELL_SARTHARION_FLAME_BREATH
Definition boss_sartharion.cpp:83
@ SPELL_SARTHARION_TAIL_LASH
Definition boss_sartharion.cpp:84
@ SPELL_SARTHARION_CLEAVE
Definition boss_sartharion.cpp:82
TaskScheduler scheduler
Definition CreatureAI.h:74
bool UpdateVictim()
Definition CreatureAI.cpp:350
void Update(uint32 time)
Definition EventMap.h:67
void Repeat(Milliseconds time)
Definition EventMap.cpp:76
EventId ExecuteEvent()
Definition EventMap.cpp:86
void DespawnEntry(uint32 entry)
Definition ScriptedCreature.cpp:55
Creature * GetRandomCreatureWithEntry(uint32 entry) const
Definition ScriptedCreature.cpp:145
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition TaskScheduler.cpp:27
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:41
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:274
bool HasUnitState(const uint32 f) const
Definition Unit.h:742
void SendLavaWaves(bool start)
Definition boss_sartharion.cpp:660
void SummonLavaWaves()
Definition boss_sartharion.cpp:630

References ACTION_CALL_DRAGON, below11PctReached, DATA_SHADRON, DATA_TENEBRON, DATA_VESPERON, SummonList::DespawnEntry(), UnitAI::DoCastSelf(), UnitAI::DoCastVictim(), UnitAI::DoMeleeAttackIfReady(), EVENT_SARTHARION_BERSERK, EVENT_SARTHARION_CALL_SHADRON, EVENT_SARTHARION_CALL_TENEBRON, EVENT_SARTHARION_CALL_VESPERON, EVENT_SARTHARION_CAST_CLEAVE, EVENT_SARTHARION_CAST_FLAME_BREATH, EVENT_SARTHARION_CAST_TAIL_LASH, EVENT_SARTHARION_FINISH_LAVA, EVENT_SARTHARION_LAVA_STRIKE, EVENT_SARTHARION_START_LAVA, EVENT_SARTHARION_SUMMON_LAVA, EventMap::ExecuteEvent(), extraEvents, ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), SummonList::GetRandomCreatureWithEntry(), Unit::HasUnitState(), BossAI::instance, ScriptedAI::me, NPC_FIRE_CYCLONE, NPC_SAFE_AREA_TRIGGER, randtime(), SummonList::RemoveNotExisting(), EventMap::Repeat(), SAY_SARTHARION_CALL_SHADRON, SAY_SARTHARION_CALL_TENEBRON, SAY_SARTHARION_CALL_VESPERON, SAY_SARTHARION_CYCLONE, SAY_SARTHARION_LAVA, CreatureAI::scheduler, SendLavaWaves(), SPELL_CYCLONE_AURA_PERIODIC, SPELL_SARTHARION_CLEAVE, SPELL_SARTHARION_FLAME_BREATH, SPELL_SARTHARION_TAIL_LASH, SummonLavaWaves(), BossAI::summons, UNIT_STATE_CASTING, TaskScheduler::Update(), EventMap::Update(), and CreatureAI::UpdateVictim().

Member Data Documentation

◆ below11PctReached

bool boss_sartharion::below11PctReached
private

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

◆ dragonsCount

uint8 boss_sartharion::dragonsCount
private

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

◆ extraEvents

EventMap boss_sartharion::extraEvents
private

◆ usedBerserk

bool boss_sartharion::usedBerserk
private

Referenced by DamageTaken(), and Reset().

◆ volcanoBlows

std::list<uint32> boss_sartharion::volcanoBlows
private

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


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