TrinityCore
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 "GameObject.h"
21#include "InstanceScript.h"
22#include "magtheridons_lair.h"
23#include "Map.h"
24#include "ScriptedCreature.h"
25
27{
28 { DATA_MAGTHERIDON, new CircleBoundary(Position(-18.70f, 2.24f), 52.30) }
29};
30
32{
35};
36
38{
41 { 0, 0 } // END
42
43};
44
46{
54 { 0, 0 } //END
55};
56
58{
65};
66
68{
69 { DATA_MAGTHERIDON, {{ 651 }} }
70};
71
73{
74 public:
76
78 {
80 {
87 }
88
89 void OnGameObjectCreate(GameObject* go) override
90 {
92
93 if (go->GetEntry() == GO_MANTICRON_CUBE)
94 cubesGUIDS.push_back(go->GetGUID());
95 }
96
97 void OnCreatureCreate(Creature* creature) override
98 {
100
101 if (creature->GetEntry() == NPC_HELLFIRE_WARDER)
102 warderGUIDS.push_back(creature->GetGUID());
103 }
104
105 void SetData(uint32 data, uint32 value) override
106 {
107 switch (data)
108 {
110 for (ObjectGuid gobGUID : cubesGUIDS)
111 if (GameObject* cube = instance->GetGameObject(gobGUID))
112 {
113 if (value == ACTION_ENABLE)
114 cube->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
115 else
116 cube->SetFlag(GO_FLAG_NOT_SELECTABLE);
117 }
118 break;
119 case DATA_COLLAPSE:
121 HandleGameObject(ObjectGuid::Empty, value == ACTION_ENABLE ? true : false, hall);
122 break;
123 case DATA_COLLAPSE_2:
125 if (GameObject* go = GetGameObject(type))
126 HandleGameObject(ObjectGuid::Empty, value == ACTION_ENABLE ? true : false, go);
127 break;
129 for (ObjectGuid warderGuid : warderGUIDS)
130 if (Creature* warder = instance->GetCreature(warderGuid))
131 if (warder->IsAlive())
132 warder->AI()->DoZoneInCombat();
133 break;
134 default:
135 break;
136 }
137 }
138
139 protected:
142 };
143
145 {
147 }
148};
149
151{
153}
@ NPC_WORLD_TRIGGER
uint32_t uint32
Definition: Define.h:142
std::vector< ObjectGuid > GuidVector
Definition: ObjectGuid.h:395
@ GO_FLAG_NOT_SELECTABLE
#define DataHeader
uint32 const EncounterCount
void SetBossNumber(uint32 number)
virtual void OnCreatureCreate(Creature *creature) override
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
void LoadDungeonEncounterData(T const &encounters)
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:3489
Creature * GetCreature(ObjectGuid const &guid)
Definition: Map.cpp:3479
static ObjectGuid const Empty
Definition: ObjectGuid.h:274
uint32 GetEntry() const
Definition: Object.h:161
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:159
InstanceScript * GetInstanceScript(InstanceMap *map) const override
ObjectData const gameObjectData[]
ObjectData const creatureData[]
DoorData const doorData[]
void AddSC_instance_magtheridons_lair()
BossBoundaryData const boundaries
DungeonEncounterData const encounters[]
static MLDataTypes const collapseObjectDatas[]
@ NPC_MAGTHERIDON
@ NPC_HELLFIRE_WARDER
#define MLScriptName
MLDataTypes
@ DATA_CALL_WARDERS
@ DATA_MAGTHERIDON_COLUMN_0
@ DATA_MAGTHERIDON_HALL
@ DATA_COLLAPSE
@ DATA_COLLAPSE_2
@ DATA_MAGTHERIDON_COLUMN_5
@ DATA_WORLD_TRIGGER
@ 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