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

Public Member Functions

 boss_thorim (Creature *creature)
 
void DisableThorim (bool apply)
 
GameObject * GetThorimObject (uint32 entry)
 
void SpawnAllNPCs ()
 
void CloseDoors ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
void EnterEvadeMode (EvadeReason why) override
 
void Reset () override
 
uint32 GetData (uint32 param) const override
 
void DoAction (int32 param) override
 
void SummonedCreatureDies (Creature *summon, Unit *) override
 
void KilledUnit (Unit *victim) override
 
void JustReachedHome () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void DamageTaken (Unit *who, uint32 &damage, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void SpawnAnArenaNPC (uint32 arenaNpc)
 
void SpawnCommoners ()
 
void SpellHit (Unit *caster, SpellInfo const *spellInfo) override
 
void SpellHitTarget (Unit *target, SpellInfo const *spellInfo) override
 
Player * GetArenaPlayer ()
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
- Public Member Functions inherited from BossAI
 BossAI (Creature *creature, uint32 bossId)
 
 ~BossAI () override
 
bool CanRespawn () override
 
void OnSpellCast (SpellInfo const *spell) override
 
void OnChannelFinished (SpellInfo const *spell) override
 
void OnSpellFailed (SpellInfo const *spell) override
 
void DamageTaken (Unit *attacker, uint32 &damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SummonedCreatureDespawnAll () override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void ScheduleHealthCheckEvent (uint32 healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
 Executes a function once the creature reaches the defined health point percent.
 
void ScheduleHealthCheckEvent (std::initializer_list< uint8 > healthPct, std::function< void()> exec, bool allowedWhileCasting=true)
 
void ProcessHealthCheck ()
 
void ScheduleEnrageTimer (uint32 spellId, Milliseconds timer, uint8 textId=0)
 
virtual void ExecuteEvent (uint32)
 
virtual void ScheduleTasks ()
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER) override
 
void JustDied (Unit *) override
 
void JustReachedHome () override
 
- Public Member Functions inherited from ScriptedAI
 ScriptedAI (Creature *creature)
 
 ~ScriptedAI () override
 
void AttackStartNoMove (Unit *target)
 
void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask) override
 Called at any Damage from any attacker (before damage apply)
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void JustDied (Unit *) override
 
void KilledUnit (Unit *) override
 
void JustSummoned (Creature *) override
 
void SummonedCreatureDespawn (Creature *) override
 
void SpellHit (Unit *, SpellInfo const *) override
 
void SpellHitTarget (Unit *, SpellInfo const *) override
 
void MovementInform (uint32, uint32) override
 
void OnPossess (bool)
 
bool IsInRoom (Position const *pos, Axis axis, bool above)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoRewardPlayersInArea ()
 
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)
 
Unit * DoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
Player * GetPlayerAtMinimumRange (float minRange)
 
Creature * DoSpawnCreature (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 >
T const & DUNGEON_MODE (T const &normal5, T const &heroic10) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25) const
 
template<class T >
T const & RAID_MODE (T const &normal10, T const &normal25, T const &heroic10, T const &heroic25) const
 
Player * SelectTargetFromPlayerList (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)
 
WorldObject * GetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool IsEscortNPC (bool=true) const
 
void JustEnteredCombat (Unit *who) override
 Called when the unit enters combat.
 
virtual void JustStartedThreateningMe (Unit *who)
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void PathEndReached (uint32)
 
virtual void WaypointPathStarted (uint32)
 == Waypoints system =============================
 
virtual void WaypointStarted (uint32, uint32)
 
virtual void WaypointReached (uint32, uint32)
 
virtual void WaypointPathEnded (uint32, uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed.
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *attacker)
 
virtual void OwnerAttacked (Unit *target)
 
void OnOwnerCombatInteraction (Unit *target)
 
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 void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid const &, int32=0)
 
virtual ObjectGuid GetGUID (int32=0) const
 
Unit * SelectTarget (SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
 
template<class PREDICATE >
Unit * SelectTarget (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 OnDespawn ()
 Called when the unit is about to be removed from the world (despawn, grid unload, corpse disappearing, player logging out etc.)
 
virtual void EvadeTimerExpired ()
 Called when evade timer expires (target unreachable for too long)
 
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, int32 aura=0)
 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

bool _isArenaEmpty
 
bool _spawnCommoners
 
bool _hardMode
 
bool _isHitAllowed
 
bool _isAlly
 
uint8 _trashCounter
 
bool _hitByLightning
 
- Public Attributes inherited from BossAI
float callForHelpRange
 
InstanceScript *const instance
 
- Public Attributes inherited from ScriptedAI
Creature * me
 

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 AISpellInfoType * AISpellInfo
 
- 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)
 
Creature * DoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
Creature * DoSummonFlyer (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
 
bool _isEngaged
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_thorim()

boss_thorim::boss_thorim ( Creature *  creature)
inline
318: BossAI(creature, BOSS_THORIM) { }
Definition ScriptedCreature.h:485
@ BOSS_THORIM
Definition ulduar.h:41

Member Function Documentation

◆ CloseDoors()

void boss_thorim::CloseDoors ( )
inline
390 {
391 GameObject* go;
393 {
396 }
399
402
405 }
@ GO_STATE_READY
Definition GameObjectData.h:709
@ GO_STATE_ACTIVE
Definition GameObjectData.h:708
GameObjectFlags
Definition SharedDefines.h:1606
Definition GameObject.h:120
void SetGoState(GOState state)
Definition GameObject.cpp:2519
void ReplaceAllGameObjectFlags(GameObjectFlags flags)
Definition GameObject.h:221
GameObject * GetThorimObject(uint32 entry)
Definition boss_thorim.cpp:346
@ DATA_THORIM_FIRST_DOORS
Definition ulduar.h:99
@ DATA_THORIM_LEVER
Definition ulduar.h:97
@ DATA_THORIM_FENCE
Definition ulduar.h:98
@ DATA_THORIM_SECOND_DOORS
Definition ulduar.h:100

References DATA_THORIM_FENCE, DATA_THORIM_FIRST_DOORS, DATA_THORIM_LEVER, DATA_THORIM_SECOND_DOORS, GetThorimObject(), GO_STATE_ACTIVE, GO_STATE_READY, GameObject::ReplaceAllGameObjectFlags(), and GameObject::SetGoState().

Referenced by Reset().

◆ DamageTaken()

void boss_thorim::DamageTaken ( Unit *  ,
uint32 &  ,
DamageEffectType  ,
SpellSchoolMask   
)
inlineoverridevirtual

Called at any Damage from any attacker (before damage apply)

Note
It use for recalculation damage or special reaction at damage for attack reaction use AttackedBy called for non DOT damage in Unit::DealDamage also

Reimplemented from UnitAI.

516 {
517 if (who && _isHitAllowed && who->GetPositionZ() > 430 && who->IsPlayer())
518 {
519 _isHitAllowed = false;
520 DisableThorim(false);
521
522 events.SetPhase(EVENT_PHASE_RING);
524 events.ScheduleEvent(EVENT_THORIM_LIGHTNING_CHARGE, 12s + 500ms, 0, EVENT_PHASE_RING);
526 events.ScheduleEvent(EVENT_THORIM_BERSERK, 5min, 0, EVENT_PHASE_RING);
527
531
533
534 // Hard Mode
535 if (!me->HasAura(62565 /*TOUCH OF DOMINION TRIGGER*/))
536 {
538
539 _hardMode = true;
542 }
543
545 if (Player* player = GetArenaPlayer())
546 me->AddThreat(player, 1000.0f);
547 }
548
549 // The hook also fires with zero damage on an already despawned Thorim (damage shields after
550 // his own lethal melee during the HARD_RESET evade), where 0 >= 0 would count as a defeat
551 if (me->IsAlive() && damage >= me->GetHealth())
552 {
553 damage = 0;
555 {
556 // Must precede CombatStop: it runs JustExitedCombat, whose DONE check keeps the outro from evading
561 me->CombatStop();
563 events.Reset();
564 DisableThorim(true);
565
567
568 events.SetPhase(EVENT_PHASE_OUTRO);
569 events.ScheduleEvent(EVENT_THORIM_OUTRO1, 2s, 0, EVENT_PHASE_OUTRO);
570
571 GameObject* go = nullptr;
574
576 if (_hardMode)
577 chestId += 1; // hard mode offset
578
579 // Summoned by the map, not Thorim, so the chest survives his despawn during the outro.
580 if ((go = me->GetMap()->SummonGameObject(chestId, 2134.73f, -286.32f, 419.51f, 4.65f, 0, 0, 0, 0, 0)))
581 {
583 go->SetLootRecipient(me->GetMap());
584 go->SetRespawnTime(7 * DAY);
585 }
586
587 // Defeat credit
588 me->CastSpell(me, 64985, true); // credit
589 }
590 }
591 }
constexpr auto DAY
Definition Common.h:49
@ ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET
Definition DBCEnums.h:142
std::uint32_t uint32
Definition Define.h:107
@ DONE
Definition InstanceScript.h:61
@ FACTION_FRIENDLY
Definition SharedDefines.h:189
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:258
events
Definition boss_sartura.cpp:43
@ EVENT_THORIM_LIGHTNING_CHARGE
Definition boss_thorim.cpp:177
@ EVENT_THORIM_OUTRO1
Definition boss_thorim.cpp:182
@ EVENT_THORIM_UNBALANCING_STRIKE
Definition boss_thorim.cpp:176
@ EVENT_THORIM_CHAIN_LIGHTNING
Definition boss_thorim.cpp:178
@ EVENT_THORIM_BERSERK
Definition boss_thorim.cpp:179
@ ACTION_SIF_JOIN_FIGHT
Definition boss_thorim.cpp:299
@ EVENT_PHASE_OUTRO
Definition boss_thorim.cpp:308
@ EVENT_PHASE_RING
Definition boss_thorim.cpp:307
const Position Middle
Definition boss_thorim.cpp:314
@ NPC_SIF
Definition boss_thorim.cpp:162
@ SAY_DEATH
Definition boss_thorim.cpp:275
@ SAY_JUMPDOWN
Definition boss_thorim.cpp:271
@ SPELL_SHEATH_OF_LIGHTNING
Definition boss_thorim.cpp:36
InstanceScript *const instance
Definition ScriptedCreature.h:492
SummonList summons
Definition ScriptedCreature.h:539
Definition ScriptedCreature.h:168
void SetRespawnTime(int32 respawn)
Definition GameObject.cpp:1288
void SetLootRecipient(Creature *creature)
Definition GameObject.cpp:2688
virtual bool SetBossState(uint32 id, EncounterState state)
Definition InstanceScript.cpp:400
void DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=nullptr)
Definition InstanceScript.cpp:674
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:252
bool Is25ManRaid() const
Definition Map.h:304
GameObject * SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime, bool checkTransport=true)
Definition Object.cpp:2400
void MoveChase(Unit *target, std::optional< ChaseRange > dist={}, std::optional< ChaseAngle > angle={})
Force the unit to chase this target. Doesn't work with UNIT_FLAG_DISABLE_MOVE.
Definition MotionMaster.cpp:316
void MoveJump(Position const &pos, float speedXY, float speedZ, uint32 id=0)
Definition MotionMaster.h:257
Definition Player.h:1086
void DoAction(int32 info, uint16 max=0)
Definition ScriptedCreature.h:102
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4797
void SetFaction(uint32 faction)
Definition Unit.cpp:6850
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition Unit.cpp:11198
MotionMaster * GetMotionMaster()
Definition Unit.h:1761
uint32 GetMaxHealth() const
Definition Unit.h:1115
bool IsAlive() const
Definition Unit.h:1796
void SetHealth(uint32 val)
Definition Unit.cpp:11950
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5764
uint32 GetHealth() const
Definition Unit.h:1114
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:1372
Unit * GetVictim() const
Definition Unit.h:904
void RemoveAllAuras()
Definition Unit.cpp:5359
void CombatStop(bool includingCast=false, bool mutualPvP=true)
Definition Unit.cpp:7273
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:749
Map * GetMap() const
Definition Object.h:637
Talk
Definition hyjal.cpp:82
float GetPositionZ() const
Definition Position.h:123
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
void DoResetThreatList()
Definition ScriptedCreature.cpp:473
Creature * me
Definition ScriptedCreature.h:281
bool _isHitAllowed
Definition boss_thorim.cpp:323
bool _hardMode
Definition boss_thorim.cpp:322
Player * GetArenaPlayer()
Definition boss_thorim.cpp:633
void DisableThorim(bool apply)
Definition boss_thorim.cpp:329
@ GO_THORIM_CHEST
Definition ulduar.h:262
@ GO_THORIM_CHEST_HERO
Definition ulduar.h:263

References _hardMode, _isHitAllowed, ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, ACTION_SIF_JOIN_FIGHT, Unit::AddThreat(), BOSS_THORIM, Unit::CastSpell(), Unit::CombatStop(), DATA_THORIM_FENCE, DAY, DisableThorim(), SummonList::DoAction(), DONE, ScriptedAI::DoResetThreatList(), InstanceScript::DoUpdateAchievementCriteria(), EVENT_PHASE_OUTRO, EVENT_PHASE_RING, EVENT_THORIM_BERSERK, EVENT_THORIM_CHAIN_LIGHTNING, EVENT_THORIM_LIGHTNING_CHARGE, EVENT_THORIM_OUTRO1, EVENT_THORIM_UNBALANCING_STRIKE, FACTION_FRIENDLY, GetArenaPlayer(), InstanceScript::GetBossState(), Unit::GetHealth(), WorldObject::GetMap(), Unit::GetMaxHealth(), Unit::GetMotionMaster(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), GetThorimObject(), Unit::GetVictim(), GO_STATE_ACTIVE, GO_THORIM_CHEST, GO_THORIM_CHEST_HERO, Unit::HasAura(), BossAI::instance, Map::Is25ManRaid(), Unit::IsAlive(), Object::IsPlayer(), ScriptedAI::me, Middle, MotionMaster::MoveChase(), MotionMaster::MoveJump(), NPC_SIF, Unit::RemoveAllAuras(), Unit::RemoveAura(), GameObject::ReplaceAllGameObjectFlags(), SAY_DEATH, SAY_JUMPDOWN, InstanceScript::SetBossState(), Unit::SetFaction(), GameObject::SetGoState(), Unit::SetHealth(), GameObject::SetLootRecipient(), GameObject::SetRespawnTime(), Unit::SetUnitFlag(), SPELL_SHEATH_OF_LIGHTNING, Map::SummonGameObject(), BossAI::summons, and UNIT_FLAG_NON_ATTACKABLE.

◆ DisableThorim()

void boss_thorim::DisableThorim ( bool  apply)
inline
330 {
331 if (apply)
332 {
334 me->DisableRotate(true);
336 }
337 else
338 {
340 me->DisableRotate(false);
343 }
344 }
@ UNIT_STATE_ROOT
Definition UnitDefines.h:183
@ UNIT_FLAG_PACIFIED
Definition UnitDefines.h:274
@ UNIT_FLAG_DISABLE_MOVE
Definition UnitDefines.h:259
@ BASE_ATTACK
Definition Unit.h:216
void ClearUnitState(uint32 f)
Definition Unit.h:738
void AddUnitState(uint32 f)
Definition Unit.h:736
void DisableRotate(bool apply)
Definition Unit.cpp:14145
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
Definition Unit.cpp:769
void RemoveUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:750

References Unit::AddUnitState(), BASE_ATTACK, Unit::ClearUnitState(), Unit::DisableRotate(), ScriptedAI::me, Unit::RemoveUnitFlag(), Unit::resetAttackTimer(), Unit::SetUnitFlag(), UNIT_FLAG_DISABLE_MOVE, UNIT_FLAG_PACIFIED, and UNIT_STATE_ROOT.

Referenced by DamageTaken(), EnterEvadeMode(), JustEngagedWith(), and Reset().

◆ DoAction()

void boss_thorim::DoAction ( int32  param)
inlineoverridevirtual

Reimplemented from UnitAI.

455 {
456 if (param == ACTION_START_TRASH_DIED)
457 {
459 // activate levar
460 if (_trashCounter >= 6)
461 {
463 go->RemoveGameObjectFlag((GameObjectFlags)48);
464
465 // Iron Ring Guards and the Runic Colossus spawn with UNIT_FLAG_IMMUNE_TO_PC until the arena event starts
467 {
468 if (Creature* c = obj->ToCreature())
469 if (c->EntryEquals(NPC_IRON_RING_GUARD, NPC_RUNIC_COLOSSUS))
470 c->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
471 });
472
473 events.ScheduleEvent(EVENT_THORIM_AGGRO, 0ms);
474 events.SetPhase(EVENT_PHASE_START);
475 events.ScheduleEvent(EVENT_THORIM_START_PHASE1, 20s);
476 _trashCounter = 0;
477 }
478 }
479 else if (param == ACTION_ALLOW_HIT)
480 _isHitAllowed = true;
481 }
@ UNIT_FLAG_IMMUNE_TO_PC
Definition UnitDefines.h:265
@ EVENT_THORIM_START_PHASE1
Definition boss_thorim.cpp:167
@ EVENT_THORIM_AGGRO
Definition boss_thorim.cpp:180
@ ACTION_START_TRASH_DIED
Definition boss_thorim.cpp:297
@ ACTION_ALLOW_HIT
Definition boss_thorim.cpp:298
@ EVENT_PHASE_START
Definition boss_thorim.cpp:306
@ NPC_IRON_RING_GUARD
Definition boss_thorim.cpp:148
@ NPC_RUNIC_COLOSSUS
Definition boss_thorim.cpp:149
Definition Creature.h:47
Creature * ToCreature()
Definition Object.h:212
void DoForAllSummons(std::function< void(WorldObject *)> exec)
Definition ScriptedCreature.h:140
Definition Object.h:482
uint8 _trashCounter
Definition boss_thorim.cpp:325

References _isHitAllowed, _trashCounter, ACTION_ALLOW_HIT, ACTION_START_TRASH_DIED, DATA_THORIM_LEVER, SummonList::DoForAllSummons(), EVENT_PHASE_START, EVENT_THORIM_AGGRO, EVENT_THORIM_START_PHASE1, GetThorimObject(), NPC_IRON_RING_GUARD, NPC_RUNIC_COLOSSUS, BossAI::summons, Object::ToCreature(), and UNIT_FLAG_IMMUNE_TO_PC.

Referenced by SummonedCreatureDies().

◆ EnterEvadeMode()

void boss_thorim::EnterEvadeMode ( EvadeReason  why)
inlineoverridevirtual

Reimplemented from CreatureAI.

416 {
417 DisableThorim(false);
419 }
void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER) override
Definition ScriptedCreature.h:526

References DisableThorim(), and BossAI::EnterEvadeMode().

Referenced by JustExitedCombat().

◆ GetArenaPlayer()

Player * boss_thorim::GetArenaPlayer ( )
inline
634 {
635 Map::PlayerList const& pList = me->GetMap()->GetPlayers();
636 for(Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
637 if (Player* p = itr->GetSource())
638 if (p->GetPositionX() > 2085 && p->GetPositionX() < 2185 && p->GetPositionY() < -214 && p->GetPositionY() > -305 && p->IsAlive() && p->GetPositionZ() < 425)
639 return p;
640 return nullptr;
641 }
Definition LinkedList.h:139
Definition MapRefMgr.h:26
iterator begin()
Definition MapRefMgr.h:36
iterator end()
Definition MapRefMgr.h:37
PlayerList const & GetPlayers() const
Definition Map.h:335

References MapRefMgr::begin(), MapRefMgr::end(), WorldObject::GetMap(), Map::GetPlayers(), and ScriptedAI::me.

Referenced by DamageTaken(), and UpdateAI().

◆ GetData()

uint32 boss_thorim::GetData ( uint32  param) const
inlineoverridevirtual

Reimplemented from UnitAI.

445 {
446 if (param == DATA_HIT_BY_LIGHTNING)
447 return !_hitByLightning;
448 if (param == DATA_LOSE_YOUR_ILLUSION)
449 return _hardMode;
450
451 return 0;
452 }
@ DATA_HIT_BY_LIGHTNING
Definition boss_thorim.cpp:310
@ DATA_LOSE_YOUR_ILLUSION
Definition boss_thorim.cpp:311
bool _hitByLightning
Definition boss_thorim.cpp:327

References _hardMode, _hitByLightning, DATA_HIT_BY_LIGHTNING, and DATA_LOSE_YOUR_ILLUSION.

◆ GetThorimObject()

GameObject * boss_thorim::GetThorimObject ( uint32  entry)
inline
347 {
348 return instance->GetGameObject(entry);
349 }
GameObject * GetGameObject(uint32 type)
Definition InstanceScript.cpp:125

References InstanceScript::GetGameObject(), and BossAI::instance.

Referenced by CloseDoors(), DamageTaken(), DoAction(), and UpdateAI().

◆ JustEngagedWith()

void boss_thorim::JustEngagedWith ( Unit *  )
inlineoverridevirtual

Called for reaction when initially engaged - this happens after JustEnteredCombat.

Reimplemented from CreatureAI.

506 {
509 me->setActive(true);
510 DisableThorim(true);
512 //me->CastSpell(me, SPELL_TOUCH_OF_DOMINION, true);
513 }
@ IN_PROGRESS
Definition InstanceScript.h:59
void setActive(bool isActiveObject)
Definition Object.cpp:1091

References BOSS_THORIM, Unit::CastSpell(), DisableThorim(), DONE, InstanceScript::GetBossState(), IN_PROGRESS, BossAI::instance, ScriptedAI::me, WorldObject::setActive(), InstanceScript::SetBossState(), and SPELL_SHEATH_OF_LIGHTNING.

◆ JustExitedCombat()

void boss_thorim::JustExitedCombat ( )
inlineoverridevirtual

Called when the unit leaves combat.

Reimplemented from UnitAI.

408 {
411 return;
413 }
@ EVADE_REASON_NO_HOSTILES
Definition CreatureAI.h:88
void EngagementOver()
Definition CreatureAI.cpp:298
void EnterEvadeMode(EvadeReason why) override
Definition boss_thorim.cpp:415

References BOSS_THORIM, DONE, CreatureAI::EngagementOver(), EnterEvadeMode(), CreatureAI::EVADE_REASON_NO_HOSTILES, InstanceScript::GetBossState(), and BossAI::instance.

◆ JustReachedHome()

void boss_thorim::JustReachedHome ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

500 {
502 me->setActive(false);
503 }
void _JustReachedHome()
Definition ScriptedCreature.h:534

References BossAI::_JustReachedHome(), ScriptedAI::me, and WorldObject::setActive().

◆ KilledUnit()

void boss_thorim::KilledUnit ( Unit *  victim)
inlineoverridevirtual

Reimplemented from CreatureAI.

494 {
495 if (victim->IsPlayer())
496 Talk(SAY_SLAY);
497 }
@ SAY_SLAY
Definition boss_thorim.cpp:272
bool IsPlayer() const
Definition Object.h:207

References Object::IsPlayer(), and SAY_SLAY.

◆ Reset()

void boss_thorim::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

422 {
424 _Reset();
425
426 _trashCounter = 0;
427 _isAlly = true;
428 _isHitAllowed = false;
429 _spawnCommoners = false;
430 _hardMode = false;
431 _isArenaEmpty = false;
432 _hitByLightning = false;
433
434 if (Player* t = SelectTargetFromPlayerList(1000))
435 if (t->GetTeamId() == TEAM_HORDE)
436 _isAlly = false;
437
438 SpawnAllNPCs();
439
440 CloseDoors();
441 DisableThorim(false);
442 }
@ TEAM_HORDE
Definition SharedDefines.h:749
void _Reset()
Definition ScriptedCreature.cpp:644
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition ScriptedCreature.cpp:591
bool _spawnCommoners
Definition boss_thorim.cpp:321
bool _isAlly
Definition boss_thorim.cpp:324
bool _isArenaEmpty
Definition boss_thorim.cpp:320
void CloseDoors()
Definition boss_thorim.cpp:389
void SpawnAllNPCs()
Definition boss_thorim.cpp:351

References _hardMode, _hitByLightning, _isAlly, _isArenaEmpty, _isHitAllowed, BossAI::_Reset(), _spawnCommoners, _trashCounter, BOSS_THORIM, CloseDoors(), DisableThorim(), DONE, InstanceScript::GetBossState(), BossAI::instance, ScriptedAI::SelectTargetFromPlayerList(), SpawnAllNPCs(), and TEAM_HORDE.

◆ SpawnAllNPCs()

void boss_thorim::SpawnAllNPCs ( )
inline
352 {
353 // Jormungar Behemoth 32882
354 me->SummonCreature(NPC_JORMUNGAR_BEHEMOT, 2146.611f, -266.653f, 419.8175f, 2.70526f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
355
356 // Captured Mercenary Soldier 32885
360
361 // Captured Mercenary Captain 32908
363
364 // Dark Rune Acolyte (arena) 32886
365 me->SummonCreature(NPC_DARK_RUNE_ACOLYTE_I, 2129.09f, -277.142f, 419.756f, 1.22173f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
366
367 // Iron Ring Guard 32874
368 me->SummonCreature(NPC_IRON_RING_GUARD, 2217.69f, -337.394f, 412.177f, 1.23918f);
369 me->SummonCreature(NPC_IRON_RING_GUARD, 2218.38f, -297.505f, 412.176f, 1.02974f);
370 me->SummonCreature(NPC_IRON_RING_GUARD, 2235.26f, -338.345f, 412.134f, 1.58979f);
371 me->SummonCreature(NPC_IRON_RING_GUARD, 2235.07f, -297.985f, 412.134f, 1.61336f);
372
373 // Dark Rune Acolyte (gauntlet) 33110
374 me->SummonCreature(NPC_DARK_RUNE_ACOLYTE_G, 2198.29f, -436.92f, 419.985f, 0.261799f);
375 me->SummonCreature(NPC_DARK_RUNE_ACOLYTE_G, 2227.58f, -308.303f, 412.134f, 1.59372f);
376 me->SummonCreature(NPC_DARK_RUNE_ACOLYTE_G, 2227.47f, -345.375f, 412.134f, 1.56622f);
377
378 // Iron Honor Guard 32875
379 me->SummonCreature(NPC_IRON_HONOR_GUARD, 2198.05f, -428.769f, 419.985f, 6.05629f);
380 me->SummonCreature(NPC_IRON_HONOR_GUARD, 2220.31f, -436.22f, 412.26f, 1.06465f);
381
382 // Runic Colossus 32872
383 me->SummonCreature(NPC_RUNIC_COLOSSUS, 2227.5f, -396.179f, 412.176f, 1.79769f);
384
385 // Ancient Rune Giant 32873
386 me->SummonCreature(NPC_ANCIENT_RUNE_GIANT, 2134.57f, -440.318f, 438.331f, 0.226893f);
387 }
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:55
@ NPC_DARK_RUNE_ACOLYTE_G
Definition boss_thorim.cpp:151
@ NPC_DARK_RUNE_ACOLYTE_I
Definition boss_thorim.cpp:134
@ NPC_CAPTURED_MERCENARY_CAPTAIN_HORDE
Definition boss_thorim.cpp:138
@ NPC_JORMUNGAR_BEHEMOT
Definition boss_thorim.cpp:139
@ NPC_CAPTURED_MERCENARY_SOLDIER_HORDE
Definition boss_thorim.cpp:136
@ NPC_ANCIENT_RUNE_GIANT
Definition boss_thorim.cpp:150
@ NPC_IRON_HONOR_GUARD
Definition boss_thorim.cpp:152
@ NPC_CAPTURED_MERCENARY_CAPTAIN_ALLY
Definition boss_thorim.cpp:137
@ NPC_CAPTURED_MERCENARY_SOLDIER_ALLY
Definition boss_thorim.cpp:135
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2453

References _isAlly, ScriptedAI::me, NPC_ANCIENT_RUNE_GIANT, NPC_CAPTURED_MERCENARY_CAPTAIN_ALLY, NPC_CAPTURED_MERCENARY_CAPTAIN_HORDE, NPC_CAPTURED_MERCENARY_SOLDIER_ALLY, NPC_CAPTURED_MERCENARY_SOLDIER_HORDE, NPC_DARK_RUNE_ACOLYTE_G, NPC_DARK_RUNE_ACOLYTE_I, NPC_IRON_HONOR_GUARD, NPC_IRON_RING_GUARD, NPC_JORMUNGAR_BEHEMOT, NPC_RUNIC_COLOSSUS, WorldObject::SummonCreature(), and TEMPSUMMON_CORPSE_TIMED_DESPAWN.

Referenced by Reset().

◆ SpawnAnArenaNPC()

void boss_thorim::SpawnAnArenaNPC ( uint32  arenaNpc)
inline
594 {
595 Creature* cr;
596 uint8 rnd = urand(0,13);
597 if ((cr = me->SummonCreature(arenaNpc, ArenaNPCs[rnd], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000)))
599 Middle.GetPositionX() + urand(19, 24) * cos(Middle.GetAngle(cr)),
600 Middle.GetPositionY() + urand(19, 24) * std::sin(Middle.GetAngle(cr)),
601 Middle.GetPositionZ(), 20, 20);
602 }
std::uint8_t uint8
Definition Define.h:109
uint32 urand(uint32 min, uint32 max)
Definition Random.cpp:44
const Position ArenaNPCs[]
Definition boss_thorim.cpp:245
float GetAngle(Position const *pos) const
Definition Position.cpp:85

References ArenaNPCs, Position::GetAngle(), Unit::GetMotionMaster(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), ScriptedAI::me, Middle, MotionMaster::MoveJump(), WorldObject::SummonCreature(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, and urand().

Referenced by SpawnCommoners(), and UpdateAI().

◆ SpawnCommoners()

void boss_thorim::SpawnCommoners ( )
inline
605 {
606 uint8 rnd = urand(6,7);
607 for (uint8 i = 0; i < rnd; ++i)
609 }
@ NPC_DARK_RUNE_COMMONER
Definition boss_thorim.cpp:145
void SpawnAnArenaNPC(uint32 arenaNpc)
Definition boss_thorim.cpp:593

References NPC_DARK_RUNE_COMMONER, SpawnAnArenaNPC(), and urand().

Referenced by UpdateAI().

◆ SpellHit()

void boss_thorim::SpellHit ( Unit *  caster,
SpellInfo const *  spellInfo 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

612 {
613 if (spellInfo->Id == SPELL_LIGHTNING_ORB_CHARGER)
614 {
615 me->SetOrientation(me->GetAngle(caster));
618 events.RescheduleEvent(EVENT_THORIM_LIGHTNING_CHARGE, 10s, 0, EVENT_PHASE_RING);
619 }
620 else if (spellInfo->Id == SPELL_TELEPORT)
621 {
624 }
625 }
@ SPELL_LIGHTNING_CHARGE_BUFF
Definition boss_thorim.cpp:48
@ SPELL_LIGHTNING_ORB_CHARGER
Definition boss_thorim.cpp:50
@ SPELL_LIGHTNING_CHARGE_DAMAGE
Definition boss_thorim.cpp:47
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2216
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
@ SPELL_TELEPORT
Definition karazhan.cpp:36
void SetOrientation(float orientation)
Definition Position.h:116
@ EVENT_KEEPER_TELEPORTED
Definition ulduar.h:430

References Unit::CastSpell(), Creature::DespawnOrUnsummon(), DONE, EVENT_KEEPER_TELEPORTED, EVENT_PHASE_RING, EVENT_THORIM_LIGHTNING_CHARGE, Position::GetAngle(), SpellInfo::Id, BossAI::instance, ScriptedAI::me, ZoneScript::SetData(), Position::SetOrientation(), SPELL_LIGHTNING_CHARGE_BUFF, SPELL_LIGHTNING_CHARGE_DAMAGE, SPELL_LIGHTNING_ORB_CHARGER, and SPELL_TELEPORT.

◆ SpellHitTarget()

void boss_thorim::SpellHitTarget ( Unit *  target,
SpellInfo const *  spellInfo 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

628 {
629 if (spellInfo->Id == SPELL_LIGHTNING_CHARGE_DAMAGE && target->IsPlayer())
630 _hitByLightning = true;
631 }

References _hitByLightning, SpellInfo::Id, Object::IsPlayer(), and SPELL_LIGHTNING_CHARGE_DAMAGE.

◆ SummonedCreatureDies()

void boss_thorim::SummonedCreatureDies ( Creature *  summon,
Unit *   
)
inlineoverridevirtual

Reimplemented from CreatureAI.

484 {
485 // start pack deaths must be counted here: a member killed while Mind Controlled
486 // still has PossessedAI installed when it dies, so its own JustDied never runs
491 }
bool EntryEquals(T... entries) const
Definition Object.h:240
void DoAction(int32 param) override
Definition boss_thorim.cpp:454

References ACTION_START_TRASH_DIED, DoAction(), Object::EntryEquals(), NPC_CAPTURED_MERCENARY_CAPTAIN_ALLY, NPC_CAPTURED_MERCENARY_CAPTAIN_HORDE, NPC_CAPTURED_MERCENARY_SOLDIER_ALLY, NPC_CAPTURED_MERCENARY_SOLDIER_HORDE, NPC_DARK_RUNE_ACOLYTE_I, and NPC_JORMUNGAR_BEHEMOT.

◆ UpdateAI()

void boss_thorim::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

644 {
646 return;
647
648 events.Update(diff);
650 return;
651
652 switch (events.ExecuteEvent())
653 {
656 events.ScheduleEvent(EVENT_THORIM_AGGRO2, 9s);
657
659 go->SetGoState(GO_STATE_READY);
660
661 break;
664 events.ScheduleEvent(EVENT_THORIM_SUMMON_SIF, 6500ms);
665 break;
667 me->SummonCreature(NPC_SIF, 2148.3f, -297.845f, 438.331f, 2.688f);
668 break;
670 {
672 events.ScheduleEvent(EVENT_THORIM_CHARGE_ORB, 14s, 0, EVENT_PHASE_START);
677 events.ScheduleEvent(EVENT_THORIM_LIGHTNING_ORB, 5s, 0, EVENT_PHASE_START); // checked every 5 secs if there are players on arena
681 break;
682 }
685 events.Repeat(16s);
686 break;
689 events.Repeat(16s);
690 break;
692 {
693 if (GetArenaPlayer())
694 {
695 // Player found, repeat and return
696 events.Repeat(5s);
697 return;
698 }
699
700 // No players found
701 Talk(SAY_WIPE);
703
704 _isArenaEmpty = true;
706 break;
707 }
709 _isArenaEmpty = true;
713 break;
716 events.Repeat(15s);
717 break;
720 events.Repeat(20s);
721 break;
724 events.Repeat(21s);
725 break;
728 events.Repeat(25s);
729 break;
732 events.Repeat(20s);
733 break;
736 break;
739 me->CastSpell(target, SPELL_CHAIN_LIGHTNING, false);
740 events.Repeat(15s);
741 break;
743 me->CastSpell(me, SPELL_BERSERK, true);
745 break;
747 if (_hardMode)
748 {
750 events.ScheduleEvent(EVENT_THORIM_OUTRO2, 5s, 0, 3);
753 }
754 else
755 {
757 events.ScheduleEvent(EVENT_THORIM_OUTRO2, 9s, 0, 3);
758 }
759 break;
761 if (_hardMode)
762 {
764 events.ScheduleEvent(EVENT_THORIM_OUTRO3, 12s, 0, 3);
765 }
766 else
767 {
769 events.ScheduleEvent(EVENT_THORIM_OUTRO3, 10s, 0, 3);
770 }
771 break;
773 if (_hardMode)
774 {
776 }
777 else
778 {
780 }
781 events.ScheduleEvent(EVENT_THORIM_OUTRO4, 14s, 0, 3);
782 break;
785 break;
786 }
787
790 }
@ SPELLVALUE_MAX_TARGETS
Definition SpellDefines.h:125
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ EVENT_THORIM_NOT_REACH_IN_TIME
Definition boss_thorim.cpp:171
@ EVENT_THORIM_LIGHTNING_ORB
Definition boss_thorim.cpp:170
@ EVENT_THORIM_OUTRO3
Definition boss_thorim.cpp:184
@ EVENT_THORIM_OUTRO4
Definition boss_thorim.cpp:185
@ EVENT_THORIM_STORMHAMMER
Definition boss_thorim.cpp:168
@ EVENT_THORIM_ARENA_SPAWN_EVOKER
Definition boss_thorim.cpp:173
@ EVENT_THORIM_ARENA_SPAWN_WARBRINGER
Definition boss_thorim.cpp:172
@ EVENT_THORIM_OUTRO2
Definition boss_thorim.cpp:183
@ EVENT_THORIM_SUMMON_SIF
Definition boss_thorim.cpp:223
@ EVENT_THORIM_ARENA_SPAWN_COMMONER
Definition boss_thorim.cpp:174
@ EVENT_THORIM_CHARGE_ORB
Definition boss_thorim.cpp:169
@ EVENT_THORIM_AGGRO2
Definition boss_thorim.cpp:181
@ EVENT_THORIM_ARENA_SPAWN_CHAMPION
Definition boss_thorim.cpp:175
@ ACTION_SIF_TRANSFORM
Definition boss_thorim.cpp:301
@ ACTION_SIF_START_DOMINION
Definition boss_thorim.cpp:300
@ NPC_DARK_RUNE_WARBRINGER
Definition boss_thorim.cpp:142
@ NPC_DARK_RUNE_CHAMPION
Definition boss_thorim.cpp:144
@ NPC_DARK_RUNE_EVOKER
Definition boss_thorim.cpp:143
@ NPC_LIGHTNING_ORB
Definition boss_thorim.cpp:157
@ SAY_AGGRO_2
Definition boss_thorim.cpp:267
@ SAY_WIPE
Definition boss_thorim.cpp:274
@ SAY_END_HARD_3
Definition boss_thorim.cpp:281
@ SAY_END_NORMAL_3
Definition boss_thorim.cpp:278
@ SAY_END_NORMAL_2
Definition boss_thorim.cpp:277
@ SAY_END_NORMAL_1
Definition boss_thorim.cpp:276
@ SAY_END_HARD_1
Definition boss_thorim.cpp:279
@ SAY_AGGRO_1
Definition boss_thorim.cpp:266
@ SAY_BERSERK
Definition boss_thorim.cpp:273
@ SAY_END_HARD_2
Definition boss_thorim.cpp:280
@ SPELL_UNBALANCING_STRIKE
Definition boss_thorim.cpp:40
@ SPELL_STORMHAMMER
Definition boss_thorim.cpp:37
@ SPELL_CHARGE_ORB
Definition boss_thorim.cpp:43
@ SPELL_BERSERK_FRIENDS
Definition boss_thorim.cpp:38
@ SPELL_CHAIN_LIGHTNING
Definition boss_thorim.cpp:39
@ SPELL_BERSERK
Definition boss_thorim.cpp:41
@ SPELL_LIGHTNING_PILLAR_P2
Definition boss_thorim.cpp:49
bool UpdateVictim()
Definition CreatureAI.cpp:350
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:41
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:399
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:112
Definition Unit.h:665
SpellCastResult CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition Unit.cpp:1429
bool HasUnitState(const uint32 f) const
Definition Unit.h:737
void SpawnCommoners()
Definition boss_thorim.cpp:604

References _hardMode, _isArenaEmpty, ACTION_SIF_START_DOMINION, ACTION_SIF_TRANSFORM, BOSS_THORIM, Unit::CastCustomSpell(), Unit::CastSpell(), DATA_THORIM_FENCE, SummonList::DoAction(), UnitAI::DoCastSelf(), UnitAI::DoMeleeAttackIfReady(), DONE, EVENT_PHASE_START, EVENT_THORIM_AGGRO, EVENT_THORIM_AGGRO2, EVENT_THORIM_ARENA_SPAWN_CHAMPION, EVENT_THORIM_ARENA_SPAWN_COMMONER, EVENT_THORIM_ARENA_SPAWN_EVOKER, EVENT_THORIM_ARENA_SPAWN_WARBRINGER, EVENT_THORIM_BERSERK, EVENT_THORIM_CHAIN_LIGHTNING, EVENT_THORIM_CHARGE_ORB, EVENT_THORIM_LIGHTNING_CHARGE, EVENT_THORIM_LIGHTNING_ORB, EVENT_THORIM_NOT_REACH_IN_TIME, EVENT_THORIM_OUTRO1, EVENT_THORIM_OUTRO2, EVENT_THORIM_OUTRO3, EVENT_THORIM_OUTRO4, EVENT_THORIM_START_PHASE1, EVENT_THORIM_STORMHAMMER, EVENT_THORIM_SUMMON_SIF, EVENT_THORIM_UNBALANCING_STRIKE, GetArenaPlayer(), InstanceScript::GetBossState(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), GetThorimObject(), Unit::GetVictim(), GO_STATE_READY, Unit::HasUnitState(), BossAI::instance, ScriptedAI::me, NPC_DARK_RUNE_CHAMPION, NPC_DARK_RUNE_EVOKER, NPC_DARK_RUNE_WARBRINGER, NPC_LIGHTNING_ORB, NPC_SIF, Random, SAY_AGGRO_1, SAY_AGGRO_2, SAY_BERSERK, SAY_END_HARD_1, SAY_END_HARD_2, SAY_END_HARD_3, SAY_END_NORMAL_1, SAY_END_NORMAL_2, SAY_END_NORMAL_3, SAY_WIPE, UnitAI::SelectTarget(), SpawnAnArenaNPC(), SpawnCommoners(), SPELL_BERSERK, SPELL_BERSERK_FRIENDS, SPELL_CHAIN_LIGHTNING, SPELL_CHARGE_ORB, SPELL_LIGHTNING_PILLAR_P2, SPELL_STORMHAMMER, SPELL_TELEPORT, SPELL_UNBALANCING_STRIKE, SPELLVALUE_MAX_TARGETS, WorldObject::SummonCreature(), BossAI::summons, UNIT_STATE_CASTING, and CreatureAI::UpdateVictim().

Member Data Documentation

◆ _hardMode

bool boss_thorim::_hardMode

Referenced by DamageTaken(), GetData(), Reset(), and UpdateAI().

◆ _hitByLightning

bool boss_thorim::_hitByLightning

Referenced by GetData(), Reset(), and SpellHitTarget().

◆ _isAlly

bool boss_thorim::_isAlly

Referenced by Reset(), and SpawnAllNPCs().

◆ _isArenaEmpty

bool boss_thorim::_isArenaEmpty

Referenced by Reset(), and UpdateAI().

◆ _isHitAllowed

bool boss_thorim::_isHitAllowed

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

◆ _spawnCommoners

bool boss_thorim::_spawnCommoners

Referenced by Reset().

◆ _trashCounter

uint8 boss_thorim::_trashCounter

Referenced by DoAction(), and Reset().


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