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 (const Position *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 >
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
 
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
 
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)
 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
 
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
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_sartharion()

boss_sartharion::boss_sartharion ( Creature creature)
inlineexplicit
308 : BossAI(creature, DATA_SARTHARION),
309 dragonsCount(0),
311 usedBerserk(false),
312 below11PctReached(false)
313 {
314 }
@ LAVA_RIGHT_SIDE
Definition boss_sartharion.cpp:141
Definition ScriptedCreature.h:485
@ DATA_SARTHARION
Definition obsidian_sanctum.h:30
bool below11PctReached
Definition boss_sartharion.cpp:688
uint8 dragonsCount
Definition boss_sartharion.cpp:685
bool usedBerserk
Definition boss_sartharion.cpp:687
uint8 lastLavaSide
Definition boss_sartharion.cpp:686

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.

468 {
469 // Temporal hack, by some case some melee spells can bypass this aura damage reduction
471 {
472 damage = 0;
473 return;
474 }
475
476 if (!usedBerserk && me->HealthBelowPctDamaged(30, damage))
477 {
479 usedBerserk = true;
480 return;
481 }
482
483 // Soft enrage
484 if (!below11PctReached && me->HealthBelowPctDamaged(10, damage))
485 {
487 if (!summons.empty())
488 {
489 for (ObjectGuid const& summonGuid : summons)
490 {
491 Creature* summon = ObjectAccessor::GetCreature(*me, summonGuid);
492 if (summon && summon->GetEntry() == NPC_FIRE_CYCLONE)
493 summon->CastSpell(summon, SPELL_CYCLONE_AURA_PERIODIC, true);
494 }
495 }
497 below11PctReached = true;
498 }
499 }
@ 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:86
SummonList summons
Definition ScriptedCreature.h:539
Definition Creature.h:47
Definition ObjectGuid.h:118
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:5982
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:1350
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition Unit.h:1117
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.

345 {
346 if (param == ACTION_DRAKE_DIED)
348 }
@ ACTION_DRAKE_DIED
Definition boss_sartharion.cpp:134
@ 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.

330 {
332
333 // Despawn drakes
334 for (uint32 i : dragons)
335 {
336 if (instance->GetBossState(i) == DONE)
337 continue;
338
339 if (Creature* boss = instance->GetCreature(i) )
340 boss->DespawnOnEvade();
341 }
342 }
std::uint32_t uint32
Definition Define.h:107
@ DONE
Definition InstanceScript.h:61
const uint32 dragons[MAX_DRAGONS]
Definition boss_sartharion.cpp:283
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:115
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.

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

References DATA_ACHIEVEMENT_DRAGONS_COUNT, dragonsCount, and volcanoBlows.

◆ JustDied()

void boss_sartharion::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

413 {
414 _JustDied();
416 }
@ SAY_SARTHARION_DEATH
Definition boss_sartharion.cpp:34
void _JustDied()
Definition ScriptedCreature.cpp:664

References BossAI::_JustDied(), and SAY_SARTHARION_DEATH.

◆ JustEngagedWith()

void boss_sartharion::JustEngagedWith ( Unit )
inlineoverridevirtual

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

Reimplemented from CreatureAI.

351 {
356
357 // Combat events
358 events.ScheduleEvent(EVENT_SARTHARION_CAST_CLEAVE, 7s);
360 events.ScheduleEvent(EVENT_SARTHARION_CAST_TAIL_LASH, 11s);
361
362 // Extra events
366
367 // Store dragons
368 for (uint8 i = 0; i < MAX_DRAGONS; ++i)
369 {
371 if (!dragon || !dragon->IsAlive() || instance->GetBossState(dragons[i]) == DONE)
372 continue;
373
374 dragon->SetImmuneToNPC(true);
375 dragon->CastSpell(dragon, SPELL_FULL_HEAL, true);
376
377 ++dragonsCount;
379
380 switch (dragons[i])
381 {
382 case DATA_TENEBRON:
383 {
384 dragon->CastSpell(dragon, SPELL_POWER_OF_TENEBRON, true);
386 break;
387 }
388 case DATA_SHADRON:
389 {
390 dragon->CastSpell(dragon, SPELL_POWER_OF_SHADRON, true);
392 break;
393 }
394 case DATA_VESPERON:
395 {
396 dragon->CastSpell(dragon, SPELL_POWER_OF_VESPERON, true);
398 break;
399 }
400 }
401 }
402
403 if (dragonsCount)
404 {
407 }
408
409 me->CallForHelp(500.0f);
410 }
std::uint8_t uint8
Definition Define.h:109
@ SAY_SARTHARION_AGGRO
Definition boss_sartharion.cpp:28
@ MAX_DRAGONS
Definition boss_sartharion.cpp:146
@ 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:111
@ SPELL_SARTHARION_PYROBUFFET
Definition boss_sartharion.cpp:90
@ EVENT_SARTHARION_LAVA_STRIKE
Definition boss_sartharion.cpp:171
@ EVENT_SARTHARION_CALL_TENEBRON
Definition boss_sartharion.cpp:175
@ EVENT_SARTHARION_CAST_TAIL_LASH
Definition boss_sartharion.cpp:167
@ EVENT_SARTHARION_CALL_SHADRON
Definition boss_sartharion.cpp:176
@ EVENT_SARTHARION_CAST_CLEAVE
Definition boss_sartharion.cpp:165
@ EVENT_SARTHARION_SUMMON_LAVA
Definition boss_sartharion.cpp:168
@ EVENT_SARTHARION_CAST_FLAME_BREATH
Definition boss_sartharion.cpp:166
@ EVENT_SARTHARION_CALL_VESPERON
Definition boss_sartharion.cpp:177
@ EVENT_SARTHARION_BERSERK
Definition boss_sartharion.cpp:172
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:246
void CallForHelp(float fRadius, Unit *target=nullptr)
Definition Creature.cpp:2435
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
virtual void DoAction(int32)
Definition InstanceScript.h:284
void SetImmuneToNPC(bool apply, bool keepCombat=false)
Definition Unit.cpp:10618
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:683

References BossAI::_JustEngagedWith(), ACTION_START_PATROL, Creature::AddLootMode(), Creature::CallForHelp(), 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.

449 {
450 switch (summon->GetEntry())
451 {
453 {
454 summon->SetSpeed(MOVE_FLIGHT, 1.5f);
455 break;
456 }
457 case NPC_FIRE_CYCLONE:
458 {
459 summon->GetMotionMaster()->MoveRandom(5.0f);
460 break;
461 }
462 }
463
464 summons.Summon(summon);
465 }
@ MOVE_FLIGHT
Definition UnitDefines.h:362
@ NPC_FLAME_TSUNAMI
Definition boss_sartharion.cpp:125
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:244
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:11270

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.

443 {
444 if (!urand(0, 2) && victim->IsPlayer())
446 }
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.

317 {
318 _Reset();
320
322 usedBerserk = false;
323 below11PctReached = false;
324 dragonsCount = 0;
325 volcanoBlows.clear();
327 }
void _Reset()
Definition ScriptedCreature.cpp:644
void Reset()
Definition EventMap.cpp:21
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition InstanceScript.cpp:688
@ SPELL_TWILIGHT_SHIFT
Definition obsidian_sanctum.h:52
void SummonStartingTriggers()
Definition boss_sartharion.cpp:615

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

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

References DATA_VOLCANO_BLOWS, and volcanoBlows.

◆ SummonLavaWaves()

void boss_sartharion::SummonLavaWaves ( )
inlineprivate
625 {
630
631 // Send wave from left
633 {
634 for (uint8 i = 0; i < MAX_LEFT_LAVA_TSUNAMIS; ++i)
635 {
636 Creature* tsunami = me->SummonCreature(NPC_FLAME_TSUNAMI, 3211.0f, FlameTsunamiLeftOffsets[i], 57.083332f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 13500);
637
638 if (((i - 1) % 3 == 0) && tsunami) // If center of wave
639 tsunami->CastSpell(tsunami, SPELL_FLAME_TSUNAMI_VISUAL, true);
640 }
641
643 }
644 // from right
645 else
646 {
647 for (uint8 i = 0; i < MAX_RIGHT_LAVA_TSUNAMIS; ++i)
648 {
649 Creature* tsunami = me->SummonCreature(NPC_FLAME_TSUNAMI, 3286.0f, FlameTsunamiRightOffsets[i], 57.083332f, 3.14f, TEMPSUMMON_TIMED_DESPAWN, 13500);
650
651 if (((i - 1) % 3 == 0) && tsunami) // If center of wave
652 tsunami->CastSpell(tsunami, SPELL_FLAME_TSUNAMI_VISUAL, true);
653 }
654
656 }
657 }
@ 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:268
@ MAX_RIGHT_LAVA_TSUNAMIS
Definition boss_sartharion.cpp:145
@ MAX_LEFT_LAVA_TSUNAMIS
Definition boss_sartharion.cpp:144
@ LAVA_LEFT_SIDE
Definition boss_sartharion.cpp:140
float const FlameTsunamiRightOffsets[MAX_RIGHT_LAVA_TSUNAMIS]
Definition boss_sartharion.cpp:275
@ SPELL_FLAME_TSUNAMI_VISUAL
Definition boss_sartharion.cpp:104
@ EVENT_SARTHARION_FINISH_LAVA
Definition boss_sartharion.cpp:170
@ EVENT_SARTHARION_START_LAVA
Definition boss_sartharion.cpp:169
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:2394

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
616 {
617 for (auto const& CycloneSummonPo : CycloneSummonPos)
618 me->SummonCreature(NPC_FIRE_CYCLONE, CycloneSummonPo);
619
620 for (auto const& AreaTriggerSummonPo : AreaTriggerSummonPos)
621 me->SummonCreature(NPC_SAFE_AREA_TRIGGER, AreaTriggerSummonPo);
622 }
@ NPC_SAFE_AREA_TRIGGER
Definition boss_sartharion.cpp:126
const Position CycloneSummonPos[MAX_CYCLONE_COUNT]
Definition boss_sartharion.cpp:214
const Position AreaTriggerSummonPos[MAX_AREA_TRIGGER_COUNT]
Definition boss_sartharion.cpp:223

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.

502 {
503 if (!UpdateVictim())
504 return;
505
506 extraEvents.Update(diff);
507
508 // Special events which needs to be fired immediately
509 while (uint32 const eventId = extraEvents.ExecuteEvent())
510 {
511 switch (eventId)
512 {
514 {
516
518 extraEvents.Repeat(25s);
519 return;
520 }
522 {
523 SendLavaWaves(true);
524 return;
525 }
527 {
528 SendLavaWaves(false);
529 return;
530 }
531 // Handling of Drakes Events
532 // Dragon Calls
534 {
537 tenebron->AI()->DoAction(ACTION_CALL_DRAGON);
538 break;
539 }
541 {
544 shadron->AI()->DoAction(ACTION_CALL_DRAGON);
545 break;
546 }
548 {
551 vesperon->AI()->DoAction(ACTION_CALL_DRAGON);
552
553 break;
554 }
556 {
560 summon->CastSpell(summon, SPELL_CYCLONE_AURA_PERIODIC, true);
561
562 extraEvents.Repeat((below11PctReached ? randtime(1400ms, 2s) : 25s));
563 break;
564 }
565 default:
566 break;
567 }
568 }
569
570 // Handle Sartharion combat abilities
571 events.Update(diff);
572
574 return;
575
576 while (uint32 const eventId = events.ExecuteEvent())
577 {
578 switch (eventId)
579 {
581 {
583 events.Repeat(10s);
584 break;
585 }
587 {
589 events.Repeat(10s);
590 break;
591 }
593 {
595 events.Repeat(18s);
596 break;
597 }
599 {
601 break;
602 }
603 default:
604 break;
605 }
606
608 return;
609 }
610
612 }
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:133
@ 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
bool UpdateVictim()
Definition CreatureAI.cpp:353
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
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:40
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:277
bool HasUnitState(const uint32 f) const
Definition Unit.h:736
void SendLavaWaves(bool start)
Definition boss_sartharion.cpp:659
void SummonLavaWaves()
Definition boss_sartharion.cpp:624

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, SendLavaWaves(), SPELL_CYCLONE_AURA_PERIODIC, SPELL_SARTHARION_CLEAVE, SPELL_SARTHARION_FLAME_BREATH, SPELL_SARTHARION_TAIL_LASH, SummonLavaWaves(), BossAI::summons, UNIT_STATE_CASTING, 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

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