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
33static constexpr ObjectData creatureData[] =
34{
36 { 0, 0 } // END
37};
38
40{
41 public:
43
45 {
55
56 void OnCreatureCreate(Creature* creature) override
57 {
59
60 switch (creature->GetEntry())
61 {
63 AmbassadorHellmawGUID = creature->GetGUID();
64 break;
66 GrandmasterVorpilGUID = creature->GetGUID();
67 break;
69 if (creature->IsAlive())
70 {
73 hellmaw->AI()->DoAction(ACTION_AMBASSADOR_HELLMAW_BANISH);
74 }
75 break;
76 default:
77 break;
78 }
79 }
80
81 void OnGameObjectCreate(GameObject* go) override
82 {
83 switch (go->GetEntry())
84 {
87 AddDoor(go, true);
88 break;
89 default:
90 break;
91 }
92 }
93
94 void OnGameObjectRemove(GameObject* go) override
95 {
96 switch (go->GetEntry())
97 {
100 AddDoor(go, false);
101 break;
102 default:
103 break;
104 }
105 }
106
107 void OnUnitDeath(Unit* unit) override
108 {
109 Creature* creature = unit->ToCreature();
110 if (!creature)
111 return;
112
113 if (creature->GetEntry() == NPC_FEL_OVERSEER)
114 {
117
118 if (!FelOverseerCount)
121 }
122 }
123
124 uint32 GetData(uint32 type) const override
125 {
126 switch (type)
127 {
129 return !FelOverseerCount ? 1 : 0;
130 default:
131 break;
132 }
133 return 0;
134 }
135
136 ObjectGuid GetGuidData(uint32 type) const override
137 {
138 switch (type)
139 {
142 default:
143 break;
144 }
145 return ObjectGuid::Empty;
146 }
147
148 protected:
152 };
153
155 {
157 }
158};
159
uint32_t uint32
Definition Define.h:133
@ DOOR_TYPE_ROOM
@ DOOR_TYPE_PASSAGE
#define DataHeader
uint32 const EncounterCount
CreatureAI * AI() const
Definition Creature.h:163
void SetBossNumber(uint32 number)
virtual void OnCreatureCreate(Creature *creature) override
InstanceMap * instance
virtual void AddDoor(GameObject *door, bool add)
void LoadDoorData(DoorData const *data)
void SetHeaders(std::string const &dataHeaders)
void LoadObjectData(ObjectData const *creatureData, ObjectData const *gameObjectData)
Creature * GetCreature(ObjectGuid const &guid)
Definition Map.cpp:4392
static ObjectGuid const Empty
Definition ObjectGuid.h:140
static Creature * ToCreature(Object *o)
Definition Object.h:189
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:783
bool IsAlive() const
Definition Unit.h:1247
InstanceScript * GetInstanceScript(InstanceMap *map) const override
static constexpr ObjectData creatureData[]
static constexpr DoorData doorData[]
void AddSC_instance_shadow_labyrinth()
@ GO_REFECTORY_DOOR
@ GO_SCREAMING_HALL_DOOR
#define SLScriptName
@ NPC_GRANDMASTER_VORPIL
@ NPC_FEL_OVERSEER
@ NPC_AMBASSADOR_HELLMAW
@ NPC_BLACKHEART
@ ACTION_AMBASSADOR_HELLMAW_BANISH
@ ACTION_AMBASSADOR_HELLMAW_INTRO
@ DATA_GRANDMASTER_VORPIL
@ DATA_FEL_OVERSEER
@ DATA_BLACKHEART_THE_INCITER