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

Public Member Functions

 boss_kalecgosAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void EnterEvadeMode (EvadeReason why) override
 
void DoAction (int32 param) override
 
void UpdateAI (uint32 diff) override
 
void MoveInLineOfSight (Unit *who) override
 
void DamageTaken (Unit *done_by, uint32 &damage) override
 
void EnterCombat (Unit *) override
 
void KilledUnit (Unit *) override
 
void MovementInform (uint32 type, uint32) override
 
void GoodEnding ()
 
void BadEnding ()
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
void JustDied (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 IsSummonedBy (Unit *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted () const
 
virtual void JustRespawned ()
 
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 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 ArcaneBuffetTimer
 
uint32 FrostBreathTimer
 
uint32 WildMagicTimer
 
uint32 SpectralBlastTimer
 
uint32 TailLashTimer
 
uint32 CheckTimer
 
uint32 TalkTimer
 
uint32 TalkSequence
 
uint32 ResetTimer
 
bool isFriendly
 
bool isEnraged
 
bool isBanished
 
bool bJustReset
 
ObjectGuid SathGUID
 
- 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_kalecgos::boss_kalecgosAI::boss_kalecgosAI ( Creature creature)
inline
108  : ScriptedAI(creature)
109  {
110  Initialize();
111  instance = creature->GetInstanceScript();
112  bJustReset = false;
113  me->setActive(true);
114  }
InstanceScript * instance
Definition: boss_kalecgos.cpp:134
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
bool bJustReset
Definition: boss_kalecgos.cpp:149
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
void setActive(bool isActiveObject)
Definition: Object.cpp:1473
Creature *const me
Definition: CreatureAI.h:71
void Initialize()
Definition: boss_kalecgos.cpp:116

+ Here is the call graph for this function:

Member Function Documentation

void boss_kalecgos::boss_kalecgosAI::BadEnding ( )
inline
413  {
414  switch (TalkSequence)
415  {
416  case 1:
418  TalkTimer = 3000;
419  break;
420  case 2:
421  me->SetDisableGravity(true);
423  TalkTimer = 15000;
424  break;
425  case 3:
427  break;
428  default:
429  break;
430  }
431  }
#define FLY_Y
Definition: boss_kalecgos.cpp:87
Definition: boss_kalecgos.cpp:43
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
#define FLY_X
Definition: boss_kalecgos.cpp:86
bool SetDisableGravity(bool disable, bool packetOnly=false)
Definition: Unit.cpp:15818
#define FLY_Z
Definition: boss_kalecgos.cpp:88
void EnterEvadeMode(EvadeReason why) override
Definition: boss_kalecgos.cpp:172
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
Definition: CreatureAI.h:90
uint32 TalkTimer
Definition: boss_kalecgos.cpp:142
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
uint32 TalkSequence
Definition: boss_kalecgos.cpp:143

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_kalecgos::boss_kalecgosAI::DamageTaken ( Unit done_by,
uint32 damage 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

344  {
345  if (damage >= me->GetHealth() && done_by != me)
346  damage = 0;
347  }
Creature *const me
Definition: CreatureAI.h:71
uint32 GetHealth() const
Definition: Unit.h:1426

+ Here is the call graph for this function:

void boss_kalecgos::boss_kalecgosAI::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

181  {
182  switch (param)
183  {
184  case DO_ENRAGE:
185  isEnraged = true;
186  me->CastSpell(me, SPELL_ENRAGE, true);
187  break;
188  case DO_BANISH:
189  isBanished = true;
190  me->CastSpell(me, SPELL_BANISH, true);
191  break;
192  }
193  }
Definition: boss_kalecgos.cpp:66
Definition: boss_kalecgos.cpp:78
Creature *const me
Definition: CreatureAI.h:71
Definition: boss_kalecgos.cpp:64
bool isEnraged
Definition: boss_kalecgos.cpp:147
bool isBanished
Definition: boss_kalecgos.cpp:148
Definition: boss_kalecgos.cpp:79
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_kalecgos::boss_kalecgosAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

350  {
353  DoZoneInCombat();
354 
356  }
Definition: Unit.h:207
InstanceScript * instance
Definition: boss_kalecgos.cpp:134
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
Definition: CreatureAI.cpp:47
Creature *const me
Definition: CreatureAI.h:71
Definition: InstanceScript.h:59
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273
Definition: sunwell_plateau.h:29
void SetStandState(UnitStandStateType state, uint32 animKitID=0)
Definition: Unit.cpp:12772
Definition: boss_kalecgos.cpp:40

+ Here is the call graph for this function:

void boss_kalecgos::boss_kalecgosAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

173  {
174  bJustReset = true;
175  me->SetVisible(false);
178  }
bool bJustReset
Definition: boss_kalecgos.cpp:149
Definition: Unit.h:674
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:168
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
Creature *const me
Definition: CreatureAI.h:71
void SetVisible(bool x)
Definition: Unit.cpp:10368
Definition: UpdateFields.h:109
Definition: Unit.h:698

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_kalecgos::boss_kalecgosAI::GoodEnding ( )
inline
391  {
392  switch (TalkSequence)
393  {
394  case 1:
395  me->setFaction(35);
396  TalkTimer = 1000;
397  break;
398  case 2:
400  TalkTimer = 10000;
401  break;
402  case 3:
403  me->SetDisableGravity(true);
405  TalkTimer = 600000;
406  break;
407  default:
408  break;
409  }
410  }
#define FLY_Y
Definition: boss_kalecgos.cpp:87
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
#define FLY_X
Definition: boss_kalecgos.cpp:86
bool SetDisableGravity(bool disable, bool packetOnly=false)
Definition: Unit.cpp:15818
#define FLY_Z
Definition: boss_kalecgos.cpp:88
void setFaction(uint32 faction)
Definition: Unit.h:1467
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
Definition: boss_kalecgos.cpp:42
uint32 TalkTimer
Definition: boss_kalecgos.cpp:142
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
uint32 TalkSequence
Definition: boss_kalecgos.cpp:143

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_kalecgos::boss_kalecgosAI::Initialize ( void  )
inline
117  {
118  SathGUID.Clear();
119  ArcaneBuffetTimer = 8000;
120  FrostBreathTimer = 15000;
121  WildMagicTimer = 10000;
122  TailLashTimer = 25000;
123  SpectralBlastTimer = urand(20000, 25000);
124  CheckTimer = 1000;
125  ResetTimer = 30000;
126 
127  TalkTimer = 0;
128  TalkSequence = 0;
129  isFriendly = false;
130  isEnraged = false;
131  isBanished = false;
132  }
ObjectGuid SathGUID
Definition: boss_kalecgos.cpp:151
uint32 TailLashTimer
Definition: boss_kalecgos.cpp:140
uint32 ResetTimer
Definition: boss_kalecgos.cpp:144
bool isFriendly
Definition: boss_kalecgos.cpp:146
bool isEnraged
Definition: boss_kalecgos.cpp:147
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
uint32 TalkTimer
Definition: boss_kalecgos.cpp:142
uint32 TalkSequence
Definition: boss_kalecgos.cpp:143
void Clear()
Definition: ObjectGuid.h:215
uint32 FrostBreathTimer
Definition: boss_kalecgos.cpp:137
uint32 SpectralBlastTimer
Definition: boss_kalecgos.cpp:139
bool isBanished
Definition: boss_kalecgos.cpp:148
uint32 ArcaneBuffetTimer
Definition: boss_kalecgos.cpp:136
uint32 CheckTimer
Definition: boss_kalecgos.cpp:141
uint32 WildMagicTimer
Definition: boss_kalecgos.cpp:138

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_kalecgos::boss_kalecgosAI::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

359  {
361  }
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: boss_kalecgos.cpp:41

+ Here is the call graph for this function:

void boss_kalecgos::boss_kalecgosAI::MoveInLineOfSight ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

331  {
332  if (bJustReset)//boss is invisible, don't attack
333  return;
334 
335  if (!me->GetVictim() && me->IsValidAttackTarget(who))
336  {
337  float attackRadius = me->GetAttackDistance(who);
338  if (me->IsWithinDistInMap(who, attackRadius))
339  AttackStart(who);
340  }
341  }
bool bJustReset
Definition: boss_kalecgos.cpp:149
bool IsValidAttackTarget(Unit const *target) const
Definition: Unit.cpp:10002
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.cpp:1663
Creature *const me
Definition: CreatureAI.h:71
float GetAttackDistance(Unit const *player) const
Definition: Creature.cpp:1586
Unit * GetVictim() const
Definition: Unit.h:1379
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:117

+ Here is the call graph for this function:

void boss_kalecgos::boss_kalecgosAI::MovementInform ( uint32  type,
uint32   
)
inlineoverridevirtual

Reimplemented from CreatureAI.

364  {
365  if (type != POINT_MOTION_TYPE)
366  return;
367  me->SetVisible(false);
368  if (isFriendly)
369  {
371 
372  Map::PlayerList const& players = me->GetMap()->GetPlayers();
373  if (!players.isEmpty())
374  {
375  for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
376  {
377  Player* player = itr->GetSource();
378  if (player)
379  me->GetMap()->ToInstanceMap()->PermBindAllPlayers(player);
380  }
381  }
382  }
383  else
384  {
386  TalkTimer = 1000;
387  }
388  }
Map * GetMap() const
Definition: Object.h:543
Definition: Unit.h:542
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
void MoveTargetedHome()
Definition: MotionMaster.cpp:201
iterator begin()
Definition: MapRefManager.h:37
Creature *const me
Definition: CreatureAI.h:71
void setDeathState(DeathState s) override
Definition: Creature.cpp:1624
bool isFriendly
Definition: boss_kalecgos.cpp:146
void SetVisible(bool x)
Definition: Unit.cpp:10368
InstanceMap * ToInstanceMap()
Definition: Map.h:495
Definition: LinkedList.h:141
void PermBindAllPlayers(Player *source)
Definition: Map.cpp:3333
uint32 TalkTimer
Definition: boss_kalecgos.cpp:142
bool isEmpty() const
Definition: LinkedList.h:102
PlayerList const & GetPlayers() const
Definition: Map.h:433
Definition: MapRefManager.h:26
Definition: MotionMaster.h:46
iterator end()
Definition: MapRefManager.h:38

+ Here is the call graph for this function:

void boss_kalecgos::boss_kalecgosAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

154  {
157 
159  Sath->AI()->EnterEvadeMode();
160 
161  me->setFaction(14);
162  if (!bJustReset) //first reset at create
163  {
165  me->SetDisableGravity(false);
166  me->SetVisible(true);
168  }
169  me->SetFullHealth(); //dunno why it does not resets health at evade..
170  }
InstanceScript * instance
Definition: boss_kalecgos.cpp:134
bool bJustReset
Definition: boss_kalecgos.cpp:149
Definition: Unit.h:674
ObjectGuid SathGUID
Definition: boss_kalecgos.cpp:151
Definition: Creature.h:467
bool SetDisableGravity(bool disable, bool packetOnly=false)
Definition: Unit.cpp:15818
void setFaction(uint32 faction)
Definition: Unit.h:1467
Creature *const me
Definition: CreatureAI.h:71
Definition: sunwell_plateau.h:38
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: InstanceScript.h:58
void SetVisible(bool x)
Definition: Unit.cpp:10368
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:273
Definition: Unit.h:210
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
Definition: sunwell_plateau.h:29
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
Definition: UpdateFields.h:109
void SetStandState(UnitStandStateType state, uint32 animKitID=0)
Definition: Unit.cpp:12772
void SetFullHealth()
Definition: Unit.h:1440
Definition: Unit.h:698

+ Here is the call graph for this function:

void boss_kalecgos::boss_kalecgosAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

196  {
197  if (TalkTimer)
198  {
199  if (!TalkSequence)
200  {
203  me->RemoveAllAuras();
204  me->DeleteThreatList();
205  me->CombatStop();
206  ++TalkSequence;
207  }
208  if (TalkTimer <= diff)
209  {
210  if (isFriendly)
211  GoodEnding();
212  else
213  BadEnding();
214  ++TalkSequence;
215  } else TalkTimer -= diff;
216  }
217  else
218  {
219  if (bJustReset)
220  {
221  if (ResetTimer <= diff)
222  {
224  me->SetDisableGravity(false);
225  me->SetVisible(true);
227  ResetTimer = 10000;
228  bJustReset = false;
229  } else ResetTimer -= diff;
230  return;
231  }
232 
233  if (!UpdateVictim())
234  return;
235 
236  if (CheckTimer <= diff)
237  {
239  {
241  return;
242  }
243  if (HealthBelowPct(10) && !isEnraged)
244  {
246  Sath->AI()->DoAction(DO_ENRAGE);
248  }
249  if (!isBanished && HealthBelowPct(1))
250  {
252  {
253  if (Sath->HasAura(SPELL_BANISH))
254  {
255  Sath->DealDamage(Sath, Sath->GetHealth());
256  return;
257  }
258  else
260  }
261  else
262  {
263  TC_LOG_ERROR("scripts", "Didn't find Shathrowar. Kalecgos event reseted.");
265  return;
266  }
267  }
268  CheckTimer = 1000;
269  } else CheckTimer -= diff;
270 
271  if (ArcaneBuffetTimer <= diff)
272  {
274  ArcaneBuffetTimer = 8000;
275  } else ArcaneBuffetTimer -= diff;
276 
277  if (FrostBreathTimer <= diff)
278  {
280  FrostBreathTimer = 15000;
281  } else FrostBreathTimer -= diff;
282 
283  if (TailLashTimer <= diff)
284  {
286  TailLashTimer = 15000;
287  } else TailLashTimer -= diff;
288 
289  if (WildMagicTimer <= diff)
290  {
291  DoCastAOE(WildMagic[rand32() % 6]);
292  WildMagicTimer = 20000;
293  } else WildMagicTimer -= diff;
294 
295  if (SpectralBlastTimer <= diff)
296  {
298  std::list<Unit*> targetList;
299  for (ThreatContainer::StorageType::const_iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr)
300  {
301  Unit* target = (*itr)->getTarget();
302  if (target
303  && target->GetTypeId() == TYPEID_PLAYER
304  && (!target->GetVictim() || target->GetGUID() != me->EnsureVictim()->GetGUID())
305  && target->GetPositionZ() > me->GetPositionZ() - 5
306  && !target->HasAura(AURA_SPECTRAL_EXHAUSTION))
307  {
308  targetList.push_back(target);
309  }
310  }
311  if (targetList.empty())
312  {
313  SpectralBlastTimer = 1000;
314  return;
315  }
316 
317  std::list<Unit*>::const_iterator i = targetList.begin();
318  advance(i, rand32() % targetList.size());
319  if ((*i))
320  {
321  (*i)->CastSpell((*i), SPELL_SPECTRAL_BLAST, true);
322  SpectralBlastTimer = 20000 + rand32() % 5000;
323  } else SpectralBlastTimer = 1000;
324  } else SpectralBlastTimer -= diff;
325 
327  }
328  }
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4240
void RemoveAllAuras()
Definition: Unit.cpp:3920
Unit * EnsureVictim() const
Definition: Unit.h:1381
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:167
bool bJustReset
Definition: boss_kalecgos.cpp:149
Definition: Unit.h:674
bool UpdateVictim()
Definition: CreatureAI.cpp:233
ObjectGuid SathGUID
Definition: boss_kalecgos.cpp:151
bool HealthBelowPct(uint32 pct) const
Definition: ScriptedCreature.h:247
void GoodEnding()
Definition: boss_kalecgos.cpp:390
void BadEnding()
Definition: boss_kalecgos.cpp:412
Definition: boss_kalecgos.cpp:78
ThreatContainer::StorageType const & getThreatList() const
Definition: ThreatManager.h:263
uint32 TailLashTimer
Definition: boss_kalecgos.cpp:140
#define CENTER_X
Definition: boss_kalecgos.cpp:90
Definition: Creature.h:467
bool SetDisableGravity(bool disable, bool packetOnly=false)
Definition: Unit.cpp:15818
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
void advance(octet_iterator &it, distance_type n, octet_iterator end)
Definition: checked.h:190
void EnterEvadeMode(EvadeReason why) override
Definition: boss_kalecgos.cpp:172
Definition: boss_kalecgos.cpp:62
Creature *const me
Definition: CreatureAI.h:71
TypeID GetTypeId() const
Definition: Object.h:113
uint32 ResetTimer
Definition: boss_kalecgos.cpp:144
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1594
bool isFriendly
Definition: boss_kalecgos.cpp:146
Definition: CreatureAI.h:88
Definition: boss_kalecgos.cpp:61
Definition: CreatureAI.h:90
Definition: boss_kalecgos.cpp:64
Unit * GetVictim() const
Definition: Unit.h:1379
bool isEnraged
Definition: boss_kalecgos.cpp:147
Definition: boss_kalecgos.cpp:60
void SetVisible(bool x)
Definition: Unit.cpp:10368
#define CENTER_Y
Definition: boss_kalecgos.cpp:91
float GetPositionZ() const
Definition: Position.h:106
Definition: boss_kalecgos.cpp:58
uint32 TalkTimer
Definition: boss_kalecgos.cpp:142
uint32 TalkSequence
Definition: boss_kalecgos.cpp:143
void DoAction(int32 param) override
Definition: boss_kalecgos.cpp:180
Definition: Unit.h:210
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
uint32 FrostBreathTimer
Definition: boss_kalecgos.cpp:137
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: ObjectGuid.h:33
uint32 SpectralBlastTimer
Definition: boss_kalecgos.cpp:139
void DeleteThreatList()
Definition: Unit.cpp:10700
std::list< HostileReference * > StorageType
Definition: ThreatManager.h:149
Definition: UpdateFields.h:109
Definition: boss_kalecgos.cpp:53
bool isBanished
Definition: boss_kalecgos.cpp:148
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:2916
ThreatManager & getThreatManager()
Definition: Unit.h:1998
Definition: boss_kalecgos.cpp:79
uint32 rand32()
Definition: Random.cpp:64
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
void SetStandState(UnitStandStateType state, uint32 animKitID=0)
Definition: Unit.cpp:12772
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
uint32 WildMagic[]
Definition: boss_kalecgos.cpp:99
#define DRAGON_REALM_Z
Definition: boss_kalecgos.cpp:94
void CombatStop(bool includingCast=false)
Definition: Unit.cpp:7371
Definition: Unit.h:1305
uint32 ArcaneBuffetTimer
Definition: boss_kalecgos.cpp:136
Definition: Unit.h:698
uint32 CheckTimer
Definition: boss_kalecgos.cpp:141
uint32 WildMagicTimer
Definition: boss_kalecgos.cpp:138

+ Here is the call graph for this function:

Member Data Documentation

uint32 boss_kalecgos::boss_kalecgosAI::ArcaneBuffetTimer
bool boss_kalecgos::boss_kalecgosAI::bJustReset
uint32 boss_kalecgos::boss_kalecgosAI::CheckTimer
uint32 boss_kalecgos::boss_kalecgosAI::FrostBreathTimer
InstanceScript* boss_kalecgos::boss_kalecgosAI::instance
bool boss_kalecgos::boss_kalecgosAI::isBanished
bool boss_kalecgos::boss_kalecgosAI::isEnraged
bool boss_kalecgos::boss_kalecgosAI::isFriendly
uint32 boss_kalecgos::boss_kalecgosAI::ResetTimer
ObjectGuid boss_kalecgos::boss_kalecgosAI::SathGUID
uint32 boss_kalecgos::boss_kalecgosAI::SpectralBlastTimer
uint32 boss_kalecgos::boss_kalecgosAI::TailLashTimer
uint32 boss_kalecgos::boss_kalecgosAI::TalkSequence
uint32 boss_kalecgos::boss_kalecgosAI::TalkTimer
uint32 boss_kalecgos::boss_kalecgosAI::WildMagicTimer

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