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.30f) }
29};
30
35
42
53
63
64static constexpr DungeonEncounterData encounters[] =
65{
66 { DATA_MAGTHERIDON, {{ 651 }} }
67};
68
70{
71 public:
73
75 {
85
86 void OnGameObjectCreate(GameObject* go) override
87 {
89
90 if (go->GetEntry() == GO_MANTICRON_CUBE)
91 cubesGUIDS.push_back(go->GetGUID());
92 }
93
94 void OnCreatureCreate(Creature* creature) override
95 {
97
98 if (creature->GetEntry() == NPC_HELLFIRE_WARDER)
99 warderGUIDS.push_back(creature->GetGUID());
100 }
101
102 void SetData(uint32 data, uint32 value) override
103 {
104 switch (data)
105 {
107 for (ObjectGuid gobGUID : cubesGUIDS)
108 if (GameObject* cube = instance->GetGameObject(gobGUID))
109 {
110 if (value == ACTION_ENABLE)
111 cube->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
112 else
113 cube->SetFlag(GO_FLAG_NOT_SELECTABLE);
114 }
115 break;
116 case DATA_COLLAPSE:
118 HandleGameObject(ObjectGuid::Empty, value == ACTION_ENABLE ? true : false, hall);
119 break;
120 case DATA_COLLAPSE_2:
122 if (GameObject* go = GetGameObject(type))
123 HandleGameObject(ObjectGuid::Empty, value == ACTION_ENABLE ? true : false, go);
124 break;
126 for (ObjectGuid warderGuid : warderGUIDS)
127 if (Creature* warder = instance->GetCreature(warderGuid))
128 if (warder->IsAlive())
129 warder->AI()->DoZoneInCombat();
130 break;
131 default:
132 break;
133 }
134 }
135
136 protected:
139 };
140
142 {
144 }
145};
146
uint32_t uint32
Definition Define.h:154
std::vector< ObjectGuid > GuidVector
Definition ObjectGuid.h:434
@ GO_FLAG_NOT_SELECTABLE
#define DataHeader
uint32 const EncounterCount
ObjectGuid const & GetGUID() const
Definition BaseEntity.h:163
void SetBossNumber(uint32 number)
virtual void OnCreatureCreate(Creature *creature) override
void HandleGameObject(ObjectGuid guid, bool open, GameObject *go=nullptr)
void LoadObjectData(std::span< ObjectData const > creatureData, std::span< ObjectData const > gameObjectData)
InstanceMap * instance
void SetHeaders(std::string_view dataHeaders)
void LoadDungeonEncounterData(std::span< DungeonEncounterData const > encounters)
virtual void OnGameObjectCreate(GameObject *go) override
void LoadDoorData(std::span< DoorData const > data)
GameObject * GetGameObject(uint32 type)
void LoadBossBoundaries(BossBoundaryData const &data)
GameObject * GetGameObject(ObjectGuid const &guid)
Definition Map.cpp:3552
Creature * GetCreature(ObjectGuid const &guid)
Definition Map.cpp:3542
static ObjectGuid const Empty
Definition ObjectGuid.h:314
uint32 GetEntry() const
Definition Object.h:89
InstanceScript * GetInstanceScript(InstanceMap *map) const override
static constexpr ObjectData creatureData[]
static constexpr MLDataTypes collapseObjectDatas[]
void AddSC_instance_magtheridons_lair()
static constexpr DoorData doorData[]
BossBoundaryData const boundaries
static constexpr ObjectData gameObjectData[]
static constexpr DungeonEncounterData encounters[]
@ 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