TrinityCore
instance_obsidian_sanctum.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 "AreaBoundary.h"
20#include "Creature.h"
21#include "InstanceScript.h"
22#include "obsidian_sanctum.h"
23
24/* Obsidian Sanctum encounters:
250 - Sartharion
26*/
27
29{
30 { DATA_SARTHARION, new RectangleBoundary(3218.86f, 3275.69f, 484.68f, 572.4f) }
31};
32
34{
35 { DATA_SARTHARION, {{ 1090 }} },
36 { DATA_TENEBRON, {{ 1092 }} },
37 { DATA_SHADRON, {{ 1091 }} },
38 { DATA_VESPERON, {{ 1093 }} }
39};
40
42{
43public:
45
47 {
49 {
54 }
55
56 void OnCreatureCreate(Creature* creature) override
57 {
58 switch (creature->GetEntry())
59 {
60 case NPC_SARTHARION:
61 sartharionGUID = creature->GetGUID();
62 break;
63 // Three dragons below set to active state once created.
64 // We must expect bigger raid to encounter main boss, and then three dragons must be active due to grid differences
65 case NPC_TENEBRON:
66 tenebronGUID = creature->GetGUID();
67 creature->setActive(true);
68 creature->SetFarVisible(true);
69 break;
70 case NPC_SHADRON:
71 shadronGUID = creature->GetGUID();
72 creature->setActive(true);
73 creature->SetFarVisible(true);
74 break;
75 case NPC_VESPERON:
76 vesperonGUID = creature->GetGUID();
77 creature->setActive(true);
78 creature->SetFarVisible(true);
79 break;
80 }
81 }
82
83 bool SetBossState(uint32 type, EncounterState state) override
84 {
85 if (!InstanceScript::SetBossState(type, state))
86 return false;
87
88 switch (type)
89 {
90 case DATA_SARTHARION:
91 case DATA_TENEBRON:
92 case DATA_SHADRON:
93 case DATA_VESPERON:
94 break;
95 default:
96 break;
97 }
98 return true;
99 }
100
102 {
103 switch (Data)
104 {
105 case DATA_SARTHARION:
106 return sartharionGUID;
107 case DATA_TENEBRON:
108 return tenebronGUID;
109 case DATA_SHADRON:
110 return shadronGUID;
111 case DATA_VESPERON:
112 return vesperonGUID;
113 }
114 return ObjectGuid::Empty;
115 }
116
117 protected:
122 };
123
125 {
127 }
128};
129
131{
133}
uint32_t uint32
Definition: Define.h:142
EncounterState
#define DataHeader
uint32 const EncounterCount
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
void LoadDungeonEncounterData(T const &encounters)
void LoadBossBoundaries(BossBoundaryData const &data)
void SetHeaders(std::string const &dataHeaders)
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
void setActive(bool isActiveObject)
Definition: Object.cpp:922
void SetFarVisible(bool on)
Definition: Object.cpp:973
InstanceScript * GetInstanceScript(InstanceMap *map) const override
BossBoundaryData const boundaries
void AddSC_instance_obsidian_sanctum()
DungeonEncounterData const encounters[]
#define OSScriptName
@ DATA_VESPERON
@ DATA_TENEBRON
@ DATA_SARTHARION
@ DATA_SHADRON
@ NPC_VESPERON
@ NPC_SHADRON
@ NPC_TENEBRON
@ NPC_SARTHARION