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

Public Member Functions

 boss_nightbane (Creature *creature)
 
void Reset () override
 
void EnterEvadeMode (EvadeReason why) override
 
void JustEngagedWith (Unit *who) override
 Called for reaction when initially engaged.
 
void ScheduleGround ()
 
void ScheduleFly ()
 
void AttackStart (Unit *who) override
 
void MoveInLineOfSight (Unit *who) override
 
void MovementInform (uint32 type, uint32 id) override
 
void JustSummoned (Creature *summon) override
 
void DoCastOnFarAwayPlayers (uint32 spellid, bool triggered, float tresholddistance)
 
void TakeOff ()
 
void UpdateAI (uint32 diff) override
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
 ~BossAI () override
 
bool CanRespawn () override
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SummonedCreatureDespawnAll () override
 
void UpdateAI (uint32 diff) override
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec)
 Executes a function once the creature reaches the defined health point percent.
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec)
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void JustDied (Unit *) override
 
void JustReachedHome () 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 IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
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 OnPowerUpdate (Powers, int32, int32, uint32)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 
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
 

Private Attributes

uint32 Phase
 
TaskScheduler _skeletonscheduler
 
bool _intro
 
bool _flying
 
bool _movement
 
uint32 _movePhase
 
uint8 _skeletonCount
 
uint8 _skeletonSpawnCounter
 

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 ()
 
- Public Attributes inherited from BossAI
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
bool IsFleeing
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _JustEngagedWith ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
bool _ProccessHealthCheckEvent (uint8 healthPct, uint32 damage, std::function< void()> exec) const
 
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)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from BossAI
SummonList summons
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_nightbane()

boss_nightbane::boss_nightbane ( Creature creature)
inline
75 : BossAI(creature, DATA_NIGHTBANE)
76 {
77 _intro = true;
79 _movePhase = 0;
80 }
@ DATA_NIGHTBANE
Definition: karazhan.h:41
Definition: ScriptedCreature.h:469
uint8 _skeletonCount
Definition: boss_nightbane.cpp:365
uint32 _movePhase
Definition: boss_nightbane.cpp:364
bool _intro
Definition: boss_nightbane.cpp:360

References _intro, _movePhase, and _skeletonCount.

Member Function Documentation

◆ AttackStart()

void boss_nightbane::AttackStart ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

187 {
188 if (!_intro && !_flying)
190 }
void AttackStart(Unit *) override
Definition: ScriptedCreature.cpp:210
bool _flying
Definition: boss_nightbane.cpp:361

References _flying, _intro, and ScriptedAI::AttackStart().

◆ DoCastOnFarAwayPlayers()

void boss_nightbane::DoCastOnFarAwayPlayers ( uint32  spellid,
bool  triggered,
float  tresholddistance 
)
inline
250 {
251 //resembles DoCastToAllHostilePlayers a bit/lot
253 for (ThreatContainer::StorageType::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
254 {
255 if (Unit* unit = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()))
256 {
257 if (unit->IsPlayer() && !unit->IsWithinDist(me, tresholddistance, false))
258 {
259 me->CastSpell(unit, spellid, triggered);
260 }
261 }
262 }
263 }
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:202
Creature * me
Definition: ScriptedCreature.h:282
std::list< HostileReference * > StorageType
Definition: ThreatMgr.h:148
ThreatContainer::StorageType const & GetThreatList() const
Definition: ThreatMgr.h:274
Definition: Unit.h:1302
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1169
ThreatMgr & GetThreatMgr()
Definition: Unit.h:2159

References Unit::CastSpell(), ThreatMgr::GetThreatList(), Unit::GetThreatMgr(), ObjectAccessor::GetUnit(), and ScriptedAI::me.

Referenced by ScheduleFly().

◆ EnterEvadeMode()

void boss_nightbane::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

104 {
106 me->SetDisableGravity(true);
108 me->GetMotionMaster()->MoveTakeoff(POINT_DESPAWN, -11013.246f, -1770.5212f, 166.50139f);
109 }
@ POINT_DESPAWN
Definition: boss_nightbane.cpp:58
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:196
bool SetDisableGravity(bool disable, bool packetOnly=false, bool updateAnimationTier=true) override
Definition: Creature.cpp:3109
MotionMaster * GetMotionMaster()
Definition: Unit.h:2276
void SendMovementFlagUpdate(bool self=false)
Definition: Unit.cpp:16972
void MoveTakeoff(uint32 id, Position const &pos, float speed=0.0f)
Definition: MotionMaster.cpp:497

References CreatureAI::EnterEvadeMode(), Unit::GetMotionMaster(), ScriptedAI::me, MotionMaster::MoveTakeoff(), POINT_DESPAWN, Unit::SendMovementFlagUpdate(), and Creature::SetDisableGravity().

◆ JustEngagedWith()

void boss_nightbane::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from BossAI.

112 {
114 _intro = false;
115
118 }
@ YELL_AGGRO
Definition: boss_nightbane.cpp:44
Talk
Definition: boss_fathomlord_karathress.cpp:25
void JustEngagedWith(Unit *) override
Called for reaction when initially engaged.
Definition: ScriptedCreature.h:497
void ScheduleGround()
Definition: boss_nightbane.cpp:120

References _intro, BossAI::JustEngagedWith(), ScheduleGround(), and YELL_AGGRO.

◆ JustSummoned()

void boss_nightbane::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from BossAI.

244 {
245 summon->AI()->AttackStart(me->GetVictim());
246 summons.Summon(summon);
247 }
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:27
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:90
SummonList summons
Definition: ScriptedCreature.h:510
CreatureAI * AI() const
Definition: Creature.h:136
Unit * GetVictim() const
Definition: Unit.h:1398

References Creature::AI(), UnitAI::AttackStart(), Unit::GetVictim(), ScriptedAI::me, SummonList::Summon(), and BossAI::summons.

◆ MoveInLineOfSight()

void boss_nightbane::MoveInLineOfSight ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

193 {
194 if (!_intro && !_flying)
196 }
virtual void MoveInLineOfSight(Unit *)
Definition: CreatureAI.cpp:157

References _flying, _intro, and CreatureAI::MoveInLineOfSight().

◆ MovementInform()

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

Reimplemented from ScriptedAI.

199 {
200 if (type != POINT_MOTION_TYPE)
201 return;
202
203 if (id == POINT_DESPAWN)
204 {
206 }
207
208 if (_intro)
209 {
210 if (id >= 8)
211 {
214 return;
215 }
216
217 _movePhase = id + 1;
218 return;
219 }
220
221 if (_flying)
222 {
223 if (id == 0)
224 {
226 _flying = false;
227 Phase = 2;
228 return;
229 }
230
231 if (id < 8)
232 _movePhase = id + 1;
233 else
234 {
235 Phase = 1;
236 _flying = false;
237 _movement = true;
238 return;
239 }
240 }
241 }
@ UNIT_FLAG_NOT_SELECTABLE
Definition: Unit.h:473
@ UNIT_FLAG_IMMUNE_TO_PC
Definition: Unit.h:456
@ POINT_MOTION_TYPE
Definition: MotionMaster.h:46
@ EMOTE_BREATH
Definition: boss_nightbane.cpp:47
Phase
Definition: boss_zuljin.cpp:84
void SetInCombatWithZone()
Definition: Creature.cpp:2732
void DespawnOnEvade(Seconds respawnDelay=20s)
Definition: Creature.cpp:2125
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:1496
bool _movement
Definition: boss_nightbane.cpp:362

References _flying, _intro, _movement, _movePhase, Creature::DespawnOnEvade(), EMOTE_BREATH, ScriptedAI::me, POINT_DESPAWN, POINT_MOTION_TYPE, Unit::RemoveUnitFlag(), Creature::SetInCombatWithZone(), UNIT_FLAG_IMMUNE_TO_PC, and UNIT_FLAG_NOT_SELECTABLE.

◆ Reset()

void boss_nightbane::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

83 {
86
87 me->SetSpeed(MOVE_RUN, 2.0f);
89 me->SetWalk(false);
90 me->setActive(true);
91
92 _flying = false;
93 _movement = false;
94 _intro = true;
95 Phase = 1;
96 _movePhase = 0;
97
98 ScheduleHealthCheckEvent({ 75, 50, 25 }, [&]{
99 TakeOff();
100 });
101 }
@ MOVE_RUN
Definition: Unit.h:379
TaskScheduler & CancelAll()
Definition: TaskScheduler.cpp:45
void ScheduleHealthCheckEvent(uint32 healthPct, std::function< void()> exec)
Executes a function once the creature reaches the defined health point percent.
Definition: ScriptedCreature.cpp:724
void Reset() override
Definition: ScriptedCreature.h:496
bool SetWalk(bool enable) override
Definition: Creature.cpp:3098
void setActive(bool isActiveObject)
Definition: Object.cpp:1085
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:14414
void TakeOff()
Definition: boss_nightbane.cpp:265
TaskScheduler _skeletonscheduler
Definition: boss_nightbane.cpp:358

References _flying, _intro, _movement, _movePhase, _skeletonscheduler, TaskScheduler::CancelAll(), ScriptedAI::me, MOVE_RUN, BossAI::Reset(), BossAI::ScheduleHealthCheckEvent(), WorldObject::setActive(), Creature::SetDisableGravity(), Unit::SetSpeed(), Creature::SetWalk(), and TakeOff().

◆ ScheduleFly()

void boss_nightbane::ScheduleFly ( )
inline
152 {
154
156 {
158 _skeletonscheduler.Schedule(50ms, [this](TaskContext context)
159 {
160 //spawns skeletons every second until skeletonCount is reached
162 {
165 context.Repeat(2s);
166 }
167 });
168 }).Schedule(20s, GROUP_FLYING, [this](TaskContext context)
169 {
171 context.Repeat(2s); //timer wrong?
172 }).Schedule(25s, GROUP_FLYING, [this](TaskContext context)
173 {
174 //5 seconds added due to double trigger?
175 //trigger for timer in original + in rain of bones
176 //timers need some investigation
178 context.Repeat(1500ms); //timer wrong?
179 }).Schedule(13s, GROUP_FLYING, [this](TaskContext context)
180 {
182 context.Repeat(20s);
183 });
184 }
@ SPELL_DISTRACTING_ASH
Definition: boss_nightbane.cpp:30
@ SPELL_RAIN_OF_BONES
Definition: boss_nightbane.cpp:34
@ SPELL_FIREBALL_BARRAGE
Definition: boss_nightbane.cpp:36
@ SPELL_SMOKING_BLAST
Definition: boss_nightbane.cpp:35
@ SPELL_SUMMON_SKELETON
Definition: boss_nightbane.cpp:38
@ GROUP_FLYING
Definition: boss_nightbane.cpp:53
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition: TaskScheduler.h:232
Definition: TaskScheduler.h:418
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
Definition: TaskScheduler.h:488
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:240
SpellCastResult DoCastRandomTarget(uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
Definition: UnitAI.cpp:256
TaskScheduler scheduler
Definition: CreatureAI.h:76
uint8 _skeletonSpawnCounter
Definition: boss_nightbane.cpp:366
void DoCastOnFarAwayPlayers(uint32 spellid, bool triggered, float tresholddistance)
Definition: boss_nightbane.cpp:249

References _skeletonCount, _skeletonscheduler, _skeletonSpawnCounter, DoCastOnFarAwayPlayers(), UnitAI::DoCastRandomTarget(), UnitAI::DoCastVictim(), GROUP_FLYING, TaskContext::Repeat(), TaskScheduler::Schedule(), CreatureAI::scheduler, SPELL_DISTRACTING_ASH, SPELL_FIREBALL_BARRAGE, SPELL_RAIN_OF_BONES, SPELL_SMOKING_BLAST, and SPELL_SUMMON_SKELETON.

Referenced by TakeOff().

◆ ScheduleGround()

void boss_nightbane::ScheduleGround ( )
inline
121 {
122 scheduler.Schedule(30s, GROUP_GROUND, [this](TaskContext context)
123 {
125 context.Repeat(30s, 40s);
126 }).Schedule(15s, GROUP_GROUND, [this](TaskContext context)
127 {
128 DoCastRandomTarget(SPELL_CHARRED_EARTH, 0, 100.0f, true);
129 context.Repeat(20s);
130 }).Schedule(10s, GROUP_GROUND, [this](TaskContext context)
131 {
133 context.Repeat(20s);
134 }).Schedule(12s, GROUP_GROUND, [this](TaskContext context)
135 {
136 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
137 {
138 if (!me->HasInArc(M_PI, target))
139 {
140 DoCast(target, SPELL_TAIL_SWEEP);
141 }
142 }
143 context.Repeat(15s);
144 }).Schedule(14s, GROUP_GROUND, [this](TaskContext context)
145 {
147 context.Repeat(10s);
148 });
149 }
@ SPELL_SMOLDERING_BREATH
Definition: boss_nightbane.cpp:31
@ SPELL_CHARRED_EARTH
Definition: boss_nightbane.cpp:29
@ SPELL_BELLOWING_ROAR
Definition: boss_nightbane.cpp:28
@ SPELL_SEARING_CINDERS
Definition: boss_nightbane.cpp:37
@ SPELL_TAIL_SWEEP
Definition: boss_nightbane.cpp:32
@ GROUP_GROUND
Definition: boss_nightbane.cpp:52
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition: UnitAI.cpp:248
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
SpellCastResult DoCast(uint32 spellId)
Definition: UnitAI.cpp:177
bool HasInArc(float arcangle, const Position *pos, float targetRadius=0.0f) const
Definition: Position.cpp:140

References UnitAI::DoCast(), UnitAI::DoCastAOE(), UnitAI::DoCastRandomTarget(), UnitAI::DoCastVictim(), GROUP_GROUND, Position::HasInArc(), ScriptedAI::me, TaskContext::Repeat(), TaskScheduler::Schedule(), CreatureAI::scheduler, UnitAI::SelectTarget(), SPELL_BELLOWING_ROAR, SPELL_CHARRED_EARTH, SPELL_SEARING_CINDERS, SPELL_SMOLDERING_BREATH, and SPELL_TAIL_SWEEP.

Referenced by JustEngagedWith(), and TakeOff().

◆ TakeOff()

void boss_nightbane::TakeOff ( )
inline
266 {
269
272 me->SetDisableGravity(true);
273 me->GetMotionMaster()->Clear(false);
274 me->GetMotionMaster()->MovePoint(0, IntroWay[2][0], IntroWay[2][1], IntroWay[2][2]);
275
276 _flying = true;
277
278 ScheduleFly();
279
280 //handle landing again
281 scheduler.Schedule(45s, 60s, [this](TaskContext)
282 {
284
285 me->GetMotionMaster()->Clear(false);
286 me->GetMotionMaster()->MovePoint(3, IntroWay[3][0], IntroWay[3][1], IntroWay[3][2]);
287
288 _flying = true;
290 scheduler.Schedule(2s, [this](TaskContext)
291 {
293 });
294 });
295 }
@ CURRENT_GENERIC_SPELL
Definition: Unit.h:991
@ YELL_FLY_PHASE
Definition: boss_nightbane.cpp:45
@ YELL_LAND_PHASE
Definition: boss_nightbane.cpp:46
float IntroWay[8][3]
Definition: boss_nightbane.cpp:61
@ EMOTE_ONESHOT_LIFTOFF
Definition: SharedDefines.h:1960
TaskScheduler & CancelGroup(group_t const group)
Definition: TaskScheduler.cpp:53
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4014
void HandleEmoteCommand(uint32 emoteId)
Definition: Unit.cpp:1980
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:211
void Clear(bool reset=true)
Definition: MotionMaster.h:165
void ScheduleFly()
Definition: boss_nightbane.cpp:151

References _flying, TaskScheduler::CancelGroup(), MotionMaster::Clear(), CURRENT_GENERIC_SPELL, EMOTE_ONESHOT_LIFTOFF, Unit::GetMotionMaster(), GROUP_FLYING, GROUP_GROUND, Unit::HandleEmoteCommand(), Unit::InterruptSpell(), IntroWay, ScriptedAI::me, MotionMaster::MovePoint(), TaskScheduler::Schedule(), ScheduleFly(), ScheduleGround(), CreatureAI::scheduler, Creature::SetDisableGravity(), YELL_FLY_PHASE, and YELL_LAND_PHASE.

Referenced by Reset().

◆ UpdateAI()

void boss_nightbane::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from BossAI.

298 {
299 if (_intro)
300 {
301 if (_movePhase)
302 {
303 if (_movePhase >= 7)
304 {
305 me->SetDisableGravity(false);
307 me->GetMotionMaster()->MovePoint(8, IntroWay[7][0], IntroWay[7][1], IntroWay[7][2]);
308 }
309 else
310 {
312 }
313 _movePhase = 0;
314 }
315 return;
316 }
317
318 if (_flying && _movePhase)
319 {
320 if (_movePhase >= 7)
321 {
322 me->SetDisableGravity(false);
325 me->GetMotionMaster()->MovePoint(8, IntroWay[7][0], IntroWay[7][1], IntroWay[7][2]);
326 }
327 else
329
330 _movePhase = 0;
331 }
332
333 if (!UpdateVictim())
334 return;
335
336 if (_flying)
337 return;
338
339 scheduler.Update(diff);
341
342 // Phase 1 "GROUND FIGHT"
343 if (Phase == 1)
344 {
345 if (_movement)
346 {
348 _movement = false;
349 }
350
352 }
353 }
@ EMOTE_ONESHOT_LAND
Definition: SharedDefines.h:1964
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition: TaskScheduler.cpp:27
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
bool UpdateVictim()
Definition: CreatureAI.cpp:268
void DoStartMovement(Unit *target, float distance=0.0f, float angle=0.0f)
Definition: ScriptedCreature.cpp:227

References _flying, _intro, _movement, _movePhase, _skeletonscheduler, UnitAI::DoMeleeAttackIfReady(), ScriptedAI::DoStartMovement(), EMOTE_ONESHOT_LAND, Unit::GetMotionMaster(), Unit::GetVictim(), Unit::HandleEmoteCommand(), IntroWay, ScriptedAI::me, MotionMaster::MovePoint(), Unit::RemoveUnitFlag(), CreatureAI::scheduler, Creature::SetDisableGravity(), UNIT_FLAG_IMMUNE_TO_PC, UNIT_FLAG_NOT_SELECTABLE, TaskScheduler::Update(), and CreatureAI::UpdateVictim().

Member Data Documentation

◆ _flying

bool boss_nightbane::_flying
private

◆ _intro

bool boss_nightbane::_intro
private

◆ _movement

bool boss_nightbane::_movement
private

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

◆ _movePhase

uint32 boss_nightbane::_movePhase
private

◆ _skeletonCount

uint8 boss_nightbane::_skeletonCount
private

Referenced by boss_nightbane(), and ScheduleFly().

◆ _skeletonscheduler

TaskScheduler boss_nightbane::_skeletonscheduler
private

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

◆ _skeletonSpawnCounter

uint8 boss_nightbane::_skeletonSpawnCounter
private

Referenced by ScheduleFly().

◆ Phase

uint32 boss_nightbane::Phase
private