TrinityCore
instance_razorfen_kraul.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/* ScriptData
19SDName: Instance_Razorfen_Kraul
20SD%Complete:
21SDComment:
22SDCategory: Razorfen Kraul
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "GameObject.h"
27#include "InstanceScript.h"
28#include "Map.h"
29#include "Unit.h"
30#include "razorfen_kraul.h"
31
32#define WARD_KEEPERS_NR 2
33
34static constexpr DungeonEncounterData Encounters[] =
35{
36 { BOSS_HUNTER_BONETUSK, { { 1656 } } },
37 { BOSS_ROOGUG, { { 438 } } },
38 { BOSS_WARLORD_RAMTUSK, { { 1659 } } },
39 { BOSS_GROYAT_THE_BLIND_HUNTER, { { 1660 } } },
40 { BOSS_CHARLGA_RAZORFLANK, { { 1661 } } },
41};
42
44{
45public:
47
49 {
51 }
52
54 {
56 {
61 }
62
65
66 void OnUnitDeath(Unit* unit) override
67 {
68 switch (unit->GetEntry())
69 {
75 default: break;
76 }
77 }
78
79 void OnGameObjectCreate(GameObject* go) override
80 {
81 switch (go->GetEntry())
82 {
83 case 21099: DoorWardGUID = go->GetGUID(); break;
84 case 20920: go->SetFaction(FACTION_NONE); break; // big fat fugly hack
85 }
86 }
87
88 void Update(uint32 /*diff*/) override
89 {
92 {
93 go->SetFlag(GO_FLAG_IN_USE | GO_FLAG_NODESPAWN);
94 go->SetGoState(GO_STATE_ACTIVE);
95 }
96 }
97
98 void SetData(uint32 type, uint32 /*data*/) override
99 {
100 switch (type)
101 {
102 case EVENT_WARD_KEEPER: WardKeeperDeath++; break;
103 }
104 }
105
106 };
107
108};
109
111{
113}
uint32_t uint32
Definition: Define.h:142
@ DONE
@ GO_FLAG_NODESPAWN
@ GO_FLAG_IN_USE
@ FACTION_NONE
@ GO_STATE_ACTIVE
#define DataHeader
void SetFaction(uint32 faction) override
Definition: GameObject.h:389
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
void LoadDungeonEncounterData(T const &encounters)
InstanceMap * instance
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
Definition: Unit.h:627
InstanceScript * GetInstanceScript(InstanceMap *map) const override
void AddSC_instance_razorfen_kraul()
static constexpr DungeonEncounterData Encounters[]
#define WARD_KEEPERS_NR
#define MAX_ENCOUNTER
#define EVENT_WARD_KEEPER
@ BOSS_WARLORD_RAMTUSK
@ BOSS_ROOGUG
@ BOSS_HUNTER_BONETUSK
@ BOSS_GROYAT_THE_BLIND_HUNTER
@ BOSS_CHARLGA_RAZORFLANK
#define RFKScriptName
@ NPC_CHARLGA_RAZORFLANK
@ NPC_HUNTER_BONETUSK
@ NPC_WARLORD_RAMTUSK
@ NPC_ROOGUG
@ NPC_GROYAT_THE_BLIND_HUNTER