TrinityCore
Loading...
Searching...
No Matches
instance_ahnkahet.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 "ahnkahet.h"
19#include "AreaBoundary.h"
20#include "GameObject.h"
21#include "InstanceScript.h"
22#include "ScriptMgr.h"
23
28
37
42
44{
45 { DATA_JEDOGA_SHADOWSEEKER, new ParallelogramBoundary(Position(460.365f, -661.997f, -20.985f), Position(364.958f,-790.211f, -14.207f), Position(347.436f,-657.978f,14.478f)) }
46};
47
48static constexpr DungeonEncounterData encounters[] =
49{
50 { DATA_ELDER_NADOX, {{ 1969 }} },
51 { DATA_PRINCE_TALDARAM, {{ 1966 }} },
52 { DATA_JEDOGA_SHADOWSEEKER, {{ 1967 }} },
53 { DATA_AMANITAR, {{ 1989 }} },
54 { DATA_HERALD_VOLAZJ, {{ 1968 }} }
55};
56
58{
59 public:
61
63 {
76
77 void OnGameObjectCreate(GameObject* go) override
78 {
80
81 switch (go->GetEntry())
82 {
86 break;
87 case GO_SPHERE_1:
88 if (SpheresState[0])
89 {
92 }
93 else
95 break;
96 case GO_SPHERE_2:
97 if (SpheresState[1])
98 {
101 }
102 else
104 break;
105 default:
106 break;
107 }
108 }
109
110 void SetData(uint32 type, uint32 data) override
111 {
112 switch (type)
113 {
114 case DATA_SPHERE_1:
115 case DATA_SPHERE_2:
116 SpheresState[type - DATA_SPHERE_1] = data;
117 break;
118 default:
119 break;
120 }
121 }
122
123 uint32 GetData(uint32 type) const override
124 {
125 switch (type)
126 {
127 case DATA_SPHERE_1:
128 case DATA_SPHERE_2:
129 return SpheresState[type - DATA_SPHERE_1];
130 default:
131 break;
132 }
133 return 0;
134 }
135
136 void AfterDataLoad() override
137 {
139 {
142 }
143 }
144
145 protected:
147 };
148
150 {
151 return new instance_ahnkahet_InstanceScript(map);
152 }
153};
154
156{
157 new instance_ahnkahet();
158}
uint32_t uint32
Definition Define.h:154
@ IN_PROGRESS
@ DONE
@ GO_FLAG_NOT_SELECTABLE
@ GO_STATE_ACTIVE
@ DATA_HERALD_VOLAZJ
Definition ahnkahet.h:35
@ DATA_JEDOGA_SHADOWSEEKER
Definition ahnkahet.h:33
@ DATA_AMANITAR
Definition ahnkahet.h:34
@ DATA_SPHERE_2
Definition ahnkahet.h:39
@ DATA_PRINCE_TALDARAM_PLATFORM
Definition ahnkahet.h:40
@ DATA_ELDER_NADOX
Definition ahnkahet.h:31
@ DATA_PRINCE_TALDARAM
Definition ahnkahet.h:32
@ DATA_SPHERE_1
Definition ahnkahet.h:38
#define AhnKahetScriptName
Definition ahnkahet.h:23
@ GO_PRINCE_TALDARAM_GATE
Definition ahnkahet.h:75
@ GO_PRINCE_TALDARAM_PLATFORM
Definition ahnkahet.h:76
@ GO_SPHERE_2
Definition ahnkahet.h:78
@ GO_SPHERE_1
Definition ahnkahet.h:77
@ NPC_AMANITAR
Definition ahnkahet.h:48
@ NPC_HERALD_VOLAZJ
Definition ahnkahet.h:49
@ NPC_JEDOGA_SHADOWSEEKER
Definition ahnkahet.h:47
@ NPC_ELDER_NADOX
Definition ahnkahet.h:45
@ NPC_PRINCE_TALDARAM
Definition ahnkahet.h:46
#define DataHeader
uint32 const EncounterCount
void SetGoState(GOState state)
void RemoveFlag(GameObjectFlags flags)
Definition GameObject.h:278
void SetFlag(GameObjectFlags flags)
Definition GameObject.h:277
void SetBossNumber(uint32 number)
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
void LoadObjectData(std::span< ObjectData const > creatureData, std::span< ObjectData const > gameObjectData)
void SetHeaders(std::string_view dataHeaders)
void LoadDungeonEncounterData(std::span< DungeonEncounterData const > encounters)
EncounterState GetBossState(uint32 id) const
virtual void OnGameObjectCreate(GameObject *go) override
void LoadDoorData(std::span< DoorData const > data)
void LoadBossBoundaries(BossBoundaryData const &data)
static ObjectGuid const Empty
Definition ObjectGuid.h:314
uint32 GetEntry() const
Definition Object.h:89
InstanceScript * GetInstanceScript(InstanceMap *map) const override
static constexpr ObjectData creatureData[]
void AddSC_instance_ahnkahet()
static constexpr DoorData doorData[]
BossBoundaryData const boundaries
static constexpr ObjectData gameObjectData[]
static constexpr DungeonEncounterData encounters[]
void SetData(uint32 type, uint32 data) override