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

Public Member Functions

 boss_hodir (Creature *creature)
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
void Reset () override
 
void JustRespawned () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
GameObject * GetHardmodeChest ()
 
void DoAction (int action) override
 
void SmallIcicles (bool enable)
 
void SpellHitTarget (Unit *target, SpellInfo const *spell) override
 
void DamageTaken (Unit *, uint32 &damage, 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 SpellHit (Unit *, SpellInfo const *spellInfo) override
 
Creature * GetHelper (uint8 index)
 
void SpawnHelpers ()
 
void DoHelperVictoryEmotes ()
 
void KilledUnit (Unit *who) override
 
bool CanAIAttack (Unit const *t) const override
 
void SetData (uint32 id, uint32 value) override
 
uint32 GetData (uint32 id) const override
 
void MoveInLineOfSight (Unit *) override
 
- 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 SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
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 void InitializeAI ()
 
virtual void DoAction (int32)
 
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

ObjectGuid Helpers [8]
 
bool berserk { false }
 
bool bAchievCheese { true }
 
bool bAchievGettingCold { true }
 
bool bAchievCacheRare { true }
 
bool bAchievCoolestFriends { true }
 
uint16 addSpawnTimer { 0 }
 
const Position ENTRANCE_DOOR { 1999.160034f, -297.792999f, 431.960999f, 0 }
 
const Position EXIT_DOOR { 1999.709961f, -166.259003f, 432.822998f, 0 }
 
- 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)
 
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_hodir()

boss_hodir::boss_hodir ( Creature *  creature)
inline
214 : BossAI(creature, BOSS_HODIR)
215 {
216 if (!me->IsAlive())
218 }
@ DONE
Definition InstanceScript.h:61
Definition ScriptedCreature.h:496
InstanceScript *const instance
Definition ScriptedCreature.h:503
virtual bool SetBossState(uint32 id, EncounterState state)
Definition InstanceScript.cpp:406
bool IsAlive() const
Definition Unit.h:1812
Creature * me
Definition ScriptedCreature.h:292
@ BOSS_HODIR
Definition ulduar.h:38

References BOSS_HODIR, DONE, BossAI::instance, Unit::IsAlive(), ScriptedAI::me, and InstanceScript::SetBossState().

Member Function Documentation

◆ CanAIAttack()

bool boss_hodir::CanAIAttack ( Unit const *  t) const
inlineoverridevirtual

Reimplemented from UnitAI.

555 {
556 if (t->IsPlayer())
557 return !t->HasAura(SPELL_FLASH_FREEZE_TRAPPED_PLAYER);
558 else if (t->IsCreature())
559 return !t->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC);
560
561 return true;
562 }
@ SPELL_FLASH_FREEZE_TRAPPED_PLAYER
Definition boss_hodir.cpp:43
@ SPELL_FLASH_FREEZE_TRAPPED_NPC
Definition boss_hodir.cpp:44

References Unit::HasAura(), Object::IsCreature(), Object::IsPlayer(), SPELL_FLASH_FREEZE_TRAPPED_NPC, and SPELL_FLASH_FREEZE_TRAPPED_PLAYER.

◆ DamageTaken()

void boss_hodir::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.

341 {
342 if (damage >= me->GetHealth() || me->GetHealth() < 150000)
343 {
344 damage = 0;
347 {
348 if (instance)
349 {
351 me->CastSpell(me, 64899, true); // credit
354 }
355
359 me->AttackStop();
360 me->CombatStop();
363
364 events.Reset();
365
366 // Helpers stay for their outro; despawn everything else Hodir summoned.
368 {
369 return std::ranges::none_of(Helpers, [guid](ObjectGuid helper) { return guid == helper; });
370 });
371
372 // Start victory emote sequence on surviving helpers
374
376 scheduler.Schedule(14s, [this](TaskContext /*context*/)
377 {
379 });
380 }
381 }
382 }
@ FACTION_FRIENDLY
Definition SharedDefines.h:189
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:258
@ REACT_PASSIVE
Definition Unit.h:574
@ SPELL_BITING_COLD_PLAYER_AURA
Definition boss_hodir.cpp:36
@ SPELL_FLASH_FREEZE_CAST
Definition boss_hodir.cpp:41
@ TEXT_DEATH
Definition boss_hodir.cpp:154
events
Definition boss_sartura.cpp:43
SummonList summons
Definition ScriptedCreature.h:550
TaskScheduler scheduler
Definition CreatureAI.h:74
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:99
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition InstanceScript.cpp:707
void Clear(bool reset=true)
Definition MotionMaster.h:194
Definition ObjectGuid.h:121
void DespawnMatching(T predicate)
Despawns every summon matching the predicate.
Definition ScriptedCreature.h:104
Definition TaskScheduler.h:422
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition TaskScheduler.h:233
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:399
void SetFaction(uint32 faction)
Definition Unit.cpp:6886
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4079
MotionMaster * GetMotionMaster()
Definition Unit.h:1774
bool HasUnitFlag(UnitFlags flags) const
Definition Unit.h:753
void CombatStop(bool includingCast=false, bool mutualPvP=true, bool keepPvPForOthers=false)
Definition Unit.cpp:7303
uint32 GetHealth() const
Definition Unit.h:1122
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:1378
void RemoveAllAuras()
Definition Unit.cpp:5393
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:754
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition Unit.cpp:7270
Talk
Definition hyjal.cpp:82
@ SPELL_TELEPORT
Definition karazhan.cpp:36
void DoHelperVictoryEmotes()
Definition boss_hodir.cpp:515
ObjectGuid Helpers[8]
Definition boss_hodir.cpp:220

References Unit::AttackStop(), BOSS_HODIR, Unit::CastSpell(), MotionMaster::Clear(), Unit::CombatStop(), SummonList::DespawnMatching(), UnitAI::DoCastSelf(), DoHelperVictoryEmotes(), DONE, InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), FACTION_FRIENDLY, Unit::GetHealth(), Unit::GetMotionMaster(), Unit::HasUnitFlag(), Helpers, BossAI::instance, Unit::InterruptNonMeleeSpells(), ScriptedAI::me, REACT_PASSIVE, Unit::RemoveAllAuras(), TaskScheduler::Schedule(), CreatureAI::scheduler, InstanceScript::SetBossState(), Unit::SetFaction(), Creature::SetReactState(), Unit::SetUnitFlag(), SPELL_BITING_COLD_PLAYER_AURA, SPELL_FLASH_FREEZE_CAST, SPELL_TELEPORT, BossAI::summons, TEXT_DEATH, and UNIT_FLAG_NON_ATTACKABLE.

◆ DoAction()

void boss_hodir::DoAction ( int  action)
inlineoverride
296 {
297 if (action)
298 {
299 switch (action)
300 {
303 bAchievCacheRare = false;
304 if (instance)
305 {
306 if (GameObject* go = GetHardmodeChest())
307 me->CastSpell(go, SPELL_SHATTER_CHEST, false);
308 }
309 break;
310 }
311 }
312 }
@ SPELL_SHATTER_CHEST
Definition boss_hodir.cpp:48
@ EVENT_HARD_MODE_MISSED
Definition boss_hodir.cpp:128
@ TEXT_HM_MISS
Definition boss_hodir.cpp:156
Definition GameObject.h:125
GameObject * GetHardmodeChest()
Definition boss_hodir.cpp:288
bool bAchievCacheRare
Definition boss_hodir.cpp:224

References bAchievCacheRare, Unit::CastSpell(), EVENT_HARD_MODE_MISSED, GetHardmodeChest(), BossAI::instance, ScriptedAI::me, SPELL_SHATTER_CHEST, and TEXT_HM_MISS.

◆ DoHelperVictoryEmotes()

void boss_hodir::DoHelperVictoryEmotes ( )
inline
516 {
517 for (uint8 i = 0; i < 8; ++i)
518 {
519 Creature* helper = GetHelper(i);
520 if (!helper)
521 continue;
522
523 if (!helper->IsAlive())
524 {
525 helper->DespawnOrUnsummon();
526 continue;
527 }
528
529 // Thaw if still frozen
531 {
533 if (Creature* iceBlock = helper->FindNearestCreature(NPC_FLASH_FREEZE_NPC, 5.0f))
534 iceBlock->DespawnOrUnsummon();
535 }
536
537 // Keep other NPCs from tagging the helper during the outro
539
540 // Stop combat behavior and start victory emote chain
541 helper->AI()->DoAction(ACTION_VICTORY_EMOTE);
542
543 // First cheer
545 }
546 }
std::uint8_t uint8
Definition Define.h:109
@ EMOTE_ONESHOT_CHEER_NO_SHEATHE
Definition SharedDefines.h:1950
@ UNIT_FLAG_IMMUNE_TO_NPC
Definition UnitDefines.h:266
@ NPC_FLASH_FREEZE_NPC
Definition boss_hodir.cpp:113
@ ACTION_VICTORY_EMOTE
Definition boss_hodir.cpp:174
Definition Creature.h:47
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2221
CreatureAI * AI() const
Definition Creature.h:143
virtual void DoAction(int32)
Definition UnitAI.h:217
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:4830
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5798
void HandleEmoteCommand(uint32 emoteId)
Definition Unit.cpp:2202
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2565
Creature * GetHelper(uint8 index)
Definition boss_hodir.cpp:467

References ACTION_VICTORY_EMOTE, Creature::AI(), Creature::DespawnOrUnsummon(), UnitAI::DoAction(), EMOTE_ONESHOT_CHEER_NO_SHEATHE, WorldObject::FindNearestCreature(), GetHelper(), Unit::HandleEmoteCommand(), Unit::HasAura(), Unit::IsAlive(), NPC_FLASH_FREEZE_NPC, Unit::RemoveAura(), Unit::SetUnitFlag(), SPELL_FLASH_FREEZE_TRAPPED_NPC, and UNIT_FLAG_IMMUNE_TO_NPC.

Referenced by DamageTaken().

◆ GetData()

uint32 boss_hodir::GetData ( uint32  id) const
inlineoverridevirtual

Reimplemented from UnitAI.

582 {
583 switch (id)
584 {
585 case 1:
586 return (bAchievCheese ? 1 : 0);
587 case 2:
588 return (bAchievGettingCold ? 1 : 0);
589 case 3:
590 return (bAchievCacheRare ? 1 : 0);
591 case 4:
592 return (bAchievCoolestFriends ? 1 : 0);
593 }
594 return 0;
595 }
bool bAchievCoolestFriends
Definition boss_hodir.cpp:225
bool bAchievCheese
Definition boss_hodir.cpp:222
bool bAchievGettingCold
Definition boss_hodir.cpp:223

References bAchievCacheRare, bAchievCheese, bAchievCoolestFriends, and bAchievGettingCold.

◆ GetHardmodeChest()

GameObject * boss_hodir::GetHardmodeChest ( )
inline
289 {
291 return go;
293 }
GameObject * GetGameObject(uint32 type)
Definition InstanceScript.cpp:131
@ DATA_HODIR_CHEST_HARD
Definition ulduar.h:141
@ DATA_HODIR_CHEST_HARD_HERO
Definition ulduar.h:143

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

Referenced by DoAction().

◆ GetHelper()

Creature * boss_hodir::GetHelper ( uint8  index)
inline
468 {
469 return Helpers[index] ? ObjectAccessor::GetCreature(*me, Helpers[index]) : nullptr;
470 }
Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:234

References ObjectAccessor::GetCreature(), Helpers, and ScriptedAI::me.

Referenced by DoHelperVictoryEmotes(), and JustEngagedWith().

◆ JustEngagedWith()

void boss_hodir::JustEngagedWith ( Unit *  )
inlineoverridevirtual

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

Reimplemented from CreatureAI.

267 {
269 // Hard mode timer: periodic dummy aura whose tick shatters the Rare Cache (sniffed on retail)
271 SmallIcicles(true);
272 events.Reset();
273 events.ScheduleEvent(EVENT_FLASH_FREEZE, 48s, 49s);
274 events.ScheduleEvent(EVENT_FREEZE, 17s, 20s);
275 events.ScheduleEvent(EVENT_BERSERK, 8min);
277
278 // Helpers spawn IMMUNE_TO_NPC so idle bosses (e.g. Freya's Ground Tremor, #26330) can't tag
279 // them; drop it on engage. TODO: confirm timing - sniffs may clear it per-helper on unfreeze.
280 for (uint8 i = 0; i < 8; ++i)
281 if (Creature* helper = GetHelper(i))
282 helper->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC);
283
286 }
@ IN_PROGRESS
Definition InstanceScript.h:59
@ SPELL_SHATTER_CHEST_TIMER
Definition boss_hodir.cpp:49
@ SPELL_BITING_COLD_BOSS_AURA
Definition boss_hodir.cpp:35
@ EVENT_FLASH_FREEZE
Definition boss_hodir.cpp:123
@ EVENT_BERSERK
Definition boss_hodir.cpp:125
@ EVENT_FREEZE
Definition boss_hodir.cpp:126
@ TEXT_AGGRO
Definition boss_hodir.cpp:150
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:252
void SmallIcicles(bool enable)
Definition boss_hodir.cpp:314

References BOSS_HODIR, Unit::CastSpell(), DONE, EVENT_BERSERK, EVENT_FLASH_FREEZE, EVENT_FREEZE, InstanceScript::GetBossState(), GetHelper(), IN_PROGRESS, BossAI::instance, ScriptedAI::me, InstanceScript::SetBossState(), SmallIcicles(), SPELL_BITING_COLD_BOSS_AURA, SPELL_SHATTER_CHEST_TIMER, TEXT_AGGRO, and UNIT_FLAG_IMMUNE_TO_NPC.

◆ JustExitedCombat()

void boss_hodir::JustExitedCombat ( )
inlineoverridevirtual

Called when the unit leaves combat.

Reimplemented from UnitAI.

233 {
236 return;
238 }
void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER) override
Definition ScriptedCreature.h:537
@ EVADE_REASON_NO_HOSTILES
Definition CreatureAI.h:88
void EngagementOver()
Definition CreatureAI.cpp:298

References CreatureAI::EngagementOver(), BossAI::EnterEvadeMode(), CreatureAI::EVADE_REASON_NO_HOSTILES, Unit::HasUnitFlag(), ScriptedAI::me, and UNIT_FLAG_NON_ATTACKABLE.

◆ JustRespawned()

void boss_hodir::JustRespawned ( )
inlineoverridevirtual

Reimplemented from CreatureAI.

262 {
264 }
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
@ TYPE_HODIR_HM_RESET
Definition ulduar.h:54

References BossAI::instance, ZoneScript::SetData(), and TYPE_HODIR_HM_RESET.

◆ KilledUnit()

void boss_hodir::KilledUnit ( Unit *  who)
inlineoverridevirtual

Reimplemented from CreatureAI.

549 {
550 if (who->IsPlayer())
552 }
@ TEXT_SLAY
Definition boss_hodir.cpp:151
bool IsPlayer() const
Definition Object.h:207

References Object::IsPlayer(), and TEXT_SLAY.

◆ MoveInLineOfSight()

void boss_hodir::MoveInLineOfSight ( Unit *  )
inlineoverridevirtual

Reimplemented from CreatureAI.

597{}

◆ Reset()

void boss_hodir::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

241 {
242 _Reset();
243 berserk = false;
244 bAchievCheese = true;
245 bAchievGettingCold = true;
246 bAchievCacheRare = true;
249
250 // Reset the spells cast after wipe
253
254 // Reset helpers
255 if (!summons.size())
256 SpawnHelpers();
257 }
@ SHEATH_STATE_MELEE
Definition UnitDefines.h:130
void _Reset()
Definition ScriptedCreature.cpp:648
size_type size() const
Definition ScriptedCreature.h:78
virtual void SetSheath(SheathState sheathed)
Definition Unit.h:1793
void SpawnHelpers()
Definition boss_hodir.cpp:472
bool berserk
Definition boss_hodir.cpp:221

References BossAI::_Reset(), bAchievCacheRare, bAchievCheese, bAchievCoolestFriends, bAchievGettingCold, berserk, InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), BossAI::instance, ScriptedAI::me, Unit::RemoveAllAuras(), Unit::SetSheath(), SHEATH_STATE_MELEE, SummonList::size(), SpawnHelpers(), SPELL_BITING_COLD_PLAYER_AURA, and BossAI::summons.

◆ SetData()

void boss_hodir::SetData ( uint32  id,
uint32  value 
)
inlineoverridevirtual

Reimplemented from UnitAI.

565 {
566 if (value)
567 switch (id)
568 {
569 case 1:
570 bAchievCheese = false;
571 break;
572 case 2:
573 bAchievGettingCold = false;
574 break;
575 case 4:
576 bAchievCoolestFriends = false;
577 break;
578 }
579 }

References bAchievCheese, bAchievCoolestFriends, and bAchievGettingCold.

◆ SmallIcicles()

void boss_hodir::SmallIcicles ( bool  enable)
inline
315 {
316 if (enable)
318 else
320 }
@ SPELL_ICICLE_BOSS_AURA
Definition boss_hodir.cpp:51

References Unit::CastSpell(), ScriptedAI::me, Unit::RemoveAura(), and SPELL_ICICLE_BOSS_AURA.

Referenced by JustEngagedWith(), and UpdateAI().

◆ SpawnHelpers()

void boss_hodir::SpawnHelpers ( )
inline
473 {
474 char faction = 'A';
475 if (hhd[0][0].id)
476 {
477 Map::PlayerList const& cl = me->GetMap()->GetPlayers();
478 for (Map::PlayerList::const_iterator itr = cl.begin(); itr != cl.end(); ++itr)
479 if (!itr->GetSource()->IsGameMaster())
480 {
481 faction = (itr->GetSource()->GetTeamId() == TEAM_ALLIANCE ? 'A' : 'H');
482 break;
483 }
484 }
485
486 uint8 cnt = 0;
487 if (faction)
488 for( uint8 k = 0; k < 4; ++k )
489 {
490 if ((faction == 'A' && ( k > 1 || (k == 1 && RAID_MODE(1, 0)))) ||
491 (faction == 'H' && ( k < 2 || (k == 3 && RAID_MODE(1, 0)))))
492 continue;
493
494 for( uint8 i = 0; i < 4; ++i )
495 {
496 if (!hhd[k][i].id)
497 continue;
498
499 if (Creature* h_p = me->SummonCreature(hhd[k][i].id, hhd[k][i].pos))
500 {
501 h_p->SetFaction(1665);
502 if (cnt < 8)
503 Helpers[cnt++] = h_p->GetGUID();
504
505 if (Creature* c = h_p->SummonCreature(NPC_FLASH_FREEZE_NPC, h_p->GetPositionX(), h_p->GetPositionY(), h_p->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000))
506 {
507 c->CastSpell(h_p, SPELL_FLASH_FREEZE_TRAPPED_NPC, true);
508 JustSummoned(c);
509 }
510 }
511 }
512 }
513 }
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:55
@ TEAM_ALLIANCE
Definition SharedDefines.h:748
HodirHelperData hhd[4][4]
Definition boss_hodir.cpp:182
void JustSummoned(Creature *summon) override
Definition ScriptedCreature.cpp:729
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
Map * GetMap() const
Definition Object.h:637
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:2460
uint32 id
Definition boss_hodir.cpp:179
Position pos
Definition boss_hodir.cpp:180
T const & RAID_MODE(T const &normal10, T const &normal25) const
Definition ScriptedCreature.h:419

References MapRefMgr::begin(), MapRefMgr::end(), WorldObject::GetMap(), Map::GetPlayers(), Helpers, hhd, HodirHelperData::id, BossAI::JustSummoned(), ScriptedAI::me, NPC_FLASH_FREEZE_NPC, HodirHelperData::pos, ScriptedAI::RAID_MODE(), SPELL_FLASH_FREEZE_TRAPPED_NPC, WorldObject::SummonCreature(), TEAM_ALLIANCE, and TEMPSUMMON_CORPSE_TIMED_DESPAWN.

Referenced by Reset().

◆ SpellHit()

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

Reimplemented from CreatureAI.

459 {
460 if (spellInfo->Id == SPELL_TELEPORT)
461 {
464 }
465 }
@ EVENT_KEEPER_TELEPORTED
Definition ulduar.h:431

References Creature::DespawnOrUnsummon(), DONE, EVENT_KEEPER_TELEPORTED, SpellInfo::Id, BossAI::instance, ScriptedAI::me, ZoneScript::SetData(), and SPELL_TELEPORT.

◆ SpellHitTarget()

void boss_hodir::SpellHitTarget ( Unit *  target,
SpellInfo const *  spell 
)
inlineoverridevirtual

Reimplemented from CreatureAI.

323 {
324 switch (spell->Id)
325 {
328 break;
330 {
331 std::list<Creature*> fires;
333 for (std::list<Creature*>::iterator itr = fires.begin(); itr != fires.end(); ++itr)
334 (*itr)->AI()->DoAction(1); // remove it
335 }
336 break;
337 }
338 }
@ SPELL_ICICLE_TBBA
Definition boss_hodir.cpp:52
@ SPELL_FLASH_FREEZE_VISUAL
Definition boss_hodir.cpp:45
@ SPELL_ICICLE_VISUAL_UNPACKED
Definition boss_hodir.cpp:54
@ NPC_TOASTY_FIRE
Definition boss_hodir.cpp:116
void GetCreaturesWithEntryInRange(std::list< Creature * > &creatureList, float radius, uint32 entry)
Definition Object.cpp:3127

References Unit::CastSpell(), WorldObject::GetCreaturesWithEntryInRange(), SpellInfo::Id, ScriptedAI::me, NPC_TOASTY_FIRE, SPELL_FLASH_FREEZE_VISUAL, SPELL_ICICLE_TBBA, and SPELL_ICICLE_VISUAL_UNPACKED.

◆ UpdateAI()

void boss_hodir::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

385 {
386 scheduler.Update(diff);
388 {
390 return;
391 }
392
393 if (!UpdateVictim())
394 {
395 if (me->IsInCombat())
397 return;
398 }
399
400 events.Update(diff);
401
403 return;
404
405 switch (events.ExecuteEvent())
406 {
407 case 0:
408 break;
409 case EVENT_BERSERK:
410 {
411 berserk = true;
412 me->CastSpell(me, SPELL_BERSERK, true);
414 }
415 break;
417 {
419 me->CastSpell((Unit*)nullptr, SPELL_FLASH_FREEZE_CAST, false);
423 SmallIcicles(false);
424 events.ScheduleEvent(EVENT_FLASH_FREEZE, 48s, 49s);
425 events.ScheduleEvent(EVENT_SMALL_ICICLES_ENABLE, Is25ManRaid() ? 12s : 24s);
426 events.ScheduleEvent(EVENT_FROZEN_BLOWS, 15s);
427 events.RescheduleEvent(EVENT_FREEZE, 17s, 20s);
428 }
429 break;
431 {
432 SmallIcicles(true);
433 }
434 break;
436 {
440 }
441 break;
442 case EVENT_FREEZE:
444 {
445 me->CastSpell(plr, SPELL_FREEZE, false);
446 }
447 else if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
448 {
449 me->CastSpell(target, SPELL_FREEZE, false);
450 }
451 events.RescheduleEvent(EVENT_FREEZE, 17s, 20s);
452 break;
453 }
454
456 }
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ SPELL_ICICLE_FORCE_CAST_H
Definition boss_hodir.cpp:57
@ SPELL_FREEZE
Definition boss_hodir.cpp:39
@ SPELL_FROZEN_BLOWS
Definition boss_hodir.cpp:65
@ SPELL_BERSERK
Definition boss_hodir.cpp:33
@ SPELL_ICICLE_FORCE_CAST
Definition boss_hodir.cpp:56
@ EVENT_SMALL_ICICLES_ENABLE
Definition boss_hodir.cpp:127
@ EVENT_FROZEN_BLOWS
Definition boss_hodir.cpp:124
@ TEXT_BERSERK
Definition boss_hodir.cpp:155
@ TEXT_EMOTE_BLOW
Definition boss_hodir.cpp:158
@ TEXT_FLASH_FREEZE
Definition boss_hodir.cpp:152
@ TEXT_STALACTITE
Definition boss_hodir.cpp:153
@ TEXT_EMOTE_FREEZE
Definition boss_hodir.cpp:157
@ SOUND_HODIR_FLASH_FREEZE
Definition boss_hodir.cpp:166
bool UpdateVictim()
Definition CreatureAI.cpp:350
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:235
Definition Player.h:1086
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition TaskScheduler.cpp:27
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:41
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:108
Definition Unit.h:670
bool HasUnitState(const uint32 f) const
Definition Unit.h:742
bool IsInCombat() const
Definition Unit.h:949
void PlayDirectSound(uint32 sound_id, Player *target=nullptr)
Definition Object.cpp:3023
float GetPositionY() const
Definition Position.h:122
bool Is25ManRaid() const
Definition ScriptedCreature.h:400
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition ScriptedCreature.cpp:591
const Position EXIT_DOOR
Definition boss_hodir.cpp:230
const Position ENTRANCE_DOOR
Definition boss_hodir.cpp:229

References berserk, Unit::CastSpell(), UnitAI::DoCastSelf(), UnitAI::DoMeleeAttackIfReady(), CreatureAI::EnterEvadeMode(), BossAI::EnterEvadeMode(), ENTRANCE_DOOR, EVENT_BERSERK, EVENT_FLASH_FREEZE, EVENT_FREEZE, EVENT_FROZEN_BLOWS, EVENT_SMALL_ICICLES_ENABLE, EXIT_DOOR, Position::GetPositionY(), Unit::HasUnitState(), ScriptedAI::Is25ManRaid(), Unit::IsInCombat(), ScriptedAI::me, WorldObject::PlayDirectSound(), ScriptedAI::RAID_MODE(), Random, CreatureAI::scheduler, UnitAI::SelectTarget(), ScriptedAI::SelectTargetFromPlayerList(), SmallIcicles(), SOUND_HODIR_FLASH_FREEZE, SPELL_BERSERK, SPELL_FLASH_FREEZE_CAST, SPELL_FLASH_FREEZE_TRAPPED_PLAYER, SPELL_FREEZE, SPELL_FROZEN_BLOWS, SPELL_ICICLE_FORCE_CAST, SPELL_ICICLE_FORCE_CAST_H, TEXT_BERSERK, TEXT_EMOTE_BLOW, TEXT_EMOTE_FREEZE, TEXT_FLASH_FREEZE, TEXT_STALACTITE, UNIT_STATE_CASTING, TaskScheduler::Update(), and CreatureAI::UpdateVictim().

Member Data Documentation

◆ addSpawnTimer

uint16 boss_hodir::addSpawnTimer { 0 }
226{ 0 };

◆ bAchievCacheRare

bool boss_hodir::bAchievCacheRare { true }
224{ true };

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

◆ bAchievCheese

bool boss_hodir::bAchievCheese { true }
222{ true };

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

◆ bAchievCoolestFriends

bool boss_hodir::bAchievCoolestFriends { true }
225{ true };

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

◆ bAchievGettingCold

bool boss_hodir::bAchievGettingCold { true }
223{ true };

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

◆ berserk

bool boss_hodir::berserk { false }
221{ false };

Referenced by Reset(), and UpdateAI().

◆ ENTRANCE_DOOR

const Position boss_hodir::ENTRANCE_DOOR { 1999.160034f, -297.792999f, 431.960999f, 0 }
229{ 1999.160034f, -297.792999f, 431.960999f, 0 };

Referenced by UpdateAI().

◆ EXIT_DOOR

const Position boss_hodir::EXIT_DOOR { 1999.709961f, -166.259003f, 432.822998f, 0 }
230{ 1999.709961f, -166.259003f, 432.822998f, 0 };

Referenced by UpdateAI().

◆ Helpers

ObjectGuid boss_hodir::Helpers[8]

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