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

Public Member Functions

 boss_arlokkAI (Creature *creature)
 
void Reset () override
 
void JustDied (Unit *) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged.
 
void JustReachedHome () override
 
void EnterEvadeMode (EvadeReason why) override
 
void SetData (uint32 id, uint32) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
 ~BossAI () override
 
bool CanRespawn () override
 
void OnSpellCastFinished (SpellInfo const *spell, SpellFinishReason reason) 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.
 
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.
 
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 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)
 
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
 
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
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (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 *)
 
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 ()
 
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 JustEnteredCombat (Unit *)
 Called when the unit enters combat.
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage to any victim (before damage apply)
 
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

uint8 _summonCountA
 
uint8 _summonCountB
 
ObjectGuid _triggersSideAGUID [5]
 
ObjectGuid _triggersSideBGUID [5]
 

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
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_arlokkAI()

boss_arlokk::boss_arlokkAI::boss_arlokkAI ( Creature creature)
inline
92: BossAI(creature, DATA_ARLOKK) { }
Definition ScriptedCreature.h:482
@ DATA_ARLOKK
Definition zulgurub.h:34

Member Function Documentation

◆ EnterEvadeMode()

void boss_arlokk::boss_arlokkAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

155 {
157
158 std::list<Creature*> panthers;
160 for (auto const& panther : panthers)
161 panther->DespawnOrUnsummon();
162 }
void GetCreatureListWithEntryInGrid(std::list< Creature * > &list, WorldObject *source, uint32 entry, float maxSearchRange)
Definition ScriptedCreature.cpp:915
void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER) override
Definition ScriptedCreature.h:521
Creature * me
Definition ScriptedCreature.h:281
@ NPC_ZULIAN_PROWLER
Definition zulgurub.h:51

References BossAI::EnterEvadeMode(), GetCreatureListWithEntryInGrid(), ScriptedAI::me, and NPC_ZULIAN_PROWLER.

◆ JustDied()

void boss_arlokk::boss_arlokkAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

109 {
110 _JustDied();
112 }
@ SAY_DEATH
Definition boss_arlokk.cpp:28
void _JustDied()
Definition ScriptedCreature.cpp:654
Talk
Definition hyjal.cpp:82

References BossAI::_JustDied(), and SAY_DEATH.

◆ JustEngagedWith()

void boss_arlokk::boss_arlokkAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from CreatureAI.

115 {
117 events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, 7s, 9s, 0, PHASE_ONE);
118 events.ScheduleEvent(EVENT_GOUGE, 12s, 15s, 0, PHASE_ONE);
119 events.ScheduleEvent(EVENT_SUMMON_PROWLERS, 6s, 0, PHASE_ALL);
120 events.ScheduleEvent(EVENT_MARK_OF_ARLOKK, 9s, 11s, 0, PHASE_ALL);
121 events.ScheduleEvent(EVENT_TRANSFORM, 30s, 0, PHASE_ONE);
123
124 // Sets up list of Panther spawners to cast on
125 std::list<Creature*> triggerList;
127 if (!triggerList.empty())
128 {
129 uint8 sideA = 0;
130 uint8 sideB = 0;
131 for (auto const& trigger : triggerList)
132 {
133 if (trigger->GetPositionY() < -1625.0f)
134 {
135 _triggersSideAGUID[sideA] = trigger->GetGUID();
136 ++sideA;
137 }
138 else
139 {
140 _triggersSideBGUID[sideB] = trigger->GetGUID();
141 ++sideB;
142 }
143 }
144 }
145 }
std::uint8_t uint8
Definition Define.h:109
@ SAY_AGGRO
Definition boss_arlokk.cpp:26
@ PHASE_ONE
Definition boss_arlokk.cpp:62
@ PHASE_ALL
Definition boss_arlokk.cpp:61
@ EVENT_SUMMON_PROWLERS
Definition boss_arlokk.cpp:56
@ EVENT_SHADOW_WORD_PAIN
Definition boss_arlokk.cpp:47
@ EVENT_GOUGE
Definition boss_arlokk.cpp:48
@ EVENT_TRANSFORM
Definition boss_arlokk.cpp:51
@ EVENT_MARK_OF_ARLOKK
Definition boss_arlokk.cpp:49
events
Definition boss_sartura.cpp:43
void _JustEngagedWith()
Definition ScriptedCreature.cpp:667
ObjectGuid _triggersSideBGUID[5]
Definition boss_arlokk.cpp:291
ObjectGuid _triggersSideAGUID[5]
Definition boss_arlokk.cpp:290
@ NPC_PANTHER_TRIGGER
Definition zulgurub.h:50

References BossAI::_JustEngagedWith(), _triggersSideAGUID, _triggersSideBGUID, EVENT_GOUGE, EVENT_MARK_OF_ARLOKK, EVENT_SHADOW_WORD_PAIN, EVENT_SUMMON_PROWLERS, EVENT_TRANSFORM, GetCreatureListWithEntryInGrid(), ScriptedAI::me, NPC_PANTHER_TRIGGER, PHASE_ALL, PHASE_ONE, and SAY_AGGRO.

◆ JustReachedHome()

void boss_arlokk::boss_arlokkAI::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

148 {
150 object->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
152 }
@ GO_FLAG_NOT_SELECTABLE
Definition SharedDefines.h:1618
InstanceScript *const instance
Definition ScriptedCreature.h:489
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2178
Definition GameObject.h:120
ObjectGuid GetGuidData(uint32 type) const override
Definition InstanceScript.cpp:110
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:184
@ GO_GONG_OF_BETHEKK
Definition zulgurub.h:79

References Creature::DespawnOrUnsummon(), ObjectAccessor::GetGameObject(), InstanceScript::GetGuidData(), GO_FLAG_NOT_SELECTABLE, GO_GONG_OF_BETHEKK, BossAI::instance, and ScriptedAI::me.

◆ Reset()

void boss_arlokk::boss_arlokkAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

95 {
96 if (events.IsInPhase(PHASE_TWO))
98 _Reset();
99 _summonCountA = 0;
100 _summonCountB = 0;
103 me->SetWalk(false);
106 }
std::uint32_t uint32
Definition Define.h:107
@ UNIT_MOD_DAMAGE_MAINHAND
Definition Unit.h:172
@ TOTAL_PCT
Definition Unit.h:136
@ UNIT_VIRTUAL_ITEM_SLOT_ID
Definition UpdateFields.h:116
@ PHASE_TWO
Definition boss_arlokk.cpp:63
float const DamageDecrease
Definition boss_arlokk.cpp:83
Position const PosMoveOnSpawn[1]
Definition boss_arlokk.cpp:76
@ WEAPON_DAGGER
Definition boss_arlokk.cpp:68
void _Reset()
Definition ScriptedCreature.cpp:634
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:339
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition Creature.cpp:3218
void MoveTargetedHome(bool walk=false)
The unit will return this initial position (owner for pets and summoned creatures)....
Definition MotionMaster.cpp:260
void ApplyStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float amount)
Definition Unit.cpp:15339
MotionMaster * GetMotionMaster()
Definition Unit.h:1738
void SetUInt32Value(uint16 index, uint32 value)
Definition Unit.cpp:21414
uint8 _summonCountA
Definition boss_arlokk.cpp:288
uint8 _summonCountB
Definition boss_arlokk.cpp:289

References BossAI::_Reset(), _summonCountA, _summonCountB, Unit::ApplyStatPctModifier(), DamageDecrease, Unit::GetMotionMaster(), ScriptedAI::me, MotionMaster::MoveTargetedHome(), PHASE_TWO, PosMoveOnSpawn, Creature::SetHomePosition(), Unit::SetUInt32Value(), Creature::SetWalk(), TOTAL_PCT, UNIT_MOD_DAMAGE_MAINHAND, UNIT_VIRTUAL_ITEM_SLOT_ID, and WEAPON_DAGGER.

◆ SetData()

void boss_arlokk::boss_arlokkAI::SetData ( uint32  id,
uint32   
)
inlineoverridevirtual

Reimplemented from UnitAI.

165 {
166 if (id == 1)
168 else if (id == 2)
170 }

References _summonCountA, and _summonCountB.

◆ UpdateAI()

void boss_arlokk::boss_arlokkAI::UpdateAI ( uint32  )
inlineoverridevirtual

Use to start attacking a target. Called just before JustEngagedWith()

Implements UnitAI.

173 {
174 if (!UpdateVictim())
175 return;
176
177 events.Update(diff);
178
180 return;
181
182 while (uint32 eventId = events.ExecuteEvent())
183 {
184 switch (eventId)
185 {
188 events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, 5s, 7s, 0, PHASE_ONE);
189 break;
190 case EVENT_GOUGE:
192 break;
195 {
196 if (Unit* trigger = ObjectAccessor::GetUnit(*me, _triggersSideAGUID[urand(0, 4)]))
197 {
198 trigger->CastSpell(trigger, SPELL_SUMMON_PROWLER);
200 }
201 }
203 {
204 if (Unit* trigger = ObjectAccessor::GetUnit(*me, _triggersSideBGUID[urand(0, 4)]))
205 {
206 trigger->CastSpell(trigger, SPELL_SUMMON_PROWLER);
208 }
209 }
210 events.ScheduleEvent(EVENT_SUMMON_PROWLERS, 6s, 0, PHASE_ALL);
211 break;
213 {
214 Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, urand(1, 3), 0.0f, false, true, -SPELL_MARK_OF_ARLOKK);
215 if (!target)
216 target = me->GetVictim();
217 if (target)
218 {
219 DoCast(target, SPELL_MARK_OF_ARLOKK, true);
220 Talk(SAY_FEAST_PROWLER, target);
221 }
222 events.ScheduleEvent(EVENT_MARK_OF_ARLOKK, 120s, 130s);
223 break;
224 }
225 case EVENT_TRANSFORM:
226 {
227 DoCastSelf(SPELL_PANTHER_TRANSFORM); // SPELL_AURA_TRANSFORM
230 me->AttackStop();
236 events.ScheduleEvent(EVENT_VANISH, 1s, 0, PHASE_ONE);
237 break;
238 }
239 case EVENT_VANISH:
241 me->SetWalk(false);
242 me->GetMotionMaster()->MovePoint(0, frand(-11551.0f, -11508.0f), frand(-1638.0f, -1617.0f), me->GetPositionZ());
243 events.ScheduleEvent(EVENT_VANISH_2, 9s, 0, PHASE_ONE);
244 break;
245 case EVENT_VANISH_2:
248 events.ScheduleEvent(EVENT_VISIBLE, 41s, 47s, 0, PHASE_ONE);
249 break;
250 case EVENT_VISIBLE:
254 AttackStart(target);
257 events.ScheduleEvent(EVENT_RAVAGE, 10s, 14s, 0, PHASE_TWO);
258 events.ScheduleEvent(EVENT_TRANSFORM_BACK, 30s, 40s, 0, PHASE_TWO);
259 events.SetPhase(PHASE_TWO);
261 break;
262 case EVENT_RAVAGE:
264 events.ScheduleEvent(EVENT_RAVAGE, 10s, 14s, 0, PHASE_TWO);
265 break;
267 {
268 me->RemoveAura(SPELL_PANTHER_TRANSFORM); // SPELL_AURA_TRANSFORM
273 events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, 4s, 7s, 0, PHASE_ONE);
274 events.ScheduleEvent(EVENT_GOUGE, 12s, 15s, 0, PHASE_ONE);
275 events.ScheduleEvent(EVENT_TRANSFORM, 30s, 0, PHASE_ONE);
276 events.SetPhase(PHASE_ONE);
277 break;
278 }
279 default:
280 break;
281 }
282 }
283
285 }
@ EQUIP_UNEQUIP
Definition CreatureAI.h:67
float frand(float min, float max)
Definition Random.cpp:57
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:255
@ UNIT_FLAG_NOT_SELECTABLE
Definition UnitDefines.h:279
@ REACT_PASSIVE
Definition Unit.h:555
@ REACT_AGGRESSIVE
Definition Unit.h:557
@ SAY_FEAST_PROWLER
Definition boss_arlokk.cpp:27
@ MAX_PROWLERS_PER_SIDE
Definition boss_arlokk.cpp:73
@ SPELL_PANTHER_TRANSFORM
Definition boss_arlokk.cpp:38
@ SPELL_SUMMON_PROWLER
Definition boss_arlokk.cpp:39
@ SPELL_RAVAGE
Definition boss_arlokk.cpp:36
@ SPELL_SHADOW_WORD_PAIN
Definition boss_arlokk.cpp:33
@ SPELL_SUPER_INVIS
Definition boss_arlokk.cpp:42
@ SPELL_VANISH
Definition boss_arlokk.cpp:41
@ SPELL_MARK_OF_ARLOKK
Definition boss_arlokk.cpp:35
@ SPELL_GOUGE
Definition boss_arlokk.cpp:34
@ SPELL_VANISH_VISUAL
Definition boss_arlokk.cpp:40
float const DamageIncrease
Definition boss_arlokk.cpp:82
@ EVENT_TRANSFORM_BACK
Definition boss_arlokk.cpp:54
@ EVENT_VISIBLE
Definition boss_arlokk.cpp:55
@ EVENT_VANISH_2
Definition boss_arlokk.cpp:53
@ EVENT_VANISH
Definition boss_arlokk.cpp:52
@ EVENT_RAVAGE
Definition boss_arlokk.cpp:50
bool UpdateVictim()
Definition CreatureAI.cpp:277
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:99
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:238
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:39
SpellCastResult DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:276
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:391
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
Definition Unit.h:655
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4895
Unit * GetVictim() const
Definition Unit.h:893
bool HasUnitState(const uint32 f) const
Definition Unit.h:726
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:738
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition Unit.cpp:10607
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:739
Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:199
float GetPositionZ() const
Definition Position.h:123
void DoResetThreatList()
Definition ScriptedCreature.cpp:463
void AttackStart(Unit *) override
Definition ScriptedCreature.cpp:228

References _summonCountA, _summonCountB, _triggersSideAGUID, _triggersSideBGUID, Unit::ApplyStatPctModifier(), ScriptedAI::AttackStart(), Unit::AttackStop(), DamageDecrease, DamageIncrease, UnitAI::DoCast(), UnitAI::DoCastSelf(), UnitAI::DoCastVictim(), UnitAI::DoMeleeAttackIfReady(), ScriptedAI::DoResetThreatList(), EQUIP_UNEQUIP, EVENT_GOUGE, EVENT_MARK_OF_ARLOKK, EVENT_RAVAGE, EVENT_SHADOW_WORD_PAIN, EVENT_SUMMON_PROWLERS, EVENT_TRANSFORM, EVENT_TRANSFORM_BACK, EVENT_VANISH, EVENT_VANISH_2, EVENT_VISIBLE, frand(), Unit::GetMotionMaster(), Position::GetPositionZ(), ObjectAccessor::GetUnit(), Unit::GetVictim(), Unit::HasUnitState(), MAX_PROWLERS_PER_SIDE, MaxThreat, ScriptedAI::me, MotionMaster::MovePoint(), PHASE_ALL, PHASE_ONE, PHASE_TWO, Random, REACT_AGGRESSIVE, REACT_PASSIVE, Unit::RemoveAura(), Unit::RemoveUnitFlag(), SAY_FEAST_PROWLER, UnitAI::SelectTarget(), Creature::SetReactState(), Unit::SetUInt32Value(), Unit::SetUnitFlag(), Creature::SetWalk(), SPELL_GOUGE, SPELL_MARK_OF_ARLOKK, SPELL_PANTHER_TRANSFORM, SPELL_RAVAGE, SPELL_SHADOW_WORD_PAIN, SPELL_SUMMON_PROWLER, SPELL_SUPER_INVIS, SPELL_VANISH, SPELL_VANISH_VISUAL, TOTAL_PCT, UNIT_FLAG_NON_ATTACKABLE, UNIT_FLAG_NOT_SELECTABLE, UNIT_MOD_DAMAGE_MAINHAND, UNIT_STATE_CASTING, UNIT_VIRTUAL_ITEM_SLOT_ID, CreatureAI::UpdateVictim(), urand(), and WEAPON_DAGGER.

Member Data Documentation

◆ _summonCountA

uint8 boss_arlokk::boss_arlokkAI::_summonCountA
private

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

◆ _summonCountB

uint8 boss_arlokk::boss_arlokkAI::_summonCountB
private

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

◆ _triggersSideAGUID

ObjectGuid boss_arlokk::boss_arlokkAI::_triggersSideAGUID[5]
private

Referenced by JustEngagedWith(), and UpdateAI().

◆ _triggersSideBGUID

ObjectGuid boss_arlokk::boss_arlokkAI::_triggersSideBGUID[5]
private

Referenced by JustEngagedWith(), and UpdateAI().


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