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

Public Member Functions

 boss_thaddius_summonAI (Creature *c)
 
void Reset () override
 
void EnterEvadeMode (EvadeReason why) override
 
void JustEngagedWith (Unit *pWho) override
 Called for reaction when initially engaged. More...
 
void DoAction (int32 param) override
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *who) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
- 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
 
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=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)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon. More...
 
 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
 
uint32 pullTimer {}
 
uint32 visualTimer {}
 
bool overload
 
ObjectGuid myCoil
 
- 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_thaddius_summonAI()

boss_thaddius_summon::boss_thaddius_summonAI::boss_thaddius_summonAI ( Creature c)
inlineexplicit
385 : ScriptedAI(c)
386 {
388 overload = false;
389 }
Definition: ScriptedCreature.h:190
Creature * me
Definition: ScriptedCreature.h:280
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
InstanceScript * pInstance
Definition: boss_thaddius.cpp:391
bool overload
Definition: boss_thaddius.cpp:395

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

Member Function Documentation

◆ DoAction()

void boss_thaddius_summon::boss_thaddius_summonAI::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

457 {
458 if (param == ACTION_MAGNETIC_PULL)
459 {
460 pullTimer = 1;
462 }
463 else if (param == ACTION_RESTORE)
464 {
465 if (!me->IsAlive())
466 {
467 me->Respawn();
470 }
471 else
472 {
474 }
475 }
476 }
Talk
Definition: hyjal.cpp:82
@ NPC_STALAGG
Definition: naxxramas.h:136
@ EMOTE_FEUG_REVIVE
Definition: boss_thaddius.cpp:40
@ EMOTE_STAL_REVIVE
Definition: boss_thaddius.cpp:33
@ ACTION_RESTORE
Definition: boss_thaddius.cpp:107
@ ACTION_MAGNETIC_PULL
Definition: boss_thaddius.cpp:105
@ UNIT_STATE_STUNNED
Definition: UnitDefines.h:152
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition: Creature.cpp:2811
void Respawn(bool force=false)
Definition: Creature.cpp:2035
uint32 GetEntry() const
Definition: Object.h:115
uint32 GetMaxHealth() const
Definition: Unit.h:1030
bool IsAlive() const
Definition: Unit.h:1654
void SetHealth(uint32 val)
Definition: Unit.cpp:15478
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition: Unit.cpp:18034
uint32 pullTimer
Definition: boss_thaddius.cpp:393

References ACTION_MAGNETIC_PULL, ACTION_RESTORE, EMOTE_FEUG_REVIVE, EMOTE_STAL_REVIVE, Object::GetEntry(), Unit::GetMaxHealth(), Unit::IsAlive(), ScriptedAI::me, NPC_STALAGG, pullTimer, Creature::Respawn(), Unit::SetControlled(), Unit::SetHealth(), Creature::SetInCombatWithZone(), and UNIT_STATE_STUNNED.

Referenced by UpdateAI().

◆ EnterEvadeMode()

void boss_thaddius_summon::boss_thaddius_summonAI::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

414 {
417 }
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:208

References CreatureAI::EnterEvadeMode(), ScriptedAI::me, Unit::SetControlled(), and UNIT_STATE_STUNNED.

◆ JustDied()

void boss_thaddius_summon::boss_thaddius_summonAI::JustDied ( Unit )
inlineoverridevirtual

Reimplemented from ScriptedAI.

479 {
482 if (pInstance)
483 {
485 {
486 cr->AI()->DoAction(ACTION_SUMMON_DIED);
487 }
488 }
489 }
@ DATA_THADDIUS_BOSS
Definition: naxxramas.h:55
@ EMOTE_FEUG_DEATH
Definition: boss_thaddius.cpp:39
@ SAY_STAL_DEATH
Definition: boss_thaddius.cpp:31
@ SAY_FEUG_DEATH
Definition: boss_thaddius.cpp:38
@ EMOTE_STAL_DEATH
Definition: boss_thaddius.cpp:32
@ ACTION_SUMMON_DIED
Definition: boss_thaddius.cpp:106
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
Definition: Creature.h:43
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:98

References ACTION_SUMMON_DIED, DATA_THADDIUS_BOSS, EMOTE_FEUG_DEATH, EMOTE_STAL_DEATH, ObjectAccessor::GetCreature(), Object::GetEntry(), InstanceScript::GetGuidData(), ScriptedAI::me, NPC_STALAGG, pInstance, SAY_FEUG_DEATH, and SAY_STAL_DEATH.

◆ JustEngagedWith()

void boss_thaddius_summon::boss_thaddius_summonAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

420 {
422 if (Creature* cr = me->FindNearestCreature(NPC_TESLA_COIL, 150.f, true))
423 {
424 myCoil = cr->GetGUID();
425 }
426 if (me->GetEntry() == NPC_STALAGG)
427 {
428 events.ScheduleEvent(EVENT_MINION_POWER_SURGE, 10s);
430 }
431 else
432 {
433 events.ScheduleEvent(EVENT_MINION_STATIC_FIELD, 5s);
435 }
436 events.ScheduleEvent(EVENT_MINION_CHECK_DISTANCE, 5s);
437
438 if (me->GetEntry() == NPC_STALAGG) // This event needs synchronisation, called for stalagg only
439 {
440 events.ScheduleEvent(EVENT_MINION_MAGNETIC_PULL, 20s);
441 }
442 if (pInstance)
443 {
445 {
446 go->SetGoState(GO_STATE_READY);
447 }
449 {
450 cr->AI()->AttackStart(pWho);
451 cr->AddThreat(pWho, 10.0f);
452 }
453 }
454 }
events
Definition: boss_sartura.cpp:43
@ DATA_THADDIUS_GATE
Definition: naxxramas.h:58
@ SAY_STAL_AGGRO
Definition: boss_thaddius.cpp:29
@ SAY_FEUG_AGGRO
Definition: boss_thaddius.cpp:36
@ NPC_TESLA_COIL
Definition: boss_thaddius.cpp:110
@ EVENT_MINION_MAGNETIC_PULL
Definition: boss_thaddius.cpp:91
@ EVENT_MINION_STATIC_FIELD
Definition: boss_thaddius.cpp:93
@ EVENT_MINION_CHECK_DISTANCE
Definition: boss_thaddius.cpp:92
@ EVENT_MINION_POWER_SURGE
Definition: boss_thaddius.cpp:90
@ GO_STATE_READY
Definition: GameObjectData.h:690
Definition: GameObject.h:120
Map * GetMap() const
Definition: Object.h:536
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2457
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3322
ObjectGuid myCoil
Definition: boss_thaddius.cpp:396

References DATA_THADDIUS_BOSS, DATA_THADDIUS_GATE, EVENT_MINION_CHECK_DISTANCE, EVENT_MINION_MAGNETIC_PULL, EVENT_MINION_POWER_SURGE, EVENT_MINION_STATIC_FIELD, WorldObject::FindNearestCreature(), ObjectAccessor::GetCreature(), Object::GetEntry(), Map::GetGameObject(), InstanceScript::GetGuidData(), WorldObject::GetMap(), GO_STATE_READY, ScriptedAI::me, myCoil, NPC_STALAGG, NPC_TESLA_COIL, pInstance, SAY_FEUG_AGGRO, SAY_STAL_AGGRO, and Creature::SetInCombatWithZone().

◆ KilledUnit()

void boss_thaddius_summon::boss_thaddius_summonAI::KilledUnit ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

492 {
493 if (!who->IsPlayer())
494 return;
495
496 if (pInstance)
497 {
499 }
500 if (!urand(0, 2))
501 {
503 }
504 }
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ DATA_IMMORTAL_FAIL
Definition: naxxramas.h:73
@ SAY_FEUG_SLAY
Definition: boss_thaddius.cpp:37
@ SAY_STAL_SLAY
Definition: boss_thaddius.cpp:30
bool IsPlayer() const
Definition: Object.h:200
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52

References DATA_IMMORTAL_FAIL, Object::GetEntry(), Object::IsPlayer(), ScriptedAI::me, NPC_STALAGG, pInstance, SAY_FEUG_SLAY, SAY_STAL_SLAY, ZoneScript::SetData(), and urand().

◆ Reset()

void boss_thaddius_summon::boss_thaddius_summonAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

399 {
400 pullTimer = 0;
401 visualTimer = 1;
402 overload = false;
403 events.Reset();
405 if (Creature* cr = me->FindNearestCreature(NPC_TESLA_COIL, 150.0f))
406 {
407 cr->CastSpell(cr, me->GetEntry() == NPC_STALAGG ? SPELL_STALAGG_CHAIN : SPELL_FEUGEN_CHAIN, false);
408 cr->SetImmuneToPC(false);
409 myCoil = cr->GetGUID();
410 }
411 }
@ SPELL_FEUGEN_CHAIN
Definition: boss_thaddius.cpp:69
@ SPELL_STALAGG_CHAIN
Definition: boss_thaddius.cpp:64
uint32 visualTimer
Definition: boss_thaddius.cpp:394

References WorldObject::FindNearestCreature(), Object::GetEntry(), ScriptedAI::me, myCoil, NPC_STALAGG, NPC_TESLA_COIL, overload, pullTimer, Unit::SetControlled(), SPELL_FEUGEN_CHAIN, SPELL_STALAGG_CHAIN, UNIT_STATE_STUNNED, and visualTimer.

◆ UpdateAI()

void boss_thaddius_summon::boss_thaddius_summonAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from ScriptedAI.

507 {
508 if (visualTimer)
509 {
510 visualTimer += diff;
511 if (visualTimer >= 3000)
512 {
513 visualTimer = 0;
514 if (Creature* cr = me->FindNearestCreature(NPC_TESLA_COIL, 150.0f))
515 {
516 cr->CastSpell(cr, me->GetEntry() == NPC_STALAGG ? SPELL_STALAGG_CHAIN : SPELL_FEUGEN_CHAIN, false);
517 }
518 }
519 }
520
521 if (!UpdateVictim())
522 return;
523
524 if (pullTimer) // Disable AI during pull
525 {
526 pullTimer += diff;
527 if (pullTimer >= 3000)
528 {
530 pullTimer = 0;
531 }
532 return;
533 }
534
535 events.Update(diff);
537 return;
538
539 switch (events.ExecuteEvent())
540 {
543 events.Repeat(19s);
544 break;
547 events.Repeat(3s);
548 break;
550 events.Repeat(20s);
551 if (pInstance)
552 {
554 {
555 if (!feugen->IsAlive() || !feugen->GetVictim() || !me->GetVictim())
556 return;
557
558 float threatFeugen = feugen->GetThreatMgr().GetThreat(feugen->GetVictim());
559 float threatStalagg = me->GetThreatMgr().GetThreat(me->GetVictim());
560 Unit* tankFeugen = feugen->GetVictim();
561 Unit* tankStalagg = me->GetVictim();
562
563 feugen->GetThreatMgr().ModifyThreatByPercent(tankFeugen, -100);
564 feugen->AddThreat(tankStalagg, threatFeugen);
565 feugen->CastSpell(tankStalagg, SPELL_MAGNETIC_PULL, true);
566 feugen->AI()->DoAction(ACTION_MAGNETIC_PULL);
567
568 me->GetThreatMgr().ModifyThreatByPercent(tankStalagg, -100);
569 me->AddThreat(tankFeugen, threatStalagg);
570 me->CastSpell(tankFeugen, SPELL_MAGNETIC_PULL, true);
572 }
573 }
574 break;
577 {
578 if (!me->GetHomePosition().IsInDist(me, 28) && me->IsInCombat())
579 {
580 if (!overload)
581 {
582 overload = true;
583 cr->AI()->Talk(EMOTE_TESLA_LINK_BREAKS);
585 cr->InterruptNonMeleeSpells(true);
586 }
587 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 1000.f, true))
588 {
589 cr->CastStop(SPELL_TESLA_SHOCK);
590 cr->CastSpell(target, SPELL_TESLA_SHOCK, true);
591 }
592 events.Repeat(1500ms);
593 break;
594 }
595 else
596 {
597 overload = false;
598 cr->CastSpell(cr, me->GetEntry() == NPC_STALAGG ? SPELL_STALAGG_CHAIN : SPELL_FEUGEN_CHAIN, false);
599 }
600 }
601 events.Repeat(5s);
602 break;
603 }
605 }
@ DATA_FEUGEN_BOSS
Definition: naxxramas.h:57
@ EMOTE_TESLA_LINK_BREAKS
Definition: boss_thaddius.cpp:51
@ SPELL_MAGNETIC_PULL
Definition: boss_thaddius.cpp:57
@ SPELL_TESLA_SHOCK
Definition: boss_thaddius.cpp:58
@ SPELL_POWER_SURGE_25
Definition: boss_thaddius.cpp:63
@ SPELL_POWER_SURGE_10
Definition: boss_thaddius.cpp:62
@ SPELL_STATIC_FIELD_25
Definition: boss_thaddius.cpp:68
@ SPELL_STATIC_FIELD_10
Definition: boss_thaddius.cpp:67
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
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:280
const T & RAID_MODE(const T &normal10, const T &normal25) const
Definition: ScriptedCreature.h:404
float GetThreat(Unit *victim, bool alsoSearchOfflineList=false)
Definition: ThreatMgr.cpp:525
void ModifyThreatByPercent(Unit *victim, int32 percent)
Definition: ThreatMgr.cpp:508
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:338
Definition: Unit.h:630
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition: Unit.cpp:14653
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:1167
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4909
Unit * GetVictim() const
Definition: Unit.h:853
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
ThreatMgr & GetThreatMgr()
Definition: Unit.h:903
bool IsInCombat() const
Definition: Unit.h:884
void DoAction(int32 param) override
Definition: boss_thaddius.cpp:456

References ACTION_MAGNETIC_PULL, Unit::AddThreat(), Unit::CastSpell(), DATA_FEUGEN_BOSS, DoAction(), UnitAI::DoMeleeAttackIfReady(), EMOTE_TESLA_LINK_BREAKS, EVENT_MINION_CHECK_DISTANCE, EVENT_MINION_MAGNETIC_PULL, EVENT_MINION_POWER_SURGE, EVENT_MINION_STATIC_FIELD, WorldObject::FindNearestCreature(), ObjectAccessor::GetCreature(), Object::GetEntry(), InstanceScript::GetGuidData(), Creature::GetHomePosition(), ThreatMgr::GetThreat(), Unit::GetThreatMgr(), Unit::GetVictim(), Unit::HasUnitState(), Unit::IsInCombat(), ScriptedAI::me, ThreatMgr::ModifyThreatByPercent(), myCoil, NPC_STALAGG, NPC_TESLA_COIL, overload, pInstance, pullTimer, ScriptedAI::RAID_MODE(), Unit::RemoveAurasDueToSpell(), UnitAI::SelectTarget(), Unit::SetControlled(), SPELL_FEUGEN_CHAIN, SPELL_MAGNETIC_PULL, SPELL_POWER_SURGE_10, SPELL_POWER_SURGE_25, SPELL_STALAGG_CHAIN, SPELL_STATIC_FIELD_10, SPELL_STATIC_FIELD_25, SPELL_TESLA_SHOCK, UNIT_STATE_CASTING, UNIT_STATE_STUNNED, CreatureAI::UpdateVictim(), and visualTimer.

Member Data Documentation

◆ events

EventMap boss_thaddius_summon::boss_thaddius_summonAI::events

◆ myCoil

ObjectGuid boss_thaddius_summon::boss_thaddius_summonAI::myCoil

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

◆ overload

bool boss_thaddius_summon::boss_thaddius_summonAI::overload

◆ pInstance

InstanceScript* boss_thaddius_summon::boss_thaddius_summonAI::pInstance

◆ pullTimer

uint32 boss_thaddius_summon::boss_thaddius_summonAI::pullTimer {}

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

◆ visualTimer

uint32 boss_thaddius_summon::boss_thaddius_summonAI::visualTimer {}

Referenced by Reset(), and UpdateAI().