AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
npc_hor_lich_king::npc_hor_lich_kingAI Struct Reference
Inheritance diagram for npc_hor_lich_king::npc_hor_lich_kingAI:
NullCreatureAI CreatureAI UnitAI

Public Member Functions

 npc_hor_lich_kingAI (Creature *creature)
 
void Reset () override
 
void DoAction (int32 a) override
 
void MovementInform (uint32 type, uint32) override
 
void JustSummoned (Creature *s) override
 
void SummonedCreatureDespawn (Creature *s) override
 
void SpellHitTarget (Unit *target, SpellInfo const *spell) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
- Public Member Functions inherited from NullCreatureAI
 NullCreatureAI (Creature *c)
 
void MoveInLineOfSight (Unit *) override
 
void AttackStart (Unit *) override
 
void UpdateAI (uint32) override
 Use to start attacking a target. Called just before JustEngagedWith() More...
 
void EnterEvadeMode (EvadeReason) override
 
void OnCharmed (bool) override
 Called when unit is charmed. More...
 
- 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
 
uint8 currentWall
 
uint8 reqKillCount
 
uint8 div2
 

Additional Inherited Members

- 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 NullCreatureAI
static int32 Permissible (Creature const *creature)
 
- 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

◆ npc_hor_lich_kingAI()

npc_hor_lich_king::npc_hor_lich_kingAI::npc_hor_lich_kingAI ( Creature creature)
inline
1661 : NullCreatureAI(creature), summons(me)
1662 {
1664 if (!pInstance)
1665 me->IsAIEnabled = false;
1666 }
Definition: PassiveAI.h:53
Creature *const me
Definition: CreatureAI.h:72
InstanceScript * GetInstanceScript() const
Definition: Object.cpp:1203
bool IsAIEnabled
Definition: Unit.h:1962
InstanceScript * pInstance
Definition: halls_of_reflection.cpp:1668
SummonList summons
Definition: halls_of_reflection.cpp:1670

References WorldObject::GetInstanceScript(), Unit::IsAIEnabled, CreatureAI::me, and pInstance.

Member Function Documentation

◆ DoAction()

void npc_hor_lich_king::npc_hor_lich_kingAI::DoAction ( int32  a)
inlineoverridevirtual

Reimplemented from UnitAI.

1683 {
1685 events.ScheduleEvent(EVENT_LK_START_FOLLOWING, 1500ms);
1687 {
1688 if ((a == ACTION_CHECK_TRASH_DIED && reqKillCount == 0) || (a == ACTION_INFORM_TRASH_DIED && (--reqKillCount) == 0))
1689 {
1690 events.CancelEvent(EVENT_DECREASE_REQ_COUNT_BY_100); // just in case, magic happens sometimes
1691 ++currentWall;
1693 if (currentWall <= 3)
1694 {
1695 events.ScheduleEvent(EVENT_LK_SUMMON_NEXT_ICE_WALL, 1s);
1696 events.ScheduleEvent(EVENT_LK_SUMMON, currentWall == 3 ? 11s : 7500ms);
1697 }
1698 else
1701 c->AI()->DoAction(ACTION_INFORM_WALL_DESTROYED);
1702 }
1703 }
1704 }
events
Definition: boss_sartura.cpp:43
@ ACTION_INFORM_WALL_DESTROYED
Definition: halls_of_reflection.h:248
@ ACTION_INFORM_TRASH_DIED
Definition: halls_of_reflection.h:246
@ SPELL_REMORSELESS_WINTER
Definition: halls_of_reflection.h:284
@ ACTION_CHECK_TRASH_DIED
Definition: halls_of_reflection.h:247
@ ACTION_START_LK_FIGHT_REAL
Definition: halls_of_reflection.h:245
@ ACTION_DELETE_ICE_WALL
Definition: halls_of_reflection.h:44
@ EVENT_LK_START_FOLLOWING
Definition: halls_of_reflection.cpp:1635
@ EVENT_DECREASE_REQ_COUNT_BY_100
Definition: halls_of_reflection.cpp:1646
@ EVENT_LK_SUMMON_NEXT_ICE_WALL
Definition: halls_of_reflection.cpp:1644
@ EVENT_LK_SUMMON
Definition: halls_of_reflection.cpp:1640
@ NPC_SYLVANAS_PART2
Definition: forge_of_souls.h:41
Definition: Creature.h:43
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4776
ObjectGuid GetGuidData(uint32 type) const override
Definition: InstanceScript.cpp:98
Map * instance
Definition: InstanceScript.h:148
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3317
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:52
uint8 currentWall
Definition: halls_of_reflection.cpp:1671
uint8 reqKillCount
Definition: halls_of_reflection.cpp:1672

References ACTION_CHECK_TRASH_DIED, ACTION_DELETE_ICE_WALL, ACTION_INFORM_TRASH_DIED, ACTION_INFORM_WALL_DESTROYED, ACTION_START_LK_FIGHT_REAL, currentWall, EVENT_DECREASE_REQ_COUNT_BY_100, EVENT_LK_START_FOLLOWING, EVENT_LK_SUMMON, EVENT_LK_SUMMON_NEXT_ICE_WALL, Map::GetCreature(), InstanceScript::GetGuidData(), InstanceScript::instance, CreatureAI::me, NPC_SYLVANAS_PART2, pInstance, Unit::RemoveAura(), reqKillCount, ZoneScript::SetData(), and SPELL_REMORSELESS_WINTER.

Referenced by UpdateAI().

◆ JustSummoned()

void npc_hor_lich_king::npc_hor_lich_kingAI::JustSummoned ( Creature s)
inlineoverridevirtual

Reimplemented from CreatureAI.

1732 {
1733
1734 ++reqKillCount;
1735 if (events.GetNextEventTime(EVENT_DECREASE_REQ_COUNT_BY_100))
1736 events.RescheduleEvent(EVENT_DECREASE_REQ_COUNT_BY_100, 10s);
1737 summons.Summon(s);
1741 if (Unit* target = s->SelectNearestPlayer(350.0f))
1742 {
1743 s->AddThreat(target, 1000.0f);
1744 s->AI()->AttackStart(target);
1745 }
1747 }
const Position PathWaypoints[PATH_WP_COUNT]
Definition: halls_of_reflection.h:342
const uint8 WP_STOP[6]
Definition: halls_of_reflection.h:340
virtual void AttackStart(Unit *)
Definition: UnitAI.cpp:27
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:88
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition: Creature.cpp:2811
void SetHomePosition(float x, float y, float z, float o)
Definition: Creature.h:336
CreatureAI * AI() const
Definition: Creature.h:140
Player * SelectNearestPlayer(float distance=0) const
Definition: Object.cpp:2484
Definition: Unit.h:630
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition: Unit.cpp:14653
MotionMaster * GetMotionMaster()
Definition: Unit.h:1620
void MovePoint(uint32 id, const Position &pos, bool generatePath=true, bool forceDestination=true)
Definition: MotionMaster.h:213

References Unit::AddThreat(), Creature::AI(), UnitAI::AttackStart(), currentWall, EVENT_DECREASE_REQ_COUNT_BY_100, Unit::GetMotionMaster(), MotionMaster::MovePoint(), PathWaypoints, reqKillCount, WorldObject::SelectNearestPlayer(), Creature::SetHomePosition(), Creature::SetInCombatWithZone(), SummonList::Summon(), summons, and WP_STOP.

◆ MovementInform()

void npc_hor_lich_king::npc_hor_lich_kingAI::MovementInform ( uint32  type,
uint32   
)
inlineoverridevirtual

Reimplemented from CreatureAI.

1707 {
1708 // Xinef: dont use 0, it is no longer the last point
1709 // Xinef: if type is escort and spline is finalized, it means that we reached last point from the path
1710 if (type == ESCORT_MOTION_TYPE && me->movespline->Finalized())
1711 {
1712 if (currentWall == 0)
1713 {
1715 me->SetOrientation(4.15f);
1717 {
1718 me->SetFacingToObject(icewall);
1719 me->CastSpell(icewall, SPELL_SUMMON_ICE_WALL, false);
1720 events.ScheduleEvent(EVENT_LK_REMORSELESS_WINTER, 4s);
1721 }
1722 }
1723 else if (currentWall == 4)
1724 {
1727 }
1728 }
1729 }
Talk
Definition: hyjal.cpp:82
@ NPC_ICE_WALL_TARGET
Definition: halls_of_reflection.h:75
@ SPELL_SUMMON_ICE_WALL
Definition: halls_of_reflection.h:288
@ SAY_LK_NOWHERE_TO_RUN
Definition: halls_of_reflection.h:192
@ SAY_LK_IW_1
Definition: halls_of_reflection.h:185
@ DATA_LICH_KING
Definition: halls_of_reflection.h:35
@ EVENT_LK_REMORSELESS_WINTER
Definition: halls_of_reflection.cpp:1637
@ DONE
Definition: InstanceScript.h:60
@ ESCORT_MOTION_TYPE
Definition: MotionMaster.h:57
void SetOrientation(float orientation)
Definition: Position.h:111
Movement::MoveSpline * movespline
Definition: Unit.h:1979
void SetFacingToObject(WorldObject *object)
Definition: Unit.cpp:20537
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
bool Finalized() const
Definition: MoveSpline.h:116

References Unit::CastSpell(), currentWall, DATA_LICH_KING, DONE, ESCORT_MOTION_TYPE, EVENT_LK_REMORSELESS_WINTER, Movement::MoveSpline::Finalized(), Map::GetCreature(), InstanceScript::GetGuidData(), InstanceScript::instance, CreatureAI::me, Unit::movespline, NPC_ICE_WALL_TARGET, pInstance, SAY_LK_IW_1, SAY_LK_NOWHERE_TO_RUN, ZoneScript::SetData(), Unit::SetFacingToObject(), Position::SetOrientation(), and SPELL_SUMMON_ICE_WALL.

◆ Reset()

void npc_hor_lich_king::npc_hor_lich_kingAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

1676 {
1677 currentWall = 0;
1678 reqKillCount = 0;
1679 events.Reset();
1680 events.RescheduleEvent(EVENT_LK_CHECK_COMBAT, 1s);
1681 }
@ EVENT_LK_CHECK_COMBAT
Definition: halls_of_reflection.cpp:1638

References currentWall, EVENT_LK_CHECK_COMBAT, and reqKillCount.

◆ SpellHitTarget()

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

Reimplemented from CreatureAI.

1755 {
1756 if (target && target->IsAlive() && spell->Id == SPELL_LICH_KING_ZAP_PLAYER)
1757 Unit::DealDamage(me, target, 10000);
1758 }
@ SPELL_LICH_KING_ZAP_PLAYER
Definition: halls_of_reflection.h:285
bool IsAlive() const
Definition: Unit.h:1654
static uint32 DealDamage(Unit *attacker, Unit *victim, uint32 damage, CleanDamage const *cleanDamage=nullptr, DamageEffectType damagetype=DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *spellProto=nullptr, bool durabilityLoss=true, bool allowGM=false, Spell const *spell=nullptr)
Definition: Unit.cpp:810

References Unit::DealDamage(), SpellInfo::Id, Unit::IsAlive(), CreatureAI::me, and SPELL_LICH_KING_ZAP_PLAYER.

◆ SummonedCreatureDespawn()

void npc_hor_lich_king::npc_hor_lich_kingAI::SummonedCreatureDespawn ( Creature s)
inlineoverridevirtual

Reimplemented from CreatureAI.

1750 {
1751 summons.Despawn(s);
1752 }
void Despawn(Creature const *summon)
Definition: ScriptedCreature.h:89

References SummonList::Despawn(), and summons.

◆ UpdateAI()

void npc_hor_lich_king::npc_hor_lich_kingAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Reimplemented from NullCreatureAI.

1761 {
1762 if (me->HealthBelowPct(70))
1763 me->SetHealth(me->GetMaxHealth() * 3 / 4);
1764
1765 events.Update(diff);
1766
1767 if (me->IsNonMeleeSpellCast(false, true, true))
1768 return;
1769
1770 switch (events.ExecuteEvent())
1771 {
1773 if (me->isActiveObject()) // during fight
1774 {
1776 if (leader->IsAlive() && leader->GetPositionX() < 5575.0f && me->GetExactDist2d(leader) <= 12.5f && !leader->HasAura(SPELL_HARVEST_SOUL) && me->HasAura(SPELL_REMORSELESS_WINTER))
1777 {
1779 me->StopMoving();
1780 reqKillCount = 255;
1781 leader->InterruptNonMeleeSpells(true);
1782 me->CastSpell(leader, SPELL_HARVEST_SOUL, false);
1783 events.ScheduleEvent(EVENT_LK_KILL_LEADER, 3s);
1784 events.ScheduleEvent(EVENT_LK_CHECK_COMBAT, 1s);
1785 break;
1786 }
1788 {
1790 ++div2;
1791 if (div2 > 1)
1792 {
1793 div2 = 0;
1794 if (me->HasAura(SPELL_REMORSELESS_WINTER)) // prevent going behind him during fight
1795 {
1797 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
1798 if (Player* p = itr->GetSource())
1799 if (!p->IsGameMaster() && p->IsAlive() && (p->GetPositionX() - me->GetPositionX() + p->GetPositionY() - me->GetPositionY()) > 20.0f)
1801 }
1802 }
1803 }
1804 else
1805 {
1808 }
1809 }
1810 events.ScheduleEvent(EVENT_LK_CHECK_COMBAT, 1s);
1811 break;
1814 {
1815 leader->CastSpell(leader, SPELL_HOR_SUICIDE, true);
1816 Unit::Kill(me, leader);
1818 me->CastSpell((Unit*)nullptr, SPELL_FURY_OF_FROSTMOURNE, false);
1819 }
1820 break;
1822 {
1823 me->SetSpeed(MOVE_RUN, 9.0f / 7.0f);
1825 path.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
1826 for (uint8 i = 0; i <= 2; ++i)
1827 path.push_back(G3D::Vector3(PathWaypoints[i].GetPositionX(), PathWaypoints[i].GetPositionY(), PathWaypoints[i].GetPositionZ()));
1829 }
1830 break;
1832 {
1837 path.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
1838 for (uint8 i = 3; i < PATH_WP_COUNT - 1; ++i)
1839 path.push_back(G3D::Vector3(PathWaypoints[i].GetPositionX(), PathWaypoints[i].GetPositionY(), PathWaypoints[i].GetPositionZ()));
1842 events.ScheduleEvent(EVENT_LK_SUMMON, 1s);
1843 }
1844 break;
1845 case EVENT_LK_SUMMON:
1846 switch (currentWall)
1847 {
1848 case 0:
1849 events.ScheduleEvent(EVENT_LK_SUMMON_GHOULS, 0ms);
1850 events.ScheduleEvent(EVENT_LK_SUMMON_RWD, 4s);
1851 break;
1852 case 1:
1853 events.ScheduleEvent(EVENT_LK_SUMMON_LA, 0ms);
1854 events.ScheduleEvent(EVENT_LK_SUMMON_GHOULS, 100ms);
1855 events.ScheduleEvent(EVENT_LK_SUMMON_RWD, 4s);
1856 events.ScheduleEvent(EVENT_LK_SUMMON_RWD, 5100ms);
1857 break;
1858 case 2:
1859 events.ScheduleEvent(EVENT_LK_SUMMON_LA, 0ms);
1860 events.ScheduleEvent(EVENT_LK_SUMMON_GHOULS, 100ms);
1861 events.ScheduleEvent(EVENT_LK_SUMMON_LA, 4s);
1862 events.ScheduleEvent(EVENT_LK_SUMMON_RWD, 4100ms);
1863 events.ScheduleEvent(EVENT_LK_SUMMON_RWD, 5200ms);
1864 break;
1865 case 3:
1866 events.ScheduleEvent(EVENT_LK_SUMMON_LA, 0ms);
1867 events.ScheduleEvent(EVENT_LK_SUMMON_RWD, 100ms);
1868 events.ScheduleEvent(EVENT_LK_SUMMON_GHOULS, 1200ms);
1869 events.ScheduleEvent(EVENT_LK_SUMMON_RWD, 5300ms);
1870 events.ScheduleEvent(EVENT_LK_SUMMON_RWD, 6400ms);
1871 events.ScheduleEvent(EVENT_LK_SUMMON_GHOULS, 12s + 500ms);
1872 events.ScheduleEvent(EVENT_LK_SUMMON_LA, 16s + 500ms);
1873 events.ScheduleEvent(EVENT_LK_SUMMON_RWD, 16s + 600ms);
1874 events.ScheduleEvent(EVENT_LK_SUMMON_LA, 17s + 700ms);
1875 break;
1876 }
1877 if (currentWall <= 3)
1878 {
1879 reqKillCount = 100;
1880 events.RescheduleEvent(EVENT_DECREASE_REQ_COUNT_BY_100, 10s);
1881 }
1882 break;
1884 reqKillCount = (reqKillCount <= 100 ? 0 : reqKillCount - 100);
1886 break;
1888 me->CastSpell((Unit*)nullptr, SPELL_SUMMON_RAGING_GHOULS, false);
1889 break;
1892 break;
1893 case EVENT_LK_SUMMON_LA:
1895 break;
1900 break;
1901 }
1902 }
std::uint8_t uint8
Definition: Define.h:109
@ SPELL_SUMMON_RAGING_GHOULS
Definition: halls_of_reflection.h:292
@ SPELL_SUMMON_LUMBERING_ABOMINATION
Definition: halls_of_reflection.h:294
@ SPELL_SUMMON_RISEN_WITCH_DOCTOR
Definition: halls_of_reflection.h:293
@ SPELL_HARVEST_SOUL
Definition: halls_of_reflection.h:290
@ SPELL_HOR_SUICIDE
Definition: halls_of_reflection.h:291
@ SPELL_FURY_OF_FROSTMOURNE
Definition: halls_of_reflection.h:289
@ SAY_LK_WINTER
Definition: halls_of_reflection.h:191
#define PATH_WP_COUNT
Definition: halls_of_reflection.h:339
@ ACTION_STOP_LK_FIGHT
Definition: halls_of_reflection.h:43
@ EVENT_LK_KILL_LEADER
Definition: halls_of_reflection.cpp:1639
@ EVENT_LK_SUMMON_GHOULS
Definition: halls_of_reflection.cpp:1641
@ EVENT_LK_SUMMON_RWD
Definition: halls_of_reflection.cpp:1642
@ EVENT_LK_SUMMON_LA
Definition: halls_of_reflection.cpp:1643
@ MOVE_RUN
Definition: UnitDefines.h:329
std::vector< Vector3 > PointsArray
Definition: MoveSplineInitArgs.h:28
Definition: LinkedList.h:139
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
CreatureTemplate const * GetCreatureTemplate() const
Definition: Creature.h:205
float speed_run
Definition: CreatureData.h:201
bool isActiveObject() const
Definition: Object.h:579
float GetExactDist2d(const float x, const float y) const
Definition: Position.h:165
float GetPositionZ() const
Definition: Position.h:118
float GetPositionX() const
Definition: Position.h:116
float GetPositionY() const
Definition: Position.h:117
Definition: Player.h:1081
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4129
static void Kill(Unit *killer, Unit *victim, bool durabilityLoss=true, WeaponAttackType attackType=BASE_ATTACK, SpellInfo const *spellProto=nullptr, Spell const *spell=nullptr)
Definition: Unit.cpp:17702
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition: Unit.cpp:4099
uint32 GetMaxHealth() const
Definition: Unit.h:1030
void StopMoving()
Definition: Unit.cpp:16650
void SetHealth(uint32 val)
Definition: Unit.cpp:15478
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5698
bool HealthBelowPct(int32 pct) const
Definition: Unit.h:1037
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition: Unit.cpp:14429
bool HavePlayers() const
Definition: Map.h:475
PlayerList const & GetPlayers() const
Definition: Map.h:484
Definition: MapRefMgr.h:26
iterator begin()
Definition: MapRefMgr.h:36
iterator end()
Definition: MapRefMgr.h:37
void propagateSpeedChange()
Definition: MotionMaster.cpp:890
void MovementExpired(bool reset=true)
Definition: MotionMaster.h:180
void MoveSplinePath(Movement::PointsArray *path)
Definition: MotionMaster.cpp:454
uint8 div2
Definition: halls_of_reflection.cpp:1673
void DoAction(int32 a) override
Definition: halls_of_reflection.cpp:1682

References ACTION_CHECK_TRASH_DIED, ACTION_STOP_LK_FIGHT, MapRefMgr::begin(), Unit::CastSpell(), currentWall, SummonList::DespawnAll(), div2, DoAction(), MapRefMgr::end(), EVENT_DECREASE_REQ_COUNT_BY_100, EVENT_LK_CHECK_COMBAT, EVENT_LK_KILL_LEADER, EVENT_LK_REMORSELESS_WINTER, EVENT_LK_START_FOLLOWING, EVENT_LK_SUMMON, EVENT_LK_SUMMON_GHOULS, EVENT_LK_SUMMON_LA, EVENT_LK_SUMMON_NEXT_ICE_WALL, EVENT_LK_SUMMON_RWD, Map::GetCreature(), Creature::GetCreatureTemplate(), Position::GetExactDist2d(), InstanceScript::GetGuidData(), Unit::GetMaxHealth(), Unit::GetMotionMaster(), Map::GetPlayers(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::HasAura(), Map::HavePlayers(), Unit::HealthBelowPct(), InstanceScript::instance, Unit::InterruptNonMeleeSpells(), WorldObject::isActiveObject(), Unit::IsNonMeleeSpellCast(), Unit::Kill(), CreatureAI::me, MOVE_RUN, MotionMaster::MovementExpired(), MotionMaster::MoveSplinePath(), NPC_ICE_WALL_TARGET, NPC_SYLVANAS_PART2, PATH_WP_COUNT, PathWaypoints, pInstance, MotionMaster::propagateSpeedChange(), reqKillCount, SAY_LK_IW_1, SAY_LK_WINTER, ZoneScript::SetData(), Unit::SetHealth(), Creature::SetInCombatWithZone(), Unit::SetSpeed(), CreatureTemplate::speed_run, SPELL_FURY_OF_FROSTMOURNE, SPELL_HARVEST_SOUL, SPELL_HOR_SUICIDE, SPELL_LICH_KING_ZAP_PLAYER, SPELL_REMORSELESS_WINTER, SPELL_SUMMON_ICE_WALL, SPELL_SUMMON_LUMBERING_ABOMINATION, SPELL_SUMMON_RAGING_GHOULS, SPELL_SUMMON_RISEN_WITCH_DOCTOR, Unit::StopMoving(), and summons.

Member Data Documentation

◆ currentWall

uint8 npc_hor_lich_king::npc_hor_lich_kingAI::currentWall

◆ div2

uint8 npc_hor_lich_king::npc_hor_lich_kingAI::div2

Referenced by UpdateAI().

◆ events

EventMap npc_hor_lich_king::npc_hor_lich_kingAI::events

◆ pInstance

InstanceScript* npc_hor_lich_king::npc_hor_lich_kingAI::pInstance

◆ reqKillCount

uint8 npc_hor_lich_king::npc_hor_lich_kingAI::reqKillCount

◆ summons

SummonList npc_hor_lich_king::npc_hor_lich_kingAI::summons