TrinityCore
Loading...
Searching...
No Matches
instance_serpent_shrine.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 "EventMap.h"
20#include "InstanceScript.h"
21#include "Map.h"
22#include "serpent_shrine.h"
23#include "Unit.h"
24
25/* Serpentshrine cavern encounters:
260 - Hydross The Unstable event
271 - Leotheras The Blind Event
282 - The Lurker Below Event
293 - Fathom-Lord Karathress Event
304 - Morogrim Tidewalker Event
315 - Lady Vashj Event
32*/
33
43
54
55static constexpr DungeonEncounterData encounters[] =
56{
57 { BOSS_HYDROSS_THE_UNSTABLE, {{ 623 }} },
58 { BOSS_THE_LURKER_BELOW, {{ 624 }} },
59 { BOSS_LEOTHERAS_THE_BLIND, {{ 625 }} },
60 { BOSS_FATHOM_LORD_KARATHRESS, {{ 626 }} },
61 { BOSS_MOROGRIM_TIDEWALKER, {{ 627 }} },
62 { BOSS_LADY_VASHJ, {{ 628 }} }
63};
64
66{
67 public:
69
71 {
81
82 void OnUnitDeath(Unit* unit) override
83 {
84 switch (unit->GetEntry())
85 {
89 ++KilledElitesCount; // TODO: spawn Coilfang Frenzy Corpse (21689)
90 break;
91 default:
92 break;
93 }
94 }
95
96 bool SetBossState(uint32 id, EncounterState state) override
97 {
98 if (!InstanceScript::SetBossState(id, state))
99 return false;
100
101 switch (id)
102 {
104 if (state == FAIL)
105 Events.ScheduleEvent(EVENT_RESPAWN_STRANGE_POOL, 15s);
106 break;
107 default:
108 break;
109 }
110
111 return true;
112 }
113
114 uint32 GetData(uint32 type) const override
115 {
116 if (type == DATA_KILLED_ELITES)
117 return KilledElitesCount;
118
119 return 0;
120 }
121
122 void Update(uint32 diff) override
123 {
124 Events.Update(diff);
125
126 if (Events.ExecuteEvent() == EVENT_RESPAWN_STRANGE_POOL)
128 }
129
130 protected:
133 };
134
139};
140
uint32_t uint32
Definition Define.h:154
EncounterState
@ FAIL
@ NOT_STARTED
#define DataHeader
uint32 const EncounterCount
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
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)
uint32 GetEntry() const
Definition Object.h:89
Definition Unit.h:647
InstanceScript * GetInstanceScript(InstanceMap *map) const override
static constexpr ObjectData creatureData[]
static constexpr ObjectData gameObjectData[]
void AddSC_instance_serpentshrine_cavern()
static constexpr DungeonEncounterData encounters[]
@ GO_SHIELD_GENERATOR_4
@ GO_SHIELD_GENERATOR_1
@ GO_SHIELD_GENERATOR_2
@ GO_BRIDGE_PART_2
@ GO_BRIDGE_PART_3
@ GO_SHIELD_GENERATOR_3
@ GO_BRIDGE_PART_1
@ MIN_KILLED_ELITES
@ DATA_SHIELD_GENERATOR_1
@ DATA_CARIBDIS
@ DATA_KILLED_ELITES
@ DATA_SHIELD_GENERATOR_2
@ DATA_BRIDGE_PART_2
@ DATA_TIDALVESS
@ DATA_BRIDGE_PART_1
@ DATA_SHIELD_GENERATOR_3
@ DATA_BRIDGE_PART_3
@ DATA_SHARKKIS
@ DATA_SHIELD_GENERATOR_4
@ EVENT_RESPAWN_STRANGE_POOL
@ NPC_SHARKKIS
@ NPC_CARIBDIS
@ NPC_COILFANG_PRIESTESS
@ NPC_LADY_VASHJ
@ NPC_LEOTHERAS_THE_BLIND
@ NPC_KARATHRESS
@ NPC_TIDALVESS
@ NPC_COILFANG_SHATTERER
#define SSCScriptName
@ BOSS_FATHOM_LORD_KARATHRESS
@ BOSS_LADY_VASHJ
@ BOSS_THE_LURKER_BELOW
@ BOSS_HYDROSS_THE_UNSTABLE
@ BOSS_MOROGRIM_TIDEWALKER
@ BOSS_LEOTHERAS_THE_BLIND