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

Public Member Functions

 boss_maexxnaAI (Creature *c)
 
bool IsInRoom ()
 
void JustEngagedWith (Unit *who) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void JustSummoned (Creature *cr) override
 
void KilledUnit (Unit *who) override
 
void DoCastWebWrap ()
 
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 OnSpellCast (SpellInfo const *spell) override
 
void OnChannelFinished (SpellInfo const *spell) override
 
void OnSpellFailed (SpellInfo const *spell) override
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SummonedCreatureDespawnAll () override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
 Executes a function once the creature reaches the defined health point percent.
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
 
void ProcessHealthCheck ()
 
void ScheduleEnrageTimer (uint32 spellId, Milliseconds timer, uint8 textId=0)
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER) override
 
void JustDied (Unit *) override
 
void JustReachedHome () override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (Position const *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0ms, uint32 uniqueId=0)
 
void ScheduleUniqueTimedEvent (Milliseconds timer, std::function< void()> exec, uint32 uniqueId)
 
bool HealthBelowPct (uint32 pct) const
 
bool HealthAbovePct (uint32 pct) const
 
SpellInfo const * SelectSpell (Unit *target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect)
 
void SetEquipmentSlots (bool loadDefault, int32 mainHand=EQUIP_NO_CHANGE, int32 offHand=EQUIP_NO_CHANGE, int32 ranged=EQUIP_NO_CHANGE)
 
virtual bool CheckEvadeIfOutOfCombatArea () const
 
bool IsHeroic () const
 
Difficulty GetDifficulty () const
 
bool Is25ManRaid () const
 
template<class T >
T const & DUNGEON_MODE (T const &normal5, T const &heroic10) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25, T const &heroic10, T const &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool IsEscortNPC (bool=true) const
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ==================
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields =======================================
 
virtual bool BeforeSpellClick (Unit *)
 
virtual void OnSpellClick (Unit *, bool &)
 
virtual bool CanSeeAlways (WorldObject const *)
 
virtual bool CanBeSeen (Player const *)
 
virtual bool CanAlwaysBeDetectable (WorldObject const *)
 
virtual void PetStopAttack ()
 
int32 VisualizeBoundary (uint32 duration, Unit *owner=nullptr, bool fill=false, bool checkZ=false) const
 
virtual bool CheckInRoom ()
 
CreatureBoundary const * GetBoundary () const
 
void SetBoundary (CreatureBoundary const *boundary, bool negativeBoundaries=false)
 
bool IsInBoundary (Position const *who=nullptr) const
 
virtual void CalculateThreat (Unit *, float &, SpellInfo const *)
 
virtual bool OnTeleportUnreacheablePlayer (Player *)
 
virtual void OnAuraRemove (AuraApplication *, AuraRemoveMode)
 
virtual void DistancingStarted ()
 
virtual void DistancingEnded ()
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
UnitSelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
UnitSelectTarget (SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 Select the best (up to) <num> targets (in <targetType> order) from the threat list that fulfill the following:
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
virtual void 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, int32 aura=0)
 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
 

Public Attributes

GuidList wraps
 
- Public Attributes inherited from BossAI
float callForHelpRange
 
InstanceScript *const instance
 
- 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 BossAI
void _Reset ()
 
void _JustEngagedWith ()
 
void _JustDied ()
 
void _JustReachedHome ()
 
void _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
void TeleportCheaters ()
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from BossAI
SummonList summons
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_maexxnaAI()

boss_maexxna::boss_maexxnaAI::boss_maexxnaAI ( Creature c)
inlineexplicit
104 : BossAI(c, BOSS_MAEXXNA)
105 {}
Definition ScriptedCreature.h:485
@ BOSS_MAEXXNA
Definition naxxramas.h:35

Member Function Documentation

◆ DoCastWebWrap()

void boss_maexxna::boss_maexxnaAI::DoCastWebWrap ( )
inline
151 {
152 std::list<Unit*> candidates;
154
155 std::vector<uint32> positions {0, 1, 2, 3, 4, 5, 6};
157
158 if (candidates.empty())
159 return;
160
161 for (int i = 0; i < RAID_MODE(1, 2) ; i++)
162 {
163 if (candidates.empty())
164 break;
165 Position const& randomPos = PosWrap[positions[i]];
166
167 auto itr = candidates.begin();
168
169 if (candidates.size() > 1)
170 std::advance(itr, urand(0, candidates.size() - 1));
171
172 Unit *target = *itr;
173 candidates.erase(itr);
174
175 float dx = randomPos.GetPositionX() - target->GetPositionX();
176 float dy = randomPos.GetPositionY() - target->GetPositionY();
177 float distXY = std::hypotf(dx, dy);
178
179 // smooth knockback arc that avoids the ceiling
180 float horizontalSpeed = distXY / 1.5f;
181 float verticalSpeed = 28.0f;
182 if (distXY <= 10.0f)
183 verticalSpeed = 12.0f;
184 else if (distXY <= 20.0f)
185 verticalSpeed = 16.0f;
186 else if (distXY <= 30.0f)
187 verticalSpeed = 20.0f;
188 else if (distXY <= 40.0f)
189 verticalSpeed = 24.0f;
190
191 target->KnockbackFrom(randomPos.GetPositionX(), randomPos.GetPositionY(), -horizontalSpeed, verticalSpeed);
192 me->CastSpell(target, SPELL_WEB_WRAP_PACIFY_5, true); // pacify silence for 5 seconds
193
194 wraps.push_back(target->GetGUID());
195 }
196 events.ScheduleEvent(EVENT_WEB_WRAP_APPLY_STUN, 2s);
197 }
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
const Position positions[MAX_SUMMONS]
Definition boss_lurker_below.cpp:57
const Position PosWrap[7]
Definition boss_maexxna.cpp:63
@ SPELL_WEB_WRAP_PACIFY_5
Definition boss_maexxna.cpp:36
@ EVENT_WEB_WRAP_APPLY_STUN
Definition boss_maexxna.cpp:47
events
Definition boss_sartura.cpp:43
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:114
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 f...
Definition UnitAI.cpp:117
Definition Unit.h:665
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:1361
void KnockbackFrom(float x, float y, float speedXY, float speedZ)
Definition Unit.cpp:15385
void RandomShuffle(C &container)
Definition Containers.h:230
Definition Position.h:27
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
Creature * me
Definition ScriptedCreature.h:281
T const & RAID_MODE(T const &normal10, T const &normal25) const
Definition ScriptedCreature.h:408
Definition boss_maexxna.cpp:75
GuidList wraps
Definition boss_maexxna.cpp:107

References Unit::CastSpell(), EVENT_WEB_WRAP_APPLY_STUN, Object::GetGUID(), Position::GetPositionX(), Position::GetPositionY(), Unit::KnockbackFrom(), ScriptedAI::me, positions, PosWrap, ScriptedAI::RAID_MODE(), Random, Acore::Containers::RandomShuffle(), UnitAI::SelectTargetList(), SPELL_WEB_WRAP_PACIFY_5, urand(), and wraps.

Referenced by UpdateAI().

◆ IsInRoom()

bool boss_maexxna::boss_maexxnaAI::IsInRoom ( )
inline
110 {
111 if (me->GetExactDist(3486.6f, -3890.6f, 291.8f) > 100.0f)
112 {
114 return false;
115 }
116 return true;
117 }
void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER) override
Definition ScriptedCreature.h:526
float GetExactDist(float x, float y, float z) const
Definition Position.h:182

References BossAI::EnterEvadeMode(), Position::GetExactDist(), and ScriptedAI::me.

Referenced by UpdateAI().

◆ JustEngagedWith()

void boss_maexxna::boss_maexxnaAI::JustEngagedWith ( Unit )
inlineoverridevirtual

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

Reimplemented from CreatureAI.

120 {
123 events.ScheduleEvent(EVENT_WEB_WRAP, 20s);
124 events.ScheduleEvent(EVENT_WEB_SPRAY, 40s);
125 events.ScheduleEvent(EVENT_POISON_SHOCK, 10s);
126 events.ScheduleEvent(EVENT_NECROTIC_POISON, 5s);
127 events.ScheduleEvent(EVENT_HEALTH_CHECK, 1s);
128 events.ScheduleEvent(EVENT_SUMMON_SPIDERLINGS, 30s);
129 }
@ EVENT_POISON_SHOCK
Definition boss_maexxna.cpp:42
@ EVENT_SUMMON_SPIDERLINGS
Definition boss_maexxna.cpp:46
@ EVENT_WEB_SPRAY
Definition boss_maexxna.cpp:41
@ EVENT_NECROTIC_POISON
Definition boss_maexxna.cpp:43
@ EVENT_HEALTH_CHECK
Definition boss_maexxna.cpp:45
@ EVENT_WEB_WRAP
Definition boss_maexxna.cpp:44
void JustEngagedWith(Unit *) override
Called for reaction when initially engaged - this happens after JustEnteredCombat.
Definition ScriptedCreature.h:525
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2863

References EVENT_HEALTH_CHECK, EVENT_NECROTIC_POISON, EVENT_POISON_SHOCK, EVENT_SUMMON_SPIDERLINGS, EVENT_WEB_SPRAY, EVENT_WEB_WRAP, BossAI::JustEngagedWith(), ScriptedAI::me, and Creature::SetInCombatWithZone().

◆ JustSummoned()

void boss_maexxna::boss_maexxnaAI::JustSummoned ( Creature cr)
inlineoverridevirtual

Reimplemented from CreatureAI.

132 {
133 if (cr->GetEntry() == NPC_MAEXXNA_SPIDERLING)
134 {
137 {
138 cr->AI()->AttackStart(target);
139 }
140 }
141 summons.Summon(cr);
142 }
@ NPC_MAEXXNA_SPIDERLING
Definition boss_maexxna.cpp:60
SummonList summons
Definition ScriptedCreature.h:539
CreatureAI * AI() const
Definition Creature.h:144
uint32 GetEntry() const
Definition Object.h:117
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:112
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:29

References Creature::AI(), UnitAI::AttackStart(), Object::GetEntry(), NPC_MAEXXNA_SPIDERLING, Random, UnitAI::SelectTarget(), Creature::SetInCombatWithZone(), SummonList::Summon(), and BossAI::summons.

◆ KilledUnit()

void boss_maexxna::boss_maexxnaAI::KilledUnit ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

145 {
146 if (who->IsPlayer())
148 }
InstanceScript *const instance
Definition ScriptedCreature.h:492
void StorePersistentData(uint32 index, uint32 data)
Definition InstanceScript.cpp:440
bool IsPlayer() const
Definition Object.h:201
@ PERSISTENT_DATA_IMMORTAL_FAIL
Definition naxxramas.h:87

References BossAI::instance, Object::IsPlayer(), PERSISTENT_DATA_IMMORTAL_FAIL, and InstanceScript::StorePersistentData().

◆ UpdateAI()

void boss_maexxna::boss_maexxnaAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

200 {
201 if (!IsInRoom())
202 return;
203
204 if (!UpdateVictim())
205 return;
206
207 events.Update(diff);
209 return;
210
211 switch (events.ExecuteEvent())
212 {
213 case EVENT_WEB_SPRAY:
216 events.Repeat(40s);
217 break;
220 events.Repeat(10s);
221 break;
224 events.Repeat(30s);
225 break;
228 for (uint8 i = 0; i < 8; ++i)
229 {
231 }
232 events.Repeat(40s);
233 break;
235 if (me->GetHealthPct() < 30)
236 {
237 me->CastSpell(me, SPELL_FRENZY, true);
238 break;
239 }
240 events.Repeat(1s);
241 break;
242 case EVENT_WEB_WRAP:
245 events.Repeat(40s);
246 break;
248 {
249 for (auto& p : wraps)
250 {
251 if (Player* player = ObjectAccessor::GetPlayer(*me, p))
252 {
253 player->CastSpell(player, SPELL_WEB_WRAP_STUN, true);
254 }
255 }
256 wraps.clear();
257 break;
258 }
259 }
261 }
std::uint8_t uint8
Definition Define.h:109
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ EMOTE_WEB_WRAP
Definition boss_maexxna.cpp:53
@ EMOTE_WEB_SPRAY
Definition boss_maexxna.cpp:54
@ EMOTE_SPIDERS
Definition boss_maexxna.cpp:52
@ SPELL_WEB_WRAP_STUN
Definition boss_maexxna.cpp:33
@ SPELL_POISON_SHOCK
Definition boss_maexxna.cpp:30
@ SPELL_NECROTIC_POISON
Definition boss_maexxna.cpp:31
@ SPELL_FRENZY
Definition boss_maexxna.cpp:32
@ SPELL_WEB_SPRAY
Definition boss_maexxna.cpp:29
bool UpdateVictim()
Definition CreatureAI.cpp:350
Definition Player.h:1086
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:41
float GetHealthPct() const
Definition Unit.h:1111
Unit * GetVictim() const
Definition Unit.h:904
bool HasUnitState(const uint32 f) const
Definition Unit.h:737
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2448
Talk
Definition hyjal.cpp:82
Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:244
float GetPositionZ() const
Definition Position.h:123
float GetOrientation() const
Definition Position.h:124
void DoCastWebWrap()
Definition boss_maexxna.cpp:150
bool IsInRoom()
Definition boss_maexxna.cpp:109

References Unit::CastSpell(), DoCastWebWrap(), UnitAI::DoMeleeAttackIfReady(), EMOTE_SPIDERS, EMOTE_WEB_SPRAY, EMOTE_WEB_WRAP, EVENT_HEALTH_CHECK, EVENT_NECROTIC_POISON, EVENT_POISON_SHOCK, EVENT_SUMMON_SPIDERLINGS, EVENT_WEB_SPRAY, EVENT_WEB_WRAP, EVENT_WEB_WRAP_APPLY_STUN, Unit::GetHealthPct(), Position::GetOrientation(), ObjectAccessor::GetPlayer(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::GetVictim(), Unit::HasUnitState(), IsInRoom(), ScriptedAI::me, NPC_MAEXXNA_SPIDERLING, SPELL_FRENZY, SPELL_NECROTIC_POISON, SPELL_POISON_SHOCK, SPELL_WEB_SPRAY, SPELL_WEB_WRAP_STUN, WorldObject::SummonCreature(), UNIT_STATE_CASTING, CreatureAI::UpdateVictim(), and wraps.

Member Data Documentation

◆ wraps

GuidList boss_maexxna::boss_maexxnaAI::wraps

Referenced by DoCastWebWrap(), and UpdateAI().


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