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

Public Member Functions

 boss_alarAI (Creature *creature)
 
void JustReachedHome () override
 
void Reset () override
 
void JustEngagedWith (Unit *who) override
 Called for reaction when initially engaged.
 
void JustDied (Unit *killer) override
 
void JustSummoned (Creature *summon) override
 
void MoveInLineOfSight (Unit *) override
 
void DamageTaken (Unit *, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 
void MovementInform (uint32 type, uint32 id) override
 
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
 

Public Attributes

uint8 platform
 
uint8 noQuillTimes
 
bool startPath
 
- Public Attributes inherited from BossAI
InstanceScript *const instance
 
- 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 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_alarAI()

boss_alar::boss_alarAI::boss_alarAI ( Creature creature)
inline
95 : BossAI(creature, DATA_ALAR)
96 {
97 startPath = true;
98 SetCombatMovement(false);
99 }
@ DATA_ALAR
Definition: the_eye.h:33
void SetCombatMovement(bool allowMovement)
Definition: ScriptedCreature.cpp:540
Definition: ScriptedCreature.h:469
bool startPath
Definition: boss_alar.cpp:103

References ScriptedAI::SetCombatMovement(), and startPath.

Member Function Documentation

◆ DamageTaken()

void boss_alar::boss_alarAI::DamageTaken ( Unit ,
uint32 damage,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Reimplemented from BossAI.

153 {
154 if (damage >= me->GetHealth() && platform < POINT_MIDDLE)
155 {
156 damage = 0;
157 if (events.GetNextEventTime(EVENT_REBIRTH) == 0)
158 {
163
165 events.Reset();
166 events.ScheduleEvent(EVENT_RELOCATE_MIDDLE, 8000);
167 events.ScheduleEvent(EVENT_MOVE_TO_PHASE_2, 12000);
168 events.ScheduleEvent(EVENT_REBIRTH, 16001);
169 }
170 }
171 }
@ REACT_PASSIVE
Definition: Unit.h:1035
@ BASE_ATTACK
Definition: Unit.h:396
events
Definition: boss_sartura.cpp:43
@ EVENT_REBIRTH
Definition: boss_alar.cpp:66
@ POINT_MIDDLE
Definition: boss_alar.cpp:60
@ EVENT_RELOCATE_MIDDLE
Definition: boss_alar.cpp:65
@ EVENT_MOVE_TO_PHASE_2
Definition: boss_alar.cpp:77
@ SPELL_EMBER_BLAST
Definition: boss_alar.cpp:32
Creature * me
Definition: ScriptedCreature.h:282
void SetReactState(ReactStates st)
Definition: Creature.h:90
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4081
void setAttackTimer(WeaponAttackType type, int32 time)
Definition: Unit.h:1352
uint32 GetMaxHealth() const
Definition: Unit.h:1455
void SetHealth(uint32 val)
Definition: Unit.cpp:15464
uint32 GetHealth() const
Definition: Unit.h:1454
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
uint8 platform
Definition: boss_alar.cpp:101

References BASE_ATTACK, Unit::CastSpell(), EVENT_MOVE_TO_PHASE_2, EVENT_REBIRTH, EVENT_RELOCATE_MIDDLE, Unit::GetHealth(), Unit::GetMaxHealth(), Unit::InterruptNonMeleeSpells(), ScriptedAI::me, platform, POINT_MIDDLE, REACT_PASSIVE, Unit::setAttackTimer(), Unit::SetHealth(), Creature::SetReactState(), and SPELL_EMBER_BLAST.

◆ JustDied()

void boss_alar::boss_alarAI::JustDied ( Unit killer)
inlineoverridevirtual

Reimplemented from BossAI.

128 {
129 me->SetModelVisible(true);
130 BossAI::JustDied(killer);
131
132 // Xinef: Ruse of the Ashtongue (10946)
133 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
134 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
135 {
136 Player* player = itr->GetSource();
138 if (player->HasAura(SPELL_ASHTONGUE_RUSE))
140 }
141 }
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:103
@ QUEST_RUSE_OF_THE_ASHTONGUE
Definition: boss_alar.cpp:85
@ SPELL_ASHTONGUE_RUSE
Definition: boss_alar.cpp:84
Definition: LinkedList.h:139
void JustDied(Unit *) override
Definition: ScriptedCreature.h:498
Map * GetMap() const
Definition: Object.h:517
Definition: Player.h:1056
void AreaExploredOrEventHappens(uint32 questId)
Definition: PlayerQuest.cpp:1777
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1416
void SetModelVisible(bool on)
Definition: Unit.cpp:14230
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5636
PlayerList const & GetPlayers() const
Definition: Map.h:485
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37

References Player::AreaExploredOrEventHappens(), MapRefMgr::begin(), MapRefMgr::end(), WorldObject::GetMap(), Map::GetPlayers(), Player::GetQuestStatus(), Unit::HasAura(), BossAI::JustDied(), ScriptedAI::me, QUEST_RUSE_OF_THE_ASHTONGUE, QUEST_STATUS_INCOMPLETE, Unit::SetModelVisible(), and SPELL_ASHTONGUE_RUSE.

◆ JustEngagedWith()

void boss_alar::boss_alarAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from BossAI.

122 {
124 events.ScheduleEvent(EVENT_SWITCH_PLATFORM, 0);
125 }
@ EVENT_SWITCH_PLATFORM
Definition: boss_alar.cpp:63
void JustEngagedWith(Unit *) override
Called for reaction when initially engaged.
Definition: ScriptedCreature.h:497

References EVENT_SWITCH_PLATFORM, and BossAI::JustEngagedWith().

◆ JustReachedHome()

void boss_alar::boss_alarAI::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from BossAI.

106 {
108 startPath = true;
109 }
void JustReachedHome() override
Definition: ScriptedCreature.h:499

References BossAI::JustReachedHome(), and startPath.

◆ JustSummoned()

void boss_alar::boss_alarAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from BossAI.

144 {
145 summons.Summon(summon);
146 if (summon->GetEntry() == NPC_EMBER_OF_ALAR)
148 }
@ NPC_EMBER_OF_ALAR
Definition: boss_alar.cpp:55
@ IMMUNITY_DAMAGE
Definition: SharedDefines.h:1397
@ SPELL_SCHOOL_MASK_FIRE
Definition: SharedDefines.h:299
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:90
SummonList summons
Definition: ScriptedCreature.h:510
uint32 GetEntry() const
Definition: Object.h:109
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition: Unit.cpp:13383

References Unit::ApplySpellImmune(), Object::GetEntry(), IMMUNITY_DAMAGE, NPC_EMBER_OF_ALAR, SPELL_SCHOOL_MASK_FIRE, SummonList::Summon(), and BossAI::summons.

◆ MoveInLineOfSight()

void boss_alar::boss_alarAI::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

150{ }

◆ MovementInform()

void boss_alar::boss_alarAI::MovementInform ( uint32  type,
uint32  id 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

174 {
175 if (type != POINT_MOTION_TYPE)
176 {
177 if (type == ESCORT_MOTION_TYPE && me->movespline->Finalized() && !me->IsInCombat())
178 startPath = true;
179 return;
180 }
181
182 if (id == POINT_PLATFORM)
184 else if (id == POINT_QUILL)
185 events.ScheduleEvent(EVENT_START_QUILLS, 1000);
186 else if (id == POINT_DIVE)
187 {
188 events.ScheduleEvent(EVENT_START_DIVE, 1000);
189 events.ScheduleEvent(EVENT_CAST_DIVE_BOMB, 5000);
190 }
191 }
@ ESCORT_MOTION_TYPE
Definition: MotionMaster.h:55
@ POINT_MOTION_TYPE
Definition: MotionMaster.h:46
@ EVENT_START_DIVE
Definition: boss_alar.cpp:71
@ POINT_PLATFORM
Definition: boss_alar.cpp:58
@ POINT_QUILL
Definition: boss_alar.cpp:59
@ EVENT_START_QUILLS
Definition: boss_alar.cpp:64
@ POINT_DIVE
Definition: boss_alar.cpp:61
@ EVENT_CAST_DIVE_BOMB
Definition: boss_alar.cpp:72
Movement::MoveSpline * movespline
Definition: Unit.h:2454
bool IsInCombat() const
Definition: Unit.h:1702
bool Finalized() const
Definition: MoveSpline.h:116

References BASE_ATTACK, ESCORT_MOTION_TYPE, EVENT_CAST_DIVE_BOMB, EVENT_START_DIVE, EVENT_START_QUILLS, Movement::MoveSpline::Finalized(), Unit::IsInCombat(), ScriptedAI::me, Unit::movespline, POINT_DIVE, POINT_MOTION_TYPE, POINT_PLATFORM, POINT_QUILL, Unit::setAttackTimer(), and startPath.

◆ Reset()

void boss_alar::boss_alarAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

112 {
114 platform = 0;
115 noQuillTimes = 0;
116 me->SetModelVisible(true);
119 }
@ REACT_AGGRESSIVE
Definition: Unit.h:1037
void Reset() override
Definition: ScriptedCreature.h:496
uint8 noQuillTimes
Definition: boss_alar.cpp:102

References Unit::ApplySpellImmune(), IMMUNITY_DAMAGE, ScriptedAI::me, noQuillTimes, platform, REACT_AGGRESSIVE, BossAI::Reset(), Unit::SetModelVisible(), Creature::SetReactState(), and SPELL_SCHOOL_MASK_FIRE.

◆ UpdateAI()

void boss_alar::boss_alarAI::UpdateAI ( uint32  diff)
inlineoverridevirtual

Reimplemented from BossAI.

194 {
195 if (startPath)
196 {
197 me->StopMoving();
198 startPath = false;
199 if (WaypointPath const* i_path = sWaypointMgr->GetPath(me->GetWaypointPath()))
200 {
201 Movement::PointsArray pathPoints;
202 pathPoints.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
203 for (uint8 i = 0; i < i_path->size(); ++i)
204 {
205 WaypointData const* node = i_path->at(i);
206 pathPoints.push_back(G3D::Vector3(node->x, node->y, node->z));
207 }
208 me->GetMotionMaster()->MoveSplinePath(&pathPoints);
209 }
210 }
211
212 if (!UpdateVictim())
213 return;
214
215 events.Update(diff);
217 return;
218
219 switch (events.ExecuteEvent())
220 {
222 if (roll_chance_i(20 * noQuillTimes))
223 {
224 noQuillTimes = 0;
225 platform = RAND(0, 3);
227 events.ScheduleEvent(EVENT_SWITCH_PLATFORM, 16000);
228 }
229 else
230 {
231 if (noQuillTimes++ > 0)
232 {
233 me->SetOrientation(alarPoints[platform].GetOrientation());
235 }
237 platform = (platform + 1) % 4;
238 events.ScheduleEvent(EVENT_SWITCH_PLATFORM, 30000);
239 }
241 break;
244 break;
247 break;
251 break;
252 case EVENT_REBIRTH:
256
257 events.ScheduleEvent(EVENT_SPELL_MELT_ARMOR, 67000);
258 events.ScheduleEvent(EVENT_SPELL_CHARGE, 10000);
259 events.ScheduleEvent(EVENT_SPELL_FLAME_PATCH, 20000);
260 events.ScheduleEvent(EVENT_SPELL_DIVE_BOMB, 30000);
261 break;
264 events.ScheduleEvent(EVENT_SPELL_MELT_ARMOR, 60000);
265 break;
267 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
268 me->CastSpell(target, SPELL_CHARGE, false);
269 events.ScheduleEvent(EVENT_SPELL_CHARGE, 30000);
270 break;
272 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
274 events.ScheduleEvent(EVENT_SPELL_FLAME_PATCH, 30000);
275 break;
278 events.ScheduleEvent(EVENT_SPELL_DIVE_BOMB, 30000);
279 events.DelayEvents(15000);
281 break;
282 case EVENT_START_DIVE:
284 break;
286 events.ScheduleEvent(EVENT_SUMMON_DIVE_PHOENIX, 2000);
287 events.ScheduleEvent(EVENT_REBIRTH_DIVE, 6000);
288 events.ScheduleEvent(EVENT_FINISH_DIVE, 10000);
289 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 90.0f, true))
290 {
291 me->CastSpell(target, SPELL_DIVE_BOMB, false);
292 me->SetPosition(*target);
294 }
295
297 break;
299 {
300 Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 10.0f, true);
303 break;
304 }
306 me->SetModelVisible(true);
308 break;
311 break;
313 me->CastSpell(me, SPELL_BERSERK, true);
314 break;
315 }
316
317 if (me->isAttackReady())
318 {
320 {
323 }
324 else
325 {
328 for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
329 if (Unit* unit = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()))
330 if (me->IsWithinMeleeRange(unit))
331 {
332 me->AttackerStateUpdate(unit);
333 return;
334 }
335
337 }
338 }
339 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:55
constexpr auto MINUTE
Definition: Common.h:49
std::uint8_t uint8
Definition: Define.h:110
bool roll_chance_i(int chance)
Definition: Random.h:59
static First const & RAND(First const &first, Second const &second, Rest const &... rest)
Definition: CreatureAIImpl.h:30
@ TEMPSUMMON_TIMED_DESPAWN
Definition: Object.h:44
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition: Object.h:47
@ UNIT_STATE_CASTING
Definition: Unit.h:340
std::vector< WaypointData * > WaypointPath
Definition: WaypointMgr.h:47
#define sWaypointMgr
Definition: WaypointMgr.h:78
@ EVENT_SUMMON_DIVE_PHOENIX
Definition: boss_alar.cpp:73
@ EVENT_FINISH_DIVE
Definition: boss_alar.cpp:78
@ EVENT_SPELL_FLAME_PATCH
Definition: boss_alar.cpp:68
@ EVENT_SPELL_DIVE_BOMB
Definition: boss_alar.cpp:70
@ EVENT_REBIRTH_DIVE
Definition: boss_alar.cpp:74
@ EVENT_SPELL_BERSERK
Definition: boss_alar.cpp:75
@ EVENT_SPELL_CHARGE
Definition: boss_alar.cpp:69
@ NPC_FLAME_PATCH
Definition: boss_alar.cpp:56
@ EVENT_SPELL_MELT_ARMOR
Definition: boss_alar.cpp:67
@ SPELL_DIVE_BOMB
Definition: boss_alar.cpp:38
@ SPELL_CHARGE
Definition: boss_alar.cpp:35
@ SPELL_FLAME_QUILLS
Definition: boss_alar.cpp:28
@ SPELL_REBIRTH_PHASE2
Definition: boss_alar.cpp:33
@ SPELL_BERSERK
Definition: boss_alar.cpp:27
@ SPELL_DIVE_BOMB_VISUAL
Definition: boss_alar.cpp:37
@ SPELL_MELT_ARMOR
Definition: boss_alar.cpp:34
@ SPELL_FLAME_BUFFET
Definition: boss_alar.cpp:31
@ SPELL_REBIRTH_DIVE
Definition: boss_alar.cpp:36
const Position alarPoints[7]
Definition: boss_alar.cpp:41
std::vector< Vector3 > PointsArray
Definition: MoveSplineInitArgs.h:28
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:202
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
bool UpdateVictim()
Definition: CreatureAI.cpp:268
std::list< HostileReference * > StorageType
Definition: ThreatMgr.h:148
ThreatContainer::StorageType const & GetThreatList() const
Definition: ThreatMgr.h:274
uint32 GetWaypointPath() const
Definition: Creature.h:340
void SetPosition(float x, float y, float z, float o)
Definition: Creature.cpp:3072
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:2343
float GetPositionZ() const
Definition: Position.h:119
void SetOrientation(float orientation)
Definition: Position.h:112
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
Definition: Unit.h:1302
MotionMaster * GetMotionMaster()
Definition: Unit.h:2276
void StopMoving()
Definition: Unit.cpp:16918
bool IsWithinMeleeRange(Unit const *obj, float dist=0.f) const
Definition: Unit.cpp:683
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4855
Unit * GetVictim() const
Definition: Unit.h:1398
void StopMovingOnCurrentPos()
Definition: Unit.cpp:16957
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1410
void AttackerStateUpdate(Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false, bool ignoreCasting=false)
Definition: Unit.cpp:2537
ThreatMgr & GetThreatMgr()
Definition: Unit.h:2159
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
Definition: Unit.h:1355
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
Definition: Unit.cpp:661
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Definition: MotionMaster.cpp:300
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:211
void MoveSplinePath(Movement::PointsArray *path)
Definition: MotionMaster.cpp:436
Definition: WaypointMgr.h:37
float z
Definition: WaypointMgr.h:39
float x
Definition: WaypointMgr.h:39
float y
Definition: WaypointMgr.h:39

References alarPoints, Unit::AttackerStateUpdate(), BASE_ATTACK, Unit::CastSpell(), EVENT_CAST_DIVE_BOMB, EVENT_FINISH_DIVE, EVENT_MOVE_TO_PHASE_2, EVENT_REBIRTH, EVENT_REBIRTH_DIVE, EVENT_RELOCATE_MIDDLE, EVENT_SPELL_BERSERK, EVENT_SPELL_CHARGE, EVENT_SPELL_DIVE_BOMB, EVENT_SPELL_FLAME_PATCH, EVENT_SPELL_MELT_ARMOR, EVENT_START_DIVE, EVENT_START_QUILLS, EVENT_SUMMON_DIVE_PHOENIX, EVENT_SWITCH_PLATFORM, Unit::GetMotionMaster(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), ThreatMgr::GetThreatList(), Unit::GetThreatMgr(), ObjectAccessor::GetUnit(), Unit::GetVictim(), Creature::GetWaypointPath(), Unit::HasUnitState(), IN_MILLISECONDS, Unit::isAttackReady(), Unit::IsWithinMeleeRange(), ScriptedAI::me, MINUTE, MotionMaster::MoveChase(), MotionMaster::MovePoint(), MotionMaster::MoveSplinePath(), noQuillTimes, NPC_EMBER_OF_ALAR, NPC_FLAME_PATCH, platform, POINT_DIVE, POINT_MIDDLE, POINT_PLATFORM, POINT_QUILL, RAND(), REACT_AGGRESSIVE, Unit::RemoveAurasDueToSpell(), Unit::resetAttackTimer(), roll_chance_i(), UnitAI::SelectTarget(), Unit::setAttackTimer(), Unit::SetModelVisible(), Position::SetOrientation(), Creature::SetPosition(), Creature::SetReactState(), SPELL_BERSERK, SPELL_CHARGE, SPELL_DIVE_BOMB, SPELL_DIVE_BOMB_VISUAL, SPELL_EMBER_BLAST, SPELL_FLAME_BUFFET, SPELL_FLAME_QUILLS, SPELL_MELT_ARMOR, SPELL_REBIRTH_DIVE, SPELL_REBIRTH_PHASE2, startPath, Unit::StopMoving(), Unit::StopMovingOnCurrentPos(), WorldObject::SummonCreature(), sWaypointMgr, TEMPSUMMON_CORPSE_TIMED_DESPAWN, TEMPSUMMON_TIMED_DESPAWN, UNIT_STATE_CASTING, CreatureAI::UpdateVictim(), WaypointData::x, WaypointData::y, and WaypointData::z.

Member Data Documentation

◆ noQuillTimes

uint8 boss_alar::boss_alarAI::noQuillTimes

Referenced by Reset(), and UpdateAI().

◆ platform

uint8 boss_alar::boss_alarAI::platform

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

◆ startPath

bool boss_alar::boss_alarAI::startPath