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

Public Member Functions

 boss_gothikAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void EnterCombat (Unit *) override
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void KilledUnit (Unit *) override
 
void JustDied (Unit *) override
 
void DoGothikSummon (uint32 entry)
 
bool CheckGroupSplitted ()
 
void SpellHit (Unit *, SpellInfo const *spell) override
 
void DamageTaken (Unit *, uint32 &damage) override
 
void SpellHitTarget (Unit *target, SpellInfo const *spell) override
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
virtual ~BossAI ()
 
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 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 waveCount
 
bool mergedSides
 
bool phaseTwo
 
bool thirtyPercentReached
 
GuidVector LiveTriggerGUID
 
GuidVector DeadTriggerGUID
 
- 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_gothik::boss_gothikAI::boss_gothikAI ( Creature creature)
inline
165  : BossAI(creature, BOSS_GOTHIK)
166  {
167  Initialize();
168  waveCount = 0;
169  }
void Initialize()
Definition: boss_gothik.cpp:171
uint32 waveCount
Definition: boss_gothik.cpp:178
Definition: naxxramas.h:38
BossAI(Creature *creature, uint32 bossId)
Definition: ScriptedCreature.cpp:444

+ Here is the call graph for this function:

Member Function Documentation

bool boss_gothik::boss_gothikAI::CheckGroupSplitted ( )
inline
319  {
320  bool checklife = false;
321  bool checkdead = false;
322  Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
323  for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
324  {
325  if (i->GetSource() && i->GetSource()->IsAlive() &&
326  i->GetSource()->GetPositionX() <= POS_X_NORTH &&
327  i->GetSource()->GetPositionX() >= POS_X_SOUTH &&
328  i->GetSource()->GetPositionY() <= POS_Y_GATE &&
329  i->GetSource()->GetPositionY() >= POS_Y_EAST)
330  {
331  checklife = true;
332  }
333  else if (i->GetSource() && i->GetSource()->IsAlive() &&
334  i->GetSource()->GetPositionX() <= POS_X_NORTH &&
335  i->GetSource()->GetPositionX() >= POS_X_SOUTH &&
336  i->GetSource()->GetPositionY() >= POS_Y_GATE &&
337  i->GetSource()->GetPositionY() <= POS_Y_WEST)
338  {
339  checkdead = true;
340  }
341 
342  if (checklife && checkdead)
343  return true;
344  }
345 
346  return false;
347  }
#define POS_Y_GATE
Definition: boss_gothik.cpp:99
#define POS_X_NORTH
Definition: boss_gothik.cpp:102
Map * GetMap() const
Definition: Object.h:543
#define POS_Y_WEST
Definition: boss_gothik.cpp:100
iterator begin()
Definition: MapRefManager.h:37
Creature *const me
Definition: CreatureAI.h:71
#define POS_X_SOUTH
Definition: boss_gothik.cpp:103
Definition: LinkedList.h:141
#define POS_Y_EAST
Definition: boss_gothik.cpp:101
PlayerList const & GetPlayers() const
Definition: Map.h:433
Definition: MapRefManager.h:26
iterator end()
Definition: MapRefManager.h:38

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_gothik::boss_gothikAI::DamageTaken ( Unit ,
uint32 damage 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

367  {
368  if (!phaseTwo)
369  damage = 0;
370  }
bool phaseTwo
Definition: boss_gothik.cpp:180
void boss_gothik::boss_gothikAI::DoGothikSummon ( uint32  entry)
inline
259  {
261  {
262  switch (entry)
263  {
264  case NPC_LIVE_TRAINEE:
265  {
266  if (Creature* liveTrigger = ObjectAccessor::GetCreature(*me, LiveTriggerGUID[0]))
267  DoSummon(NPC_LIVE_TRAINEE, liveTrigger, 1);
268  if (Creature* liveTrigger1 = ObjectAccessor::GetCreature(*me, LiveTriggerGUID[1]))
269  DoSummon(NPC_LIVE_TRAINEE, liveTrigger1, 1);
270  if (Creature* liveTrigger2 = ObjectAccessor::GetCreature(*me, LiveTriggerGUID[2]))
271  DoSummon(NPC_LIVE_TRAINEE, liveTrigger2, 1);
272  break;
273  }
274  case NPC_LIVE_KNIGHT:
275  {
276  if (Creature* liveTrigger3 = ObjectAccessor::GetCreature(*me, LiveTriggerGUID[3]))
277  DoSummon(NPC_LIVE_KNIGHT, liveTrigger3, 1);
278  if (Creature* liveTrigger5 = ObjectAccessor::GetCreature(*me, LiveTriggerGUID[5]))
279  DoSummon(NPC_LIVE_KNIGHT, liveTrigger5, 1);
280  break;
281  }
282  case NPC_LIVE_RIDER:
283  {
284  if (Creature* liveTrigger4 = ObjectAccessor::GetCreature(*me, LiveTriggerGUID[4]))
285  DoSummon(NPC_LIVE_RIDER, liveTrigger4, 1);
286  break;
287  }
288  }
289  }
290  else
291  {
292  switch (entry)
293  {
294  case NPC_LIVE_TRAINEE:
295  {
296  if (Creature* liveTrigger = ObjectAccessor::GetCreature(*me, LiveTriggerGUID[4]))
297  DoSummon(NPC_LIVE_TRAINEE, liveTrigger, 1);
298  if (Creature* liveTrigger2 = ObjectAccessor::GetCreature(*me, LiveTriggerGUID[4]))
299  DoSummon(NPC_LIVE_TRAINEE, liveTrigger2, 1);
300  break;
301  }
302  case NPC_LIVE_KNIGHT:
303  {
304  if (Creature* liveTrigger5 = ObjectAccessor::GetCreature(*me, LiveTriggerGUID[4]))
305  DoSummon(NPC_LIVE_KNIGHT, liveTrigger5, 1);
306  break;
307  }
308  case NPC_LIVE_RIDER:
309  {
310  if (Creature* liveTrigger4 = ObjectAccessor::GetCreature(*me, LiveTriggerGUID[4]))
311  DoSummon(NPC_LIVE_RIDER, liveTrigger4, 1);
312  break;
313  }
314  }
315  }
316  }
GuidVector LiveTriggerGUID
Definition: boss_gothik.cpp:183
Definition: boss_gothik.cpp:50
Definition: boss_gothik.cpp:51
Definition: boss_gothik.cpp:52
Definition: Creature.h:467
Difficulty GetDifficulty() const
Definition: ScriptedCreature.h:271
Creature *const me
Definition: CreatureAI.h:71
Creature * DoSummon(uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
Definition: CreatureAI.cpp:377
Definition: DBCEnums.h:408
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_gothik::boss_gothikAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from BossAI.

198  {
199  for (uint32 i = 0; i < POS_LIVE; ++i)
200  if (Creature* trigger = DoSummon(WORLD_TRIGGER, PosSummonLive[i]))
201  LiveTriggerGUID.push_back(trigger->GetGUID());
202  for (uint32 i = 0; i < POS_DEAD; ++i)
203  if (Creature* trigger = DoSummon(WORLD_TRIGGER, PosSummonDead[i]))
204  DeadTriggerGUID.push_back(trigger->GetGUID());
205 
206  if (LiveTriggerGUID.size() < POS_LIVE || DeadTriggerGUID.size() < POS_DEAD)
207  {
208  TC_LOG_ERROR("scripts", "Script Gothik: cannot summon triggers!");
209  EnterEvadeMode();
210  return;
211  }
212 
213  _EnterCombat();
214  waveCount = 0;
217  Talk(SAY_SPEECH);
219  }
GuidVector LiveTriggerGUID
Definition: boss_gothik.cpp:183
void _EnterCombat()
Definition: ScriptedCreature.cpp:480
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:168
#define WORLD_TRIGGER
Definition: Unit.h:33
const Position PosSummonLive[POS_LIVE]
Definition: boss_gothik.cpp:121
Definition: Creature.h:467
float const PosPlatform[4]
Definition: boss_gothik.cpp:142
void DoTeleportTo(float x, float y, float z, uint32 time=0)
Definition: ScriptedCreature.cpp:280
Definition: naxxramas.h:47
Definition: boss_gothik.cpp:117
Creature * DoSummon(uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
Definition: CreatureAI.cpp:377
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
uint32_t uint32
Definition: Define.h:150
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
const Position PosSummonDead[POS_DEAD]
Definition: boss_gothik.cpp:131
Definition: GameObject.h:823
uint32 waveCount
Definition: boss_gothik.cpp:178
Definition: boss_gothik.cpp:110
EventMap events
Definition: ScriptedCreature.h:371
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Definition: boss_gothik.cpp:27
GuidVector DeadTriggerGUID
Definition: boss_gothik.cpp:184
InstanceScript *const instance
Definition: ScriptedCreature.h:340
Definition: boss_gothik.cpp:118

+ Here is the call graph for this function:

void boss_gothik::boss_gothikAI::Initialize ( void  )
inline
172  {
173  mergedSides = false;
174  phaseTwo = false;
175  thirtyPercentReached = false;
176  }
bool phaseTwo
Definition: boss_gothik.cpp:180
bool mergedSides
Definition: boss_gothik.cpp:179
bool thirtyPercentReached
Definition: boss_gothik.cpp:181

+ Here is the caller graph for this function:

void boss_gothik::boss_gothikAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from BossAI.

250  {
251  LiveTriggerGUID.clear();
252  DeadTriggerGUID.clear();
253  _JustDied();
254  Talk(SAY_DEATH);
256  }
GuidVector LiveTriggerGUID
Definition: boss_gothik.cpp:183
void _JustDied()
Definition: ScriptedCreature.cpp:471
Definition: naxxramas.h:47
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: GameObject.h:822
Definition: boss_gothik.cpp:29
GuidVector DeadTriggerGUID
Definition: boss_gothik.cpp:184
InstanceScript *const instance
Definition: ScriptedCreature.h:340

+ Here is the call graph for this function:

void boss_gothik::boss_gothikAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from BossAI.

222  {
223  if (summon->GetEntry() == WORLD_TRIGGER)
224  summon->setActive(true);
225  else if (!mergedSides)
226  {
227  summon->AI()->DoAction(me->HasReactState(REACT_PASSIVE) ? 1 : 0);
228  summon->AI()->EnterEvadeMode();
229  }
230  else
231  {
232  summon->AI()->DoAction(0);
233  summon->AI()->DoZoneInCombat();
234  }
235  summons.Summon(summon);
236  }
Definition: Unit.h:1129
void setActive(bool isActiveObject)
Definition: Object.cpp:1473
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:168
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
Definition: CreatureAI.cpp:47
#define WORLD_TRIGGER
Definition: Unit.h:33
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:92
bool HasReactState(ReactStates state) const
Definition: Creature.h:504
Creature *const me
Definition: CreatureAI.h:71
CreatureAI * AI() const
Definition: Creature.h:525
virtual void DoAction(int32)
Definition: UnitAI.h:138
SummonList summons
Definition: ScriptedCreature.h:372
bool mergedSides
Definition: boss_gothik.cpp:179
uint32 GetEntry() const
Definition: Object.h:107

+ Here is the call graph for this function:

void boss_gothik::boss_gothikAI::KilledUnit ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

244  {
245  if (!(rand32() % 5))
246  Talk(SAY_KILL);
247  }
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: boss_gothik.cpp:28
uint32 rand32()
Definition: Random.cpp:64

+ Here is the call graph for this function:

void boss_gothik::boss_gothikAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

187  {
188  LiveTriggerGUID.clear();
189  DeadTriggerGUID.clear();
190 
193  _Reset();
194  Initialize();
195  }
GuidVector LiveTriggerGUID
Definition: boss_gothik.cpp:183
void Initialize()
Definition: boss_gothik.cpp:171
Definition: Unit.h:1129
Creature *const me
Definition: CreatureAI.h:71
Definition: naxxramas.h:47
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
void _Reset()
Definition: ScriptedCreature.cpp:457
Definition: GameObject.h:822
void SetReactState(ReactStates st)
Definition: Creature.h:502
GuidVector DeadTriggerGUID
Definition: boss_gothik.cpp:184
InstanceScript *const instance
Definition: ScriptedCreature.h:340

+ Here is the call graph for this function:

void boss_gothik::boss_gothikAI::SpellHit ( Unit ,
SpellInfo const spell 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

350  {
351  uint32 spellId = 0;
352  switch (spell->Id)
353  {
355  case SPELL_INFORM_LIVE_KNIGHT: spellId = SPELL_INFORM_DEAD_KNIGHT; break;
356  case SPELL_INFORM_LIVE_RIDER: spellId = SPELL_INFORM_DEAD_RIDER; break;
357  }
358  if (spellId && me->IsInCombat())
359  {
361  if (Creature* pRandomDeadTrigger = ObjectAccessor::GetCreature(*me, DeadTriggerGUID[rand32() % POS_DEAD]))
362  me->CastSpell(pRandomDeadTrigger, spellId, true);
363  }
364  }
Definition: boss_gothik.cpp:39
Definition: boss_gothik.cpp:40
bool IsInCombat() const
Definition: Unit.h:1584
Definition: boss_gothik.cpp:38
Definition: Creature.h:467
Definition: SharedDefines.h:2453
Definition: boss_gothik.cpp:42
Creature *const me
Definition: CreatureAI.h:71
Definition: boss_gothik.cpp:43
uint32_t uint32
Definition: Define.h:150
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:174
uint32 rand32()
Definition: Random.cpp:64
void HandleEmoteCommand(uint32 anim_id)
Definition: Unit.cpp:1444
Definition: boss_gothik.cpp:41
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
GuidVector DeadTriggerGUID
Definition: boss_gothik.cpp:184
Definition: boss_gothik.cpp:118

+ Here is the call graph for this function:

void boss_gothik::boss_gothikAI::SpellHitTarget ( Unit target,
SpellInfo const spell 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

373  {
374  if (!me->IsInCombat())
375  return;
376 
377  switch (spell->Id)
378  {
380  DoSummon(NPC_DEAD_TRAINEE, target, 0);
381  break;
383  DoSummon(NPC_DEAD_KNIGHT, target, 0);
384  break;
386  DoSummon(NPC_DEAD_RIDER, target, 1.0f);
387  DoSummon(NPC_DEAD_HORSE, target, 1.0f);
388  break;
389  }
390  }
Definition: boss_gothik.cpp:53
bool IsInCombat() const
Definition: Unit.h:1584
Definition: boss_gothik.cpp:55
Definition: boss_gothik.cpp:42
Creature *const me
Definition: CreatureAI.h:71
Definition: boss_gothik.cpp:43
Creature * DoSummon(uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
Definition: CreatureAI.cpp:377
Definition: boss_gothik.cpp:56
Definition: boss_gothik.cpp:54
Definition: boss_gothik.cpp:41

+ Here is the call graph for this function:

void boss_gothik::boss_gothikAI::SummonedCreatureDespawn ( Creature summon)
inlineoverridevirtual

Reimplemented from BossAI.

239  {
240  summons.Despawn(summon);
241  }
void Despawn(Creature const *summon)
Definition: ScriptedCreature.h:93
SummonList summons
Definition: ScriptedCreature.h:372

+ Here is the call graph for this function:

void boss_gothik::boss_gothikAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Magic numbers fail

Magic numbers fail

Reimplemented from BossAI.

393  {
394  if (!UpdateVictim())
395  return;
396 
397  events.Update(diff);
398 
400  {
401  thirtyPercentReached = true;
403  }
404 
406  return;
407 
408  while (uint32 eventId = events.ExecuteEvent())
409  {
410  switch (eventId)
411  {
412  case EVENT_SUMMON:
413  if (waves[waveCount].entry)
414  {
415  if ((waves[waveCount].mode == 2) && (GetDifficulty() == DIFFICULTY_25_N))
417  else if ((waves[waveCount].mode == 0) && (GetDifficulty() == DIFFICULTY_10_N))
419  else if (waves[waveCount].mode == 1)
421 
422  // if group is not splitted, open gate and merge both sides at ~ 2 minutes (wave 11)
423  if (waveCount == 11)
424  {
425  if (!CheckGroupSplitted())
426  {
429  summons.DoAction(0, pred);
431  mergedSides = true;
432  }
433  }
434 
435  if (waves[waveCount].mode == 1)
437  else if ((waves[waveCount].mode == 2) && (GetDifficulty() == DIFFICULTY_25_N))
439  else if ((waves[waveCount].mode == 0) && (GetDifficulty() == DIFFICULTY_10_N))
441  else
443 
444  ++waveCount;
445  }
446  else
447  {
448  phaseTwo = true;
453  summons.DoAction(0, pred);
456  events.ScheduleEvent(EVENT_HARVEST, urand(3000, 15000));
458  }
459  break;
460  case EVENT_BOLT:
463  break;
464  case EVENT_HARVEST:
466  events.ScheduleEvent(EVENT_HARVEST, urand(20000, 25000));
467  break;
468  case EVENT_TELEPORT:
470  {
471  me->AttackStop();
472  if (IN_LIVE_SIDE(me))
474  else
476 
478  if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0))
479  {
480  me->getThreatManager().addThreat(target, 100.0f);
481  AttackStart(target);
482  }
483 
485  }
486  break;
487  }
488  }
489 
490  if (!phaseTwo)
492  }
bool AttackStop()
Definition: Unit.cpp:7337
bool phaseTwo
Definition: boss_gothik.cpp:180
Definition: boss_gothik.cpp:145
bool CheckGroupSplitted()
Definition: boss_gothik.cpp:318
Definition: DBCEnums.h:407
bool UpdateVictim()
Definition: CreatureAI.cpp:233
Definition: Unit.h:1131
Definition: boss_gothik.cpp:36
void addThreat(Unit *victim, float threat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=NULL)
Definition: ThreatManager.cpp:406
Definition: Unit.h:565
Definition: boss_gothik.cpp:30
bool HealthBelowPct(uint32 pct) const
Definition: ScriptedCreature.h:247
Definition: ScriptedCreature.h:136
void DoAction(int32 info, Predicate &predicate, uint16 max=0)
Definition: ScriptedCreature.h:104
#define IN_LIVE_SIDE(who)
Definition: boss_gothik.cpp:105
const Waves waves[]
Definition: boss_gothik.cpp:63
void resetAggro(PREDICATE predicate)
Definition: ThreatManager.h:243
Definition: boss_gothik.cpp:113
void DoTeleportTo(float x, float y, float z, uint32 time=0)
Definition: ScriptedCreature.cpp:280
Difficulty GetDifficulty() const
Definition: ScriptedCreature.h:271
Creature *const me
Definition: CreatureAI.h:71
Definition: naxxramas.h:47
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
void DoGothikSummon(uint32 entry)
Definition: boss_gothik.cpp:258
void DoZoneInCombat(uint32 entry=0)
Definition: ScriptedCreature.cpp:35
uint32_t uint32
Definition: Define.h:150
Definition: DBCEnums.h:408
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
SummonList summons
Definition: ScriptedCreature.h:372
Definition: GameObject.h:822
void Update(uint32 time)
Definition: EventMap.h:54
bool mergedSides
Definition: boss_gothik.cpp:179
uint32 waveCount
Definition: boss_gothik.cpp:178
float const PosGroundLiveSide[4]
Definition: boss_gothik.cpp:140
Definition: boss_gothik.cpp:110
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:117
Definition: boss_gothik.cpp:112
uint32 ExecuteEvent()
Definition: EventMap.cpp:46
ThreatManager & getThreatManager()
Definition: Unit.h:1998
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1395
EventMap events
Definition: ScriptedCreature.h:371
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:159
bool thirtyPercentReached
Definition: boss_gothik.cpp:181
Definition: Unit.h:1305
float const PosGroundDeadSide[4]
Definition: boss_gothik.cpp:141
void SetReactState(ReactStates st)
Definition: Creature.h:502
Definition: boss_gothik.cpp:37
InstanceScript *const instance
Definition: ScriptedCreature.h:340
Definition: UnitAI.h:38
Definition: boss_gothik.cpp:111

+ Here is the call graph for this function:

Member Data Documentation

GuidVector boss_gothik::boss_gothikAI::DeadTriggerGUID
GuidVector boss_gothik::boss_gothikAI::LiveTriggerGUID
bool boss_gothik::boss_gothikAI::mergedSides
bool boss_gothik::boss_gothikAI::phaseTwo
bool boss_gothik::boss_gothikAI::thirtyPercentReached
uint32 boss_gothik::boss_gothikAI::waveCount

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