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

Public Member Functions

 boss_hodirAI (Creature *pCreature)
 
void Reset () override
 
void JustEngagedWith (Unit *) override
 Called for reaction when initially engaged. More...
 
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) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void SpellHit (Unit *, SpellInfo const *spellInfo) override
 
CreatureGetHelper (uint8 index)
 
void SpawnHelpers ()
 
void KilledUnit (Unit *who) override
 
void JustSummoned (Creature *s) override
 
void SummonedCreatureDespawn (Creature *s) 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 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) More...
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
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. More...
 
void AttackStart (Unit *) override
 
void DoStartMovement (Unit *target, float distance=0.0f, float angle=0.0f)
 
void DoStartNoMovement (Unit *target)
 
void DoStopAttack ()
 
void DoCastSpell (Unit *target, SpellInfo const *spellInfo, bool triggered=false)
 
void DoPlaySoundToSet (WorldObject *source, uint32 soundId)
 
void DoPlayMusic (uint32 soundId, bool zone)
 
void DoAddThreat (Unit *unit, float amount)
 
void DoModifyThreatByPercent (Unit *unit, int32 pct)
 
void DoResetThreat (Unit *unit)
 
void DoResetThreatList ()
 
float DoGetThreat (Unit *unit)
 
void DoTeleportPlayer (Unit *unit, float x, float y, float z, float o)
 
void DoTeleportPlayer (Unit *unit, Position pos)
 
void DoTeleportAll (float x, float y, float z, float o)
 
UnitDoSelectLowestHpFriendly (float range, uint32 minHPDiff=1)
 
std::list< Creature * > DoFindFriendlyCC (float range)
 
std::list< Creature * > DoFindFriendlyMissingBuff (float range, uint32 spellId)
 
PlayerGetPlayerAtMinimumRange (float minRange)
 
CreatureDoSpawnCreature (uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime)
 
bool IsUniqueTimedEventDone (uint32 id) const
 
void SetUniqueTimedEventDone (uint32 id)
 
void ResetUniqueTimedEvent (uint32 id)
 
void ClearUniqueTimedEventsDone ()
 
void ScheduleTimedEvent (Milliseconds timerMin, Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, uint32 uniqueId=0)
 
void ScheduleTimedEvent (Milliseconds timerMax, std::function< void()> exec, Milliseconds repeatMin, Milliseconds repeatMax=0s, 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=0s)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table. More...
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon. More...
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At ================================= More...
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged. More...
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void JustSummoned (Creature *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDespawn (Creature *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void SpellHitTarget (Unit *, SpellInfo const *)
 
virtual void AttackedBy (Unit *)
 
virtual bool IsEscorted ()
 
virtual void JustRespawned ()
 
virtual void MovementInform (uint32, uint32)
 
virtual void PathEndReached (uint32)
 
void OnCharmed (bool apply) override
 Called when unit is charmed. More...
 
virtual void JustReachedHome ()
 
void DoZoneInCombat (Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
 
virtual void ReceiveEmote (Player *, uint32)
 
virtual void OwnerAttackedBy (Unit *)
 
virtual void OwnerAttacked (Unit *)
 
virtual void CorpseRemoved (uint32 &)
 == Triggered Actions Requested ================== More...
 
virtual void PassengerBoarded (Unit *, int8, bool)
 == Fields ======================================= More...
 
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 ()
 
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)
 
- Public Member Functions inherited from UnitAI
 UnitAI (Unit *unit)
 
virtual ~UnitAI ()
 
virtual bool CanAIAttack (Unit const *) const
 
virtual void AttackStart (Unit *)
 
virtual void UpdateAI (uint32)=0
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 Called when unit is charmed. More...
 
virtual void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void SetGUID (ObjectGuid, 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: More...
 
template<class PREDICATE >
void SelectTargetList (std::list< Unit * > &targetList, uint32 num, SelectTargetMethod targetType, uint32 position, PREDICATE const &predicate)
 
virtual void JustEnteredCombat (Unit *)
 Called when the unit enters combat. More...
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat. More...
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 Called at any Damage to any victim (before damage apply) More...
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (before damage apply) More...
 
virtual void HealReceived (Unit *, uint32 &)
 Called when the creature receives heal. More...
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 Called when the creature power updates. More...
 
virtual void HealDone (Unit *, uint32 &)
 Called when the unit heals. More...
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 Called during damage calculations. More...
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 Called during calculation when receiving periodic healing or damage (DoT or HoT) More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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

InstanceScriptpInstance
 
EventMap events
 
SummonList summons
 
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 ScriptedAI
Creatureme
 

Additional Inherited Members

- Public Types inherited from ScriptedAI
enum class  Axis {
  AXIS_X ,
  AXIS_Y
}
 
- Public Types inherited from CreatureAI
enum  EvadeReason {
  EVADE_REASON_NO_HOSTILES ,
  EVADE_REASON_BOUNDARY ,
  EVADE_REASON_SEQUENCE_BREAK ,
  EVADE_REASON_NO_PATH ,
  EVADE_REASON_OTHER
}
 
- Static Public Member Functions inherited from CreatureAI
static bool IsInBounds (CreatureBoundary const &boundary, Position const *who)
 
- Static Public Member Functions inherited from UnitAI
static void FillAISpellInfo ()
 
- Static Public Attributes inherited from UnitAI
static AISpellInfoTypeAISpellInfo
 
- Protected Member Functions inherited from CreatureAI
bool UpdateVictim ()
 
bool UpdateVictimWithGaze ()
 
void SetGazeOn (Unit *target)
 
CreatureDoSummon (uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummon (uint32 entry, WorldObject *obj, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
CreatureDoSummonFlyer (uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TEMPSUMMON_CORPSE_TIMED_DESPAWN)
 
virtual void MoveInLineOfSight (Unit *)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- Protected Attributes inherited from CreatureAI
Creature *const me
 
EventMap events
 
TaskScheduler scheduler
 
CreatureBoundary const * _boundary
 
bool _negateBoundary
 
- Protected Attributes inherited from UnitAI
Unit *const me
 

Detailed Description

Constructor & Destructor Documentation

◆ boss_hodirAI()

boss_hodir::boss_hodirAI::boss_hodirAI ( Creature pCreature)
inline
216 : ScriptedAI(pCreature), summons(me)
217 {
218 pInstance = pCreature->GetInstanceScript();
219 if (!me->IsAlive())
220 if (pInstance)
222 }
@ TYPE_HODIR
Definition: ulduar.h:40
@ DONE
Definition: InstanceScript.h:60
Definition: ScriptedCreature.h:190
Creature * me
Definition: ScriptedCreature.h:280
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
bool IsAlive() const
Definition: Unit.h:1654
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
SummonList summons
Definition: boss_hodir.cpp:226
InstanceScript * pInstance
Definition: boss_hodir.cpp:224

References DONE, WorldObject::GetInstanceScript(), Unit::IsAlive(), ScriptedAI::me, pInstance, ZoneScript::SetData(), and TYPE_HODIR.

Member Function Documentation

◆ CanAIAttack()

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

Reimplemented from UnitAI.

578 {
579 if (t->IsPlayer())
580 return !t->HasAura(SPELL_FLASH_FREEZE_TRAPPED_PLAYER);
581 else if (t->IsCreature())
582 return !t->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC);
583
584 return true;
585 }
@ SPELL_FLASH_FREEZE_TRAPPED_PLAYER
Definition: boss_hodir.cpp:41
@ SPELL_FLASH_FREEZE_TRAPPED_NPC
Definition: boss_hodir.cpp:42

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

◆ DamageTaken()

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

338 {
339 if (damage >= me->GetHealth() || me->GetHealth() < 150000)
340 {
341 damage = 0;
344 {
345 if (pInstance)
346 {
348 me->CastSpell(me, 64899, true); // credit
350 }
351
355 me->AttackStop();
356 me->CombatStop();
359
360 events.Reset();
362
364 {
365 if (d->GetGoState() != GO_STATE_ACTIVE )
366 {
367 d->SetLootState(GO_READY);
368 d->UseDoorOrButton(0, false);
369 }
370 }
372 {
373 if (d->GetGoState() != GO_STATE_ACTIVE )
374 {
375 d->SetLootState(GO_READY);
376 d->UseDoorOrButton(0, false);
377 }
378 }
379
381 {
382 go->SetGoState(GO_STATE_ACTIVE);
383 }
384
386 scheduler.Schedule(14s, [this](TaskContext /*context*/)
387 {
389 });
390 }
391 }
392 }
events
Definition: boss_sartura.cpp:43
Talk
Definition: hyjal.cpp:82
@ GO_HODIR_FRONTDOOR
Definition: ulduar.h:232
@ GO_HODIR_FROZEN_DOOR
Definition: ulduar.h:230
@ GO_HODIR_DOOR
Definition: ulduar.h:231
@ SPELL_BITING_COLD_PLAYER_AURA
Definition: boss_hodir.cpp:34
@ TEXT_DEATH
Definition: boss_hodir.cpp:148
@ SPELL_TELEPORT
Definition: karazhan.cpp:48
@ FACTION_FRIENDLY
Definition: SharedDefines.h:201
@ GO_READY
Definition: GameObject.h:111
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:689
@ REACT_PASSIVE
Definition: Unit.h:548
@ UNIT_FLAG_NON_ATTACKABLE
Definition: UnitDefines.h:230
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition: TaskScheduler.h:232
Definition: TaskScheduler.h:421
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition: UnitAI.h:392
TaskScheduler scheduler
Definition: CreatureAI.h:75
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
void SetReactState(ReactStates state)
A creature can have 3 ReactStates : Agressive, Passive, Neutral.
Definition: Creature.h:94
Definition: GameObject.h:120
GameObject * FindNearestGameObject(uint32 entry, float range, bool onlySpawned=false) const
Definition: Object.cpp:2466
void CombatStop(bool includingCast=false)
Definition: Unit.cpp:10436
void SetFaction(uint32 faction)
Definition: Unit.cpp:10056
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4129
MotionMaster * GetMotionMaster()
Definition: Unit.h:1620
bool HasUnitFlag(UnitFlags flags) const
Definition: Unit.h:712
uint32 GetHealth() const
Definition: Unit.h:1029
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:1167
void RemoveAllAuras()
Definition: Unit.cpp:5319
void SetUnitFlag(UnitFlags flags)
UnitFlags available in UnitDefines.h.
Definition: Unit.h:713
bool AttackStop()
Force the unit to stop attacking. This will clear UNIT_STATE_MELEE_ATTACKING, Interrupt current spell...
Definition: Unit.cpp:10403
void DoRemoveAurasDueToSpellOnPlayers(uint32 spell)
Definition: InstanceScript.cpp:665
void Clear(bool reset=true)
Definition: MotionMaster.h:167

References Unit::AttackStop(), Unit::CastSpell(), MotionMaster::Clear(), Unit::CombatStop(), SummonList::DespawnAll(), UnitAI::DoCastSelf(), DONE, InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), FACTION_FRIENDLY, WorldObject::FindNearestGameObject(), Unit::GetHealth(), Unit::GetMotionMaster(), GO_HODIR_DOOR, GO_HODIR_FRONTDOOR, GO_HODIR_FROZEN_DOOR, GO_READY, GO_STATE_ACTIVE, Unit::HasUnitFlag(), Unit::InterruptNonMeleeSpells(), ScriptedAI::me, pInstance, REACT_PASSIVE, Unit::RemoveAllAuras(), TaskScheduler::Schedule(), CreatureAI::scheduler, ZoneScript::SetData(), Unit::SetFaction(), Creature::SetReactState(), Unit::SetUnitFlag(), SPELL_BITING_COLD_PLAYER_AURA, SPELL_TELEPORT, summons, TEXT_DEATH, TYPE_HODIR, and UNIT_FLAG_NON_ATTACKABLE.

◆ DoAction()

void boss_hodir::boss_hodirAI::DoAction ( int  action)
inlineoverride
292 {
293 if (action)
294 {
295 switch (action)
296 {
297 case EVENT_FAIL_HM:
298 if (pInstance)
299 {
301 {
302 go->SetGoState(GO_STATE_ACTIVE);
303 events.ScheduleEvent(EVENT_DESPAWN_CHEST, 3s);
304 }
305 }
306 break;
307 }
308 }
309 }
@ GO_HODIR_CHEST_HARD
Definition: ulduar.h:182
@ EVENT_FAIL_HM
Definition: boss_hodir.cpp:127
@ EVENT_DESPAWN_CHEST
Definition: boss_hodir.cpp:126
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:98
Map * instance
Definition: InstanceScript.h:148
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3322

References EVENT_DESPAWN_CHEST, EVENT_FAIL_HM, Map::GetGameObject(), InstanceScript::GetGuidData(), GO_HODIR_CHEST_HARD, GO_STATE_ACTIVE, InstanceScript::instance, and pInstance.

◆ GetData()

uint32 boss_hodir::boss_hodirAI::GetData ( uint32  id) const
inlineoverridevirtual

Reimplemented from UnitAI.

605 {
606 switch (id)
607 {
608 case 1:
609 return (bAchievCheese ? 1 : 0);
610 case 2:
611 return (bAchievGettingCold ? 1 : 0);
612 case 3:
613 return (bAchievCacheRare ? 1 : 0);
614 case 4:
615 return (bAchievCoolestFriends ? 1 : 0);
616 }
617 return 0;
618 }
bool bAchievCheese
Definition: boss_hodir.cpp:229
bool bAchievCoolestFriends
Definition: boss_hodir.cpp:232
bool bAchievCacheRare
Definition: boss_hodir.cpp:231
bool bAchievGettingCold
Definition: boss_hodir.cpp:230

References bAchievCacheRare, bAchievCheese, bAchievCoolestFriends, and bAchievGettingCold.

◆ GetHelper()

Creature * boss_hodir::boss_hodirAI::GetHelper ( uint8  index)
inline
514 {
515 return Helpers[index] ? ObjectAccessor::GetCreature(*me, Helpers[index]) : nullptr;
516 }
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:210
ObjectGuid Helpers[8]
Definition: boss_hodir.cpp:227

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

◆ JustEngagedWith()

void boss_hodir::boss_hodirAI::JustEngagedWith ( Unit )
inlineoverridevirtual

Called for reaction when initially engaged.

Reimplemented from ScriptedAI.

270 {
272 SmallIcicles(true);
273 events.Reset();
274 events.ScheduleEvent(EVENT_FLASH_FREEZE, 48s, 49s);
275 events.ScheduleEvent(EVENT_FREEZE, 17s, 20s);
276 events.ScheduleEvent(EVENT_BERSERK, 8min);
277 events.ScheduleEvent(EVENT_HARD_MODE_MISSED, 3min);
279
281 {
283 }
284
286 {
287 go->SetGoState(GO_STATE_READY);
288 }
289 }
@ SPELL_BITING_COLD_BOSS_AURA
Definition: boss_hodir.cpp:33
@ EVENT_HARD_MODE_MISSED
Definition: boss_hodir.cpp:125
@ EVENT_FLASH_FREEZE
Definition: boss_hodir.cpp:120
@ EVENT_BERSERK
Definition: boss_hodir.cpp:122
@ EVENT_FREEZE
Definition: boss_hodir.cpp:123
@ TEXT_AGGRO
Definition: boss_hodir.cpp:144
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ GO_STATE_READY
Definition: GameObjectData.h:690
virtual uint32 GetData(uint32) const
Definition: ZoneScript.h:51
void SmallIcicles(bool enable)
Definition: boss_hodir.cpp:311

References Unit::CastSpell(), DONE, EVENT_BERSERK, EVENT_FLASH_FREEZE, EVENT_FREEZE, EVENT_HARD_MODE_MISSED, WorldObject::FindNearestGameObject(), ZoneScript::GetData(), GO_HODIR_FRONTDOOR, GO_STATE_READY, IN_PROGRESS, ScriptedAI::me, pInstance, ZoneScript::SetData(), SmallIcicles(), SPELL_BITING_COLD_BOSS_AURA, TEXT_AGGRO, and TYPE_HODIR.

◆ JustSummoned()

void boss_hodir::boss_hodirAI::JustSummoned ( Creature s)
inlineoverridevirtual

Reimplemented from ScriptedAI.

568 {
569 summons.Summon(s);
570 }
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88

References SummonList::Summon(), and summons.

Referenced by SpawnHelpers().

◆ KilledUnit()

void boss_hodir::boss_hodirAI::KilledUnit ( Unit who)
inlineoverridevirtual

Reimplemented from ScriptedAI.

562 {
563 if (who->IsPlayer())
565 }
@ TEXT_SLAY
Definition: boss_hodir.cpp:145
bool IsPlayer() const
Definition: Object.h:200

References Object::IsPlayer(), and TEXT_SLAY.

◆ MoveInLineOfSight()

void boss_hodir::boss_hodirAI::MoveInLineOfSight ( Unit )
inlineoverridevirtual

Reimplemented from CreatureAI.

620{}

◆ Reset()

void boss_hodir::boss_hodirAI::Reset ( )
inlineoverridevirtual

Reimplemented from ScriptedAI.

240 {
241 events.Reset();
243 berserk = false;
244 bAchievCheese = true;
245 bAchievGettingCold = true;
246 bAchievCacheRare = true;
249
250 // Reset the spells cast after wipe
253
255 {
257 }
258
260 {
261 go->SetGoState(GO_STATE_ACTIVE);
262 }
263
264 // Reset helpers
265 if (!summons.size())
266 SpawnHelpers();
267 }
@ NOT_STARTED
Definition: InstanceScript.h:57
@ SHEATH_STATE_MELEE
Definition: UnitDefines.h:106
size_type size() const
Definition: ScriptedCreature.h:78
virtual void SetSheath(SheathState sheathed)
Definition: Unit.h:1639
bool berserk
Definition: boss_hodir.cpp:228
void SpawnHelpers()
Definition: boss_hodir.cpp:518

References bAchievCacheRare, bAchievCheese, bAchievCoolestFriends, bAchievGettingCold, berserk, SummonList::DespawnAll(), DONE, InstanceScript::DoRemoveAurasDueToSpellOnPlayers(), WorldObject::FindNearestGameObject(), ZoneScript::GetData(), GO_HODIR_FRONTDOOR, GO_STATE_ACTIVE, ScriptedAI::me, NOT_STARTED, pInstance, Unit::RemoveAllAuras(), ZoneScript::SetData(), Unit::SetSheath(), SHEATH_STATE_MELEE, SummonList::size(), SpawnHelpers(), SPELL_BITING_COLD_PLAYER_AURA, summons, and TYPE_HODIR.

◆ SetData()

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

Reimplemented from UnitAI.

588 {
589 if (value)
590 switch (id)
591 {
592 case 1:
593 bAchievCheese = false;
594 break;
595 case 2:
596 bAchievGettingCold = false;
597 break;
598 case 4:
599 bAchievCoolestFriends = false;
600 break;
601 }
602 }

References bAchievCheese, bAchievCoolestFriends, and bAchievGettingCold.

◆ SmallIcicles()

void boss_hodir::boss_hodirAI::SmallIcicles ( bool  enable)
inline
312 {
313 if (enable)
315 else
317 }
@ SPELL_ICICLE_BOSS_AURA
Definition: boss_hodir.cpp:48
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4776

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

Referenced by JustEngagedWith(), and UpdateAI().

◆ SpawnHelpers()

void boss_hodir::boss_hodirAI::SpawnHelpers ( )
inline
519 {
520 char faction = 'A';
521 if (hhd[0][0].id)
522 {
523 Map::PlayerList const& cl = me->GetMap()->GetPlayers();
524 for (Map::PlayerList::const_iterator itr = cl.begin(); itr != cl.end(); ++itr)
525 if (!itr->GetSource()->IsGameMaster())
526 {
527 faction = (itr->GetSource()->GetTeamId() == TEAM_ALLIANCE ? 'A' : 'H');
528 break;
529 }
530 }
531
532 uint8 cnt = 0;
533 if (faction)
534 for( uint8 k = 0; k < 4; ++k )
535 {
536 if ((faction == 'A' && ( k > 1 || (k == 1 && RAID_MODE(1, 0)))) ||
537 (faction == 'H' && ( k < 2 || (k == 3 && RAID_MODE(1, 0)))))
538 continue;
539
540 for( uint8 i = 0; i < 4; ++i )
541 {
542 if (!hhd[k][i].id)
543 continue;
544
545 if (Creature* h_p = me->SummonCreature(hhd[k][i].id, hhd[k][i].x, hhd[k][i].y, 432.69f, M_PI / 2))
546 {
547 h_p->SetFaction(1665);
548 if (cnt < 8)
549 Helpers[cnt++] = h_p->GetGUID();
550
551 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))
552 {
553 c->CastSpell(h_p, SPELL_FLASH_FREEZE_TRAPPED_NPC, true);
554 JustSummoned(c);
555 }
556 }
557 }
558 }
559 }
std::uint8_t uint8
Definition: Define.h:109
@ NPC_FLASH_FREEZE_NPC
Definition: boss_hodir.cpp:110
HodirHelperData hhd[4][4]
Definition: boss_hodir.cpp:174
@ TEAM_ALLIANCE
Definition: SharedDefines.h:760
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition: Object.h:51
Definition: LinkedList.h:139
const T & RAID_MODE(const T &normal10, const T &normal25) const
Definition: ScriptedCreature.h:404
Definition: Creature.h:43
Map * GetMap() const
Definition: Object.h:536
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:2366
PlayerList const & GetPlayers() const
Definition: Map.h:484
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37
float y
Definition: boss_hodir.cpp:172
uint32 id
Definition: boss_hodir.cpp:171
float x
Definition: boss_hodir.cpp:172
void JustSummoned(Creature *s) override
Definition: boss_hodir.cpp:567

References MapRefMgr::begin(), MapRefMgr::end(), WorldObject::GetMap(), Map::GetPlayers(), Helpers, hhd, HodirHelperData::id, 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::boss_hodirAI::SpellHit ( Unit ,
SpellInfo const *  spellInfo 
)
inlineoverridevirtual

Reimplemented from ScriptedAI.

505 {
506 if (spellInfo->Id == SPELL_TELEPORT)
507 {
510 }
511 }
@ EVENT_KEEPER_TELEPORTED
Definition: ulduar.h:296
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2178

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

◆ SpellHitTarget()

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

Reimplemented from ScriptedAI.

320 {
321 switch (spell->Id)
322 {
325 break;
327 {
328 std::list<Creature*> fires;
330 for (std::list<Creature*>::iterator itr = fires.begin(); itr != fires.end(); ++itr)
331 (*itr)->AI()->DoAction(1); // remove it
332 }
333 break;
334 }
335 }
@ SPELL_ICICLE_TBBA
Definition: boss_hodir.cpp:49
@ SPELL_FLASH_FREEZE_VISUAL
Definition: boss_hodir.cpp:43
@ SPELL_ICICLE_VISUAL_UNPACKED
Definition: boss_hodir.cpp:51
@ NPC_TOASTY_FIRE
Definition: boss_hodir.cpp:113
void GetCreaturesWithEntryInRange(std::list< Creature * > &creatureList, float radius, uint32 entry)
Definition: Object.cpp:3097

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

◆ SummonedCreatureDespawn()

void boss_hodir::boss_hodirAI::SummonedCreatureDespawn ( Creature s)
inlineoverridevirtual

Reimplemented from ScriptedAI.

573 {
574 summons.Despawn(s);
575 }
void Despawn(Creature const *summon)
Definition: ScriptedCreature.h:89

References SummonList::Despawn(), and summons.

◆ UpdateAI()

void boss_hodir::boss_hodirAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from ScriptedAI.

395 {
396 scheduler.Update(diff);
398 {
400 return;
401 }
402
403 if (!UpdateVictim())
404 {
405 if (me->IsInCombat())
406 {
407 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
408 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
409 itr->GetSource()->CastSpell(itr->GetSource(), SPELL_FLASH_FREEZE_INSTAKILL, true);
411 }
412 return;
413 }
414
415 events.Update(diff);
416
418 return;
419
420 switch (events.ExecuteEvent())
421 {
422 case 0:
423 break;
424 case EVENT_BERSERK:
425 {
426 berserk = true;
427 me->CastSpell(me, SPELL_BERSERK, true);
429 }
430 break;
432 {
434 bAchievCacheRare = false;
435 if (pInstance)
436 {
438 {
439 me->CastSpell(go, SPELL_SHATTER_CHEST, false);
440 }
441 }
442 }
443 break;
447 break;
449 {
450 std::list<Unit*> targets;
451 Map::PlayerList const& pl = me->GetMap()->GetPlayers();
452 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
453 targets.push_back(itr->GetSource());
454 targets.remove_if(Acore::ObjectTypeIdCheck(TYPEID_PLAYER, false));
457 for (std::list<Unit*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
458 {
459 float prevZ = (*itr)->GetPositionZ();
460 (*itr)->m_positionZ = 432.7f;
461 (*itr)->CastSpell((*itr), SPELL_ICICLE_VISUAL_PACKED, true);
462 (*itr)->m_positionZ = prevZ;
463 }
464
465 me->CastSpell((Unit*)nullptr, SPELL_FLASH_FREEZE_CAST, false);
469 SmallIcicles(false);
470 events.ScheduleEvent(EVENT_FLASH_FREEZE, 48s, 49s);
471 events.ScheduleEvent(EVENT_SMALL_ICICLES_ENABLE, Is25ManRaid() ? 12s : 24s);
472 events.ScheduleEvent(EVENT_FROZEN_BLOWS, 15s);
473 events.RescheduleEvent(EVENT_FREEZE, 17s, 20s);
474 }
475 break;
477 {
478 SmallIcicles(true);
479 }
480 break;
482 {
486 }
487 break;
488 case EVENT_FREEZE:
490 {
491 me->CastSpell(plr, SPELL_FREEZE, false);
492 }
493 else if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
494 {
495 me->CastSpell(target, SPELL_FREEZE, false);
496 }
497 events.RescheduleEvent(EVENT_FREEZE, 17s, 20s);
498 break;
499 }
500
502 }
@ TYPE_HODIR_HM_FAIL
Definition: ulduar.h:47
@ SPELL_FLASH_FREEZE_CAST
Definition: boss_hodir.cpp:39
@ SPELL_FLASH_FREEZE_INSTAKILL
Definition: boss_hodir.cpp:40
@ SPELL_FREEZE
Definition: boss_hodir.cpp:37
@ SPELL_FROZEN_BLOWS_25
Definition: boss_hodir.cpp:61
@ SPELL_FROZEN_BLOWS_10
Definition: boss_hodir.cpp:60
@ SPELL_SHATTER_CHEST
Definition: boss_hodir.cpp:46
@ SPELL_BERSERK
Definition: boss_hodir.cpp:31
@ SPELL_ICICLE_VISUAL_PACKED
Definition: boss_hodir.cpp:52
@ EVENT_SMALL_ICICLES_ENABLE
Definition: boss_hodir.cpp:124
@ EVENT_FROZEN_BLOWS
Definition: boss_hodir.cpp:121
@ TEXT_BERSERK
Definition: boss_hodir.cpp:149
@ TEXT_EMOTE_BLOW
Definition: boss_hodir.cpp:152
@ TEXT_HM_MISS
Definition: boss_hodir.cpp:150
@ TEXT_FLASH_FREEZE
Definition: boss_hodir.cpp:146
@ TEXT_STALACTITE
Definition: boss_hodir.cpp:147
@ TEXT_EMOTE_FREEZE
Definition: boss_hodir.cpp:151
@ SOUND_HODIR_FLASH_FREEZE
Definition: boss_hodir.cpp:163
@ TYPEID_PLAYER
Definition: ObjectGuid.h:36
@ UNIT_STATE_CASTING
Definition: UnitDefines.h:164
void RandomResize(C &container, std::size_t requestedSize)
Definition: Containers.h:79
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition: TaskScheduler.cpp:27
void DoMeleeAttackIfReady()
Definition: UnitAI.cpp:39
Unit * SelectTarget(SelectTargetMethod targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, bool withTank=true, int32 aura=0)
Definition: UnitAI.cpp:110
bool UpdateVictim()
Definition: CreatureAI.cpp:280
virtual void EnterEvadeMode(EvadeReason why=EVADE_REASON_OTHER)
Definition: CreatureAI.cpp:208
bool Is25ManRaid() const
Definition: ScriptedCreature.h:385
Player * SelectTargetFromPlayerList(float maxdist, uint32 excludeAura=0, bool mustBeInLOS=false) const
Definition: ScriptedCreature.cpp:571
void PlayDirectSound(uint32 sound_id, Player *target=nullptr)
Definition: Object.cpp:2903
float GetPositionY() const
Definition: Position.h:117
Definition: Player.h:1081
Definition: Unit.h:630
bool HasUnitState(const uint32 f) const
Definition: Unit.h:701
bool IsInCombat() const
Definition: Unit.h:884
Definition: GridNotifiers.h:1599
Definition: GridNotifiers.h:1627
const Position ENTRANCE_DOOR
Definition: boss_hodir.cpp:236
const Position EXIT_DOOR
Definition: boss_hodir.cpp:237

References bAchievCacheRare, MapRefMgr::begin(), berserk, Unit::CastSpell(), UnitAI::DoMeleeAttackIfReady(), DONE, MapRefMgr::end(), CreatureAI::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, ZoneScript::GetData(), Map::GetGameObject(), InstanceScript::GetGuidData(), WorldObject::GetMap(), Map::GetPlayers(), Position::GetPositionY(), GO_HODIR_CHEST_HARD, Unit::HasUnitState(), InstanceScript::instance, ScriptedAI::Is25ManRaid(), Unit::IsInCombat(), ScriptedAI::me, pInstance, WorldObject::PlayDirectSound(), ScriptedAI::RAID_MODE(), 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_10, SPELL_FROZEN_BLOWS_25, 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, TYPE_HODIR_HM_FAIL, TYPEID_PLAYER, UNIT_STATE_CASTING, TaskScheduler::Update(), and CreatureAI::UpdateVictim().

Member Data Documentation

◆ addSpawnTimer

uint16 boss_hodir::boss_hodirAI::addSpawnTimer { 0 }

◆ bAchievCacheRare

bool boss_hodir::boss_hodirAI::bAchievCacheRare { true }

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

◆ bAchievCheese

bool boss_hodir::boss_hodirAI::bAchievCheese { true }

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

◆ bAchievCoolestFriends

bool boss_hodir::boss_hodirAI::bAchievCoolestFriends { true }

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

◆ bAchievGettingCold

bool boss_hodir::boss_hodirAI::bAchievGettingCold { true }

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

◆ berserk

bool boss_hodir::boss_hodirAI::berserk { false }

Referenced by Reset(), and UpdateAI().

◆ ENTRANCE_DOOR

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

Referenced by UpdateAI().

◆ events

EventMap boss_hodir::boss_hodirAI::events

◆ EXIT_DOOR

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

Referenced by UpdateAI().

◆ Helpers

ObjectGuid boss_hodir::boss_hodirAI::Helpers[8]

Referenced by GetHelper(), and SpawnHelpers().

◆ pInstance

InstanceScript* boss_hodir::boss_hodirAI::pInstance

◆ summons

SummonList boss_hodir::boss_hodirAI::summons