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.
 
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()
 
- 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 bool CanRespawn ()
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellCastFinished (SpellInfo const *, SpellFinishReason)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
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 ==================
 
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

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
357 : ScriptedAI(c)
358 {
359 overload = false;
360 }
Definition ScriptedCreature.h:190
bool overload
Definition boss_thaddius.cpp:365

References overload.

Member Function Documentation

◆ DoAction()

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

Reimplemented from UnitAI.

421 {
422 if (param == ACTION_MAGNETIC_PULL)
423 {
424 pullTimer = 1;
426 }
427 else if (param == ACTION_RESTORE)
428 {
429 if (!me->IsAlive())
430 {
431 me->Respawn();
434 }
435 else
436 {
438 }
439 }
440 }
@ UNIT_STATE_STUNNED
Definition UnitDefines.h:173
@ EMOTE_FEUG_REVIVE
Definition boss_thaddius.cpp:40
@ EMOTE_STAL_REVIVE
Definition boss_thaddius.cpp:33
@ ACTION_RESTORE
Definition boss_thaddius.cpp:104
@ ACTION_MAGNETIC_PULL
Definition boss_thaddius.cpp:102
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2829
void Respawn(bool force=false)
Definition Creature.cpp:2043
uint32 GetEntry() const
Definition Object.h:116
uint32 GetMaxHealth() const
Definition Unit.h:1071
bool IsAlive() const
Definition Unit.h:1748
void SetHealth(uint32 val)
Definition Unit.cpp:15507
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition Unit.cpp:18074
Talk
Definition hyjal.cpp:82
@ NPC_STALAGG
Definition naxxramas.h:163
Creature * me
Definition ScriptedCreature.h:280
uint32 pullTimer
Definition boss_thaddius.cpp:363

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.

384 {
387 }
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:215

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

◆ JustDied()

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

Reimplemented from CreatureAI.

443 {
446
448 cr->AI()->DoAction(ACTION_SUMMON_DIED);
449 }
@ 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:103
Definition Creature.h:47
Creature * GetCreature(uint32 type)
Definition InstanceScript.cpp:115
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1221
@ DATA_THADDIUS_BOSS
Definition naxxramas.h:50

References ACTION_SUMMON_DIED, DATA_THADDIUS_BOSS, EMOTE_FEUG_DEATH, EMOTE_STAL_DEATH, InstanceScript::GetCreature(), Object::GetEntry(), WorldObject::GetInstanceScript(), ScriptedAI::me, NPC_STALAGG, 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 CreatureAI.

390 {
392 if (Creature* cr = me->FindNearestCreature(NPC_TESLA_COIL, 150.f, true))
393 {
394 myCoil = cr->GetGUID();
395 }
396 if (me->GetEntry() == NPC_STALAGG)
397 {
398 events.ScheduleEvent(EVENT_MINION_POWER_SURGE, 10s);
400 }
401 else
402 {
403 events.ScheduleEvent(EVENT_MINION_STATIC_FIELD, 5s);
405 }
406 events.ScheduleEvent(EVENT_MINION_CHECK_DISTANCE, 5s);
407
408 if (me->GetEntry() == NPC_STALAGG) // This event needs synchronisation, called for stalagg only
409 {
410 events.ScheduleEvent(EVENT_MINION_MAGNETIC_PULL, 20s);
411 }
412
414 {
415 cr->AI()->AttackStart(pWho);
416 cr->AddThreat(pWho, 10.0f);
417 }
418 }
events
Definition boss_sartura.cpp:43
@ SAY_STAL_AGGRO
Definition boss_thaddius.cpp:29
@ SAY_FEUG_AGGRO
Definition boss_thaddius.cpp:36
@ NPC_TESLA_COIL
Definition boss_thaddius.cpp:107
@ EVENT_MINION_MAGNETIC_PULL
Definition boss_thaddius.cpp:88
@ EVENT_MINION_STATIC_FIELD
Definition boss_thaddius.cpp:90
@ EVENT_MINION_CHECK_DISTANCE
Definition boss_thaddius.cpp:89
@ EVENT_MINION_POWER_SURGE
Definition boss_thaddius.cpp:87
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2450
ObjectGuid myCoil
Definition boss_thaddius.cpp:366

References DATA_THADDIUS_BOSS, EVENT_MINION_CHECK_DISTANCE, EVENT_MINION_MAGNETIC_PULL, EVENT_MINION_POWER_SURGE, EVENT_MINION_STATIC_FIELD, WorldObject::FindNearestCreature(), InstanceScript::GetCreature(), Object::GetEntry(), WorldObject::GetInstanceScript(), ScriptedAI::me, myCoil, NPC_STALAGG, NPC_TESLA_COIL, SAY_FEUG_AGGRO, SAY_STAL_AGGRO, and Creature::SetInCombatWithZone().

◆ KilledUnit()

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

Reimplemented from CreatureAI.

452 {
453 if (!who->IsPlayer())
454 return;
455
456 if (!urand(0, 2))
458
460 }
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
@ SAY_FEUG_SLAY
Definition boss_thaddius.cpp:37
@ SAY_STAL_SLAY
Definition boss_thaddius.cpp:30
void StorePersistentData(uint32 index, uint32 data)
Definition InstanceScript.cpp:422
bool IsPlayer() const
Definition Object.h:201
@ PERSISTENT_DATA_IMMORTAL_FAIL
Definition naxxramas.h:88

References Object::GetEntry(), WorldObject::GetInstanceScript(), Object::IsPlayer(), ScriptedAI::me, NPC_STALAGG, PERSISTENT_DATA_IMMORTAL_FAIL, SAY_FEUG_SLAY, SAY_STAL_SLAY, InstanceScript::StorePersistentData(), and urand().

◆ Reset()

void boss_thaddius_summon::boss_thaddius_summonAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

369 {
370 pullTimer = 0;
371 visualTimer = 1;
372 overload = false;
373 events.Reset();
375 if (Creature* cr = me->FindNearestCreature(NPC_TESLA_COIL, 150.0f))
376 {
377 cr->CastSpell(cr, me->GetEntry() == NPC_STALAGG ? SPELL_STALAGG_CHAIN : SPELL_FEUGEN_CHAIN, false);
378 cr->SetImmuneToPC(false);
379 myCoil = cr->GetGUID();
380 }
381 }
@ SPELL_FEUGEN_CHAIN
Definition boss_thaddius.cpp:67
@ SPELL_STALAGG_CHAIN
Definition boss_thaddius.cpp:63
uint32 visualTimer
Definition boss_thaddius.cpp:364

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

Implements UnitAI.

463 {
464 if (visualTimer)
465 {
466 visualTimer += diff;
467 if (visualTimer >= 3000)
468 {
469 visualTimer = 0;
470 if (Creature* cr = me->FindNearestCreature(NPC_TESLA_COIL, 150.0f))
471 {
472 cr->CastSpell(cr, me->GetEntry() == NPC_STALAGG ? SPELL_STALAGG_CHAIN : SPELL_FEUGEN_CHAIN, false);
473 }
474 }
475 }
476
477 if (!UpdateVictim())
478 return;
479
480 if (pullTimer) // Disable AI during pull
481 {
482 pullTimer += diff;
483 if (pullTimer >= 3000)
484 {
486 pullTimer = 0;
487 }
488 return;
489 }
490
491 events.Update(diff);
493 return;
494
495 switch (events.ExecuteEvent())
496 {
499 events.Repeat(19s);
500 break;
503 events.Repeat(3s);
504 break;
506 {
507 events.Repeat(20s);
509 {
510 if (!feugen->IsAlive() || !feugen->GetVictim() || !me->GetVictim())
511 return;
512
513 float threatFeugen = feugen->GetThreatMgr().GetThreat(feugen->GetVictim());
514 float threatStalagg = me->GetThreatMgr().GetThreat(me->GetVictim());
515 Unit* tankFeugen = feugen->GetVictim();
516 Unit* tankStalagg = me->GetVictim();
517
518 feugen->GetThreatMgr().ModifyThreatByPercent(tankFeugen, -100);
519 feugen->AddThreat(tankStalagg, threatFeugen);
520 feugen->CastSpell(tankStalagg, SPELL_MAGNETIC_PULL, true);
521 feugen->AI()->DoAction(ACTION_MAGNETIC_PULL);
522
523 me->GetThreatMgr().ModifyThreatByPercent(tankStalagg, -100);
524 me->AddThreat(tankFeugen, threatStalagg);
525 me->CastSpell(tankFeugen, SPELL_MAGNETIC_PULL, true);
527 }
528 break;
529 }
532 {
533 if (!me->GetHomePosition().IsInDist(me, 28) && me->IsInCombat())
534 {
535 if (!overload)
536 {
537 overload = true;
538 cr->AI()->Talk(EMOTE_TESLA_LINK_BREAKS);
540 cr->InterruptNonMeleeSpells(true);
541 }
542 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 1000.f, true))
543 {
544 cr->CastStop(SPELL_TESLA_SHOCK);
545 cr->CastSpell(target, SPELL_TESLA_SHOCK, true);
546 }
547 events.Repeat(1500ms);
548 break;
549 }
550 else
551 {
552 overload = false;
553 cr->CastSpell(cr, me->GetEntry() == NPC_STALAGG ? SPELL_STALAGG_CHAIN : SPELL_FEUGEN_CHAIN, false);
554 }
555 }
556 events.Repeat(5s);
557 break;
558 }
560 }
@ UNIT_STATE_CASTING
Definition UnitDefines.h:185
@ 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_STATIC_FIELD
Definition boss_thaddius.cpp:66
@ SPELL_POWER_SURGE
Definition boss_thaddius.cpp:62
bool UpdateVictim()
Definition CreatureAI.cpp:287
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition Creature.h:341
float GetThreat(Unit *victim, bool alsoSearchOfflineList=false)
Definition ThreatMgr.cpp:525
void ModifyThreatByPercent(Unit *victim, int32 percent)
Definition ThreatMgr.cpp:508
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
Definition Unit.h:650
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition Unit.cpp:14682
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
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4977
Unit * GetVictim() const
Definition Unit.h:886
bool HasUnitState(const uint32 f) const
Definition Unit.h:721
ThreatMgr & GetThreatMgr()
Definition Unit.h:936
bool IsInCombat() const
Definition Unit.h:917
Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:210
@ DATA_FEUGEN_BOSS
Definition naxxramas.h:49
void DoAction(int32 param) override
Definition boss_thaddius.cpp:420

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(), InstanceScript::GetCreature(), ObjectAccessor::GetCreature(), Object::GetEntry(), Creature::GetHomePosition(), WorldObject::GetInstanceScript(), ThreatMgr::GetThreat(), Unit::GetThreatMgr(), Unit::GetVictim(), Unit::HasUnitState(), Unit::IsInCombat(), ScriptedAI::me, ThreatMgr::ModifyThreatByPercent(), myCoil, NPC_STALAGG, NPC_TESLA_COIL, overload, pullTimer, Random, Unit::RemoveAurasDueToSpell(), UnitAI::SelectTarget(), Unit::SetControlled(), SPELL_FEUGEN_CHAIN, SPELL_MAGNETIC_PULL, SPELL_POWER_SURGE, SPELL_STALAGG_CHAIN, SPELL_STATIC_FIELD, 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

◆ pullTimer

uint32 boss_thaddius_summon::boss_thaddius_summonAI::pullTimer {}
363{};

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

◆ visualTimer

uint32 boss_thaddius_summon::boss_thaddius_summonAI::visualTimer {}
364{};

Referenced by Reset(), and UpdateAI().


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