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)
 
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. More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
 ~BossAI () override
 
bool CanRespawn () override
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
 Called at any Damage from any attacker (before damage apply) More...
 
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() More...
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec)
 Executes a function once the creature reaches the defined health point percent. More...
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec)
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
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) 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
 
EventMap events
 
SummonList summons
 
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
126 {
128 }
@ BOSS_THADDIUS
Definition: naxxramas.h:38
Creature * me
Definition: ScriptedCreature.h:280
Definition: ScriptedCreature.h:457
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1192
bool ballLightningEnabled
Definition: boss_thaddius.cpp:136
SummonList summons
Definition: boss_thaddius.cpp:132
InstanceScript * pInstance
Definition: boss_thaddius.cpp:130

References WorldObject::GetInstanceScript(), ScriptedAI::me, and pInstance.

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:106
uint32 reviveTimer
Definition: boss_thaddius.cpp:134
uint32 summonTimer
Definition: boss_thaddius.cpp:133

References ACTION_SUMMON_DIED, reviveTimer, and summonTimer.

◆ JustDied()

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

Reimplemented from BossAI.

224 {
225 BossAI::JustDied(killer);
227 if (pInstance)
228 {
234 {
235 go->SetGoState(GO_STATE_ACTIVE);
236 }
237 }
238 }
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:690
@ DATA_THADDIUS_GATE
Definition: naxxramas.h:59
@ SAY_DEATH
Definition: boss_thaddius.cpp:47
@ SPELL_POSITIVE_POLARITY
Definition: boss_thaddius.cpp:84
@ SPELL_POSITIVE_CHARGE_STACK
Definition: boss_thaddius.cpp:81
@ SPELL_NEGATIVE_CHARGE_STACK
Definition: boss_thaddius.cpp:83
@ SPELL_NEGATIVE_POLARITY
Definition: boss_thaddius.cpp:85
Talk
Definition: hyjal.cpp:82
void JustDied(Unit *) override
Definition: ScriptedCreature.h:489
Definition: GameObject.h:121
Map * GetMap() const
Definition: Object.h:531
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:95
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:639
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3319

References DATA_THADDIUS_GATE, InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), Map::GetGameObject(), InstanceScript::GetGuidData(), WorldObject::GetMap(), GO_STATE_ACTIVE, BossAI::JustDied(), ScriptedAI::me, pInstance, 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 BossAI.

246 {
251 }
@ NPC_FEUGEN
Definition: naxxramas.h:138
@ NPC_STALAGG
Definition: naxxramas.h:137
void DoZoneInCombat(uint32 entry=0)
Definition: ScriptedCreature.cpp:40
void JustEngagedWith(Unit *) override
Called for reaction when initially engaged.
Definition: ScriptedCreature.h:487
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition: Creature.cpp:2806

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

◆ JustSummoned()

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

Reimplemented from BossAI.

241 {
242 summons.Summon(cr);
243 }
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88

References SummonList::Summon(), and summons.

◆ KilledUnit()

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

Reimplemented from ScriptedAI.

212 {
213 if (!who->IsPlayer())
214 return;
215
216 Talk(SAY_SLAY);
217 if (pInstance)
218 {
220 }
221 }
@ DATA_IMMORTAL_FAIL
Definition: naxxramas.h:74
@ SAY_SLAY
Definition: boss_thaddius.cpp:45
bool IsPlayer() const
Definition: Object.h:197
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:53

References DATA_IMMORTAL_FAIL, Object::IsPlayer(), pInstance, SAY_SLAY, and ZoneScript::SetData().

◆ Reset()

void boss_thaddius::boss_thaddiusAI::Reset ( )
inlineoverridevirtual

Reimplemented from BossAI.

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 {
188 go->SetGoState(GO_STATE_ACTIVE);
189 }
191 {
192 go->SetGoState(GO_STATE_ACTIVE);
193 }
194 if (pInstance)
195 {
197 {
199 {
200 go->SetGoState(GO_STATE_ACTIVE);
201 }
202 }
203 }
204
209 }
@ DONE
Definition: InstanceScript.h:60
@ UNIT_STATE_ROOT
Definition: UnitDefines.h:159
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:230
@ BOSS_GLUTH
Definition: naxxramas.h:31
@ GO_TESLA_COIL_LEFT
Definition: boss_thaddius.cpp:108
@ NPC_TESLA_COIL
Definition: boss_thaddius.cpp:110
@ GO_TESLA_COIL_RIGHT
Definition: boss_thaddius.cpp:109
@ SPELL_FEUGEN_CHAIN
Definition: boss_thaddius.cpp:69
@ SPELL_STALAGG_CHAIN
Definition: boss_thaddius.cpp:64
events
Definition: boss_sartura.cpp:43
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
void Reset() override
Definition: ScriptedCreature.h:486
Definition: Creature.h:46
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:339
void SetPosition(float x, float y, float z, float o)
Definition: Creature.cpp:3149
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
GameObject * FindNearestGameObject(uint32 entry, float range, bool onlySpawned=false) const
Definition: Object.cpp:2455
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition: Unit.cpp:17990
void RemoveAllAuras()
Definition: Unit.cpp:5290
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:683
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:235
uint32 resetTimer
Definition: boss_thaddius.cpp:135

References ballLightningEnabled, BOSS_GLUTH, DATA_THADDIUS_GATE, SummonList::DespawnAll(), DONE, InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), WorldObject::FindNearestGameObject(), InstanceScript::GetBossState(), Map::GetGameObject(), InstanceScript::GetGuidData(), Creature::GetHomePosition(), WorldObject::GetMap(), GO_STATE_ACTIVE, GO_TESLA_COIL_LEFT, GO_TESLA_COIL_RIGHT, ScriptedAI::me, NPC_FEUGEN, NPC_STALAGG, NPC_TESLA_COIL, pInstance, 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(), 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()

Reimplemented from BossAI.

254 {
255 if (resetTimer)
256 {
257 resetTimer += diff;
258 if (resetTimer > 1000)
259 {
260 resetTimer = 0;
262 }
263 return;
264 }
265 if (reviveTimer)
266 {
267 reviveTimer += diff;
268 if (reviveTimer >= 12000)
269 {
270 for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
271 {
272 if (Creature* cr = ObjectAccessor::GetCreature(*me, (*itr)))
273 {
274 if (cr->GetEntry() == NPC_TESLA_COIL)
275 {
276 cr->AI()->Talk(EMOTE_TESLA_OVERLOAD);
277 cr->CastSpell(me, SPELL_SHOCK_VISUAL, true);
278 }
279 }
280 }
281 reviveTimer = 0;
282 events.ScheduleEvent(EVENT_THADDIUS_INIT, 750ms);
283 }
284 return;
285 }
286
287 if (!UpdateVictim())
288 return;
289
290 events.Update(diff);
292 return;
293
294 if (summonTimer) // Revive
295 {
296 summonTimer += diff;
297 if (summonTimer >= 5000)
298 {
300 summonTimer = 0;
301 }
302 }
303
304 switch (events.ExecuteEvent())
305 {
307 {
310 for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
311 {
312 if (Creature* cr = ObjectAccessor::GetCreature(*me, (*itr)))
313 {
314 if (cr->GetEntry() == NPC_TESLA_COIL)
315 {
316 Unit::Kill(cr, cr);
317 }
318 }
319 }
321 {
322 go->SetGoState(GO_STATE_READY);
323 }
325 {
326 go->SetGoState(GO_STATE_READY);
327 }
329 events.ScheduleEvent(EVENT_THADDIUS_ENTER_COMBAT, 1s);
330 break;
331 }
337 events.ScheduleEvent(EVENT_THADDIUS_CHAIN_LIGHTNING, 14s);
338 events.ScheduleEvent(EVENT_THADDIUS_BERSERK, 6min);
339 events.ScheduleEvent(EVENT_THADDIUS_POLARITY_SHIFT, 30s);
340 events.ScheduleEvent(EVENT_ALLOW_BALL_LIGHTNING, 5s);
341 return;
343 me->CastSpell(me, SPELL_BERSERK, true);
344 break;
347 events.Repeat(15s);
348 break;
351 events.Repeat(30s);
352 break;
355 break;
356 }
357
359 {
361 }
362 else if (ballLightningEnabled)
363 {
364 if (Unit* target = SelectTarget(SelectTargetMethod::MaxThreat))
365 {
366 me->CastSpell(target, SPELL_BALL_LIGHTNING, false);
367 }
368 }
369 }
@ REACT_AGGRESSIVE
Definition: Unit.h:550
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
@ UNIT_STATE_STUNNED
Definition: UnitDefines.h:152
@ GO_STATE_READY
Definition: GameObjectData.h:691
@ SAY_AGGRO
Definition: boss_thaddius.cpp:44
@ EMOTE_TESLA_OVERLOAD
Definition: boss_thaddius.cpp:52
@ ACTION_RESTORE
Definition: boss_thaddius.cpp:107
@ SPELL_POLARITY_SHIFT
Definition: boss_thaddius.cpp:72
@ SPELL_BALL_LIGHTNING
Definition: boss_thaddius.cpp:73
@ SPELL_CHAIN_LIGHTNING_25
Definition: boss_thaddius.cpp:75
@ SPELL_SHOCK_VISUAL
Definition: boss_thaddius.cpp:59
@ SPELL_CHAIN_LIGHTNING_10
Definition: boss_thaddius.cpp:74
@ SPELL_BERSERK
Definition: boss_thaddius.cpp:76
@ SPELL_THADDIUS_SPAWN_STUN
Definition: boss_thaddius.cpp:78
@ SPELL_THADDIUS_VISUAL_LIGHTNING
Definition: boss_thaddius.cpp:77
@ EVENT_THADDIUS_ENTER_COMBAT
Definition: boss_thaddius.cpp:96
@ EVENT_THADDIUS_INIT
Definition: boss_thaddius.cpp:95
@ EVENT_THADDIUS_POLARITY_SHIFT
Definition: boss_thaddius.cpp:99
@ EVENT_ALLOW_BALL_LIGHTNING
Definition: boss_thaddius.cpp:100
@ EVENT_THADDIUS_CHAIN_LIGHTNING
Definition: boss_thaddius.cpp:97
@ EVENT_THADDIUS_BERSERK
Definition: boss_thaddius.cpp:98
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:213
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
bool UpdateVictim()
Definition: CreatureAI.cpp:269
iterator begin()
Definition: ScriptedCreature.h:48
StorageType::const_iterator const_iterator
Definition: ScriptedCreature.h:37
iterator end()
Definition: ScriptedCreature.h:58
void DoAction(int32 info, uint16 max=0)
Definition: ScriptedCreature.h:102
const T & RAID_MODE(const T &normal10, const T &normal25) const
Definition: ScriptedCreature.h:404
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition: Creature.h:97
Definition: Unit.h:630
static void Kill(Unit *killer, Unit *victim, bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition: Unit.cpp:17658
bool IsWithinMeleeRange(Unit const *obj, float dist=0.f) const
Definition: Unit.cpp: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:1168
Unit * GetVictim() const
Definition: Unit.h:789
bool HasUnitState(const uint32 f) const
Definition: Unit.h:673
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:684

References ACTION_RESTORE, ballLightningEnabled, SummonList::begin(), Unit::CastSpell(), SummonList::DoAction(), UnitAI::DoMeleeAttackIfReady(), EMOTE_TESLA_OVERLOAD, SummonList::end(), EVENT_ALLOW_BALL_LIGHTNING, EVENT_THADDIUS_BERSERK, EVENT_THADDIUS_CHAIN_LIGHTNING, EVENT_THADDIUS_ENTER_COMBAT, EVENT_THADDIUS_INIT, EVENT_THADDIUS_POLARITY_SHIFT, WorldObject::FindNearestGameObject(), ObjectAccessor::GetCreature(), Unit::GetVictim(), GO_STATE_READY, GO_TESLA_COIL_LEFT, GO_TESLA_COIL_RIGHT, Unit::HasUnitState(), Unit::IsWithinMeleeRange(), Unit::Kill(), ScriptedAI::me, NPC_TESLA_COIL, ScriptedAI::RAID_MODE(), REACT_AGGRESSIVE, Unit::RemoveAllAuras(), Unit::RemoveUnitFlag(), resetTimer, reviveTimer, SAY_AGGRO, UnitAI::SelectTarget(), Unit::SetControlled(), Creature::SetReactState(), SPELL_BALL_LIGHTNING, SPELL_BERSERK, SPELL_CHAIN_LIGHTNING_10, SPELL_CHAIN_LIGHTNING_25, SPELL_POLARITY_SHIFT, SPELL_SHOCK_VISUAL, SPELL_THADDIUS_SPAWN_STUN, SPELL_THADDIUS_VISUAL_LIGHTNING, summons, summonTimer, UNIT_FLAG_NON_ATTACKABLE, UNIT_STATE_CASTING, UNIT_STATE_STUNNED, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ ballLightningEnabled

bool boss_thaddius::boss_thaddiusAI::ballLightningEnabled

Referenced by Reset(), and UpdateAI().

◆ events

EventMap boss_thaddius::boss_thaddiusAI::events

◆ pInstance

InstanceScript* boss_thaddius::boss_thaddiusAI::pInstance

◆ resetTimer

uint32 boss_thaddius::boss_thaddiusAI::resetTimer {}

Referenced by Reset(), and UpdateAI().

◆ reviveTimer

uint32 boss_thaddius::boss_thaddiusAI::reviveTimer {}

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

◆ summons

SummonList boss_thaddius::boss_thaddiusAI::summons

◆ summonTimer

uint32 boss_thaddius::boss_thaddiusAI::summonTimer {}

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