AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
instance_molten_core::instance_molten_core_InstanceMapScript Struct Reference
Inheritance diagram for instance_molten_core::instance_molten_core_InstanceMapScript:
InstanceScript ZoneScript

Public Member Functions

 instance_molten_core_InstanceMapScript (Map *map)
 
void OnPlayerEnter (Player *) override
 
void OnCreatureCreate (Creature *creature) override
 
void OnCreatureRemove (Creature *creature) override
 
void OnGameObjectCreate (GameObject *go) override
 
ObjectGuid GetGuidData (uint32 type) const override
 
bool SetBossState (uint32 bossId, EncounterState state) override
 
void DoAction (int32 action) override
 
void SummonMajordomoExecutus ()
 
bool CheckMajordomoExecutus () const
 
- Public Member Functions inherited from InstanceScript
 InstanceScript (Map *map)
 
 ~InstanceScript () override
 
virtual void Initialize ()
 
virtual void Load (char const *data)
 
virtual void CreatureLooted (Creature *, LootType)
 
virtual std::string GetSaveData ()
 
void SaveToDB ()
 
virtual void Update (uint32)
 
virtual bool IsEncounterInProgress () const
 
void OnCreatureCreate (Creature *creature) override
 
void OnCreatureRemove (Creature *creature) override
 
void OnGameObjectCreate (GameObject *go) override
 
void OnGameObjectRemove (GameObject *go) override
 
ObjectGuid GetObjectGuid (uint32 type) const
 
ObjectGuid GetGuidData (uint32 type) const override
 
CreatureGetCreature (uint32 type)
 
GameObjectGetGameObject (uint32 type)
 
virtual void OnPlayerEnter (Player *)
 
virtual void OnPlayerAreaUpdate (Player *, uint32, uint32)
 
virtual void OnPlayerInWaterStateUpdate (Player *, bool)
 
void HandleGameObject (ObjectGuid guid, bool open, GameObject *go=nullptr)
 
void DoUseDoorOrButton (ObjectGuid guid, uint32 withRestoreTime=0, bool useAlternativeState=false)
 
void DoRespawnGameObject (ObjectGuid guid, uint32 timeToDespawn=MINUTE)
 
void DoRespawnCreature (ObjectGuid guid, bool force=false)
 
void DoRespawnCreature (uint32 type, bool force=false)
 
void DoUpdateWorldState (uint32 worldstateId, uint32 worldstateValue)
 
void DoSendNotifyToInstance (char const *format,...)
 
void DoUpdateAchievementCriteria (AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=nullptr)
 
void DoStartTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
void DoStopTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
void DoRemoveAurasDueToSpellOnPlayers (uint32 spell)
 
void DoCastSpellOnPlayers (uint32 spell)
 
void DoCastSpellOnPlayer (Player *player, uint32 spell, bool includePets, bool includeControlled)
 
bool ServerAllowsTwoSideGroups ()
 
virtual bool SetBossState (uint32 id, EncounterState state)
 
EncounterState GetBossState (uint32 id) const
 
CreatureBoundary const * GetBossBoundary (uint32 id) const
 
BossInfo const * GetBossInfo (uint32 id) const
 
uint32 GetPersistentData (uint32 index) const
 
void StorePersistentData (uint32 index, uint32 data)
 
virtual bool CheckAchievementCriteriaMeet (uint32, Player const *, Unit const *=nullptr, uint32=0)
 
virtual bool CheckRequiredBosses (uint32, Player const *=nullptr) const
 
void SetCompletedEncountersMask (uint32 newMask, bool save)
 
uint32 GetCompletedEncounterMask () const
 
void SendEncounterUnit (uint32 type, Unit *unit=nullptr, uint8 param1=0, uint8 param2=0)
 
virtual void FillInitialWorldStates (WorldPacket &)
 
uint32 GetEncounterCount () const
 
void MarkAreaTriggerDone (uint32 id)
 
void ResetAreaTriggerDone (uint32 id)
 
bool IsAreaTriggerDone (uint32 id) const
 
virtual void DoAction (int32)
 
void DoForAllMinions (uint32 id, std::function< void(Creature *)> exec)
 
void StoreGameObjectState (ObjectGuid::LowType spawnId, uint8 state)
 
uint8 GetStoredGameObjectState (ObjectGuid::LowType spawnId) const
 
void LoadInstanceSavedGameobjectStateData ()
 
bool IsBossDone (uint32 bossId) const
 
bool AllBossesDone () const
 
bool AllBossesDone (std::initializer_list< uint32 > bossIds) const
 
- Public Member Functions inherited from ZoneScript
 ZoneScript ()
 
virtual ~ZoneScript ()
 
virtual uint32 GetCreatureEntry (ObjectGuid::LowType, CreatureData const *data)
 
virtual uint32 GetGameObjectEntry (ObjectGuid::LowType, uint32 entry)
 
virtual void OnCreatureCreate (Creature *)
 
virtual void OnCreatureRemove (Creature *)
 
virtual void OnGameObjectCreate (GameObject *)
 
virtual void OnGameObjectRemove (GameObject *)
 
virtual void OnUnitDeath (Unit *)
 
virtual void OnCreatureEvade (Creature *)
 
virtual ObjectGuid GetGuidData (uint32) const
 
virtual void SetGuidData (uint32, ObjectGuid)
 
virtual uint64 GetData64 (uint32) const
 
virtual void SetData64 (uint32, uint64)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void ProcessEvent (WorldObject *, uint32)
 

Private Attributes

std::unordered_map< uint32, ObjectGuid_circlesGUIDs
 
std::unordered_map< uint32, ObjectGuid_runesGUIDs
 
ObjectGuid _golemaggGUID
 
GuidSet _golemaggMinionsGUIDS
 
ObjectGuid _ragnarosGUID
 
ObjectGuid _lavaSteamGUID
 
ObjectGuid _lavaSplashGUID
 
ObjectGuid _majordomoExecutusGUID
 
ObjectGuid _cacheOfTheFirelordGUID
 
ObjectGuid _garrGUID
 
ObjectGuid _magmadarGUID
 

Additional Inherited Members

- Static Public Member Functions inherited from InstanceScript
static std::string GetBossStateName (uint8 state)
 
- Public Attributes inherited from InstanceScript
Mapinstance
 
TaskScheduler scheduler
 
- Protected Member Functions inherited from InstanceScript
void SetHeaders (std::string const &dataHeaders)
 
void SetBossNumber (uint32 number)
 
void SetPersistentDataCount (uint32 number)
 
void LoadBossBoundaries (BossBoundaryData const &data)
 
void LoadDoorData (DoorData const *data)
 
void LoadMinionData (MinionData const *data)
 
void LoadObjectData (ObjectData const *creatureData, ObjectData const *gameObjectData)
 
void AddObject (Creature *obj, bool add=true)
 
void RemoveObject (Creature *obj)
 
void AddObject (GameObject *obj, bool add=true)
 
void RemoveObject (GameObject *obj)
 
void AddObject (WorldObject *obj, uint32 type, bool add=true)
 
void RemoveObject (WorldObject *obj, uint32 type)
 
void AddDoor (GameObject *door, bool add=true)
 
void RemoveDoor (GameObject *door)
 
void AddMinion (Creature *minion, bool add=true)
 
void RemoveMinion (Creature *minion)
 
void UpdateDoorState (GameObject *door)
 
void UpdateMinionState (Creature *minion, EncounterState state)
 
bool ReadSaveDataHeaders (std::istringstream &data)
 
void ReadSaveDataBossStates (std::istringstream &data)
 
void ReadSavePersistentData (std::istringstream &data)
 
virtual void ReadSaveDataMore (std::istringstream &)
 
void WriteSaveDataHeaders (std::ostringstream &data)
 
void WriteSaveDataBossStates (std::ostringstream &data)
 
void WritePersistentData (std::ostringstream &data)
 
virtual void WriteSaveDataMore (std::ostringstream &)
 

Detailed Description

Constructor & Destructor Documentation

◆ instance_molten_core_InstanceMapScript()

instance_molten_core::instance_molten_core_InstanceMapScript::instance_molten_core_InstanceMapScript ( Map map)
inline
63 : InstanceScript(map)
64 {
68 }
#define MAX_ENCOUNTER
Definition: violet_hold.h:21
#define DataHeader
Definition: blackrock_depths.h:23
MinionData const minionData[]
Definition: instance_molten_core.cpp:24
Definition: InstanceScript.h:142
void SetBossNumber(uint32 number)
Definition: InstanceScript.h:285
void LoadMinionData(MinionData const *data)
Definition: InstanceScript.cpp:149
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:138

References DataHeader, InstanceScript::LoadMinionData(), MAX_ENCOUNTER, minionData, InstanceScript::SetBossNumber(), and InstanceScript::SetHeaders().

Member Function Documentation

◆ CheckMajordomoExecutus()

bool instance_molten_core::instance_molten_core_InstanceMapScript::CheckMajordomoExecutus ( ) const
inline
380 {
382 {
383 return false;
384 }
385
386 for (uint8 i = 0; i < DATA_MAJORDOMO_EXECUTUS; ++i)
387 {
388 if (i == DATA_LUCIFRON)
389 {
390 continue;
391 }
392
393 if (GetBossState(i) != DONE)
394 {
395 return false;
396 }
397 }
398
399 // Prevent spawning if Ragnaros is present
401 {
402 return false;
403 }
404
405 return true;
406 }
std::uint8_t uint8
Definition: Define.h:109
@ DONE
Definition: InstanceScript.h:60
@ DATA_MAJORDOMO_EXECUTUS
Definition: molten_core.h:39
@ DATA_RAGNAROS
Definition: molten_core.h:40
@ DATA_LUCIFRON
Definition: molten_core.h:31
Map * instance
Definition: InstanceScript.h:148
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:235
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3314
ObjectGuid _ragnarosGUID
Definition: instance_molten_core.cpp:417

References _ragnarosGUID, DATA_LUCIFRON, DATA_MAJORDOMO_EXECUTUS, DATA_RAGNAROS, DONE, InstanceScript::GetBossState(), Map::GetCreature(), and InstanceScript::instance.

Referenced by OnPlayerEnter(), and SetBossState().

◆ DoAction()

void instance_molten_core::instance_molten_core_InstanceMapScript::DoAction ( int32  action)
inlineoverridevirtual

Reimplemented from InstanceScript.

338 {
340 {
341 if (Creature* golemagg = instance->GetCreature(_golemaggGUID))
342 {
343 golemagg->AI()->EnterEvadeMode();
344 }
345
346 if (!_golemaggMinionsGUIDS.empty())
347 {
348 for (ObjectGuid const& minionGuid : _golemaggMinionsGUIDS)
349 {
350 if (Creature* minion = instance->GetCreature(minionGuid))
351 {
352 minion->AI()->EnterEvadeMode();
353 }
354 }
355 }
356 }
357 }
@ ACTION_RESET_GOLEMAGG_ENCOUNTER
Definition: molten_core.h:51
Definition: Creature.h:46
Definition: ObjectGuid.h:118
ObjectGuid _golemaggGUID
Definition: instance_molten_core.cpp:413
GuidSet _golemaggMinionsGUIDS
Definition: instance_molten_core.cpp:414

References _golemaggGUID, _golemaggMinionsGUIDS, ACTION_RESET_GOLEMAGG_ENCOUNTER, Map::GetCreature(), and InstanceScript::instance.

◆ GetGuidData()

ObjectGuid instance_molten_core::instance_molten_core_InstanceMapScript::GetGuidData ( uint32  type) const
inlineoverridevirtual

Reimplemented from InstanceScript.

225 {
226 switch (type)
227 {
228 case DATA_GOLEMAGG:
229 return _golemaggGUID;
232 case DATA_GARR:
233 return _garrGUID;
234 case DATA_LAVA_STEAM:
235 return _lavaSteamGUID;
236 case DATA_LAVA_SPLASH:
237 return _lavaSplashGUID;
238 case DATA_RAGNAROS:
239 return _ragnarosGUID;
240 }
241
242 return ObjectGuid::Empty;
243 }
@ DATA_GOLEMAGG
Definition: molten_core.h:38
@ DATA_LAVA_SPLASH
Definition: molten_core.h:44
@ DATA_LAVA_STEAM
Definition: molten_core.h:43
@ DATA_GARR
Definition: molten_core.h:34
static ObjectGuid const Empty
Definition: ObjectGuid.h:120
ObjectGuid _garrGUID
Definition: instance_molten_core.cpp:423
ObjectGuid _lavaSplashGUID
Definition: instance_molten_core.cpp:419
ObjectGuid _majordomoExecutusGUID
Definition: instance_molten_core.cpp:421
ObjectGuid _lavaSteamGUID
Definition: instance_molten_core.cpp:418

References _garrGUID, _golemaggGUID, _lavaSplashGUID, _lavaSteamGUID, _majordomoExecutusGUID, _ragnarosGUID, DATA_GARR, DATA_GOLEMAGG, DATA_LAVA_SPLASH, DATA_LAVA_STEAM, DATA_MAJORDOMO_EXECUTUS, DATA_RAGNAROS, and ObjectGuid::Empty.

◆ OnCreatureCreate()

void instance_molten_core::instance_molten_core_InstanceMapScript::OnCreatureCreate ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

79 {
80 switch (creature->GetEntry())
81 {
83 {
84 _golemaggGUID = creature->GetGUID();
85 break;
86 }
87 case NPC_CORE_RAGER:
88 {
89 _golemaggMinionsGUIDS.insert(creature->GetGUID());
90 break;
91 }
93 {
94 _majordomoExecutusGUID = creature->GetGUID();
95 break;
96 }
97 case NPC_GARR:
98 {
99 _garrGUID = creature->GetGUID();
100 break;
101 }
102 case NPC_RAGNAROS:
103 {
104 _ragnarosGUID = creature->GetGUID();
105 break;
106 }
107 case NPC_FIRESWORN:
108 case NPC_FLAMEWALKER:
113 {
114 AddMinion(creature);
115 break;
116 }
117 }
118 }
@ NPC_RAGNAROS
Definition: molten_core.h:60
@ NPC_FLAMEWALKER
Definition: molten_core.h:71
@ NPC_MAJORDOMO_EXECUTUS
Definition: molten_core.h:86
@ NPC_FLAMEWALKER_PROTECTOR
Definition: molten_core.h:79
@ NPC_GARR
Definition: molten_core.h:66
@ NPC_GOLEMAGG_THE_INCINERATOR
Definition: molten_core.h:74
@ NPC_CORE_RAGER
Definition: molten_core.h:75
@ NPC_FIRESWORN
Definition: molten_core.h:67
@ NPC_FLAMEWALKER_HEALER
Definition: molten_core.h:87
@ NPC_FLAMEWALKER_ELITE
Definition: molten_core.h:88
@ NPC_FLAMEWALKER_PRIEST
Definition: molten_core.h:83
uint32 GetEntry() const
Definition: Object.h:112
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
void AddMinion(Creature *minion, bool add=true)
Definition: InstanceScript.cpp:334

References _garrGUID, _golemaggGUID, _golemaggMinionsGUIDS, _majordomoExecutusGUID, _ragnarosGUID, InstanceScript::AddMinion(), Object::GetEntry(), Object::GetGUID(), NPC_CORE_RAGER, NPC_FIRESWORN, NPC_FLAMEWALKER, NPC_FLAMEWALKER_ELITE, NPC_FLAMEWALKER_HEALER, NPC_FLAMEWALKER_PRIEST, NPC_FLAMEWALKER_PROTECTOR, NPC_GARR, NPC_GOLEMAGG_THE_INCINERATOR, NPC_MAJORDOMO_EXECUTUS, and NPC_RAGNAROS.

◆ OnCreatureRemove()

void instance_molten_core::instance_molten_core_InstanceMapScript::OnCreatureRemove ( Creature creature)
inlineoverridevirtual

Reimplemented from InstanceScript.

121 {
122 switch (creature->GetEntry())
123 {
124 case NPC_FIRESWORN:
125 {
126 RemoveMinion(creature);
127 break;
128 }
129 case NPC_FLAMEWALKER:
134 {
135 RemoveMinion(creature);
136 break;
137 }
138 }
139 }
void RemoveMinion(Creature *minion)
Definition: InstanceScript.cpp:346

References Object::GetEntry(), NPC_FIRESWORN, NPC_FLAMEWALKER, NPC_FLAMEWALKER_ELITE, NPC_FLAMEWALKER_HEALER, NPC_FLAMEWALKER_PRIEST, NPC_FLAMEWALKER_PROTECTOR, and InstanceScript::RemoveMinion().

◆ OnGameObjectCreate()

void instance_molten_core::instance_molten_core_InstanceMapScript::OnGameObjectCreate ( GameObject go)
inlineoverridevirtual

Reimplemented from InstanceScript.

142 {
143 switch (go->GetEntry())
144 {
146 {
148 break;
149 }
150 case GO_CIRCLE_GEDDON:
151 case GO_CIRCLE_GARR:
157 {
158 for (uint8 i = 0; i < MAX_MC_LINKED_BOSS_OBJ; ++i)
159 {
160 if (linkedBossObjData[i].circleId != go->GetEntry())
161 {
162 continue;
163 }
164
165 if (GetBossState(linkedBossObjData[i].bossId) == DONE)
166 {
167 go->DespawnOrUnsummon(0ms, Seconds(WEEK));
168 }
169 else
170 {
172 }
173 }
174
175 break;
176 }
177 case GO_RUNE_KRESS:
178 case GO_RUNE_MOHN:
179 case GO_RUNE_BLAZ:
180 case GO_RUNE_MAZJ:
181 case GO_RUNE_ZETH:
182 case GO_RUNE_THERI:
183 case GO_RUNE_KORO:
184 {
185 for (uint8 i = 0; i < MAX_MC_LINKED_BOSS_OBJ; ++i)
186 {
187 if (linkedBossObjData[i].runeId != go->GetEntry())
188 {
189 continue;
190 }
191
192 if (GetBossState(linkedBossObjData[i].bossId) == DONE)
193 {
195 }
196 else
197 {
199 }
200 }
201 break;
202 }
203 case GO_LAVA_STEAM:
204 {
205 _lavaSteamGUID = go->GetGUID();
206 break;
207 }
208 case GO_LAVA_SPLASH:
209 {
210 _lavaSplashGUID = go->GetGUID();
211 break;
212 }
213 case GO_LAVA_BURST:
214 {
215 if (Creature* ragnaros = instance->GetCreature(_ragnarosGUID))
216 {
217 ragnaros->AI()->SetGUID(go->GetGUID(), GO_LAVA_BURST);
218 }
219 break;
220 }
221 }
222 }
constexpr auto WEEK
Definition: Common.h:50
constexpr auto IN_MILLISECONDS
Definition: Common.h:53
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:30
constexpr uint8 MAX_MC_LINKED_BOSS_OBJ
Definition: instance_molten_core.cpp:42
MCBossObject const linkedBossObjData[MAX_MC_LINKED_BOSS_OBJ]
Definition: instance_molten_core.cpp:43
@ GO_RUNE_ZETH
Definition: molten_core.h:106
@ GO_CIRCLE_GARR
Definition: molten_core.h:98
@ GO_LAVA_STEAM
Definition: molten_core.h:111
@ GO_LAVA_SPLASH
Definition: molten_core.h:112
@ GO_CIRCLE_GOLEMAGG
Definition: molten_core.h:97
@ GO_CIRCLE_SULFURON
Definition: molten_core.h:94
@ GO_RUNE_MAZJ
Definition: molten_core.h:105
@ GO_CACHE_OF_THE_FIRELORD
Definition: molten_core.h:93
@ GO_RUNE_KORO
Definition: molten_core.h:108
@ GO_CIRCLE_GEDDON
Definition: molten_core.h:95
@ GO_CIRCLE_SHAZZRAH
Definition: molten_core.h:96
@ GO_RUNE_BLAZ
Definition: molten_core.h:104
@ GO_RUNE_THERI
Definition: molten_core.h:107
@ GO_RUNE_MOHN
Definition: molten_core.h:103
@ GO_LAVA_BURST
Definition: molten_core.h:113
@ GO_CIRCLE_GEHENNAS
Definition: molten_core.h:100
@ GO_RUNE_KRESS
Definition: molten_core.h:102
@ GO_CIRCLE_MAGMADAR
Definition: molten_core.h:99
void UseDoorOrButton(uint32 time_to_restore=0, bool alternative=false, Unit *user=nullptr)
Definition: GameObject.cpp:1429
void DespawnOrUnsummon(Milliseconds delay=0ms, Seconds forcedRespawnTime=0s)
Definition: GameObject.cpp:933
uint32 bossId
Definition: instance_molten_core.cpp:37
ObjectGuid _cacheOfTheFirelordGUID
Definition: instance_molten_core.cpp:422
std::unordered_map< uint32, ObjectGuid > _circlesGUIDs
Definition: instance_molten_core.cpp:409
std::unordered_map< uint32, ObjectGuid > _runesGUIDs
Definition: instance_molten_core.cpp:410

References _cacheOfTheFirelordGUID, _circlesGUIDs, _lavaSplashGUID, _lavaSteamGUID, _ragnarosGUID, _runesGUIDs, MCBossObject::bossId, GameObject::DespawnOrUnsummon(), DONE, InstanceScript::GetBossState(), Map::GetCreature(), Object::GetEntry(), Object::GetGUID(), GO_CACHE_OF_THE_FIRELORD, GO_CIRCLE_GARR, GO_CIRCLE_GEDDON, GO_CIRCLE_GEHENNAS, GO_CIRCLE_GOLEMAGG, GO_CIRCLE_MAGMADAR, GO_CIRCLE_SHAZZRAH, GO_CIRCLE_SULFURON, GO_LAVA_BURST, GO_LAVA_SPLASH, GO_LAVA_STEAM, GO_RUNE_BLAZ, GO_RUNE_KORO, GO_RUNE_KRESS, GO_RUNE_MAZJ, GO_RUNE_MOHN, GO_RUNE_THERI, GO_RUNE_ZETH, IN_MILLISECONDS, InstanceScript::instance, linkedBossObjData, MAX_MC_LINKED_BOSS_OBJ, GameObject::UseDoorOrButton(), and WEEK.

◆ OnPlayerEnter()

void instance_molten_core::instance_molten_core_InstanceMapScript::OnPlayerEnter ( Player )
inlineoverridevirtual

Reimplemented from InstanceScript.

71 {
73 {
75 }
76 }
void SummonMajordomoExecutus()
Definition: instance_molten_core.cpp:359
bool CheckMajordomoExecutus() const
Definition: instance_molten_core.cpp:379

References CheckMajordomoExecutus(), and SummonMajordomoExecutus().

◆ SetBossState()

bool instance_molten_core::instance_molten_core_InstanceMapScript::SetBossState ( uint32  bossId,
EncounterState  state 
)
inlineoverridevirtual

Reimplemented from InstanceScript.

246 {
247 if (!InstanceScript::SetBossState(bossId, state))
248 {
249 return false;
250 }
251
252 if (bossId == DATA_MAJORDOMO_EXECUTUS && state == DONE)
253 {
255 {
256 cache->SetRespawnTime(7 * DAY);
257 cache->SetLootRecipient(instance);
258 }
259 }
260 else if (bossId == DATA_GOLEMAGG)
261 {
262 switch (state)
263 {
264 case NOT_STARTED:
265 case FAIL:
266 {
267 if (!_golemaggMinionsGUIDS.empty())
268 {
269 for (ObjectGuid const& minionGuid : _golemaggMinionsGUIDS)
270 {
271 Creature* minion = instance->GetCreature(minionGuid);
272 if (minion && minion->isDead())
273 {
274 minion->Respawn();
275 }
276 }
277 }
278 break;
279 }
280 case IN_PROGRESS:
281 {
282 if (!_golemaggMinionsGUIDS.empty())
283 {
284 for (ObjectGuid const& minionGuid : _golemaggMinionsGUIDS)
285 {
286 if (Creature* minion = instance->GetCreature(minionGuid))
287 {
288 minion->AI()->DoZoneInCombat(nullptr, 150.0f);
289 }
290 }
291 }
292 break;
293 }
294 case DONE:
295 {
296 if (!_golemaggMinionsGUIDS.empty())
297 {
298 for (ObjectGuid const& minionGuid : _golemaggMinionsGUIDS)
299 {
300 if (Creature* minion = instance->GetCreature(minionGuid))
301 {
302 minion->CastSpell(minion, SPELL_CORE_RAGER_QUIET_SUICIDE, true);
303 }
304 }
305 _golemaggMinionsGUIDS.clear();
306 }
307 break;
308 }
309 default:
310 break;
311 }
312 }
313 // Perform needed checks for Majordomu
314 if (bossId < DATA_MAJORDOMO_EXECUTUS && state == DONE)
315 {
316 if (GameObject* circle = instance->GetGameObject(_circlesGUIDs[bossId]))
317 {
318 circle->DespawnOrUnsummon(0ms, Seconds(WEEK));
319 _circlesGUIDs[bossId].Clear();
320 }
321
322 if (GameObject* rune = instance->GetGameObject(_runesGUIDs[bossId]))
323 {
324 rune->UseDoorOrButton(WEEK * IN_MILLISECONDS);
325 _runesGUIDs[bossId].Clear();
326 }
327
329 {
331 }
332 }
333
334 return true;
335 }
constexpr auto DAY
Definition: Common.h:49
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ FAIL
Definition: InstanceScript.h:59
@ NOT_STARTED
Definition: InstanceScript.h:57
@ SPELL_CORE_RAGER_QUIET_SUICIDE
Definition: molten_core.h:118
void DoZoneInCombat(Creature *creature=nullptr, float maxRangeToNearestTarget=250.0f)
Definition: CreatureAI.cpp:95
void Respawn(bool force=false)
Definition: Creature.cpp:2030
CreatureAI * AI() const
Definition: Creature.h:143
Definition: GameObject.h:121
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:1168
bool isDead() const
Definition: Unit.h:1206
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:351
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3319

References _cacheOfTheFirelordGUID, _circlesGUIDs, _golemaggMinionsGUIDS, _runesGUIDs, CheckMajordomoExecutus(), DATA_GOLEMAGG, DATA_MAJORDOMO_EXECUTUS, DAY, DONE, FAIL, Map::GetCreature(), Map::GetGameObject(), IN_MILLISECONDS, IN_PROGRESS, InstanceScript::instance, Unit::isDead(), NOT_STARTED, Creature::Respawn(), InstanceScript::SetBossState(), SPELL_CORE_RAGER_QUIET_SUICIDE, SummonMajordomoExecutus(), and WEEK.

◆ SummonMajordomoExecutus()

void instance_molten_core::instance_molten_core_InstanceMapScript::SummonMajordomoExecutus ( )
inline
360 {
362 {
363 return;
364 }
365
367 {
369 {
370 creature->AI()->Talk(SAY_SPAWN);
371 }
372 }
373 else
374 {
376 }
377 }
Position const MajordomoSummonPos
Definition: boss_majordomo_executus.cpp:120
Position const MajordomoRagnaros
Definition: boss_majordomo_executus.cpp:119
constexpr uint8 SAY_SPAWN
Definition: instance_molten_core.cpp:54
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, uint32 duration=0, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0, bool visibleBySummonerOnly=false)
Definition: Object.cpp:2163

References _majordomoExecutusGUID, DATA_MAJORDOMO_EXECUTUS, DONE, InstanceScript::GetBossState(), Map::GetCreature(), InstanceScript::instance, MajordomoRagnaros, MajordomoSummonPos, NPC_MAJORDOMO_EXECUTUS, SAY_SPAWN, and Map::SummonCreature().

Referenced by OnPlayerEnter(), and SetBossState().

Member Data Documentation

◆ _cacheOfTheFirelordGUID

ObjectGuid instance_molten_core::instance_molten_core_InstanceMapScript::_cacheOfTheFirelordGUID
private

Referenced by OnGameObjectCreate(), and SetBossState().

◆ _circlesGUIDs

std::unordered_map<uint32, ObjectGuid> instance_molten_core::instance_molten_core_InstanceMapScript::_circlesGUIDs
private

Referenced by OnGameObjectCreate(), and SetBossState().

◆ _garrGUID

ObjectGuid instance_molten_core::instance_molten_core_InstanceMapScript::_garrGUID
private

Referenced by GetGuidData(), and OnCreatureCreate().

◆ _golemaggGUID

ObjectGuid instance_molten_core::instance_molten_core_InstanceMapScript::_golemaggGUID
private

◆ _golemaggMinionsGUIDS

GuidSet instance_molten_core::instance_molten_core_InstanceMapScript::_golemaggMinionsGUIDS
private

◆ _lavaSplashGUID

ObjectGuid instance_molten_core::instance_molten_core_InstanceMapScript::_lavaSplashGUID
private

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ _lavaSteamGUID

ObjectGuid instance_molten_core::instance_molten_core_InstanceMapScript::_lavaSteamGUID
private

Referenced by GetGuidData(), and OnGameObjectCreate().

◆ _magmadarGUID

ObjectGuid instance_molten_core::instance_molten_core_InstanceMapScript::_magmadarGUID
private

◆ _majordomoExecutusGUID

ObjectGuid instance_molten_core::instance_molten_core_InstanceMapScript::_majordomoExecutusGUID
private

◆ _ragnarosGUID

ObjectGuid instance_molten_core::instance_molten_core_InstanceMapScript::_ragnarosGUID
private

◆ _runesGUIDs

std::unordered_map<uint32, ObjectGuid> instance_molten_core::instance_molten_core_InstanceMapScript::_runesGUIDs
private

Referenced by OnGameObjectCreate(), and SetBossState().