TrinityCore
boss_sartharion Struct Reference

Public Member Functions

 boss_sartharion (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void JustReachedHome () override
 
void JustEngagedWith (Unit *who) override
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *who) override
 
void AddDrakeLootMode ()
 
void DrakeRespawn ()
 
void FetchDragons ()
 
void CallDragon (uint32 dataId)
 
uint32 GetData (uint32 type) const override
 
void CastLavaStrikeOnTarget (Unit *target)
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
virtual ~BossAI ()
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
bool CanAIAttack (Unit const *target) const override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ScriptedAI (Creature *creature, uint32 scriptId)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
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 AddThreat (Unit *victim, float amount, Unit *who=nullptr)
 
void ModifyThreatByPercent (Unit *victim, int32 pct, Unit *who=nullptr)
 
void ResetThreat (Unit *victim, Unit *who=nullptr)
 
void ResetThreatList (Unit *who=nullptr)
 
float GetThreat (Unit const *victim, Unit const *who=nullptr)
 
void ForceCombatStop (Creature *who, bool reset=true)
 
void ForceCombatStopForCreatureEntry (uint32 entry, float maxSearchRange=250.0f, bool samePhase=true, bool reset=true)
 
void ForceCombatStopForCreatureEntry (std::vector< uint32 > creatureEntries, float maxSearchRange=250.0f, bool samePhase=true, bool reset=true)
 
void DoTeleportTo (float x, float y, float z, uint32 time=0)
 
void DoTeleportTo (float const pos[4])
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
UnitDoSelectBelowHpPctFriendlyWithEntry (uint32 entry, float range, uint8 hpPct=1, bool excludeSelf=true)
 
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, Milliseconds despawntime)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, 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)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () 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
 
- Public Member Functions inherited from CreatureAI
 CreatureAI (Creature *creature, uint32 scriptId={})
 
virtual ~CreatureAI ()
 
uint32 GetId () const
 
bool IsEngaged () const
 
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr)
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
void JustEnteredCombat (Unit *) override
 
virtual void JustStartedThreateningMe (Unit *who)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void JustSummonedGameobject (GameObject *)
 
virtual void SummonedGameobjectDespawn (GameObject *)
 
virtual void JustRegisteredDynObject (DynamicObject *)
 
virtual void JustUnregisteredDynObject (DynamicObject *)
 
virtual void JustRegisteredAreaTrigger (AreaTrigger *)
 
virtual void JustUnregisteredAreaTrigger (AreaTrigger *)
 
virtual void SpellHit (WorldObject *, SpellInfo const *)
 
virtual void SpellHitTarget (WorldObject *, SpellInfo const *)
 
virtual void OnSpellCast (SpellInfo const *)
 
virtual void OnSpellFailed (SpellInfo const *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void OnChannelFinished (SpellInfo const *)
 
virtual bool IsEscorted () const
 
virtual void JustAppeared ()
 
virtual void MovementInform (uint32, uint32)
 
void OnCharmed (bool isNew) override
 
void DoZoneInCombat (Creature *creature=nullptr)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ================== More...
 
virtual Optional< QuestGiverStatusGetDialogStatus (Player *player)
 == Gossip system ================================ More...
 
virtual bool OnGossipHello (Player *)
 
virtual bool OnGossipSelect (Player *, uint32, uint32)
 
virtual bool OnGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void OnQuestAccept (Player *, Quest const *)
 
virtual void OnQuestReward (Player *, Quest const *, LootItemType, uint32)
 
virtual void WaypointStarted (uint32, uint32)
 == Waypoints system ============================= More...
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
virtual void OnSpellClick (Unit *, bool)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual PlayerAIGetAIForCharmedPlayer (Player *)
 
int32 VisualizeBoundary (Seconds duration, Unit *owner=nullptr, bool fill=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual void InitializeAI ()
 
virtual void DoAction (int32)
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 offset, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit *> &targetList, uint32 num, SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit *> &targetList, uint32 num, SelectTargetMethod targetType, uint32 offset, PREDICATE const &predicate)
 
virtual void JustExitedCombat ()
 
virtual void LeavingWorld ()
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellInfo const *)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void SpellInterrupted (uint32, uint32)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, CastSpellExtraArgs const &args={})
 
SpellCastResult DoCastSelf (uint32 spellId, CastSpellExtraArgs const &args={})
 
SpellCastResult DoCastVictim (uint32 spellId, CastSpellExtraArgs const &args={})
 
SpellCastResult DoCastAOE (uint32 spellId, CastSpellExtraArgs const &args={})
 
virtual bool ShouldSparWith (Unit const *) const
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spellId)
 
virtual void OnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Private Attributes

bool _isBerserk
 
bool _isSoftEnraged
 
bool _isHardEnraged
 
uint8 drakeCount
 

Additional Inherited Members

- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES, EVADE_REASON_BOUNDARY, EVADE_REASON_NO_PATH, EVADE_REASON_SEQUENCE_BREAK,
  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
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
bool IsFleeing
 
- Static Public Attributes inherited from UnitAI
static std::unordered_map< std::pair< uint32, Difficulty >, AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _JustEngagedWith (Unit *who)
 
void _JustDied ()
 
void _JustReachedHome ()
 
void _DespawnAtEvade (Seconds delayToRespawn=30s, Creature *who=nullptr)
 
void TeleportCheaters ()
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
CreatureDoSummon (uint32 entry, Position const &pos, Milliseconds despawnTime=30s, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, Milliseconds despawnTime=30s, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, Milliseconds despawnTime=30s, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from BossAI
EventMap events
 
SummonList summons
 
TaskScheduler scheduler
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Constructor & Destructor Documentation

◆ boss_sartharion()

boss_sartharion::boss_sartharion ( Creature creature)
inline
130  : BossAI(creature, DATA_SARTHARION)
131  {
132  Initialize();
133  }
Definition: obsidian_sanctum.h:30
void Initialize()
Definition: boss_sartharion.cpp:135
BossAI(Creature *creature, uint32 bossId)
Definition: ScriptedCreature.cpp:493
+ Here is the call graph for this function:

Member Function Documentation

◆ AddDrakeLootMode()

void boss_sartharion::AddDrakeLootMode ( )
inline
206  {
207  if (me->HasLootMode(LOOT_MODE_HARD_MODE_2)) // Has two Drake loot modes
208  me->AddLootMode(LOOT_MODE_HARD_MODE_3); // Add 3rd Drake loot mode
209  else if (me->HasLootMode(LOOT_MODE_HARD_MODE_1)) // Has one Drake loot mode
210  me->AddLootMode(LOOT_MODE_HARD_MODE_2); // Add 2nd Drake loot mode
211  else // Has no Drake loot modes
212  me->AddLootMode(LOOT_MODE_HARD_MODE_1); // Add 1st Drake loot mode
213  }
void AddLootMode(uint16 lootMode)
Definition: Creature.h:242
bool HasLootMode(uint16 lootMode)
Definition: Creature.h:240
Definition: SharedDefines.h:71
Creature *const me
Definition: CreatureAI.h:61
Definition: SharedDefines.h:73
Definition: SharedDefines.h:72
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CallDragon()

void boss_sartharion::CallDragon ( uint32  dataId)
inline
339  {
341  {
342  if (temp->IsAlive() && !temp->GetVictim())
343  {
344  temp->SetWalk(false);
345 
346  temp->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
347 
348  uint8 textId = 0;
349 
350  switch (temp->GetEntry())
351  {
352  case NPC_TENEBRON:
354  temp->AddAura(SPELL_POWER_OF_TENEBRON, temp);
355  temp->GetMotionMaster()->MovePoint(POINT_ID_LAND, TenebronPositions[1]);
356  break;
357  case NPC_SHADRON:
359  temp->AddAura(SPELL_POWER_OF_SHADRON, temp);
360  temp->GetMotionMaster()->MovePoint(POINT_ID_LAND, ShadronPositions[1]);
361  break;
362  case NPC_VESPERON:
364  temp->AddAura(SPELL_POWER_OF_VESPERON, temp);
365  temp->GetMotionMaster()->MovePoint(POINT_ID_LAND, VesperonPositions[1]);
366  break;
367  }
368 
369  Talk(textId);
370  }
371  }
372  }
Definition: obsidian_sanctum.h:43
Definition: boss_sartharion.cpp:58
Position const VesperonPositions[]
Definition: boss_sartharion.cpp:105
Definition: Creature.h:69
Definition: obsidian_sanctum.h:41
Definition: boss_sartharion.cpp:67
Creature *const me
Definition: CreatureAI.h:61
Definition: UnitDefines.h:126
Definition: boss_sartharion.cpp:35
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:129
Definition: obsidian_sanctum.h:42
Definition: boss_sartharion.cpp:34
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:54
Definition: boss_sartharion.cpp:63
Position const ShadronPositions[]
Definition: boss_sartharion.cpp:99
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:217
Definition: boss_sartharion.cpp:36
uint8_t uint8
Definition: Define.h:145
Position const TenebronPositions[]
Definition: boss_sartharion.cpp:93
Definition: boss_sartharion.cpp:73
InstanceScript *const instance
Definition: ScriptedCreature.h:317
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CastLavaStrikeOnTarget()

void boss_sartharion::CastLavaStrikeOnTarget ( Unit target)
inline
385  {
386  std::list<Creature*> fireCyclonesList;
388  Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, fireCyclonesList, checker);
389  Cell::VisitAllObjects(me, searcher, 200.0f);
390 
391  if (fireCyclonesList.empty())
392  return;
393 
394  Trinity::Containers::SelectRandomContainerElement(fireCyclonesList)->CastSpell(target, SPELL_LAVA_STRIKE, true);
395  }
Definition: boss_sartharion.cpp:48
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition: Containers.h:119
Creature *const me
Definition: CreatureAI.h:61
Definition: GridNotifiers.h:558
Definition: boss_sartharion.cpp:50
Definition: GridNotifiers.h:1538
static void VisitAllObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:203
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DrakeRespawn()

void boss_sartharion::DrakeRespawn ( )
inline
216  {
218  {
219  tenebron->SetHomePosition(3239.07f, 657.235f, 86.8775f, 4.74729f);
220  if (tenebron->IsAlive())
221  {
222  tenebron->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
223  tenebron->GetMotionMaster()->MoveTargetedHome();
224  }
225  else
226  {
228  {
229  tenebron->Respawn();
230  tenebron->GetMotionMaster()->MoveTargetedHome();
231  tenebron->AI()->SetData(DATA_CAN_LOOT, 0);
232  }
233  }
234  }
235 
237  {
238  shadron->SetHomePosition(3363.06f, 525.28f, 98.362f, 4.76475f);
239  if (shadron->IsAlive())
240  {
241  shadron->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
242  shadron->GetMotionMaster()->MoveTargetedHome();
243  }
244  else
245  {
247  {
248  shadron->Respawn();
249  shadron->GetMotionMaster()->MoveTargetedHome();
250  shadron->AI()->SetData(DATA_CAN_LOOT, 0);
251  }
252  }
253  }
254 
256  {
257  vesperon->SetHomePosition(3145.68f, 520.71f, 89.7f, 4.64258f);
258  if (vesperon->IsAlive())
259  {
260  vesperon->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
261  vesperon->GetMotionMaster()->MoveTargetedHome();
262  }
263  else
264  {
266  {
267  vesperon->Respawn();
268  vesperon->GetMotionMaster()->MoveTargetedHome();
269  vesperon->AI()->SetData(DATA_CAN_LOOT, 0);
270  }
271  }
272  }
273  }
Definition: Creature.h:69
Definition: InstanceScript.h:67
Definition: obsidian_sanctum.h:31
Creature *const me
Definition: CreatureAI.h:61
Definition: UnitDefines.h:126
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:129
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:232
Definition: obsidian_sanctum.h:33
Definition: obsidian_sanctum.h:32
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:217
Definition: boss_sartharion.cpp:78
InstanceScript *const instance
Definition: ScriptedCreature.h:317
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FetchDragons()

void boss_sartharion::FetchDragons ( )
inline
276  {
277  me->ResetLootMode();
278  drakeCount = 0;
279 
280  //if at least one of the dragons are alive and are being called
281  bool _canUseWill = false;
282 
284  {
285  if (fetchTene->IsAlive() && !fetchTene->GetVictim())
286  {
287  _canUseWill = true;
288  if (!fetchTene->IsInCombat())
289  {
292  ++drakeCount;
293  }
294  fetchTene->GetMotionMaster()->MovePoint(POINT_ID_INIT, TenebronPositions[0]);
295 
296  fetchTene->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
297  }
298  }
299 
301  {
302  if (fetchShad->IsAlive() && !fetchShad->GetVictim())
303  {
304  _canUseWill = true;
305  if (!fetchShad->IsInCombat())
306  {
309  ++drakeCount;
310  }
311  fetchShad->GetMotionMaster()->MovePoint(POINT_ID_INIT, ShadronPositions[0]);
312 
313  fetchShad->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
314  }
315  }
316 
318  {
319  if (fetchVesp->IsAlive() && !fetchVesp->GetVictim())
320  {
321  _canUseWill = true;
322  if (!fetchVesp->IsInCombat())
323  {
326  ++drakeCount;
327  }
328  fetchVesp->GetMotionMaster()->MovePoint(POINT_ID_INIT, VesperonPositions[0]);
329 
330  fetchVesp->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
331  }
332  }
333 
334  if (_canUseWill)
336  }
Definition: boss_sartharion.cpp:58
Position const VesperonPositions[]
Definition: boss_sartharion.cpp:105
Definition: Creature.h:69
Definition: obsidian_sanctum.h:31
Definition: boss_sartharion.cpp:67
Creature *const me
Definition: CreatureAI.h:61
Definition: UnitDefines.h:126
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:129
Definition: boss_sartharion.cpp:47
uint8 drakeCount
Definition: boss_sartharion.cpp:503
Definition: obsidian_sanctum.h:33
Definition: boss_sartharion.cpp:63
Position const ShadronPositions[]
Definition: boss_sartharion.cpp:99
Definition: obsidian_sanctum.h:32
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:217
void ResetLootMode()
Definition: Creature.h:244
void AddDrakeLootMode()
Definition: boss_sartharion.cpp:205
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:112
Definition: boss_sartharion.cpp:72
Position const TenebronPositions[]
Definition: boss_sartharion.cpp:93
InstanceScript *const instance
Definition: ScriptedCreature.h:317
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetData()

uint32 boss_sartharion::GetData ( uint32  type) const
inlineoverridevirtual

Reimplemented from UnitAI.

375  {
376  if (type == TWILIGHT_ACHIEVEMENTS)
377  return drakeCount;
378 
379  return 0;
380  }
Definition: obsidian_sanctum.h:35
uint8 drakeCount
Definition: boss_sartharion.cpp:503

◆ Initialize()

void boss_sartharion::Initialize ( )
inline
136  {
137  _isBerserk = false;
138  _isSoftEnraged = false;
139  _isHardEnraged = false;
140  drakeCount = 0;
141  }
bool _isBerserk
Definition: boss_sartharion.cpp:500
uint8 drakeCount
Definition: boss_sartharion.cpp:503
bool _isHardEnraged
Definition: boss_sartharion.cpp:502
bool _isSoftEnraged
Definition: boss_sartharion.cpp:501
+ Here is the caller graph for this function:

◆ JustDied()

void boss_sartharion::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from BossAI.

180  {
182  _JustDied();
183 
185  if (tenebron->IsAlive())
186  tenebron->DisappearAndDie();
187 
189  if (shadron->IsAlive())
190  shadron->DisappearAndDie();
191 
193  if (vesperon->IsAlive())
194  vesperon->DisappearAndDie();
195  }
void _JustDied()
Definition: ScriptedCreature.cpp:517
Definition: Creature.h:69
Definition: obsidian_sanctum.h:31
Creature *const me
Definition: CreatureAI.h:61
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:129
Definition: obsidian_sanctum.h:33
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:54
Definition: boss_sartharion.cpp:37
Definition: obsidian_sanctum.h:32
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:217
InstanceScript *const instance
Definition: ScriptedCreature.h:317
+ Here is the call graph for this function:

◆ JustEngagedWith()

void boss_sartharion::JustEngagedWith ( Unit who)
inlineoverridevirtual

Reimplemented from BossAI.

162  {
165  DoZoneInCombat();
166 
167  FetchDragons();
168 
177  }
Definition: boss_sartharion.cpp:31
Definition: boss_sartharion.cpp:121
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void DoZoneInCombat(Creature *creature=nullptr)
Definition: CreatureAI.cpp:79
Definition: boss_sartharion.cpp:119
void FetchDragons()
Definition: boss_sartharion.cpp:275
Definition: boss_sartharion.cpp:116
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:54
Definition: boss_sartharion.cpp:114
Definition: boss_sartharion.cpp:120
Definition: boss_sartharion.cpp:118
Definition: boss_sartharion.cpp:117
EventMap events
Definition: ScriptedCreature.h:348
void JustEngagedWith(Unit *who) override
Definition: ScriptedCreature.h:333
Definition: boss_sartharion.cpp:115
+ Here is the call graph for this function:

◆ JustReachedHome()

void boss_sartharion::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from BossAI.

157  {
158  _Reset();
159  }
void _Reset()
Definition: ScriptedCreature.cpp:503
+ Here is the call graph for this function:

◆ KilledUnit()

void boss_sartharion::KilledUnit ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

198  {
199  if (who->GetTypeId() == TYPEID_PLAYER)
201  }
TypeID GetTypeId() const
Definition: Object.h:170
Definition: boss_sartharion.cpp:39
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:54
Definition: ObjectGuid.h:40
+ Here is the call graph for this function:

◆ Reset()

void boss_sartharion::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

144  {
145  Initialize();
146 
149 
150  me->SetHomePosition(3246.57f, 551.263f, 58.6164f, 4.66003f);
151 
152  DrakeRespawn();
154  }
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4520
Definition: boss_sartharion.cpp:49
Definition: obsidian_sanctum.h:34
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:310
Creature *const me
Definition: CreatureAI.h:61
Definition: InstanceScript.h:64
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:372
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3686
void DrakeRespawn()
Definition: boss_sartharion.cpp:215
void Initialize()
Definition: boss_sartharion.cpp:135
InstanceScript *const instance
Definition: ScriptedCreature.h:317
+ Here is the call graph for this function:

◆ UpdateAI()

void boss_sartharion::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from BossAI.

398  {
399  if (!UpdateVictim())
400  return;
401 
402  events.Update(diff);
403 
404  while (uint32 eventId = events.ExecuteEvent())
405  {
406  switch (eventId)
407  {
408  case EVENT_HARD_ENRAGE:
409  if (!_isHardEnraged)
410  {
411  DoCast(me, SPELL_PYROBUFFET, true);
412  _isHardEnraged = true;
413  }
414  break;
415  case EVENT_FLAME_TSUNAMI:
417  switch (urand(0, 1))
418  {
419  case 0:
420  {
422  right1->GetMotionMaster()->MovePoint(0, FlameRight1Direction);
424  right2->GetMotionMaster()->MovePoint(0, FlameRight2Direction);
426  right3->GetMotionMaster()->MovePoint(0, FlameRight3Direction);
427  break;
428  }
429  case 1:
430  {
432  left1->GetMotionMaster()->MovePoint(0, FlameLeft1Direction);
434  left2->GetMotionMaster()->MovePoint(0, FlameLeft2Direction);
435  break;
436  }
437  }
439  break;
440  case EVENT_FLAME_BREATH:
444  break;
445  case EVENT_TAIL_SWEEP:
448  break;
449  case EVENT_CLEAVE_ATTACK:
452  break;
453  case EVENT_LAVA_STRIKE:
454  if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
455  {
456  CastLavaStrikeOnTarget(target);
457  if (urand(0, 5) == 0)
459  }
460  if (_isSoftEnraged)
462  else
464  break;
465  case EVENT_CALL_TENEBRON:
467  break;
468  case EVENT_CALL_SHADRON:
470  break;
471  case EVENT_CALL_VESPERON:
473  break;
474  default:
475  break;
476  }
477  }
478 
479  // At 35% spell will target dragons, if they are still alive.
480  if (!_isBerserk && !HealthAbovePct(35))
481  {
483  {
486  _isBerserk = true;
487  }
488  }
489 
490  // Soft Enrage used while determining Lava Strike cooldown.
491  if (!_isSoftEnraged && HealthBelowPct(10))
492  {
493  _isSoftEnraged = true;
494  }
495 
497  }
void CastLavaStrikeOnTarget(Unit *target)
Definition: boss_sartharion.cpp:384
bool UpdateVictim()
Definition: CreatureAI.cpp:246
Position const FlameRight2Direction
Definition: boss_sartharion.cpp:84
Definition: boss_sartharion.cpp:44
Definition: boss_sartharion.cpp:52
void CallDragon(uint32 dataId)
Definition: boss_sartharion.cpp:338
Definition: boss_sartharion.cpp:121
Definition: boss_sartharion.cpp:32
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
Definition: Creature.h:69
Definition: boss_sartharion.cpp:38
Definition: InstanceScript.h:67
Unit * SelectTarget(SelectTargetMethod targetType, uint32 offset=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:102
Definition: boss_sartharion.cpp:119
Position const FlameRight1Direction
Definition: boss_sartharion.cpp:82
Definition: obsidian_sanctum.h:31
Position const FlameLeft1Spawn
Definition: boss_sartharion.cpp:87
Position const FlameRight2Spawn
Definition: boss_sartharion.cpp:83
Position const FlameRight1Spawn
Definition: boss_sartharion.cpp:81
Position const FlameRight3Spawn
Definition: boss_sartharion.cpp:85
Position const FlameLeft2Direction
Definition: boss_sartharion.cpp:90
Creature *const me
Definition: CreatureAI.h:61
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition: Object.cpp:1927
Definition: boss_sartharion.cpp:116
Definition: boss_sartharion.cpp:113
Position const FlameLeft2Spawn
Definition: boss_sartharion.cpp:89
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:232
bool _isBerserk
Definition: boss_sartharion.cpp:500
uint32_t uint32
Definition: Define.h:143
Definition: obsidian_sanctum.h:33
Definition: boss_sartharion.cpp:45
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:54
Definition: boss_sartharion.cpp:69
Definition: boss_sartharion.cpp:40
Definition: boss_sartharion.cpp:33
Definition: obsidian_sanctum.h:32
void Update(uint32 time)
Definition: EventMap.h:54
Definition: boss_sartharion.cpp:114
bool _isHardEnraged
Definition: boss_sartharion.cpp:502
Definition: boss_sartharion.cpp:46
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:112
Definition: boss_sartharion.cpp:120
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
Definition: UnitAI.cpp:203
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:42
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
Definition: boss_sartharion.cpp:118
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:60
Definition: boss_sartharion.cpp:117
bool HealthBelowPct(uint32 pct) const
Definition: ScriptedCreature.cpp:290
Definition: boss_sartharion.cpp:43
EventMap events
Definition: ScriptedCreature.h:348
Position const FlameRight3Direction
Definition: boss_sartharion.cpp:86
bool HealthAbovePct(uint32 pct) const
Definition: ScriptedCreature.cpp:295
Definition: Unit.h:746
Position const FlameLeft1Direction
Definition: boss_sartharion.cpp:88
Definition: ObjectDefines.h:63
bool _isSoftEnraged
Definition: boss_sartharion.cpp:501
Definition: boss_sartharion.cpp:115
InstanceScript *const instance
Definition: ScriptedCreature.h:317
+ Here is the call graph for this function:

Member Data Documentation

◆ _isBerserk

bool boss_sartharion::_isBerserk
private

◆ _isHardEnraged

bool boss_sartharion::_isHardEnraged
private

◆ _isSoftEnraged

bool boss_sartharion::_isSoftEnraged
private

◆ drakeCount

uint8 boss_sartharion::drakeCount
private

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