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
44
56
58{
59 public:
61
63 {
72
73 void OnUnitDeath(Unit* unit) override
74 {
75 switch (unit->GetEntry())
76 {
80 ++KilledElitesCount; // TODO: spawn Coilfang Frenzy Corpse (21689)
81 SaveToDB();
82 break;
83 default:
84 break;
85 }
86 }
87
88 bool SetBossState(uint32 id, EncounterState state) override
89 {
90 if (!InstanceScript::SetBossState(id, state))
91 return false;
92
93 switch (id)
94 {
96 if (state == FAIL)
97 Events.ScheduleEvent(EVENT_RESPAWN_STRANGE_POOL, 15s);
98 break;
99 default:
100 break;
101 }
102
103 return true;
104 }
105
106 uint32 GetData(uint32 type) const override
107 {
108 if (type == DATA_KILLED_ELITES)
109 return KilledElitesCount;
110
111 return 0;
112 }
113
114 void Update(uint32 diff) override
115 {
116 Events.Update(diff);
117
118 if (Events.ExecuteEvent() == EVENT_RESPAWN_STRANGE_POOL)
120 }
121
122 void WriteSaveDataMore(std::ostringstream& stream) override
123 {
124 stream << KilledElitesCount;
125 }
126
127 void ReadSaveDataMore(std::istringstream& stream) override
128 {
129 stream >> KilledElitesCount;
130 }
131
132 protected:
135 };
136
141};
142
uint32_t uint32
Definition Define.h:133
EncounterState
@ FAIL
@ NOT_STARTED
#define DataHeader
uint32 const EncounterCount
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
void SetHeaders(std::string const &dataHeaders)
void LoadObjectData(ObjectData const *creatureData, ObjectData const *gameObjectData)
uint32 GetEntry() const
Definition Object.h:81
Definition Unit.h:783
InstanceScript * GetInstanceScript(InstanceMap *map) const override
static constexpr ObjectData creatureData[]
static constexpr ObjectData gameObjectData[]
void AddSC_instance_serpentshrine_cavern()
@ 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_LEOTHERAS_THE_BLIND