TrinityCore
Loading...
Searching...
No Matches
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{
35public:
37
39 {
46
47 void OnCreatureCreate(Creature* creature) override
48 {
49 switch (creature->GetEntry())
50 {
51 case NPC_SARTHARION:
52 sartharionGUID = creature->GetGUID();
53 break;
54 // Three dragons below set to active state once created.
55 // We must expect bigger raid to encounter main boss, and then three dragons must be active due to grid differences
56 case NPC_TENEBRON:
57 tenebronGUID = creature->GetGUID();
58 creature->setActive(true);
59 creature->SetFarVisible(true);
60 break;
61 case NPC_SHADRON:
62 shadronGUID = creature->GetGUID();
63 creature->setActive(true);
64 creature->SetFarVisible(true);
65 break;
66 case NPC_VESPERON:
67 vesperonGUID = creature->GetGUID();
68 creature->setActive(true);
69 creature->SetFarVisible(true);
70 break;
71 }
72 }
73
74 bool SetBossState(uint32 type, EncounterState state) override
75 {
76 if (!InstanceScript::SetBossState(type, state))
77 return false;
78
79 switch (type)
80 {
81 case DATA_SARTHARION:
82 case DATA_TENEBRON:
83 case DATA_SHADRON:
84 case DATA_VESPERON:
85 break;
86 default:
87 break;
88 }
89 return true;
90 }
91
93 {
94 switch (Data)
95 {
96 case DATA_SARTHARION:
97 return sartharionGUID;
98 case DATA_TENEBRON:
99 return tenebronGUID;
100 case DATA_SHADRON:
101 return shadronGUID;
102 case DATA_VESPERON:
103 return vesperonGUID;
104 }
105 return ObjectGuid::Empty;
106 }
107
108 protected:
113 };
114
116 {
118 }
119};
120
uint32_t uint32
Definition Define.h:133
EncounterState
#define DataHeader
uint32 const EncounterCount
Data
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
void LoadBossBoundaries(BossBoundaryData const &data)
void SetHeaders(std::string const &dataHeaders)
static ObjectGuid const Empty
Definition ObjectGuid.h:140
uint32 GetEntry() const
Definition Object.h:81
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
void setActive(bool isActiveObject)
Definition Object.cpp:991
void SetFarVisible(bool on)
Definition Object.cpp:1014
InstanceScript * GetInstanceScript(InstanceMap *map) const override
BossBoundaryData const boundaries
void AddSC_instance_obsidian_sanctum()
#define OSScriptName
@ DATA_VESPERON
@ DATA_TENEBRON
@ DATA_SARTHARION
@ DATA_SHADRON
@ NPC_VESPERON
@ NPC_SHADRON
@ NPC_TENEBRON
@ NPC_SARTHARION