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 DoAction (int32 param) override
 
void JustEngagedWith (Unit *who) override
 Called for reaction when initially engaged.
 
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 OnSpellCastFinished (SpellInfo const *spell, SpellFinishReason reason) 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.
 
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 (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 void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (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 *)
 
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 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
 

Private Member Functions

void SummonStartingTriggers ()
 
void SummonLavaWaves ()
 
void SendLavaWaves (bool start)
 
void RespawnDragons (bool checkCombat)
 
bool IsTargetInBounds (Unit const *victim) const
 

Private Attributes

EventMap extraEvents
 
std::list< uint32volcanoBlows
 
uint8 dragonsCount
 
uint8 lastLavaSide
 
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
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_sartharion()

boss_sartharion::boss_sartharion ( Creature creature)
inline
258 : BossAI(creature, DATA_SARTHARION),
259 dragonsCount(0),
261 usedBerserk(false),
262 below11PctReached(false)
263 {
264 }
@ LAVA_RIGHT_SIDE
Definition boss_sartharion.cpp:139
Definition ScriptedCreature.h:482
@ DATA_SARTHARION
Definition obsidian_sanctum.h:30
bool below11PctReached
Definition boss_sartharion.cpp:682
uint8 dragonsCount
Definition boss_sartharion.cpp:679
bool usedBerserk
Definition boss_sartharion.cpp:681
uint8 lastLavaSide
Definition boss_sartharion.cpp:680

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.

407 {
408 // Temporal hack, by some case some melee spells can bypass this aura damage reduction
410 {
411 damage = 0;
412 return;
413 }
414
415 if (!usedBerserk && me->HealthBelowPctDamaged(30, damage))
416 {
418 usedBerserk = true;
419 return;
420 }
421
422 // Soft enrage
423 if (!below11PctReached && me->HealthBelowPctDamaged(10, damage))
424 {
426 if (!summons.empty())
427 {
428 for (ObjectGuid const& summonGuid : summons)
429 {
430 Creature* summon = ObjectAccessor::GetCreature(*me, summonGuid);
431 if (summon && summon->GetEntry() == NPC_FIRE_CYCLONE)
432 summon->CastSpell(summon, SPELL_CYCLONE_AURA_PERIODIC, true);
433 }
434 }
436 below11PctReached = true;
437 }
438 }
@ SAY_SARTHARION_BERSERK
Definition boss_sartharion.cpp:29
@ SPELL_SARTHARION_BERSERK
Definition boss_sartharion.cpp:89
@ SPELL_GIFT_OF_TWILIGHT_FIRE
Definition boss_sartharion.cpp:97
@ SPELL_CYCLONE_AURA_PERIODIC
Definition boss_sartharion.cpp:84
SummonList summons
Definition ScriptedCreature.h:534
Definition Creature.h:47
Definition ObjectGuid.h:118
uint32 GetEntry() const
Definition Object.h:116
bool empty() const
Definition ScriptedCreature.h:73
void RemoveNotExisting()
Definition ScriptedCreature.cpp:83
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:391
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5851
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
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:1102
Talk
Definition hyjal.cpp:82
Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:210
@ 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.

280 {
281 if (param == ACTION_DRAKE_DIED)
283 }
@ ACTION_DRAKE_DIED
Definition boss_sartharion.cpp:130
@ SPELL_SARTHARION_TWILIGHT_REVENGE
Definition boss_sartharion.cpp:90

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

◆ GetData()

uint32 boss_sartharion::GetData ( uint32  dataOrGuid) const
inlineoverridevirtual

Reimplemented from UnitAI.

369 {
370 // it means we want dragons count
371 if (dataOrGuid == DATA_ACHIEVEMENT_DRAGONS_COUNT)
372 return dragonsCount;
373
374 // otherwise it is guid to check if player was hit by lava strike :)
375 if (!volcanoBlows.empty() && std::find(volcanoBlows.begin(), volcanoBlows.end(), dataOrGuid) != volcanoBlows.end())
376 return 1;
377
378 return 0;
379 }
@ DATA_ACHIEVEMENT_DRAGONS_COUNT
Definition obsidian_sanctum.h:37
std::list< uint32 > volcanoBlows
Definition boss_sartharion.cpp:678

References DATA_ACHIEVEMENT_DRAGONS_COUNT, dragonsCount, and volcanoBlows.

◆ IsTargetInBounds()

bool boss_sartharion::IsTargetInBounds ( Unit const *  victim) const
inlineprivate
666 {
667 if (!victim || victim->GetPositionX() < SartharionBoundary[0] || victim->GetPositionX() > SartharionBoundary[1] || victim->GetPositionY() > SartharionBoundary[3])
668 return false;
669
670 // Big island handling
671 if (victim->GetPositionY() < SartharionBoundary[2])
672 return victim->GetDistance(bigIslandMiddlePos) <= 6.0f;
673
674 return true;
675 }
const Position bigIslandMiddlePos
Definition boss_sartharion.cpp:248
float const SartharionBoundary[MAX_BOUNDARY_POSITIONS]
Definition boss_sartharion.cpp:227

References bigIslandMiddlePos, WorldObject::GetDistance(), Position::GetPositionX(), Position::GetPositionY(), and SartharionBoundary.

Referenced by JustEngagedWith(), and UpdateAI().

◆ JustDied()

void boss_sartharion::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

351 {
352 RespawnDragons(true);
353 _JustDied();
355 }
@ SAY_SARTHARION_DEATH
Definition boss_sartharion.cpp:34
void _JustDied()
Definition ScriptedCreature.cpp:654
void RespawnDragons(bool checkCombat)
Definition boss_sartharion.cpp:645

References BossAI::_JustDied(), RespawnDragons(), and SAY_SARTHARION_DEATH.

◆ JustEngagedWith()

void boss_sartharion::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from CreatureAI.

286 {
287 if (who && !IsTargetInBounds(who))
288 {
290 return;
291 }
292
296
297 // Combat events
298 events.ScheduleEvent(EVENT_SARTHARION_CAST_CLEAVE, 7s);
299 events.ScheduleEvent(EVENT_SARTHARION_CAST_FLAME_BREATH, 15s);
300 events.ScheduleEvent(EVENT_SARTHARION_CAST_TAIL_LASH, 11s);
301
302 // Extra events
307
308 // Store dragons
309 for (uint8 i = 0; i < MAX_DRAGONS; ++i)
310 {
312 if (!dragon || !dragon->IsAlive() || instance->GetBossState(dragons[i]) == DONE)
313 continue;
314
315 dragon->SetImmuneToNPC(true);
316 dragon->SetFullHealth();
317
318 ++dragonsCount;
320
321 switch (dragons[i])
322 {
323 case DATA_TENEBRON:
324 {
325 dragon->CastSpell(dragon, SPELL_POWER_OF_TENEBRON, true);
327 break;
328 }
329 case DATA_SHADRON:
330 {
331 dragon->CastSpell(dragon, SPELL_POWER_OF_SHADRON, true);
333 break;
334 }
335 case DATA_VESPERON:
336 {
337 dragon->CastSpell(dragon, SPELL_POWER_OF_VESPERON, true);
339 break;
340 }
341 }
342 }
343
344 if (dragonsCount)
346
347 me->CallForHelp(500.0f);
348 }
std::uint8_t uint8
Definition Define.h:109
@ DONE
Definition InstanceScript.h:61
@ SAY_SARTHARION_AGGRO
Definition boss_sartharion.cpp:28
const uint32 dragons[MAX_DRAGONS]
Definition boss_sartharion.cpp:250
@ MAX_DRAGONS
Definition boss_sartharion.cpp:144
@ SPELL_POWER_OF_VESPERON
Definition boss_sartharion.cpp:95
@ SPELL_POWER_OF_SHADRON
Definition boss_sartharion.cpp:96
@ SPELL_POWER_OF_TENEBRON
Definition boss_sartharion.cpp:94
@ SPELL_WILL_OF_SARTHARION
Definition boss_sartharion.cpp:93
@ SPELL_SARTHARION_PYROBUFFET
Definition boss_sartharion.cpp:88
@ EVENT_SARTHARION_LAVA_STRIKE
Definition boss_sartharion.cpp:168
@ EVENT_SARTHARION_CALL_TENEBRON
Definition boss_sartharion.cpp:172
@ EVENT_SARTHARION_CAST_TAIL_LASH
Definition boss_sartharion.cpp:164
@ EVENT_SARTHARION_CALL_SHADRON
Definition boss_sartharion.cpp:173
@ EVENT_SARTHARION_CAST_CLEAVE
Definition boss_sartharion.cpp:162
@ EVENT_SARTHARION_SUMMON_LAVA
Definition boss_sartharion.cpp:165
@ EVENT_SARTHARION_CAST_FLAME_BREATH
Definition boss_sartharion.cpp:163
@ EVENT_SARTHARION_BOUNDARY
Definition boss_sartharion.cpp:176
@ EVENT_SARTHARION_CALL_VESPERON
Definition boss_sartharion.cpp:174
@ EVENT_SARTHARION_BERSERK
Definition boss_sartharion.cpp:169
events
Definition boss_sartura.cpp:43
InstanceScript *const instance
Definition ScriptedCreature.h:489
void _JustEngagedWith()
Definition ScriptedCreature.cpp:667
void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER) override
Definition ScriptedCreature.h:521
void AddLootMode(uint16 lootMode)
Definition Creature.h:245
void CallForHelp(float fRadius, Unit *target=nullptr)
Definition Creature.cpp:2421
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:110
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:242
void SetFullHealth()
Definition Unit.h:1111
void SetImmuneToNPC(bool apply, bool keepCombat=false)
Definition Unit.cpp:13781
bool IsAlive() const
Definition Unit.h:1773
@ DATA_VESPERON
Definition obsidian_sanctum.h:32
@ DATA_TENEBRON
Definition obsidian_sanctum.h:31
@ DATA_SHADRON
Definition obsidian_sanctum.h:33
EventMap extraEvents
Definition boss_sartharion.cpp:677
bool IsTargetInBounds(Unit const *victim) const
Definition boss_sartharion.cpp:665

References BossAI::_JustEngagedWith(), Creature::AddLootMode(), Creature::CallForHelp(), Unit::CastSpell(), DATA_SHADRON, DATA_TENEBRON, DATA_VESPERON, UnitAI::DoCastSelf(), DONE, dragons, dragonsCount, BossAI::EnterEvadeMode(), EVENT_SARTHARION_BERSERK, EVENT_SARTHARION_BOUNDARY, 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(), IsTargetInBounds(), MAX_DRAGONS, ScriptedAI::me, SAY_SARTHARION_AGGRO, EventMap::ScheduleEvent(), Unit::SetFullHealth(), Unit::SetImmuneToNPC(), SPELL_POWER_OF_SHADRON, SPELL_POWER_OF_TENEBRON, SPELL_POWER_OF_VESPERON, SPELL_SARTHARION_PYROBUFFET, and SPELL_WILL_OF_SARTHARION.

◆ JustSummoned()

void boss_sartharion::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

388 {
389 switch (summon->GetEntry())
390 {
392 {
393 summon->SetSpeed(MOVE_FLIGHT, 1.5f);
394 break;
395 }
396 case NPC_FIRE_CYCLONE:
397 {
398 summon->GetMotionMaster()->MoveRandom(5.0f);
399 break;
400 }
401 }
402
403 summons.Summon(summon);
404 }
@ MOVE_FLIGHT
Definition UnitDefines.h:359
@ NPC_FLAME_TSUNAMI
Definition boss_sartharion.cpp:121
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:243
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88
MotionMaster * GetMotionMaster()
Definition Unit.h:1738
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition Unit.cpp:14606

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.

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

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

◆ Reset()

void boss_sartharion::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

267 {
268 _Reset();
270 RespawnDragons(false);
272 usedBerserk = false;
273 below11PctReached = false;
274 dragonsCount = 0;
275 volcanoBlows.clear();
277 }
void _Reset()
Definition ScriptedCreature.cpp:634
void Reset()
Definition EventMap.cpp:21
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition InstanceScript.cpp:683
@ SPELL_TWILIGHT_SHIFT
Definition obsidian_sanctum.h:52
void SummonStartingTriggers()
Definition boss_sartharion.cpp:573

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

◆ RespawnDragons()

void boss_sartharion::RespawnDragons ( bool  checkCombat)
inlineprivate
646 {
647 for (uint8 i = 0; i < MAX_DRAGONS; ++i)
648 {
649 if (instance->GetBossState(dragons[i]) == DONE)
650 continue;
651
653 {
654 if (checkCombat && dragon->IsInCombat())
655 continue;
656
657 dragon->DespawnOrUnsummon();
658 dragon->SetRespawnTime(5);
659 }
660 }
661
662 dragonsCount = 0;
663 }

References DONE, dragons, dragonsCount, InstanceScript::GetBossState(), ObjectAccessor::GetCreature(), InstanceScript::GetGuidData(), BossAI::instance, MAX_DRAGONS, and ScriptedAI::me.

Referenced by JustDied(), and Reset().

◆ SendLavaWaves()

void boss_sartharion::SendLavaWaves ( bool  start)
inlineprivate
622 {
623 if (summons.empty())
624 return;
625
626 for (ObjectGuid const& guid : summons)
627 {
628 Creature* tsunami = ObjectAccessor::GetCreature(*me, guid);
629 if (!tsunami || tsunami->GetEntry() != NPC_FLAME_TSUNAMI)
630 continue;
631
632 if (start) // Movement possibly simplified from official, ideally reevaluate in the future.
633 {
634 tsunami->CastSpell(tsunami, SPELL_FLAME_TSUNAMI_DAMAGE_AURA, true);
635 tsunami->GetMotionMaster()->MovePoint(0, ((tsunami->GetPositionX() < 3250.0f) ? 3286.0f : 3211.0f), tsunami->GetPositionY(), tsunami->GetPositionZ());
636 }
637 else
638 {
640 tsunami->SetObjectScale(0.1f);
641 }
642 }
643 }
@ SPELL_FLAME_TSUNAMI_DAMAGE_AURA
Definition boss_sartharion.cpp:105
void SetObjectScale(float scale) override
Definition Creature.cpp:3336
void MovePoint(uint32 id, const Position &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:238
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4899
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.

358 {
359 if (type == DATA_VOLCANO_BLOWS && data)
360 {
361 if (!volcanoBlows.empty() && std::find(volcanoBlows.begin(), volcanoBlows.end(), data) != volcanoBlows.end())
362 return;
363
364 volcanoBlows.push_back(data);
365 }
366 }
@ DATA_VOLCANO_BLOWS
Definition obsidian_sanctum.h:38

References DATA_VOLCANO_BLOWS, and volcanoBlows.

◆ SummonLavaWaves()

void boss_sartharion::SummonLavaWaves ( )
inlineprivate
587 {
592
593 // Send wave from left
595 {
596 for (uint8 i = 0; i < MAX_LEFT_LAVA_TSUNAMIS; ++i)
597 {
598 Creature* tsunami = me->SummonCreature(NPC_FLAME_TSUNAMI, 3211.0f, FlameTsunamiLeftOffsets[i], 57.083332f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 13500);
599
600 if (((i - 2) % 3 == 0) && tsunami) // If center of wave
601 tsunami->CastSpell(tsunami, SPELL_FLAME_TSUNAMI_VISUAL, true);
602 }
603
605 }
606 // from right
607 else
608 {
609 for (uint8 i = 0; i < MAX_RIGHT_LAVA_TSUNAMIS; ++i)
610 {
611 Creature* tsunami = me->SummonCreature(NPC_FLAME_TSUNAMI, 3286.0f, FlameTsunamiRightOffsets[i], 57.083332f, 3.14f, TEMPSUMMON_TIMED_DESPAWN, 13500);
612
613 if (((i - 2) % 3 == 0) && tsunami) // If center of wave
614 tsunami->CastSpell(tsunami, SPELL_FLAME_TSUNAMI_VISUAL, true);
615 }
616
618 }
619 }
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:50
@ WHISPER_LAVA_CHURN
Definition boss_sartharion.cpp:64
float const FlameTsunamiLeftOffsets[MAX_LEFT_LAVA_TSUNAMIS]
Definition boss_sartharion.cpp:235
@ 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
float const FlameTsunamiRightOffsets[MAX_RIGHT_LAVA_TSUNAMIS]
Definition boss_sartharion.cpp:242
@ SPELL_FLAME_TSUNAMI_VISUAL
Definition boss_sartharion.cpp:101
@ EVENT_SARTHARION_FINISH_LAVA
Definition boss_sartharion.cpp:167
@ EVENT_SARTHARION_START_LAVA
Definition boss_sartharion.cpp:166
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:2352

References Unit::CastSpell(), EVENT_SARTHARION_FINISH_LAVA, EVENT_SARTHARION_START_LAVA, extraEvents, FlameTsunamiLeftOffsets, FlameTsunamiRightOffsets, lastLavaSide, 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, and WHISPER_LAVA_CHURN.

Referenced by UpdateAI().

◆ SummonStartingTriggers()

void boss_sartharion::SummonStartingTriggers ( )
inlineprivate
574 {
575 for (uint8 i = 0; i < MAX_CYCLONE_COUNT; ++i)
576 {
578 }
579
580 for (uint8 i = 0; i < MAX_AREA_TRIGGER_COUNT; ++i)
581 {
583 }
584 }
@ MAX_CYCLONE_COUNT
Definition boss_sartharion.cpp:146
@ MAX_AREA_TRIGGER_COUNT
Definition boss_sartharion.cpp:145
@ NPC_SAFE_AREA_TRIGGER
Definition boss_sartharion.cpp:122
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, MAX_AREA_TRIGGER_COUNT, MAX_CYCLONE_COUNT, 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.

441 {
442 if (!UpdateVictim())
443 return;
444
445 extraEvents.Update(diff);
446
447 // Special events which needs to be fired immediately
448 while (uint32 const eventId = extraEvents.ExecuteEvent())
449 {
450 switch (eventId)
451 {
453 {
456 else
457 extraEvents.Repeat(250ms);
458 break;
459 }
461 {
462 if (!urand(0, 3))
464
466 extraEvents.Repeat(25s);
467 return;
468 }
470 {
471 SendLavaWaves(true);
472 return;
473 }
475 {
476 SendLavaWaves(false);
477 return;
478 }
479 // Handling of Drakes Events
480 // Dragon Calls
482 {
485 tenebron->AI()->DoAction(ACTION_CALL_DRAGON);
486 break;
487 }
489 {
492 shadron->AI()->DoAction(ACTION_CALL_DRAGON);
493 break;
494 }
496 {
499 vesperon->AI()->DoAction(ACTION_CALL_DRAGON);
500
501 break;
502 }
503 }
504 }
505
506 // Handle Sartharion combat abilities
507 events.Update(diff);
508
510 return;
511
512 while (uint32 const eventId = events.ExecuteEvent())
513 {
514 switch (eventId)
515 {
517 {
519 events.Repeat(10s);
520 break;
521 }
523 {
525 events.Repeat(20s);
526 break;
527 }
529 {
531 events.Repeat(18s);
532 break;
533 }
535 {
536 if (!urand(0, 2))
538
540 uint8 rand = urand(0, MAX_CYCLONE_COUNT - 1); // 5 - number of cyclones
541 uint8 iter = 0;
542 if (!summons.empty())
543 {
544 for (ObjectGuid const& summonGuid : summons)
545 {
546 Creature* summon = ObjectAccessor::GetCreature(*me, summonGuid);
547 if (summon && summon->GetEntry() == NPC_FIRE_CYCLONE && iter == rand)
548 {
549 summon->CastSpell(summon, SPELL_CYCLONE_AURA_PERIODIC, true);
550 ++iter;
551 }
552 }
553 }
554
555 events.Repeat((below11PctReached ? randtime(1400ms, 2s) : randtime(5s, 20s)));
556 break;
557 }
559 {
561 break;
562 }
563 }
564
566 return;
567 }
568
570 }
std::uint32_t uint32
Definition Define.h:107
Milliseconds randtime(Milliseconds min, Milliseconds max)
Definition Random.cpp:64
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
@ SAY_SARTHARION_SPECIAL_4
Definition boss_sartharion.cpp:37
@ SAY_SARTHARION_CALL_TENEBRON
Definition boss_sartharion.cpp:32
@ SAY_SARTHARION_CALL_VESPERON
Definition boss_sartharion.cpp:33
@ SAY_SARTHARION_CALL_SHADRON
Definition boss_sartharion.cpp:31
@ SAY_SARTHARION_SPECIAL
Definition boss_sartharion.cpp:35
@ ACTION_CALL_DRAGON
Definition boss_sartharion.cpp:129
@ SPELL_SARTHARION_FLAME_BREATH
Definition boss_sartharion.cpp:82
@ SPELL_SARTHARION_TAIL_LASH
Definition boss_sartharion.cpp:83
@ SPELL_SARTHARION_CLEAVE
Definition boss_sartharion.cpp:81
bool UpdateVictim()
Definition CreatureAI.cpp:277
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
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:39
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:276
Unit * GetVictim() const
Definition Unit.h:893
bool HasUnitState(const uint32 f) const
Definition Unit.h:726
void SendLavaWaves(bool start)
Definition boss_sartharion.cpp:621
void SummonLavaWaves()
Definition boss_sartharion.cpp:586

References ACTION_CALL_DRAGON, below11PctReached, Unit::CastSpell(), DATA_SHADRON, DATA_TENEBRON, DATA_VESPERON, SummonList::DespawnEntry(), UnitAI::DoCastSelf(), UnitAI::DoCastVictim(), UnitAI::DoMeleeAttackIfReady(), SummonList::empty(), BossAI::EnterEvadeMode(), EVENT_SARTHARION_BERSERK, EVENT_SARTHARION_BOUNDARY, 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(), Object::GetEntry(), InstanceScript::GetGuidData(), Unit::GetVictim(), Unit::HasUnitState(), BossAI::instance, IsTargetInBounds(), MAX_CYCLONE_COUNT, 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_SPECIAL, SAY_SARTHARION_SPECIAL_4, SendLavaWaves(), SPELL_CYCLONE_AURA_PERIODIC, SPELL_SARTHARION_CLEAVE, SPELL_SARTHARION_FLAME_BREATH, SPELL_SARTHARION_TAIL_LASH, SummonLavaWaves(), BossAI::summons, UNIT_STATE_CASTING, EventMap::Update(), CreatureAI::UpdateVictim(), and urand().

Member Data Documentation

◆ below11PctReached

bool boss_sartharion::below11PctReached
private

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

◆ dragonsCount

uint8 boss_sartharion::dragonsCount
private

◆ extraEvents

EventMap boss_sartharion::extraEvents
private

◆ lastLavaSide

uint8 boss_sartharion::lastLavaSide
private

Referenced by SummonLavaWaves().

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