TrinityCore
instance_forge_of_souls.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 "forge_of_souls.h"
22#include "InstanceScript.h"
23#include "Map.h"
24#include "Player.h"
25
27{
28 { DATA_BRONJAHM, new CircleBoundary(Position(5297.3f, 2506.45f), 100.96) },
29 { DATA_DEVOURER_OF_SOULS, new ParallelogramBoundary(Position(5663.56f, 2570.53f), Position(5724.39f, 2520.45f), Position(5570.36f, 2461.42f)) }
30};
31
33{
34 { DATA_BRONJAHM, {{ 2006 }} },
35 { DATA_DEVOURER_OF_SOULS, {{ 2007 }} }
36};
37
39{
40 public:
42
44 {
46 {
51
53 }
54
55 void OnPlayerEnter(Player* player) override
56 {
57 if (!teamInInstance)
58 teamInInstance = player->GetTeam();
59 }
60
61 void OnCreatureCreate(Creature* creature) override
62 {
63 switch (creature->GetEntry())
64 {
65 case NPC_BRONJAHM:
66 bronjahm = creature->GetGUID();
67 break;
68 case NPC_DEVOURER:
69 devourerOfSouls = creature->GetGUID();
70 break;
71 }
72 }
73
74 uint32 GetCreatureEntry(ObjectGuid::LowType /*guidLow*/, CreatureData const* data) override
75 {
76 if (!teamInInstance)
77 {
78 Map::PlayerList const& players = instance->GetPlayers();
79 if (!players.isEmpty())
80 if (Player* player = players.begin()->GetSource())
81 teamInInstance = player->GetTeam();
82 }
83
84 uint32 entry = data->id;
85 switch (entry)
86 {
89 case NPC_LORALEN:
91 case NPC_KALIRA:
93 default:
94 return entry;
95 }
96 }
97
98 uint32 GetData(uint32 type) const override
99 {
100 switch (type)
101 {
103 return teamInInstance;
104 default:
105 break;
106 }
107
108 return 0;
109 }
110
111 ObjectGuid GetGuidData(uint32 type) const override
112 {
113 switch (type)
114 {
115 case DATA_BRONJAHM:
116 return bronjahm;
118 return devourerOfSouls;
119 default:
120 break;
121 }
122
123 return ObjectGuid::Empty;
124 }
125
126 private:
129
131 };
132
134 {
136 }
137};
138
140{
142}
uint32_t uint32
Definition: Define.h:142
@ ALLIANCE
#define DataHeader
uint32 const EncounterCount
void SetBossNumber(uint32 number)
void LoadDungeonEncounterData(T const &encounters)
InstanceMap * instance
void LoadBossBoundaries(BossBoundaryData const &data)
void SetHeaders(std::string const &dataHeaders)
bool isEmpty() const
Definition: LinkedList.h:110
iterator begin()
Definition: MapRefManager.h:34
PlayerList const & GetPlayers() const
Definition: Map.h:367
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
uint64 LowType
Definition: ObjectGuid.h:278
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
Team GetTeam() const
Definition: Player.h:2235
FROM * GetSource() const
Definition: Reference.h:96
InstanceScript * GetInstanceScript(InstanceMap *map) const override
#define FoSScriptName
@ DATA_TEAM_IN_INSTANCE
@ DATA_DEVOURER_OF_SOULS
@ DATA_BRONJAHM
@ NPC_JAINA_PART1
@ NPC_DEVOURER
@ NPC_KALIRA
@ NPC_KORELN
@ NPC_BRONJAHM
@ NPC_LORALEN
@ NPC_ELANDRA
@ NPC_SYLVANAS_PART1
void AddSC_instance_forge_of_souls()
BossBoundaryData const boundaries
DungeonEncounterData const encounters[]
uint32 id
Definition: SpawnData.h:104
uint32 GetCreatureEntry(ObjectGuid::LowType, CreatureData const *data) override