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 "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{
34 { 0, 0, DOOR_TYPE_ROOM } // END
35};
36
38{
41 { 0, 0 } // END
42
43};
44
56
66
68{
69 public:
71
73 {
82
83 void OnGameObjectCreate(GameObject* go) override
84 {
86
87 if (go->GetEntry() == GO_MANTICRON_CUBE)
88 cubesGUIDS.push_back(go->GetGUID());
89 }
90
91 void OnCreatureCreate(Creature* creature) override
92 {
94
95 if (creature->GetEntry() == NPC_HELLFIRE_WARDER)
96 warderGUIDS.push_back(creature->GetGUID());
97 }
98
99 void SetData(uint32 data, uint32 value) override
100 {
101 switch (data)
102 {
104 for (ObjectGuid gobGUID : cubesGUIDS)
105 if (GameObject* cube = instance->GetGameObject(gobGUID))
106 {
107 if (value == ACTION_ENABLE)
108 cube->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
109 else
110 cube->SetFlag(GO_FLAG_NOT_SELECTABLE);
111 }
112 break;
113 case DATA_COLLAPSE:
115 HandleGameObject(ObjectGuid::Empty, value == ACTION_ENABLE ? true : false, hall);
116 break;
117 case DATA_COLLAPSE_2:
119 if (GameObject* go = GetGameObject(type))
120 HandleGameObject(ObjectGuid::Empty, value == ACTION_ENABLE ? true : false, go);
121 break;
123 for (ObjectGuid warderGuid : warderGUIDS)
124 if (Creature* warder = instance->GetCreature(warderGuid))
125 if (warder->IsAlive())
126 warder->AI()->DoZoneInCombat();
127 break;
128 default:
129 break;
130 }
131 }
132
133 protected:
136 };
137
139 {
141 }
142};
143
@ NPC_WORLD_TRIGGER
uint32_t uint32
Definition Define.h:133
@ DOOR_TYPE_ROOM
std::vector< ObjectGuid > GuidVector
Definition ObjectGuid.h:262
@ 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)
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:4430
Creature * GetCreature(ObjectGuid const &guid)
Definition Map.cpp:4397
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
InstanceScript * GetInstanceScript(InstanceMap *map) const override
ObjectData const gameObjectData[]
ObjectData const creatureData[]
DoorData const doorData[]
void AddSC_instance_magtheridons_lair()
BossBoundaryData const boundaries
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_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