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

Public Member Functions

 boss_nightbaneAI (Creature *creature)
 
void Initialize ()
 
void Reset () override
 
void HandleTerraceDoors (bool open)
 
void EnterCombat (Unit *) override
 
void AttackStart (Unit *who) override
 
void JustDied (Unit *) override
 
void MoveInLineOfSight (Unit *who) override
 
void MovementInform (uint32 type, uint32 id) override
 
void JustSummoned (Creature *summoned) override
 
void TakeOff ()
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
virtual ~ScriptedAI ()
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &) override
 
void KilledUnit (Unit *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void OnPossess (bool)
 
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 ()
 
void OnCharmed (bool apply) override
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary constGetBoundary () const
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectAggroTarget targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectAggroTarget targetType, float dist=0.0f, bool playerOnly=false, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, PREDICATE const &predicate, uint32 maxTargets, SelectAggroTarget targetType)
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void SpellInterrupted (uint32, uint32)
 
void AttackStartCaster (Unit *victim, float dist)
 
void DoCast (uint32 spellId)
 
void DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
void DoCastVictim (uint32 spellId, bool triggered=false)
 
void DoCastAOE (uint32 spellId, bool triggered=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spellId)
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual bool sOnDummyEffect (Unit *, uint32, SpellEffIndex)
 
virtual void sOnGameEvent (bool, uint16)
 

Public Attributes

InstanceScriptinstance
 
uint32 Phase
 
bool RainBones
 
bool Skeletons
 
uint32 BellowingRoarTimer
 
uint32 CharredEarthTimer
 
uint32 DistractingAshTimer
 
uint32 SmolderingBreathTimer
 
uint32 TailSweepTimer
 
uint32 RainofBonesTimer
 
uint32 SmokingBlastTimer
 
uint32 FireballBarrageTimer
 
uint32 SearingCindersTimer
 
uint32 FlyCount
 
uint32 FlyTimer
 
bool Intro
 
bool Flying
 
bool Movement
 
uint32 WaitTimer
 
uint32 MovePhase
 
- 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_nightbane::boss_nightbaneAI::boss_nightbaneAI ( Creature creature)
inline
79  : ScriptedAI(creature)
80  {
81  Initialize();
82  instance = creature->GetInstanceScript();
83  Intro = true;
84  RainBones = false;
85  Skeletons = false;
86  FlyTimer = 0;
87  }
ScriptedAI(Creature *creature)
Definition: ScriptedCreature.cpp:100
void Initialize()
Definition: boss_nightbane.cpp:89
uint32 FlyTimer
Definition: boss_nightbane.cpp:128
InstanceScript * GetInstanceScript()
Definition: Object.cpp:1540
bool Intro
Definition: boss_nightbane.cpp:130
InstanceScript * instance
Definition: boss_nightbane.cpp:110
bool RainBones
Definition: boss_nightbane.cpp:114
bool Skeletons
Definition: boss_nightbane.cpp:115

+ Here is the call graph for this function:

Member Function Documentation

void boss_nightbane::boss_nightbaneAI::AttackStart ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

175  {
176  if (!Intro && !Flying)
178  }
bool Flying
Definition: boss_nightbane.cpp:131
bool Intro
Definition: boss_nightbane.cpp:130
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:117

+ Here is the call graph for this function:

void boss_nightbane::boss_nightbaneAI::EnterCombat ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

167  {
169 
170  HandleTerraceDoors(false);
171  Talk(YELL_AGGRO);
172  }
Definition: boss_nightbane.cpp:49
void HandleTerraceDoors(bool open)
Definition: boss_nightbane.cpp:160
Definition: InstanceScript.h:59
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
InstanceScript * instance
Definition: boss_nightbane.cpp:110
Definition: karazhan.h:37

+ Here is the call graph for this function:

void boss_nightbane::boss_nightbaneAI::HandleTerraceDoors ( bool  open)
inline
161  {
164  }
Definition: karazhan.h:56
virtual ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:93
Definition: karazhan.h:55
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:397
InstanceScript * instance
Definition: boss_nightbane.cpp:110

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_nightbane::boss_nightbaneAI::Initialize ( void  )
inline
90  {
91  BellowingRoarTimer = 30000;
92  CharredEarthTimer = 15000;
93  DistractingAshTimer = 20000;
94  SmolderingBreathTimer = 10000;
95  TailSweepTimer = 12000;
96  RainofBonesTimer = 10000;
97  SmokingBlastTimer = 20000;
98  FireballBarrageTimer = 13000;
99  SearingCindersTimer = 14000;
100  WaitTimer = 1000;
101 
102  Phase = 1;
103  FlyCount = 0;
104  MovePhase = 0;
105 
106  Flying = false;
107  Movement = false;
108  }
uint32 TailSweepTimer
Definition: boss_nightbane.cpp:121
uint32 RainofBonesTimer
Definition: boss_nightbane.cpp:122
bool Flying
Definition: boss_nightbane.cpp:131
uint32 BellowingRoarTimer
Definition: boss_nightbane.cpp:117
uint32 WaitTimer
Definition: boss_nightbane.cpp:134
Definition: Unit.h:409
uint32 SearingCindersTimer
Definition: boss_nightbane.cpp:125
uint32 FlyCount
Definition: boss_nightbane.cpp:127
uint32 SmolderingBreathTimer
Definition: boss_nightbane.cpp:120
uint32 MovePhase
Definition: boss_nightbane.cpp:135
uint32 DistractingAshTimer
Definition: boss_nightbane.cpp:119
uint32 SmokingBlastTimer
Definition: boss_nightbane.cpp:123
Phase
Definition: boss_kiljaeden.cpp:153
uint32 FireballBarrageTimer
Definition: boss_nightbane.cpp:124
uint32 CharredEarthTimer
Definition: boss_nightbane.cpp:118

+ Here is the caller graph for this function:

void boss_nightbane::boss_nightbaneAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

181  {
183 
184  HandleTerraceDoors(true);
185  }
Definition: inflate.h:49
void HandleTerraceDoors(bool open)
Definition: boss_nightbane.cpp:160
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
InstanceScript * instance
Definition: boss_nightbane.cpp:110
Definition: karazhan.h:37

+ Here is the call graph for this function:

void boss_nightbane::boss_nightbaneAI::JustSummoned ( Creature summoned)
inlineoverridevirtual

Reimplemented from ScriptedAI.

241  {
242  summoned->AI()->AttackStart(me->GetVictim());
243  }
Creature *const me
Definition: CreatureAI.h:71
Unit * GetVictim() const
Definition: Unit.h:1379
CreatureAI * AI() const
Definition: Creature.h:525
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:29

+ Here is the call graph for this function:

void boss_nightbane::boss_nightbaneAI::MoveInLineOfSight ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

189  {
190  if (!Intro && !Flying)
192  }
bool Flying
Definition: boss_nightbane.cpp:131
bool Intro
Definition: boss_nightbane.cpp:130
virtual void MoveInLineOfSight(Unit *)
Definition: CreatureAI.cpp:128

+ Here is the call graph for this function:

void boss_nightbane::boss_nightbaneAI::MovementInform ( uint32  type,
uint32  id 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

195  {
196  if (type != POINT_MOTION_TYPE)
197  return;
198 
199  if (Intro)
200  {
201  if (id >= 8)
202  {
203  Intro = false;
204  me->SetHomePosition(IntroWay[7][0], IntroWay[7][1], IntroWay[7][2], 0);
205  return;
206  }
207 
208  WaitTimer = 1;
209  }
210 
211  if (Flying)
212  {
213  if (id == 0)
214  {
216  Flying = false;
217  Phase = 2;
218  return;
219  }
220 
221  if (id == 3)
222  {
223  MovePhase = 4;
224  WaitTimer = 1;
225  return;
226  }
227 
228  if (id == 8)
229  {
230  Flying = false;
231  Phase = 1;
232  Movement = true;
233  return;
234  }
235 
236  WaitTimer = 1;
237  }
238  }
bool Flying
Definition: boss_nightbane.cpp:131
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:670
float IntroWay[8][3]
Definition: boss_nightbane.cpp:55
Creature *const me
Definition: CreatureAI.h:71
uint32 WaitTimer
Definition: boss_nightbane.cpp:134
Definition: Unit.h:409
bool Intro
Definition: boss_nightbane.cpp:130
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
uint32 MovePhase
Definition: boss_nightbane.cpp:135
Definition: boss_nightbane.cpp:52
Definition: MotionMaster.h:46
Phase
Definition: boss_kiljaeden.cpp:153

+ Here is the call graph for this function:

void boss_nightbane::boss_nightbaneAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

138  {
139  Initialize();
140 
141  me->SetSpeed(MOVE_RUN, 2.0f);
142  me->SetDisableGravity(true);
143  me->SetWalk(false);
144  me->setActive(true);
145 
147  me->DisappearAndDie();
148  else
150 
151  HandleTerraceDoors(true);
152 
153  if (!Intro)
154  {
155  me->SetHomePosition(IntroWay[7][0], IntroWay[7][1], IntroWay[7][2], 0);
157  }
158  }
void Initialize()
Definition: boss_nightbane.cpp:89
void setActive(bool isActiveObject)
Definition: Object.cpp:1473
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Definition: inflate.h:49
void MoveTargetedHome()
Definition: MotionMaster.cpp:201
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:670
bool SetDisableGravity(bool disable, bool packetOnly=false)
Definition: Unit.cpp:15818
void HandleTerraceDoors(bool open)
Definition: boss_nightbane.cpp:160
float IntroWay[8][3]
Definition: boss_nightbane.cpp:55
Creature *const me
Definition: CreatureAI.h:71
Definition: InstanceScript.h:59
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
Definition: InstanceScript.h:58
bool Intro
Definition: boss_nightbane.cpp:130
InstanceScript * instance
Definition: boss_nightbane.cpp:110
Definition: Unit.h:600
bool SetWalk(bool enable)
Definition: Unit.cpp:15800
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:10531
Definition: karazhan.h:37
void DisappearAndDie()
Definition: Creature.cpp:256

+ Here is the call graph for this function:

void boss_nightbane::boss_nightbaneAI::TakeOff ( )
inline
246  {
248 
251  me->SetDisableGravity(true);
252  (*me).GetMotionMaster()->Clear(false);
253  (*me).GetMotionMaster()->MovePoint(0, IntroWay[2][0], IntroWay[2][1], IntroWay[2][2]);
254 
255  Flying = true;
256 
257  FlyTimer = urand(45000, 60000); //timer wrong between 45 and 60 seconds
258  ++FlyCount;
259 
260  RainofBonesTimer = 5000; //timer wrong (maybe)
261  RainBones = false;
262  Skeletons = false;
263  }
Definition: Unit.h:1109
uint32 FlyTimer
Definition: boss_nightbane.cpp:128
uint32 RainofBonesTimer
Definition: boss_nightbane.cpp:122
bool Flying
Definition: boss_nightbane.cpp:131
bool SetDisableGravity(bool disable, bool packetOnly=false)
Definition: Unit.cpp:15818
float IntroWay[8][3]
Definition: boss_nightbane.cpp:55
Creature *const me
Definition: CreatureAI.h:71
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
Definition: Unit.cpp:2849
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
uint32 FlyCount
Definition: boss_nightbane.cpp:127
Definition: boss_nightbane.cpp:50
Definition: SharedDefines.h:2478
bool RainBones
Definition: boss_nightbane.cpp:114
bool Skeletons
Definition: boss_nightbane.cpp:115
void HandleEmoteCommand(uint32 anim_id)
Definition: Unit.cpp:1444

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void boss_nightbane::boss_nightbaneAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from ScriptedAI.

266  {
267  /* The timer for this was never setup apparently, not sure if the code works properly:
268  if (WaitTimer <= diff)
269  {
270  if (Intro)
271  {
272  if (MovePhase >= 7)
273  {
274  me->SetLevitate(false);
275  me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
276  me->GetMotionMaster()->MovePoint(8, IntroWay[7][0], IntroWay[7][1], IntroWay[7][2]);
277  }
278  else
279  {
280  me->GetMotionMaster()->MovePoint(MovePhase, IntroWay[MovePhase][0], IntroWay[MovePhase][1], IntroWay[MovePhase][2]);
281  ++MovePhase;
282  }
283  }
284  if (Flying)
285  {
286  if (MovePhase >= 7)
287  {
288  me->SetLevitate(false);
289  me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
290  me->GetMotionMaster()->MovePoint(8, IntroWay[7][0], IntroWay[7][1], IntroWay[7][2]);
291  }
292  else
293  {
294  me->GetMotionMaster()->MovePoint(MovePhase, IntroWay[MovePhase][0], IntroWay[MovePhase][1], IntroWay[MovePhase][2]);
295  ++MovePhase;
296  }
297  }
298 
299  WaitTimer = 0;
300  } else WaitTimer -= diff;
301  */
302 
303  if (!UpdateVictim())
304  return;
305 
306  if (Flying)
307  return;
308 
309  // Phase 1 "GROUND FIGHT"
310  if (Phase == 1)
311  {
312  if (Movement)
313  {
315  Movement = false;
316  }
317 
318  if (BellowingRoarTimer <= diff)
319  {
321  BellowingRoarTimer = urand(30000, 40000);
322  } else BellowingRoarTimer -= diff;
323 
324  if (SmolderingBreathTimer <= diff)
325  {
327  SmolderingBreathTimer = 20000;
328  } else SmolderingBreathTimer -= diff;
329 
330  if (CharredEarthTimer <= diff)
331  {
332  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
333  DoCast(target, SPELL_CHARRED_EARTH);
334  CharredEarthTimer = 20000;
335  } else CharredEarthTimer -= diff;
336 
337  if (TailSweepTimer <= diff)
338  {
339  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
340  if (!me->HasInArc(float(M_PI), target))
341  DoCast(target, SPELL_TAIL_SWEEP);
342  TailSweepTimer = 15000;
343  } else TailSweepTimer -= diff;
344 
345  if (SearingCindersTimer <= diff)
346  {
347  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
348  DoCast(target, SPELL_SEARING_CINDERS);
349  SearingCindersTimer = 10000;
350  } else SearingCindersTimer -= diff;
351 
352  uint32 Prozent = uint32(me->GetHealthPct());
353 
354  if (Prozent < 75 && FlyCount == 0) // first take off 75%
355  TakeOff();
356 
357  if (Prozent < 50 && FlyCount == 1) // secound take off 50%
358  TakeOff();
359 
360  if (Prozent < 25 && FlyCount == 2) // third take off 25%
361  TakeOff();
362 
364  }
365 
366  //Phase 2 "FLYING FIGHT"
367  if (Phase == 2)
368  {
369  if (!RainBones)
370  {
371  if (!Skeletons)
372  {
373  for (uint8 i = 0; i <= 3; ++i)
374  {
376  Skeletons = true;
377  }
378  }
379 
380  if (RainofBonesTimer < diff && !RainBones) // only once at the beginning of phase 2
381  {
383  RainBones = true;
384  SmokingBlastTimer = 20000;
385  } else RainofBonesTimer -= diff;
386 
387  if (DistractingAshTimer <= diff)
388  {
389  if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
390  DoCast(target, SPELL_DISTRACTING_ASH);
391  DistractingAshTimer = 2000; //timer wrong
392  } else DistractingAshTimer -= diff;
393  }
394 
395  if (RainBones)
396  {
397  if (SmokingBlastTimer <= diff)
398  {
400  SmokingBlastTimer = 1500; //timer wrong
401  } else SmokingBlastTimer -= diff;
402  }
403 
404  if (FireballBarrageTimer <= diff)
405  {
406  if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0))
408  FireballBarrageTimer = 20000;
409  } else FireballBarrageTimer -= diff;
410 
411  if (FlyTimer <= diff) //landing
412  {
414 
415  me->GetMotionMaster()->Clear(false);
416  me->GetMotionMaster()->MovePoint(3, IntroWay[3][0], IntroWay[3][1], IntroWay[3][2]);
417 
418  Flying = true;
419  } else FlyTimer -= diff;
420  }
421  }
Definition: boss_nightbane.cpp:51
bool UpdateVictim()
Definition: CreatureAI.cpp:233
Definition: boss_nightbane.cpp:40
uint32 FlyTimer
Definition: boss_nightbane.cpp:128
uint32 TailSweepTimer
Definition: boss_nightbane.cpp:121
void Clear(bool reset=true)
Definition: MotionMaster.h:138
#define M_PI
Definition: Common.h:163
uint32 RainofBonesTimer
Definition: boss_nightbane.cpp:122
Definition: boss_nightbane.cpp:43
bool Flying
Definition: boss_nightbane.cpp:131
Definition: boss_nightbane.cpp:42
MotionMaster * GetMotionMaster()
Definition: Unit.h:2101
Definition: boss_nightbane.cpp:34
float IntroWay[8][3]
Definition: boss_nightbane.cpp:55
Creature *const me
Definition: CreatureAI.h:71
void MovePoint(uint32 id, Position const &pos, bool generatePath=true)
Definition: MotionMaster.h:172
uint32 BellowingRoarTimer
Definition: boss_nightbane.cpp:117
Definition: UnitAI.h:35
Unit * GetVictim() const
Definition: Unit.h:1379
Definition: boss_nightbane.cpp:39
Definition: boss_nightbane.cpp:36
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:45
Definition: Unit.h:409
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition: UnitAI.cpp:91
uint32_t uint32
Definition: Define.h:150
void DoCast(uint32 spellId)
Definition: UnitAI.cpp:101
uint32 SearingCindersTimer
Definition: boss_nightbane.cpp:125
bool HasInArc(float arcangle, Position const *pos, float border=2.0f) const
Definition: Position.cpp:129
void Talk(uint8 id, WorldObject const *whisperTarget=nullptr)
Definition: CreatureAI.cpp:42
Definition: boss_nightbane.cpp:35
uint32 FlyCount
Definition: boss_nightbane.cpp:127
uint32 SmolderingBreathTimer
Definition: boss_nightbane.cpp:120
Definition: boss_nightbane.cpp:33
bool RainBones
Definition: boss_nightbane.cpp:114
Definition: boss_nightbane.cpp:41
uint32 DistractingAshTimer
Definition: boss_nightbane.cpp:119
bool Skeletons
Definition: boss_nightbane.cpp:115
Definition: UnitAI.h:39
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:49
Definition: boss_nightbane.cpp:37
uint8_t uint8
Definition: Define.h:152
void DoStartMovement(Unit *target, float distance=0.0f, float angle=0.0f)
Definition: ScriptedCreature.cpp:134
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:159
uint32_t uint32
Definition: g3dmath.h:168
uint32 SmokingBlastTimer
Definition: boss_nightbane.cpp:123
Definition: Unit.h:1305
Phase
Definition: boss_kiljaeden.cpp:153
uint32 FireballBarrageTimer
Definition: boss_nightbane.cpp:124
uint32 CharredEarthTimer
Definition: boss_nightbane.cpp:118
float GetHealthPct() const
Definition: Unit.h:1434
void TakeOff()
Definition: boss_nightbane.cpp:245

+ Here is the call graph for this function:

Member Data Documentation

uint32 boss_nightbane::boss_nightbaneAI::BellowingRoarTimer
uint32 boss_nightbane::boss_nightbaneAI::CharredEarthTimer
uint32 boss_nightbane::boss_nightbaneAI::DistractingAshTimer
uint32 boss_nightbane::boss_nightbaneAI::FireballBarrageTimer
uint32 boss_nightbane::boss_nightbaneAI::FlyCount
bool boss_nightbane::boss_nightbaneAI::Flying
uint32 boss_nightbane::boss_nightbaneAI::FlyTimer
InstanceScript* boss_nightbane::boss_nightbaneAI::instance
bool boss_nightbane::boss_nightbaneAI::Intro
bool boss_nightbane::boss_nightbaneAI::Movement
uint32 boss_nightbane::boss_nightbaneAI::MovePhase
uint32 boss_nightbane::boss_nightbaneAI::Phase
bool boss_nightbane::boss_nightbaneAI::RainBones
uint32 boss_nightbane::boss_nightbaneAI::RainofBonesTimer
uint32 boss_nightbane::boss_nightbaneAI::SearingCindersTimer
bool boss_nightbane::boss_nightbaneAI::Skeletons
uint32 boss_nightbane::boss_nightbaneAI::SmokingBlastTimer
uint32 boss_nightbane::boss_nightbaneAI::SmolderingBreathTimer
uint32 boss_nightbane::boss_nightbaneAI::TailSweepTimer
uint32 boss_nightbane::boss_nightbaneAI::WaitTimer

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