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

Public Member Functions

 boss_anubarak_trialAI (Creature *pCreature)
 
void Reset () override
 
void DoAction (int32 param) override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
void JustReachedHome () override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void JustSummoned (Creature *summon) override
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *who) override
 
void EnterEvadeMode (EvadeReason) override
 
void MoveInLineOfSight (Unit *who) override
 
bool CanAIAttack (Unit const *target) const 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) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
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. More...
 
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=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)
 
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. More...
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
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. More...
 
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 SummonedCreatureEvade (Creature *)
 
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
 Called when unit is charmed. More...
 
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 ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
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 *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
- 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
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
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)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following: More...
 
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. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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

InstanceScriptpInstance
 
SummonList summons
 
EventMap events
 
bool bIntro
 
bool bPhase3
 
ObjectGuid SphereGUID [6]
 
ObjectGuid BurrowGUID [4]
 
- Public Attributes inherited from ScriptedAI
Creatureme
 

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 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 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_anubarak_trialAI()

boss_anubarak_trial::boss_anubarak_trialAI::boss_anubarak_trialAI ( Creature pCreature)
inline
158 : ScriptedAI(pCreature), summons(me)
159 {
161 events.Reset();
162 bIntro = false;
163 bPhase3 = false;
164 me->ApplySpellImmune(0, IMMUNITY_ID, RAID_MODE(66193, 67855, 67856, 67857), true);
165 me->m_SightDistance = 90.0f; // for MoveInLineOfSight distance
166 }
events
Definition: boss_sartura.cpp:43
@ IMMUNITY_ID
Definition: SharedDefines.h:1400
Definition: ScriptedCreature.h:190
Creature * me
Definition: ScriptedCreature.h:280
const T & RAID_MODE(const T &normal10, const T &normal25) const
Definition: ScriptedCreature.h:404
float m_SightDistance
Definition: Creature.h:372
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType=SPELL_BLOCK_TYPE_ALL)
Definition: Unit.cpp:13346
Definition: InstanceScript.h:142
bool bIntro
Definition: boss_anubarak_trial.cpp:171
SummonList summons
Definition: boss_anubarak_trial.cpp:169
bool bPhase3
Definition: boss_anubarak_trial.cpp:172
InstanceScript * pInstance
Definition: boss_anubarak_trial.cpp:168

References Unit::ApplySpellImmune(), bIntro, bPhase3, WorldObject::GetInstanceScript(), IMMUNITY_ID, Creature::m_SightDistance, ScriptedAI::me, pInstance, and ScriptedAI::RAID_MODE().

Member Function Documentation

◆ CanAIAttack()

bool boss_anubarak_trial::boss_anubarak_trialAI::CanAIAttack ( Unit const *  target) const
inlineoverridevirtual

Reimplemented from UnitAI.

420 {
421 return target->GetEntry() != NPC_FROST_SPHERE;
422 }
@ NPC_FROST_SPHERE
Definition: boss_anubarak_trial.cpp:44

References Object::GetEntry(), and NPC_FROST_SPHERE.

◆ DoAction()

void boss_anubarak_trial::boss_anubarak_trialAI::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

195 {
196 switch (param)
197 {
198 case -1:
200 break;
201 }
202 }
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71

References SummonList::DespawnAll(), and summons.

◆ EnterEvadeMode()

void boss_anubarak_trial::boss_anubarak_trialAI::EnterEvadeMode ( EvadeReason  )
inlineoverridevirtual

Reimplemented from CreatureAI.

393 {
394 events.Reset();
397 if (pInstance)
399 }
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:230
@ TYPE_FAILED
Definition: trial_of_the_crusader.h:33
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:683
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53

References SummonList::DespawnAll(), ScriptedAI::me, pInstance, ZoneScript::SetData(), Unit::SetUnitFlag(), summons, TYPE_FAILED, and UNIT_FLAG_NON_ATTACKABLE.

◆ JustDied()

void boss_anubarak_trial::boss_anubarak_trialAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

378 {
379 events.Reset();
382 if (pInstance)
384 }
@ DONE
Definition: InstanceScript.h:60
@ SAY_DEATH
Definition: boss_anubarak_trial.cpp:37
@ TYPE_ANUBARAK
Definition: trial_of_the_crusader.h:44
Talk
Definition: hyjal.cpp:82

References SummonList::DespawnAll(), DONE, pInstance, SAY_DEATH, ZoneScript::SetData(), summons, and TYPE_ANUBARAK.

◆ JustEngagedWith()

void boss_anubarak_trial::boss_anubarak_trialAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

205 {
206 me->setActive(true);
207 events.Reset();
208 events.RescheduleEvent(EVENT_ENRAGE, 10min);
209 events.RescheduleEvent(EVENT_SPELL_FREEZING_SLASH, 7s, 15s);
210 events.RescheduleEvent(EVENT_SPELL_PENETRATING_COLD, 15s, 20s);
211 events.RescheduleEvent(EVENT_SUMMON_NERUBIAN, 5s, 8s);
212 events.RescheduleEvent(EVENT_SUBMERGE, 80s);
213 if (!IsHeroic())
214 events.RescheduleEvent(EVENT_RESPAWN_SPHERE, 4s);
215
216 for (ObjectGuid const& guid : summons)
217 if (pInstance)
218 if (Creature* c = pInstance->instance->GetCreature(guid))
219 {
220 c->GetMotionMaster()->MoveIdle();
221 c->StopMoving();
222 c->CastSpell(c, SPELL_SUBMERGE, false);
223 c->AI()->DoAction(1);
224 }
225 summons.clear();
226 for( uint8 i = 0; i < 4; ++i )
227 if (Creature* c = me->SummonCreature(NPC_BURROW, AnubLocs[i + 1]))
228 BurrowGUID[i] = c->GetGUID();
229 for( uint8 i = 0; i < 6; ++i )
231 SphereGUID[i] = c->GetGUID();
232
235 if (pInstance)
237 }
std::uint8_t uint8
Definition: Define.h:109
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ SPELL_SUBMERGE
Definition: boss_anubarak_trial.cpp:89
const Position AnubLocs[]
Definition: boss_anubarak_trial.cpp:51
@ EVENT_RESPAWN_SPHERE
Definition: boss_anubarak_trial.cpp:133
@ EVENT_SPELL_PENETRATING_COLD
Definition: boss_anubarak_trial.cpp:136
@ EVENT_ENRAGE
Definition: boss_anubarak_trial.cpp:134
@ EVENT_SUMMON_NERUBIAN
Definition: boss_anubarak_trial.cpp:137
@ EVENT_SPELL_FREEZING_SLASH
Definition: boss_anubarak_trial.cpp:135
@ EVENT_SUBMERGE
Definition: boss_anubarak_trial.cpp:138
@ NPC_BURROW
Definition: boss_anubarak_trial.cpp:45
@ SAY_AGGRO
Definition: boss_anubarak_trial.cpp:30
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition: CreatureAI.cpp:95
void clear()
Definition: ScriptedCreature.h:83
bool IsHeroic() const
Definition: ScriptedCreature.h:379
Definition: Creature.h:46
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:2355
void setActive(bool isActiveObject)
Definition: Object.cpp:1085
Definition: ObjectGuid.h:118
Map * instance
Definition: InstanceScript.h:148
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3314
ObjectGuid SphereGUID[6]
Definition: boss_anubarak_trial.cpp:173
ObjectGuid BurrowGUID[4]
Definition: boss_anubarak_trial.cpp:174

References AnubLocs, BurrowGUID, SummonList::clear(), CreatureAI::DoZoneInCombat(), EVENT_ENRAGE, EVENT_RESPAWN_SPHERE, EVENT_SPELL_FREEZING_SLASH, EVENT_SPELL_PENETRATING_COLD, EVENT_SUBMERGE, EVENT_SUMMON_NERUBIAN, Map::GetCreature(), IN_PROGRESS, InstanceScript::instance, ScriptedAI::IsHeroic(), ScriptedAI::me, NPC_BURROW, NPC_FROST_SPHERE, pInstance, SAY_AGGRO, WorldObject::setActive(), ZoneScript::SetData(), SPELL_SUBMERGE, SphereGUID, WorldObject::SummonCreature(), summons, and TYPE_ANUBARAK.

◆ JustReachedHome()

void boss_anubarak_trial::boss_anubarak_trialAI::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

240 {
241 me->setActive(false);
242 }

References ScriptedAI::me, and WorldObject::setActive().

◆ JustSummoned()

void boss_anubarak_trial::boss_anubarak_trialAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from ScriptedAI.

370 {
371 if (!summon)
372 return;
373
374 summons.Summon(summon);
375 }
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88

References SummonList::Summon(), and summons.

◆ KilledUnit()

void boss_anubarak_trial::boss_anubarak_trialAI::KilledUnit ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

387 {
388 if (who->IsPlayer())
390 }
@ SAY_KILL_PLAYER
Definition: boss_anubarak_trial.cpp:36
bool IsPlayer() const
Definition: Object.h:197

References Object::IsPlayer(), and SAY_KILL_PLAYER.

◆ MoveInLineOfSight()

void boss_anubarak_trial::boss_anubarak_trialAI::MoveInLineOfSight ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

402 {
403 if (!who->IsPlayer() || me->GetExactDistSq(who) > 6400.0f) // 80yd*80yd
404 return;
405
408
409 if (!bIntro)
410 {
412 if (!me->IsInCombat())
414 bIntro = true;
415 }
417 }
@ UNIT_STAND_STATE_STAND
Definition: UnitDefines.h:32
@ SAY_INTRO
Definition: boss_anubarak_trial.cpp:29
virtual void MoveInLineOfSight(Unit *)
Definition: CreatureAI.cpp:158
float GetExactDistSq(float x, float y, float z) const
Definition: Position.h:170
uint8 getStandState() const
Definition: Unit.h:982
void SetStandState(uint8 state)
Definition: Unit.cpp:16682
bool IsInCombat() const
Definition: Unit.h:820
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:684

References bIntro, Position::GetExactDistSq(), Unit::getStandState(), Unit::IsInCombat(), Object::IsPlayer(), ScriptedAI::me, CreatureAI::MoveInLineOfSight(), Unit::RemoveUnitFlag(), SAY_INTRO, Unit::SetStandState(), UNIT_FLAG_NON_ATTACKABLE, and UNIT_STAND_STATE_STAND.

◆ Reset()

void boss_anubarak_trial::boss_anubarak_trialAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

177 {
181 for( uint8 i = 0; i < 10; ++i )
182 {
183 float angle = rand_norm() * 2 * M_PI;
184 float dist = rand_norm() * 40.0f;
185 if (Creature* c = me->SummonCreature(NPC_SCARAB, AnubLocs[0].GetPositionX() + cos(angle) * dist, AnubLocs[0].GetPositionY() + std::sin(angle) * dist, AnubLocs[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
186 {
187 c->SetFaction(FACTION_PREY);
188 c->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
189 c->GetMotionMaster()->MoveRandom(15.0f);
190 }
191 }
192 }
double rand_norm()
Definition: Random.cpp:77
@ UNIT_STAND_STATE_SUBMERGED
Definition: UnitDefines.h:41
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition: Object.h:50
@ NPC_SCARAB
Definition: boss_anubarak_trial.cpp:47
@ FACTION_PREY
Definition: SharedDefines.h:199
float GetPositionX() const
Definition: Position.h:117

References AnubLocs, SummonList::DespawnAll(), FACTION_PREY, Position::GetPositionX(), ScriptedAI::me, NPC_SCARAB, rand_norm(), Unit::SetStandState(), Unit::SetUnitFlag(), WorldObject::SummonCreature(), summons, TEMPSUMMON_CORPSE_TIMED_DESPAWN, UNIT_FLAG_NON_ATTACKABLE, and UNIT_STAND_STATE_SUBMERGED.

◆ UpdateAI()

void boss_anubarak_trial::boss_anubarak_trialAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from ScriptedAI.

245 {
246 if (!UpdateVictim())
247 return;
248
249 events.Update(diff);
250
252 return;
253
255 {
256 bPhase3 = true;
257 events.CancelEvent(EVENT_SUBMERGE);
258 events.CancelEvent(EVENT_EMERGE);
259 events.CancelEvent(EVENT_EMERGE_2);
260 if (!IsHeroic())
261 events.CancelEvent(EVENT_SUMMON_NERUBIAN);
262 me->CastSpell((Unit*)nullptr, SPELL_LEECHING_SWARM, false);
265 return;
266 }
267
268 switch (events.ExecuteEvent())
269 {
270 case 0:
271 break;
272 case EVENT_ENRAGE:
273 {
274 me->CastSpell(me, SPELL_BERSERK, true);
275 }
276 break;
278 {
279 uint8 StartAt = urand(0, 5);
280 uint8 i = StartAt;
281 do
282 {
284 if (!c->HasAura(SPELL_FROST_SPHERE))
285 {
287 SphereGUID[i] = c->GetGUID();
288 break;
289 }
290 i = (i + 1) % 6;
291 } while( i != StartAt );
292 events.Repeat(4s);
293 }
294 break;
296 {
297 if (me->GetVictim())
299 events.Repeat(15s, 20s);
300 }
301 break;
303 {
305 events.Repeat(18s);
306 }
307 break;
309 {
311 events.Repeat(45s);
312 }
313 break;
314 case EVENT_SUBMERGE:
315 {
317 bool berserk = me->HasAura(SPELL_BERSERK);
319 if (berserk)
320 me->CastSpell(me, SPELL_BERSERK, true);
323 me->CastSpell(me, SPELL_SUBMERGE, false);
324 events.CancelEvent(EVENT_SUMMON_NERUBIAN);
327 events.RescheduleEvent(EVENT_EMERGE, 1min);
328 events.RescheduleEvent(EVENT_SPELL_SUMMON_SPIKE, 2500ms);
329 events.RescheduleEvent(EVENT_SUMMON_SCARAB, 3s);
330 }
331 break;
333 {
334 uint8 i = urand(0, 3);
337 events.Repeat(4s);
338 }
339 break;
340 case EVENT_EMERGE:
341 {
344 events.CancelEvent(EVENT_SUMMON_SCARAB);
345 events.RescheduleEvent(EVENT_EMERGE_2, 2s);
346 }
347 break;
348 case EVENT_EMERGE_2:
349 {
354 me->CastSpell(me, SPELL_EMERGE, false);
355 events.RescheduleEvent(EVENT_SUMMON_NERUBIAN, 5s, 8s);
356 events.RescheduleEvent(EVENT_SPELL_FREEZING_SLASH, 7s, 15s);
357 events.RescheduleEvent(EVENT_SPELL_PENETRATING_COLD, 15s, 20s);
358 events.RescheduleEvent(EVENT_SUBMERGE, 80s);
359 }
360 break;
363 break;
364 }
365
367 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ BASE_ATTACK
Definition: Unit.h:209
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
@ UNIT_FLAG_NOT_SELECTABLE
Definition: UnitDefines.h:254
@ SPELLVALUE_MAX_TARGETS
Definition: SpellDefines.h:118
@ SPELL_CLEAR_ALL_DEBUFFS
Definition: boss_anubarak_trial.cpp:92
@ SPELL_LEECHING_SWARM
Definition: boss_anubarak_trial.cpp:98
@ SPELL_FROST_SPHERE
Definition: boss_anubarak_trial.cpp:119
@ SPELL_SUMMON_BURROWER
Definition: boss_anubarak_trial.cpp:97
@ SPELL_EMERGE
Definition: boss_anubarak_trial.cpp:90
@ SPELL_SPIKE_TELE
Definition: boss_anubarak_trial.cpp:108
@ SPELL_FREEZING_SLASH
Definition: boss_anubarak_trial.cpp:94
@ SPELL_PENETRATING_COLD
Definition: boss_anubarak_trial.cpp:95
@ SPELL_SUMMON_SCARAB
Definition: boss_anubarak_trial.cpp:96
@ SPELL_SUMMON_SPIKE
Definition: boss_anubarak_trial.cpp:102
@ SPELL_BERSERK
Definition: boss_anubarak_trial.cpp:91
@ EVENT_EMERGE_2
Definition: boss_anubarak_trial.cpp:140
@ EVENT_EMERGE
Definition: boss_anubarak_trial.cpp:139
@ EVENT_SUMMON_SCARAB
Definition: boss_anubarak_trial.cpp:143
@ EVENT_SPELL_SUMMON_SPIKE
Definition: boss_anubarak_trial.cpp:141
@ NPC_SPIKE
Definition: boss_anubarak_trial.cpp:48
@ SAY_EMERGE
Definition: boss_anubarak_trial.cpp:33
@ EMOTE_BURROWER
Definition: boss_anubarak_trial.cpp:32
@ EMOTE_SUBMERGE
Definition: boss_anubarak_trial.cpp:31
@ EMOTE_LEECHING_SWARM
Definition: boss_anubarak_trial.cpp:35
@ SAY_LEECHING_SWARM
Definition: boss_anubarak_trial.cpp:34
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition: UnitAI.h:392
bool UpdateVictim()
Definition: CreatureAI.cpp:269
void DespawnEntry(uint32 entry)
Definition: ScriptedCreature.cpp:54
bool HealthBelowPct(uint32 pct) const
Definition: ScriptedCreature.h:364
Definition: Unit.h:630
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4758
bool HasUnitFlag(UnitFlags flags) const
Definition: Unit.h:682
void setAttackTimer(WeaponAttackType type, int32 time)
Definition: Unit.h:763
SpellCastResult CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1225
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5669
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:1168
Unit * GetVictim() const
Definition: Unit.h:789
bool HasUnitState(const uint32 f) const
Definition: Unit.h:673

References AnubLocs, BASE_ATTACK, bPhase3, BurrowGUID, Unit::CastCustomSpell(), Unit::CastSpell(), SummonList::DespawnEntry(), UnitAI::DoCastSelf(), UnitAI::DoMeleeAttackIfReady(), EMOTE_BURROWER, EMOTE_LEECHING_SWARM, EMOTE_SUBMERGE, EVENT_EMERGE, EVENT_EMERGE_2, EVENT_ENRAGE, EVENT_RESPAWN_SPHERE, EVENT_SPELL_FREEZING_SLASH, EVENT_SPELL_PENETRATING_COLD, EVENT_SPELL_SUMMON_SPIKE, EVENT_SUBMERGE, EVENT_SUMMON_NERUBIAN, EVENT_SUMMON_SCARAB, ObjectAccessor::GetCreature(), Unit::GetVictim(), Unit::HasAura(), Unit::HasUnitFlag(), Unit::HasUnitState(), ScriptedAI::HealthBelowPct(), ScriptedAI::IsHeroic(), ScriptedAI::me, NPC_FROST_SPHERE, NPC_SPIKE, ScriptedAI::RAID_MODE(), Unit::RemoveAura(), Unit::RemoveUnitFlag(), SAY_EMERGE, SAY_LEECHING_SWARM, Unit::setAttackTimer(), Unit::SetUnitFlag(), SPELL_BERSERK, SPELL_CLEAR_ALL_DEBUFFS, SPELL_EMERGE, SPELL_FREEZING_SLASH, SPELL_FROST_SPHERE, SPELL_LEECHING_SWARM, SPELL_PENETRATING_COLD, SPELL_SPIKE_TELE, SPELL_SUBMERGE, SPELL_SUMMON_BURROWER, SPELL_SUMMON_SCARAB, SPELL_SUMMON_SPIKE, SPELLVALUE_MAX_TARGETS, SphereGUID, WorldObject::SummonCreature(), summons, UNIT_FLAG_NOT_SELECTABLE, UNIT_STATE_CASTING, CreatureAI::UpdateVictim(), and urand().

Member Data Documentation

◆ bIntro

bool boss_anubarak_trial::boss_anubarak_trialAI::bIntro

◆ bPhase3

bool boss_anubarak_trial::boss_anubarak_trialAI::bPhase3

Referenced by boss_anubarak_trialAI(), and UpdateAI().

◆ BurrowGUID

ObjectGuid boss_anubarak_trial::boss_anubarak_trialAI::BurrowGUID[4]

Referenced by JustEngagedWith(), and UpdateAI().

◆ events

EventMap boss_anubarak_trial::boss_anubarak_trialAI::events

◆ pInstance

InstanceScript* boss_anubarak_trial::boss_anubarak_trialAI::pInstance

◆ SphereGUID

ObjectGuid boss_anubarak_trial::boss_anubarak_trialAI::SphereGUID[6]

Referenced by JustEngagedWith(), and UpdateAI().

◆ summons

SummonList boss_anubarak_trial::boss_anubarak_trialAI::summons