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 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 (const Position *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 >
const T & DUNGEON_MODE (const T &normal5, const T &heroic10) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25) const
 
template<class T >
const T & RAID_MODE (const T &normal10, const T &normal25, const T &heroic10, const T &heroic25) const
 
PlayerSelectTargetFromPlayerList (float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
 
void SetInvincibility (bool apply)
 
bool IsInvincible () const
 
void SetAutoAttackAllowed (bool allow)
 
bool IsAutoAttackAllowed () const
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
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
 
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)
 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
202 : BossAI(creature, BOSS_HODIR)
203 {
204 if (!me->IsAlive())
206 }
@ 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:390
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.

522 {
523 if (t->IsPlayer())
524 return !t->HasAura(SPELL_FLASH_FREEZE_TRAPPED_PLAYER);
525 else if (t->IsCreature())
526 return !t->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC);
527
528 return true;
529 }
@ SPELL_FLASH_FREEZE_TRAPPED_PLAYER
Definition boss_hodir.cpp:42
@ SPELL_FLASH_FREEZE_TRAPPED_NPC
Definition boss_hodir.cpp:43

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.

316 {
317 if (damage >= me->GetHealth() || me->GetHealth() < 150000)
318 {
319 damage = 0;
322 {
323 if (instance)
324 {
326 me->CastSpell(me, 64899, true); // credit
328 }
329
333 me->AttackStop();
334 me->CombatStop();
337
338 events.Reset();
340
342 scheduler.Schedule(14s, [this](TaskContext /*context*/)
343 {
345 });
346 }
347 }
348 }
@ FACTION_FRIENDLY
Definition SharedDefines.h:189
@ UNIT_FLAG_NON_ATTACKABLE
Definition UnitDefines.h:258
@ REACT_PASSIVE
Definition Unit.h:566
@ SPELL_BITING_COLD_PLAYER_AURA
Definition boss_hodir.cpp:35
@ TEXT_DEATH
Definition boss_hodir.cpp:147
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:99
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition InstanceScript.cpp:688
void Clear(bool reset=true)
Definition MotionMaster.h:193
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:72
Definition TaskScheduler.h:421
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition TaskScheduler.h:232
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:394
void SetFaction(uint32 faction)
Definition Unit.cpp:7056
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4302
MotionMaster * GetMotionMaster()
Definition Unit.h:1758
bool HasUnitFlag(UnitFlags flags) const
Definition Unit.h:747
uint32 GetHealth() const
Definition Unit.h:1108
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:1350
void RemoveAllAuras()
Definition Unit.cpp:5580
void CombatStop(bool includingCast=false, bool mutualPvP=true)
Definition Unit.cpp:7469
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition Unit.h:748
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition Unit.cpp:7436
Talk
Definition hyjal.cpp:82
@ SPELL_TELEPORT
Definition karazhan.cpp:36

References Unit::AttackStop(), BOSS_HODIR, Unit::CastSpell(), MotionMaster::Clear(), Unit::CombatStop(), SummonList::DespawnAll(), UnitAI::DoCastSelf(), DONE, InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), FACTION_FRIENDLY, Unit::GetHealth(), Unit::GetMotionMaster(), Unit::HasUnitFlag(), 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
270 {
271 if (action)
272 {
273 switch (action)
274 {
275 case EVENT_FAIL_HM:
276 if (instance)
277 {
278 if (GameObject* go = GetHardmodeChest())
279 {
280 go->SetGoState(GO_STATE_ACTIVE);
281 events.ScheduleEvent(EVENT_DESPAWN_CHEST, 3s);
282 }
283 }
284 break;
285 }
286 }
287 }
@ GO_STATE_ACTIVE
Definition GameObjectData.h:708
@ EVENT_FAIL_HM
Definition boss_hodir.cpp:126
@ EVENT_DESPAWN_CHEST
Definition boss_hodir.cpp:125
Definition GameObject.h:120
GameObject * GetHardmodeChest()
Definition boss_hodir.cpp:262

References EVENT_DESPAWN_CHEST, EVENT_FAIL_HM, GetHardmodeChest(), GO_STATE_ACTIVE, and BossAI::instance.

◆ GetData()

uint32 boss_hodir::GetData ( uint32  id) const
inlineoverridevirtual

Reimplemented from UnitAI.

549 {
550 switch (id)
551 {
552 case 1:
553 return (bAchievCheese ? 1 : 0);
554 case 2:
555 return (bAchievGettingCold ? 1 : 0);
556 case 3:
557 return (bAchievCacheRare ? 1 : 0);
558 case 4:
559 return (bAchievCoolestFriends ? 1 : 0);
560 }
561 return 0;
562 }
bool bAchievCoolestFriends
Definition boss_hodir.cpp:213
bool bAchievCacheRare
Definition boss_hodir.cpp:212
bool bAchievCheese
Definition boss_hodir.cpp:210
bool bAchievGettingCold
Definition boss_hodir.cpp:211

References bAchievCacheRare, bAchievCheese, bAchievCoolestFriends, and bAchievGettingCold.

◆ GetHardmodeChest()

GameObject * boss_hodir::GetHardmodeChest ( )
inline
263 {
265 return go;
267 }
GameObject * GetGameObject(uint32 type)
Definition InstanceScript.cpp:120
@ DATA_HODIR_CHEST_HARD
Definition ulduar.h:137
@ DATA_HODIR_CHEST_HARD_HERO
Definition ulduar.h:139

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

Referenced by DoAction(), and UpdateAI().

◆ 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:210
ObjectGuid Helpers[8]
Definition boss_hodir.cpp:208

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

◆ JustEngagedWith()

void boss_hodir::JustEngagedWith ( Unit )
inlineoverridevirtual

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

Reimplemented from CreatureAI.

248 {
250 SmallIcicles(true);
251 events.Reset();
252 events.ScheduleEvent(EVENT_FLASH_FREEZE, 48s, 49s);
253 events.ScheduleEvent(EVENT_FREEZE, 17s, 20s);
254 events.ScheduleEvent(EVENT_BERSERK, 8min);
255 events.ScheduleEvent(EVENT_HARD_MODE_MISSED, 3min);
257
260 }
@ IN_PROGRESS
Definition InstanceScript.h:59
@ SPELL_BITING_COLD_BOSS_AURA
Definition boss_hodir.cpp:34
@ EVENT_HARD_MODE_MISSED
Definition boss_hodir.cpp:124
@ EVENT_FLASH_FREEZE
Definition boss_hodir.cpp:119
@ EVENT_BERSERK
Definition boss_hodir.cpp:121
@ EVENT_FREEZE
Definition boss_hodir.cpp:122
@ TEXT_AGGRO
Definition boss_hodir.cpp:143
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:252
void SmallIcicles(bool enable)
Definition boss_hodir.cpp:289

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

◆ JustExitedCombat()

void boss_hodir::JustExitedCombat ( )
inlineoverridevirtual

Called when the unit leaves combat.

Reimplemented from UnitAI.

221 {
224 return;
226 }
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.

516 {
517 if (who->IsPlayer())
519 }
@ TEXT_SLAY
Definition boss_hodir.cpp:144
bool IsPlayer() const
Definition Object.h:201

References Object::IsPlayer(), and TEXT_SLAY.

◆ MoveInLineOfSight()

void boss_hodir::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

564{}

◆ Reset()

void boss_hodir::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

229 {
230 _Reset();
231 berserk = false;
232 bAchievCheese = true;
233 bAchievGettingCold = true;
234 bAchievCacheRare = true;
237
238 // Reset the spells cast after wipe
241
242 // Reset helpers
243 if (!summons.size())
244 SpawnHelpers();
245 }
@ 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:472
bool berserk
Definition boss_hodir.cpp:209

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.

532 {
533 if (value)
534 switch (id)
535 {
536 case 1:
537 bAchievCheese = false;
538 break;
539 case 2:
540 bAchievGettingCold = false;
541 break;
542 case 4:
543 bAchievCoolestFriends = false;
544 break;
545 }
546 }

References bAchievCheese, bAchievCoolestFriends, and bAchievGettingCold.

◆ SmallIcicles()

void boss_hodir::SmallIcicles ( bool  enable)
inline
290 {
291 if (enable)
293 else
295 }
@ SPELL_ICICLE_BOSS_AURA
Definition boss_hodir.cpp:49
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:5024

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].x, hhd[k][i].y, 432.69f, M_PI / 2))
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 }
std::uint8_t uint8
Definition Define.h:109
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition Object.h:54
@ TEAM_ALLIANCE
Definition SharedDefines.h:748
@ NPC_FLASH_FREEZE_NPC
Definition boss_hodir.cpp:109
HodirHelperData hhd[4][4]
Definition boss_hodir.cpp:170
void JustSummoned(Creature *summon) override
Definition ScriptedCreature.cpp:725
Definition Creature.h:47
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:326
Map * GetMap() const
Definition Object.h:625
TempSummon * SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2394
float y
Definition boss_hodir.cpp:168
uint32 id
Definition boss_hodir.cpp:167
float x
Definition boss_hodir.cpp:168
const T & RAID_MODE(const T &normal10, const T &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, ScriptedAI::RAID_MODE(), SPELL_FLASH_FREEZE_TRAPPED_NPC, WorldObject::SummonCreature(), TEAM_ALLIANCE, TEMPSUMMON_CORPSE_TIMED_DESPAWN, HodirHelperData::x, and HodirHelperData::y.

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 }
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2126
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
@ EVENT_KEEPER_TELEPORTED
Definition ulduar.h:351

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.

298 {
299 switch (spell->Id)
300 {
303 break;
305 {
306 std::list<Creature*> fires;
308 for (std::list<Creature*>::iterator itr = fires.begin(); itr != fires.end(); ++itr)
309 (*itr)->AI()->DoAction(1); // remove it
310 }
311 break;
312 }
313 }
@ SPELL_ICICLE_TBBA
Definition boss_hodir.cpp:50
@ SPELL_FLASH_FREEZE_VISUAL
Definition boss_hodir.cpp:44
@ SPELL_ICICLE_VISUAL_UNPACKED
Definition boss_hodir.cpp:52
@ NPC_TOASTY_FIRE
Definition boss_hodir.cpp:112
void GetCreaturesWithEntryInRange(std::list< Creature * > &creatureList, float radius, uint32 entry)
Definition Object.cpp:3061

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.

351 {
352 scheduler.Update(diff);
354 {
356 return;
357 }
358
359 if (!UpdateVictim())
360 {
361 if (me->IsInCombat())
362 {
363 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
364 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
365 itr->GetSource()->CastSpell(itr->GetSource(), SPELL_FLASH_FREEZE_INSTAKILL, true);
367 }
368 return;
369 }
370
371 events.Update(diff);
372
374 return;
375
376 switch (events.ExecuteEvent())
377 {
378 case 0:
379 break;
380 case EVENT_BERSERK:
381 {
382 berserk = true;
383 me->CastSpell(me, SPELL_BERSERK, true);
385 }
386 break;
388 {
390 bAchievCacheRare = false;
391 if (instance)
392 {
393 if (GameObject* go = GetHardmodeChest())
394 me->CastSpell(go, SPELL_SHATTER_CHEST, false);
395 }
396 }
397 break;
401 break;
403 {
404 std::list<Unit*> targets;
405 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
406 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
407 targets.push_back(itr->GetSource());
408 targets.remove_if(Acore::ObjectTypeIdCheck(TYPEID_PLAYER, false));
411 for (std::list<Unit*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
412 {
413 float prevZ = (*itr)->GetPositionZ();
414 (*itr)->m_positionZ = 432.7f;
415 (*itr)->CastSpell((*itr), SPELL_ICICLE_VISUAL_PACKED, true);
416 (*itr)->m_positionZ = prevZ;
417 }
418
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 }
@ TYPEID_PLAYER
Definition ObjectGuid.h:36
@ UNIT_STATE_CASTING
Definition UnitDefines.h:188
@ SPELL_FLASH_FREEZE_CAST
Definition boss_hodir.cpp:40
@ SPELL_FLASH_FREEZE_INSTAKILL
Definition boss_hodir.cpp:41
@ SPELL_FREEZE
Definition boss_hodir.cpp:38
@ SPELL_FROZEN_BLOWS
Definition boss_hodir.cpp:61
@ SPELL_SHATTER_CHEST
Definition boss_hodir.cpp:47
@ SPELL_BERSERK
Definition boss_hodir.cpp:32
@ SPELL_ICICLE_VISUAL_PACKED
Definition boss_hodir.cpp:53
@ EVENT_SMALL_ICICLES_ENABLE
Definition boss_hodir.cpp:123
@ EVENT_FROZEN_BLOWS
Definition boss_hodir.cpp:120
@ TEXT_BERSERK
Definition boss_hodir.cpp:148
@ TEXT_EMOTE_BLOW
Definition boss_hodir.cpp:151
@ TEXT_HM_MISS
Definition boss_hodir.cpp:149
@ TEXT_FLASH_FREEZE
Definition boss_hodir.cpp:145
@ TEXT_STALACTITE
Definition boss_hodir.cpp:146
@ TEXT_EMOTE_FREEZE
Definition boss_hodir.cpp:150
@ SOUND_HODIR_FLASH_FREEZE
Definition boss_hodir.cpp:159
Definition GridNotifiers.h:1629
Definition GridNotifiers.h:1657
bool UpdateVictim()
Definition CreatureAI.cpp:353
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition CreatureAI.cpp:235
Definition Player.h:1084
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition TaskScheduler.cpp:27
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:40
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition UnitAI.cpp:111
Definition Unit.h:664
bool HasUnitState(const uint32 f) const
Definition Unit.h:736
bool IsInCombat() const
Definition Unit.h:935
void PlayDirectSound(uint32 sound_id, Player *target=nullptr)
Definition Object.cpp:2957
void RandomResize(C &container, std::size_t requestedSize)
Definition Containers.h:79
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:218
const Position ENTRANCE_DOOR
Definition boss_hodir.cpp:217
@ TYPE_HODIR_HM_FAIL
Definition ulduar.h:52

References bAchievCacheRare, MapRefMgr::begin(), berserk, BOSS_HODIR, Unit::CastSpell(), UnitAI::DoMeleeAttackIfReady(), DONE, MapRefMgr::end(), CreatureAI::EnterEvadeMode(), BossAI::EnterEvadeMode(), ENTRANCE_DOOR, EVENT_BERSERK, EVENT_DESPAWN_CHEST, EVENT_FLASH_FREEZE, EVENT_FREEZE, EVENT_FROZEN_BLOWS, EVENT_HARD_MODE_MISSED, EVENT_SMALL_ICICLES_ENABLE, EXIT_DOOR, InstanceScript::GetBossState(), GetHardmodeChest(), WorldObject::GetMap(), Map::GetPlayers(), Position::GetPositionY(), Unit::HasUnitState(), BossAI::instance, ScriptedAI::Is25ManRaid(), Unit::IsInCombat(), ScriptedAI::me, WorldObject::PlayDirectSound(), ScriptedAI::RAID_MODE(), Random, Acore::Containers::RandomResize(), CreatureAI::scheduler, UnitAI::SelectTarget(), ScriptedAI::SelectTargetFromPlayerList(), ZoneScript::SetData(), 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_VISUAL_PACKED, SPELL_SHATTER_CHEST, TEXT_BERSERK, TEXT_EMOTE_BLOW, TEXT_EMOTE_FREEZE, TEXT_FLASH_FREEZE, TEXT_HM_MISS, TEXT_STALACTITE, TYPE_HODIR_HM_FAIL, TYPEID_PLAYER, UNIT_STATE_CASTING, TaskScheduler::Update(), and CreatureAI::UpdateVictim().

Member Data Documentation

◆ addSpawnTimer

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

◆ bAchievCacheRare

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

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

◆ bAchievCheese

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

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

◆ bAchievCoolestFriends

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

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

◆ bAchievGettingCold

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

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

◆ berserk

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

Referenced by Reset(), and UpdateAI().

◆ ENTRANCE_DOOR

const Position boss_hodir::ENTRANCE_DOOR { 1999.160034f, -297.792999f, 431.960999f, 0 }
217{ 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 }
218{ 1999.709961f, -166.259003f, 432.822998f, 0 };

Referenced by UpdateAI().

◆ Helpers

ObjectGuid boss_hodir::Helpers[8]

Referenced by GetHelper(), and SpawnHelpers().


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