TrinityCore
instance_steam_vault.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 "GameObjectAI.h"
23#include "InstanceScript.h"
24#include "steam_vault.h"
25
27{
28 go_main_chambers_access_panel(GameObject* go) : GameObjectAI(go), _instance(go->GetInstanceScript()) { }
29
30 bool OnGossipHello(Player* /*player*/) override
31 {
33 controller->AI()->Talk(CONTROLLER_TEXT_ACESS_USED);
37 return true;
38 }
39
40private:
42};
43
45{
49 { 0, 0 } // END
50};
51
53{
58 { 0, 0 } // END
59};
60
62{
63 { DATA_HYDROMANCER_THESPIA, {{ 1942 }} },
64 { DATA_MEKGINEER_STEAMRIGGER, {{ 1943 }} },
65 { DATA_WARLORD_KALITHRESH, {{ 1944 }} }
66};
67
69{
70 public:
72
74 {
76 {
82 }
83
84 void OnGameObjectCreate(GameObject* go) override
85 {
89 }
90
92 {
94 {
95 if (Creature* controller = GetCreature(DATA_DOOR_CONTROLLER))
96 controller->AI()->Talk(CONTROLLER_TEXT_MAIN_DOOR_OPEN);
97
99 {
100 HandleGameObject(ObjectGuid::Empty, true, mainDoor);
101 mainDoor->SetFlag(GO_FLAG_NOT_SELECTABLE);
102 }
103 }
104 }
105
106 void SetData(uint32 type, uint32 data) override
107 {
108 if (type == DATA_DISTILLER)
109 distillerState = data;
110 else if (type == ACTION_OPEN_DOOR)
112 }
113
114 uint32 GetData(uint32 type) const override
115 {
116 if (type == DATA_DISTILLER)
117 return distillerState;
118 return 0;
119 }
120
121 bool SetBossState(uint32 type, EncounterState state) override
122 {
123 if (!InstanceScript::SetBossState(type, state))
124 return false;
125
126 switch (type)
127 {
129 if (state == DONE)
131 panel->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
132 break;
134 if (state == DONE)
136 panel->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
137 break;
138 default:
139 break;
140 }
141
142 return true;
143 }
144
145 protected:
147 };
148
150 {
152 }
153};
154
156{
159}
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
EncounterState
@ DONE
#define RegisterGameObjectAI(ai_name)
Definition: ScriptMgr.h:1398
@ GO_FLAG_NOT_SELECTABLE
@ GO_STATE_ACTIVE
#define DataHeader
uint32 const EncounterCount
@ ACTION_OPEN_DOOR
Definition: black_temple.h:140
GameObject *const me
Definition: GameObjectAI.h:50
void SetGoState(GOState state)
void SetFlag(GameObjectFlags flags)
Definition: GameObject.h:274
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
Creature * GetCreature(uint32 type)
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
void LoadDungeonEncounterData(T const &encounters)
EncounterState GetBossState(uint32 id) const
virtual void OnGameObjectCreate(GameObject *go) override
GameObject * GetGameObject(uint32 type)
void SetHeaders(std::string const &dataHeaders)
void LoadObjectData(ObjectData const *creatureData, ObjectData const *gameObjectData)
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
uint32 GetEntry() const
Definition: Object.h:161
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:92
InstanceScript * GetInstanceScript(InstanceMap *map) const override
ObjectData const gameObjectData[]
ObjectData const creatureData[]
void AddSC_instance_steam_vault()
DungeonEncounterData const encounters[]
@ NPC_COILFANG_DOOR_CONTROLLER
Definition: steam_vault.h:47
@ NPC_HYDROMANCER_THESPIA
Definition: steam_vault.h:44
@ NPC_WARLORD_KALITHRESH
Definition: steam_vault.h:46
@ NPC_MEKGINEER_STEAMRIGGER
Definition: steam_vault.h:45
#define SteamVaultScriptName
Definition: steam_vault.h:23
@ DATA_HYDROMANCER_THESPIA
Definition: steam_vault.h:30
@ DATA_ACCESS_PANEL_MEK
Definition: steam_vault.h:37
@ DATA_DOOR_CONTROLLER
Definition: steam_vault.h:38
@ DATA_MEKGINEER_STEAMRIGGER
Definition: steam_vault.h:31
@ DATA_DISTILLER
Definition: steam_vault.h:35
@ DATA_ACCESS_PANEL_HYDRO
Definition: steam_vault.h:36
@ DATA_WARLORD_KALITHRESH
Definition: steam_vault.h:32
@ GO_ACCESS_PANEL_HYDRO
Definition: steam_vault.h:53
@ GO_MAIN_CHAMBERS_DOOR
Definition: steam_vault.h:52
@ GO_ACCESS_PANEL_MEK
Definition: steam_vault.h:54
@ CONTROLLER_TEXT_ACESS_USED
Definition: steam_vault.h:60
@ CONTROLLER_TEXT_MAIN_DOOR_OPEN
Definition: steam_vault.h:61
bool OnGossipHello(Player *) override
bool SetBossState(uint32 type, EncounterState state) override
@ DATA_MAIN_DOOR
Definition: violet_hold.h:84