TrinityCore
instance_black_temple.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 "AreaBoundary.h"
20#include "black_temple.h"
21#include "Creature.h"
22#include "CreatureAI.h"
23#include "GameObject.h"
24#include "InstanceScript.h"
25#include "Map.h"
26
28{
42};
43
45{
46 { DATA_HIGH_WARLORD_NAJENTUS, new RectangleBoundary(394.0f, 479.4f, 707.8f, 859.1f) },
47 { DATA_SUPREMUS, new RectangleBoundary(556.1f, 850.2f, 542.0f, 1001.0f) },
48 { DATA_SHADE_OF_AKAMA, new RectangleBoundary(406.8f, 564.0f, 327.9f, 473.5f) },
49 { DATA_TERON_GOREFIEND, new RectangleBoundary(512.5f, 613.3f, 373.2f, 432.0f) },
50 { DATA_TERON_GOREFIEND, new ZRangeBoundary(179.5f, 223.6f) },
51 { DATA_GURTOGG_BLOODBOIL, new RectangleBoundary(720.5f, 864.5f, 159.3f, 316.0f) },
52 { DATA_RELIQUARY_OF_SOULS, new RectangleBoundary(435.9f, 660.3f, 21.2f, 229.6f) },
53 { DATA_RELIQUARY_OF_SOULS, new ZRangeBoundary(81.8f, 148.0f) },
54 { DATA_MOTHER_SHAHRAZ, new RectangleBoundary(903.4f, 982.1f, 92.4f, 313.2f) },
55 { DATA_ILLIDARI_COUNCIL, new EllipseBoundary(Position(696.6f, 305.0f), 70.0 , 85.0) },
56 { DATA_ILLIDAN_STORMRAGE, new EllipseBoundary(Position(694.8f, 309.0f), 80.0 , 95.0) }
57};
58
60{
80 { 0, 0 } // END
81};
82
84{
88 { 0, 0 } //END
89};
90
92{
93 { DATA_HIGH_WARLORD_NAJENTUS, {{ 601 }} },
94 { DATA_SUPREMUS, {{ 602 }} },
95 { DATA_SHADE_OF_AKAMA, {{ 603 }} },
96 { DATA_TERON_GOREFIEND, {{ 604 }} },
97 { DATA_GURTOGG_BLOODBOIL, {{ 605 }} },
98 { DATA_RELIQUARY_OF_SOULS, {{ 606 }} },
99 { DATA_MOTHER_SHAHRAZ, {{ 607 }} },
100 { DATA_ILLIDARI_COUNCIL, {{ 608 }} },
101 { DATA_ILLIDAN_STORMRAGE, {{ 609 }} }
102};
103
105{
106 public:
108
110 {
112 {
121 }
122
124 {
126
127 if (go->GetEntry() == GO_DEN_OF_MORTAL_DOOR)
130 }
131
132 void OnCreatureCreate(Creature* creature) override
133 {
135
136 switch (creature->GetEntry())
137 {
144 case NPC_STORM_FURY:
145 AshtongueGUIDs.push_back(creature->GetGUID());
148 break;
149 default:
150 break;
151 }
152 }
153
154 uint32 GetData(uint32 type) const override
155 {
156 switch (type)
157 {
158 case DATA_AKAMA:
159 return AkamaState;
161 return AkamaIllidanIntro;
162 default:
163 return 0;
164 }
165 }
166
167 void SetData(uint32 type, uint32 data) override
168 {
169 switch (type)
170 {
171 case DATA_AKAMA:
172 AkamaState = data;
173 break;
174 case ACTION_OPEN_DOOR:
176 HandleGameObject(ObjectGuid::Empty, true, illidanGate);
177 break;
179 AkamaIllidanIntro = data;
180 break;
181 default:
182 break;
183 }
184 }
185
186 bool SetBossState(uint32 type, EncounterState state) override
187 {
188 if (!InstanceScript::SetBossState(type, state))
189 return false;
190
191 switch (type)
192 {
194 if (state == DONE)
196 trigger->AI()->Talk(EMOTE_HIGH_WARLORD_NAJENTUS_DIED);
197 break;
199 if (state == DONE)
200 for (ObjectGuid ashtongueGuid : AshtongueGUIDs)
201 if (Creature* ashtongue = instance->GetCreature(ashtongueGuid))
202 ashtongue->SetFaction(FACTION_ASHTONGUE_DEATHSWORN);
203 [[fallthrough]];
207 if (state == DONE && CheckDenOfMortalDoor())
208 {
210 trigger->AI()->Talk(EMOTE_DEN_OF_MORTAL_DOOR_OPEN);
211
214 }
215 break;
217 if (state == DONE)
218 if (Creature* akama = GetCreature(DATA_AKAMA))
219 akama->AI()->DoAction(ACTION_ACTIVE_AKAMA_INTRO);
220 break;
221 default:
222 break;
223 }
224
225 return true;
226 }
227
229 {
231 if (GetBossState(boss) != DONE)
232 return false;
233 return true;
234 }
235
236 protected:
240 };
241
243 {
245 }
246};
247
249{
251}
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
EncounterState
@ DONE
std::vector< ObjectGuid > GuidVector
Definition: ObjectGuid.h:395
@ FACTION_ASHTONGUE_DEATHSWORN
#define DataHeader
uint32 const EncounterCount
#define BTScriptName
Definition: black_temple.h:23
@ EMOTE_DEN_OF_MORTAL_DOOR_OPEN
Definition: black_temple.h:64
@ EMOTE_HIGH_WARLORD_NAJENTUS_DIED
Definition: black_temple.h:63
BTDataTypes
Definition: black_temple.h:29
@ DATA_TERON_GOREFIEND
Definition: black_temple.h:34
@ DATA_AKAMA
Definition: black_temple.h:43
@ DATA_ILLIDARI_COUNCIL
Definition: black_temple.h:38
@ DATA_MOTHER_SHAHRAZ
Definition: black_temple.h:37
@ DATA_HIGH_NETHERMANCER_ZEREVOR
Definition: black_temple.h:48
@ DATA_SUPREMUS
Definition: black_temple.h:32
@ DATA_GATHIOS_THE_SHATTERER
Definition: black_temple.h:47
@ DATA_BLOOD_ELF_COUNCIL_VOICE
Definition: black_temple.h:51
@ DATA_ILLIDAN_STORMRAGE
Definition: black_temple.h:39
@ DATA_VERAS_DARKSHADOW
Definition: black_temple.h:50
@ DATA_RELIQUARY_COMBAT_TRIGGER
Definition: black_temple.h:58
@ DATA_ILLIDAN_MUSIC_CONTROLLER
Definition: black_temple.h:56
@ DATA_AKAMA_SHADE
Definition: black_temple.h:42
@ DATA_BLACK_TEMPLE_TRIGGER
Definition: black_temple.h:46
@ DATA_LADY_MALANDE
Definition: black_temple.h:49
@ DATA_GO_DEN_OF_MORTAL_DOOR
Definition: black_temple.h:52
@ DATA_GO_ILLIDAN_GATE
Definition: black_temple.h:45
@ DATA_HIGH_WARLORD_NAJENTUS
Definition: black_temple.h:31
@ DATA_AKAMA_ILLIDAN_INTRO
Definition: black_temple.h:57
@ DATA_SHADE_OF_AKAMA
Definition: black_temple.h:33
@ DATA_MAIEV
Definition: black_temple.h:44
@ DATA_GURTOGG_BLOODBOIL
Definition: black_temple.h:35
@ DATA_RELIQUARY_OF_SOULS
Definition: black_temple.h:36
@ NPC_TERON_GOREFIEND
Definition: black_temple.h:73
@ NPC_VERAS_DARKSHADOW
Definition: black_temple.h:84
@ NPC_ILLIDARI_COUNCIL
Definition: black_temple.h:77
@ NPC_GURTOGG_BLOODBOIL
Definition: black_temple.h:74
@ NPC_AKAMA
Definition: black_temple.h:86
@ NPC_MOTHER_SHAHRAZ
Definition: black_temple.h:76
@ NPC_GATHIOS_THE_SHATTERER
Definition: black_temple.h:81
@ NPC_HIGH_WARLORD_NAJENTUS
Definition: black_temple.h:70
@ NPC_SHADE_OF_AKAMA
Definition: black_temple.h:72
@ NPC_ASHTONGUE_PRIMALIST
Definition: black_temple.h:95
@ NPC_ILLIDAN_STORMRAGE
Definition: black_temple.h:78
@ NPC_RELIQUARY_OF_SOULS
Definition: black_temple.h:75
@ NPC_ASHTONGUE_MYSTIC
Definition: black_temple.h:94
@ NPC_RELIQUARY_COMBAT_TRIGGER
Definition: black_temple.h:112
@ NPC_ASHTONGUE_STORMCALLER
Definition: black_temple.h:96
@ NPC_HIGH_NETHERMANCER_ZEREVOR
Definition: black_temple.h:82
@ NPC_BLACK_TEMPLE_TRIGGER
Definition: black_temple.h:89
@ NPC_LADY_MALANDE
Definition: black_temple.h:83
@ NPC_ASHTONGUE_FERAL_SPIRIT
Definition: black_temple.h:97
@ NPC_ASHTONGUE_STALKER
Definition: black_temple.h:92
@ NPC_BLOOD_ELF_COUNCIL_VOICE
Definition: black_temple.h:85
@ NPC_AKAMA_SHADE
Definition: black_temple.h:87
@ NPC_ASHTONGUE_BATTLELORD
Definition: black_temple.h:93
@ NPC_MAIEV_SHADOWSONG
Definition: black_temple.h:103
@ NPC_SUPREMUS
Definition: black_temple.h:71
@ NPC_STORM_FURY
Definition: black_temple.h:98
@ ACTION_OPEN_DOOR
Definition: black_temple.h:140
@ AKAMA_INTRO
Definition: black_temple.h:137
@ ACTION_ACTIVE_AKAMA_INTRO
Definition: black_temple.h:139
@ GO_ILLIDAN_DOOR_R
Definition: black_temple.h:129
@ GO_ILLIDAN_MUSIC_CONTROLLER
Definition: black_temple.h:132
@ GO_TERON_DOOR_1
Definition: black_temple.h:121
@ GO_TERON_DOOR_2
Definition: black_temple.h:122
@ GO_COUNCIL_DOOR_1
Definition: black_temple.h:126
@ GO_SHADE_OF_AKAMA_DOOR
Definition: black_temple.h:120
@ GO_MOTHER_SHAHRAZ_DOOR
Definition: black_temple.h:125
@ GO_GURTOGG_DOOR
Definition: black_temple.h:123
@ GO_DEN_OF_MORTAL_DOOR
Definition: black_temple.h:124
@ GO_NAJENTUS_GATE
Definition: black_temple.h:117
@ GO_ILLIDAN_GATE
Definition: black_temple.h:128
@ GO_COUNCIL_DOOR_2
Definition: black_temple.h:127
@ GO_SUPREMUS_GATE
Definition: black_temple.h:119
@ GO_ILLIDAN_DOOR_L
Definition: black_temple.h:130
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
virtual void OnCreatureCreate(Creature *creature) override
Creature * GetCreature(uint32 type)
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
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 LoadBossBoundaries(BossBoundaryData const &data)
void SetHeaders(std::string const &dataHeaders)
void LoadObjectData(ObjectData const *creatureData, ObjectData const *gameObjectData)
Creature * GetCreature(ObjectGuid const &guid)
Definition: Map.cpp:3479
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
void SetFaction(uint32 faction) override
Definition: Unit.h:859
InstanceScript * GetInstanceScript(InstanceMap *map) const override
ObjectData const gameObjectData[]
void AddSC_instance_black_temple()
ObjectData const creatureData[]
DoorData const doorData[]
BossBoundaryData const boundaries
DungeonEncounterData const encounters[]
bool SetBossState(uint32 type, EncounterState state) override