TrinityCore
Loading...
Searching...
No Matches
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 "ObjectMgr.h"
24#include "razorfen_downs.h"
25#include "TemporarySummon.h"
26
28{
29 // 7349 Tomb Fiend
30 { 2487.339f, 805.9111f, 43.08361f, 2.844887f },
31 { 2485.405f, 804.1145f, 43.68511f, 3.054326f },
32 { 2488.431f, 801.2809f, 42.70374f, 4.29351f },
33 { 2489.914f, 804.7949f, 43.25175f, 1.658063f },
34 { 2541.246f, 907.0941f, 46.64201f, 2.024582f },
35 { 2544.701f, 907.6331f, 46.38007f, 1.605703f },
36 { 2541.49f, 911.1756f, 46.26493f, 4.817109f },
37 { 2544.693f, 912.8887f, 46.39912f, 2.129302f },
38 { 2524.036f, 834.4852f, 48.37031f, 0.8028514f },
39 { 2527.017f, 829.9793f, 48.06498f, 0.6981317f },
40 // 7351 Tomb Reaver
41 { 2542.818f, 904.9359f, 46.80911f, 4.642576f },
42 { 2543.287f, 911.2448f, 46.32785f, 0.6806784f },
43 { 2489.083f, 806.5914f, 43.21102f, 3.682645f },
44 { 2486.828f, 802.8737f, 43.19883f, 2.9147f },
45 // 7355 Tuten'kash
46 { 2487.939f, 804.2224f, 43.10735f, 1.692969f }
47};
48
50{
51public:
53
55 {
67
68 void OnGameObjectCreate(GameObject* gameObject) override
69 {
70 switch (gameObject->GetEntry())
71 {
72 case GO_GONG:
73 goGongGUID = gameObject->GetGUID();
76 break;
81 gameObject->Delete();
82 break;
83 default:
84 break;
85 }
86 }
87
88 bool SetBossState(uint32 type, EncounterState state) override
89 {
90 if (!InstanceScript::SetBossState(type, state))
91 return false;
92
93 switch (type)
94 {
95 case DATA_TUTEN_KASH:
97 case DATA_GLUTTON:
99 case DATA_GONG:
100 case DATA_WAVE:
102 break;
103 default:
104 break;
105 }
106 return true;
107 }
108
109 void SetData(uint32 type, uint32 data) override
110 {
111 if (type == DATA_WAVE)
112 {
113 switch (data)
114 {
115 case IN_PROGRESS:
116 {
118 go->SetFlag(GO_FLAG_NOT_SELECTABLE);
119
120 switch (gongWave)
121 {
122 case 0:
123 summonLowRange = 0;
124 summonHighRange = 10;
126 break;
127 case 1:
128 summonLowRange = 10;
129 summonHighRange = 14;
131 break;
132 case 2:
133 summonLowRange = 14;
134 summonHighRange = 15;
136 break;
137 }
138
140 {
141 for (uint8 i = summonLowRange; i < summonHighRange; ++i)
142 {
144 creature->GetMotionMaster()->MovePoint(0, 2533.479f + float(irand(-5, 5)), 870.020f + float(irand(-5, 5)), 47.678f);
145 }
146 }
147
148 ++gongWave;
149 break;
150 }
151 case NPC_TOMB_FIEND:
152 if (++fiendsKilled == 10)
153 {
154 fiendsKilled = 0;
156 go->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
157 }
158 break;
159 case NPC_TOMB_REAVER:
160 if (++reaversKilled == 4)
161 {
162 reaversKilled = 0;
164 go->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
165 }
166 break;
167 }
168 }
169 }
170
171 protected:
179 };
180
182 {
184 }
185};
186
uint8_t uint8
Definition Define.h:135
uint16_t uint16
Definition Define.h:134
uint32_t uint32
Definition Define.h:133
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:171
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:4430
void MovePoint(uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={})
uint32 GetEntry() const
Definition Object.h:81
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
MotionMaster * GetMotionMaster()
Definition Unit.h:1667
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:1992
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