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.
 
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 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

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
EventMap events
 
SummonList summons
 
TaskScheduler scheduler
 
- 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_alarAI()

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

References ScriptedAI::SetCombatMovement(), and startPath.

Member Function Documentation

◆ DamageTaken()

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

Reimplemented from BossAI.

152 {
153 if (damage >= me->GetHealth() && platform < POINT_MIDDLE)
154 {
155 damage = 0;
156 if (events.GetNextEventTime(EVENT_REBIRTH) == 0)
157 {
162
164 events.Reset();
165 events.ScheduleEvent(EVENT_RELOCATE_MIDDLE, 8000);
166 events.ScheduleEvent(EVENT_MOVE_TO_PHASE_2, 12000);
167 events.ScheduleEvent(EVENT_REBIRTH, 16001);
168 }
169 }
170 }
@ BASE_ATTACK
Definition: Unit.h:396
@ REACT_PASSIVE
Definition: Unit.h:1023
events
Definition: boss_sartura.cpp:43
@ EVENT_REBIRTH
Definition: boss_alar.cpp:65
@ POINT_MIDDLE
Definition: boss_alar.cpp:59
@ EVENT_RELOCATE_MIDDLE
Definition: boss_alar.cpp:64
@ EVENT_MOVE_TO_PHASE_2
Definition: boss_alar.cpp:76
@ SPELL_EMBER_BLAST
Definition: boss_alar.cpp:31
Creature * me
Definition: ScriptedCreature.h:282
void SetReactState(ReactStates st)
Definition: Creature.h:89
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4069
void setAttackTimer(WeaponAttackType type, int32 time)
Definition: Unit.h:1340
uint32 GetMaxHealth() const
Definition: Unit.h:1441
void SetHealth(uint32 val)
Definition: Unit.cpp:15370
uint32 GetHealth() const
Definition: Unit.h:1440
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:100

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.

127 {
128 me->SetModelVisible(true);
129 BossAI::JustDied(killer);
130
131 // Xinef: Ruse of the Ashtongue (10946)
132 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
133 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
134 {
135 Player* player = itr->GetSource();
137 if (player->HasAura(SPELL_ASHTONGUE_RUSE))
139 }
140 }
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:103
@ QUEST_RUSE_OF_THE_ASHTONGUE
Definition: boss_alar.cpp:84
@ SPELL_ASHTONGUE_RUSE
Definition: boss_alar.cpp:83
Definition: LinkedList.h:139
void JustDied(Unit *) override
Definition: ScriptedCreature.h:484
Map * GetMap() const
Definition: Object.h:517
Definition: Player.h:1046
void AreaExploredOrEventHappens(uint32 questId)
Definition: PlayerQuest.cpp:1775
QuestStatus GetQuestStatus(uint32 quest_id) const
Definition: PlayerQuest.cpp:1414
void SetModelVisible(bool on)
Definition: Unit.cpp:14139
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5610
PlayerList const & GetPlayers() const
Definition: Map.h:484
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.

121 {
123 events.ScheduleEvent(EVENT_SWITCH_PLATFORM, 0);
124 }
@ EVENT_SWITCH_PLATFORM
Definition: boss_alar.cpp:62
void JustEngagedWith(Unit *) override
Called for reaction when initially engaged.
Definition: ScriptedCreature.h:483

References EVENT_SWITCH_PLATFORM, and BossAI::JustEngagedWith().

◆ JustReachedHome()

void boss_alar::boss_alarAI::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from BossAI.

105 {
107 startPath = true;
108 }
void JustReachedHome() override
Definition: ScriptedCreature.h:485

References BossAI::JustReachedHome(), and startPath.

◆ JustSummoned()

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

Reimplemented from BossAI.

143 {
144 summons.Summon(summon);
145 if (summon->GetEntry() == NPC_EMBER_OF_ALAR)
147 }
@ NPC_EMBER_OF_ALAR
Definition: boss_alar.cpp:54
@ IMMUNITY_DAMAGE
Definition: SharedDefines.h:1369
@ SPELL_SCHOOL_MASK_FIRE
Definition: SharedDefines.h:271
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:90
SummonList summons
Definition: ScriptedCreature.h:497
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:13300

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.

149{ }

◆ MovementInform()

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

Reimplemented from ScriptedAI.

173 {
174 if (type != POINT_MOTION_TYPE)
175 {
176 if (type == ESCORT_MOTION_TYPE && me->movespline->Finalized() && !me->IsInCombat())
177 startPath = true;
178 return;
179 }
180
181 if (id == POINT_PLATFORM)
183 else if (id == POINT_QUILL)
184 events.ScheduleEvent(EVENT_START_QUILLS, 1000);
185 else if (id == POINT_DIVE)
186 {
187 events.ScheduleEvent(EVENT_START_DIVE, 1000);
188 events.ScheduleEvent(EVENT_CAST_DIVE_BOMB, 5000);
189 }
190 }
@ ESCORT_MOTION_TYPE
Definition: MotionMaster.h:55
@ POINT_MOTION_TYPE
Definition: MotionMaster.h:46
@ EVENT_START_DIVE
Definition: boss_alar.cpp:70
@ POINT_PLATFORM
Definition: boss_alar.cpp:57
@ POINT_QUILL
Definition: boss_alar.cpp:58
@ EVENT_START_QUILLS
Definition: boss_alar.cpp:63
@ POINT_DIVE
Definition: boss_alar.cpp:60
@ EVENT_CAST_DIVE_BOMB
Definition: boss_alar.cpp:71
Movement::MoveSpline * movespline
Definition: Unit.h:2440
bool IsInCombat() const
Definition: Unit.h:1688
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.

111 {
113 platform = 0;
114 noQuillTimes = 0;
115 me->SetModelVisible(true);
118 }
@ REACT_AGGRESSIVE
Definition: Unit.h:1025
void Reset() override
Definition: ScriptedCreature.h:482
uint8 noQuillTimes
Definition: boss_alar.cpp:101

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.

193 {
194 if (startPath)
195 {
196 me->StopMoving();
197 startPath = false;
198 if (WaypointPath const* i_path = sWaypointMgr->GetPath(me->GetWaypointPath()))
199 {
200 Movement::PointsArray pathPoints;
201 pathPoints.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
202 for (uint8 i = 0; i < i_path->size(); ++i)
203 {
204 WaypointData const* node = i_path->at(i);
205 pathPoints.push_back(G3D::Vector3(node->x, node->y, node->z));
206 }
207 me->GetMotionMaster()->MoveSplinePath(&pathPoints);
208 }
209 }
210
211 if (!UpdateVictim())
212 return;
213
214 events.Update(diff);
216 return;
217
218 switch (events.ExecuteEvent())
219 {
221 if (roll_chance_i(20 * noQuillTimes))
222 {
223 noQuillTimes = 0;
224 platform = RAND(0, 3);
226 events.ScheduleEvent(EVENT_SWITCH_PLATFORM, 16000);
227 }
228 else
229 {
230 if (noQuillTimes++ > 0)
231 {
232 me->SetOrientation(alarPoints[platform].GetOrientation());
234 }
236 platform = (platform + 1) % 4;
237 events.ScheduleEvent(EVENT_SWITCH_PLATFORM, 30000);
238 }
240 break;
243 break;
246 break;
250 break;
251 case EVENT_REBIRTH:
255
256 events.ScheduleEvent(EVENT_SPELL_MELT_ARMOR, 67000);
257 events.ScheduleEvent(EVENT_SPELL_CHARGE, 10000);
258 events.ScheduleEvent(EVENT_SPELL_FLAME_PATCH, 20000);
259 events.ScheduleEvent(EVENT_SPELL_DIVE_BOMB, 30000);
260 break;
263 events.ScheduleEvent(EVENT_SPELL_MELT_ARMOR, 60000);
264 break;
266 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
267 me->CastSpell(target, SPELL_CHARGE, false);
268 events.ScheduleEvent(EVENT_SPELL_CHARGE, 30000);
269 break;
271 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
273 events.ScheduleEvent(EVENT_SPELL_FLAME_PATCH, 30000);
274 break;
277 events.ScheduleEvent(EVENT_SPELL_DIVE_BOMB, 30000);
278 events.DelayEvents(15000);
280 break;
281 case EVENT_START_DIVE:
283 break;
285 events.ScheduleEvent(EVENT_SUMMON_DIVE_PHOENIX, 2000);
286 events.ScheduleEvent(EVENT_REBIRTH_DIVE, 6000);
287 events.ScheduleEvent(EVENT_FINISH_DIVE, 10000);
288 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 90.0f, true))
289 {
290 me->CastSpell(target, SPELL_DIVE_BOMB, false);
291 me->SetPosition(*target);
293 }
294
296 break;
298 {
299 Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 10.0f, true);
302 break;
303 }
305 me->SetModelVisible(true);
307 break;
310 break;
312 me->CastSpell(me, SPELL_BERSERK, true);
313 break;
314 }
315
316 if (me->isAttackReady())
317 {
319 {
322 }
323 else
324 {
327 for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
328 if (Unit* unit = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()))
329 if (me->IsWithinMeleeRange(unit))
330 {
331 me->AttackerStateUpdate(unit);
332 return;
333 }
334
336 }
337 }
338 }
constexpr auto IN_MILLISECONDS
Definition: Common.h:62
constexpr auto MINUTE
Definition: Common.h:56
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:46
#define sWaypointMgr
Definition: WaypointMgr.h:77
@ EVENT_SUMMON_DIVE_PHOENIX
Definition: boss_alar.cpp:72
@ EVENT_FINISH_DIVE
Definition: boss_alar.cpp:77
@ EVENT_SPELL_FLAME_PATCH
Definition: boss_alar.cpp:67
@ EVENT_SPELL_DIVE_BOMB
Definition: boss_alar.cpp:69
@ EVENT_REBIRTH_DIVE
Definition: boss_alar.cpp:73
@ EVENT_SPELL_BERSERK
Definition: boss_alar.cpp:74
@ EVENT_SPELL_CHARGE
Definition: boss_alar.cpp:68
@ NPC_FLAME_PATCH
Definition: boss_alar.cpp:55
@ EVENT_SPELL_MELT_ARMOR
Definition: boss_alar.cpp:66
@ SPELL_DIVE_BOMB
Definition: boss_alar.cpp:37
@ SPELL_CHARGE
Definition: boss_alar.cpp:34
@ SPELL_FLAME_QUILLS
Definition: boss_alar.cpp:27
@ SPELL_REBIRTH_PHASE2
Definition: boss_alar.cpp:32
@ SPELL_BERSERK
Definition: boss_alar.cpp:26
@ SPELL_DIVE_BOMB_VISUAL
Definition: boss_alar.cpp:36
@ SPELL_MELT_ARMOR
Definition: boss_alar.cpp:33
@ SPELL_FLAME_BUFFET
Definition: boss_alar.cpp:30
@ SPELL_REBIRTH_DIVE
Definition: boss_alar.cpp:35
const Position alarPoints[7]
Definition: boss_alar.cpp:40
std::vector< Vector3 > PointsArray
Definition: MoveSplineInitArgs.h:28
Unit * GetUnit(WorldObject const &, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:204
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:111
bool UpdateVictim()
Definition: CreatureAI.cpp:269
std::list< HostileReference * > StorageType
Definition: ThreatMgr.h:148
ThreatContainer::StorageType const & GetThreatList() const
Definition: ThreatMgr.h:274
uint32 GetWaypointPath() const
Definition: Creature.h:338
void SetPosition(float x, float y, float z, float o)
Definition: Creature.cpp:3055
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:2318
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:1290
MotionMaster * GetMotionMaster()
Definition: Unit.h:2262
void StopMoving()
Definition: Unit.cpp:16824
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:4835
Unit * GetVictim() const
Definition: Unit.h:1386
void StopMovingOnCurrentPos()
Definition: Unit.cpp:16863
bool HasUnitState(const uint32 f) const
Definition: Unit.h:1398
void AttackerStateUpdate(Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false, bool ignoreCasting=false)
Definition: Unit.cpp:2527
ThreatMgr & GetThreatMgr()
Definition: Unit.h:2145
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
Definition: Unit.h:1343
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:299
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:210
void MoveSplinePath(Movement::PointsArray *path)
Definition: MotionMaster.cpp:409
Definition: WaypointMgr.h:36
float z
Definition: WaypointMgr.h:38
float x
Definition: WaypointMgr.h:38
float y
Definition: WaypointMgr.h:38

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