TrinityCore
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 "Log.h"
25#include "steam_vault.h"
26
28{
29 go_main_chambers_access_panel(GameObject* go) : GameObjectAI(go), _instance(go->GetInstanceScript()) { }
30
31 bool OnGossipHello(Player* /*player*/) override
32 {
34 controller->AI()->Talk(CONTROLLER_TEXT_ACESS_USED);
38 return true;
39 }
40
41private:
43};
44
46{
50 { 0, 0 } // END
51};
52
54{
59 { 0, 0 } // END
60};
61
63{
64 public:
66
68 {
70 {
74 }
75
76 void OnGameObjectCreate(GameObject* go) override
77 {
81 }
82
84 {
86 {
87 if (Creature* controller = GetCreature(DATA_DOOR_CONTROLLER))
88 controller->AI()->Talk(CONTROLLER_TEXT_MAIN_DOOR_OPEN);
89
91 {
92 HandleGameObject(ObjectGuid::Empty, true, mainDoor);
93 mainDoor->SetFlag(GO_FLAG_NOT_SELECTABLE);
94 }
95 }
96 }
97
98 void SetData(uint32 type, uint32 /*data*/) override
99 {
100 if (type == ACTION_OPEN_DOOR)
102 }
103
104 bool SetBossState(uint32 type, EncounterState state) override
105 {
106 if (!InstanceScript::SetBossState(type, state))
107 return false;
108
109 switch (type)
110 {
112 if (state == DONE)
114 panel->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
115 break;
117 if (state == DONE)
119 panel->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
120 break;
121 default:
122 break;
123 }
124
125 return true;
126 }
127 };
128
130 {
132 }
133};
134
136{
139}
uint32_t uint32
Definition: Define.h:133
EncounterState
@ DONE
#define RegisterGameObjectAI(ai_name)
Definition: ScriptMgr.h:1158
@ GO_FLAG_NOT_SELECTABLE
@ GO_STATE_ACTIVE
@ ACTION_OPEN_DOOR
Definition: black_temple.h:140
#define DataHeader
uint32 const EncounterCount
GameObject *const me
Definition: GameObjectAI.h:35
void SetGoState(GOState state)
void SetFlag(GameObjectFlags flags)
Definition: GameObject.h:171
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
Creature * GetCreature(uint32 type)
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
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:132
uint32 GetEntry() const
Definition: Object.h:80
Definition: Player.h:915
virtual void SetData(uint32, uint32)
Definition: ZoneScript.h:56
InstanceScript * GetInstanceScript(InstanceMap *map) const override
ObjectData const gameObjectData[]
ObjectData const creatureData[]
void AddSC_instance_steam_vault()
@ 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_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:83