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.30f) }
30};
31
36
43
54
64
65static constexpr DungeonEncounterData encounters[] =
66{
67 { DATA_MAGTHERIDON, {{ 651 }} }
68};
69
71{
72 public:
74
76 {
86
87 void OnCreatureCreate(Creature* creature) override
88 {
90
91 if (creature->GetEntry() == NPC_HELLFIRE_WARDER)
92 WarderGuids.insert(creature->GetGUID());
93 }
94
95 void OnCreatureRemove(Creature* creature) override
96 {
98
99 if (creature->GetEntry() == NPC_HELLFIRE_WARDER)
100 WarderGuids.erase(creature->GetGUID());
101 }
102
104 {
106
107 if (go->GetEntry() == GO_MANTICRON_CUBE)
108 CubeGuids.insert(go->GetGUID());
109 }
110
112 {
114
115 if (go->GetEntry() == GO_MANTICRON_CUBE)
116 CubeGuids.erase(go->GetGUID());
117 }
118
119 void SetData(uint32 data, uint32 value) override
120 {
121 switch (data)
122 {
124 for (ObjectGuid const& guid : CubeGuids)
125 if (GameObject* go = instance->GetGameObject(guid))
127 break;
128 case DATA_COLLAPSE_1:
131 break;
132 case DATA_COLLAPSE_2:
133 for (uint32 columnData : ColumnObjectDataTypes)
134 if (GameObject* go = GetGameObject(columnData))
136 break;
138 for (ObjectGuid const& guid : WarderGuids)
139 if (Creature* warder = instance->GetCreature(guid))
140 if (warder->IsAlive())
141 warder->AI()->DoZoneInCombat();
142 break;
143 default:
144 break;
145 }
146 }
147
148 protected:
151 };
152
154 {
156 }
157};
158
uint32_t uint32
Definition Define.h:154
#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)
virtual void OnCreatureRemove(Creature *creature) override
virtual void OnGameObjectRemove(GameObject *go) override
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:3588
Creature * GetCreature(ObjectGuid const &guid)
Definition Map.cpp:3578
static ObjectGuid const Empty
Definition ObjectGuid.h:314
uint32 GetEntry() const
Definition Object.h:89
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 DungeonEncounterData encounters[]
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