TrinityCore
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
36{
44};
45
47{
61 { 0, 0 } // END
62};
63
65{
66 { DATA_KALECGOS, new BoundaryUnionBoundary(new CircleBoundary(Position(1704.9f, 928.4f), 34.0), new RectangleBoundary(1689.2f, 1713.3f, 762.2f, 1074.8f)) }
67};
68
70{
71 { DATA_KALECGOS, {{ 724 }} },
72 { DATA_BRUTALLUS, {{ 725 }} },
73 { DATA_FELMYST, {{ 726 }} },
74 { DATA_EREDAR_TWINS, {{ 727 }} },
75 { DATA_MURU, {{ 728 }} },
76 { DATA_KILJAEDEN, {{ 729 }} }
77};
78
80{
81 public:
83
85 {
87 {
94 }
95
96 Player const* GetPlayerInMap() const
97 {
98 Map::PlayerList const& players = instance->GetPlayers();
99
100 if (!players.isEmpty())
101 {
102 for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
103 {
104 Player* player = itr->GetSource();
105 if (player && !player->HasAura(45839))
106 return player;
107 }
108 }
109 else
110 TC_LOG_DEBUG("scripts", "Instance Sunwell Plateau: GetPlayerInMap, but PlayerList is empty!");
111
112 return nullptr;
113 }
114
115 ObjectGuid GetGuidData(uint32 id) const override
116 {
117 switch (id)
118 {
119 case DATA_PLAYER_GUID:
120 {
121 Player const* target = GetPlayerInMap();
122 return target ? target->GetGUID() : ObjectGuid::Empty;
123 }
124 default:
125 break;
126 }
127 return ObjectGuid::Empty;
128 }
129 };
130
132 {
134 }
135};
136
138{
140}
uint32_t uint32
Definition: Define.h:142
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:156
#define DataHeader
uint32 const EncounterCount
void SetBossNumber(uint32 number)
void LoadDungeonEncounterData(T const &encounters)
InstanceMap * instance
void LoadDoorData(DoorData const *data)
void LoadBossBoundaries(BossBoundaryData const &data)
void SetHeaders(std::string const &dataHeaders)
void LoadObjectData(ObjectData const *creatureData, ObjectData const *gameObjectData)
bool isEmpty() const
Definition: LinkedList.h:110
iterator end()
Definition: MapRefManager.h:35
iterator begin()
Definition: MapRefManager.h:34
PlayerList const & GetPlayers() const
Definition: Map.h:367
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Definition: Unit.cpp:4664
InstanceScript * GetInstanceScript(InstanceMap *map) const override
ObjectData const creatureData[]
DoorData const doorData[]
void AddSC_instance_sunwell_plateau()
BossBoundaryData const boundaries
DungeonEncounterData const 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