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

Public Member Functions

 cthunAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void EnterCombat (Unit *) override
 
void SpawnEyeTentacle (float x, float y)
 
Unit * SelectRandomNotStomach ()
 
void UpdateAI (uint32 diff) override
 
void JustDied (Unit *) override
 
void DamageTaken (Unit *, uint32 &damage) override
 
void DoAction (int32 param) 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)
 
Unit * DoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
Player * GetPlayerAtMinimumRange (float minRange)
 
Creature * DoSpawnCreature (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 const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
void SetCombatMovement (bool allowMovement)
 
bool IsCombatMovementAllowed () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
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 const * GetBoundary () 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
 
Unit * SelectTarget (SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
Unit * SelectTarget (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

InstanceScript * instance
 
uint32 WisperTimer
 
uint32 PhaseTimer
 
ObjectGuid HoldPlayer
 
uint32 EyeTentacleTimer
 
uint8 FleshTentaclesKilled
 
uint32 GiantClawTentacleTimer
 
uint32 GiantEyeTentacleTimer
 
uint32 StomachAcidTimer
 
uint32 StomachEnterTimer
 
uint32 StomachEnterVisTimer
 
ObjectGuid StomachEnterTarget
 
std::unordered_map< ObjectGuid,
bool > 
Stomach_Map
 
- 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 AISpellInfoType * AISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
Creature * DoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummonFlyer (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 CreatureAI
Creature *const me
 
CreatureBoundary const * _boundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Constructor & Destructor Documentation

boss_cthun::cthunAI::cthunAI ( Creature *  creature)
inline
461  : ScriptedAI(creature)
462  {
463  Initialize();
464  SetCombatMovement(false);
465 
466  instance = creature->GetInstanceScript();
467  }
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
void SetCombatMovement(bool allowMovement)
Definition: ScriptedCreature.cpp:382
InstanceScript * instance
Definition: boss_cthun.cpp:491
void Initialize()
Definition: boss_cthun.cpp:469

+ Here is the call graph for this function:

Member Function Documentation

void boss_cthun::cthunAI::DamageTaken ( Unit *  ,
uint32 &  damage 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

849  {
851  {
852  case PHASE_CTHUN_STOMACH:
853  //Not weakened so reduce damage by 99%
854  damage /= 100;
855  if (damage == 0)
856  damage = 1;
857 
858  //Prevent death in non-weakened state
859  if (damage >= me->GetHealth())
860  damage = 0;
861 
862  return;
863 
864  case PHASE_CTHUN_WEAK:
865  //Weakened - takes normal damage
866  return;
867 
868  default:
869  damage = 0;
870  break;
871  }
872  }
Definition: temple_of_ahnqiraj.h:38
Definition: boss_cthun.cpp:72
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
Creature *const me
Definition: CreatureAI.h:71
Definition: boss_cthun.cpp:71
InstanceScript * instance
Definition: boss_cthun.cpp:491
uint32 GetHealth() const
Definition: Unit.h:1426

+ Here is the call graph for this function:

void boss_cthun::cthunAI::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

875  {
876  switch (param)
877  {
880  break;
881  }
882  }
Definition: boss_cthun.cpp:119
uint8 FleshTentaclesKilled
Definition: boss_cthun.cpp:506
void boss_cthun::cthunAI::EnterCombat ( Unit *  )
inlineoverridevirtual

Reimplemented from ScriptedAI.

533  {
534  DoZoneInCombat();
535  }
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
Definition: CreatureAI.cpp:47

+ Here is the call graph for this function:

void boss_cthun::cthunAI::Initialize ( void  )
inline
470  {
471  //One random wisper every 90 - 300 seconds
472  WisperTimer = 90000;
473 
474  //Phase information
475  PhaseTimer = 10000; //Emerge in 10 seconds
476 
477  //No hold player for transition
478  HoldPlayer.Clear();
479 
480  //Body Phase
481  EyeTentacleTimer = 30000;
483  GiantClawTentacleTimer = 15000; //15 seconds into body phase (1 min repeat)
484  GiantEyeTentacleTimer = 45000; //15 seconds into body phase (1 min repeat)
485  StomachAcidTimer = 4000; //Every 4 seconds
486  StomachEnterTimer = 10000; //Every 10 seconds
487  StomachEnterVisTimer = 0; //Always 3.5 seconds after Stomach Enter Timer
488  StomachEnterTarget.Clear(); //Target to be teleported to stomach
489  }
uint32 EyeTentacleTimer
Definition: boss_cthun.cpp:505
ObjectGuid HoldPlayer
Definition: boss_cthun.cpp:502
uint32 StomachAcidTimer
Definition: boss_cthun.cpp:509
uint32 WisperTimer
Definition: boss_cthun.cpp:494
ObjectGuid StomachEnterTarget
Definition: boss_cthun.cpp:512
uint32 GiantClawTentacleTimer
Definition: boss_cthun.cpp:507
void Clear()
Definition: ObjectGuid.h:215
uint32 StomachEnterTimer
Definition: boss_cthun.cpp:510
uint32 GiantEyeTentacleTimer
Definition: boss_cthun.cpp:508
uint32 PhaseTimer
Definition: boss_cthun.cpp:497
uint32 StomachEnterVisTimer
Definition: boss_cthun.cpp:511
uint8 FleshTentaclesKilled
Definition: boss_cthun.cpp:506

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_cthun::cthunAI::JustDied ( Unit *  )
inlineoverridevirtual

Reimplemented from ScriptedAI.

844  {
846  }
Definition: temple_of_ahnqiraj.h:38
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Definition: boss_cthun.cpp:74
InstanceScript * instance
Definition: boss_cthun.cpp:491

+ Here is the call graph for this function:

void boss_cthun::cthunAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

518  {
519  Initialize();
520 
521  //Clear players in stomach and outside
522  Stomach_Map.clear();
523 
524  //Reset flags
527  me->SetVisible(false);
528 
530  }
Definition: temple_of_ahnqiraj.h:38
Definition: Unit.h:674
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
Definition: boss_cthun.cpp:96
Creature *const me
Definition: CreatureAI.h:71
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
void SetVisible(bool x)
Definition: Unit.cpp:10368
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3586
Definition: boss_cthun.cpp:63
InstanceScript * instance
Definition: boss_cthun.cpp:491
Definition: UpdateFields.h:109
void Initialize()
Definition: boss_cthun.cpp:469
std::unordered_map< ObjectGuid, bool > Stomach_Map
Definition: boss_cthun.cpp:515
Definition: Unit.h:698

+ Here is the call graph for this function:

Unit* boss_cthun::cthunAI::SelectRandomNotStomach ( )
inline
546  {
547  if (Stomach_Map.empty())
548  return NULL;
549 
550  std::unordered_map<ObjectGuid, bool>::const_iterator i = Stomach_Map.begin();
551 
552  std::list<Unit*> temp;
553  std::list<Unit*>::const_iterator j;
554 
555  //Get all players in map
556  while (i != Stomach_Map.end())
557  {
558  //Check for valid player
559  Unit* unit = ObjectAccessor::GetUnit(*me, i->first);
560 
561  //Only units out of stomach
562  if (unit && i->second == false)
563  temp.push_back(unit);
564 
565  ++i;
566  }
567 
568  if (temp.empty())
569  return NULL;
570 
571  j = temp.begin();
572 
573  //Get random but only if we have more than one unit on threat list
574  if (temp.size() > 1)
575  advance(j, rand32() % (temp.size() - 1));
576 
577  return (*j);
578  }
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
arena_t NULL
Definition: jemalloc_internal.h:624
void advance(octet_iterator &it, distance_type n, octet_iterator end)
Definition: checked.h:190
Creature *const me
Definition: CreatureAI.h:71
uint32 rand32()
Definition: Random.cpp:64
std::unordered_map< ObjectGuid, bool > Stomach_Map
Definition: boss_cthun.cpp:515
Definition: Unit.h:1305

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_cthun::cthunAI::SpawnEyeTentacle ( float  x,
float  y 
)
inline
538  {
540  if (Spawned && Spawned->AI())
541  if (Unit* target = SelectRandomNotStomach())
542  Spawned->AI()->AttackStart(target);
543  }
Definition: Object.h:58
Definition: Creature.h:467
CreatureAI * AI() const
Definition: Creature.h:525
G3D::int16 y
Definition: Vector2int16.h:38
Unit * SelectRandomNotStomach()
Definition: boss_cthun.cpp:545
Creature * DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
Definition: ScriptedCreature.cpp:177
G3D::int16 x
Definition: Vector2int16.h:37
Definition: Unit.h:1305
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:29
Definition: temple_of_ahnqiraj.h:47

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_cthun::cthunAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

581  {
582  //Check if we have a target
583  if (!UpdateVictim())
584  {
585  //No target so we'll use this section to do our random wispers instance wide
586  //WisperTimer
587  if (WisperTimer <= diff)
588  {
589  //Play random sound to the zone
590  Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
591  for (Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr)
592  me->PlayDirectSound(RANDOM_SOUND_WHISPER, itr->GetSource());
593 
594  //One random wisper every 90 - 300 seconds
595  WisperTimer = urand(90000, 300000);
596  } else WisperTimer -= diff;
597 
598  return;
599  }
600 
602 
603  uint32 currentPhase = instance->GetData(DATA_CTHUN_PHASE);
604  if (currentPhase == PHASE_CTHUN_STOMACH || currentPhase == PHASE_CTHUN_WEAK)
605  {
606  // EyeTentacleTimer
607  if (EyeTentacleTimer <= diff)
608  {
609  //Spawn the 8 Eye Tentacles in the corret spots
610  SpawnEyeTentacle(0, 20); //south
611  SpawnEyeTentacle(10, 10); //south west
612  SpawnEyeTentacle(20, 0); //west
613  SpawnEyeTentacle(10, -10); //north west
614 
615  SpawnEyeTentacle(0, -20); //north
616  SpawnEyeTentacle(-10, -10); //north east
617  SpawnEyeTentacle(-20, 0); // east
618  SpawnEyeTentacle(-10, 10); // south east
619 
620  EyeTentacleTimer = 30000; // every 30sec in phase 2
621  } else EyeTentacleTimer -= diff;
622  }
623 
624  switch (currentPhase)
625  {
626  //Transition phase
628  //PhaseTimer
629  if (PhaseTimer <= diff)
630  {
631  //Switch
633 
634  //Switch to c'thun model
635  me->InterruptNonMeleeSpells(false);
636  DoCast(me, SPELL_TRANSFORM, false);
637  me->SetFullHealth();
638 
639  me->SetVisible(true);
641 
642  //Emerging phase
643  //AttackStart(ObjectAccessor::GetUnit(*me, HoldpPlayer));
644  DoZoneInCombat();
645 
646  //Place all units in threat list on outside of stomach
647  Stomach_Map.clear();
648 
649  for (std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin(); i != me->getThreatManager().getThreatList().end(); ++i)
650  Stomach_Map[(*i)->getUnitGuid()] = false; //Outside stomach
651 
652  //Spawn 2 flesh tentacles
654 
655  //Spawn flesh tentacle
656  for (uint8 i = 0; i < 2; i++)
657  {
659  if (!spawned)
661  }
662 
663  PhaseTimer = 0;
664  } else PhaseTimer -= diff;
665 
666  break;
667 
668  //Body Phase
669  case PHASE_CTHUN_STOMACH:
670  //Remove Target field
672 
673  //Weaken
674  if (FleshTentaclesKilled > 1)
675  {
677 
679  PhaseTimer = 45000;
680 
682 
683  std::unordered_map<ObjectGuid, bool>::iterator i = Stomach_Map.begin();
684 
685  //Kick all players out of stomach
686  while (i != Stomach_Map.end())
687  {
688  //Check for valid player
689  Unit* unit = ObjectAccessor::GetUnit(*me, i->first);
690 
691  //Only move units in stomach
692  if (unit && i->second == true)
693  {
694  //Teleport each player out
695  DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 10, float(rand32() % 6));
696 
697  //Cast knockback on them
699 
700  //Remove the acid debuff
702 
703  i->second = false;
704  }
705  ++i;
706  }
707 
708  return;
709  }
710 
711  //Stomach acid
712  if (StomachAcidTimer <= diff)
713  {
714  //Apply aura to all players in stomach
715  std::unordered_map<ObjectGuid, bool>::iterator i = Stomach_Map.begin();
716 
717  while (i != Stomach_Map.end())
718  {
719  //Check for valid player
720  Unit* unit = ObjectAccessor::GetUnit(*me, i->first);
721 
722  //Only apply to units in stomach
723  if (unit && i->second == true)
724  {
725  //Cast digestive acid on them
726  DoCast(unit, SPELL_DIGESTIVE_ACID, true);
727 
728  //Check if player should be kicked from stomach
729  if (unit->IsWithinDist3d(&KickPos, 15.0f))
730  {
731  //Teleport each player out
732  DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 10, float(rand32() % 6));
733 
734  //Cast knockback on them
736 
737  //Remove the acid debuff
739 
740  i->second = false;
741  }
742  }
743  ++i;
744  }
745 
746  StomachAcidTimer = 4000;
747  } else StomachAcidTimer -= diff;
748 
749  //Stomach Enter Timer
750  if (StomachEnterTimer <= diff)
751  {
752  if (Unit* target = SelectRandomNotStomach())
753  {
754  //Set target in stomach
755  Stomach_Map[target->GetGUID()] = true;
756  target->InterruptNonMeleeSpells(false);
757  target->CastSpell(target, SPELL_MOUTH_TENTACLE, true, NULL, NULL, me->GetGUID());
758  StomachEnterTarget = target->GetGUID();
759  StomachEnterVisTimer = 3800;
760  }
761 
762  StomachEnterTimer = 13800;
763  } else StomachEnterTimer -= diff;
764 
766  {
767  if (StomachEnterVisTimer <= diff)
768  {
769  //Check for valid player
771 
772  if (unit)
773  {
775  }
776 
779  } else StomachEnterVisTimer -= diff;
780  }
781 
782  //GientClawTentacleTimer
783  if (GiantClawTentacleTimer <= diff)
784  {
785  if (Unit* target = SelectRandomNotStomach())
786  {
787  //Spawn claw tentacle on the random target
789  if (spawned->AI())
790  spawned->AI()->AttackStart(target);
791  }
792 
793  //One giant claw tentacle every minute
794  GiantClawTentacleTimer = 60000;
795  } else GiantClawTentacleTimer -= diff;
796 
797  //GiantEyeTentacleTimer
798  if (GiantEyeTentacleTimer <= diff)
799  {
800  if (Unit* target = SelectRandomNotStomach())
801  {
802  //Spawn claw tentacle on the random target
804  if (spawned->AI())
805  spawned->AI()->AttackStart(target);
806  }
807 
808  //One giant eye tentacle every minute
809  GiantEyeTentacleTimer = 60000;
810  } else GiantEyeTentacleTimer -= diff;
811 
812  break;
813 
814  //Weakened state
815  case PHASE_CTHUN_WEAK:
816  //PhaseTimer
817  if (PhaseTimer <= diff)
818  {
819  //Switch
821 
822  //Remove purple coloration
824 
825  //Spawn 2 flesh tentacles
827 
828  //Spawn flesh tentacle
829  for (uint8 i = 0; i < 2; i++)
830  {
832  if (!spawned)
834  }
835 
836  PhaseTimer = 0;
837  } else PhaseTimer -= diff;
838 
839  break;
840  }
841  }
uint32 EyeTentacleTimer
Definition: boss_cthun.cpp:505
Definition: boss_cthun.cpp:97
#define STOMACH_X
Definition: boss_cthun.cpp:134
Definition: temple_of_ahnqiraj.h:38
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Definition: Unit.h:674
bool UpdateVictim()
Definition: CreatureAI.cpp:233
void PlayDirectSound(uint32 sound_id, Player *target=NULL)
Definition: Object.cpp:2966
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
Map * GetMap() const
Definition: Object.h:543
Definition: temple_of_ahnqiraj.h:51
Definition: boss_cthun.cpp:72
const Position FleshTentaclePos[2]
Definition: boss_cthun.cpp:140
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
Definition: CreatureAI.cpp:47
arena_t NULL
Definition: jemalloc_internal.h:624
ThreatContainer::StorageType const & getThreatList() const
Definition: ThreatManager.h:263
Definition: boss_cthun.cpp:113
uint32 StomachAcidTimer
Definition: boss_cthun.cpp:509
Definition: boss_cthun.cpp:70
Definition: Object.h:58
Definition: Creature.h:467
uint32 WisperTimer
Definition: boss_cthun.cpp:494
iterator begin()
Definition: MapRefManager.h:37
Definition: boss_cthun.cpp:96
#define STOMACH_Z
Definition: boss_cthun.cpp:136
Creature *const me
Definition: CreatureAI.h:71
Definition: temple_of_ahnqiraj.h:52
ObjectGuid StomachEnterTarget
Definition: boss_cthun.cpp:512
Definition: boss_cthun.cpp:130
Definition: temple_of_ahnqiraj.h:50
Definition: boss_cthun.cpp:71
float GetPositionY() const
Definition: Position.h:105
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Definition: boss_cthun.cpp:125
CreatureAI * AI() const
Definition: Creature.h:525
void SetVisible(bool x)
Definition: Unit.cpp:10368
float GetPositionZ() const
Definition: Position.h:106
uint32_t uint32
Definition: Define.h:150
#define STOMACH_Y
Definition: boss_cthun.cpp:135
Definition: LinkedList.h:141
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
Unit * SelectRandomNotStomach()
Definition: boss_cthun.cpp:545
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
void DoTeleportPlayer(Unit *unit, float x, float y, float z, float o)
Definition: ScriptedCreature.cpp:292
uint32 GiantClawTentacleTimer
Definition: boss_cthun.cpp:507
bool IsWithinDist3d(float x, float y, float z, float dist) const
Definition: Object.cpp:1638
const Position KickPos
Definition: boss_cthun.cpp:147
void Clear()
Definition: ObjectGuid.h:215
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
PlayerList const & GetPlayers() const
Definition: Map.h:433
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3586
ObjectGuid const & GetGUID() const
Definition: Object.h:105
uint32 StomachEnterTimer
Definition: boss_cthun.cpp:510
Definition: MapRefManager.h:26
InstanceScript * instance
Definition: boss_cthun.cpp:491
Definition: boss_cthun.cpp:114
Definition: UpdateFields.h:109
Definition: boss_cthun.cpp:112
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:2916
ThreatManager & getThreatManager()
Definition: Unit.h:1998
uint32 rand32()
Definition: Random.cpp:64
uint8_t uint8
Definition: Define.h:152
uint32 GiantEyeTentacleTimer
Definition: boss_cthun.cpp:508
uint32 PhaseTimer
Definition: boss_cthun.cpp:497
void SpawnEyeTentacle(float x, float y)
Definition: boss_cthun.cpp:537
uint32 StomachEnterVisTimer
Definition: boss_cthun.cpp:511
void SetFullHealth()
Definition: Unit.h:1440
std::unordered_map< ObjectGuid, bool > Stomach_Map
Definition: boss_cthun.cpp:515
float GetPositionX() const
Definition: Position.h:104
Definition: Unit.h:1305
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:29
#define STOMACH_O
Definition: boss_cthun.cpp:137
Definition: Unit.h:698
void SetTarget(ObjectGuid const &guid) override
Definition: Creature.cpp:2675
bool IsEmpty() const
Definition: ObjectGuid.h:242
iterator end()
Definition: MapRefManager.h:38
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Definition: Object.cpp:2346
uint8 FleshTentaclesKilled
Definition: boss_cthun.cpp:506

+ Here is the call graph for this function:

Member Data Documentation

uint32 boss_cthun::cthunAI::EyeTentacleTimer
uint8 boss_cthun::cthunAI::FleshTentaclesKilled
uint32 boss_cthun::cthunAI::GiantClawTentacleTimer
uint32 boss_cthun::cthunAI::GiantEyeTentacleTimer
ObjectGuid boss_cthun::cthunAI::HoldPlayer
InstanceScript* boss_cthun::cthunAI::instance
uint32 boss_cthun::cthunAI::PhaseTimer
std::unordered_map<ObjectGuid, bool> boss_cthun::cthunAI::Stomach_Map
uint32 boss_cthun::cthunAI::StomachAcidTimer
ObjectGuid boss_cthun::cthunAI::StomachEnterTarget
uint32 boss_cthun::cthunAI::StomachEnterTimer
uint32 boss_cthun::cthunAI::StomachEnterVisTimer
uint32 boss_cthun::cthunAI::WisperTimer

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