TrinityCore
Loading...
Searching...
No Matches
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#include "ScriptMgr.h"
19#include "Creature.h"
20#include "CreatureAI.h"
21#include "InstanceScript.h"
22#include "wailing_caverns.h"
23
24static constexpr ObjectData creatureData[] =
25{
28};
29
30static constexpr DungeonEncounterData Encounters[] =
31{
32 { DATA_LADY_ANACONDRA, {{ 585 } } },
33 { DATA_LORD_COBRAHN, {{ 586 } } },
34 { DATA_KRESH, {{ 587 } } },
35 { DATA_LORD_PYTHAS, {{ 588 } } },
36 { DATA_SKUM, {{ 589 } } },
37 { DATA_LORD_SERPENTIS, {{ 590 } } },
38 { DATA_VERDAN_THE_EVERLIVING, {{ 591 } } },
39 { DATA_MUTANUS_THE_DEVOURER, {{ 592 } } },
40};
41
43{
44public:
46
51
53 {
61
62 void OnUnitDeath(Unit* unit) override
63 {
64 switch (unit->GetEntry())
65 {
67 case NPC_SKUM: SetBossState(DATA_SKUM, DONE); break;
69 default:
70 break;
71 }
72 }
73
74 bool SetBossState(uint32 type, EncounterState state) override
75 {
76 if (!InstanceScript::SetBossState(type, state))
77 return false;
78
79 switch (type)
80 {
85 if (state == DONE)
86 {
89 {
90 if (Creature* disciple = GetCreature(DATA_DISCIPLE))
91 disciple->AI()->DoAction(ACTION_ALL_DONE);
92 }
93 }
94 break;
95 default:
96 break;
97 }
98 return true;
99 }
100 };
101};
102
uint32_t uint32
Definition Define.h:154
EncounterState
@ DONE
#define DataHeader
uint32 const EncounterCount
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
Creature * GetCreature(uint32 type)
void LoadObjectData(std::span< ObjectData const > creatureData, std::span< ObjectData const > gameObjectData)
void SetHeaders(std::string_view dataHeaders)
void LoadDungeonEncounterData(std::span< DungeonEncounterData const > encounters)
EncounterState GetBossState(uint32 id) const
uint32 GetEntry() const
Definition Object.h:89
Definition Unit.h:647
InstanceScript * GetInstanceScript(InstanceMap *map) const override
static constexpr ObjectData creatureData[]
static constexpr DungeonEncounterData Encounters[]
void AddSC_instance_wailing_caverns()
@ DATA_NARALEX
@ DATA_SKUM
@ DATA_LORD_PYTHAS
@ DATA_DISCIPLE
@ DATA_LORD_SERPENTIS
@ DATA_LADY_ANACONDRA
@ DATA_KRESH
@ DATA_VERDAN_THE_EVERLIVING
@ DATA_LORD_COBRAHN
@ DATA_MUTANUS_THE_DEVOURER
@ ACTION_ALL_DONE
#define WCScriptName
@ NPC_DISCIPLE
@ NPC_VERDAN_THE_EVERLIVING
@ NPC_SKUM
@ NPC_KRESH
@ NPC_NARALEX