TrinityCore
Loading...
Searching...
No Matches
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
32
34{
35 public:
37
39 {
48
49 void OnCreatureCreate(Creature* creature) override
50 {
51 switch (creature->GetEntry())
52 {
54 AmbassadorHellmawGUID = creature->GetGUID();
55 break;
56 case NPC_BLACKHEART:
57 BlackheartGUID = creature->GetGUID();
58 break;
64 BlackheartDummyGUIDs.insert(creature->GetGUID());
65 break;
67 GrandmasterVorpilGUID = creature->GetGUID();
68 break;
70 if (creature->IsAlive())
71 {
74 hellmaw->AI()->DoAction(ACTION_AMBASSADOR_HELLMAW_BANISH);
75 }
76 break;
77 default:
78 break;
79 }
80 }
81
82 void OnCreatureRemove(Creature* creature) override
83 {
84 switch (creature->GetEntry())
85 {
91 BlackheartDummyGUIDs.erase(creature->GetGUID());
92 break;
93 default:
94 break;
95 }
96 }
97
98 void OnGameObjectCreate(GameObject* go) override
99 {
100 switch (go->GetEntry())
101 {
104 AddDoor(go, true);
105 break;
106 default:
107 break;
108 }
109 }
110
112 {
113 switch (go->GetEntry())
114 {
117 AddDoor(go, false);
118 break;
119 default:
120 break;
121 }
122 }
123
124 void OnUnitDeath(Unit* unit) override
125 {
126 Creature* creature = unit->ToCreature();
127 if (!creature)
128 return;
129
130 if (creature->GetEntry() == NPC_FEL_OVERSEER)
131 {
134
135 if (!FelOverseerCount)
138 }
139 }
140
141 uint32 GetData(uint32 type) const override
142 {
143 switch (type)
144 {
146 return !FelOverseerCount ? 1 : 0;
147 default:
148 break;
149 }
150 return 0;
151 }
152
153 ObjectGuid GetGuidData(uint32 type) const override
154 {
155 switch (type)
156 {
158 return BlackheartGUID;
161 default:
162 break;
163 }
164 return ObjectGuid::Empty;
165 }
166
168
169 protected:
175 };
176
178 {
180 }
181};
182
184{
185 if (auto* script = dynamic_cast<instance_shadow_labyrinth::instance_shadow_labyrinth_InstanceMapScript const*>(s))
186 return &script->GetBlackheartDummies();
187 return nullptr;
188
189}
190
uint32_t uint32
Definition Define.h:133
@ DOOR_TYPE_ROOM
@ DOOR_TYPE_PASSAGE
std::unordered_set< ObjectGuid > GuidUnorderedSet
Definition ObjectGuid.h:263
#define DataHeader
uint32 const EncounterCount
CreatureAI * AI() const
Definition Creature.h:154
void SetBossNumber(uint32 number)
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:4397
static ObjectGuid const Empty
Definition ObjectGuid.h:140
static Creature * ToCreature(Object *o)
Definition Object.h:186
uint32 GetEntry() const
Definition Object.h:81
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
virtual void DoAction(int32)
Definition UnitAI.h:154
Definition Unit.h:769
bool IsAlive() const
Definition Unit.h:1234
InstanceScript * GetInstanceScript(InstanceMap *map) const override
GuidUnorderedSet const * GetBlackheartDummies(InstanceScript const *s)
DoorData const doorData[]
void AddSC_instance_shadow_labyrinth()
@ 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_GRANDMASTER_VORPIL
@ DATA_FEL_OVERSEER
@ DATA_BLACKHEART_THE_INCITER