TrinityCore
instance_razorfen_downs.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 "GameObject.h"
20#include "InstanceScript.h"
21#include "Map.h"
22#include "MotionMaster.h"
23#include "razorfen_downs.h"
24#include "TemporarySummon.h"
25
27{
28 // 7349 Tomb Fiend
29 { 2487.339f, 805.9111f, 43.08361f, 2.844887f },
30 { 2485.405f, 804.1145f, 43.68511f, 3.054326f },
31 { 2488.431f, 801.2809f, 42.70374f, 4.29351f },
32 { 2489.914f, 804.7949f, 43.25175f, 1.658063f },
33 { 2541.246f, 907.0941f, 46.64201f, 2.024582f },
34 { 2544.701f, 907.6331f, 46.38007f, 1.605703f },
35 { 2541.49f, 911.1756f, 46.26493f, 4.817109f },
36 { 2544.693f, 912.8887f, 46.39912f, 2.129302f },
37 { 2524.036f, 834.4852f, 48.37031f, 0.8028514f },
38 { 2527.017f, 829.9793f, 48.06498f, 0.6981317f },
39 // 7351 Tomb Reaver
40 { 2542.818f, 904.9359f, 46.80911f, 4.642576f },
41 { 2543.287f, 911.2448f, 46.32785f, 0.6806784f },
42 { 2489.083f, 806.5914f, 43.21102f, 3.682645f },
43 { 2486.828f, 802.8737f, 43.19883f, 2.9147f },
44 // 7355 Tuten'kash
45 { 2487.939f, 804.2224f, 43.10735f, 1.692969f }
46};
47
49{
50public:
52
54 {
56 {
59 gongWave = 0;
60 fiendsKilled = 0;
61 reaversKilled = 0;
65 }
66
67 void OnGameObjectCreate(GameObject* gameObject) override
68 {
69 switch (gameObject->GetEntry())
70 {
71 case GO_GONG:
72 goGongGUID = gameObject->GetGUID();
75 break;
80 gameObject->Delete();
81 break;
82 default:
83 break;
84 }
85 }
86
87 bool SetBossState(uint32 type, EncounterState state) override
88 {
89 if (!InstanceScript::SetBossState(type, state))
90 return false;
91
92 switch (type)
93 {
94 case DATA_TUTEN_KASH:
96 case DATA_GLUTTON:
98 case DATA_GONG:
99 case DATA_WAVE:
101 break;
102 default:
103 break;
104 }
105 return true;
106 }
107
108 void SetData(uint32 type, uint32 data) override
109 {
110 if (type == DATA_WAVE)
111 {
112 switch (data)
113 {
114 case IN_PROGRESS:
115 {
117 go->SetFlag(GO_FLAG_NOT_SELECTABLE);
118
119 switch (gongWave)
120 {
121 case 0:
122 summonLowRange = 0;
123 summonHighRange = 10;
125 break;
126 case 1:
127 summonLowRange = 10;
128 summonHighRange = 14;
130 break;
131 case 2:
132 summonLowRange = 14;
133 summonHighRange = 15;
135 break;
136 }
137
139 for (uint8 i = summonLowRange; i < summonHighRange; ++i)
141 creature->GetMotionMaster()->MovePoint(0, 2533.479f + float(irand(-5, 5)), 870.020f + float(irand(-5, 5)), 47.678f);
142
143 ++gongWave;
144 break;
145 }
146 case NPC_TOMB_FIEND:
147 if (++fiendsKilled == 10)
148 {
149 fiendsKilled = 0;
151 go->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
152 }
153 break;
154 case NPC_TOMB_REAVER:
155 if (++reaversKilled == 4)
156 {
157 reaversKilled = 0;
159 go->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
160 }
161 break;
162 }
163 }
164 }
165
166 protected:
174 };
175
177 {
179 }
180};
181
183{
185}
uint8_t uint8
Definition: Define.h:144
uint16_t uint16
Definition: Define.h:143
uint32_t uint32
Definition: Define.h:142
EncounterState
@ IN_PROGRESS
@ DONE
int32 irand(int32 min, int32 max)
Definition: Random.cpp:35
@ GO_FLAG_NOT_SELECTABLE
#define DataHeader
uint32 const EncounterCount
void Delete()
void SetFlag(GameObjectFlags flags)
Definition: GameObject.h:274
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
InstanceMap * instance
EncounterState GetBossState(uint32 id) const
void SetHeaders(std::string const &dataHeaders)
GameObject * GetGameObject(ObjectGuid const &guid)
Definition: Map.cpp:3489
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
Definition: Object.cpp:2025
InstanceScript * GetInstanceScript(InstanceMap *map) const override
void AddSC_instance_razorfen_downs()
Position const PosSummonTutenkash[15]
#define RFDScriptName
@ GO_IDOL_CUP_FIRE
@ GO_IDOL_OVEN_FIRE
@ GO_IDOL_MOUTH_FIRE
@ GO_GONG
@ NPC_TOMB_FIEND
@ NPC_TUTEN_KASH
@ NPC_TOMB_REAVER
@ DATA_AMNENNAR_THE_COLD_BRINGER
@ DATA_GONG
@ DATA_MORDRESH_FIRE_EYE
@ DATA_TUTEN_KASH
@ DATA_GLUTTON
@ DATA_EXTINGUISHING_THE_IDOL
@ DATA_WAVE