TrinityCore
Loading...
Searching...
No Matches
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
28/*
290 - Selin Fireheart
301 - Vexallus
312 - Priestess Delrissa
323 - Kael'thas Sunstrider
33*/
34
44
45static constexpr ObjectData gameObjectData[] =
46{
48};
49
58
59static constexpr DungeonEncounterData encounters[] =
60{
61 { DATA_SELIN_FIREHEART, {{ 1897 }} },
62 { DATA_VEXALLUS, {{ 1898 }} },
63 { DATA_PRIESTESS_DELRISSA, {{ 1895 }} },
64 { DATA_KAELTHAS_SUNSTRIDER, {{ 1894 }} }
65};
66
67static constexpr Position KalecgosSpawnPos = { 164.3747f, -397.1197f, 2.151798f, 1.66219f };
68static constexpr Position KaelthasTrashGroupDistanceComparisonPos = { 150.0f, 141.0f, -14.4f };
69
71{
72 public:
74
76 {
85
86 uint32 GetData(uint32 type) const override
87 {
88 switch (type)
89 {
92 default:
93 break;
94 }
95 return 0;
96 }
97
98 void SetData(uint32 type, uint32 data) override
99 {
100 switch (type)
101 {
103 if (data == SPECIAL)
105 else
107 break;
108 default:
109 break;
110 }
111 }
112
113 void OnCreatureCreate(Creature* creature) override
114 {
116
117 switch (creature->GetEntry())
118 {
126 _kaelthasPreTrashGUIDs.insert(creature->GetGUID());
127 break;
128 default:
129 break;
130 }
131 }
132
133 void OnUnitDeath(Unit* unit) override
134 {
135 if (unit->GetTypeId() != TYPEID_UNIT)
136 return;
137
138 switch (unit->GetEntry())
139 {
146 if (_kaelthasPreTrashGUIDs.find(unit->GetGUID()) != _kaelthasPreTrashGUIDs.end())
147 {
148 _kaelthasPreTrashGUIDs.erase(unit->GetGUID());
149 if (_kaelthasPreTrashGUIDs.size() == 0)
151 kaelthas->AI()->SetData(DATA_KAELTHAS_INTRO, IN_PROGRESS);
152 }
153 break;
154 default:
155 break;
156 }
157 }
158
160 {
162
163 switch (go->GetEntry())
164 {
165 case GO_ESCAPE_ORB:
168 break;
169 default:
170 break;
171 }
172 }
173
174 void ProcessEvent(WorldObject* /*obj*/, uint32 eventId, WorldObject* /*invoker*/) override
175 {
176 if (eventId == EVENT_SPAWN_KALECGOS)
179 }
180
181 void Update(uint32 diff) override
182 {
183 _events.Update(diff);
184
186 {
188 {
189 kalecgos->GetMotionMaster()->MovePath(PATH_KALECGOS_FLIGHT, false);
190 kalecgos->AI()->Talk(SAY_KALECGOS_SPAWN);
191 }
192 }
193 }
194
195 bool SetBossState(uint32 type, EncounterState state) override
196 {
197 if (!InstanceScript::SetBossState(type, state))
198 return false;
199
200 switch (type)
201 {
203 if (state == IN_PROGRESS)
205 break;
207 if (state == DONE)
209 orb->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
210 break;
211 default:
212 break;
213 }
214 return true;
215 }
216
217 protected:
221 };
222
224 {
226 }
227};
228
uint8_t uint8
Definition Define.h:156
uint32_t uint32
Definition Define.h:154
EncounterState
@ IN_PROGRESS
@ DONE
@ SPECIAL
@ TYPEID_UNIT
Definition ObjectGuid.h:43
std::set< ObjectGuid > GuidSet
Definition ObjectGuid.h:432
@ GO_FLAG_NOT_SELECTABLE
#define DataHeader
uint32 const EncounterCount
ObjectGuid const & GetGUID() const
Definition BaseEntity.h:163
TypeID GetTypeId() const
Definition BaseEntity.h:166
uint32 ExecuteEvent()
Definition EventMap.cpp:77
void Update(uint32 time)
Definition EventMap.h:61
bool Empty() const
Definition EventMap.h:89
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
void RemoveFlag(GameObjectFlags flags)
Definition GameObject.h:278
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
virtual void OnCreatureCreate(Creature *creature) override
Creature * GetCreature(uint32 type)
void LoadObjectData(std::span< ObjectData const > creatureData, std::span< ObjectData const > gameObjectData)
InstanceMap * instance
void SetHeaders(std::string_view dataHeaders)
void LoadDungeonEncounterData(std::span< DungeonEncounterData const > encounters)
EncounterState GetBossState(uint32 id) const
virtual void OnGameObjectCreate(GameObject *go) override
void LoadDoorData(std::span< DoorData const > data)
GameObject * GetGameObject(uint32 type)
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:1186
uint32 GetEntry() const
Definition Object.h:89
Definition Unit.h:635
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:432
InstanceScript * GetInstanceScript(InstanceMap *map) const override
static constexpr Position KaelthasTrashGroupDistanceComparisonPos
static constexpr ObjectData creatureData[]
void AddSC_instance_magisters_terrace()
static constexpr Position KalecgosSpawnPos
static constexpr DoorData doorData[]
static constexpr ObjectData gameObjectData[]
static constexpr DungeonEncounterData 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