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 "Creature.h"
21#include "InstanceScript.h"
22#include "Log.h"
23#include "Map.h"
24#include "Player.h"
25#include "sunwell_plateau.h"
26
27/* Sunwell Plateau:
280 - Kalecgos and Sathrovarr
291 - Brutallus
302 - Felmyst
313 - Eredar Twins (Alythess and Sacrolash)
324 - M'uru
335 - Kil'Jaeden
34*/
35
46
66
68{
70 { 0, 0 } //END
71};
72
74{
75 { DATA_KALECGOS, new BoundaryUnionBoundary(new CircleBoundary(Position(1704.9f, 928.4f), 34.0), new RectangleBoundary(1689.2f, 1713.3f, 762.2f, 1074.8f)) }
76};
77
79{
80 public:
82
84 {
93
94 Player const* GetPlayerInMap() const
95 {
96 Map::PlayerList const& players = instance->GetPlayers();
97
98 if (!players.isEmpty())
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 void OnCreatureCreate(Creature* creature) override
114 {
116
117 switch (creature->GetEntry())
118 {
120 EredarTwinsSpawnId[0] = creature->GetSpawnId();
121 break;
123 EredarTwinsSpawnId[1] = creature->GetSpawnId();
124 break;
125 default:
126 break;
127 }
128 }
129
130 uint64 GetData64(uint32 type) const override
131 {
132 switch (type)
133 {
134 case DATA_SACROLASH:
135 return EredarTwinsSpawnId[0];
136 case DATA_ALYTHESS:
137 return EredarTwinsSpawnId[1];
138 default:
139 break;
140 }
141
142 return InstanceScript::GetData64(type);
143 }
144
145 ObjectGuid GetGuidData(uint32 id) const override
146 {
147 switch (id)
148 {
149 case DATA_PLAYER_GUID:
150 {
151 Player const* target = GetPlayerInMap();
152 return target ? target->GetGUID() : ObjectGuid::Empty;
153 }
154 default:
155 break;
156 }
158 }
159
161 };
162
164 {
166 }
167};
168
@ NPC_WORLD_TRIGGER
uint64_t uint64
Definition Define.h:132
uint32_t uint32
Definition Define.h:133
@ DOOR_TYPE_ROOM
@ DOOR_TYPE_PASSAGE
#define TC_LOG_DEBUG(filterType__,...)
Definition Log.h:156
#define DataHeader
uint32 const EncounterCount
ObjectGuid::LowType GetSpawnId() const
Definition Creature.h:83
void SetBossNumber(uint32 number)
virtual void OnCreatureCreate(Creature *creature) override
virtual ObjectGuid GetGuidData(uint32 type) const override
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:108
iterator end()
iterator begin()
PlayerList const & GetPlayers() const
Definition Map.h:448
static ObjectGuid const Empty
Definition ObjectGuid.h:140
uint32 LowType
Definition ObjectGuid.h:142
uint32 GetEntry() const
Definition Object.h:81
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition Unit.cpp:4535
virtual uint64 GetData64(uint32) const
Definition ZoneScript.h:51
InstanceScript * GetInstanceScript(InstanceMap *map) const override
ObjectData const gameObjectData[]
ObjectData const creatureData[]
DoorData const doorData[]
void AddSC_instance_sunwell_plateau()
BossBoundaryData const boundaries
@ NPC_KALECGOS
@ DATA_KALECGOS
@ GO_BOSS_COLLISION_2
@ GO_FORCE_FIELD
@ GO_FIRE_BARRIER
@ GO_MURUS_GATE_2
@ GO_MURUS_GATE_1
@ GO_ICE_BARRIER
@ GO_BOSS_COLLISION_1
#define SunwellPlateauScriptName
@ DATA_KILJAEDEN_CONTROLLER
@ DATA_BRUTALLUS
@ DATA_MURU
@ DATA_SATHROVARR
@ DATA_ICE_BARRIER
@ DATA_KILJAEDEN
@ DATA_FELMYST
@ DATA_ALYTHESS
@ DATA_ANVEENA
@ DATA_WORLD_TRIGGER
@ DATA_KALECGOS_HUMAN
@ DATA_SACROLASH
@ DATA_KALECGOS_DRAGON
@ DATA_PLAYER_GUID
@ DATA_ENTROPIUS
@ 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_ENTROPIUS
@ NPC_SATHROVARR
@ NPC_FELMYST
@ NPC_KALECGOS_KJ
@ NPC_MADRIGOSA