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 guid, int32) override
 
void SetData (uint32 type, uint32 data) override
 
void UpdateAI (uint32 diff) override
 
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 UpdateAI (uint32) override
 
void EnterEvadeMode (EvadeReason) override
 
void OnCharmed (bool) override
 
- 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.
 
void Talk (uint8 id, Milliseconds delay)
 
 CreatureAI (Creature *creature)
 
 ~CreatureAI () override
 
void MoveCircleChecks ()
 
void MoveBackwardsChecks ()
 
void MoveInLineOfSight_Safe (Unit *who)
 == Reactions At =================================
 
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.
 
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 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
 
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 ==================
 
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 ()
 
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 *)
 
- 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
 
virtual void InitializeAI ()
 
virtual void Reset ()
 
virtual void OnCharmed (bool apply)=0
 
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)
 
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 (NOTE: Creature engage logic should NOT be here, but in JustEngagedWith, which happens once threat is established!)
 
virtual void JustExitedCombat ()
 Called when the unit leaves combat.
 
virtual void DamageDealt (Unit *, uint32 &, DamageEffectType)
 
virtual void DamageTaken (Unit *, uint32 &, DamageEffectType, SpellSchoolMask)
 
virtual void HealReceived (Unit *, uint32 &)
 
virtual void OnPowerUpdate (Powers, int32, int32, uint32)
 
virtual void HealDone (Unit *, uint32 &)
 
virtual void OnCalculateMeleeDamageReceived (uint32 &, Unit *)
 
virtual void OnCalculateSpellDamageReceived (int32 &, Unit *)
 
virtual void OnCalculatePeriodicTickReceived (uint32 &, Unit *)
 
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)
 
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)
 
SpellCastResult DoCastMaxThreat (uint32 spellId, uint32 threatTablePosition=0, float dist=0.0f, bool playerOnly=true, bool triggered=false)
 Cast spell on the max threat target, which may not always 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)
 
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)
 
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_q24545_lich_kingAI()

npc_q24545_lich_king::npc_q24545_lich_kingAI::npc_q24545_lich_kingAI ( Creature c)
inline
1068 {
1069 }
Definition: PassiveAI.h:53
Creature *const me
Definition: CreatureAI.h:73
SummonList summons
Definition: zone_dragonblight.cpp:1072

Member Function Documentation

◆ CleanAll()

void npc_q24545_lich_king::npc_q24545_lich_kingAI::CleanAll ( bool  fromReset = true)
inline
1076 {
1078 c->RemoveAllAuras();
1079 if (fromReset)
1080 {
1082 c->DespawnOrUnsummon(1);
1084 c->RemoveAllAuras();
1085 }
1087 c->DespawnOrUnsummon(1);
1089 go->Delete();
1091 go->Delete();
1092 WretchedGhoulCleaner cleaner;
1094 Cell::VisitGridObjects(me, worker, 150.0f);
1095 }
@ NPC_SAC_LIGHTS_VENGEANCE_VEH_2
Definition: zone_dragonblight.cpp:1011
@ GO_SAC_LIGHTS_VENGEANCE_1
Definition: zone_dragonblight.cpp:1015
@ NPC_SAC_LIGHTS_VENGEANCE_VEH_1
Definition: zone_dragonblight.cpp:1010
@ NPC_SAC_LIGHTS_VENGEANCE_BUNNY
Definition: zone_dragonblight.cpp:1012
@ NPC_SAC_LIGHTS_VENGEANCE
Definition: zone_dragonblight.cpp:1009
@ GO_SAC_LIGHTS_VENGEANCE_2
Definition: zone_dragonblight.cpp:1016
Definition: Creature.h:46
Definition: GameObject.h:122
GameObject * FindNearestGameObject(uint32 entry, float range, bool onlySpawned=false) const
Definition: Object.cpp:2443
Creature * FindNearestCreature(uint32 entry, float range, bool alive=true) const
Definition: Object.cpp:2434
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
Definition: CellImpl.h:179
Definition: GridNotifiers.h:486
Definition: zone_dragonblight.cpp:1046

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::VisitGridObjects().

Referenced by Reset(), and UpdateAI().

◆ JustSummoned()

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

Reimplemented from CreatureAI.

1338 {
1339 summons.Summon(summon);
1340 }
void Summon(Creature const *summon)
Definition: ScriptedCreature.h:90

References SummonList::Summon(), and summons.

◆ Reset()

void npc_q24545_lich_king::npc_q24545_lich_kingAI::Reset ( )
inlineoverridevirtual

Reimplemented from UnitAI.

1098 {
1099 events.Reset();
1100 events.ScheduleEvent(998, 10s);
1101 events.ScheduleEvent(999, 0ms);
1102 events.ScheduleEvent(1, 3s);
1104 playerGUID.Clear();
1105
1106 CleanAll();
1107
1108 me->setActive(false);
1109 me->SetWalk(true);
1110 me->SetVisible(false);
1111 me->RemoveAllAuras();
1113 float x, y, z, o;
1114 me->GetHomePosition(x, y, z, o);
1115 me->UpdatePosition(x, y, z, o, true);
1117 me->GetMotionMaster()->Clear();
1118 }
events
Definition: boss_sartura.cpp:43
void DespawnAll(uint32 delay=0)
Definition: ScriptedCreature.cpp:71
void GetHomePosition(float &x, float &y, float &z, float &ori) const
Definition: Creature.h:332
bool SetWalk(bool enable) override
Definition: Creature.cpp:3098
void setActive(bool isActiveObject)
Definition: Object.cpp:1085
void Clear()
Definition: ObjectGuid.h:140
void SetVisible(bool x)
Definition: Unit.cpp:14220
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true, bool bySelf=false)
Definition: Unit.cpp:4081
MotionMaster * GetMotionMaster()
Definition: Unit.h:2276
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition: Unit.cpp:20296
void StopMovingOnCurrentPos()
Definition: Unit.cpp:16957
void RemoveAllAuras()
Definition: Unit.cpp:5259
void Clear(bool reset=true)
Definition: MotionMaster.h:165
void CleanAll(bool fromReset=true)
Definition: zone_dragonblight.cpp:1075
ObjectGuid playerGUID
Definition: zone_dragonblight.cpp:1073

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.

1132 {
1133 if (!playerGUID || type != data)
1134 return;
1135 if (data == 1)
1136 events.ScheduleEvent(15, 0ms);
1137 else if (data == 2)
1138 {
1140 go->Delete();
1142 {
1143 c->CastSpell(c, SPELL_SAC_HAMMER_SHIELD, true);
1144 c->CastSpell(c, SPELL_SAC_SUMMON_GO_3, true);
1146 p->KnockbackFrom(c->GetPositionX(), c->GetPositionY(), 5.0f, 3.0f);
1147 }
1148 events.ScheduleEvent(18, 3s);
1149 }
1150 else if (data == 3)
1151 {
1153 {
1154 c->RemoveAllAuras();
1155 c->CastSpell(c, SPELL_SAC_HOLY_ZONE_AURA, true);
1157 go->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
1158 playerGUID.Clear();
1159 events.RescheduleEvent(2, 1min);
1160 }
1161 }
1162 }
@ SPELL_SAC_HOLY_ZONE_AURA
Definition: zone_dragonblight.cpp:1020
@ SPELL_SAC_SUMMON_GO_3
Definition: zone_dragonblight.cpp:1038
@ SPELL_SAC_HAMMER_SHIELD
Definition: zone_dragonblight.cpp:1037
@ GO_SAC_LIGHTS_VENGEANCE_3
Definition: zone_dragonblight.cpp:1017
@ GO_FLAG_NOT_SELECTABLE
Definition: SharedDefines.h:1607
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:223
Definition: Player.h:1056

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  guid,
int32   
)
inlineoverridevirtual

Reimplemented from UnitAI.

1121 {
1122 if (playerGUID || events.GetNextEventTime(998) || events.GetNextEventTime(2))
1123 return;
1124
1125 me->setActive(true);
1126 playerGUID = guid;
1127 events.ScheduleEvent(2, 15min);
1128 events.ScheduleEvent(3, 0ms);
1129 }

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.

1348 {
1349 if (spell->Id == SPELL_SAC_REPEL_HAMMER && target->GetTypeId() == TYPEID_UNIT)
1350 {
1351 target->CastSpell((Unit*)nullptr, SPELL_SAC_THROW_HAMMER, true);
1352 target->ToCreature()->DespawnOrUnsummon(1);
1353 if (Unit* c = target->GetVehicleBase())
1354 c->RemoveAurasDueToSpell(SPELL_SAC_HOLY_ZONE_AURA);
1355 }
1356 }
@ TYPEID_UNIT
Definition: ObjectGuid.h:37
@ SPELL_SAC_THROW_HAMMER
Definition: zone_dragonblight.cpp:1021
@ SPELL_SAC_REPEL_HAMMER
Definition: zone_dragonblight.cpp:1019
void DespawnOrUnsummon(Milliseconds msTimeToDespawn, Seconds forcedRespawnTimer)
Definition: Creature.cpp:2117
TypeID GetTypeId() const
Definition: Object.h:121
Creature * ToCreature()
Definition: Object.h:197
Definition: Unit.h:1302
Unit * GetVehicleBase() const
Definition: Unit.cpp:19006
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:1169

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

◆ SummonedCreatureDespawn()

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

Reimplemented from CreatureAI.

1343 {
1344 summons.Despawn(summon);
1345 }
void Despawn(Creature const *summon)
Definition: ScriptedCreature.h:91

References SummonList::Despawn(), and summons.

◆ UpdateAI()

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

Reimplemented from NullCreatureAI.

1165 {
1166 events.Update(diff);
1167 switch (events.ExecuteEvent())
1168 {
1169 case 0:
1170 break;
1171 case 998: // ensure everything is cleaned up
1172 CleanAll(false);
1173 break;
1174 case 999: // apply holy aura
1177 {
1178 l->CastSpell(c, SPELL_SAC_VEHICLE_CONTROL_AURA, true);
1179 c->CastSpell(c, SPELL_SAC_HOLY_ZONE_AURA, true);
1180 }
1181 break;
1182 case 1: // check player
1183 if (playerGUID)
1184 {
1185 bool valid = false;
1187 if (p->IsAlive() && p->GetPhaseMask() & 2 && p->GetExactDistSq(me) < 100.0f * 100.0f && !p->IsGameMaster())
1188 valid = true;
1189 if (!valid)
1190 {
1191 Reset();
1192 return;
1193 }
1194 }
1195 events.ScheduleEvent(1, 3s);
1196 break;
1197 case 2: // reset timer
1198 Reset();
1199 break;
1200 case 3: // start event
1202 {
1203 me->CastSpell(p, SPELL_SAC_STUN, true);
1204 me->SetVisible(true);
1206 path.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
1207 path.push_back(G3D::Vector3(4825.35f, -582.99f, 164.83f));
1208 path.push_back(G3D::Vector3(4813.38f, -580.94f, 162.62f));
1210 events.ScheduleEvent(4, 10s);
1211 }
1212 break;
1213 case 4: // talk 0
1214 Talk(0);
1215 events.ScheduleEvent(5, 6s);
1216 break;
1217 case 5: // talk 1
1218 Talk(1);
1219 events.ScheduleEvent(6, 4s);
1220 events.ScheduleEvent(7, 11s);
1221 break;
1222 case 6: // repel hammer
1223 me->CastSpell((Unit*)nullptr, SPELL_SAC_REPEL_HAMMER, false);
1225 c->CastSpell(c, SPELL_SAC_BLUE_EXPLOSION, true);
1226
1227 events.ScheduleEvent(65, 3500ms);
1228 break;
1229 case 65: // spawn hammer go
1231 {
1232 c->CastSpell(c, SPELL_SAC_HOLY_ZONE_AURA, true);
1233 c->CastSpell(c, SPELL_SAC_SUMMON_GO_1, true);
1234 }
1235 break;
1236 case 7: // talk 2
1237 Talk(2);
1238 events.ScheduleEvent(8, 8s);
1239 events.ScheduleEvent(9, 11s + 500ms);
1240 break;
1241 case 8: // summon ghouls
1242 me->CastSpell((Unit*)nullptr, SPELL_SAC_SUMMON_GHOULS_AURA, false);
1243 break;
1244 case 9: // talk 3
1245 Talk(3);
1246 events.ScheduleEvent(10, 10s);
1247 break;
1248 case 10: // summon vegard
1249 me->SummonCreature(NPC_SAC_VEGARD_1, 4812.12f, -586.08f, 162.49f, 3.14f, TEMPSUMMON_MANUAL_DESPAWN);
1250 events.ScheduleEvent(11, 4s);
1251 events.ScheduleEvent(12, 5s);
1252 break;
1253 case 11: // vagard shield
1254 if (Creature* c = me->FindNearestCreature(NPC_SAC_VEGARD_1, 50.0f, true))
1256 break;
1257 case 12: // talk 4
1258 Talk(4);
1260 me->CastSpell(p, SPELL_SAC_ZAP_PLAYER, false);
1261 events.ScheduleEvent(13, 3500ms);
1262 events.ScheduleEvent(14, 6s);
1263 break;
1264 case 13: // despawn
1266 break;
1267 case 14: // vagard talk 0
1268 me->SetVisible(false);
1269 me->RemoveAllAuras();
1270 if (Creature* c = me->FindNearestCreature(NPC_SAC_VEGARD_1, 50.0f, true))
1271 {
1272 c->AI()->Talk(0);
1273 c->CastSpell(c, SPELL_SAC_VEGARD_SUMMON_GHOULS_AURA, false);
1274 }
1276 go->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
1277 break;
1278 case 15: // remove light
1281 {
1282 c->RemoveAurasDueToSpell(SPELL_SAC_HOLY_ZONE_AURA);
1284 {
1285 x->SetCanFly(true);
1286 x->SetDisableGravity(true);
1287 x->SetHover(true);
1288 x->NearTeleportTo(4812.09f, -585.55f, 172.03f, 3.75f);
1289 l->EnterVehicle(x, 1);
1290 //l->ClearUnitState(UNIT_STATE_ONVEHICLE);
1291 l->CastSpell(l, SPELL_SAC_HOLY_BOMB_VISUAL, false);
1292 l->AddAura(SPELL_SAC_HOLY_BOMB_VISUAL, l);
1293 events.ScheduleEvent(16, 5s);
1294 }
1295 }
1296 break;
1297 case 16: // add aura to kill ghouls
1299 c->CastSpell(c, SPELL_SAC_ZAP_GHOULS_AURA, true);
1300 if (Creature* c = me->FindNearestCreature(NPC_SAC_VEGARD_1, 50.0f, true))
1301 c->RemoveAurasDueToSpell(SPELL_SAC_VEGARD_SUMMON_GHOULS_AURA);
1302 events.ScheduleEvent(17, 12s);
1303 break;
1304 case 17: // kill vegard
1305 {
1306 WretchedGhoulCleaner cleaner;
1308 Cell::VisitGridObjects(me, worker, 150.0f);
1309
1311 if (Creature* v = me->FindNearestCreature(NPC_SAC_VEGARD_1, 50.0f, true))
1313 {
1314 c->CastSpell(v, SPELL_SAC_KILL_VEGARD, true);
1315 v->SetDisplayId(11686);
1316 v->DespawnOrUnsummon(1000);
1317 b->CastSpell(b, SPELL_SAC_HOLY_BOMB_EXPLOSION, true);
1318 b->CastSpell(b, SPELL_SAC_SUMMON_GO_2, true);
1319 if (Unit* vb = c->GetVehicleBase())
1320 {
1321 if (Unit* pass = vb->GetVehicleKit()->GetPassenger(0))
1322 if (pass->GetTypeId() == TYPEID_UNIT)
1323 pass->ToCreature()->DespawnOrUnsummon(1);
1324 vb->RemoveAllAuras();
1325 vb->ToCreature()->DespawnOrUnsummon(1);
1326 }
1327 c->ToCreature()->DespawnOrUnsummon(1);
1328 }
1329 }
1330 break;
1331 case 18: // summon vegard
1333 break;
1334 }
1335 }
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: Object.h:49
@ SPELL_SAC_VEHICLE_CONTROL_AURA
Definition: zone_dragonblight.cpp:1042
@ NPC_SAC_VEGARD_1
Definition: zone_dragonblight.cpp:1014
@ SPELL_SAC_SUMMON_GHOULS_AURA
Definition: zone_dragonblight.cpp:1023
@ SPELL_SAC_VEGARD_SUMMON_GHOULS_AURA
Definition: zone_dragonblight.cpp:1028
@ SPELL_SAC_SUMMON_VEGARD_SKELETON
Definition: zone_dragonblight.cpp:1036
@ SPELL_SAC_LK_DESPAWN_ANIM
Definition: zone_dragonblight.cpp:1027
@ SPELL_SAC_ZAP_PLAYER
Definition: zone_dragonblight.cpp:1026
@ SPELL_SAC_SUMMON_GO_2
Definition: zone_dragonblight.cpp:1035
@ SPELL_SAC_KILL_VEGARD
Definition: zone_dragonblight.cpp:1034
@ SPELL_SAC_BLUE_EXPLOSION
Definition: zone_dragonblight.cpp:1041
@ SPELL_SAC_HOLY_BOMB_EXPLOSION
Definition: zone_dragonblight.cpp:1031
@ SPELL_SAC_SHIELD_OF_THE_LICH_KING
Definition: zone_dragonblight.cpp:1025
@ SPELL_SAC_STUN
Definition: zone_dragonblight.cpp:1018
@ SPELL_SAC_SUMMON_GO_1
Definition: zone_dragonblight.cpp:1022
@ SPELL_SAC_HOLY_BOMB_VISUAL
Definition: zone_dragonblight.cpp:1030
@ SPELL_SAC_ZAP_GHOULS_AURA
Definition: zone_dragonblight.cpp:1032
Talk
Definition: boss_fathomlord_karathress.cpp:25
std::vector< Vector3 > PointsArray
Definition: MoveSplineInitArgs.h:28
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:2343
float GetPositionZ() const
Definition: Position.h:119
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
Vehicle * GetVehicleKit() const
Definition: Unit.h:2367
Unit * GetPassenger(int8 seatId) const
Definition: Vehicle.cpp:226
void MoveSplinePath(Movement::PointsArray *path)
Definition: MotionMaster.cpp:436
void Reset() override
Definition: zone_dragonblight.cpp:1097

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, TYPEID_UNIT, and Cell::VisitGridObjects().

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