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 JustEngagedWith (Unit *) override
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
GameObjectGetHardmodeChest ()
 
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
 
CreatureGetHelper (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)
 
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 >
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
 
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
 
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 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 void InitializeAI ()
 
virtual void DoAction (int32)
 
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 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
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 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)
 
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)
 
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:485
InstanceScript *const instance
Definition ScriptedCreature.h:492
virtual bool SetBossState(uint32 id, EncounterState state)
Definition InstanceScript.cpp:400
bool IsAlive() const
Definition Unit.h:1793
Creature * me
Definition ScriptedCreature.h:281
@ BOSS_HODIR
Definition ulduar.h:39

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.

549 {
550 if (t->IsPlayer())
551 return !t->HasAura(SPELL_FLASH_FREEZE_TRAPPED_PLAYER);
552 else if (t->IsCreature())
553 return !t->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC);
554
555 return true;
556 }
@ 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.

334 {
335 if (damage >= me->GetHealth() || me->GetHealth() < 150000)
336 {
337 damage = 0;
340 {
341 if (instance)
342 {
344 me->CastSpell(me, 64899, true); // credit
346 }
347
351 me->AttackStop();
352 me->CombatStop();
355
356 events.Reset();
357
358 // Manually despawn helpers
359 summons.DespawnIf([this](ObjectGuid guid) -> bool
360 {
361 return std::ranges::none_of(Helpers, [guid](ObjectGuid Helper) { return guid == Helper; });
362 });
363
364 // Start victory emote sequence on surviving helpers
366
368 scheduler.Schedule(14s, [this](TaskContext /*context*/)
369 {
371 });
372 }
373 }
374 }
@ FACTION_FRIENDLY
Definition SharedDefines.h:189
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:258
@ REACT_PASSIVE
Definition Unit.h:567
@ SPELL_BITING_COLD_PLAYER_AURA
Definition boss_hodir.cpp:36
@ TEXT_DEATH
Definition boss_hodir.cpp:154
events
Definition boss_sartura.cpp:43
SummonList summons
Definition ScriptedCreature.h:539
TaskScheduler scheduler
Definition CreatureAI.h:74
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition Creature.h:100
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition InstanceScript.cpp:701
void Clear(bool reset=true)
Definition MotionMaster.h:193
Definition ObjectGuid.h:121
void DespawnIf(T const &predicate)
Definition ScriptedCreature.h:97
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:394
void SetFaction(uint32 faction)
Definition Unit.cpp:7117
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4312
MotionMaster * GetMotionMaster()
Definition Unit.h:1758
bool HasUnitFlag(UnitFlags flags) const
Definition Unit.h:748
uint32 GetHealth() const
Definition Unit.h:1109
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:1361
void RemoveAllAuras()
Definition Unit.cpp:5612
void CombatStop(bool includingCast=false, bool mutualPvP=true)
Definition Unit.cpp:7532
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:749
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition Unit.cpp:7499
Talk
Definition hyjal.cpp:82
@ SPELL_TELEPORT
Definition karazhan.cpp:36
void DoHelperVictoryEmotes()
Definition boss_hodir.cpp:512
ObjectGuid Helpers[8]
Definition boss_hodir.cpp:220

References Unit::AttackStop(), BOSS_HODIR, Unit::CastSpell(), MotionMaster::Clear(), Unit::CombatStop(), SummonList::DespawnIf(), 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_TELEPORT, BossAI::summons, TEXT_DEATH, and UNIT_FLAG_NON_ATTACKABLE.

◆ DoAction()

void boss_hodir::DoAction ( int  action)
inlineoverride
289 {
290 if (action)
291 {
292 switch (action)
293 {
296 bAchievCacheRare = false;
297 if (instance)
298 {
299 if (GameObject* go = GetHardmodeChest())
300 me->CastSpell(go, SPELL_SHATTER_CHEST, false);
301 }
302 break;
303 }
304 }
305 }
@ 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:120
GameObject * GetHardmodeChest()
Definition boss_hodir.cpp:281
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
513 {
514 for (uint8 i = 0; i < 8; ++i)
515 {
516 Creature* helper = GetHelper(i);
517 if (!helper)
518 continue;
519
520 if (!helper->IsAlive())
521 {
522 helper->DespawnOrUnsummon();
523 continue;
524 }
525
526 // Stop combat behavior and start victory emote chain
527 helper->AI()->DoAction(ACTION_VICTORY_EMOTE);
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 // First cheer
539 }
540 }
std::uint8_t uint8
Definition Define.h:109
@ EMOTE_ONESHOT_CHEER_NO_SHEATHE
Definition SharedDefines.h:1950
@ 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:2199
CreatureAI * AI() const
Definition Creature.h:144
virtual void DoAction(int32)
Definition UnitAI.h:217
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:5050
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:6017
void HandleEmoteCommand(uint32 emoteId)
Definition Unit.cpp:2187
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2553
Creature * GetHelper(uint8 index)
Definition boss_hodir.cpp:464

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(), and SPELL_FLASH_FREEZE_TRAPPED_NPC.

Referenced by DamageTaken().

◆ GetData()

uint32 boss_hodir::GetData ( uint32  id) const
inlineoverridevirtual

Reimplemented from UnitAI.

576 {
577 switch (id)
578 {
579 case 1:
580 return (bAchievCheese ? 1 : 0);
581 case 2:
582 return (bAchievGettingCold ? 1 : 0);
583 case 3:
584 return (bAchievCacheRare ? 1 : 0);
585 case 4:
586 return (bAchievCoolestFriends ? 1 : 0);
587 }
588 return 0;
589 }
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
282 {
284 return go;
286 }
GameObject * GetGameObject(uint32 type)
Definition InstanceScript.cpp:125
@ DATA_HODIR_CHEST_HARD
Definition ulduar.h:140
@ DATA_HODIR_CHEST_HARD_HERO
Definition ulduar.h:142

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
465 {
466 return Helpers[index] ? ObjectAccessor::GetCreature(*me, Helpers[index]) : nullptr;
467 }
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.

260 {
262 // Hard mode timer: periodic dummy aura whose tick shatters the Rare Cache (sniffed on retail)
264 SmallIcicles(true);
265 events.Reset();
266 events.ScheduleEvent(EVENT_FLASH_FREEZE, 48s, 49s);
267 events.ScheduleEvent(EVENT_FREEZE, 17s, 20s);
268 events.ScheduleEvent(EVENT_BERSERK, 8min);
270
271 // Helpers spawn IMMUNE_TO_NPC so idle bosses (e.g. Freya's Ground Tremor, #26330) can't tag
272 // them; drop it on engage. TODO: confirm timing - sniffs may clear it per-helper on unfreeze.
273 for (uint8 i = 0; i < 8; ++i)
274 if (Creature* helper = GetHelper(i))
275 helper->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC);
276
279 }
@ IN_PROGRESS
Definition InstanceScript.h:59
@ UNIT_FLAG_IMMUNE_TO_NPC
Definition UnitDefines.h:266
@ 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:307

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:526
@ 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.

◆ KilledUnit()

void boss_hodir::KilledUnit ( Unit who)
inlineoverridevirtual

Reimplemented from CreatureAI.

543 {
544 if (who->IsPlayer())
546 }
@ TEXT_SLAY
Definition boss_hodir.cpp:151
bool IsPlayer() const
Definition Object.h:201

References Object::IsPlayer(), and TEXT_SLAY.

◆ MoveInLineOfSight()

void boss_hodir::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

591{}

◆ 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:644
size_type size() const
Definition ScriptedCreature.h:78
virtual void SetSheath(SheathState sheathed)
Definition Unit.h:1777
void SpawnHelpers()
Definition boss_hodir.cpp:469
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.

559 {
560 if (value)
561 switch (id)
562 {
563 case 1:
564 bAchievCheese = false;
565 break;
566 case 2:
567 bAchievGettingCold = false;
568 break;
569 case 4:
570 bAchievCoolestFriends = false;
571 break;
572 }
573 }

References bAchievCheese, bAchievCoolestFriends, and bAchievGettingCold.

◆ SmallIcicles()

void boss_hodir::SmallIcicles ( bool  enable)
inline
308 {
309 if (enable)
311 else
313 }
@ 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
470 {
471 char faction = 'A';
472 if (hhd[0][0].id)
473 {
474 Map::PlayerList const& cl = me->GetMap()->GetPlayers();
475 for (Map::PlayerList::const_iterator itr = cl.begin(); itr != cl.end(); ++itr)
476 if (!itr->GetSource()->IsGameMaster())
477 {
478 faction = (itr->GetSource()->GetTeamId() == TEAM_ALLIANCE ? 'A' : 'H');
479 break;
480 }
481 }
482
483 uint8 cnt = 0;
484 if (faction)
485 for( uint8 k = 0; k < 4; ++k )
486 {
487 if ((faction == 'A' && ( k > 1 || (k == 1 && RAID_MODE(1, 0)))) ||
488 (faction == 'H' && ( k < 2 || (k == 3 && RAID_MODE(1, 0)))))
489 continue;
490
491 for( uint8 i = 0; i < 4; ++i )
492 {
493 if (!hhd[k][i].id)
494 continue;
495
496 if (Creature* h_p = me->SummonCreature(hhd[k][i].id, hhd[k][i].pos))
497 {
498 h_p->SetFaction(1665);
499 if (cnt < 8)
500 Helpers[cnt++] = h_p->GetGUID();
501
502 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))
503 {
504 c->CastSpell(h_p, SPELL_FLASH_FREEZE_TRAPPED_NPC, true);
505 JustSummoned(c);
506 }
507 }
508 }
509 }
510 }
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:54
@ TEAM_ALLIANCE
Definition SharedDefines.h:748
HodirHelperData hhd[4][4]
Definition boss_hodir.cpp:182
void JustSummoned(Creature *summon) override
Definition ScriptedCreature.cpp:725
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:631
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:2448
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:408

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.

456 {
457 if (spellInfo->Id == SPELL_TELEPORT)
458 {
461 }
462 }
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
@ EVENT_KEEPER_TELEPORTED
Definition ulduar.h:381

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.

316 {
317 switch (spell->Id)
318 {
321 break;
323 {
324 std::list<Creature*> fires;
326 for (std::list<Creature*>::iterator itr = fires.begin(); itr != fires.end(); ++itr)
327 (*itr)->AI()->DoAction(1); // remove it
328 }
329 break;
330 }
331 }
@ 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:3115

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.

377 {
378 scheduler.Update(diff);
380 {
382 return;
383 }
384
385 if (!UpdateVictim())
386 {
387 if (me->IsInCombat())
388 {
389 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
390 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
391 itr->GetSource()->CastSpell(itr->GetSource(), SPELL_FLASH_FREEZE_INSTAKILL, true);
393 }
394 return;
395 }
396
397 events.Update(diff);
398
400 return;
401
402 switch (events.ExecuteEvent())
403 {
404 case 0:
405 break;
406 case EVENT_BERSERK:
407 {
408 berserk = true;
409 me->CastSpell(me, SPELL_BERSERK, true);
411 }
412 break;
414 {
416 me->CastSpell((Unit*)nullptr, SPELL_FLASH_FREEZE_CAST, false);
420 SmallIcicles(false);
421 events.ScheduleEvent(EVENT_FLASH_FREEZE, 48s, 49s);
422 events.ScheduleEvent(EVENT_SMALL_ICICLES_ENABLE, Is25ManRaid() ? 12s : 24s);
423 events.ScheduleEvent(EVENT_FROZEN_BLOWS, 15s);
424 events.RescheduleEvent(EVENT_FREEZE, 17s, 20s);
425 }
426 break;
428 {
429 SmallIcicles(true);
430 }
431 break;
433 {
437 }
438 break;
439 case EVENT_FREEZE:
441 {
442 me->CastSpell(plr, SPELL_FREEZE, false);
443 }
444 else if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
445 {
446 me->CastSpell(target, SPELL_FREEZE, false);
447 }
448 events.RescheduleEvent(EVENT_FREEZE, 17s, 20s);
449 break;
450 }
451
453 }
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ SPELL_ICICLE_FORCE_CAST_H
Definition boss_hodir.cpp:57
@ SPELL_FLASH_FREEZE_CAST
Definition boss_hodir.cpp:41
@ SPELL_FLASH_FREEZE_INSTAKILL
Definition boss_hodir.cpp:42
@ 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:112
Definition Unit.h:665
bool HasUnitState(const uint32 f) const
Definition Unit.h:737
bool IsInCombat() const
Definition Unit.h:936
void PlayDirectSound(uint32 sound_id, Player *target=nullptr)
Definition Object.cpp:3011
float GetPositionY() const
Definition Position.h:122
bool Is25ManRaid() const
Definition ScriptedCreature.h:389
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 MapRefMgr::begin(), berserk, Unit::CastSpell(), UnitAI::DoCastSelf(), UnitAI::DoMeleeAttackIfReady(), MapRefMgr::end(), CreatureAI::EnterEvadeMode(), BossAI::EnterEvadeMode(), ENTRANCE_DOOR, EVENT_BERSERK, EVENT_FLASH_FREEZE, EVENT_FREEZE, EVENT_FROZEN_BLOWS, EVENT_SMALL_ICICLES_ENABLE, EXIT_DOOR, WorldObject::GetMap(), Map::GetPlayers(), 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_INSTAKILL, 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: