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

Public Member Functions

 boss_felblood_kaelthasAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void JustDied (Unit *) override
 
void DamageTaken (Unit *, uint32 &damage) override
 
void EnterCombat (Unit *) override
 
void MoveInLineOfSight (Unit *who) override
 
void SetThreatList (Creature *summonedUnit)
 
void TeleportPlayersToSelf ()
 
void CastGravityLapseKnockUp ()
 
void CastGravityLapseFly ()
 
void RemoveGravityLapse ()
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
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 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
 
virtual void JustReachedHome ()
 
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 bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
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)
 

Public Attributes

InstanceScriptinstance
 
uint32 FireballTimer
 
uint32 PhoenixTimer
 
uint32 FlameStrikeTimer
 
uint32 CombatPulseTimer
 
uint32 PyroblastTimer
 
uint32 GravityLapseTimer
 
uint32 GravityLapsePhase
 
bool FirstGravityLapse
 
bool HasTaunted
 
uint8 Phase
 
- Public Attributes inherited from ScriptedAI
bool IsFleeing
 

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 ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- 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)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
CreatureBoundary const_boundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Constructor & Destructor Documentation

boss_felblood_kaelthas::boss_felblood_kaelthasAI::boss_felblood_kaelthasAI ( Creature creature)
inline
104  : ScriptedAI(creature)
105  {
106  Initialize();
107  instance = creature->GetInstanceScript();
108  }
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
void Initialize()
Definition: boss_felblood_kaelthas.cpp:110
InstanceScript * instance
Definition: boss_felblood_kaelthas.cpp:129

+ Here is the call graph for this function:

Member Function Documentation

void boss_felblood_kaelthas::boss_felblood_kaelthasAI::CastGravityLapseFly ( )
inline
244  {
246  ThreatContainer::StorageType::const_iterator i = threatlist.begin();
247  for (i = threatlist.begin(); i != threatlist.end(); ++i)
248  {
249  Unit* unit = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid());
250  if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
251  {
252  // Also needs an exception in spell system.
253  unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, me->GetGUID());
254  // Use packet hack
256  data << unit->GetPackGUID();
257  data << uint32(0);
258  unit->SendMessageToSet(&data, true);
259  }
260  }
261  }
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
Definition: Opcodes.h:1236
ThreatContainer::StorageType const & getThreatList() const
Definition: ThreatManager.h:263
Creature *const me
Definition: CreatureAI.h:71
TypeID GetTypeId() const
Definition: Object.h:113
PackedGuid const & GetPackGUID() const
Definition: Object.h:106
Definition: boss_felblood_kaelthas.cpp:66
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: ObjectGuid.h:33
std::list< HostileReference * > StorageType
Definition: ThreatManager.h:149
ThreatManager & getThreatManager()
Definition: Unit.h:1998
uint32_t uint32
Definition: g3dmath.h:168
virtual void SendMessageToSet(WorldPacket const *data, bool self)
Definition: Object.cpp:2144
Definition: Unit.h:1305
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869
Definition: WorldPacket.h:26

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_felblood_kaelthas::boss_felblood_kaelthasAI::CastGravityLapseKnockUp ( )
inline
231  {
233  ThreatContainer::StorageType::const_iterator i = threatlist.begin();
234  for (i = threatlist.begin(); i != threatlist.end(); ++i)
235  {
236  Unit* unit = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid());
237  if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
238  // Knockback into the air
239  unit->CastSpell(unit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, me->GetGUID());
240  }
241  }
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
ThreatContainer::StorageType const & getThreatList() const
Definition: ThreatManager.h:263
Definition: boss_felblood_kaelthas.cpp:67
Creature *const me
Definition: CreatureAI.h:71
TypeID GetTypeId() const
Definition: Object.h:113
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: ObjectGuid.h:33
std::list< HostileReference * > StorageType
Definition: ThreatManager.h:149
ThreatManager & getThreatManager()
Definition: Unit.h:1998
Definition: Unit.h:1305
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_felblood_kaelthas::boss_felblood_kaelthasAI::DamageTaken ( Unit ,
uint32 damage 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

174  {
175  if (damage > me->GetHealth())
176  RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air.
177  }
void RemoveGravityLapse()
Definition: boss_felblood_kaelthas.cpp:263
Creature *const me
Definition: CreatureAI.h:71
uint32 GetHealth() const
Definition: Unit.h:1426

+ Here is the call graph for this function:

void boss_felblood_kaelthas::boss_felblood_kaelthasAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

180  {
182  }
Definition: magisters_terrace.h:31
Definition: InstanceScript.h:59
InstanceScript * instance
Definition: boss_felblood_kaelthas.cpp:129
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273

+ Here is the call graph for this function:

void boss_felblood_kaelthas::boss_felblood_kaelthasAI::Initialize ( void  )
inline
Todo:
Timers
111  {
113  FireballTimer = 0;
114  PhoenixTimer = 10000;
115  FlameStrikeTimer = 25000;
116  CombatPulseTimer = 0;
117 
118  PyroblastTimer = 60000;
119 
120  GravityLapseTimer = 0;
121  GravityLapsePhase = 0;
122 
123  FirstGravityLapse = true;
124  HasTaunted = false;
125 
126  Phase = 0;
127  }
uint32 PhoenixTimer
Definition: boss_felblood_kaelthas.cpp:132
uint32 GravityLapseTimer
Definition: boss_felblood_kaelthas.cpp:139
bool FirstGravityLapse
Definition: boss_felblood_kaelthas.cpp:147
bool HasTaunted
Definition: boss_felblood_kaelthas.cpp:148
uint32 CombatPulseTimer
Definition: boss_felblood_kaelthas.cpp:134
uint32 FireballTimer
Definition: boss_felblood_kaelthas.cpp:131
uint32 FlameStrikeTimer
Definition: boss_felblood_kaelthas.cpp:133
uint32 GravityLapsePhase
Definition: boss_felblood_kaelthas.cpp:140
uint32 PyroblastTimer
Definition: boss_felblood_kaelthas.cpp:137
Phase
Definition: boss_kiljaeden.cpp:153

+ Here is the caller graph for this function:

void boss_felblood_kaelthas::boss_felblood_kaelthasAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

163  {
164  Talk(SAY_DEATH);
165 
167 
168  // Enable the Translocation Orb Exit
170  escapeOrb->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
171  }
Definition: SharedDefines.h:2125
Definition: magisters_terrace.h:31
Definition: inflate.h:49
Creature *const me
Definition: CreatureAI.h:71
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
InstanceScript * instance
Definition: boss_felblood_kaelthas.cpp:129
Definition: GameObject.h:880
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273
Definition: UpdateFields.h:319
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:143
Definition: magisters_terrace.h:38
Definition: boss_felblood_kaelthas.cpp:40

+ Here is the call graph for this function:

void boss_felblood_kaelthas::boss_felblood_kaelthasAI::MoveInLineOfSight ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

186  {
187  if (!HasTaunted && me->IsWithinDistInMap(who, 40.0f))
188  {
189  Talk(SAY_AGGRO);
190  HasTaunted = true;
191  }
192 
194  }
Definition: boss_felblood_kaelthas.cpp:34
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.cpp:1663
Creature *const me
Definition: CreatureAI.h:71
bool HasTaunted
Definition: boss_felblood_kaelthas.cpp:148
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
virtual void MoveInLineOfSight(Unit *)
Definition: CreatureAI.cpp:128

+ Here is the call graph for this function:

void boss_felblood_kaelthas::boss_felblood_kaelthasAI::RemoveGravityLapse ( )
inline
264  {
266  ThreatContainer::StorageType::const_iterator i = threatlist.begin();
267  for (i = threatlist.begin(); i != threatlist.end(); ++i)
268  {
269  Unit* unit = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid());
270  if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
271  {
274 
276  data << unit->GetPackGUID();
277  data << uint32(0);
278  unit->SendMessageToSet(&data, true);
279  }
280  }
281  }
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
ThreatContainer::StorageType const & getThreatList() const
Definition: ThreatManager.h:263
Definition: boss_felblood_kaelthas.cpp:67
Creature *const me
Definition: CreatureAI.h:71
TypeID GetTypeId() const
Definition: Object.h:113
PackedGuid const & GetPackGUID() const
Definition: Object.h:106
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3586
Definition: boss_felblood_kaelthas.cpp:66
Definition: ObjectGuid.h:33
std::list< HostileReference * > StorageType
Definition: ThreatManager.h:149
ThreatManager & getThreatManager()
Definition: Unit.h:1998
uint32_t uint32
Definition: g3dmath.h:168
virtual void SendMessageToSet(WorldPacket const *data, bool self)
Definition: Object.cpp:2144
Definition: Unit.h:1305
Definition: WorldPacket.h:26
Definition: Opcodes.h:1286

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_felblood_kaelthas::boss_felblood_kaelthasAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

156  {
157  Initialize();
158 
160  }
Definition: magisters_terrace.h:31
void Initialize()
Definition: boss_felblood_kaelthas.cpp:110
InstanceScript * instance
Definition: boss_felblood_kaelthas.cpp:129
Definition: InstanceScript.h:58
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273

+ Here is the call graph for this function:

void boss_felblood_kaelthas::boss_felblood_kaelthasAI::SetThreatList ( Creature summonedUnit)
inline
197  {
198  if (!summonedUnit)
199  return;
200 
202  ThreatContainer::StorageType::const_iterator i = threatlist.begin();
203  for (i = threatlist.begin(); i != threatlist.end(); ++i)
204  {
205  Unit* unit = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid());
206  if (unit && unit->IsAlive())
207  {
208  float threat = me->getThreatManager().getThreat(unit);
209  summonedUnit->AddThreat(unit, threat);
210  }
211  }
212  }
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=NULL)
Definition: Unit.cpp:10691
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
ThreatContainer::StorageType const & getThreatList() const
Definition: ThreatManager.h:263
Creature *const me
Definition: CreatureAI.h:71
bool IsAlive() const
Definition: Unit.h:1692
float getThreat(Unit *victim, bool alsoSearchOfflineList=false)
Definition: ThreatManager.cpp:469
std::list< HostileReference * > StorageType
Definition: ThreatManager.h:149
ThreatManager & getThreatManager()
Definition: Unit.h:1998
Definition: Unit.h:1305

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_felblood_kaelthas::boss_felblood_kaelthasAI::TeleportPlayersToSelf ( )
inline
215  {
216  float x = KaelLocations[0][0];
217  float y = KaelLocations[0][1];
218  me->SetPosition(x, y, LOCATION_Z, 0.0f);
220  ThreatContainer::StorageType::const_iterator i = threatlist.begin();
221  for (i = threatlist.begin(); i != threatlist.end(); ++i)
222  {
223  Unit* unit = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid());
224  if (unit && (unit->GetTypeId() == TYPEID_PLAYER))
225  unit->CastSpell(unit, SPELL_TELEPORT_CENTER, true);
226  }
228  }
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
#define LOCATION_Z
Definition: boss_felblood_kaelthas.cpp:90
float KaelLocations[3][2]
Definition: boss_felblood_kaelthas.cpp:83
ThreatContainer::StorageType const & getThreatList() const
Definition: ThreatManager.h:263
Definition: boss_felblood_kaelthas.cpp:65
void SetPosition(float x, float y, float z, float o)
Definition: Creature.cpp:2537
Creature *const me
Definition: CreatureAI.h:71
TypeID GetTypeId() const
Definition: Object.h:113
G3D::int16 y
Definition: Vector2int16.h:38
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
Definition: ObjectGuid.h:33
std::list< HostileReference * > StorageType
Definition: ThreatManager.h:149
ThreatManager & getThreatManager()
Definition: Unit.h:1998
G3D::int16 x
Definition: Vector2int16.h:37
Definition: Unit.h:1305
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_felblood_kaelthas::boss_felblood_kaelthasAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

284  {
285  //Return since we have no target
286  if (!UpdateVictim())
287  return;
288 
289  switch (Phase)
290  {
291  case 0:
292  {
293  // *Heroic mode only:
294  if (IsHeroic())
295  {
296  if (PyroblastTimer <= diff)
297  {
300  DoCast(me, SPELL_SHOCK_BARRIER, true);
302  PyroblastTimer = 60000;
303  } else PyroblastTimer -= diff;
304  }
305 
306  if (FireballTimer <= diff)
307  {
309  FireballTimer = urand(2000, 6000);
310  } else FireballTimer -= diff;
311 
312  if (PhoenixTimer <= diff)
313  {
314  Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
315 
316  uint8 random = urand(1, 2);
317  float x = KaelLocations[random][0];
318  float y = KaelLocations[random][1];
319 
321  if (Phoenix)
322  {
324  SetThreatList(Phoenix);
325  Phoenix->AI()->AttackStart(target);
326  }
327 
328  Talk(SAY_PHOENIX);
329 
330  PhoenixTimer = 60000;
331  } else PhoenixTimer -= diff;
332 
333  if (FlameStrikeTimer <= diff)
334  {
335  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
336  {
339  DoCast(target, SPELL_FLAMESTRIKE3, true);
341  }
342  FlameStrikeTimer = urand(15000, 25000);
343  } else FlameStrikeTimer -= diff;
344 
345  // Below 50%
346  if (HealthBelowPct(50))
347  {
349  me->StopMoving();
350  me->GetMotionMaster()->Clear();
352  GravityLapseTimer = 0;
353  GravityLapsePhase = 0;
354  Phase = 1;
355  }
356 
358  }
359  break;
360 
361  case 1:
362  {
363  if (GravityLapseTimer <= diff)
364  {
365  switch (GravityLapsePhase)
366  {
367  case 0:
368  if (FirstGravityLapse) // Different yells at 50%, and at every following Gravity Lapse
369  {
371  FirstGravityLapse = false;
372 
374  }
375  else
377 
379  GravityLapseTimer = 2000 + diff;// Don't interrupt the visual spell
380  GravityLapsePhase = 1;
381  break;
382 
383  case 1:
385  GravityLapseTimer = 1000;
386  GravityLapsePhase = 2;
387  break;
388 
389  case 2:
391  GravityLapseTimer = 1000;
392  GravityLapsePhase = 3;
393  break;
394 
395  case 3:
397  GravityLapseTimer = 30000;
398  GravityLapsePhase = 4;
399 
400  for (uint8 i = 0; i < 3; ++i)
401  {
402  Unit* target = NULL;
403  target = SelectTarget(SELECT_TARGET_RANDOM, 0);
404 
406  if (Orb && target)
407  {
408  Orb->SetSpeed(MOVE_RUN, 0.5f);
409  Orb->AddThreat(target, 1000000.0f);
410  Orb->AI()->AttackStart(target);
411  }
412  }
413 
415  break;
416 
417  case 4:
418  me->InterruptNonMeleeSpells(false);
419  Talk(SAY_TIRED);
422  GravityLapseTimer = 10000;
423  GravityLapsePhase = 0;
424  break;
425  }
426  } else GravityLapseTimer -= diff;
427  }
428  break;
429  }
430  }
Definition: Unit.h:1109
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=NULL)
Definition: Unit.cpp:10691
uint32 PhoenixTimer
Definition: boss_felblood_kaelthas.cpp:132
void MoveIdle()
Definition: MotionMaster.cpp:185
Definition: Unit.h:674
bool UpdateVictim()
Definition: CreatureAI.cpp:233
Definition: boss_felblood_kaelthas.cpp:47
void Clear(bool reset=true)
Definition: MotionMaster.h:138
bool HealthBelowPct(uint32 pct) const
Definition: ScriptedCreature.h:247
Definition: Unit.h:1110
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
#define LOCATION_Z
Definition: boss_felblood_kaelthas.cpp:90
float KaelLocations[3][2]
Definition: boss_felblood_kaelthas.cpp:83
uint32 GravityLapseTimer
Definition: boss_felblood_kaelthas.cpp:139
arena_t NULL
Definition: jemalloc_internal.h:624
void TeleportPlayersToSelf()
Definition: boss_felblood_kaelthas.cpp:214
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
Definition: Unit.cpp:9615
bool IsHeroic() const
Definition: ScriptedCreature.h:268
bool FirstGravityLapse
Definition: boss_felblood_kaelthas.cpp:147
Definition: Creature.h:467
Definition: boss_felblood_kaelthas.cpp:78
void RemoveGravityLapse()
Definition: boss_felblood_kaelthas.cpp:263
Definition: SharedDefines.h:1078
Definition: boss_felblood_kaelthas.cpp:64
Definition: boss_felblood_kaelthas.cpp:69
void CastGravityLapseFly()
Definition: boss_felblood_kaelthas.cpp:243
Definition: boss_felblood_kaelthas.cpp:63
Creature *const me
Definition: CreatureAI.h:71
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
Definition: Unit.cpp:2849
Definition: magisters_terrace.h:37
Definition: UnitAI.h:35
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
InstanceScript * instance
Definition: boss_felblood_kaelthas.cpp:129
CreatureAI * AI() const
Definition: Creature.h:525
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
Definition: boss_felblood_kaelthas.cpp:59
G3D::int16 y
Definition: Vector2int16.h:38
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Creature * DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
Definition: ScriptedCreature.cpp:177
Definition: boss_felblood_kaelthas.cpp:76
Definition: boss_felblood_kaelthas.cpp:35
void CastGravityLapseKnockUp()
Definition: boss_felblood_kaelthas.cpp:230
Definition: Object.h:55
Definition: boss_felblood_kaelthas.cpp:38
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
uint32 FireballTimer
Definition: boss_felblood_kaelthas.cpp:131
Definition: boss_felblood_kaelthas.cpp:37
Definition: Unit.h:600
Definition: UpdateFields.h:109
Definition: boss_felblood_kaelthas.cpp:36
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:2916
Definition: boss_felblood_kaelthas.cpp:39
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
uint32 FlameStrikeTimer
Definition: boss_felblood_kaelthas.cpp:133
uint8_t uint8
Definition: Define.h:152
uint32 GravityLapsePhase
Definition: boss_felblood_kaelthas.cpp:140
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:10531
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:159
void SetThreatList(Creature *summonedUnit)
Definition: boss_felblood_kaelthas.cpp:196
Definition: SharedDefines.h:1860
G3D::int16 x
Definition: Vector2int16.h:37
uint32 PyroblastTimer
Definition: boss_felblood_kaelthas.cpp:137
Definition: Unit.h:1305
void StopMoving()
-------—End of Pet responses methods-------—
Definition: Unit.cpp:12743
Phase
Definition: boss_kiljaeden.cpp:153
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:29
Definition: boss_felblood_kaelthas.cpp:60
Definition: Unit.h:698
Definition: boss_felblood_kaelthas.cpp:57
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346

+ Here is the call graph for this function:

Member Data Documentation

uint32 boss_felblood_kaelthas::boss_felblood_kaelthasAI::CombatPulseTimer
uint32 boss_felblood_kaelthas::boss_felblood_kaelthasAI::FireballTimer
bool boss_felblood_kaelthas::boss_felblood_kaelthasAI::FirstGravityLapse
uint32 boss_felblood_kaelthas::boss_felblood_kaelthasAI::FlameStrikeTimer
uint32 boss_felblood_kaelthas::boss_felblood_kaelthasAI::GravityLapsePhase
uint32 boss_felblood_kaelthas::boss_felblood_kaelthasAI::GravityLapseTimer
bool boss_felblood_kaelthas::boss_felblood_kaelthasAI::HasTaunted
InstanceScript* boss_felblood_kaelthas::boss_felblood_kaelthasAI::instance
uint8 boss_felblood_kaelthas::boss_felblood_kaelthasAI::Phase
uint32 boss_felblood_kaelthas::boss_felblood_kaelthasAI::PhoenixTimer
uint32 boss_felblood_kaelthas::boss_felblood_kaelthasAI::PyroblastTimer

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