TrinityCore
instance_halls_of_origination.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"
23#include "InstanceScript.h"
24#include "Map.h"
25
27{
41};
42
44{
49 { 0, 0 } //END
50};
51
53{
55 { 0, 0 } //END
56};
57
59{
60 { BOSS_TEMPLE_GUARDIAN_ANHUUR, {{ 1080 }} },
61 { BOSS_EARTHRAGER_PTAH, {{ 1076 }} },
62 { BOSS_ANRAPHET, {{ 1075 }} },
63 { BOSS_ISISET, {{ 1077 }} },
64 { BOSS_AMMUNAE, {{ 1074 }} },
65 { BOSS_SETESH, {{ 1079 }} },
66 { BOSS_RAJH, {{ 1078 }} }
67};
68
70{
71 public:
73
75 {
77 {
84 }
85
86 void OnGameObjectCreate(GameObject* go) override
87 {
89
90 switch (go->GetEntry())
91 {
94 [[fallthrough]];
105 AddDoor(go, true);
106 break;
107 case GO_ANHUURS_DOOR:
108 AnhuursDoorGUID = go->GetGUID();
109 AddDoor(go, true);
110 break;
113 break;
116 break;
117 case GO_SUN_MIRROR:
118 SunMirrorGUID = go->GetGUID();
119 break;
120 case GO_ANRAPHET_DOOR:
122 break;
123 }
124 }
125
127 {
129
130 switch (go->GetEntry())
131 {
134 case GO_ANHUURS_DOOR:
144 AddDoor(go, false);
145 break;
146 }
147 }
148
149 uint32 GetData(uint32 data) const override
150 {
151 switch (data)
152 {
154 return _deadElementals;
155 default:
156 break;
157 }
158
159 return 0;
160 }
161
162 ObjectGuid GetGuidData(uint32 type) const override
163 {
164 switch (type)
165 {
167 return AnhuursBridgeGUID;
168 case DATA_ANHUUR_DOOR:
169 return AnhuursDoorGUID;
174 }
175
176 return InstanceScript::GetGuidData(type);
177 }
178
180 {
181 _deadElementals += inc;
182 if (_deadElementals == 4)
183 {
185 mirror->SetGoState(GO_STATE_ACTIVE);
187 door->SetGoState(GO_STATE_ACTIVE);
188 }
189 }
190
191 void OnUnitDeath(Unit* unit) override
192 {
194
195 Creature* creature = unit->ToCreature();
196 if (!creature)
197 return;
198
199 switch (creature->GetEntry())
200 {
201 case NPC_FIRE_WARDEN:
202 case NPC_EARTH_WARDEN:
203 case NPC_WATER_WARDEN:
204 case NPC_AIR_WARDEN:
205 uint32 data = creature->GetEntry() - WARDEN_ENTRY_DATA_DELTA;
206 SetBossState(data, IN_PROGRESS); // Needs to be set to IN_PROGRESS or else the gameobjects state won't be updated
207 SetBossState(data, DONE);
210 brann->AI()->DoAction(ACTION_ELEMENTAL_DIED);
211 break;
212 }
213 }
214
215 void AfterDataLoad() override
216 {
219 }
220
221 protected:
229 };
230
232 {
234 }
235};
236
238{
240}
uint32_t uint32
Definition: Define.h:142
@ IN_PROGRESS
@ DONE
@ GO_STATE_ACTIVE
#define DataHeader
uint32 const EncounterCount
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
Creature * GetCreature(uint32 type)
void LoadDungeonEncounterData(T const &encounters)
virtual ObjectGuid GetGuidData(uint32 type) const override
virtual void OnGameObjectRemove(GameObject *go) override
InstanceMap * instance
EncounterState GetBossState(uint32 id) const
virtual void OnGameObjectCreate(GameObject *go) override
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)
GameObject * GetGameObject(ObjectGuid const &guid)
Definition: Map.cpp:3489
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
virtual void OnUnitDeath(Unit *unit)
Definition: ZoneScript.h:80
InstanceScript * GetInstanceScript(InstanceMap *map) const override
@ GO_ANHUURS_RIGHT_BEACON
@ GO_LIFT_OF_THE_MAKERS
@ GO_ANHUURS_BRIDGE
@ GO_DOODAD_ULDUM_LASERBEAMS01
@ GO_DOODAD_ULDUM_LIGHTMACHINE_03
@ GO_DOODAD_ULDUM_ELEVATOR_COL01
@ GO_DOODAD_ULDUM_LIGHTMACHINE_01
@ GO_ANHUURS_DOOR
@ GO_SUN_MIRROR
@ GO_DOODAD_ULDUM_LASERBEAMS_01
@ GO_ANRAPHET_DOOR
@ GO_DOODAD_ULDUM_LASERBEAMS_03
@ GO_ANHUURS_LEFT_BEACON
@ GO_VAULT_OF_LIGHTS_DOOR
@ GO_DOODAD_ULDUM_LIGHTMACHINE_04
@ GO_DOODAD_ULDUM_LIGHTMACHINE_02
@ GO_DOODAD_ULDUM_LASERBEAMS_02
@ ACTION_ELEMENTAL_DIED
@ WARDEN_ENTRY_DATA_DELTA
@ NPC_ANRAPHET
@ NPC_TEMPLE_GUARDIAN_ANHUUR
@ NPC_WATER_WARDEN
@ NPC_AIR_WARDEN
@ NPC_BRANN_BRONZEBEARD_0
@ NPC_EARTHRAGER_PTAH
@ NPC_EARTH_WARDEN
@ NPC_FIRE_WARDEN
#define HoOScriptName
@ BOSS_AMMUNAE
@ BOSS_TEMPLE_GUARDIAN_ANHUUR
@ DATA_ANHUUR_RIGHT_BEACON
@ DATA_LIFT_OF_THE_MAKERS
@ BOSS_ISISET
@ BOSS_SETESH
@ BOSS_RAJH
@ BOSS_WATER_WARDEN
@ BOSS_FIRE_WARDEN
@ DATA_BRANN_BRONZEBEARD
@ DATA_DEAD_ELEMENTALS
@ DATA_ANHUUR_BRIDGE
@ BOSS_EARTH_WARDEN
@ BOSS_AIR_WARDEN
@ DATA_ANHUUR_DOOR
@ BOSS_ANRAPHET
@ BOSS_VAULT_OF_LIGHTS
@ DATA_ANHUUR_LEFT_BEACON
@ BOSS_EARTHRAGER_PTAH
ObjectData const gameObjectData[]
ObjectData const creatureData[]
DoorData const doorData[]
void AddSC_instance_halls_of_origination()
DungeonEncounterData const encounters[]