TrinityCore
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
34{
43 { 0, 0 } // END
44};
45
47{
51 { 0, 0 } // END
52};
53
54static constexpr DungeonEncounterData Encounters[] =
55{
56 { DATA_INTERROGATOR_VISHAS, { { 444 } } },
57 { DATA_BLOODMAGE_THALNOS, { { 2818 } } },
58 { DATA_HOUNDMASTER_LOKSEY, { { 446 } } },
59 { DATA_ARCANIST_DOAN, { { 447 } } },
60 { DATA_HEROD, { { 448 } } },
61 { DATA_HIGH_INQUISITOR_FAIRBANKS, { { 449 } } },
62 { DATA_MOGRAINE_AND_WHITE_EVENT, { { 450 } } },
63};
64
66{
67 public:
69
71 {
73 {
79 }
80
82 {
85 if (GameObject* gob = GetGameObject(data))
86 gob->SetFlag(GO_FLAG_NOT_SELECTABLE);
87
94 if (Creature* thomas = GetCreature(DATA_THOMAS))
95 thomas->DespawnOrUnsummon();
96 }
97
98 void SetData(uint32 type, uint32 data) override
99 {
100 switch (type)
101 {
105 break;
107 _horsemanState = data;
108 break;
112 if (Creature* bunny = GetCreature(data))
113 bunny->DespawnOrUnsummon();
114 break;
115 default:
116 break;
117 }
118 }
119
120 uint32 GetData(uint32 type) const override
121 {
122 switch (type)
123 {
125 return _horsemanState;
126 default:
127 return 0;
128 }
129 }
130
131 void Update(uint32 diff) override
132 {
133 if (_events.Empty())
134 return;
135
136 _events.Update(diff);
137
138 while (uint32 eventId = _events.ExecuteEvent())
139 {
140 switch (eventId)
141 {
143 if (Creature* earthBunny = GetCreature(DATA_EARTH_BUNNY))
144 earthBunny->CastSpell(earthBunny, SPELL_EARTH_EXPLOSION);
145 break;
148 horseman->AI()->DoAction(ACTION_HORSEMAN_EVENT_START);
149 break;
152 if (GameObject* gob = GetGameObject(data))
153 gob->RemoveFromWorld();
154 break;
155 default:
156 break;
157 }
158 }
159 }
160
161 private:
164 };
165
167 {
169 }
170};
171
173{
175}
uint32_t uint32
Definition: Define.h:142
@ IN_PROGRESS
@ NOT_STARTED
@ GO_FLAG_NOT_SELECTABLE
#define DataHeader
uint32 const EncounterCount
uint32 ExecuteEvent()
Definition: EventMap.cpp:73
void Update(uint32 time)
Definition: EventMap.h:56
bool Empty() const
Definition: EventMap.h:84
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Definition: EventMap.cpp:36
void SetBossNumber(uint32 number)
Creature * GetCreature(uint32 type)
void LoadDungeonEncounterData(T const &encounters)
InstanceMap * instance
GameObject * GetGameObject(uint32 type)
void SetHeaders(std::string const &dataHeaders)
void LoadObjectData(ObjectData const *creatureData, ObjectData const *gameObjectData)
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:1836
InstanceScript * GetInstanceScript(InstanceMap *map) const override
ObjectData const gameObjectData[]
Position const HeadlessHorsemanHeadSpawnPosition
ObjectData const creatureData[]
static constexpr DungeonEncounterData Encounters[]
void AddSC_instance_scarlet_monastery()
Position const EarthBunnySpawnPosition
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