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

InstanceScriptinstance
 
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
360 : ScriptedAI(c)
361 {
362 overload = false;
365 }
void SetBoundary(CreatureBoundary const *boundary, bool negativeBoundaries=false)
Definition CreatureAI.cpp:533
CreatureBoundary const * GetBossBoundary(uint32 id) const
Definition InstanceScript.h:244
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1214
@ BOSS_THADDIUS
Definition naxxramas.h:36
Definition ScriptedCreature.h:191
InstanceScript * instance
Definition boss_thaddius.cpp:367
bool overload
Definition boss_thaddius.cpp:371

References BOSS_THADDIUS, InstanceScript::GetBossBoundary(), WorldObject::GetInstanceScript(), instance, overload, and CreatureAI::SetBoundary().

Member Function Documentation

◆ DoAction()

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

Reimplemented from UnitAI.

432 {
433 if (param == ACTION_MAGNETIC_PULL)
434 {
435 pullTimer = 1;
437 }
438 else if (param == ACTION_RESTORE)
439 {
440 if (!me->IsAlive())
441 {
442 me->Respawn();
445 }
446 else
447 {
449 }
450 }
451 }
@ 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:103
@ ACTION_MAGNETIC_PULL
Definition boss_thaddius.cpp:101
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2777
void Respawn(bool force=false)
Definition Creature.cpp:1991
uint32 GetEntry() const
Definition Object.h:116
uint32 GetMaxHealth() const
Definition Unit.h:1094
bool IsAlive() const
Definition Unit.h:1773
void SetHealth(uint32 val)
Definition Unit.cpp:15726
void SetControlled(bool apply, UnitState state, Unit *source=nullptr, bool isFear=false)
Definition Unit.cpp:18305
Talk
Definition hyjal.cpp:82
@ NPC_STALAGG
Definition naxxramas.h:165
Creature * me
Definition ScriptedCreature.h:281
uint32 pullTimer
Definition boss_thaddius.cpp:369

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.

390 {
392
393 if (why == EVADE_REASON_BOUNDARY)
395 thaddius->AI()->EnterEvadeMode(EVADE_REASON_BOUNDARY);
396
398 }
@ EVADE_REASON_BOUNDARY
Definition CreatureAI.h:91
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:205
Definition Creature.h:47
Creature * GetCreature(uint32 type)
Definition InstanceScript.cpp:115
@ DATA_THADDIUS_BOSS
Definition naxxramas.h:50

References DATA_THADDIUS_BOSS, CreatureAI::EnterEvadeMode(), CreatureAI::EVADE_REASON_BOUNDARY, InstanceScript::GetCreature(), instance, ScriptedAI::me, Unit::SetControlled(), and UNIT_STATE_STUNNED.

◆ JustDied()

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

Reimplemented from CreatureAI.

454 {
457
459 cr->AI()->DoAction(ACTION_SUMMON_DIED);
460 }
@ 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:102

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.

401 {
403 if (Creature* cr = me->FindNearestCreature(NPC_TESLA_COIL, 150.f, true))
404 {
405 myCoil = cr->GetGUID();
406 }
407 if (me->GetEntry() == NPC_STALAGG)
408 {
409 events.ScheduleEvent(EVENT_MINION_POWER_SURGE, 10s);
411 }
412 else
413 {
414 events.ScheduleEvent(EVENT_MINION_STATIC_FIELD, 5s);
416 }
417 events.ScheduleEvent(EVENT_MINION_CHECK_DISTANCE, 5s);
418
419 if (me->GetEntry() == NPC_STALAGG) // This event needs synchronisation, called for stalagg only
420 {
421 events.ScheduleEvent(EVENT_MINION_MAGNETIC_PULL, 20s);
422 }
423
425 {
426 cr->AI()->AttackStart(pWho);
427 cr->AddThreat(pWho, 10.0f);
428 }
429 }
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:106
@ 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:2443
ObjectGuid myCoil
Definition boss_thaddius.cpp:372

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.

463 {
464 if (!who->IsPlayer())
465 return;
466
467 if (!urand(0, 2))
469
471 }
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:200
@ PERSISTENT_DATA_IMMORTAL_FAIL
Definition naxxramas.h:87

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.

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

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.

474 {
475 if (visualTimer)
476 {
477 visualTimer += diff;
478 if (visualTimer >= 3000)
479 {
480 visualTimer = 0;
481 if (Creature* cr = me->FindNearestCreature(NPC_TESLA_COIL, 150.0f))
482 {
483 cr->CastSpell(cr, me->GetEntry() == NPC_STALAGG ? SPELL_STALAGG_CHAIN : SPELL_FEUGEN_CHAIN, false);
484 }
485 }
486 }
487
488 if (!UpdateVictim())
489 return;
490
491 if (pullTimer) // Disable AI during pull
492 {
493 pullTimer += diff;
494 if (pullTimer >= 3000)
495 {
497 pullTimer = 0;
498 }
499 return;
500 }
501
502 events.Update(diff);
504 return;
505
506 switch (events.ExecuteEvent())
507 {
510 events.Repeat(19s);
511 break;
514 events.Repeat(3s);
515 break;
517 {
518 events.Repeat(20s);
520 {
521 if (!feugen->IsAlive() || !feugen->GetVictim() || !me->GetVictim())
522 return;
523
524 float threatFeugen = feugen->GetThreatMgr().GetThreat(feugen->GetVictim());
525 float threatStalagg = me->GetThreatMgr().GetThreat(me->GetVictim());
526 Unit* tankFeugen = feugen->GetVictim();
527 Unit* tankStalagg = me->GetVictim();
528
529 feugen->GetThreatMgr().ModifyThreatByPercent(tankFeugen, -100);
530 feugen->AddThreat(tankStalagg, threatFeugen);
531 feugen->CastSpell(tankStalagg, SPELL_MAGNETIC_PULL, true);
532 feugen->AI()->DoAction(ACTION_MAGNETIC_PULL);
533
534 me->GetThreatMgr().ModifyThreatByPercent(tankStalagg, -100);
535 me->AddThreat(tankFeugen, threatStalagg);
536 me->CastSpell(tankFeugen, SPELL_MAGNETIC_PULL, true);
538 }
539 break;
540 }
543 {
544 if (!me->GetHomePosition().IsInDist(me, 28) && me->IsInCombat())
545 {
546 if (!overload)
547 {
548 overload = true;
549 cr->AI()->Talk(EMOTE_TESLA_LINK_BREAKS);
551 cr->InterruptNonMeleeSpells(true);
552 }
553 if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 1000.f, true))
554 {
555 cr->CastStop(SPELL_TESLA_SHOCK);
556 cr->CastSpell(target, SPELL_TESLA_SHOCK, true);
557 }
558 events.Repeat(1500ms);
559 break;
560 }
561 else
562 {
563 overload = false;
564 cr->CastSpell(cr, me->GetEntry() == NPC_STALAGG ? SPELL_STALAGG_CHAIN : SPELL_FEUGEN_CHAIN, false);
565 }
566 }
567 events.Repeat(5s);
568 break;
569 }
571 }
@ 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:277
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition Creature.h:340
float GetThreat(Unit *victim, bool alsoSearchOfflineList=false)
Definition ThreatMgr.cpp:593
void ModifyThreatByPercent(Unit *victim, int32 percent)
Definition ThreatMgr.cpp:576
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:655
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition Unit.cpp:14771
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:5032
Unit * GetVictim() const
Definition Unit.h:893
bool HasUnitState(const uint32 f) const
Definition Unit.h:726
ThreatMgr & GetThreatMgr()
Definition Unit.h:943
bool IsInCombat() const
Definition Unit.h:924
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:431

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

◆ instance

InstanceScript* boss_thaddius_summon::boss_thaddius_summonAI::instance

◆ 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 {}
369{};

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

◆ visualTimer

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

Referenced by Reset(), and UpdateAI().


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