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

Public Member Functions

 boss_thaddiusAI (Creature *c)
 
bool IsAnyPlayerInMeleeRange () const
 
void DoAction (int32 param) override
 
void Reset () override
 
void KilledUnit (Unit *who) override
 
void JustDied (Unit *killer) override
 
void JustSummoned (Creature *cr) override
 
void JustEngagedWith (Unit *who) override
 Called for reaction when initially engaged.
 
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 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 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
 

Public Attributes

uint32 summonTimer {}
 
uint32 reviveTimer {}
 
uint32 resetTimer {}
 
bool ballLightningEnabled
 
- 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
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_thaddiusAI()

boss_thaddius::boss_thaddiusAI::boss_thaddiusAI ( Creature c)
inlineexplicit
122 {}
Definition ScriptedCreature.h:482
@ BOSS_THADDIUS
Definition naxxramas.h:36
bool ballLightningEnabled
Definition boss_thaddius.cpp:127

Member Function Documentation

◆ DoAction()

void boss_thaddius::boss_thaddiusAI::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

139 {
140 if (param == ACTION_SUMMON_DIED)
141 {
142 if (summonTimer)
143 {
144 summonTimer = 0;
145 reviveTimer = 1;
146 return;
147 }
148 summonTimer = 1;
149 }
150 }
@ ACTION_SUMMON_DIED
Definition boss_thaddius.cpp:102
uint32 reviveTimer
Definition boss_thaddius.cpp:125
uint32 summonTimer
Definition boss_thaddius.cpp:124

References ACTION_SUMMON_DIED, reviveTimer, and summonTimer.

◆ IsAnyPlayerInMeleeRange()

bool boss_thaddius::boss_thaddiusAI::IsAnyPlayerInMeleeRange ( ) const
inline
130 {
131 for (auto const& ref : me->GetThreatMgr().GetThreatList())
132 if (Unit* target = ref->getTarget())
133 if (target->IsPlayer() && me->IsWithinMeleeRange(target))
134 return true;
135 return false;
136 }
ThreatMgr & GetThreatMgr()
Definition UnitAI.cpp:379
Definition Unit.h:655
Creature * me
Definition ScriptedCreature.h:281

References ThreatMgr::GetThreatList(), Unit::GetThreatMgr(), Unit::IsWithinMeleeRange(), and ScriptedAI::me.

Referenced by UpdateAI().

◆ JustDied()

void boss_thaddius::boss_thaddiusAI::JustDied ( Unit killer)
inlineoverridevirtual

Reimplemented from CreatureAI.

208 {
209 BossAI::JustDied(killer);
215 }
@ SAY_DEATH
Definition boss_thaddius.cpp:47
@ SPELL_POSITIVE_POLARITY
Definition boss_thaddius.cpp:81
@ SPELL_POSITIVE_CHARGE_STACK
Definition boss_thaddius.cpp:78
@ SPELL_NEGATIVE_CHARGE_STACK
Definition boss_thaddius.cpp:80
@ SPELL_NEGATIVE_POLARITY
Definition boss_thaddius.cpp:82
InstanceScript *const instance
Definition ScriptedCreature.h:489
void JustDied(Unit *) override
Definition ScriptedCreature.h:522
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition InstanceScript.cpp:683
Talk
Definition hyjal.cpp:82

References InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), BossAI::instance, BossAI::JustDied(), SAY_DEATH, SPELL_NEGATIVE_CHARGE_STACK, SPELL_NEGATIVE_POLARITY, SPELL_POSITIVE_CHARGE_STACK, and SPELL_POSITIVE_POLARITY.

◆ JustEngagedWith()

void boss_thaddius::boss_thaddiusAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from CreatureAI.

223 {
228 }
void JustEngagedWith(Unit *) override
Called for reaction when initially engaged.
Definition ScriptedCreature.h:520
SummonList summons
Definition ScriptedCreature.h:534
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2777
void DoZoneInCombat(uint32 entry=0)
Definition ScriptedCreature.cpp:41
@ NPC_FEUGEN
Definition naxxramas.h:166
@ NPC_STALAGG
Definition naxxramas.h:165

References SummonList::DoZoneInCombat(), BossAI::JustEngagedWith(), ScriptedAI::me, NPC_FEUGEN, NPC_STALAGG, Creature::SetInCombatWithZone(), and BossAI::summons.

◆ JustSummoned()

void boss_thaddius::boss_thaddiusAI::JustSummoned ( Creature cr)
inlineoverridevirtual

Reimplemented from CreatureAI.

218 {
219 summons.Summon(cr);
220 }
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88

References SummonList::Summon(), and BossAI::summons.

◆ KilledUnit()

void boss_thaddius::boss_thaddiusAI::KilledUnit ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

199 {
200 if (!who->IsPlayer())
201 return;
202
203 Talk(SAY_SLAY);
205 }
@ SAY_SLAY
Definition boss_thaddius.cpp:45
void StorePersistentData(uint32 index, uint32 data)
Definition InstanceScript.cpp:422
bool IsPlayer() const
Definition Object.h:200
@ PERSISTENT_DATA_IMMORTAL_FAIL
Definition naxxramas.h:87

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

◆ Reset()

void boss_thaddius::boss_thaddiusAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

153 {
155 events.Reset();
159 summonTimer = 0;
160 reviveTimer = 0;
161 resetTimer = 1;
163 ballLightningEnabled = false;
164
165 me->SummonCreature(NPC_STALAGG, 3450.45f, -2931.42f, 312.091f, 5.49779f);
166 me->SummonCreature(NPC_FEUGEN, 3508.14f, -2988.65f, 312.092f, 2.37365f);
167 if (Creature* cr = me->SummonCreature(NPC_TESLA_COIL, 3527.34f, -2951.56f, 318.75f, 0.0f))
168 {
169 cr->RemoveAllAuras();
170 cr->InterruptNonMeleeSpells(true);
171 cr->CastSpell(cr, SPELL_FEUGEN_CHAIN, false);
172 cr->SetDisableGravity(true);
173 cr->SetImmuneToPC(false);
174 cr->SetControlled(true, UNIT_STATE_ROOT);
175 }
176 if (Creature* cr = me->SummonCreature(NPC_TESLA_COIL, 3487.04f, -2911.68f, 318.75f, 0.0f))
177 {
178 cr->RemoveAllAuras();
179 cr->InterruptNonMeleeSpells(true);
180 cr->CastSpell(cr, SPELL_STALAGG_CHAIN, false);
181 cr->SetDisableGravity(true);
182 cr->SetImmuneToPC(false);
183 cr->SetControlled(true, UNIT_STATE_ROOT);
184 }
185
187 go->SetGoState(GO_STATE_ACTIVE);
188
190 go->SetGoState(GO_STATE_ACTIVE);
191
196 }
@ GO_STATE_ACTIVE
Definition GameObjectData.h:705
@ UNIT_STATE_ROOT
Definition UnitDefines.h:180
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:255
events
Definition boss_sartura.cpp:43
@ GO_TESLA_COIL_LEFT
Definition boss_thaddius.cpp:104
@ NPC_TESLA_COIL
Definition boss_thaddius.cpp:106
@ GO_TESLA_COIL_RIGHT
Definition boss_thaddius.cpp:105
@ SPELL_FEUGEN_CHAIN
Definition boss_thaddius.cpp:67
@ SPELL_STALAGG_CHAIN
Definition boss_thaddius.cpp:63
void Reset() override
Definition ScriptedCreature.h:519
Definition Creature.h:47
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition Creature.h:340
void SetPosition(float x, float y, float z, float o)
Definition Creature.cpp:3115
Definition GameObject.h:120
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:72
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition Unit.cpp:18305
void RemoveAllAuras()
Definition Unit.cpp:5449
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:738
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:2352
GameObject * FindNearestGameObject(uint32 entry, float range, bool onlySpawned=false) const
Definition Object.cpp:2452
uint32 resetTimer
Definition boss_thaddius.cpp:126

References ballLightningEnabled, SummonList::DespawnAll(), InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), WorldObject::FindNearestGameObject(), Creature::GetHomePosition(), GO_STATE_ACTIVE, GO_TESLA_COIL_LEFT, GO_TESLA_COIL_RIGHT, BossAI::instance, ScriptedAI::me, NPC_FEUGEN, NPC_STALAGG, NPC_TESLA_COIL, Unit::RemoveAllAuras(), BossAI::Reset(), resetTimer, reviveTimer, Unit::SetControlled(), Creature::SetPosition(), Unit::SetUnitFlag(), SPELL_FEUGEN_CHAIN, SPELL_NEGATIVE_CHARGE_STACK, SPELL_NEGATIVE_POLARITY, SPELL_POSITIVE_CHARGE_STACK, SPELL_POSITIVE_POLARITY, SPELL_STALAGG_CHAIN, WorldObject::SummonCreature(), BossAI::summons, summonTimer, UNIT_FLAG_NON_ATTACKABLE, and UNIT_STATE_ROOT.

◆ UpdateAI()

void boss_thaddius::boss_thaddiusAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

231 {
232 if (resetTimer)
233 {
234 resetTimer += diff;
235 if (resetTimer > 1000)
236 {
237 resetTimer = 0;
239 }
240 return;
241 }
242 if (reviveTimer)
243 {
244 reviveTimer += diff;
245 if (reviveTimer >= 12000)
246 {
247 summons.DoForAllSummons([this](WorldObject* summon)
248 {
249 if (summon->GetEntry() == NPC_TESLA_COIL)
250 {
251 summon->ToCreature()->AI()->Talk(EMOTE_TESLA_OVERLOAD);
252 summon->ToCreature()->CastSpell(me, SPELL_SHOCK_VISUAL, true);
253 }
254 });
255
256 reviveTimer = 0;
257 events.ScheduleEvent(EVENT_THADDIUS_INIT, 750ms);
258 }
259 return;
260 }
261
262 if (!UpdateVictim())
263 return;
264
265 events.Update(diff);
266
267 if (summonTimer) // Revive
268 {
269 summonTimer += diff;
270 if (summonTimer >= 5000)
271 {
273 summonTimer = 0;
274 }
275 }
276
277 switch (events.ExecuteEvent())
278 {
280 {
284 {
285 if (summon->GetEntry() == NPC_TESLA_COIL)
286 summon->ToCreature()->KillSelf();
287 });
288
290 go->SetGoState(GO_STATE_READY);
291
293 go->SetGoState(GO_STATE_READY);
294
296 events.ScheduleEvent(EVENT_THADDIUS_ENTER_COMBAT, 1s);
297 break;
298 }
305 events.ScheduleEvent(EVENT_THADDIUS_CHAIN_LIGHTNING, 14s);
306 events.ScheduleEvent(EVENT_THADDIUS_POLARITY_SHIFT, 20s);
307 events.ScheduleEvent(EVENT_ALLOW_BALL_LIGHTNING, 5s);
309 return;
312 {
313 events.Repeat(1s);
314 ballLightningEnabled = false;
315 return;
316 }
317
319 events.ScheduleEvent(EVENT_ALLOW_BALL_LIGHTNING, 1s);
320 events.Repeat(15s);
321 break;
324 {
325 events.Repeat(1s);
326 ballLightningEnabled = false;
327 return;
328 }
329
331 events.ScheduleEvent(EVENT_ALLOW_BALL_LIGHTNING, 3s);
332 events.Repeat(30s);
333 break;
336 break;
337 }
338
343 me->CastSpell(target, SPELL_BALL_LIGHTNING, false);
344 }
@ GO_STATE_READY
Definition GameObjectData.h:706
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
@ UNIT_STATE_STUNNED
Definition UnitDefines.h:173
@ REACT_AGGRESSIVE
Definition Unit.h:557
@ SAY_AGGRO
Definition boss_thaddius.cpp:44
@ ACTION_RESTORE
Definition boss_thaddius.cpp:103
@ SPELL_POLARITY_SHIFT
Definition boss_thaddius.cpp:70
@ SPELL_BALL_LIGHTNING
Definition boss_thaddius.cpp:71
@ SPELL_CHAIN_LIGHTNING
Definition boss_thaddius.cpp:72
@ SPELL_BERSERK
Definition boss_thaddius.cpp:73
@ SPELL_THADDIUS_SPAWN_STUN
Definition boss_thaddius.cpp:75
@ SPELL_THADDIUS_VISUAL_LIGHTNING
Definition boss_thaddius.cpp:74
@ EVENT_THADDIUS_ENTER_COMBAT
Definition boss_thaddius.cpp:93
@ EVENT_THADDIUS_INIT
Definition boss_thaddius.cpp:92
@ EVENT_THADDIUS_POLARITY_SHIFT
Definition boss_thaddius.cpp:95
@ EVENT_ALLOW_BALL_LIGHTNING
Definition boss_thaddius.cpp:96
@ EVENT_THADDIUS_CHAIN_LIGHTNING
Definition boss_thaddius.cpp:94
void ScheduleEnrageTimer(uint32 spellId, Milliseconds timer, uint8 textId=0)
Definition ScriptedCreature.cpp:831
bool UpdateVictim()
Definition CreatureAI.cpp:277
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:99
uint32 GetEntry() const
Definition Object.h:116
Creature * ToCreature()
Definition Object.h:205
void DoForAllSummons(std::function< void(WorldObject *)> exec)
Definition ScriptedCreature.h:140
void DoAction(int32 info, uint16 max=0)
Definition ScriptedCreature.h:102
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:284
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 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:1194
bool HasUnitState(const uint32 f) const
Definition Unit.h:726
void KillSelf(bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition Unit.h:1219
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:739
Definition Object.h:471
bool IsAnyPlayerInMeleeRange() const
Definition boss_thaddius.cpp:129

References ACTION_RESTORE, ballLightningEnabled, Unit::CastSpell(), SummonList::DoAction(), UnitAI::DoCastAOE(), UnitAI::DoCastSelf(), UnitAI::DoCastVictim(), SummonList::DoForAllSummons(), UnitAI::DoMeleeAttackIfReady(), EVENT_ALLOW_BALL_LIGHTNING, EVENT_THADDIUS_CHAIN_LIGHTNING, EVENT_THADDIUS_ENTER_COMBAT, EVENT_THADDIUS_INIT, EVENT_THADDIUS_POLARITY_SHIFT, WorldObject::FindNearestGameObject(), Object::GetEntry(), GO_STATE_READY, GO_TESLA_COIL_LEFT, GO_TESLA_COIL_RIGHT, Unit::HasUnitState(), IsAnyPlayerInMeleeRange(), Unit::KillSelf(), MaxThreat, ScriptedAI::me, NPC_TESLA_COIL, REACT_AGGRESSIVE, Unit::RemoveAllAuras(), Unit::RemoveUnitFlag(), resetTimer, reviveTimer, SAY_AGGRO, BossAI::ScheduleEnrageTimer(), UnitAI::SelectTarget(), Unit::SetControlled(), Creature::SetReactState(), SPELL_BALL_LIGHTNING, SPELL_BERSERK, SPELL_CHAIN_LIGHTNING, SPELL_POLARITY_SHIFT, SPELL_THADDIUS_SPAWN_STUN, SPELL_THADDIUS_VISUAL_LIGHTNING, BossAI::summons, summonTimer, Object::ToCreature(), UNIT_FLAG_NON_ATTACKABLE, UNIT_STATE_CASTING, UNIT_STATE_ROOT, UNIT_STATE_STUNNED, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ ballLightningEnabled

bool boss_thaddius::boss_thaddiusAI::ballLightningEnabled

Referenced by Reset(), and UpdateAI().

◆ resetTimer

uint32 boss_thaddius::boss_thaddiusAI::resetTimer {}
126{};

Referenced by Reset(), and UpdateAI().

◆ reviveTimer

uint32 boss_thaddius::boss_thaddiusAI::reviveTimer {}
125{};

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

◆ summonTimer

uint32 boss_thaddius::boss_thaddiusAI::summonTimer {}
124{};

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


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