TrinityCore
Loading...
Searching...
No Matches
instance_magtheridons_lair.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 "FlatSet.h"
21#include "GameObject.h"
22#include "InstanceScript.h"
23#include "magtheridons_lair.h"
24#include "Map.h"
25#include "ScriptedCreature.h"
26
28{
29 { DATA_MAGTHERIDON, new CircleBoundary(Position(-18.70f, 2.24f), 52.30) }
30};
31
32static constexpr DoorData doorData[] =
33{
35 { 0, 0, DOOR_TYPE_ROOM } // END
36};
37
38static constexpr ObjectData creatureData[] =
39{
42 { 0, 0 } // END
43
44};
45
57
67
69{
70 public:
72
74 {
83
84 void OnCreatureCreate(Creature* creature) override
85 {
87
88 if (creature->GetEntry() == NPC_HELLFIRE_WARDER)
89 WarderGuids.insert(creature->GetGUID());
90 }
91
92 void OnCreatureRemove(Creature* creature) override
93 {
95
96 if (creature->GetEntry() == NPC_HELLFIRE_WARDER)
97 WarderGuids.erase(creature->GetGUID());
98 }
99
101 {
103
104 if (go->GetEntry() == GO_MANTICRON_CUBE)
105 CubeGuids.insert(go->GetGUID());
106 }
107
109 {
111
112 if (go->GetEntry() == GO_MANTICRON_CUBE)
113 CubeGuids.erase(go->GetGUID());
114 }
115
116 void SetData(uint32 data, uint32 value) override
117 {
118 switch (data)
119 {
121 for (ObjectGuid const& guid : CubeGuids)
122 if (GameObject* go = instance->GetGameObject(guid))
124 break;
125 case DATA_COLLAPSE_1:
128 break;
129 case DATA_COLLAPSE_2:
130 for (uint32 columnData : ColumnObjectDataTypes)
131 if (GameObject* go = GetGameObject(columnData))
133 break;
135 for (ObjectGuid const& guid : WarderGuids)
136 if (Creature* warder = instance->GetCreature(guid))
137 if (warder->IsAlive())
138 warder->AI()->DoZoneInCombat();
139 break;
140 default:
141 break;
142 }
143 }
144
145 protected:
148 };
149
151 {
153 }
154};
155
@ NPC_WORLD_TRIGGER
uint32_t uint32
Definition Define.h:133
@ DOOR_TYPE_ROOM
#define DataHeader
uint32 const EncounterCount
void SetBossNumber(uint32 number)
virtual void OnCreatureCreate(Creature *creature) override
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
virtual void OnCreatureRemove(Creature *creature) override
virtual void OnGameObjectRemove(GameObject *go) override
InstanceMap * instance
virtual void OnGameObjectCreate(GameObject *go) override
void LoadDoorData(DoorData const *data)
GameObject * GetGameObject(uint32 type)
void LoadBossBoundaries(BossBoundaryData const &data)
void SetHeaders(std::string const &dataHeaders)
void LoadObjectData(ObjectData const *creatureData, ObjectData const *gameObjectData)
GameObject * GetGameObject(ObjectGuid const &guid)
Definition Map.cpp:4425
Creature * GetCreature(ObjectGuid const &guid)
Definition Map.cpp:4392
static ObjectGuid const Empty
Definition ObjectGuid.h:140
uint32 GetEntry() const
Definition Object.h:81
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:78
std::pair< iterator, bool > insert(Key const &key)
Definition FlatSet.h:82
std::size_t erase(Key const &key)
Definition FlatSet.h:84
InstanceScript * GetInstanceScript(InstanceMap *map) const override
static constexpr ObjectData creatureData[]
void AddSC_instance_magtheridons_lair()
static constexpr DoorData doorData[]
static BossBoundaryData const boundaries
static constexpr ObjectData gameObjectData[]
static constexpr std::array< uint32, 6 > ColumnObjectDataTypes
@ NPC_MAGTHERIDON
@ NPC_HELLFIRE_WARDER
#define MLScriptName
@ DATA_CALL_WARDERS
@ DATA_MAGTHERIDON_COLUMN_0
@ DATA_MAGTHERIDON_HALL
@ DATA_COLLAPSE_1
@ DATA_COLLAPSE_2
@ DATA_MAGTHERIDON_COLUMN_5
@ DATA_MAGTHERIDON_COLUMN_3
@ DATA_MAGTHERIDON_COLUMN_2
@ DATA_MANTICRON_CUBE
@ DATA_MAGTHERIDON_COLUMN_1
@ DATA_MAGTHERIDON
@ DATA_MAGTHERIDON_COLUMN_4
@ ACTION_ENABLE
@ GO_MAGTHERIDON_COLUMN_0
@ GO_MAGTHERIDON_COLUMN_1
@ GO_MAGTHERIDON_COLUMN_4
@ GO_MAGTHERIDON_HALL
@ GO_MAGTHERIDON_COLUMN_5
@ GO_MAGTHERIDON_COLUMN_2
@ GO_MANTICRON_CUBE
@ GO_MAGTHERIDON_DOOR
@ GO_MAGTHERIDON_COLUMN_3
@ DATA_WORLD_TRIGGER