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 "InstanceScript.h"
23#include "Log.h"
24#include "steam_vault.h"
25
33
42
44{
45 public:
47
49 {
56
63
65 {
67 {
68 if (Creature* controller = GetCreature(DATA_DOOR_CONTROLLER))
69 controller->AI()->Talk(CONTROLLER_TEXT_MAIN_DOOR_OPEN);
70
72 {
73 HandleGameObject(ObjectGuid::Empty, true, mainDoor);
74 mainDoor->SetFlag(GO_FLAG_NOT_SELECTABLE);
75 }
76 }
77 }
78
79 void SetData(uint32 type, uint32 /*data*/) override
80 {
81 if (type == ACTION_OPEN_DOOR)
83 }
84
85 bool SetBossState(uint32 type, EncounterState state) override
86 {
87 if (!InstanceScript::SetBossState(type, state))
88 return false;
89
90 switch (type)
91 {
93 if (state == DONE)
95 panel->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
96 break;
98 if (state == DONE)
100 panel->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
101 break;
102 default:
103 break;
104 }
105
106 return true;
107 }
108 };
109
111 {
113 }
114};
115
uint32_t uint32
Definition Define.h:133
EncounterState
@ DONE
@ GO_FLAG_NOT_SELECTABLE
@ ACTION_OPEN_DOOR
#define DataHeader
uint32 const EncounterCount
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:140
uint32 GetEntry() const
Definition Object.h:81
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_MAIN_DOOR_OPEN
Definition steam_vault.h:61
bool SetBossState(uint32 type, EncounterState state) override
@ DATA_MAIN_DOOR
Definition violet_hold.h:83