Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
instance_obsidian_sanctum.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#include "ScriptMgr.h"
7#include "InstanceScript.h"
8#include "obsidian_sanctum.h"
9
10#define MAX_ENCOUNTER 1
11
12/* Obsidian Sanctum encounters:
130 - Sartharion
14*/
15
17{
18public:
19 instance_obsidian_sanctum() : InstanceMapScript("instance_obsidian_sanctum", 615) { }
20
25
27 {
29
35
39
41 {
42 memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
43
48
49 m_bTenebronKilled = false;
50 m_bShadronKilled = false;
51 m_bVesperonKilled = false;
52 }
53
55 {
56 for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
58 return true;
59
60 return false;
61 }
62
64 {
65 switch (creature->GetEntry())
66 {
67 case NPC_SARTHARION:
68 m_uiSartharionGUID = creature->GetGUID();
69 break;
70 //three dragons below set to active state once created.
71 //we must expect bigger raid to encounter main boss, and then three dragons must be active due to grid differences
72 case NPC_TENEBRON:
73 m_uiTenebronGUID = creature->GetGUID();
74 creature->setActive(true);
75 break;
76 case NPC_SHADRON:
77 m_uiShadronGUID = creature->GetGUID();
78 creature->setActive(true);
79 break;
80 case NPC_VESPERON:
81 m_uiVesperonGUID = creature->GetGUID();
82 creature->setActive(true);
83 break;
84 }
85 }
86
87 void SetData(uint32 uiType, uint32 uiData) OVERRIDE
88 {
89 if (uiType == TYPE_SARTHARION_EVENT)
90 m_auiEncounter[0] = uiData;
91 else if (uiType == TYPE_TENEBRON_PREKILLED)
92 m_bTenebronKilled = true;
93 else if (uiType == TYPE_SHADRON_PREKILLED)
94 m_bShadronKilled = true;
95 else if (uiType == TYPE_VESPERON_PREKILLED)
96 m_bVesperonKilled = true;
97 }
98
100 {
101 if (uiType == TYPE_SARTHARION_EVENT)
102 return m_auiEncounter[0];
103 else if (uiType == TYPE_TENEBRON_PREKILLED)
104 return m_bTenebronKilled;
105 else if (uiType == TYPE_SHADRON_PREKILLED)
106 return m_bShadronKilled;
107 else if (uiType == TYPE_VESPERON_PREKILLED)
108 return m_bVesperonKilled;
109
110 return 0;
111 }
112
114 {
115 switch (uiData)
116 {
117 case DATA_SARTHARION:
118 return m_uiSartharionGUID;
119 case DATA_TENEBRON:
120 return m_uiTenebronGUID;
121 case DATA_SHADRON:
122 return m_uiShadronGUID;
123 case DATA_VESPERON:
124 return m_uiVesperonGUID;
125 }
126 return 0;
127 }
128 };
129};
130
std::uint8_t uint8
Definition Define.h:79
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
std::uint64_t uint64
Definition Define.h:76
@ IN_PROGRESS
@ NPC_SARTHARION
InstanceMapScript(const char *name, uint32 mapId)
InstanceScript(Map *map)
Definition Map.h:238
InstanceScript * GetInstanceScript(InstanceMap *map) const OVERRIDE
void AddSC_instance_obsidian_sanctum()
#define MAX_ENCOUNTER
@ NPC_VESPERON
@ NPC_SHADRON
@ NPC_TENEBRON
@ TYPE_SARTHARION_EVENT
@ DATA_VESPERON
@ TYPE_VESPERON_PREKILLED
@ DATA_TENEBRON
@ TYPE_TENEBRON_PREKILLED
@ TYPE_SHADRON_PREKILLED
@ DATA_SARTHARION
@ DATA_SHADRON