TrinityCore
instance_molten_core.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "ScriptMgr.h"
19#include "molten_core.h"
20#include "GameObject.h"
21#include "InstanceScript.h"
22#include "Map.h"
23#include "ScriptedCreature.h"
24#include "TemporarySummon.h"
25
27{
28 {737.850f, -1145.35f, -120.288f, 4.71368f},
29 {744.162f, -1151.63f, -119.726f, 4.58204f},
30 {751.247f, -1152.82f, -119.744f, 4.49673f},
31 {759.206f, -1155.09f, -120.051f, 4.30104f},
32 {755.973f, -1152.33f, -120.029f, 4.25588f},
33 {731.712f, -1147.56f, -120.195f, 4.95955f},
34 {726.499f, -1149.80f, -120.156f, 5.24055f},
35 {722.408f, -1152.41f, -120.029f, 5.33087f},
36 {718.994f, -1156.36f, -119.805f, 5.75738f},
37 {838.510f, -829.840f, -232.000f, 2.00000f},
38};
39
40Position const RagnarosTelePos = {829.159f, -815.773f, -228.972f, 5.30500f};
41Position const RagnarosSummonPos = {838.510f, -829.840f, -232.000f, 2.00000f};
42
44{
45 { BOSS_LUCIFRON, {{ 663 }} },
46 { BOSS_MAGMADAR, {{ 664 }} },
47 { BOSS_GEHENNAS, {{ 665 }} },
48 { BOSS_GARR, {{ 666 }} },
49 { BOSS_SHAZZRAH, {{ 667 }} },
50 { BOSS_BARON_GEDDON, {{ 668 }} },
51 { BOSS_SULFURON_HARBINGER, {{ 669 }} },
52 { BOSS_GOLEMAGG_THE_INCINERATOR, {{ 670 }} },
53 { BOSS_MAJORDOMO_EXECUTUS, {{ 671 }} },
54 { BOSS_RAGNAROS, {{ 672 }} }
55};
56
58{
59 public:
61
63 {
65 {
69 _executusSchedule = false;
71 }
72
73 void OnPlayerEnter(Player* /*player*/) override
74 {
77 }
78
79 void OnCreatureCreate(Creature* creature) override
80 {
81 switch (creature->GetEntry())
82 {
85 break;
87 _majordomoExecutusGUID = creature->GetGUID();
88 break;
89 default:
90 break;
91 }
92 }
93
94 void OnGameObjectCreate(GameObject* go) override
95 {
96 switch (go->GetEntry())
97 {
100 break;
101 default:
102 break;
103 }
104 }
105
106 void SetData(uint32 type, uint32 data) override
107 {
108 if (type == DATA_RAGNAROS_ADDS)
109 {
110 if (data == 1)
112 else if (data == 0)
114 }
115 }
116
117 uint32 GetData(uint32 type) const override
118 {
119 switch (type)
120 {
122 return _ragnarosAddDeaths;
123 }
124
125 return 0;
126 }
127
128 ObjectGuid GetGuidData(uint32 type) const override
129 {
130 switch (type)
131 {
136 }
137
138 return ObjectGuid::Empty;
139 }
140
141 bool SetBossState(uint32 bossId, EncounterState state) override
142 {
143 if (!InstanceScript::SetBossState(bossId, state))
144 return false;
145
146 if (state == DONE && bossId < BOSS_MAJORDOMO_EXECUTUS)
149
150 if (bossId == BOSS_MAJORDOMO_EXECUTUS && state == DONE)
152
153 return true;
154 }
155
157 {
158 _executusSchedule = false;
160 return;
161
163 {
173 }
176 }
177
179 {
181 return false;
182
183 for (uint8 i = 0; i < BOSS_MAJORDOMO_EXECUTUS; ++i)
184 if (GetBossState(i) != DONE)
185 return false;
186
187 return true;
188 }
189
190 void AfterDataLoad() override
191 {
193 _executusSchedule = true;
194 }
195
196 private:
202 };
203
205 {
207 }
208};
209
211{
213}
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
EncounterState
@ DONE
#define DataHeader
CreatureAI * AI() const
Definition: Creature.h:214
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
void LoadDungeonEncounterData(T const &encounters)
InstanceMap * instance
EncounterState GetBossState(uint32 id) const
void DoRespawnGameObject(ObjectGuid guid, Seconds timeToDespawn=1min)
void SetHeaders(std::string const &dataHeaders)
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, Milliseconds duration=0ms, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty, SmoothPhasingInfo const *smoothPhasingInfo=nullptr)
Definition: Object.cpp:1836
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
bool IsEmpty() const
Definition: ObjectGuid.h:319
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
virtual void DoAction(int32)
Definition: UnitAI.h:72
InstanceScript * GetInstanceScript(InstanceMap *map) const override
Position const RagnarosSummonPos
Position const SummonPositions[10]
Position const RagnarosTelePos
void AddSC_instance_molten_core()
DungeonEncounterData const encounters[]
#define MAX_ENCOUNTER
#define MCScriptName
Definition: molten_core.h:25
@ DATA_RAGNAROS_ADDS
Definition: molten_core.h:75
@ GO_CACHE_OF_THE_FIRELORD
Definition: molten_core.h:70
@ ACTION_START_RAGNAROS_ALT
Definition: molten_core.h:46
@ NPC_FLAMEWAKER_ELITE
Definition: molten_core.h:65
@ NPC_MAJORDOMO_EXECUTUS
Definition: molten_core.h:62
@ NPC_FLAMEWAKER_HEALER
Definition: molten_core.h:64
@ NPC_GOLEMAGG_THE_INCINERATOR
Definition: molten_core.h:61
@ BOSS_GARR
Definition: molten_core.h:33
@ BOSS_LUCIFRON
Definition: molten_core.h:30
@ BOSS_BARON_GEDDON
Definition: molten_core.h:35
@ BOSS_SHAZZRAH
Definition: molten_core.h:34
@ BOSS_SULFURON_HARBINGER
Definition: molten_core.h:36
@ BOSS_GOLEMAGG_THE_INCINERATOR
Definition: molten_core.h:37
@ BOSS_RAGNAROS
Definition: molten_core.h:39
@ BOSS_GEHENNAS
Definition: molten_core.h:32
@ BOSS_MAGMADAR
Definition: molten_core.h:31
@ BOSS_MAJORDOMO_EXECUTUS
Definition: molten_core.h:38
bool SetBossState(uint32 bossId, EncounterState state) override