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

Public Member Functions

 boss_janalai (Creature *creature)
 
void Reset () override
 
void JustDied (Unit *killer) override
 
void JustSummoned (Creature *summon) override
 
void DamageDealt (Unit *target, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage to any victim (before damage apply)
 
void JustEngagedWith (Unit *who) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void SetData (uint32 index, uint32 data) override
 
bool HatchAllEggs (uint32 hatchAction)
 
void FireWall ()
 
void SpawnBombs ()
 
void Boom ()
 
void StartBombing ()
 
void ThrowBombs ()
 
bool CheckEvadeIfOutOfCombatArea () const override
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
 ~BossAI () override
 
bool CanRespawn () override
 
void OnSpellCast (SpellInfo const *spell) override
 
void OnChannelFinished (SpellInfo const *spell) override
 
void OnSpellFailed (SpellInfo const *spell) override
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SummonedCreatureDespawnAll () override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
 Executes a function once the creature reaches the defined health point percent.
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
 
void ProcessHealthCheck ()
 
void ScheduleEnrageTimer (uint32 spellId, Milliseconds timer, uint8 textId=0)
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER) override
 
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
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
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 - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
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 DoTeleportPlayer (Unit *unit, Position pos)
 
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=0ms, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, 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)
 
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
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
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 ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
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 *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- 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 SetGUID (ObjectGuid const &, 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)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal.
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates.
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals.
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations.
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT)
 
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)
 To specify the caster as target if the spell is self-cast.
 
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, bool withTank=true)
 Cast the spell on a random unit from the threat list.
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not 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)
 Called when a summon reaches a waypoint or point movement finished.
 
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

bool _isBombing
 
bool _isFlameBreathing
 
bool _sideHatched [2]
 

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
float callForHelpRange
 
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creatureme
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from BossAI
void _Reset ()
 
void _JustEngagedWith ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
void _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
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
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_janalai()

boss_janalai::boss_janalai ( Creature creature)
inline
122 : BossAI(creature, DATA_JANALAI)
123 { }
Definition ScriptedCreature.h:485
@ DATA_JANALAI
Definition zulaman.h:30

Member Function Documentation

◆ Boom()

void boss_janalai::Boom ( )
inline
298 {
299 summons.DoForAllSummons([&](WorldObject* summon) {
300 if (summon->GetEntry() == NPC_FIRE_BOMB)
301 {
302 if (Creature* bomb = summon->ToCreature())
303 {
304 bomb->AI()->DoCastSelf(SPELL_FIRE_BOMB_DAMAGE, true);
305 bomb->RemoveAllAuras();
306 }
307 }
308 });
309 }
@ NPC_FIRE_BOMB
Definition boss_janalai.cpp:72
SummonList summons
Definition ScriptedCreature.h:539
uint32 GetEntry() const
Definition Object.h:117
void DoForAllSummons(std::function< void(WorldObject *)> exec)
Definition ScriptedCreature.h:140
Definition Object.h:475

References SummonList::DoForAllSummons(), Object::GetEntry(), NPC_FIRE_BOMB, and BossAI::summons.

◆ CheckEvadeIfOutOfCombatArea()

bool boss_janalai::CheckEvadeIfOutOfCombatArea ( ) const
inlineoverridevirtual

Reimplemented from ScriptedAI.

361 {
362 return me->GetPositionZ() <= 12.0f;
363 }
float GetPositionZ() const
Definition Position.h:123
Creature * me
Definition ScriptedCreature.h:281

◆ DamageDealt()

void boss_janalai::DamageDealt ( Unit ,
uint32 ,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Called at any Damage to any victim (before damage apply)

Reimplemented from UnitAI.

172 {
174 {
175 if (!me->HasInArc(M_PI / 6, target))
176 damage = 0;
177 }
178 }
bool HasInArc(float arcangle, const Position *pos, float targetRadius=0.0f) const
Definition Position.cpp:148
bool _isFlameBreathing
Definition boss_janalai.cpp:366

References _isFlameBreathing, Position::HasInArc(), and ScriptedAI::me.

◆ FireWall()

void boss_janalai::FireWall ( )
inline
269 {
270 for (uint8 i = 0; i < 4; ++i)
271 {
272 uint8 wallNum = i == 0 || i == 2 ? 3 : 2;
273
274 for (uint8 j = 0; j < wallNum; j++)
275 {
276 Creature* wall = wallNum == 3
277 ? me->SummonCreature(NPC_FIRE_BOMB, fireWallCoords[i].GetPositionX(), fireWallCoords[i].GetPositionY() + 5 * (j - 1), fireWallCoords[i].GetPositionZ(), fireWallCoords[i].GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 15000)
278 : me->SummonCreature(NPC_FIRE_BOMB, fireWallCoords[i].GetPositionX() - 2 + 4 * j, fireWallCoords[i].GetPositionY(), fireWallCoords[i].GetPositionZ(), fireWallCoords[i].GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 15000);
279
280 if (wall)
281 wall->AI()->DoCastSelf(SPELL_FIRE_WALL, true);
282 }
283 }
284 }
std::uint8_t uint8
Definition Define.h:109
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:51
@ SPELL_FIRE_WALL
Definition boss_janalai.cpp:45
const Position fireWallCoords[4]
Definition boss_janalai.cpp:80
Definition Creature.h:47
CreatureAI * AI() const
Definition Creature.h:143
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:394
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2394

References Creature::AI(), UnitAI::DoCastSelf(), fireWallCoords, ScriptedAI::me, NPC_FIRE_BOMB, SPELL_FIRE_WALL, WorldObject::SummonCreature(), and TEMPSUMMON_TIMED_DESPAWN.

◆ HatchAllEggs()

bool boss_janalai::HatchAllEggs ( uint32  hatchAction)
inline
248 {
249 std::list<Creature* > eggList;
250 me->GetCreaturesWithEntryInRange(eggList, 100.0f, NPC_EGG);
251 if (eggList.empty())
252 return false;
253
254 if (hatchAction == HATCH_RESET)
255 {
256 for (Creature* egg : eggList)
257 egg->Respawn();
258
260 }
261 else if (hatchAction == HATCH_ALL)
263
264 eggList.clear();
265 return true;
266 }
@ HATCH_ALL
Definition boss_janalai.cpp:109
@ HATCH_RESET
Definition boss_janalai.cpp:108
@ NPC_EGG
Definition boss_janalai.cpp:71
@ SPELL_HATCH_EGG_ALL
Definition boss_janalai.cpp:60
void DespawnEntry(uint32 entry)
Definition ScriptedCreature.cpp:55
void GetCreaturesWithEntryInRange(std::list< Creature * > &creatureList, float radius, uint32 entry)
Definition Object.cpp:3061
@ NPC_AMANI_HATCHLING
Definition zulaman.h:62

References SummonList::DespawnEntry(), UnitAI::DoCastSelf(), WorldObject::GetCreaturesWithEntryInRange(), HATCH_ALL, HATCH_RESET, ScriptedAI::me, NPC_AMANI_HATCHLING, NPC_EGG, SPELL_HATCH_EGG_ALL, and BossAI::summons.

Referenced by Reset().

◆ JustDied()

void boss_janalai::JustDied ( Unit killer)
inlineoverridevirtual

Reimplemented from CreatureAI.

153 {
155 BossAI::JustDied(killer);
156 }
@ SAY_DEATH
Definition boss_janalai.cpp:36
void JustDied(Unit *) override
Definition ScriptedCreature.h:527
Talk
Definition hyjal.cpp:82

References BossAI::JustDied(), and SAY_DEATH.

◆ JustEngagedWith()

void boss_janalai::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged - this happens after JustEnteredCombat.

Reimplemented from CreatureAI.

181 {
184 //schedule abilities
185 ScheduleTimedEvent(30s, [&]{
186 StartBombing();
187 }, 20s, 40s);
188
189 scheduler.Schedule(10s, GROUP_HATCHING, [this](TaskContext context)
190 {
191 if (_sideHatched[0] && _sideHatched[1])
192 return;
193
195
196 if (_sideHatched[0] && !_sideHatched[1])
197 {
200 }
201 else if (!_sideHatched[0] && _sideHatched[1])
202 {
205 }
206 else
207 {
210 }
211
212 context.Repeat(90s);
213 });
214
215 ScheduleTimedEvent(8s, [&]{
217 {
218 me->AttackStop();
219 me->GetMotionMaster()->Clear();
220 DoCast(target, SPELL_FLAME_BREATH);
221 me->StopMoving();
222 _isFlameBreathing = true;
223 // placeholder time idk yet
224 scheduler.Schedule(2s, [this](TaskContext)
225 {
226 _isFlameBreathing = false;
227 });
228 }
229 }, 8s);
230
233 }, 5min, 5min, GROUP_ENRAGE);
234
238 }, 10min);
239 }
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:54
@ NPC_AMANI_HATCHER
Definition boss_janalai.cpp:70
@ GROUP_ENRAGE
Definition boss_janalai.cpp:115
@ GROUP_HATCHING
Definition boss_janalai.cpp:116
@ SAY_AGGRO
Definition boss_janalai.cpp:30
@ SAY_SUMMON_HATCHER
Definition boss_janalai.cpp:32
@ SAY_BERSERK
Definition boss_janalai.cpp:34
@ SPELL_ENRAGE
Definition boss_janalai.cpp:46
@ SPELL_FLAME_BREATH
Definition boss_janalai.cpp:44
@ SPELL_BERSERK
Definition boss_janalai.cpp:51
const Position hatcherway[2][5]
Definition boss_janalai.cpp:88
void JustEngagedWith(Unit *) override
Called for reaction when initially engaged - this happens after JustEnteredCombat.
Definition ScriptedCreature.h:525
TaskScheduler scheduler
Definition CreatureAI.h:74
void AddEventAtOffset(BasicEvent *event, Milliseconds offset, uint8 eventGroup=0)
Definition EventProcessor.h:108
Definition TaskScheduler.h:421
TaskContext & Repeat(std::chrono::duration< _Rep, _Period > const &duration)
Definition TaskScheduler.h:493
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition TaskScheduler.h:232
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
Definition Unit.h:664
MotionMaster * GetMotionMaster()
Definition Unit.h:1758
void StopMoving()
Definition Unit.cpp:12997
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition Unit.cpp:7436
EventProcessor m_Events
Definition Object.h:736
void ScheduleTimedEvent(Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
Definition ScriptedCreature.cpp:349
void StartBombing()
Definition boss_janalai.cpp:311
bool _sideHatched[2]
Definition boss_janalai.cpp:367

References _isFlameBreathing, _sideHatched, EventProcessor::AddEventAtOffset(), Unit::AttackStop(), UnitAI::DoCast(), UnitAI::DoCastSelf(), Unit::GetMotionMaster(), GROUP_ENRAGE, GROUP_HATCHING, hatcherway, BossAI::JustEngagedWith(), WorldObject::m_Events, ScriptedAI::me, NPC_AMANI_HATCHER, Random, TaskContext::Repeat(), SAY_AGGRO, SAY_BERSERK, SAY_SUMMON_HATCHER, TaskScheduler::Schedule(), CreatureAI::scheduler, ScriptedAI::ScheduleTimedEvent(), UnitAI::SelectTarget(), SPELL_BERSERK, SPELL_ENRAGE, SPELL_FLAME_BREATH, StartBombing(), Unit::StopMoving(), WorldObject::SummonCreature(), and TEMPSUMMON_CORPSE_TIMED_DESPAWN.

◆ JustSummoned()

void boss_janalai::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

159 {
160 if (summon->GetEntry() == NPC_AMANI_HATCHLING)
161 {
162 if (summon->GetPositionY() > 1150)
163 summon->GetMotionMaster()->MovePoint(0, hatcherway[0][3].GetPositionX() + rand() % 4 - 2, 1150.0f + rand() % 4 - 2, hatcherway[0][3].GetPositionY());
164 else
165 summon->GetMotionMaster()->MovePoint(0, hatcherway[1][3].GetPositionX() + rand() % 4 - 2, 1150.0f + rand() % 4 - 2, hatcherway[1][3].GetPositionY());
166 }
167
168 BossAI::JustSummoned(summon);
169 }
void JustSummoned(Creature *summon) override
Definition ScriptedCreature.cpp:725
void MovePoint(uint32 id, const Position &pos, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE, float speed=0.f, bool generatePath=true, bool forceDestination=true, std::optional< AnimTier > animTier=std::nullopt)
Definition MotionMaster.h:240
float GetPositionY() const
Definition Position.h:122

References Object::GetEntry(), Unit::GetMotionMaster(), Position::GetPositionY(), hatcherway, BossAI::JustSummoned(), MotionMaster::MovePoint(), and NPC_AMANI_HATCHLING.

◆ Reset()

void boss_janalai::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

126 {
129 _isBombing = false;
130 _isFlameBreathing = false;
131
134 me->AttackStop();
139 });
140
142 if (!me->HasAura(SPELL_ENRAGE))
145 });
146
147 me->m_Events.KillAllEvents(false);
148 _sideHatched[0] = false;
149 _sideHatched[1] = false;
150 }
const Position janalainPos
Definition boss_janalai.cpp:78
@ SAY_ALL_EGGS
Definition boss_janalai.cpp:33
@ SPELL_HATCH_ALL
Definition boss_janalai.cpp:50
void ScheduleHealthCheckEvent(uint32 healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
Executes a function once the creature reaches the defined health point percent.
Definition ScriptedCreature.cpp:831
void Reset() override
Definition ScriptedCreature.h:524
void SetPosition(float x, float y, float z, float o)
Definition Creature.cpp:3197
void KillAllEvents(bool force)
Definition EventProcessor.cpp:82
void CancelEventGroup(uint8 group)
Definition EventProcessor.cpp:114
void Clear(bool reset=true)
Definition MotionMaster.h:193
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:285
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5982
void StopMovingOnCurrentPos()
Definition Unit.cpp:13036
bool HatchAllEggs(uint32 hatchAction)
Definition boss_janalai.cpp:247
bool _isBombing
Definition boss_janalai.cpp:365

References _isBombing, _isFlameBreathing, _sideHatched, Unit::AttackStop(), EventProcessor::CancelEventGroup(), MotionMaster::Clear(), UnitAI::DoCastAOE(), UnitAI::DoCastSelf(), Unit::GetMotionMaster(), GROUP_ENRAGE, Unit::HasAura(), HATCH_RESET, HatchAllEggs(), janalainPos, EventProcessor::KillAllEvents(), WorldObject::m_Events, ScriptedAI::me, BossAI::Reset(), SAY_ALL_EGGS, BossAI::ScheduleHealthCheckEvent(), Creature::SetPosition(), SPELL_ENRAGE, SPELL_HATCH_ALL, and Unit::StopMovingOnCurrentPos().

◆ SetData()

void boss_janalai::SetData ( uint32  index,
uint32  data 
)
inlineoverridevirtual

Reimplemented from UnitAI.

242 {
243 if (index == DATA_ALL_EGGS_HATCHED)
244 _sideHatched[data] = true;
245 }
@ DATA_ALL_EGGS_HATCHED
Definition boss_janalai.cpp:117

References _sideHatched, and DATA_ALL_EGGS_HATCHED.

◆ SpawnBombs()

void boss_janalai::SpawnBombs ( )
inline
287 {
288 float dx, dy;
289 for (int i = 0; i < MAX_BOMB_COUNT; ++i)
290 {
291 dx = float(irand(-area_dx / 2, area_dx / 2));
292 dy = float(irand(-area_dy / 2, area_dy / 2));
294 }
295 }
int32 irand(int32 min, int32 max)
Definition Random.cpp:37
const int area_dx
Definition boss_janalai.cpp:75
@ MAX_BOMB_COUNT
Definition boss_janalai.cpp:114
const int area_dy
Definition boss_janalai.cpp:76
Creature * DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
Definition ScriptedCreature.cpp:344

References area_dx, area_dy, ScriptedAI::DoSpawnCreature(), irand(), MAX_BOMB_COUNT, NPC_FIRE_BOMB, and TEMPSUMMON_TIMED_DESPAWN.

◆ StartBombing()

void boss_janalai::StartBombing ( )
inline
312 {
314 me->AttackStop();
319
320 FireWall();
321 SpawnBombs();
322 _isBombing = true;
323
326
327 //DoCast(Temp, SPELL_SUMMON_PLAYERS, true) // core bug, spell does not work if too far
328 ThrowBombs();
329
330 scheduler.Schedule(11s, [this](TaskContext)
331 {
332 Boom();
333 _isBombing = false;
334
336 });
337 }
@ SAY_FIRE_BOMBS
Definition boss_janalai.cpp:31
@ SPELL_FIRE_BOMB_CHANNEL
Definition boss_janalai.cpp:54
@ SPELL_TELE_TO_CENTER
Definition boss_janalai.cpp:49
@ SPELL_SUMMON_PLAYERS_DUMMY
Definition boss_janalai.cpp:47
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:5157
void Boom()
Definition boss_janalai.cpp:297
void ThrowBombs()
Definition boss_janalai.cpp:339
void SpawnBombs()
Definition boss_janalai.cpp:286
void FireWall()
Definition boss_janalai.cpp:268

References janalainPos, SAY_FIRE_BOMBS, SPELL_FIRE_BOMB_CHANNEL, SPELL_SUMMON_PLAYERS_DUMMY, and SPELL_TELE_TO_CENTER.

Referenced by JustEngagedWith().

◆ ThrowBombs()

void boss_janalai::ThrowBombs ( )
inline
340 {
341 std::chrono::milliseconds bombTimer = 100ms;
342
343 summons.DoForAllSummons([this, &bombTimer](WorldObject* summon) {
344 if (summon->GetEntry() == NPC_FIRE_BOMB)
345 {
346 if (Creature* bomb = summon->ToCreature())
347 {
348 bomb->m_Events.AddEventAtOffset([this, bomb] {
349 bomb->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
350 DoCast(bomb, SPELL_FIRE_BOMB_THROW, true);
351 bomb->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
352 }, bombTimer);
353 }
354
355 bombTimer += 100ms;
356 }
357 });
358 }

References Object::GetEntry(), NPC_FIRE_BOMB, and summons.

Member Data Documentation

◆ _isBombing

bool boss_janalai::_isBombing
private

Referenced by Reset().

◆ _isFlameBreathing

bool boss_janalai::_isFlameBreathing
private

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

◆ _sideHatched

bool boss_janalai::_sideHatched[2]
private

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


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