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 "ObjectAccessor.h"
27#include "TemporarySummon.h"
28
29/*
300 - Selin Fireheart
311 - Vexallus
322 - Priestess Delrissa
333 - Kael'thas Sunstrider
34*/
35
46
48{
50 { 0, 0 } // END
51};
52
62
63Position const KalecgosSpawnPos = { 164.3747f, -397.1197f, 2.151798f, 1.66219f };
64Position const KaelthasTrashGroupDistanceComparisonPos = { 150.0f, 141.0f, -14.4f };
65
67{
68 public:
70
72 {
80
81 uint32 GetData(uint32 type) const override
82 {
83 switch (type)
84 {
87 default:
88 break;
89 }
90 return 0;
91 }
92
93 void SetData(uint32 type, uint32 data) override
94 {
95 switch (type)
96 {
98 if (data == SPECIAL)
100 else
102 break;
103 default:
104 break;
105 }
106 }
107
108 void OnCreatureCreate(Creature* creature) override
109 {
111
112 switch (creature->GetEntry())
113 {
121 _kaelthasPreTrashGUIDs.insert(creature->GetGUID());
122 break;
123 default:
124 break;
125 }
126 }
127
128 void OnUnitDeath(Unit* unit) override
129 {
130 if (unit->GetTypeId() != TYPEID_UNIT)
131 return;
132
133 switch (unit->GetEntry())
134 {
141 if (_kaelthasPreTrashGUIDs.find(unit->GetGUID()) != _kaelthasPreTrashGUIDs.end())
142 {
143 _kaelthasPreTrashGUIDs.erase(unit->GetGUID());
144 if (_kaelthasPreTrashGUIDs.size() == 0)
146 kaelthas->AI()->SetData(DATA_KAELTHAS_INTRO, IN_PROGRESS);
147 }
148 break;
149 default:
150 break;
151 }
152 }
153
155 {
157
158 switch (go->GetEntry())
159 {
160 case GO_ESCAPE_ORB:
163 break;
164 default:
165 break;
166 }
167 }
168
169 void ProcessEvent(WorldObject* /*obj*/, uint32 eventId) override
170 {
171 if (eventId == EVENT_SPAWN_KALECGOS)
174 }
175
176 void Update(uint32 diff) override
177 {
178 _events.Update(diff);
179
182 }
183
184 bool SetBossState(uint32 type, EncounterState state) override
185 {
186 if (!InstanceScript::SetBossState(type, state))
187 return false;
188
189 switch (type)
190 {
192 if (state == IN_PROGRESS)
194 break;
196 if (state == DONE)
198 orb->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
199 break;
200 default:
201 break;
202 }
203 return true;
204 }
205
206 protected:
210 };
211
213 {
215 }
216};
217
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
EncounterState
@ IN_PROGRESS
@ DONE
@ SPECIAL
@ DOOR_TYPE_ROOM
@ DOOR_TYPE_PASSAGE
@ TYPEID_UNIT
Definition ObjectGuid.h:38
std::set< ObjectGuid > GuidSet
Definition ObjectGuid.h:260
@ GO_FLAG_NOT_SELECTABLE
#define DataHeader
uint32 const EncounterCount
void Update(uint32 time)
Definition EventMap.h:67
bool Empty() const
Definition EventMap.h:95
EventId ExecuteEvent()
Definition EventMap.cpp:73
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group=0u, PhaseIndex phase=0u)
Definition EventMap.cpp:36
void RemoveFlag(GameObjectFlags flags)
Definition GameObject.h:172
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
virtual void OnCreatureCreate(Creature *creature) override
Creature * GetCreature(uint32 type)
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, uint32 duration=0, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition Object.cpp:1852
TypeID GetTypeId() const
Definition Object.h:93
uint32 GetEntry() const
Definition Object.h:81
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
Definition Unit.h:769
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1123
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
@ 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
@ DATA_KALECGOS
@ DATA_DELRISSA_DEATH_COUNT
@ DATA_ESCAPE_ORB
@ DATA_VEXALLUS
@ DATA_PRIESTESS_DELRISSA
@ DATA_KAELTHAS_INTRO
@ DATA_KAELTHAS_SUNSTRIDER
@ DATA_SELIN_FIREHEART
#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