AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
boss_nightbane::boss_nightbaneAI Struct Reference
Inheritance diagram for boss_nightbane::boss_nightbaneAI:
ScriptedAI CreatureAI UnitAI

Public Member Functions

 boss_nightbaneAI (Creature *creature)
 
void Reset () override
 
void HandleTerraceDoors (bool open)
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
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)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 
void UpdateAI (uint32 diff) override
 
void JustDied (Unit *) override
 
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 MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (const Position *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
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 DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
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 const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, 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
 
virtual bool CheckEvadeIfOutOfCombatArea () 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
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged.
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 
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 (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat (NOTE: Creature engage logic should NOT be here, but in JustEngagedWith, which happens once threat is established!)
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void HealDone (Unit *, uint32 &)
 
void AttackStartCaster (Unit *victim, float dist)
 
SpellCastResult DoAddAuraToAllHostilePlayers (uint32 spellid)
 
SpellCastResult DoCast (uint32 spellId)
 
SpellCastResult DoCast (Unit *victim, uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastSelf (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastToAllHostilePlayers (uint32 spellid, bool triggered=false)
 
SpellCastResult DoCastVictim (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastAOE (uint32 spellId, bool triggered=false)
 
SpellCastResult DoCastRandomTarget (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the max threat target, which may not always be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 
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 sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

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 MovePhase
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
bool IsFleeing
 

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
  AXIS_Y
}
 
- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES ,
  EVADE_REASON_BOUNDARY ,
  EVADE_REASON_SEQUENCE_BREAK ,
  EVADE_REASON_NO_PATH ,
  EVADE_REASON_OTHER
}
 
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- 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)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_nightbaneAI()

boss_nightbane::boss_nightbaneAI::boss_nightbaneAI ( Creature creature)
inline
79 : ScriptedAI(creature)
80 {
81 instance = creature->GetInstanceScript();
82 Intro = true;
83 }
Definition: ScriptedCreature.h:192
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
bool Intro
Definition: boss_nightbane.cpp:105
InstanceScript * instance
Definition: boss_nightbane.cpp:85

References WorldObject::GetInstanceScript(), instance, and Intro.

Member Function Documentation

◆ AttackStart()

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

Reimplemented from ScriptedAI.

171 {
172 if (!Intro && !Flying)
174 }
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:206
bool Flying
Definition: boss_nightbane.cpp:106

References ScriptedAI::AttackStart(), Flying, and Intro.

◆ HandleTerraceDoors()

void boss_nightbane::boss_nightbaneAI::HandleTerraceDoors ( bool  open)
inline
153 {
154 if (instance)
155 {
158 }
159 }
@ DATA_MASTERS_TERRACE_DOOR_1
Definition: karazhan.h:58
@ DATA_MASTERS_TERRACE_DOOR_2
Definition: karazhan.h:59
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
Definition: InstanceScript.cpp:109
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:94

References DATA_MASTERS_TERRACE_DOOR_1, DATA_MASTERS_TERRACE_DOOR_2, InstanceScript::GetGuidData(), InstanceScript::HandleGameObject(), and instance.

Referenced by JustDied(), JustEngagedWith(), and Reset().

◆ JustDied()

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

Reimplemented from ScriptedAI.

177 {
178 if (instance)
180
181 HandleTerraceDoors(true);
182 }
@ DONE
Definition: InstanceScript.h:59
@ DATA_NIGHTBANE
Definition: karazhan.h:41
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53
void HandleTerraceDoors(bool open)
Definition: boss_nightbane.cpp:152

References DATA_NIGHTBANE, DONE, HandleTerraceDoors(), instance, and ZoneScript::SetData().

◆ JustEngagedWith()

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

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

162 {
163 if (instance)
165
166 HandleTerraceDoors(false);
168 }
@ IN_PROGRESS
Definition: InstanceScript.h:57
@ YELL_AGGRO
Definition: boss_nightbane.cpp:49
Talk
Definition: boss_fathomlord_karathress.cpp:23

References DATA_NIGHTBANE, HandleTerraceDoors(), IN_PROGRESS, instance, ZoneScript::SetData(), and YELL_AGGRO.

◆ JustSummoned()

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

Reimplemented from ScriptedAI.

231 {
232 summoned->AI()->AttackStart(me->GetVictim());
233 }
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:28
Creature * me
Definition: ScriptedCreature.h:282
CreatureAI * AI() const
Definition: Creature.h:135
Unit * GetVictim() const
Definition: Unit.h:1386

References Creature::AI(), UnitAI::AttackStart(), Unit::GetVictim(), and ScriptedAI::me.

◆ MoveInLineOfSight()

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

Reimplemented from CreatureAI.

185 {
186 if (!Intro && !Flying)
188 }
virtual void MoveInLineOfSight(Unit *)
Definition: CreatureAI.cpp:158

References Flying, Intro, and CreatureAI::MoveInLineOfSight().

◆ MovementInform()

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

Reimplemented from ScriptedAI.

191 {
192 if (type != POINT_MOTION_TYPE)
193 return;
194
195 if (Intro)
196 {
197 if (id >= 8)
198 {
199 Intro = false;
200 me->SetHomePosition(IntroWay[7][0], IntroWay[7][1], IntroWay[7][2], 0);
201 return;
202 }
203
204 MovePhase = id + 1;
205 return;
206 }
207
208 if (Flying)
209 {
210 if (id == 0)
211 {
213 Flying = false;
214 Phase = 2;
215 return;
216 }
217
218 if (id < 8)
219 MovePhase = id + 1;
220 else
221 {
222 Phase = 1;
223 Flying = false;
224 Movement = true;
225 return;
226 }
227 }
228 }
@ POINT_MOTION_TYPE
Definition: MotionMaster.h:46
@ EMOTE_BREATH
Definition: boss_nightbane.cpp:52
float IntroWay[8][3]
Definition: boss_nightbane.cpp:55
Phase
Definition: boss_zuljin.cpp:84
Definition: Unit.h:688
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:328
uint32 MovePhase
Definition: boss_nightbane.cpp:109

References EMOTE_BREATH, Flying, Intro, IntroWay, ScriptedAI::me, MovePhase, POINT_MOTION_TYPE, and Creature::SetHomePosition().

◆ Reset()

void boss_nightbane::boss_nightbaneAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

112 {
113 BellowingRoarTimer = 30000;
114 CharredEarthTimer = 15000;
115 DistractingAshTimer = 20000;
116 SmolderingBreathTimer = 10000;
117 TailSweepTimer = 12000;
118 RainofBonesTimer = 10000;
119 SmokingBlastTimer = 20000;
120 FireballBarrageTimer = 13000;
121 SearingCindersTimer = 14000;
122
123 Phase = 1;
124 FlyCount = 0;
125 MovePhase = 0;
126
127 me->SetSpeed(MOVE_RUN, 2.0f);
129 me->SetWalk(false);
130 me->setActive(true);
131
132 if (instance)
133 {
136 else
138 }
139
140 HandleTerraceDoors(true);
141
142 Flying = false;
143 Movement = false;
144
145 if (!Intro)
146 {
147 me->SetHomePosition(IntroWay[7][0], IntroWay[7][1], IntroWay[7][2], 0);
149 }
150 }
@ MOVE_RUN
Definition: Unit.h:379
@ NOT_STARTED
Definition: InstanceScript.h:56
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Definition: Creature.cpp:3092
bool SetWalk(bool enable) override
Definition: Creature.cpp:3081
void DisappearAndDie()
Definition: Creature.cpp:317
void setActive(bool isActiveObject)
Definition: Object.cpp:1085
MotionMaster * GetMotionMaster()
Definition: Unit.h:2262
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:14323
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:52
void MoveTargetedHome(bool walk=false)
Definition: MotionMaster.cpp:251
uint32 SmolderingBreathTimer
Definition: boss_nightbane.cpp:95
uint32 BellowingRoarTimer
Definition: boss_nightbane.cpp:92
uint32 SmokingBlastTimer
Definition: boss_nightbane.cpp:98
uint32 SearingCindersTimer
Definition: boss_nightbane.cpp:100
uint32 DistractingAshTimer
Definition: boss_nightbane.cpp:94
uint32 RainofBonesTimer
Definition: boss_nightbane.cpp:97
uint32 TailSweepTimer
Definition: boss_nightbane.cpp:96
uint32 FireballBarrageTimer
Definition: boss_nightbane.cpp:99
uint32 CharredEarthTimer
Definition: boss_nightbane.cpp:93
uint32 FlyCount
Definition: boss_nightbane.cpp:102

References BellowingRoarTimer, CharredEarthTimer, DATA_NIGHTBANE, Creature::DisappearAndDie(), DistractingAshTimer, DONE, FireballBarrageTimer, FlyCount, Flying, ZoneScript::GetData(), Unit::GetMotionMaster(), HandleTerraceDoors(), instance, Intro, IntroWay, ScriptedAI::me, MOVE_RUN, MovePhase, MotionMaster::MoveTargetedHome(), NOT_STARTED, RainofBonesTimer, SearingCindersTimer, WorldObject::setActive(), ZoneScript::SetData(), Creature::SetDisableGravity(), Creature::SetHomePosition(), Unit::SetSpeed(), Creature::SetWalk(), SmokingBlastTimer, SmolderingBreathTimer, and TailSweepTimer.

◆ TakeOff()

void boss_nightbane::boss_nightbaneAI::TakeOff ( )
inline
236 {
238
241 me->SetDisableGravity(true);
242 me->GetMotionMaster()->Clear(false);
243 me->GetMotionMaster()->MovePoint(0, IntroWay[2][0], IntroWay[2][1], IntroWay[2][2]);
244
245 Flying = true;
246
247 FlyTimer = urand(45000, 60000); //timer wrong between 45 and 60 seconds
248 ++FlyCount;
249
250 RainofBonesTimer = 5000; //timer wrong (maybe)
251 RainBones = false;
252 Skeletons = false;
253 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ CURRENT_GENERIC_SPELL
Definition: Unit.h:979
@ YELL_FLY_PHASE
Definition: boss_nightbane.cpp:50
@ EMOTE_ONESHOT_LIFTOFF
Definition: SharedDefines.h:1932
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4002
void HandleEmoteCommand(uint32 emoteId)
Definition: Unit.cpp:1970
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:210
void Clear(bool reset=true)
Definition: MotionMaster.h:165
uint32 FlyTimer
Definition: boss_nightbane.cpp:103
bool RainBones
Definition: boss_nightbane.cpp:89
bool Skeletons
Definition: boss_nightbane.cpp:90

References MotionMaster::Clear(), CURRENT_GENERIC_SPELL, EMOTE_ONESHOT_LIFTOFF, FlyCount, Flying, FlyTimer, Unit::GetMotionMaster(), Unit::HandleEmoteCommand(), Unit::InterruptSpell(), IntroWay, ScriptedAI::me, MotionMaster::MovePoint(), RainBones, RainofBonesTimer, Creature::SetDisableGravity(), Skeletons, urand(), and YELL_FLY_PHASE.

Referenced by UpdateAI().

◆ UpdateAI()

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

Reimplemented from ScriptedAI.

256 {
257 if (Intro)
258 {
259 if (MovePhase)
260 {
261 if (MovePhase >= 7)
262 {
263 me->SetDisableGravity(false);
265 me->GetMotionMaster()->MovePoint(8, IntroWay[7][0], IntroWay[7][1], IntroWay[7][2]);
266 }
267 else
268 {
270 }
271 MovePhase = 0;
272 }
273 return;
274 }
275
276 if (Flying && MovePhase)
277 {
278 if (MovePhase >= 7)
279 {
280 me->SetDisableGravity(false);
282 me->GetMotionMaster()->MovePoint(8, IntroWay[7][0], IntroWay[7][1], IntroWay[7][2]);
283 }
284 else
286
287 MovePhase = 0;
288 }
289
290 if (!UpdateVictim())
291 return;
292
293 if (Flying)
294 return;
295
296 // Phase 1 "GROUND FIGHT"
297 if (Phase == 1)
298 {
299 if (Movement)
300 {
302 Movement = false;
303 }
304
305 if (BellowingRoarTimer <= diff)
306 {
308 BellowingRoarTimer = urand(30000, 40000);
309 }
310 else
311 BellowingRoarTimer -= diff;
312
313 if (SmolderingBreathTimer <= diff)
314 {
316 SmolderingBreathTimer = 20000;
317 }
318 else
319 SmolderingBreathTimer -= diff;
320
321 if (CharredEarthTimer <= diff)
322 {
323 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
325 CharredEarthTimer = 20000;
326 }
327 else
328 CharredEarthTimer -= diff;
329
330 if (TailSweepTimer <= diff)
331 {
332 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
333 if (!me->HasInArc(M_PI, target))
334 DoCast(target, SPELL_TAIL_SWEEP);
335 TailSweepTimer = 15000;
336 }
337 else
338 TailSweepTimer -= diff;
339
340 if (SearingCindersTimer <= diff)
341 {
342 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
344 SearingCindersTimer = 10000;
345 }
346 else
347 SearingCindersTimer -= diff;
348
349 uint32 Prozent = uint32(me->GetHealthPct());
350
351 if (Prozent < 75 && FlyCount == 0) // first take off 75%
352 TakeOff();
353
354 if (Prozent < 50 && FlyCount == 1) // secound take off 50%
355 TakeOff();
356
357 if (Prozent < 25 && FlyCount == 2) // third take off 25%
358 TakeOff();
359
361 }
362
363 //Phase 2 "FLYING FIGHT"
364 if (Phase == 2)
365 {
366 if (!RainBones)
367 {
368 if (!Skeletons)
369 {
370 for (uint8 i = 0; i <= 3; ++i)
371 {
373 Skeletons = true;
374 }
375 }
376
377 if (RainofBonesTimer < diff && !RainBones) // only once at the beginning of phase 2
378 {
380 RainBones = true;
381 SmokingBlastTimer = 20000;
382 }
383 else
384 RainofBonesTimer -= diff;
385
386 if (DistractingAshTimer <= diff)
387 {
388 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
390 DistractingAshTimer = 2000; //timer wrong
391 }
392 else
393 DistractingAshTimer -= diff;
394 }
395
396 if (RainBones)
397 {
398 if (SmokingBlastTimer <= diff)
399 {
401 SmokingBlastTimer = 1500; //timer wrong
402 }
403 else
404 SmokingBlastTimer -= diff;
405 }
406
407 if (FireballBarrageTimer <= diff)
408 {
409 if (Unit* target = SelectTarget(SelectTargetMethod::MinDistance, 0))
411 FireballBarrageTimer = 20000;
412 }
413 else
414 FireballBarrageTimer -= diff;
415
416 if (FlyTimer <= diff) //landing
417 {
419
420 me->GetMotionMaster()->Clear(false);
421 me->GetMotionMaster()->MovePoint(3, IntroWay[3][0], IntroWay[3][1], IntroWay[3][2]);
422
423 Flying = true;
424 }
425 else
426 FlyTimer -= diff;
427 }
428 }
std::uint8_t uint8
Definition: Define.h:110
std::uint32_t uint32
Definition: Define.h:108
@ YELL_LAND_PHASE
Definition: boss_nightbane.cpp:51
@ SPELL_SMOLDERING_BREATH
Definition: boss_nightbane.cpp:36
@ SPELL_CHARRED_EARTH
Definition: boss_nightbane.cpp:34
@ SPELL_DISTRACTING_ASH
Definition: boss_nightbane.cpp:35
@ SPELL_BELLOWING_ROAR
Definition: boss_nightbane.cpp:33
@ SPELL_RAIN_OF_BONES
Definition: boss_nightbane.cpp:39
@ SPELL_FIREBALL_BARRAGE
Definition: boss_nightbane.cpp:41
@ SPELL_SEARING_CINDERS
Definition: boss_nightbane.cpp:42
@ SPELL_SMOKING_BLAST
Definition: boss_nightbane.cpp:40
@ SPELL_TAIL_SWEEP
Definition: boss_nightbane.cpp:37
@ SPELL_SUMMON_SKELETON
Definition: boss_nightbane.cpp:43
@ EMOTE_ONESHOT_LAND
Definition: SharedDefines.h:1936
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:40
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:241
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:111
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:178
bool UpdateVictim()
Definition: CreatureAI.cpp:269
void DoStartMovement(Unit *target, float distance=0.0f, float angle=0.0f)
Definition: ScriptedCreature.cpp:223
bool HasInArc(float arcangle, const Position *pos, float targetRadius=0.0f) const
Definition: Position.cpp:140
Definition: Unit.h:1290
float GetHealthPct() const
Definition: Unit.h:1448
void TakeOff()
Definition: boss_nightbane.cpp:235

References BellowingRoarTimer, CharredEarthTimer, MotionMaster::Clear(), DistractingAshTimer, UnitAI::DoCast(), UnitAI::DoCastVictim(), UnitAI::DoMeleeAttackIfReady(), ScriptedAI::DoStartMovement(), EMOTE_ONESHOT_LAND, FireballBarrageTimer, FlyCount, Flying, FlyTimer, Unit::GetHealthPct(), Unit::GetMotionMaster(), Unit::GetVictim(), Unit::HandleEmoteCommand(), Position::HasInArc(), Intro, IntroWay, ScriptedAI::me, MovePhase, MotionMaster::MovePoint(), RainBones, RainofBonesTimer, SearingCindersTimer, UnitAI::SelectTarget(), Creature::SetDisableGravity(), Skeletons, SmokingBlastTimer, SmolderingBreathTimer, SPELL_BELLOWING_ROAR, SPELL_CHARRED_EARTH, SPELL_DISTRACTING_ASH, SPELL_FIREBALL_BARRAGE, SPELL_RAIN_OF_BONES, SPELL_SEARING_CINDERS, SPELL_SMOKING_BLAST, SPELL_SMOLDERING_BREATH, SPELL_SUMMON_SKELETON, SPELL_TAIL_SWEEP, TailSweepTimer, TakeOff(), CreatureAI::UpdateVictim(), urand(), and YELL_LAND_PHASE.

Member Data Documentation

◆ BellowingRoarTimer

uint32 boss_nightbane::boss_nightbaneAI::BellowingRoarTimer

Referenced by Reset(), and UpdateAI().

◆ CharredEarthTimer

uint32 boss_nightbane::boss_nightbaneAI::CharredEarthTimer

Referenced by Reset(), and UpdateAI().

◆ DistractingAshTimer

uint32 boss_nightbane::boss_nightbaneAI::DistractingAshTimer

Referenced by Reset(), and UpdateAI().

◆ FireballBarrageTimer

uint32 boss_nightbane::boss_nightbaneAI::FireballBarrageTimer

Referenced by Reset(), and UpdateAI().

◆ FlyCount

uint32 boss_nightbane::boss_nightbaneAI::FlyCount

Referenced by Reset(), TakeOff(), and UpdateAI().

◆ Flying

bool boss_nightbane::boss_nightbaneAI::Flying

◆ FlyTimer

uint32 boss_nightbane::boss_nightbaneAI::FlyTimer

Referenced by TakeOff(), and UpdateAI().

◆ instance

InstanceScript* boss_nightbane::boss_nightbaneAI::instance

◆ Intro

bool boss_nightbane::boss_nightbaneAI::Intro

◆ Movement

bool boss_nightbane::boss_nightbaneAI::Movement

◆ MovePhase

uint32 boss_nightbane::boss_nightbaneAI::MovePhase

Referenced by MovementInform(), Reset(), and UpdateAI().

◆ Phase

uint32 boss_nightbane::boss_nightbaneAI::Phase

◆ RainBones

bool boss_nightbane::boss_nightbaneAI::RainBones

Referenced by TakeOff(), and UpdateAI().

◆ RainofBonesTimer

uint32 boss_nightbane::boss_nightbaneAI::RainofBonesTimer

Referenced by Reset(), TakeOff(), and UpdateAI().

◆ SearingCindersTimer

uint32 boss_nightbane::boss_nightbaneAI::SearingCindersTimer

Referenced by Reset(), and UpdateAI().

◆ Skeletons

bool boss_nightbane::boss_nightbaneAI::Skeletons

Referenced by TakeOff(), and UpdateAI().

◆ SmokingBlastTimer

uint32 boss_nightbane::boss_nightbaneAI::SmokingBlastTimer

Referenced by Reset(), and UpdateAI().

◆ SmolderingBreathTimer

uint32 boss_nightbane::boss_nightbaneAI::SmolderingBreathTimer

Referenced by Reset(), and UpdateAI().

◆ TailSweepTimer

uint32 boss_nightbane::boss_nightbaneAI::TailSweepTimer

Referenced by Reset(), and UpdateAI().