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

Public Member Functions

 npc_hor_lich_king (Creature *creature)
 
void Reset () override
 
void DoAction (int32 action) 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()
 
- Public Member Functions inherited from NullCreatureAI
 NullCreatureAI (Creature *c)
 
void MoveInLineOfSight (Unit *) override
 
void AttackStart (Unit *) override
 
void JustStartedThreateningMe (Unit *) override
 
void JustEnteredCombat (Unit *) override
 Called when the unit enters combat.
 
void UpdateAI (uint32) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void EnterEvadeMode (EvadeReason) override
 
void OnCharmed (bool) override
 Called when unit is charmed.
 
- Public Member Functions inherited from CreatureAI
void Talk (uint8 id, WorldObject const *whisperTarget=nullptr, Milliseconds delay=0ms)
 Causes the creature to talk/say the text assigned to their entry in the creature_text database table.
 
void Talk (uint8 id, Milliseconds delay)
 
WorldObjectGetSummoner () const
 Returns the summoner creature/object, if the creature is a temporary summon.
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
bool IsEngaged () const
 Check if creature is currently engaged in combat.
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
void TriggerAlert (Unit const *who) const
 
virtual bool CanRespawn ()
 
virtual void JustEngagedWith (Unit *)
 Called for reaction when initially engaged - this happens after JustEnteredCombat.
 
void EngagementStart (Unit *who)
 
void EngagementOver ()
 
void JustExitedCombat () override
 Called when the unit leaves combat.
 
virtual void JustDied (Unit *)
 
virtual void KilledUnit (Unit *)
 
virtual void IsSummonedBy (WorldObject *)
 
virtual void SummonedCreatureDies (Creature *, Unit *)
 
virtual void SummonedCreatureDespawnAll ()
 
virtual void SummonedCreatureEvade (Creature *)
 
virtual void SpellHit (Unit *, SpellInfo const *)
 
virtual void OnSpellStart (SpellInfo const *)
 
virtual void OnSpellCast (SpellInfo const *)
 
virtual void OnSpellFailed (SpellInfo const *)
 
virtual void OnChannelFinished (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)
 
virtual void JustReachedHome ()
 
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 bool CanAIAttack (Unit const *) const
 
virtual void InitializeAI ()
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
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 DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 Called at any Damage from any attacker (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

InstanceScriptinstance
 
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)
 
bool _EnterEvadeMode (EvadeReason why=EVADE_REASON_OTHER)
 
- 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

◆ npc_hor_lich_king()

npc_hor_lich_king::npc_hor_lich_king ( Creature creature)
inline
1507 : NullCreatureAI(creature), summons(me)
1508 {
1510 if (!instance)
1511 me->IsAIEnabled = false;
1512 }
Creature *const me
Definition CreatureAI.h:71
Definition PassiveAI.h:56
bool IsAIEnabled
Definition Unit.h:2097
InstanceScript * GetInstanceScript() const
Definition Object.cpp:1238
InstanceScript * instance
Definition halls_of_reflection.cpp:1514
SummonList summons
Definition halls_of_reflection.cpp:1516

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

Member Function Documentation

◆ DoAction()

void npc_hor_lich_king::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from UnitAI.

1529 {
1530 if (action == ACTION_START_LK_FIGHT_REAL)
1531 events.ScheduleEvent(EVENT_LK_START_FOLLOWING, 1500ms);
1532 else if ((action == ACTION_INFORM_TRASH_DIED && reqKillCount) || action == ACTION_CHECK_TRASH_DIED)
1533 {
1534 if ((action == ACTION_CHECK_TRASH_DIED && reqKillCount == 0) || (action == ACTION_INFORM_TRASH_DIED && (--reqKillCount) == 0))
1535 {
1536 events.CancelEvent(EVENT_DECREASE_REQ_COUNT_BY_100); // just in case, magic happens sometimes
1537 ++currentWall;
1539 if (currentWall <= 3)
1540 {
1541 events.ScheduleEvent(EVENT_LK_SUMMON_NEXT_ICE_WALL, 1s);
1542 events.ScheduleEvent(EVENT_LK_SUMMON, currentWall == 3 ? 11s : 7500ms);
1543 }
1544 else
1547 c->AI()->DoAction(ACTION_INFORM_WALL_DESTROYED);
1548 }
1549 }
1550 }
events
Definition boss_sartura.cpp:43
Definition Creature.h:47
Creature * GetCreature(uint32 type)
Definition InstanceScript.cpp:115
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
Definition Unit.cpp:5024
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:52
@ NPC_SYLVANAS_PART2
Definition forge_of_souls.h:46
@ EVENT_LK_START_FOLLOWING
Definition halls_of_reflection.cpp:1491
@ EVENT_DECREASE_REQ_COUNT_BY_100
Definition halls_of_reflection.cpp:1502
@ EVENT_LK_SUMMON_NEXT_ICE_WALL
Definition halls_of_reflection.cpp:1500
@ EVENT_LK_SUMMON
Definition halls_of_reflection.cpp:1496
@ ACTION_INFORM_WALL_DESTROYED
Definition halls_of_reflection.h:254
@ ACTION_INFORM_TRASH_DIED
Definition halls_of_reflection.h:252
@ SPELL_REMORSELESS_WINTER
Definition halls_of_reflection.h:290
@ ACTION_CHECK_TRASH_DIED
Definition halls_of_reflection.h:253
@ ACTION_START_LK_FIGHT_REAL
Definition halls_of_reflection.h:251
@ ACTION_DELETE_ICE_WALL
Definition halls_of_reflection.h:44
uint8 reqKillCount
Definition halls_of_reflection.cpp:1518
uint8 currentWall
Definition halls_of_reflection.cpp:1517

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, InstanceScript::GetCreature(), instance, CreatureAI::me, NPC_SYLVANAS_PART2, Unit::RemoveAura(), reqKillCount, ZoneScript::SetData(), and SPELL_REMORSELESS_WINTER.

Referenced by UpdateAI().

◆ JustSummoned()

void npc_hor_lich_king::JustSummoned ( Creature s)
inlineoverridevirtual

Reimplemented from CreatureAI.

1578 {
1579
1580 ++reqKillCount;
1581 if (events.HasTimeUntilEvent(EVENT_DECREASE_REQ_COUNT_BY_100))
1582 events.RescheduleEvent(EVENT_DECREASE_REQ_COUNT_BY_100, 10s);
1583 summons.Summon(s);
1587 if (Unit* target = s->SelectNearestPlayer(350.0f))
1588 {
1589 s->AddThreat(target, 1000.0f);
1590 s->AI()->AttackStart(target);
1591 }
1593 }
void SetInCombatWithZone()
Set in combat all units in the dungeon/raid. Affect only units with IsAIEnabled.
Definition Creature.cpp:2789
void SetHomePosition(float x, float y, float z, float o)
Definition Creature.h:345
CreatureAI * AI() const
Definition Creature.h:143
void MovePoint(uint32 id, const Position &pos, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE, float speed=0.f, bool generatePath=true, bool forceDestination=true, std::optional< AnimTier > animTier=std::nullopt)
Definition MotionMaster.h:240
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88
virtual void AttackStart(Unit *)
Definition UnitAI.cpp:28
Definition Unit.h:664
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=nullptr)
Definition Unit.cpp:11413
MotionMaster * GetMotionMaster()
Definition Unit.h:1758
Player * SelectNearestPlayer(float distance=0) const
Definition Object.cpp:2526
const Position PathWaypoints[PATH_WP_COUNT]
Definition halls_of_reflection.h:353
const uint8 WP_STOP[6]
Definition halls_of_reflection.h:351

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::MovementInform ( uint32  type,
uint32   
)
inlineoverridevirtual

Reimplemented from CreatureAI.

1553 {
1554 // Xinef: dont use 0, it is no longer the last point
1555 // Xinef: if type is escort and spline is finalized, it means that we reached last point from the path
1556 if (type == ESCORT_MOTION_TYPE && me->movespline->Finalized())
1557 {
1558 if (currentWall == 0)
1559 {
1561 me->SetOrientation(4.15f);
1563 {
1564 me->SetFacingToObject(icewall);
1566 events.ScheduleEvent(EVENT_LK_REMORSELESS_WINTER, 4s);
1567 }
1568 }
1569 else if (currentWall == 4)
1570 {
1573 }
1574 }
1575 }
@ DONE
Definition InstanceScript.h:61
@ ESCORT_MOTION_TYPE
Definition MotionMaster.h:57
ObjectGuid GetGuidData(uint32 type) const override
Definition InstanceScript.cpp:110
Map * instance
Definition InstanceScript.h:149
Creature * GetCreature(ObjectGuid const &guid)
Definition Map.cpp:2336
bool Finalized() const
Definition MoveSpline.h:118
void SetFacingToObject(WorldObject *object, Milliseconds timed=0ms)
Definition Unit.cpp:16421
Movement::MoveSpline * movespline
Definition Unit.h:2114
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
@ EVENT_LK_REMORSELESS_WINTER
Definition halls_of_reflection.cpp:1493
@ NPC_ICE_WALL_TARGET
Definition halls_of_reflection.h:76
@ SPELL_SUMMON_ICE_WALL
Definition halls_of_reflection.h:294
@ SAY_LK_NOWHERE_TO_RUN
Definition halls_of_reflection.h:198
@ SAY_LK_IW_1
Definition halls_of_reflection.h:191
@ DATA_LICH_KING
Definition halls_of_reflection.h:35
Talk
Definition hyjal.cpp:82
void SetOrientation(float orientation)
Definition Position.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, instance, CreatureAI::me, Unit::movespline, NPC_ICE_WALL_TARGET, 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::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

1522 {
1523 currentWall = 0;
1524 reqKillCount = 0;
1525 events.Reset();
1526 events.RescheduleEvent(EVENT_LK_CHECK_COMBAT, 1s);
1527 }
@ EVENT_LK_CHECK_COMBAT
Definition halls_of_reflection.cpp:1494

References currentWall, EVENT_LK_CHECK_COMBAT, and reqKillCount.

◆ SpellHitTarget()

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

Reimplemented from CreatureAI.

1601 {
1602 if (target && target->IsAlive() && spell->Id == SPELL_LICH_KING_ZAP_PLAYER)
1603 Unit::DealDamage(me, target, 10000);
1604 }
bool IsAlive() const
Definition Unit.h:1793
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:983
@ SPELL_LICH_KING_ZAP_PLAYER
Definition halls_of_reflection.h:291

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

◆ SummonedCreatureDespawn()

void npc_hor_lich_king::SummonedCreatureDespawn ( Creature s)
inlineoverridevirtual

Reimplemented from CreatureAI.

1596 {
1597 summons.Despawn(s);
1598 }
void Despawn(Creature const *summon)
Definition ScriptedCreature.h:89

References SummonList::Despawn(), and summons.

◆ UpdateAI()

void npc_hor_lich_king::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

1607 {
1608 if (me->HealthBelowPct(70))
1609 me->SetHealth(me->GetMaxHealth() * 3 / 4);
1610
1611 events.Update(diff);
1612
1613 if (me->IsNonMeleeSpellCast(false, true, true))
1614 return;
1615
1616 switch (events.ExecuteEvent())
1617 {
1619 if (me->isActiveObject()) // during fight
1620 {
1622 if (leader->IsAlive() && leader->GetPositionX() < 5575.0f && me->GetExactDist2d(leader) <= 12.5f && !leader->HasAura(SPELL_HARVEST_SOUL) && me->HasAura(SPELL_REMORSELESS_WINTER))
1623 {
1625 me->StopMoving();
1626 reqKillCount = 255;
1627 leader->InterruptNonMeleeSpells(true);
1629 events.ScheduleEvent(EVENT_LK_KILL_LEADER, 3s);
1630 events.ScheduleEvent(EVENT_LK_CHECK_COMBAT, 1s);
1631 break;
1632 }
1634 {
1636 ++div2;
1637 if (div2 > 1)
1638 {
1639 div2 = 0;
1640 if (me->HasAura(SPELL_REMORSELESS_WINTER)) // prevent going behind him during fight
1641 {
1643 for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
1644 if (Player* p = itr->GetSource())
1645 if (!p->IsGameMaster() && p->IsAlive() && (p->GetPositionX() - me->GetPositionX() + p->GetPositionY() - me->GetPositionY()) > 20.0f)
1647 }
1648 }
1649 }
1650 else
1651 {
1654 }
1655 }
1656 events.ScheduleEvent(EVENT_LK_CHECK_COMBAT, 1s);
1657 break;
1660 {
1661 leader->CastSpell(leader, SPELL_HOR_SUICIDE, true);
1662 Unit::Kill(me, leader);
1665 }
1666 break;
1668 {
1669 me->SetSpeed(MOVE_RUN, 9.0f / 7.0f);
1671 path.emplace_back(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
1672 for (uint8 i = 0; i <= 2; ++i)
1675 }
1676 break;
1678 {
1683 path.emplace_back(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
1684 for (uint8 i = 3; i < PATH_WP_COUNT - 1; ++i)
1688 events.ScheduleEvent(EVENT_LK_SUMMON, 1s);
1689 }
1690 break;
1691 case EVENT_LK_SUMMON:
1692 switch (currentWall)
1693 {
1694 case 0:
1695 events.ScheduleEvent(EVENT_LK_SUMMON_GHOULS, 0ms);
1696 events.ScheduleEvent(EVENT_LK_SUMMON_RWD, 4s);
1697 break;
1698 case 1:
1699 events.ScheduleEvent(EVENT_LK_SUMMON_LA, 0ms);
1700 events.ScheduleEvent(EVENT_LK_SUMMON_GHOULS, 100ms);
1701 events.ScheduleEvent(EVENT_LK_SUMMON_RWD, 4s);
1702 events.ScheduleEvent(EVENT_LK_SUMMON_RWD, 5100ms);
1703 break;
1704 case 2:
1705 events.ScheduleEvent(EVENT_LK_SUMMON_LA, 0ms);
1706 events.ScheduleEvent(EVENT_LK_SUMMON_GHOULS, 100ms);
1707 events.ScheduleEvent(EVENT_LK_SUMMON_LA, 4s);
1708 events.ScheduleEvent(EVENT_LK_SUMMON_RWD, 4100ms);
1709 events.ScheduleEvent(EVENT_LK_SUMMON_RWD, 5200ms);
1710 break;
1711 case 3:
1712 events.ScheduleEvent(EVENT_LK_SUMMON_LA, 0ms);
1713 events.ScheduleEvent(EVENT_LK_SUMMON_RWD, 100ms);
1714 events.ScheduleEvent(EVENT_LK_SUMMON_GHOULS, 1200ms);
1715 events.ScheduleEvent(EVENT_LK_SUMMON_RWD, 5300ms);
1716 events.ScheduleEvent(EVENT_LK_SUMMON_RWD, 6400ms);
1717 events.ScheduleEvent(EVENT_LK_SUMMON_GHOULS, 12s + 500ms);
1718 events.ScheduleEvent(EVENT_LK_SUMMON_LA, 16s + 500ms);
1719 events.ScheduleEvent(EVENT_LK_SUMMON_RWD, 16s + 600ms);
1720 events.ScheduleEvent(EVENT_LK_SUMMON_LA, 17s + 700ms);
1721 break;
1722 }
1723 if (currentWall <= 3)
1724 {
1725 reqKillCount = 100;
1726 events.RescheduleEvent(EVENT_DECREASE_REQ_COUNT_BY_100, 10s);
1727 }
1728 break;
1730 reqKillCount = (reqKillCount <= 100 ? 0 : reqKillCount - 100);
1732 break;
1735 break;
1738 break;
1739 case EVENT_LK_SUMMON_LA:
1741 break;
1746 break;
1747 }
1748 }
std::uint8_t uint8
Definition Define.h:109
@ MOVE_RUN
Definition UnitDefines.h:357
CreatureTemplate const * GetCreatureTemplate() const
Definition Creature.h:206
Definition LinkedList.h:139
Definition MapRefMgr.h:26
iterator begin()
Definition MapRefMgr.h:36
iterator end()
Definition MapRefMgr.h:37
bool HavePlayers() const
Definition Map.h:320
PlayerList const & GetPlayers() const
Definition Map.h:326
void MoveSplinePath(Movement::PointsArray *path, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE)
Definition MotionMaster.cpp:503
void propagateSpeedChange()
Definition MotionMaster.cpp:938
void MovementExpired(bool reset=true)
Definition MotionMaster.h:206
Definition Player.h:1084
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:72
SpellCastResult DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:285
SpellCastResult DoCastSelf(uint32 spellId, bool triggered=false)
Definition UnitAI.h:394
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4302
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:13938
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
Definition Unit.cpp:4272
uint32 GetMaxHealth() const
Definition Unit.h:1109
void StopMoving()
Definition Unit.cpp:12997
void SetHealth(uint32 val)
Definition Unit.cpp:12315
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:5982
bool HealthBelowPct(int32 pct) const
Definition Unit.h:1116
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
Definition Unit.cpp:11270
bool isActiveObject() const
Definition Object.h:671
@ EVENT_LK_KILL_LEADER
Definition halls_of_reflection.cpp:1495
@ EVENT_LK_SUMMON_GHOULS
Definition halls_of_reflection.cpp:1497
@ EVENT_LK_SUMMON_RWD
Definition halls_of_reflection.cpp:1498
@ EVENT_LK_SUMMON_LA
Definition halls_of_reflection.cpp:1499
@ SPELL_SUMMON_RAGING_GHOULS
Definition halls_of_reflection.h:298
@ SPELL_SUMMON_LUMBERING_ABOMINATION
Definition halls_of_reflection.h:300
@ SPELL_SUMMON_RISEN_WITCH_DOCTOR
Definition halls_of_reflection.h:299
@ SPELL_HARVEST_SOUL
Definition halls_of_reflection.h:296
@ SPELL_HOR_SUICIDE
Definition halls_of_reflection.h:297
@ SPELL_FURY_OF_FROSTMOURNE
Definition halls_of_reflection.h:295
@ SAY_LK_WINTER
Definition halls_of_reflection.h:197
#define PATH_WP_COUNT
Definition halls_of_reflection.h:350
@ ACTION_STOP_LK_FIGHT
Definition halls_of_reflection.h:43
std::vector< Vector3 > PointsArray
Definition MoveSplineInitArgs.h:28
float speed_run
Definition CreatureData.h:202
float GetExactDist2d(const float x, const float y) const
Definition Position.h:170
float GetPositionZ() const
Definition Position.h:123
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
void DoAction(int32 action) override
Definition halls_of_reflection.cpp:1528
uint8 div2
Definition halls_of_reflection.cpp:1519

References ACTION_CHECK_TRASH_DIED, ACTION_STOP_LK_FIGHT, MapRefMgr::begin(), Unit::CastSpell(), currentWall, SummonList::DespawnAll(), div2, DoAction(), UnitAI::DoCastAOE(), UnitAI::DoCastSelf(), 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(), InstanceScript::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, 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, 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::currentWall

◆ div2

uint8 npc_hor_lich_king::div2

Referenced by UpdateAI().

◆ events

EventMap npc_hor_lich_king::events

◆ instance

InstanceScript* npc_hor_lich_king::instance

◆ reqKillCount

uint8 npc_hor_lich_king::reqKillCount

◆ summons

SummonList npc_hor_lich_king::summons

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