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)
 
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 >
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
 
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
 
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
 
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 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< uint32volcanoBlows
 
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
Creatureme
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- 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)
 
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 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
309 : BossAI(creature, DATA_SARTHARION),
310 dragonsCount(0),
311 usedBerserk(false),
312 below11PctReached(false)
313 {
314 callForHelpRange = 500.0f;
315 }
Definition ScriptedCreature.h:485
float callForHelpRange
Definition ScriptedCreature.h:490
@ DATA_SARTHARION
Definition obsidian_sanctum.h:30
bool below11PctReached
Definition boss_sartharion.cpp:691
uint8 dragonsCount
Definition boss_sartharion.cpp:689
bool usedBerserk
Definition boss_sartharion.cpp:690

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.

475 {
476 // Temporal hack, by some case some melee spells can bypass this aura damage reduction
478 {
479 damage = 0;
480 return;
481 }
482
483 if (!usedBerserk && me->HealthBelowPctDamaged(30, damage))
484 {
486 usedBerserk = true;
487 return;
488 }
489
490 // Soft enrage
491 if (!below11PctReached && me->HealthBelowPctDamaged(10, damage))
492 {
494 if (!summons.empty())
495 {
496 for (ObjectGuid const& summonGuid : summons)
497 {
498 Creature* summon = ObjectAccessor::GetCreature(*me, summonGuid);
499 if (summon && summon->GetEntry() == NPC_FIRE_CYCLONE)
500 summon->CastSpell(summon, SPELL_CYCLONE_AURA_PERIODIC, true);
501 }
502 }
504 below11PctReached = true;
505 }
506 }
@ SAY_SARTHARION_BERSERK
Definition boss_sartharion.cpp:29
@ SPELL_SARTHARION_BERSERK
Definition boss_sartharion.cpp:92
@ SPELL_GIFT_OF_TWILIGHT_FIRE
Definition boss_sartharion.cpp:101
@ SPELL_CYCLONE_AURA_PERIODIC
Definition boss_sartharion.cpp:86
SummonList summons
Definition ScriptedCreature.h:539
Definition Creature.h:47
Definition ObjectGuid.h:121
uint32 GetEntry() const
Definition Object.h:117
bool empty() const
Definition ScriptedCreature.h:73
void RemoveNotExisting()
Definition ScriptedCreature.cpp:83
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:394
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:6017
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:1361
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:1118
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:281

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.

346 {
347 if (param == ACTION_DRAKE_DIED)
349 }
@ ACTION_DRAKE_DIED
Definition boss_sartharion.cpp:135
@ SPELL_SARTHARION_TWILIGHT_REVENGE
Definition boss_sartharion.cpp:94

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

◆ EnterEvadeMode()

void boss_sartharion::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

331 {
333
334 // Despawn drakes
335 for (uint32 i : dragons)
336 {
337 if (instance->GetBossState(i) == DONE)
338 continue;
339
340 if (Creature* boss = instance->GetCreature(i) )
341 boss->DespawnOnEvade();
342 }
343 }
std::uint32_t uint32
Definition Define.h:107
@ DONE
Definition InstanceScript.h:61
const uint32 dragons[MAX_DRAGONS]
Definition boss_sartharion.cpp:284
InstanceScript *const instance
Definition ScriptedCreature.h:492
void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER) override
Definition ScriptedCreature.h:526
Creature * GetCreature(uint32 type)
Definition InstanceScript.cpp:120
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.

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

References DATA_ACHIEVEMENT_DRAGONS_COUNT, dragonsCount, and volcanoBlows.

◆ JustDied()

void boss_sartharion::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

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

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.

352 {
357
358 // Combat events
359 events.ScheduleEvent(EVENT_SARTHARION_CAST_CLEAVE, 7s);
361 events.ScheduleEvent(EVENT_SARTHARION_CAST_TAIL_LASH, 11s);
362
363 // Extra events
367
368 // Store dragons
369 for (uint8 i = 0; i < MAX_DRAGONS; ++i)
370 {
372 if (!dragon || !dragon->IsAlive() || instance->GetBossState(dragons[i]) == DONE)
373 continue;
374
375 dragon->SetImmuneToNPC(true);
376 dragon->CastSpell(dragon, SPELL_FULL_HEAL, true);
377
378 ++dragonsCount;
380
381 switch (dragons[i])
382 {
383 case DATA_TENEBRON:
384 {
385 dragon->CastSpell(dragon, SPELL_POWER_OF_TENEBRON, true);
387 break;
388 }
389 case DATA_SHADRON:
390 {
391 dragon->CastSpell(dragon, SPELL_POWER_OF_SHADRON, true);
393 break;
394 }
395 case DATA_VESPERON:
396 {
397 dragon->CastSpell(dragon, SPELL_POWER_OF_VESPERON, true);
399 break;
400 }
401 }
402 }
403
404 if (dragonsCount)
405 {
408 }
409 }
std::uint8_t uint8
Definition Define.h:109
@ SAY_SARTHARION_AGGRO
Definition boss_sartharion.cpp:28
@ MAX_DRAGONS
Definition boss_sartharion.cpp:147
@ SPELL_POWER_OF_VESPERON
Definition boss_sartharion.cpp:99
@ SPELL_POWER_OF_SHADRON
Definition boss_sartharion.cpp:100
@ SPELL_SARTHARION_ENRAGE
Definition boss_sartharion.cpp:93
@ SPELL_POWER_OF_TENEBRON
Definition boss_sartharion.cpp:98
@ SPELL_WILL_OF_SARTHARION
Definition boss_sartharion.cpp:97
@ SPELL_FULL_HEAL
Definition boss_sartharion.cpp:112
@ SPELL_SARTHARION_PYROBUFFET
Definition boss_sartharion.cpp:91
@ EVENT_SARTHARION_LAVA_STRIKE
Definition boss_sartharion.cpp:172
@ EVENT_SARTHARION_CALL_TENEBRON
Definition boss_sartharion.cpp:176
@ EVENT_SARTHARION_CAST_TAIL_LASH
Definition boss_sartharion.cpp:168
@ EVENT_SARTHARION_CALL_SHADRON
Definition boss_sartharion.cpp:177
@ EVENT_SARTHARION_CAST_CLEAVE
Definition boss_sartharion.cpp:166
@ EVENT_SARTHARION_SUMMON_LAVA
Definition boss_sartharion.cpp:169
@ EVENT_SARTHARION_CAST_FLAME_BREATH
Definition boss_sartharion.cpp:167
@ EVENT_SARTHARION_CALL_VESPERON
Definition boss_sartharion.cpp:178
@ EVENT_SARTHARION_BERSERK
Definition boss_sartharion.cpp:173
events
Definition boss_sartura.cpp:43
void _JustEngagedWith()
Definition ScriptedCreature.cpp:677
void ScheduleEnrageTimer(uint32 spellId, Milliseconds timer, uint8 textId=0)
Definition ScriptedCreature.cpp:859
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:115
virtual void DoAction(int32)
Definition InstanceScript.h:286
void SetImmuneToNPC(bool apply, bool keepCombat=false)
Definition Unit.cpp:10652
bool IsAlive() const
Definition Unit.h:1793
@ 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:63
EventMap extraEvents
Definition boss_sartharion.cpp:687

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.

456 {
457 switch (summon->GetEntry())
458 {
460 {
461 summon->SetSpeed(MOVE_FLIGHT, 1.5f);
462 break;
463 }
464 case NPC_FIRE_CYCLONE:
465 {
466 summon->GetMotionMaster()->MoveRandom(5.0f);
467 break;
468 }
469 }
470
471 summons.Summon(summon);
472 }
@ MOVE_FLIGHT
Definition UnitDefines.h:362
@ NPC_FLAME_TSUNAMI
Definition boss_sartharion.cpp:126
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:1758
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition Unit.cpp:11304

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.

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

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

◆ Reset()

void boss_sartharion::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

318 {
319 _Reset();
321
323 usedBerserk = false;
324 below11PctReached = false;
325 dragonsCount = 0;
326 volcanoBlows.clear();
328 }
void _Reset()
Definition ScriptedCreature.cpp:644
void Reset()
Definition EventMap.cpp:21
@ SPELL_TWILIGHT_SHIFT
Definition obsidian_sanctum.h:52
void SummonStartingTriggers()
Definition boss_sartharion.cpp:624

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
664 {
665 if (summons.empty())
666 return;
667
668 for (ObjectGuid const& guid : summons)
669 {
670 Creature* tsunami = ObjectAccessor::GetCreature(*me, guid);
671 if (!tsunami || tsunami->GetEntry() != NPC_FLAME_TSUNAMI)
672 continue;
673
674 if (start) // Movement possibly simplified from official, ideally reevaluate in the future.
675 {
676 tsunami->CastSpell(tsunami, SPELL_FLAME_TSUNAMI_DAMAGE_AURA, true);
677 tsunami->GetMotionMaster()->MovePoint(0, ((tsunami->GetPositionX() < 3250.0f) ? 3286.0f : 3211.0f), tsunami->GetPositionY(), tsunami->GetPositionZ());
678 }
679 else
680 {
682 tsunami->SetObjectScale(0.1f);
683 }
684 }
685 }
@ SPELL_FLAME_TSUNAMI_DAMAGE_AURA
Definition boss_sartharion.cpp:109
void SetObjectScale(float scale) override
Definition Creature.cpp:3514
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:240
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:5050
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.

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

References DATA_VOLCANO_BLOWS, and volcanoBlows.

◆ SummonLavaWaves()

void boss_sartharion::SummonLavaWaves ( )
inlineprivate
634 {
639
640 // Randomly choose which side the wave comes from
642 {
643 for (uint8 i = 0; i < MAX_LEFT_LAVA_TSUNAMIS; ++i)
644 {
645 Creature* tsunami = me->SummonCreature(NPC_FLAME_TSUNAMI, 3211.0f, FlameTsunamiLeftOffsets[i], 57.083332f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 13500);
646
647 if (((i - 1) % 3 == 0) && tsunami) // If center of wave
648 tsunami->CastSpell(tsunami, SPELL_FLAME_TSUNAMI_VISUAL, true);
649 }
650 }
651 else
652 {
653 for (uint8 i = 0; i < MAX_RIGHT_LAVA_TSUNAMIS; ++i)
654 {
655 Creature* tsunami = me->SummonCreature(NPC_FLAME_TSUNAMI, 3286.0f, FlameTsunamiRightOffsets[i], 57.083332f, 3.14f, TEMPSUMMON_TIMED_DESPAWN, 13500);
656
657 if (((i - 1) % 3 == 0) && tsunami) // If center of wave
658 tsunami->CastSpell(tsunami, SPELL_FLAME_TSUNAMI_VISUAL, true);
659 }
660 }
661 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:51
@ WHISPER_LAVA_CHURN
Definition boss_sartharion.cpp:66
float const FlameTsunamiLeftOffsets[MAX_LEFT_LAVA_TSUNAMIS]
Definition boss_sartharion.cpp:269
@ MAX_RIGHT_LAVA_TSUNAMIS
Definition boss_sartharion.cpp:146
@ MAX_LEFT_LAVA_TSUNAMIS
Definition boss_sartharion.cpp:145
@ LAVA_LEFT_SIDE
Definition boss_sartharion.cpp:141
@ LAVA_RIGHT_SIDE
Definition boss_sartharion.cpp:142
float const FlameTsunamiRightOffsets[MAX_RIGHT_LAVA_TSUNAMIS]
Definition boss_sartharion.cpp:276
@ SPELL_FLAME_TSUNAMI_VISUAL
Definition boss_sartharion.cpp:105
@ EVENT_SARTHARION_FINISH_LAVA
Definition boss_sartharion.cpp:171
@ EVENT_SARTHARION_START_LAVA
Definition boss_sartharion.cpp:170
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:2448

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
625 {
626 for (auto const& CycloneSummonPo : CycloneSummonPos)
627 me->SummonCreature(NPC_FIRE_CYCLONE, CycloneSummonPo);
628
629 for (auto const& AreaTriggerSummonPo : AreaTriggerSummonPos)
630 me->SummonCreature(NPC_SAFE_AREA_TRIGGER, AreaTriggerSummonPo);
631 }
@ NPC_SAFE_AREA_TRIGGER
Definition boss_sartharion.cpp:127
const Position CycloneSummonPos[MAX_CYCLONE_COUNT]
Definition boss_sartharion.cpp:215
const Position AreaTriggerSummonPos[MAX_AREA_TRIGGER_COUNT]
Definition boss_sartharion.cpp:224

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.

509 {
510 if (!UpdateVictim())
511 return;
512
513 extraEvents.Update(diff);
514
515 // Special events which needs to be fired immediately
516 while (uint32 const eventId = extraEvents.ExecuteEvent())
517 {
518 switch (eventId)
519 {
521 {
523
525 extraEvents.Repeat(25s);
526 return;
527 }
529 {
530 SendLavaWaves(true);
531 return;
532 }
534 {
535 SendLavaWaves(false);
536 return;
537 }
538 // Handling of Drakes Events
539 // Dragon Calls
541 {
544 tenebron->AI()->DoAction(ACTION_CALL_DRAGON);
545 break;
546 }
548 {
551 shadron->AI()->DoAction(ACTION_CALL_DRAGON);
552 break;
553 }
555 {
558 vesperon->AI()->DoAction(ACTION_CALL_DRAGON);
559
560 break;
561 }
563 {
567 summon->CastSpell(summon, SPELL_CYCLONE_AURA_PERIODIC, true);
568
569 extraEvents.Repeat((below11PctReached ? randtime(1400ms, 2s) : 25s));
570 break;
571 }
572 default:
573 break;
574 }
575 }
576
577 // Handle Sartharion combat abilities
578 events.Update(diff);
579
580 scheduler.Update(diff);
581
583 return;
584
585 while (uint32 const eventId = events.ExecuteEvent())
586 {
587 switch (eventId)
588 {
590 {
592 events.Repeat(10s);
593 break;
594 }
596 {
598 events.Repeat(10s);
599 break;
600 }
602 {
604 events.Repeat(18s);
605 break;
606 }
608 {
610 break;
611 }
612 default:
613 break;
614 }
615
617 return;
618 }
619
621 }
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:134
@ SPELL_SARTHARION_FLAME_BREATH
Definition boss_sartharion.cpp:84
@ SPELL_SARTHARION_TAIL_LASH
Definition boss_sartharion.cpp:85
@ SPELL_SARTHARION_CLEAVE
Definition boss_sartharion.cpp:83
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:278
bool HasUnitState(const uint32 f) const
Definition Unit.h:737
void SendLavaWaves(bool start)
Definition boss_sartharion.cpp:663
void SummonLavaWaves()
Definition boss_sartharion.cpp:633

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: