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

Public Member Functions

 npc_q24545_lich_kingAI (Creature *c)
 
void CleanAll (bool fromReset=true)
 
void Reset () override
 
void SetGUID (ObjectGuid const &guid, int32) override
 
void SetData (uint32 type, uint32 data) override
 
void UpdateAI (uint32 diff) override
 Use to start attacking a target. Called just before JustEngagedWith()
 
void JustSummoned (Creature *summon) override
 
void SummonedCreatureDespawn (Creature *summon) override
 
void SpellHitTarget (Unit *target, SpellInfo const *spell) override
 
- 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 bool IsEscortNPC (bool=true) const
 
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 MovementInform (uint32, uint32)
 
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 void DoAction (int32)
 
virtual uint32 GetData (uint32) const
 
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 OnDespawn ()
 Called when the unit is about to be removed from the world (despawn, grid unload, corpse disappearing, player logging out etc.)
 
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, int32 aura=0)
 Cast the spell on a random unit from the threat list.
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the top threat target, which may not be the current victim.
 
float DoGetSpellMaxRange (uint32 spellId, bool positive=false)
 
void DoMeleeAttackIfReady ()
 
bool DoSpellAttackIfReady (uint32 spell)
 
void DoSpellAttackToRandomTargetIfReady (uint32 spell, uint32 threatTablePosition=0, float dist=0.f, bool playerOnly=true)
 
virtual void SummonMovementInform (Creature *, uint32, uint32)
 Called when a summon reaches a waypoint or point movement finished.
 
virtual void sGossipHello (Player *)
 
virtual void sGossipSelect (Player *, uint32, uint32)
 
virtual void sGossipSelectCode (Player *, uint32, uint32, char const *)
 
virtual void sQuestAccept (Player *, Quest const *)
 
virtual void sQuestSelect (Player *, Quest const *)
 
virtual void sQuestComplete (Player *, Quest const *)
 
virtual void sQuestReward (Player *, Quest const *, uint32)
 
virtual void sOnGameEvent (bool, uint16)
 
virtual std::string GetDebugInfo () const
 

Public Attributes

EventMap events
 
SummonList summons
 
ObjectGuid playerGUID
 

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_q24545_lich_kingAI()

npc_q24545_lich_king::npc_q24545_lich_kingAI::npc_q24545_lich_kingAI ( Creature c)
inline
1051 {
1052 }
Creature *const me
Definition CreatureAI.h:71
Definition PassiveAI.h:56
SummonList summons
Definition zone_dragonblight.cpp:1055

Member Function Documentation

◆ CleanAll()

void npc_q24545_lich_king::npc_q24545_lich_kingAI::CleanAll ( bool  fromReset = true)
inline
1059 {
1061 c->RemoveAllAuras();
1062 if (fromReset)
1063 {
1065 c->DespawnOrUnsummon(1ms);
1067 c->RemoveAllAuras();
1068 }
1070 c->DespawnOrUnsummon(1ms);
1072 go->Delete();
1074 go->Delete();
1075 WretchedGhoulCleaner cleaner;
1077 Cell::VisitObjects(me, worker, 150.0f);
1078 }
Definition Creature.h:47
Definition GameObject.h:120
GameObject * FindNearestGameObject(uint32 entry, float range, bool onlySpawned=false) const
Definition Object.cpp:2562
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition Object.cpp:2553
Definition zone_dragonblight.cpp:1029
Definition GridNotifiers.h:512
static void VisitObjects(WorldObject const *obj, T &visitor, float radius)
Definition CellImpl.h:165
@ NPC_SAC_LIGHTS_VENGEANCE_VEH_2
Definition zone_dragonblight.cpp:994
@ GO_SAC_LIGHTS_VENGEANCE_1
Definition zone_dragonblight.cpp:998
@ NPC_SAC_LIGHTS_VENGEANCE_VEH_1
Definition zone_dragonblight.cpp:993
@ NPC_SAC_LIGHTS_VENGEANCE_BUNNY
Definition zone_dragonblight.cpp:995
@ NPC_SAC_LIGHTS_VENGEANCE
Definition zone_dragonblight.cpp:992
@ GO_SAC_LIGHTS_VENGEANCE_2
Definition zone_dragonblight.cpp:999

References WorldObject::FindNearestCreature(), WorldObject::FindNearestGameObject(), GO_SAC_LIGHTS_VENGEANCE_1, GO_SAC_LIGHTS_VENGEANCE_2, CreatureAI::me, NPC_SAC_LIGHTS_VENGEANCE, NPC_SAC_LIGHTS_VENGEANCE_BUNNY, NPC_SAC_LIGHTS_VENGEANCE_VEH_1, NPC_SAC_LIGHTS_VENGEANCE_VEH_2, and Cell::VisitObjects().

Referenced by Reset(), and UpdateAI().

◆ JustSummoned()

void npc_q24545_lich_king::npc_q24545_lich_kingAI::JustSummoned ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

1321 {
1322 summons.Summon(summon);
1323 }
void Summon(Creature const *summon)
Definition ScriptedCreature.h:88

References SummonList::Summon(), and summons.

◆ Reset()

void npc_q24545_lich_king::npc_q24545_lich_kingAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

1081 {
1082 events.Reset();
1083 events.ScheduleEvent(998, 10s);
1084 events.ScheduleEvent(999, 0ms);
1085 events.ScheduleEvent(1, 3s);
1087 playerGUID.Clear();
1088
1089 CleanAll();
1090
1091 me->setActive(false);
1092 me->SetWalk(true);
1093 me->SetVisible(false);
1094 me->RemoveAllAuras();
1096 float x, y, z, o;
1097 me->GetHomePosition(x, y, z, o);
1098 me->UpdatePosition(x, y, z, o, true);
1100 me->GetMotionMaster()->Clear();
1101 }
events
Definition boss_sartura.cpp:43
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition Creature.h:349
bool SetWalk(bool enable) override
Enable or disable the creature's walk mode by removing: MOVEMENTFLAG_WALKING. Infom also the client.
Definition Creature.cpp:3343
void Clear(bool reset=true)
Definition MotionMaster.h:194
void Clear()
Definition ObjectGuid.h:141
void DespawnAll(Milliseconds delay=0ms)
Definition ScriptedCreature.cpp:72
void SetVisible(bool x)
Definition Unit.cpp:11107
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition Unit.cpp:4313
MotionMaster * GetMotionMaster()
Definition Unit.h:1763
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition Unit.cpp:16012
void StopMovingOnCurrentPos()
Definition Unit.cpp:13081
void RemoveAllAuras()
Definition Unit.cpp:5613
void setActive(bool isActiveObject)
Definition Object.cpp:1086
void CleanAll(bool fromReset=true)
Definition zone_dragonblight.cpp:1058
ObjectGuid playerGUID
Definition zone_dragonblight.cpp:1056

References CleanAll(), ObjectGuid::Clear(), MotionMaster::Clear(), SummonList::DespawnAll(), Creature::GetHomePosition(), Unit::GetMotionMaster(), Unit::InterruptNonMeleeSpells(), CreatureAI::me, playerGUID, Unit::RemoveAllAuras(), WorldObject::setActive(), Unit::SetVisible(), Creature::SetWalk(), Unit::StopMovingOnCurrentPos(), summons, and Unit::UpdatePosition().

Referenced by UpdateAI().

◆ SetData()

void npc_q24545_lich_king::npc_q24545_lich_kingAI::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from UnitAI.

1115 {
1116 if (!playerGUID || type != data)
1117 return;
1118 if (data == 1)
1119 events.ScheduleEvent(15, 0ms);
1120 else if (data == 2)
1121 {
1123 go->Delete();
1125 {
1126 c->CastSpell(c, SPELL_SAC_HAMMER_SHIELD, true);
1127 c->CastSpell(c, SPELL_SAC_SUMMON_GO_3, true);
1129 p->KnockbackFrom(c->GetPositionX(), c->GetPositionY(), 5.0f, 3.0f);
1130 }
1131 events.ScheduleEvent(18, 3s);
1132 }
1133 else if (data == 3)
1134 {
1136 {
1137 c->RemoveAllAuras();
1138 c->CastSpell(c, SPELL_SAC_HOLY_ZONE_AURA, true);
1140 go->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
1141 playerGUID.Clear();
1142 events.RescheduleEvent(2, 1min);
1143 }
1144 }
1145 }
@ GO_FLAG_NOT_SELECTABLE
Definition SharedDefines.h:1611
Definition Player.h:1086
Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition ObjectAccessor.cpp:244
@ SPELL_SAC_HOLY_ZONE_AURA
Definition zone_dragonblight.cpp:1003
@ SPELL_SAC_SUMMON_GO_3
Definition zone_dragonblight.cpp:1021
@ SPELL_SAC_HAMMER_SHIELD
Definition zone_dragonblight.cpp:1020
@ GO_SAC_LIGHTS_VENGEANCE_3
Definition zone_dragonblight.cpp:1000

References ObjectGuid::Clear(), WorldObject::FindNearestCreature(), WorldObject::FindNearestGameObject(), ObjectAccessor::GetPlayer(), GO_FLAG_NOT_SELECTABLE, GO_SAC_LIGHTS_VENGEANCE_2, GO_SAC_LIGHTS_VENGEANCE_3, CreatureAI::me, NPC_SAC_LIGHTS_VENGEANCE_VEH_1, playerGUID, SPELL_SAC_HAMMER_SHIELD, SPELL_SAC_HOLY_ZONE_AURA, and SPELL_SAC_SUMMON_GO_3.

◆ SetGUID()

void npc_q24545_lich_king::npc_q24545_lich_kingAI::SetGUID ( ObjectGuid const &  guid,
int32   
)
inlineoverridevirtual

Reimplemented from UnitAI.

1104 {
1105 if (playerGUID || events.HasTimeUntilEvent(998) || events.HasTimeUntilEvent(2))
1106 return;
1107
1108 me->setActive(true);
1109 playerGUID = guid;
1110 events.ScheduleEvent(2, 15min);
1111 events.ScheduleEvent(3, 0ms);
1112 }

References CreatureAI::me, playerGUID, and WorldObject::setActive().

◆ SpellHitTarget()

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

Reimplemented from CreatureAI.

1331 {
1332 if (spell->Id == SPELL_SAC_REPEL_HAMMER && target->IsCreature())
1333 {
1334 target->CastSpell((Unit*)nullptr, SPELL_SAC_THROW_HAMMER, true);
1335 target->ToCreature()->DespawnOrUnsummon(1ms);
1336 if (Unit* c = target->GetVehicleBase())
1337 c->RemoveAurasDueToSpell(SPELL_SAC_HOLY_ZONE_AURA);
1338 }
1339 }
void DespawnOrUnsummon(Milliseconds msTimeToDespawn=0ms, Seconds forcedRespawnTimer=0s)
Definition Creature.cpp:2199
bool IsCreature() const
Definition Object.h:205
Creature * ToCreature()
Definition Object.h:206
Definition Unit.h:665
Unit * GetVehicleBase() const
Definition Unit.cpp:15020
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:1359
@ SPELL_SAC_THROW_HAMMER
Definition zone_dragonblight.cpp:1004
@ SPELL_SAC_REPEL_HAMMER
Definition zone_dragonblight.cpp:1002

References Unit::CastSpell(), Creature::DespawnOrUnsummon(), Unit::GetVehicleBase(), SpellInfo::Id, Object::IsCreature(), SPELL_SAC_HOLY_ZONE_AURA, SPELL_SAC_REPEL_HAMMER, SPELL_SAC_THROW_HAMMER, and Object::ToCreature().

◆ SummonedCreatureDespawn()

void npc_q24545_lich_king::npc_q24545_lich_kingAI::SummonedCreatureDespawn ( Creature summon)
inlineoverridevirtual

Reimplemented from CreatureAI.

1326 {
1327 summons.Despawn(summon);
1328 }
void Despawn(Creature const *summon)
Definition ScriptedCreature.h:89

References SummonList::Despawn(), and summons.

◆ UpdateAI()

void npc_q24545_lich_king::npc_q24545_lich_kingAI::UpdateAI ( uint32  )
inlineoverridevirtual

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

Implements UnitAI.

1148 {
1149 events.Update(diff);
1150 switch (events.ExecuteEvent())
1151 {
1152 case 0:
1153 break;
1154 case 998: // ensure everything is cleaned up
1155 CleanAll(false);
1156 break;
1157 case 999: // apply holy aura
1160 {
1161 l->CastSpell(c, SPELL_SAC_VEHICLE_CONTROL_AURA, true);
1162 c->CastSpell(c, SPELL_SAC_HOLY_ZONE_AURA, true);
1163 }
1164 break;
1165 case 1: // check player
1166 if (playerGUID)
1167 {
1168 bool valid = false;
1170 if (p->IsAlive() && p->GetPhaseMask() & 2 && p->GetExactDistSq(me) < 100.0f * 100.0f && !p->IsGameMaster())
1171 valid = true;
1172 if (!valid)
1173 {
1174 Reset();
1175 return;
1176 }
1177 }
1178 events.ScheduleEvent(1, 3s);
1179 break;
1180 case 2: // reset timer
1181 Reset();
1182 break;
1183 case 3: // start event
1185 {
1186 me->CastSpell(p, SPELL_SAC_STUN, true);
1187 me->SetVisible(true);
1189 path.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
1190 path.push_back(G3D::Vector3(4825.35f, -582.99f, 164.83f));
1191 path.push_back(G3D::Vector3(4813.38f, -580.94f, 162.62f));
1193 events.ScheduleEvent(4, 10s);
1194 }
1195 break;
1196 case 4: // talk 0
1197 Talk(0);
1198 events.ScheduleEvent(5, 6s);
1199 break;
1200 case 5: // talk 1
1201 Talk(1);
1202 events.ScheduleEvent(6, 4s);
1203 events.ScheduleEvent(7, 11s);
1204 break;
1205 case 6: // repel hammer
1206 me->CastSpell((Unit*)nullptr, SPELL_SAC_REPEL_HAMMER, false);
1208 c->CastSpell(c, SPELL_SAC_BLUE_EXPLOSION, true);
1209
1210 events.ScheduleEvent(65, 3500ms);
1211 break;
1212 case 65: // spawn hammer go
1214 {
1215 c->CastSpell(c, SPELL_SAC_HOLY_ZONE_AURA, true);
1216 c->CastSpell(c, SPELL_SAC_SUMMON_GO_1, true);
1217 }
1218 break;
1219 case 7: // talk 2
1220 Talk(2);
1221 events.ScheduleEvent(8, 8s);
1222 events.ScheduleEvent(9, 11s + 500ms);
1223 break;
1224 case 8: // summon ghouls
1225 me->CastSpell((Unit*)nullptr, SPELL_SAC_SUMMON_GHOULS_AURA, false);
1226 break;
1227 case 9: // talk 3
1228 Talk(3);
1229 events.ScheduleEvent(10, 10s);
1230 break;
1231 case 10: // summon vegard
1232 me->SummonCreature(NPC_SAC_VEGARD_1, 4812.12f, -586.08f, 162.49f, 3.14f, TEMPSUMMON_MANUAL_DESPAWN);
1233 events.ScheduleEvent(11, 4s);
1234 events.ScheduleEvent(12, 5s);
1235 break;
1236 case 11: // vagard shield
1237 if (Creature* c = me->FindNearestCreature(NPC_SAC_VEGARD_1, 50.0f, true))
1239 break;
1240 case 12: // talk 4
1241 Talk(4);
1243 me->CastSpell(p, SPELL_SAC_ZAP_PLAYER, false);
1244 events.ScheduleEvent(13, 3500ms);
1245 events.ScheduleEvent(14, 6s);
1246 break;
1247 case 13: // despawn
1249 break;
1250 case 14: // vagard talk 0
1251 me->SetVisible(false);
1252 me->RemoveAllAuras();
1253 if (Creature* c = me->FindNearestCreature(NPC_SAC_VEGARD_1, 50.0f, true))
1254 {
1255 c->AI()->Talk(0);
1256 c->CastSpell(c, SPELL_SAC_VEGARD_SUMMON_GHOULS_AURA, false);
1257 }
1259 go->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
1260 break;
1261 case 15: // remove light
1264 {
1265 c->RemoveAurasDueToSpell(SPELL_SAC_HOLY_ZONE_AURA);
1267 {
1268 x->SetCanFly(true);
1269 x->SetDisableGravity(true);
1270 x->SetHover(true);
1271 x->NearTeleportTo(4812.09f, -585.55f, 172.03f, 3.75f);
1272 l->EnterVehicle(x, 1);
1273 //l->ClearUnitState(UNIT_STATE_ONVEHICLE);
1274 l->CastSpell(l, SPELL_SAC_HOLY_BOMB_VISUAL, false);
1275 l->AddAura(SPELL_SAC_HOLY_BOMB_VISUAL, l);
1276 events.ScheduleEvent(16, 5s);
1277 }
1278 }
1279 break;
1280 case 16: // add aura to kill ghouls
1282 c->CastSpell(c, SPELL_SAC_ZAP_GHOULS_AURA, true);
1283 if (Creature* c = me->FindNearestCreature(NPC_SAC_VEGARD_1, 50.0f, true))
1284 c->RemoveAurasDueToSpell(SPELL_SAC_VEGARD_SUMMON_GHOULS_AURA);
1285 events.ScheduleEvent(17, 12s);
1286 break;
1287 case 17: // kill vegard
1288 {
1289 WretchedGhoulCleaner cleaner;
1291 Cell::VisitObjects(me, worker, 150.0f);
1292
1294 if (Creature* v = me->FindNearestCreature(NPC_SAC_VEGARD_1, 50.0f, true))
1296 {
1297 c->CastSpell(v, SPELL_SAC_KILL_VEGARD, true);
1298 v->SetDisplayId(11686);
1299 v->DespawnOrUnsummon(1s);
1300 b->CastSpell(b, SPELL_SAC_HOLY_BOMB_EXPLOSION, true);
1301 b->CastSpell(b, SPELL_SAC_SUMMON_GO_2, true);
1302 if (Unit* vb = c->GetVehicleBase())
1303 {
1304 if (Unit* pass = vb->GetVehicleKit()->GetPassenger(0))
1305 if (pass->IsCreature())
1306 pass->ToCreature()->DespawnOrUnsummon(1ms);
1307 vb->RemoveAllAuras();
1308 vb->ToCreature()->DespawnOrUnsummon(1ms);
1309 }
1310 c->ToCreature()->DespawnOrUnsummon(1ms);
1311 }
1312 }
1313 break;
1314 case 18: // summon vegard
1316 break;
1317 }
1318 }
@ TEMPSUMMON_MANUAL_DESPAWN
Definition Object.h:56
void MoveSplinePath(Movement::PointsArray *path, ForcedMovement forcedMovement=FORCED_MOVEMENT_NONE)
Definition MotionMaster.cpp:504
Vehicle * GetVehicleKit() const
Definition Unit.h:1930
Unit * GetPassenger(int8 seatId) const
Definition Vehicle.cpp:253
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0, SummonPropertiesEntry const *properties=nullptr, bool visibleBySummonerOnly=false) const
Definition Object.cpp:2448
Talk
Definition hyjal.cpp:82
std::vector< Vector3 > PointsArray
Definition MoveSplineInitArgs.h:28
float GetPositionZ() const
Definition Position.h:123
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122
void Reset() override
Definition zone_dragonblight.cpp:1080
@ SPELL_SAC_VEHICLE_CONTROL_AURA
Definition zone_dragonblight.cpp:1025
@ NPC_SAC_VEGARD_1
Definition zone_dragonblight.cpp:997
@ SPELL_SAC_SUMMON_GHOULS_AURA
Definition zone_dragonblight.cpp:1006
@ SPELL_SAC_VEGARD_SUMMON_GHOULS_AURA
Definition zone_dragonblight.cpp:1011
@ SPELL_SAC_SUMMON_VEGARD_SKELETON
Definition zone_dragonblight.cpp:1019
@ SPELL_SAC_LK_DESPAWN_ANIM
Definition zone_dragonblight.cpp:1010
@ SPELL_SAC_ZAP_PLAYER
Definition zone_dragonblight.cpp:1009
@ SPELL_SAC_SUMMON_GO_2
Definition zone_dragonblight.cpp:1018
@ SPELL_SAC_KILL_VEGARD
Definition zone_dragonblight.cpp:1017
@ SPELL_SAC_BLUE_EXPLOSION
Definition zone_dragonblight.cpp:1024
@ SPELL_SAC_HOLY_BOMB_EXPLOSION
Definition zone_dragonblight.cpp:1014
@ SPELL_SAC_SHIELD_OF_THE_LICH_KING
Definition zone_dragonblight.cpp:1008
@ SPELL_SAC_STUN
Definition zone_dragonblight.cpp:1001
@ SPELL_SAC_SUMMON_GO_1
Definition zone_dragonblight.cpp:1005
@ SPELL_SAC_HOLY_BOMB_VISUAL
Definition zone_dragonblight.cpp:1013
@ SPELL_SAC_ZAP_GHOULS_AURA
Definition zone_dragonblight.cpp:1015

References Unit::CastSpell(), CleanAll(), WorldObject::FindNearestCreature(), WorldObject::FindNearestGameObject(), Unit::GetMotionMaster(), Vehicle::GetPassenger(), ObjectAccessor::GetPlayer(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::GetVehicleBase(), Unit::GetVehicleKit(), GO_FLAG_NOT_SELECTABLE, GO_SAC_LIGHTS_VENGEANCE_1, CreatureAI::me, MotionMaster::MoveSplinePath(), NPC_SAC_LIGHTS_VENGEANCE, NPC_SAC_LIGHTS_VENGEANCE_BUNNY, NPC_SAC_LIGHTS_VENGEANCE_VEH_1, NPC_SAC_LIGHTS_VENGEANCE_VEH_2, NPC_SAC_VEGARD_1, playerGUID, Unit::RemoveAllAuras(), Reset(), Unit::SetVisible(), SPELL_SAC_BLUE_EXPLOSION, SPELL_SAC_HOLY_BOMB_EXPLOSION, SPELL_SAC_HOLY_BOMB_VISUAL, SPELL_SAC_HOLY_ZONE_AURA, SPELL_SAC_KILL_VEGARD, SPELL_SAC_LK_DESPAWN_ANIM, SPELL_SAC_REPEL_HAMMER, SPELL_SAC_SHIELD_OF_THE_LICH_KING, SPELL_SAC_STUN, SPELL_SAC_SUMMON_GHOULS_AURA, SPELL_SAC_SUMMON_GO_1, SPELL_SAC_SUMMON_GO_2, SPELL_SAC_SUMMON_VEGARD_SKELETON, SPELL_SAC_VEGARD_SUMMON_GHOULS_AURA, SPELL_SAC_VEHICLE_CONTROL_AURA, SPELL_SAC_ZAP_GHOULS_AURA, SPELL_SAC_ZAP_PLAYER, WorldObject::SummonCreature(), TEMPSUMMON_MANUAL_DESPAWN, and Cell::VisitObjects().

Member Data Documentation

◆ events

EventMap npc_q24545_lich_king::npc_q24545_lich_kingAI::events

◆ playerGUID

ObjectGuid npc_q24545_lich_king::npc_q24545_lich_kingAI::playerGUID

Referenced by Reset(), SetData(), SetGUID(), and UpdateAI().

◆ summons

SummonList npc_q24545_lich_king::npc_q24545_lich_kingAI::summons

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