TrinityCore
Loading...
Searching...
No Matches
instance_sunwell_plateau.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 "AreaBoundary.h"
20#include "InstanceScript.h"
21#include "Log.h"
22#include "Map.h"
23#include "Player.h"
24#include "sunwell_plateau.h"
25
26/* Sunwell Plateau:
270 - Kalecgos and Sathrovarr
281 - Brutallus
292 - Felmyst
303 - Eredar Twins (Alythess and Sacrolash)
314 - M'uru
325 - Kil'Jaeden
33*/
34
44
61
63{
64 { DATA_KALECGOS, new BoundaryUnionBoundary(new CircleBoundary(Position(1704.9f, 928.4f), 34.0f), new RectangleBoundary(1689.2f, 1713.3f, 762.2f, 1074.8f)) }
65};
66
67static constexpr DungeonEncounterData encounters[] =
68{
69 { DATA_KALECGOS, {{ 724 }} },
70 { DATA_BRUTALLUS, {{ 725 }} },
71 { DATA_FELMYST, {{ 726 }} },
72 { DATA_EREDAR_TWINS, {{ 727 }} },
73 { DATA_MURU, {{ 728 }} },
74 { DATA_KILJAEDEN, {{ 729 }} }
75};
76
78{
79 public:
81
83 {
93
94 Player const* GetPlayerInMap() const
95 {
96 Map::PlayerList const& players = instance->GetPlayers();
97
98 if (!players.empty())
99 {
100 for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
101 {
102 Player* player = itr->GetSource();
103 if (player && !player->HasAura(45839))
104 return player;
105 }
106 }
107 else
108 TC_LOG_DEBUG("scripts", "Instance Sunwell Plateau: GetPlayerInMap, but PlayerList is empty!");
109
110 return nullptr;
111 }
112
113 ObjectGuid GetGuidData(uint32 id) const override
114 {
115 switch (id)
116 {
117 case DATA_PLAYER_GUID:
118 {
119 Player const* target = GetPlayerInMap();
120 return target ? target->GetGUID() : ObjectGuid::Empty;
121 }
122 default:
123 break;
124 }
125 return ObjectGuid::Empty;
126 }
127 };
128
130 {
132 }
133};
134
uint32_t uint32
Definition Define.h:154
#define TC_LOG_DEBUG(filterType__, message__,...)
Definition Log.h:181
#define DataHeader
uint32 const EncounterCount
ObjectGuid const & GetGUID() const
Definition BaseEntity.h:163
void SetBossNumber(uint32 number)
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)
void LoadDoorData(std::span< DoorData const > data)
void LoadBossBoundaries(BossBoundaryData const &data)
bool empty() const
Definition LinkedList.h:107
PlayerList const & GetPlayers() const
Definition Map.h:403
static ObjectGuid const Empty
Definition ObjectGuid.h:314
iterator end()
Definition RefManager.h:36
iterator begin()
Definition RefManager.h:35
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition Unit.cpp:4804
InstanceScript * GetInstanceScript(InstanceMap *map) const override
static constexpr ObjectData creatureData[]
void AddSC_instance_sunwell_plateau()
static constexpr DoorData doorData[]
BossBoundaryData const boundaries
static constexpr DungeonEncounterData encounters[]
@ NPC_KALECGOS
@ DATA_KALECGOS
@ GO_BOSS_COLLISION_2
@ GO_FORCE_FIELD
@ GO_FIRE_BARRIER
@ GO_MURUS_GATE_2
@ GO_MURUS_GATE_1
@ GO_BOSS_COLLISION_1
#define SunwellPlateauScriptName
@ DATA_KILJAEDEN_CONTROLLER
@ DATA_BRUTALLUS
@ DATA_EREDAR_TWINS
@ DATA_MURU
@ DATA_SATHROVARR
@ DATA_KILJAEDEN
@ DATA_FELMYST
@ DATA_ALYTHESS
@ DATA_ANVEENA
@ DATA_KALECGOS_HUMAN
@ DATA_SACROLASH
@ DATA_KALECGOS_DRAGON
@ DATA_PLAYER_GUID
@ DATA_KALECGOS_KJ
@ DATA_MADRIGOSA
@ NPC_LADY_SACROLASH
@ NPC_KALECGOS_HUMAN
@ NPC_KILJAEDEN_CONTROLLER
@ NPC_GRAND_WARLOCK_ALYTHESS
@ NPC_MURU
@ NPC_BRUTALLUS
@ NPC_ANVEENA
@ NPC_KILJAEDEN
@ NPC_SATHROVARR
@ NPC_FELMYST
@ NPC_KALECGOS_KJ
@ NPC_MADRIGOSA