TrinityCore
Loading...
Searching...
No Matches
instance_scarlet_monastery.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 "scarlet_monastery.h"
19#include "Creature.h"
20#include "CreatureAI.h"
21#include "EventMap.h"
22#include "GameObject.h"
23#include "InstanceScript.h"
24#include "Map.h"
25#include "ScriptMgr.h"
26#include "TemporarySummon.h"
27
28Position const BunnySpawnPosition = { 1776.27f, 1348.74f, 19.20f };
29Position const EarthBunnySpawnPosition = { 1765.28f, 1347.46f, 18.55f, 6.17f };
30Position const HeadlessHorsemanSpawnPosition = { 1765.00f, 1347.00f, 15.00f };
31Position const HeadlessHorsemanHeadSpawnPosition = { 1788.54f, 1348.05f, 18.88f }; // Guessed
32
44
51
52static constexpr DungeonEncounterData Encounters[] =
53{
54 { DATA_INTERROGATOR_VISHAS, { { 444 } } },
55 { DATA_BLOODMAGE_THALNOS, { { 2818 } } },
56 { DATA_HOUNDMASTER_LOKSEY, { { 446 } } },
57 { DATA_ARCANIST_DOAN, { { 447 } } },
58 { DATA_HEROD, { { 448 } } },
59 { DATA_HIGH_INQUISITOR_FAIRBANKS, { { 449 } } },
60 { DATA_MOGRAINE_AND_WHITE_EVENT, { { 450 } } },
61};
62
64{
65 public:
67
69 {
78
95
96 void SetData(uint32 type, uint32 data) override
97 {
98 switch (type)
99 {
103 break;
105 _horsemanState = data;
106 break;
110 if (Creature* bunny = GetCreature(data))
111 bunny->DespawnOrUnsummon();
112 break;
113 default:
114 break;
115 }
116 }
117
118 uint32 GetData(uint32 type) const override
119 {
120 switch (type)
121 {
123 return _horsemanState;
124 default:
125 return 0;
126 }
127 }
128
129 void Update(uint32 diff) override
130 {
131 if (_events.Empty())
132 return;
133
134 _events.Update(diff);
135
136 while (uint32 eventId = _events.ExecuteEvent())
137 {
138 switch (eventId)
139 {
141 if (Creature* earthBunny = GetCreature(DATA_EARTH_BUNNY))
142 earthBunny->CastSpell(earthBunny, SPELL_EARTH_EXPLOSION);
143 break;
146 horseman->AI()->DoAction(ACTION_HORSEMAN_EVENT_START);
147 break;
150 if (GameObject* gob = GetGameObject(data))
151 gob->RemoveFromWorld();
152 break;
153 default:
154 break;
155 }
156 }
157 }
158
159 private:
162 };
163
165 {
167 }
168};
169
uint32_t uint32
Definition Define.h:154
@ IN_PROGRESS
@ NOT_STARTED
@ GO_FLAG_NOT_SELECTABLE
#define DataHeader
uint32 const EncounterCount
uint32 ExecuteEvent()
Definition EventMap.cpp:77
void Update(uint32 time)
Definition EventMap.h:61
bool Empty() const
Definition EventMap.h:89
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition EventMap.cpp:40
void SetBossNumber(uint32 number)
Creature * GetCreature(uint32 type)
void LoadObjectData(std::span< ObjectData const > creatureData, std::span< ObjectData const > gameObjectData)
InstanceMap * instance
void SetHeaders(std::string_view dataHeaders)
void LoadDungeonEncounterData(std::span< DungeonEncounterData const > encounters)
GameObject * GetGameObject(uint32 type)
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, Milliseconds duration=0ms, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty, SmoothPhasingInfo const *smoothPhasingInfo=nullptr)
Definition Object.cpp:1186
InstanceScript * GetInstanceScript(InstanceMap *map) const override
static constexpr ObjectData creatureData[]
Position const HeadlessHorsemanHeadSpawnPosition
static constexpr DungeonEncounterData Encounters[]
void AddSC_instance_scarlet_monastery()
Position const EarthBunnySpawnPosition
static constexpr ObjectData gameObjectData[]
Position const BunnySpawnPosition
Position const HeadlessHorsemanSpawnPosition
@ SPELL_EARTH_EXPLOSION
@ EVENT_ACTIVE_EARTH_EXPLOSION
@ EVENT_SPAWN_HEADLESS_HORSEMAN
@ EVENT_DESPAWN_OBJECTS
@ ACTION_HORSEMAN_EVENT_START
@ GO_LOOSELY_TURNED_SOIL
@ GO_PUMPKIN_SHRINE
@ GO_HIGH_INQUISITORS_DOOR
@ DATA_HOUNDMASTER_LOKSEY
@ DATA_MOGRAINE
@ DATA_PREPARE_RESET
@ DATA_WHITEMANE
@ DATA_HORSEMAN_HEAD
@ DATA_BLOODMAGE_THALNOS
@ DATA_ARCANIST_DOAN
@ DATA_INTERROGATOR_VISHAS
@ DATA_HIGH_INQUISITOR_FAIRBANKS
@ DATA_HEADLESS_HORSEMAN
@ DATA_VORREL
@ DATA_HEROD
@ DATA_LOOSELY_TURNED_SOIL
@ DATA_MOGRAINE_AND_WHITE_EVENT
@ DATA_HORSEMAN_EVENT_STATE
@ DATA_FLAME_BUNNY
@ DATA_EARTH_BUNNY
@ DATA_HIGH_INQUISITORS_DOOR
@ DATA_START_HORSEMAN_EVENT
@ DATA_THOMAS
@ DATA_PUMPKIN_SHRINE
@ NPC_VORREL
@ NPC_HEADLESS_HORSEMAN_HEAD
@ NPC_HEADLESS_HORSEMAN
@ NPC_FLAME_BUNNY
@ NPC_MOGRAINE
@ NPC_SIR_THOMAS
@ NPC_WHITEMANE
@ NPC_EARTH_BUNNY
#define SMScriptName