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 "Creature.h"
21#include "GameObject.h"
22#include "InstanceScript.h"
23#include "Map.h"
24#include "ScriptMgr.h"
25
31
41
47
49{
50 { 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)) }
51};
52
54{
55 public:
57
59 {
71
72 void OnGameObjectCreate(GameObject* go) override
73 {
75
76 switch (go->GetEntry())
77 {
81 break;
82 case GO_SPHERE_1:
83 if (SpheresState[0])
84 {
87 }
88 else
90 break;
91 case GO_SPHERE_2:
92 if (SpheresState[1])
93 {
96 }
97 else
99 break;
100 default:
101 break;
102 }
103 }
104
105 void SetData(uint32 type, uint32 data) override
106 {
107 switch (type)
108 {
109 case DATA_SPHERE_1:
110 case DATA_SPHERE_2:
111 SpheresState[type - DATA_SPHERE_1] = data;
112 break;
113 default:
114 break;
115 }
116 }
117
118 uint32 GetData(uint32 type) const override
119 {
120 switch (type)
121 {
122 case DATA_SPHERE_1:
123 case DATA_SPHERE_2:
124 return SpheresState[type - DATA_SPHERE_1];
125 default:
126 break;
127 }
128 return 0;
129 }
130
131 void WriteSaveDataMore(std::ostringstream& data) override
132 {
133 data << SpheresState[0] << ' ' << SpheresState[1];
134 }
135
136 void ReadSaveDataMore(std::istringstream& data) override
137 {
138 data >> SpheresState[0];
139 data >> SpheresState[1];
140 }
141
142 protected:
144 };
145
147 {
148 return new instance_ahnkahet_InstanceScript(map);
149 }
150};
151
153{
154 new instance_ahnkahet();
155}
uint32_t uint32
Definition Define.h:133
@ DONE
@ DOOR_TYPE_ROOM
@ DOOR_TYPE_PASSAGE
@ 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:172
void SetFlag(GameObjectFlags flags)
Definition GameObject.h:171
void SetBossNumber(uint32 number)
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
EncounterState GetBossState(uint32 id) const
virtual void OnGameObjectCreate(GameObject *go) override
void LoadDoorData(DoorData const *data)
void LoadBossBoundaries(BossBoundaryData const &data)
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[]
void AddSC_instance_ahnkahet()
ObjectData const creatureData[]
DoorData const doorData[]
BossBoundaryData const boundaries
void SetData(uint32 type, uint32 data) override
void ReadSaveDataMore(std::istringstream &data) override
void WriteSaveDataMore(std::ostringstream &data) override