TrinityCore
instance_wailing_caverns.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_Wailing_Caverns
20SD%Complete: 99
21SDComment: Everything seems to work, still need some checking
22SDCategory: Wailing Caverns
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "Creature.h"
27#include "InstanceScript.h"
28#include "Map.h"
29#include "wailing_caverns.h"
30
31static constexpr DungeonEncounterData Encounters[] =
32{
33 { BOSS_LADY_ANACONDRA, {{ 585 } } },
34 { BOSS_LORD_COBRAHN, {{ 586 } } },
35 { BOSS_KRESH, {{ 587 } } },
36 { BOSS_LORD_PYTHAS, {{ 588 } } },
37 { BOSS_SKUM, {{ 589 } } },
38 { BOSS_LORD_SERPENTIS, {{ 590 } } },
39 { BOSS_VERDAN_THE_EVERLIVING, {{ 591 } } },
40 { BOSS_MUTANUS_THE_DEVOURER, {{ 592 } } },
41};
42
44{
45public:
47
49 {
51 }
52
54 {
56 {
60
61 yelled = false;
62 }
63
64 bool yelled;
66
67 void OnCreatureCreate(Creature* creature) override
68 {
69 if (creature->GetEntry() == DATA_NARALEX)
70 NaralexGUID = creature->GetGUID();
71 }
72
73 void OnUnitDeath(Unit* unit) override
74 {
75 switch (unit->GetEntry())
76 {
78 case NPC_SKUM: SetBossState(BOSS_SKUM, DONE); break;
80 default:
81 break;
82 }
83 }
84
85 void SetData(uint32 type, uint32 data) override
86 {
87 switch (type)
88 {
98 case TYPE_NARALEX_YELLED: yelled = true; break;
99 default: break;
100 }
101 }
102
103 uint32 GetData(uint32 type) const override
104 {
105 switch (type)
106 {
111 case TYPE_NARALEX_EVENT: return GetBossState(4);
112 case TYPE_NARALEX_PART1: return GetBossState(5);
113 case TYPE_NARALEX_PART2: return GetBossState(6);
114 case TYPE_NARALEX_PART3: return GetBossState(7);
116 case TYPE_NARALEX_YELLED: return yelled;
117 default: break;
118 }
119 return 0;
120 }
121
122 ObjectGuid GetGuidData(uint32 data) const override
123 {
124 if (data == DATA_NARALEX)return NaralexGUID;
125 return ObjectGuid::Empty;
126 }
127 };
128
129};
130
132{
134}
uint32_t uint32
Definition: Define.h:142
EncounterState
@ DONE
#define DataHeader
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
void LoadDungeonEncounterData(T const &encounters)
EncounterState GetBossState(uint32 id) const
void SetHeaders(std::string const &dataHeaders)
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
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
#define MAX_ENCOUNTER
static constexpr DungeonEncounterData Encounters[]
void AddSC_instance_wailing_caverns()
@ TYPE_LADY_ANACONDRA
@ TYPE_NARALEX_PART1
@ DATA_NARALEX
@ TYPE_NARALEX_EVENT
@ TYPE_LORD_SERPENTIS
@ TYPE_NARALEX_PART2
@ TYPE_NARALEX_PART3
@ TYPE_MUTANUS_THE_DEVOURER
@ TYPE_LORD_COBRAHN
@ TYPE_LORD_PYTHAS
@ TYPE_NARALEX_YELLED
@ BOSS_MUTANUS_THE_DEVOURER
@ BOSS_LORD_COBRAHN
@ BOSS_KRESH
@ BOSS_LORD_PYTHAS
@ BOSS_VERDAN_THE_EVERLIVING
@ BOSS_LORD_SERPENTIS
@ BOSS_LADY_ANACONDRA
@ BOSS_SKUM
#define WCScriptName
@ NPC_VERDAN_THE_EVERLIVING
@ NPC_SKUM
@ NPC_KRESH