TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boss_sartharion::boss_sartharionAI Struct Reference

Public Member Functions

 boss_sartharionAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void JustReachedHome () override
 
void EnterCombat (Unit *) 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)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void OnPossess (bool)
 
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 DoResetThreat ()
 
float DoGetThreat (Unit *unit)
 
void DoModifyThreatPercent (Unit *unit, int32 pct)
 
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)
 
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 HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo constSelectSpell (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 >
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
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr)
 
 CreatureAI (Creature *creature)
 
virtual ~CreatureAI ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted () const
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
void OnCharmed (bool apply) override
 
void DoZoneInCombat (Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary constGetBoundary () 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, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectAggroTarget targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectAggroTarget targetType, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, PREDICATE const &predicate, uint32 maxTargets, SelectAggroTarget targetType)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void SpellInterrupted (uint32, uint32)
 
void AttackStartCaster (Unit *victim, float dist)
 
void DoCast (uint32 spellId)
 
void DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
void DoCastVictim (uint32 spellId, bool triggered=false)
 
void DoCastAOE (uint32 spellId, bool triggered=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spellId)
 
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 sQuestReward (Player *, Quest const *, uint32)
 
virtual bool sOnDummyEffect (Unit *, uint32, SpellEffIndex)
 
virtual void sOnGameEvent (bool, uint16)
 

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_SEQUENCE_BREAK, EVADE_REASON_OTHER }
 
- 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 AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _EnterCombat ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
void _DespawnAtEvade ()
 
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)
 
bool CheckBoundary (Position const *who=nullptr) const
 
void SetBoundary (CreatureBoundary const *boundary)
 
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
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Constructor & Destructor Documentation

boss_sartharion::boss_sartharionAI::boss_sartharionAI ( Creature creature)
inline
133  : BossAI(creature, DATA_SARTHARION)
134  {
135  Initialize();
136  }
void Initialize()
Definition: boss_sartharion.cpp:138
Definition: obsidian_sanctum.h:28
BossAI(Creature *creature, uint32 bossId)
Definition: ScriptedCreature.cpp:444

+ Here is the call graph for this function:

Member Function Documentation

void boss_sartharion::boss_sartharionAI::AddDrakeLootMode ( )
inline
209  {
210  if (me->HasLootMode(LOOT_MODE_HARD_MODE_2)) // Has two Drake loot modes
211  me->AddLootMode(LOOT_MODE_HARD_MODE_3); // Add 3rd Drake loot mode
212  else if (me->HasLootMode(LOOT_MODE_HARD_MODE_1)) // Has one Drake loot mode
213  me->AddLootMode(LOOT_MODE_HARD_MODE_2); // Add 2nd Drake loot mode
214  else // Has no Drake loot modes
215  me->AddLootMode(LOOT_MODE_HARD_MODE_1); // Add 1st Drake loot mode
216  }
void AddLootMode(uint16 lootMode)
Definition: Creature.h:595
bool HasLootMode(uint16 lootMode)
Definition: Creature.h:593
Definition: SharedDefines.h:70
Creature *const me
Definition: CreatureAI.h:71
Definition: SharedDefines.h:72
Definition: SharedDefines.h:71

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_sartharion::boss_sartharionAI::CallDragon ( uint32  dataId)
inline
348  {
350  {
351  if (temp->IsAlive() && !temp->GetVictim())
352  {
353  temp->SetWalk(false);
354 
355  if (temp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
356  temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
357 
358  uint8 textId = 0;
359 
360  switch (temp->GetEntry())
361  {
362  case NPC_TENEBRON:
364  temp->AddAura(SPELL_POWER_OF_TENEBRON, temp);
365  temp->GetMotionMaster()->MovePoint(POINT_ID_LAND, TenebronPositions[1]);
366  break;
367  case NPC_SHADRON:
369  temp->AddAura(SPELL_POWER_OF_SHADRON, temp);
370  temp->GetMotionMaster()->MovePoint(POINT_ID_LAND, ShadronPositions[1]);
371  break;
372  case NPC_VESPERON:
374  temp->AddAura(SPELL_POWER_OF_VESPERON, temp);
375  temp->GetMotionMaster()->MovePoint(POINT_ID_LAND, VesperonPositions[1]);
376  break;
377  }
378 
379  Talk(textId);
380  }
381  }
382  }
Definition: obsidian_sanctum.h:39
Definition: boss_sartharion.cpp:56
Position const VesperonPositions[]
Definition: boss_sartharion.cpp:103
Definition: Unit.h:674
Definition: Creature.h:467
Definition: boss_sartharion.cpp:65
Creature *const me
Definition: CreatureAI.h:71
Definition: boss_sartharion.cpp:33
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: boss_sartharion.cpp:32
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: boss_sartharion.cpp:61
Position const ShadronPositions[]
Definition: boss_sartharion.cpp:97
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
Definition: UpdateFields.h:109
Definition: obsidian_sanctum.h:40
Definition: boss_sartharion.cpp:34
uint8_t uint8
Definition: Define.h:152
Position const TenebronPositions[]
Definition: boss_sartharion.cpp:91
Definition: boss_sartharion.cpp:71
Definition: obsidian_sanctum.h:41
InstanceScript *const instance
Definition: ScriptedCreature.h:340

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_sartharion::boss_sartharionAI::CastLavaStrikeOnTarget ( Unit target)
inline
395  {
396  std::list<Creature*> fireCyclonesList;
398  Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, fireCyclonesList, checker);
399  me->VisitNearbyObject(200.0f, searcher);
400 
401  if (fireCyclonesList.empty())
402  return;
403 
404  Trinity::Containers::SelectRandomContainerElement(fireCyclonesList)->CastSpell(target, SPELL_LAVA_STRIKE, true);
405  }
Definition: boss_sartharion.cpp:46
C::value_type const & SelectRandomContainerElement(C const &container)
Definition: Containers.h:68
void VisitNearbyObject(float const &radius, NOTIFIER &notifier) const
Definition: Object.h:587
Creature *const me
Definition: CreatureAI.h:71
Definition: GridNotifiers.h:459
Definition: boss_sartharion.cpp:48
Definition: GridNotifiers.h:1265

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_sartharion::boss_sartharionAI::DrakeRespawn ( )
inline
219  {
221  {
222  tenebron->SetHomePosition(3239.07f, 657.235f, 86.8775f, 4.74729f);
223  if (tenebron->IsAlive())
224  {
225  if (tenebron->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
226  tenebron->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
227  tenebron->GetMotionMaster()->MoveTargetedHome();
228  }
229  else
230  {
232  {
233  tenebron->Respawn();
234  tenebron->GetMotionMaster()->MoveTargetedHome();
235  tenebron->AI()->SetData(DATA_CAN_LOOT, 0);
236  }
237  }
238  }
239 
241  {
242  shadron->SetHomePosition(3363.06f, 525.28f, 98.362f, 4.76475f);
243  if (shadron->IsAlive())
244  {
245  if (shadron->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
246  shadron->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
247  shadron->GetMotionMaster()->MoveTargetedHome();
248  }
249  else
250  {
252  {
253  shadron->Respawn();
254  shadron->GetMotionMaster()->MoveTargetedHome();
255  shadron->AI()->SetData(DATA_CAN_LOOT, 0);
256  }
257  }
258  }
259 
261  {
262  vesperon->SetHomePosition(3145.68f, 520.71f, 89.7f, 4.64258f);
263  if (vesperon->IsAlive())
264  {
265  if (vesperon->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
266  vesperon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
267  vesperon->GetMotionMaster()->MoveTargetedHome();
268  }
269  else
270  {
272  {
273  vesperon->Respawn();
274  vesperon->GetMotionMaster()->MoveTargetedHome();
275  vesperon->AI()->SetData(DATA_CAN_LOOT, 0);
276  }
277  }
278  }
279  }
Definition: Unit.h:674
Definition: inflate.h:49
Definition: obsidian_sanctum.h:31
Definition: Creature.h:467
Definition: obsidian_sanctum.h:29
Creature *const me
Definition: CreatureAI.h:71
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: obsidian_sanctum.h:30
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
Definition: UpdateFields.h:109
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:227
Definition: boss_sartharion.cpp:76
InstanceScript *const instance
Definition: ScriptedCreature.h:340

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_sartharion::boss_sartharionAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from BossAI.

165  {
167  _EnterCombat();
168  DoZoneInCombat();
169 
170  FetchDragons();
171 
180  }
Definition: boss_sartharion.cpp:29
void _EnterCombat()
Definition: ScriptedCreature.cpp:480
Definition: boss_sartharion.cpp:119
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
Definition: CreatureAI.cpp:47
Definition: boss_sartharion.cpp:117
Definition: boss_sartharion.cpp:114
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
Definition: boss_sartharion.cpp:112
Definition: boss_sartharion.cpp:118
Definition: boss_sartharion.cpp:116
Definition: boss_sartharion.cpp:115
EventMap events
Definition: ScriptedCreature.h:371
Definition: boss_sartharion.cpp:113
void FetchDragons()
Definition: boss_sartharion.cpp:281

+ Here is the call graph for this function:

void boss_sartharion::boss_sartharionAI::FetchDragons ( )
inline
282  {
283  me->ResetLootMode();
284  drakeCount = 0;
285 
286  //if at least one of the dragons are alive and are being called
287  bool _canUseWill = false;
288 
290  {
291  if (fetchTene->IsAlive() && !fetchTene->GetVictim())
292  {
293  _canUseWill = true;
294  if (!fetchTene->IsInCombat())
295  {
298  ++drakeCount;
299  }
300  fetchTene->GetMotionMaster()->MovePoint(POINT_ID_INIT, TenebronPositions[0]);
301 
302  if (!fetchTene->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
303  fetchTene->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
304  }
305  }
306 
308  {
309  if (fetchShad->IsAlive() && !fetchShad->GetVictim())
310  {
311  _canUseWill = true;
312  if (!fetchShad->IsInCombat())
313  {
316  ++drakeCount;
317  }
318  fetchShad->GetMotionMaster()->MovePoint(POINT_ID_INIT, ShadronPositions[0]);
319 
320  if (!fetchShad->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
321  fetchShad->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
322  }
323  }
324 
326  {
327  if (fetchVesp && fetchVesp->IsAlive() && !fetchVesp->GetVictim())
328  {
329  _canUseWill = true;
330  if (!fetchVesp->IsInCombat())
331  {
334  ++drakeCount;
335  }
336  fetchVesp->GetMotionMaster()->MovePoint(POINT_ID_INIT, VesperonPositions[0]);
337 
338  if (!fetchVesp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
339  fetchVesp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
340  }
341  }
342 
343  if (_canUseWill)
345  }
Definition: boss_sartharion.cpp:56
Position const VesperonPositions[]
Definition: boss_sartharion.cpp:103
Definition: Unit.h:674
Definition: obsidian_sanctum.h:31
Definition: Creature.h:467
Definition: obsidian_sanctum.h:29
Definition: boss_sartharion.cpp:65
Creature *const me
Definition: CreatureAI.h:71
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: obsidian_sanctum.h:30
uint8 drakeCount
Definition: boss_sartharion.cpp:510
Definition: boss_sartharion.cpp:45
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
Definition: boss_sartharion.cpp:61
Position const ShadronPositions[]
Definition: boss_sartharion.cpp:97
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
void ResetLootMode()
Definition: Creature.h:597
Definition: UpdateFields.h:109
Definition: boss_sartharion.cpp:70
Position const TenebronPositions[]
Definition: boss_sartharion.cpp:91
void AddDrakeLootMode()
Definition: boss_sartharion.cpp:208
InstanceScript *const instance
Definition: ScriptedCreature.h:340

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32 boss_sartharion::boss_sartharionAI::GetData ( uint32  type) const
inlineoverridevirtual

Reimplemented from UnitAI.

385  {
386  if (type == TWILIGHT_ACHIEVEMENTS)
387  return drakeCount;
388 
389  return 0;
390  }
Definition: obsidian_sanctum.h:33
uint8 drakeCount
Definition: boss_sartharion.cpp:510
void boss_sartharion::boss_sartharionAI::Initialize ( void  )
inline
139  {
140  _isBerserk = false;
141  _isSoftEnraged = false;
142  _isHardEnraged = false;
143  drakeCount = 0;
144  }
bool _isSoftEnraged
Definition: boss_sartharion.cpp:508
uint8 drakeCount
Definition: boss_sartharion.cpp:510
bool _isBerserk
Definition: boss_sartharion.cpp:507
bool _isHardEnraged
Definition: boss_sartharion.cpp:509

+ Here is the caller graph for this function:

void boss_sartharion::boss_sartharionAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from BossAI.

183  {
185  _JustDied();
186 
188  if (tenebron->IsAlive())
189  tenebron->DisappearAndDie();
190 
192  if (shadron->IsAlive())
193  shadron->DisappearAndDie();
194 
196  if (vesperon->IsAlive())
197  vesperon->DisappearAndDie();
198  }
Definition: obsidian_sanctum.h:31
void _JustDied()
Definition: ScriptedCreature.cpp:471
Definition: Creature.h:467
Definition: obsidian_sanctum.h:29
Creature *const me
Definition: CreatureAI.h:71
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: obsidian_sanctum.h:30
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: boss_sartharion.cpp:35
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
InstanceScript *const instance
Definition: ScriptedCreature.h:340

+ Here is the call graph for this function:

void boss_sartharion::boss_sartharionAI::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from BossAI.

160  {
161  _Reset();
162  }
void _Reset()
Definition: ScriptedCreature.cpp:457

+ Here is the call graph for this function:

void boss_sartharion::boss_sartharionAI::KilledUnit ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

201  {
202  if (who->GetTypeId() == TYPEID_PLAYER)
204  }
Definition: boss_sartharion.cpp:37
TypeID GetTypeId() const
Definition: Object.h:113
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: ObjectGuid.h:33

+ Here is the call graph for this function:

void boss_sartharion::boss_sartharionAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

147  {
148  Initialize();
149 
152 
153  me->SetHomePosition(3246.57f, 551.263f, 58.6164f, 4.66003f);
154 
155  DrakeRespawn();
157  }
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4240
void DrakeRespawn()
Definition: boss_sartharion.cpp:218
Definition: boss_sartharion.cpp:47
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:670
Creature *const me
Definition: CreatureAI.h:71
void Initialize()
Definition: boss_sartharion.cpp:138
Definition: InstanceScript.h:58
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3586
Definition: obsidian_sanctum.h:32
InstanceScript *const instance
Definition: ScriptedCreature.h:340

+ Here is the call graph for this function:

void boss_sartharion::boss_sartharionAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from BossAI.

408  {
409  if (!UpdateVictim())
410  return;
411 
412  events.Update(diff);
413 
414  while (uint32 eventId = events.ExecuteEvent())
415  {
416  switch (eventId)
417  {
418  case EVENT_HARD_ENRAGE:
419  if (!_isHardEnraged)
420  {
421  DoCast(me, SPELL_PYROBUFFET, true);
422  _isHardEnraged = true;
423  }
424  break;
425  case EVENT_FLAME_TSUNAMI:
427  switch (urand(0, 1))
428  {
429  case 0:
430  {
432  right1->GetMotionMaster()->MovePoint(0, FlameRight1Direction);
434  right2->GetMotionMaster()->MovePoint(0, FlameRight2Direction);
436  right3->GetMotionMaster()->MovePoint(0, FlameRight3Direction);
437  break;
438  }
439  case 1:
440  {
442  left1->GetMotionMaster()->MovePoint(0, FlameLeft1Direction);
444  left2->GetMotionMaster()->MovePoint(0, FlameLeft2Direction);
445  break;
446  }
447  }
449  break;
450  case EVENT_FLAME_BREATH:
454  break;
455  case EVENT_TAIL_SWEEP:
457  events.ScheduleEvent(EVENT_TAIL_SWEEP, urand(15000, 20000));
458  break;
459  case EVENT_CLEAVE_ATTACK:
462  break;
463  case EVENT_LAVA_STRIKE:
464  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
465  {
466  CastLavaStrikeOnTarget(target);
467  if (urand(0, 5) == 0)
469  }
470  events.ScheduleEvent(EVENT_LAVA_STRIKE, (_isSoftEnraged ? urand(1400, 2000) : urand(5000, 20000)));
471  break;
472  case EVENT_CALL_TENEBRON:
474  break;
475  case EVENT_CALL_SHADRON:
477  break;
478  case EVENT_CALL_VESPERON:
480  break;
481  default:
482  break;
483  }
484  }
485 
486  // At 35% spell will target dragons, if they are still alive.
487  if (!_isBerserk && !HealthAbovePct(35))
488  {
490  {
493  _isBerserk = true;
494  }
495  }
496 
497  // Soft Enrage used while determining Lava Strike cooldown.
498  if (!_isSoftEnraged && HealthBelowPct(10))
499  {
500  _isSoftEnraged = true;
501  }
502 
504  }
bool UpdateVictim()
Definition: CreatureAI.cpp:233
Position const FlameRight2Direction
Definition: boss_sartharion.cpp:82
bool _isSoftEnraged
Definition: boss_sartharion.cpp:508
Definition: boss_sartharion.cpp:42
Definition: boss_sartharion.cpp:50
void CallDragon(uint32 dataId)
Definition: boss_sartharion.cpp:347
bool HealthBelowPct(uint32 pct) const
Definition: ScriptedCreature.h:247
Definition: boss_sartharion.cpp:119
Definition: boss_sartharion.cpp:30
Definition: inflate.h:49
bool HealthAbovePct(uint32 pct) const
Definition: ScriptedCreature.h:248
Definition: obsidian_sanctum.h:31
Definition: Creature.h:467
Definition: boss_sartharion.cpp:36
Definition: boss_sartharion.cpp:117
Definition: obsidian_sanctum.h:29
Position const FlameRight1Direction
Definition: boss_sartharion.cpp:80
Position const FlameLeft1Spawn
Definition: boss_sartharion.cpp:85
Position const FlameRight2Spawn
Definition: boss_sartharion.cpp:81
Position const FlameRight1Spawn
Definition: boss_sartharion.cpp:79
Position const FlameRight3Spawn
Definition: boss_sartharion.cpp:83
Position const FlameLeft2Direction
Definition: boss_sartharion.cpp:88
Creature *const me
Definition: CreatureAI.h:71
void CastLavaStrikeOnTarget(Unit *target)
Definition: boss_sartharion.cpp:394
Definition: obsidian_sanctum.h:30
Definition: UnitAI.h:35
Definition: boss_sartharion.cpp:114
Definition: boss_sartharion.cpp:111
Position const FlameLeft2Spawn
Definition: boss_sartharion.cpp:87
Definition: Object.h:56
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
uint32_t uint32
Definition: Define.h:150
Definition: boss_sartharion.cpp:43
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: boss_sartharion.cpp:67
Definition: boss_sartharion.cpp:38
bool _isBerserk
Definition: boss_sartharion.cpp:507
Definition: boss_sartharion.cpp:31
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
void Update(uint32 time)
Definition: EventMap.h:54
Definition: boss_sartharion.cpp:112
Definition: boss_sartharion.cpp:44
Definition: boss_sartharion.cpp:118
uint32 ExecuteEvent()
Definition: EventMap.cpp:46
Definition: boss_sartharion.cpp:116
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
Definition: boss_sartharion.cpp:115
Definition: boss_sartharion.cpp:41
bool _isHardEnraged
Definition: boss_sartharion.cpp:509
EventMap events
Definition: ScriptedCreature.h:371
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:159
Position const FlameRight3Direction
Definition: boss_sartharion.cpp:84
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:227
Definition: Unit.h:1305
Position const FlameLeft1Direction
Definition: boss_sartharion.cpp:86
Definition: boss_sartharion.cpp:113
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346
InstanceScript *const instance
Definition: ScriptedCreature.h:340

+ Here is the call graph for this function:

Member Data Documentation

bool boss_sartharion::boss_sartharionAI::_isBerserk
private
bool boss_sartharion::boss_sartharionAI::_isHardEnraged
private
bool boss_sartharion::boss_sartharionAI::_isSoftEnraged
private
uint8 boss_sartharion::boss_sartharionAI::drakeCount
private

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