TrinityCore
instance_shadow_labyrinth.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 "Creature.h"
20#include "CreatureAI.h"
21#include "GameObject.h"
22#include "InstanceScript.h"
23#include "Map.h"
24#include "shadow_labyrinth.h"
25
27{
31};
32
34{
35 { DATA_AMBASSADOR_HELLMAW, {{ 1908 }} },
36 { DATA_BLACKHEART_THE_INCITER, {{ 1909 }} },
37 { DATA_GRANDMASTER_VORPIL, {{ 1911 }} },
38 { DATA_MURMUR, {{ 1910 }} }
39};
40
42{
43 public:
45
47 {
49 {
54
56 }
57
58 void OnCreatureCreate(Creature* creature) override
59 {
60 switch (creature->GetEntry())
61 {
63 AmbassadorHellmawGUID = creature->GetGUID();
64 break;
65 case NPC_BLACKHEART:
66 BlackheartGUID = creature->GetGUID();
67 break;
73 BlackheartDummyGUIDs.insert(creature->GetGUID());
74 break;
76 GrandmasterVorpilGUID = creature->GetGUID();
77 break;
79 if (creature->IsAlive())
80 {
83 hellmaw->AI()->DoAction(ACTION_AMBASSADOR_HELLMAW_BANISH);
84 }
85 break;
86 default:
87 break;
88 }
89 }
90
91 void OnCreatureRemove(Creature* creature) override
92 {
93 switch (creature->GetEntry())
94 {
100 BlackheartDummyGUIDs.erase(creature->GetGUID());
101 break;
102 default:
103 break;
104 }
105 }
106
108 {
109 switch (go->GetEntry())
110 {
113 AddDoor(go, true);
114 break;
115 default:
116 break;
117 }
118 }
119
121 {
122 switch (go->GetEntry())
123 {
126 AddDoor(go, false);
127 break;
128 default:
129 break;
130 }
131 }
132
133 void OnUnitDeath(Unit* unit) override
134 {
135 Creature* creature = unit->ToCreature();
136 if (!creature)
137 return;
138
139 if (creature->GetEntry() == NPC_FEL_OVERSEER)
140 {
143
144 if (!FelOverseerCount)
146 hellmaw->AI()->DoAction(ACTION_AMBASSADOR_HELLMAW_INTRO);
147 }
148 }
149
150 uint32 GetData(uint32 type) const override
151 {
152 switch (type)
153 {
155 return !FelOverseerCount ? 1 : 0;
156 default:
157 break;
158 }
159 return 0;
160 }
161
162 ObjectGuid GetGuidData(uint32 type) const override
163 {
164 switch (type)
165 {
167 return BlackheartGUID;
170 default:
171 break;
172 }
173 return ObjectGuid::Empty;
174 }
175
177
178 protected:
184 };
185
187 {
189 }
190};
191
193{
194 if (auto* script = dynamic_cast<instance_shadow_labyrinth::instance_shadow_labyrinth_InstanceMapScript const*>(s))
195 return &script->GetBlackheartDummies();
196
197 return nullptr;
198}
199
201{
203}
uint32_t uint32
Definition: Define.h:142
std::unordered_set< ObjectGuid > GuidUnorderedSet
Definition: ObjectGuid.h:396
#define DataHeader
uint32 const EncounterCount
void SetBossNumber(uint32 number)
void LoadDungeonEncounterData(T const &encounters)
InstanceMap * instance
virtual void AddDoor(GameObject *door, bool add)
void LoadDoorData(DoorData const *data)
void SetHeaders(std::string const &dataHeaders)
Creature * GetCreature(ObjectGuid const &guid)
Definition: Map.cpp:3479
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
static Creature * ToCreature(Object *o)
Definition: Object.h:219
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
Definition: Unit.h:627
bool IsAlive() const
Definition: Unit.h:1164
InstanceScript * GetInstanceScript(InstanceMap *map) const override
GuidUnorderedSet const * GetBlackheartDummies(InstanceScript const *s)
DoorData const doorData[]
void AddSC_instance_shadow_labyrinth()
DungeonEncounterData const encounters[]
@ GO_REFECTORY_DOOR
@ GO_SCREAMING_HALL_DOOR
#define SLScriptName
@ NPC_GRANDMASTER_VORPIL
@ NPC_BLACKHEART_DUMMY1
@ NPC_BLACKHEART_DUMMY4
@ NPC_BLACKHEART_DUMMY2
@ NPC_BLACKHEART_DUMMY5
@ NPC_FEL_OVERSEER
@ NPC_BLACKHEART_DUMMY3
@ NPC_AMBASSADOR_HELLMAW
@ NPC_BLACKHEART
@ ACTION_AMBASSADOR_HELLMAW_BANISH
@ ACTION_AMBASSADOR_HELLMAW_INTRO
@ DATA_MURMUR
@ DATA_AMBASSADOR_HELLMAW
@ DATA_GRANDMASTER_VORPIL
@ DATA_FEL_OVERSEER
@ DATA_BLACKHEART_THE_INCITER