TrinityCore
Loading...
Searching...
No Matches
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
50
58
59static constexpr DungeonEncounterData encounters[] =
60{
61 { DATA_HYDROMANCER_THESPIA, {{ 1942 }} },
62 { DATA_MEKGINEER_STEAMRIGGER, {{ 1943 }} },
63 { DATA_WARLORD_KALITHRESH, {{ 1944 }} }
64};
65
67{
68 public:
70
72 {
81
88
90 {
92 {
93 if (Creature* controller = GetCreature(DATA_DOOR_CONTROLLER))
94 controller->AI()->Talk(CONTROLLER_TEXT_MAIN_DOOR_OPEN);
95
97 {
98 HandleGameObject(ObjectGuid::Empty, true, mainDoor);
99 mainDoor->SetFlag(GO_FLAG_NOT_SELECTABLE);
100 }
101 }
102 }
103
104 void SetData(uint32 type, uint32 data) override
105 {
106 if (type == DATA_DISTILLER)
107 distillerState = data;
108 else if (type == ACTION_OPEN_DOOR)
110 }
111
112 uint32 GetData(uint32 type) const override
113 {
114 if (type == DATA_DISTILLER)
115 return distillerState;
116 return 0;
117 }
118
119 bool SetBossState(uint32 type, EncounterState state) override
120 {
121 if (!InstanceScript::SetBossState(type, state))
122 return false;
123
124 switch (type)
125 {
127 if (state == DONE)
129 panel->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
130 break;
132 if (state == DONE)
134 panel->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
135 break;
136 default:
137 break;
138 }
139
140 return true;
141 }
142
143 protected:
145 };
146
148 {
150 }
151};
152
uint8_t uint8
Definition Define.h:156
uint32_t uint32
Definition Define.h:154
EncounterState
@ DONE
#define RegisterGameObjectAI(ai_name)
Definition ScriptMgr.h:1410
@ GO_FLAG_NOT_SELECTABLE
@ GO_STATE_ACTIVE
#define DataHeader
uint32 const EncounterCount
@ ACTION_OPEN_DOOR
GameObject *const me
void SetGoState(GOState state)
void SetFlag(GameObjectFlags flags)
Definition GameObject.h:277
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 LoadObjectData(std::span< ObjectData const > creatureData, std::span< ObjectData const > gameObjectData)
void SetHeaders(std::string_view dataHeaders)
void LoadDungeonEncounterData(std::span< DungeonEncounterData const > encounters)
EncounterState GetBossState(uint32 id) const
virtual void OnGameObjectCreate(GameObject *go) override
GameObject * GetGameObject(uint32 type)
static ObjectGuid const Empty
Definition ObjectGuid.h:314
uint32 GetEntry() const
Definition Object.h:89
virtual void SetData(uint32, uint32)
Definition ZoneScript.h:100
InstanceScript * GetInstanceScript(InstanceMap *map) const override
static constexpr ObjectData creatureData[]
void AddSC_instance_steam_vault()
static constexpr ObjectData gameObjectData[]
static constexpr DungeonEncounterData 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