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

Public Member Functions

 boss_kelthuzadAI (Creature *creature)
 
void Initialize ()
 
void ResetPlayerScale ()
 
void Reset () override
 
void KilledUnit (Unit *) override
 
void JustDied (Unit *) override
 
void EnterCombat (Unit *) override
 
void DamageTaken (Unit *, uint32 &damage) override
 
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 ()
 
void JustReachedHome () override
 
bool CanAIAttack (Unit const *target) const override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
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 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

uint32 uiFaction
 
uint8 nGuardiansOfIcecrownCount
 
uint8 nAbomination
 
uint8 nWeaver
 
std::map< ObjectGuid, float > chained
 
SummonList spawns
 
- Public Attributes inherited from BossAI
InstanceScript *const instance
 
- 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 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_kelthuzad::boss_kelthuzadAI::boss_kelthuzadAI ( Creature creature)
inline
271  : BossAI(creature, BOSS_KELTHUZAD), spawns(creature)
272  {
273  Initialize();
274  uiFaction = me->getFaction();
275  }
SummonList spawns
Definition: boss_kelthuzad.cpp:293
uint32 getFaction() const
Definition: Unit.h:1466
Creature *const me
Definition: CreatureAI.h:71
uint32 uiFaction
Definition: boss_kelthuzad.cpp:285
void Initialize()
Definition: boss_kelthuzad.cpp:277
BossAI(Creature *creature, uint32 bossId)
Definition: ScriptedCreature.cpp:444
Definition: naxxramas.h:41

+ Here is the call graph for this function:

Member Function Documentation

void boss_kelthuzad::boss_kelthuzadAI::DamageTaken ( Unit ,
uint32 damage 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

371  {
372  if (events.IsInPhase(PHASE_TWO) && me->HealthBelowPctDamaged(45, damage))
373  {
377 
378  for (uint8 i = 0; i <= 3; ++i)
379  {
381  if (portal->getLootState() == GO_READY)
382  portal->UseDoorOrButton();
383  }
384  }
385  }
Definition: boss_kelthuzad.cpp:130
Definition: boss_kelthuzad.cpp:40
void SetPhase(uint8 phase)
Definition: EventMap.cpp:27
bool HealthBelowPctDamaged(int32 pct, uint32 damage) const
Definition: Unit.h:1431
bool IsInPhase(uint8 phase) const
Definition: EventMap.h:290
Creature *const me
Definition: CreatureAI.h:71
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: naxxramas.h:79
Definition: GameObject.h:880
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_kelthuzad.cpp:72
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:143
Definition: boss_kelthuzad.cpp:129
uint8_t uint8
Definition: Define.h:152
EventMap events
Definition: ScriptedCreature.h:371
Definition: GameObject.h:869
InstanceScript *const instance
Definition: ScriptedCreature.h:340

+ Here is the call graph for this function:

void boss_kelthuzad::boss_kelthuzadAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from BossAI.

349  {
351  _EnterCombat();
352  for (uint8 i = 0; i <= 3; ++i)
353  {
355  portal->ResetDoorOrButton();
356  }
368  }
Definition: boss_kelthuzad.cpp:42
Definition: boss_kelthuzad.cpp:67
void _EnterCombat()
Definition: ScriptedCreature.cpp:480
Definition: Unit.h:674
void SetPhase(uint8 phase)
Definition: EventMap.cpp:27
Definition: boss_kelthuzad.cpp:128
Definition: boss_kelthuzad.cpp:64
Definition: Unit.h:675
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
void setFaction(uint32 faction)
Definition: Unit.h:1467
Creature *const me
Definition: CreatureAI.h:71
Definition: UpdateFields.h:115
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: naxxramas.h:79
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
Definition: GameObject.h:880
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: boss_kelthuzad.cpp:63
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
Definition: UpdateFields.h:116
Definition: boss_kelthuzad.cpp:69
uint32 uiFaction
Definition: boss_kelthuzad.cpp:285
Definition: UpdateFields.h:109
void SetFloatValue(uint16 index, float value)
Definition: Object.cpp:1067
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:143
uint8_t uint8
Definition: Define.h:152
EventMap events
Definition: ScriptedCreature.h:371
Definition: boss_kelthuzad.cpp:65
Definition: Unit.h:698
InstanceScript *const instance
Definition: ScriptedCreature.h:340
Definition: boss_kelthuzad.cpp:86

+ Here is the call graph for this function:

void boss_kelthuzad::boss_kelthuzadAI::Initialize ( void  )
inline
278  {
280 
281  nAbomination = 0;
282  nWeaver = 0;
283  }
uint8 nGuardiansOfIcecrownCount
Definition: boss_kelthuzad.cpp:287
uint8 nWeaver
Definition: boss_kelthuzad.cpp:289
uint8 nAbomination
Definition: boss_kelthuzad.cpp:288

+ Here is the caller graph for this function:

void boss_kelthuzad::boss_kelthuzadAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from BossAI.

341  {
342  _JustDied();
343  Talk(SAY_DEATH);
344 
346  }
void _JustDied()
Definition: ScriptedCreature.cpp:471
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void ResetPlayerScale()
Definition: boss_kelthuzad.cpp:295
Definition: boss_kelthuzad.cpp:37

+ Here is the call graph for this function:

void boss_kelthuzad::boss_kelthuzadAI::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

336  {
337  Talk(SAY_SLAY);
338  }
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: boss_kelthuzad.cpp:36

+ Here is the call graph for this function:

void boss_kelthuzad::boss_kelthuzadAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

308  {
309  _Reset();
310 
311  me->setFaction(35);
313 
315  spawns.DespawnAll();
316 
318 
320  {
321  trigger->ResetDoorOrButton();
322  trigger->SetLootState(GO_READY);
323  }
324 
325  for (uint8 i = 0; i <= 3; ++i)
326  {
328  if (!((portal->getLootState() == GO_READY) || (portal->getLootState() == GO_NOT_READY)))
329  portal->ResetDoorOrButton();
330  }
331 
332  Initialize();
333  }
SummonList spawns
Definition: boss_kelthuzad.cpp:293
Definition: Unit.h:674
void DespawnAll()
Definition: ScriptedCreature.cpp:66
Definition: Unit.h:675
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
void setFaction(uint32 faction)
Definition: Unit.h:1467
Creature *const me
Definition: CreatureAI.h:71
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
void _Reset()
Definition: ScriptedCreature.cpp:457
Definition: naxxramas.h:79
Definition: GameObject.h:880
void ResetPlayerScale()
Definition: boss_kelthuzad.cpp:295
Definition: UpdateFields.h:109
Definition: GameObject.h:868
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:143
uint8_t uint8
Definition: Define.h:152
void Initialize()
Definition: boss_kelthuzad.cpp:277
Definition: naxxramas.h:57
Definition: GameObject.h:869
Definition: Unit.h:698
InstanceScript *const instance
Definition: ScriptedCreature.h:340
Definition: naxxramas.h:83

+ Here is the call graph for this function:

void boss_kelthuzad::boss_kelthuzadAI::ResetPlayerScale ( )
inline
296  {
297  std::map<ObjectGuid, float>::const_iterator itr;
298  for (itr = chained.begin(); itr != chained.end(); ++itr)
299  {
300  if (Player* charmed = ObjectAccessor::GetPlayer(*me, itr->first))
301  charmed->SetObjectScale(itr->second);
302  }
303 
304  chained.clear();
305  }
Creature *const me
Definition: CreatureAI.h:71
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:184
std::map< ObjectGuid, float > chained
Definition: boss_kelthuzad.cpp:291

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_kelthuzad::boss_kelthuzadAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from BossAI.

388  {
389  if (!UpdateVictim())
390  return;
391 
392  events.Update(diff);
393 
395  {
396  while (uint32 eventId = events.ExecuteEvent())
397  {
398  switch (eventId)
399  {
400  case EVENT_WASTE:
401  DoSummon(NPC_WASTE, Pos[RAND(0, 3, 6, 9)]);
402  events.Repeat(2000, 5000);
403  break;
404  case EVENT_ABOMIN:
405  if (nAbomination < 8)
406  {
407  DoSummon(NPC_ABOMINATION, Pos[RAND(1, 4, 7, 10)]);
408  nAbomination++;
409  events.Repeat(20000);
410  }
411  break;
412  case EVENT_WEAVER:
413  if (nWeaver < 8)
414  {
415  DoSummon(NPC_WEAVER, Pos[RAND(0, 3, 6, 9)]);
416  nWeaver++;
417  events.Repeat(25000);
418  }
419  break;
420  case EVENT_TRIGGER:
422  trigger->SetLootState(GO_JUST_DEACTIVATED);
423  break;
424  case EVENT_PHASE:
425  events.Reset();
426  Talk(SAY_AGGRO);
428  spawns.DespawnAll();
430  me->CastStop();
431 
433  events.ScheduleEvent(EVENT_BOLT, urand(5000, 10000));
435  events.ScheduleEvent(EVENT_DETONATE, urand(30000, 40000));
436  events.ScheduleEvent(EVENT_FISSURE, urand(10000, 30000));
437  events.ScheduleEvent(EVENT_BLAST, urand(60000, 120000));
439  events.ScheduleEvent(EVENT_CHAIN, urand(30000, 60000));
441  break;
442  default:
443  break;
444  }
445  }
446  }
447  else
448  {
450  return;
451 
452  if (uint32 eventId = events.ExecuteEvent())
453  {
454  switch (eventId)
455  {
456  case EVENT_BOLT:
458  events.Repeat(5000, 10000);
459  break;
460  case EVENT_NOVA:
462  events.Repeat(15000, 30000);
463  break;
464  case EVENT_CHAIN:
465  {
466  uint32 count = urand(1, 3);
467  for (uint8 i = 1; i <= count; i++)
468  {
469  Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true);
470  if (target && !target->IsCharmed() && (chained.find(target->GetGUID()) == chained.end()))
471  {
473  float scale = target->GetObjectScale();
474  chained.insert(std::make_pair(target->GetGUID(), scale));
475  target->SetObjectScale(scale * 2);
476  events.ScheduleEvent(EVENT_CHAINED_SPELL, 2000); //core has 2000ms to set unit flag charm
477  }
478  }
479  if (!chained.empty())
480  Talk(SAY_CHAIN);
481  events.Repeat(100000, 180000);
482  break;
483  }
484  case EVENT_CHAINED_SPELL:
485  {
486  std::map<ObjectGuid, float>::iterator itr;
487  for (itr = chained.begin(); itr != chained.end();)
488  {
489  if (Unit* player = ObjectAccessor::GetPlayer(*me, itr->first))
490  {
491  if (!player->IsCharmed())
492  {
493  player->SetObjectScale(itr->second);
494  std::map<ObjectGuid, float>::iterator next = itr;
495  ++next;
496  chained.erase(itr);
497  itr = next;
498  continue;
499  }
500 
502  {
503  switch (player->getClass())
504  {
505  case CLASS_DRUID:
506  if (urand(0, 1))
507  player->CastSpell(target, SPELL_MOONFIRE, false);
508  else
509  player->CastSpell(me, SPELL_LIFEBLOOM, false);
510  break;
511  case CLASS_HUNTER:
512  player->CastSpell(target, RAND(SPELL_MULTI_SHOT, SPELL_VOLLEY), false);
513  break;
514  case CLASS_MAGE:
515  player->CastSpell(target, RAND(SPELL_FROST_FIREBOLT, SPELL_ARCANE_MISSILES), false);
516  break;
517  case CLASS_WARLOCK:
518  player->CastSpell(target, RAND(SPELL_CURSE_OF_AGONY, SPELL_SHADOW_BOLT), true);
519  break;
520  case CLASS_WARRIOR:
521  player->CastSpell(target, RAND(SPELL_BLADESTORM, SPELL_CLEAVE), false);
522  break;
523  case CLASS_PALADIN:
524  if (urand(0, 1))
525  player->CastSpell(target, SPELL_HAMMER_OF_JUSTICE, false);
526  else
527  player->CastSpell(me, SPELL_HOLY_SHOCK, false);
528  break;
529  case CLASS_PRIEST:
530  if (urand(0, 1))
531  player->CastSpell(target, SPELL_VAMPIRIC_TOUCH, false);
532  else
533  player->CastSpell(me, SPELL_RENEW, false);
534  break;
535  case CLASS_SHAMAN:
536  if (urand(0, 1))
537  player->CastSpell(target, SPELL_EARTH_SHOCK, false);
538  else
539  player->CastSpell(me, SPELL_HEALING_WAVE, false);
540  break;
541  case CLASS_ROGUE:
542  player->CastSpell(target, RAND(SPELL_HEMORRHAGE, SPELL_MUTILATE), false);
543  break;
544  case CLASS_DEATH_KNIGHT:
545  if (urand(0, 1))
546  player->CastSpell(target, SPELL_PLAGUE_STRIKE, true);
547  else
548  player->CastSpell(target, SPELL_HOWLING_BLAST, true);
549  break;
550  }
551  }
552  }
553  ++itr;
554  }
555 
556  if (!chained.empty())
557  events.Repeat(5000);
558 
559  break;
560  }
561  case EVENT_DETONATE:
562  {
563  std::vector<Unit*> unitList;
565  for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
566  {
567  Unit* const target = (*itr)->getTarget();
568 
569  if (target->GetTypeId() == TYPEID_PLAYER
570  && target->getPowerType() == POWER_MANA
571  && target->GetPower(POWER_MANA))
572  {
573  unitList.push_back(target);
574  }
575  }
576 
577  if (!unitList.empty())
578  {
579  std::vector<Unit*>::const_iterator itr = unitList.begin();
580  advance(itr, rand32() % unitList.size());
582  Talk(SAY_SPECIAL);
583  }
584 
585  events.Repeat(20000, 50000);
586  break;
587  }
588  case EVENT_FISSURE:
589  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
590  DoCast(target, SPELL_SHADOW_FISURE);
591  events.Repeat(10000, 45000);
592  break;
593  case EVENT_BLAST:
594  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, RAID_MODE(1, 0), 0, true))
595  DoCast(target, SPELL_FROST_BLAST);
596  if (rand32() % 2)
598  events.Repeat(30000, 90000);
599  break;
602  lichKing->AI()->Talk(SAY_ANSWER_REQUEST);
604  break;
606  if (Creature* guardian = DoSummon(NPC_ICECROWN, Pos[RAND(2, 5, 8, 11)]))
607  guardian->SetFloatValue(UNIT_FIELD_COMBATREACH, 2);
611  break;
612  default:
613  break;
614  }
615  }
616 
618  }
619  }
SummonList spawns
Definition: boss_kelthuzad.cpp:293
Definition: boss_kelthuzad.cpp:39
Definition: SharedDefines.h:170
Definition: boss_kelthuzad.cpp:61
Definition: boss_kelthuzad.cpp:85
Definition: boss_kelthuzad.cpp:113
Definition: boss_kelthuzad.cpp:103
Definition: boss_kelthuzad.cpp:67
Definition: UnitAI.h:36
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:167
Definition: boss_kelthuzad.cpp:136
Definition: Unit.h:674
Definition: GameObject.h:871
bool UpdateVictim()
Definition: CreatureAI.cpp:233
Definition: SharedDefines.h:172
Definition: Unit.h:565
void DespawnAll()
Definition: ScriptedCreature.cpp:66
Definition: boss_kelthuzad.cpp:110
void SetPhase(uint8 phase)
Definition: EventMap.cpp:27
Definition: boss_kelthuzad.cpp:115
void Reset()
Definition: EventMap.cpp:20
Definition: boss_kelthuzad.cpp:101
Definition: boss_kelthuzad.cpp:73
int next(int i, int n)
Definition: RecastContour.cpp:469
Definition: boss_kelthuzad.cpp:128
Definition: boss_kelthuzad.cpp:64
Definition: boss_kelthuzad.cpp:116
Definition: boss_kelthuzad.cpp:60
Definition: boss_kelthuzad.cpp:109
ThreatContainer::StorageType const & getThreatList() const
Definition: ThreatManager.h:263
Definition: boss_kelthuzad.cpp:94
Definition: Unit.h:675
Definition: Creature.h:467
void CastStop(uint32 except_spellid=0)
Definition: Unit.cpp:862
Definition: boss_kelthuzad.cpp:254
int32 GetPower(Powers power) const
Definition: Unit.cpp:11589
Definition: boss_kelthuzad.cpp:79
bool IsInPhase(uint8 phase) const
Definition: EventMap.h:290
static First const & RAND(First const &first, Second const &second, Rest const &...rest)
Definition: CreatureAIImpl.h:30
Definition: boss_kelthuzad.cpp:97
Definition: SharedDefines.h:168
void advance(octet_iterator &it, distance_type n, octet_iterator end)
Definition: checked.h:190
Definition: boss_kelthuzad.cpp:57
Definition: boss_kelthuzad.cpp:106
Definition: SharedDefines.h:167
Difficulty GetDifficulty() const
Definition: ScriptedCreature.h:271
Creature *const me
Definition: CreatureAI.h:71
Powers getPowerType() const
Definition: Unit.h:1444
TypeID GetTypeId() const
Definition: Object.h:113
Definition: SharedDefines.h:171
Definition: boss_kelthuzad.cpp:46
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: boss_kelthuzad.cpp:58
Definition: boss_kelthuzad.cpp:118
Definition: boss_kelthuzad.cpp:98
Definition: boss_kelthuzad.cpp:100
Definition: UnitAI.h:35
Unit * GetVictim() const
Definition: Unit.h:1379
Definition: boss_kelthuzad.cpp:80
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:184
Creature * DoSummon(uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
Definition: CreatureAI.cpp:377
Definition: boss_kelthuzad.cpp:107
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
Definition: boss_kelthuzad.cpp:59
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
Definition: boss_kelthuzad.cpp:135
uint32_t uint32
Definition: Define.h:150
Definition: boss_kelthuzad.cpp:41
Definition: boss_kelthuzad.cpp:137
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
Definition: SharedDefines.h:173
Definition: DBCEnums.h:408
Definition: GameObject.h:880
uint8 nGuardiansOfIcecrownCount
Definition: boss_kelthuzad.cpp:287
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void Repeat(Milliseconds const &time)
Definition: EventMap.h:170
Definition: boss_kelthuzad.cpp:104
Definition: boss_kelthuzad.cpp:56
Definition: boss_kelthuzad.cpp:63
void ScheduleEvent(uint32 eventId, Milliseconds const &time, uint32 group=0, uint8 phase=0)
Definition: EventMap.h:123
Definition: boss_kelthuzad.cpp:38
Definition: boss_kelthuzad.cpp:119
Definition: SharedDefines.h:174
Definition: UpdateFields.h:116
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
Definition: boss_kelthuzad.cpp:69
void Update(uint32 time)
Definition: EventMap.h:54
Definition: boss_kelthuzad.cpp:78
const T & RAID_MODE(const T &normal10, const T &normal25) const
Definition: ScriptedCreature.h:293
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: ObjectGuid.h:33
std::list< HostileReference * > StorageType
Definition: ThreatManager.h:149
Definition: UpdateFields.h:109
Definition: boss_kelthuzad.cpp:95
Definition: boss_kelthuzad.cpp:112
virtual void SetObjectScale(float scale)
Definition: Object.h:111
Definition: boss_kelthuzad.cpp:72
Definition: SharedDefines.h:169
uint8 nWeaver
Definition: boss_kelthuzad.cpp:289
Definition: boss_kelthuzad.cpp:55
Definition: boss_kelthuzad.cpp:91
uint32 ExecuteEvent()
Definition: EventMap.cpp:46
ThreatManager & getThreatManager()
Definition: Unit.h:1998
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:143
Definition: boss_kelthuzad.cpp:129
uint32 rand32()
Definition: Random.cpp:64
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1395
uint8_t uint8
Definition: Define.h:152
Definition: naxxramas.h:84
std::map< ObjectGuid, float > chained
Definition: boss_kelthuzad.cpp:291
EventMap events
Definition: ScriptedCreature.h:371
Definition: boss_kelthuzad.cpp:84
void DoStartMovement(Unit *target, float distance=0.0f, float angle=0.0f)
Definition: ScriptedCreature.cpp:134
Definition: boss_kelthuzad.cpp:43
Definition: boss_kelthuzad.cpp:92
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:159
Definition: boss_kelthuzad.cpp:65
Definition: SharedDefines.h:175
Definition: SharedDefines.h:177
Definition: boss_kelthuzad.cpp:138
Definition: Unit.h:1305
Pos
Definition: boss_gothik.cpp:115
Definition: Unit.h:698
Definition: boss_kelthuzad.cpp:82
float GetObjectScale() const
Definition: Object.h:110
Definition: boss_kelthuzad.cpp:35
bool IsCharmed() const
Definition: Unit.h:1742
InstanceScript *const instance
Definition: ScriptedCreature.h:340
Definition: naxxramas.h:83
Definition: SharedDefines.h:248
uint8 nAbomination
Definition: boss_kelthuzad.cpp:288

+ Here is the call graph for this function:

Member Data Documentation

std::map<ObjectGuid, float> boss_kelthuzad::boss_kelthuzadAI::chained
uint8 boss_kelthuzad::boss_kelthuzadAI::nAbomination
uint8 boss_kelthuzad::boss_kelthuzadAI::nGuardiansOfIcecrownCount
uint8 boss_kelthuzad::boss_kelthuzadAI::nWeaver
SummonList boss_kelthuzad::boss_kelthuzadAI::spawns
uint32 boss_kelthuzad::boss_kelthuzadAI::uiFaction

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