TrinityCore
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 public:
36
38 {
40 {
44
46 }
47
48 void OnPlayerEnter(Player* player) override
49 {
50 if (!teamInInstance)
51 teamInInstance = player->GetTeam();
52 }
53
54 void OnCreatureCreate(Creature* creature) override
55 {
56 switch (creature->GetEntry())
57 {
58 case NPC_BRONJAHM:
59 bronjahm = creature->GetGUID();
60 break;
61 case NPC_DEVOURER:
62 devourerOfSouls = creature->GetGUID();
63 break;
64 }
65 }
66
67 uint32 GetCreatureEntry(ObjectGuid::LowType /*guidLow*/, CreatureData const* data) override
68 {
69 if (!teamInInstance)
70 {
71 Map::PlayerList const& players = instance->GetPlayers();
72 if (!players.isEmpty())
73 if (Player* player = players.begin()->GetSource())
74 teamInInstance = player->GetTeam();
75 }
76
77 uint32 entry = data->id;
78 switch (entry)
79 {
82 case NPC_LORALEN:
84 case NPC_KALIRA:
86 default:
87 return entry;
88 }
89 }
90
91 uint32 GetData(uint32 type) const override
92 {
93 switch (type)
94 {
96 return teamInInstance;
97 default:
98 break;
99 }
100
101 return 0;
102 }
103
104 ObjectGuid GetGuidData(uint32 type) const override
105 {
106 switch (type)
107 {
108 case DATA_BRONJAHM:
109 return bronjahm;
111 return devourerOfSouls;
112 default:
113 break;
114 }
115
116 return ObjectGuid::Empty;
117 }
118
119 private:
122
124 };
125
127 {
129 }
130};
131
133{
135}
uint32_t uint32
Definition: Define.h:133
@ ALLIANCE
#define DataHeader
uint32 const EncounterCount
void SetBossNumber(uint32 number)
InstanceMap * instance
void LoadBossBoundaries(BossBoundaryData const &data)
void SetHeaders(std::string const &dataHeaders)
bool isEmpty() const
Definition: LinkedList.h:108
iterator begin()
Definition: MapRefManager.h:34
PlayerList const & GetPlayers() const
Definition: Map.h:448
static ObjectGuid const Empty
Definition: ObjectGuid.h:132
uint32 LowType
Definition: ObjectGuid.h:134
uint32 GetEntry() const
Definition: Object.h:80
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:77
Definition: Player.h:915
uint32 GetTeam() const
Definition: Player.h:1811
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
uint32 id
Definition: SpawnData.h:96
uint32 GetCreatureEntry(ObjectGuid::LowType, CreatureData const *data) override