TrinityCore
instance_magisters_terrace.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 "CreatureAI.h"
20#include "EventMap.h"
21#include "GameObject.h"
22#include "InstanceScript.h"
23#include "magisters_terrace.h"
24#include "Map.h"
25#include "MotionMaster.h"
26#include "TemporarySummon.h"
27#include <sstream>
28
29/*
300 - Selin Fireheart
311 - Vexallus
322 - Priestess Delrissa
333 - Kael'thas Sunstrider
34*/
35
37{
44 { 0, 0 } // END
45};
46
48{
50 { 0, 0 } // END
51};
52
54{
61};
62
64{
65 { DATA_SELIN_FIREHEART, {{ 1897 }} },
66 { DATA_VEXALLUS, {{ 1898 }} },
67 { DATA_PRIESTESS_DELRISSA, {{ 1895 }} },
68 { DATA_KAELTHAS_SUNSTRIDER, {{ 1894 }} }
69};
70
71Position const KalecgosSpawnPos = { 164.3747f, -397.1197f, 2.151798f, 1.66219f };
72Position const KaelthasTrashGroupDistanceComparisonPos = { 150.0f, 141.0f, -14.4f };
73
75{
76 public:
78
80 {
82 {
88 }
89
90 uint32 GetData(uint32 type) const override
91 {
92 switch (type)
93 {
96 default:
97 break;
98 }
99 return 0;
100 }
101
102 void SetData(uint32 type, uint32 data) override
103 {
104 switch (type)
105 {
107 if (data == SPECIAL)
109 else
111 break;
112 default:
113 break;
114 }
115 }
116
117 void OnCreatureCreate(Creature* creature) override
118 {
120
121 switch (creature->GetEntry())
122 {
130 _kaelthasPreTrashGUIDs.insert(creature->GetGUID());
131 break;
132 default:
133 break;
134 }
135 }
136
137 void OnUnitDeath(Unit* unit) override
138 {
139 if (unit->GetTypeId() != TYPEID_UNIT)
140 return;
141
142 switch (unit->GetEntry())
143 {
150 if (_kaelthasPreTrashGUIDs.find(unit->GetGUID()) != _kaelthasPreTrashGUIDs.end())
151 {
152 _kaelthasPreTrashGUIDs.erase(unit->GetGUID());
153 if (_kaelthasPreTrashGUIDs.size() == 0)
155 kaelthas->AI()->SetData(DATA_KAELTHAS_INTRO, IN_PROGRESS);
156 }
157 break;
158 default:
159 break;
160 }
161 }
162
164 {
166
167 switch (go->GetEntry())
168 {
169 case GO_ESCAPE_ORB:
172 break;
173 default:
174 break;
175 }
176 }
177
178 void ProcessEvent(WorldObject* /*obj*/, uint32 eventId, WorldObject* /*invoker*/) override
179 {
180 if (eventId == EVENT_SPAWN_KALECGOS)
183 }
184
185 void Update(uint32 diff) override
186 {
187 _events.Update(diff);
188
190 {
192 {
193 kalecgos->GetMotionMaster()->MovePath(PATH_KALECGOS_FLIGHT, false);
194 kalecgos->AI()->Talk(SAY_KALECGOS_SPAWN);
195 }
196 }
197 }
198
199 bool SetBossState(uint32 type, EncounterState state) override
200 {
201 if (!InstanceScript::SetBossState(type, state))
202 return false;
203
204 switch (type)
205 {
207 if (state == IN_PROGRESS)
209 break;
211 if (state == DONE)
213 orb->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
214 break;
215 default:
216 break;
217 }
218 return true;
219 }
220
221 protected:
225 };
226
228 {
230 }
231};
232
234{
236}
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
EncounterState
@ IN_PROGRESS
@ DONE
@ SPECIAL
@ TYPEID_UNIT
Definition: ObjectGuid.h:40
std::set< ObjectGuid > GuidSet
Definition: ObjectGuid.h:393
@ GO_FLAG_NOT_SELECTABLE
#define DataHeader
uint32 const EncounterCount
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
bool Empty() const
Definition: EventMap.h:84
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void RemoveFlag(GameObjectFlags flags)
Definition: GameObject.h:275
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
virtual void OnCreatureCreate(Creature *creature) override
Creature * GetCreature(uint32 type)
void LoadDungeonEncounterData(T const &encounters)
InstanceMap * instance
EncounterState GetBossState(uint32 id) const
virtual void OnGameObjectCreate(GameObject *go) override
void LoadDoorData(DoorData const *data)
GameObject * GetGameObject(uint32 type)
void SetHeaders(std::string const &dataHeaders)
void LoadObjectData(ObjectData const *creatureData, ObjectData const *gameObjectData)
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
TypeID GetTypeId() const
Definition: Object.h:173
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
Definition: Unit.h:627
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1078
InstanceScript * GetInstanceScript(InstanceMap *map) const override
ObjectData const gameObjectData[]
void AddSC_instance_magisters_terrace()
ObjectData const creatureData[]
DoorData const doorData[]
Position const KalecgosSpawnPos
Position const KaelthasTrashGroupDistanceComparisonPos
DungeonEncounterData const encounters[]
@ BOSS_SELIN_FIREHEART
@ NPC_SUNBLADE_BLOOD_KNIGHT
@ NPC_SUNBLADE_MAGE_GUARD
@ BOSS_PRIESTESS_DELRISSA
@ NPC_COILSKAR_WITCH
@ BOSS_VEXALLUS
@ NPC_KALECGOS
@ NPC_HUMAN_KALECGOS
@ NPC_ETHEREUM_SMUGGLER
@ NPC_SUNBLADE_WARLOCK
@ BOSS_KAELTHAS_SUNSTRIDER
@ NPC_SISTER_OF_TORMENT
@ SAY_KALECGOS_SPAWN
@ DATA_KALECGOS
@ DATA_DELRISSA_DEATH_COUNT
@ DATA_ESCAPE_ORB
@ DATA_VEXALLUS
@ DATA_PRIESTESS_DELRISSA
@ DATA_KAELTHAS_INTRO
@ DATA_KAELTHAS_SUNSTRIDER
@ DATA_SELIN_FIREHEART
@ PATH_KALECGOS_FLIGHT
#define MGTScriptName
@ GO_ASSEMBLY_CHAMBER_DOOR
@ GO_SUNWELL_RAID_GATE_2
@ GO_SUNWELL_RAID_GATE_5
@ GO_SUNWELL_RAID_GATE_4
@ GO_ASYLUM_DOOR
@ GO_ESCAPE_ORB
@ EVENT_SPAWN_KALECGOS
void ProcessEvent(WorldObject *, uint32 eventId, WorldObject *) override