AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript Struct Reference
Inheritance diagram for instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript:
InstanceScript ZoneScript

Public Member Functions

 instance_magtheridons_lair_InstanceMapScript (Map *map)
 
void Initialize () override
 
bool IsAnyChannelerAlive ()
 
void OnCreatureCreate (Creature *creature) override
 
void OnCreatureRemove (Creature *creature) override
 
void OnUnitDeath (Unit *unit) override
 
void OnCreatureEvade (Creature *creature) override
 
void OnGameObjectCreate (GameObject *go) override
 
void OnGameObjectRemove (GameObject *go) override
 
bool SetBossState (uint32 id, EncounterState state) override
 
void SetData (uint32 type, uint32 data) override
 
- Public Member Functions inherited from InstanceScript
 InstanceScript (Map *map)
 
 ~InstanceScript () override
 
virtual void Load (char const *data)
 
virtual void CreatureLooted (Creature *, LootType)
 
virtual std::string GetSaveData ()
 
void SaveToDB ()
 
virtual void Update (uint32)
 
virtual bool IsEncounterInProgress () const
 
void OnCreatureCreate (Creature *creature) override
 
void OnCreatureRemove (Creature *creature) override
 
void OnGameObjectCreate (GameObject *go) override
 
void OnGameObjectRemove (GameObject *go) override
 
ObjectGuid GetObjectGuid (uint32 type) const
 
ObjectGuid GetGuidData (uint32 type) const override
 
Creature * GetCreature (uint32 type)
 
GameObject * GetGameObject (uint32 type)
 
virtual void OnPlayerEnter (Player *)
 
virtual void OnPlayerLeave (Player *)
 
virtual void OnPlayerAreaUpdate (Player *, uint32, uint32)
 
virtual void OnPlayerInWaterStateUpdate (Player *, bool)
 
void HandleGameObject (ObjectGuid guid, bool open, GameObject *go=nullptr)
 Open or close a GameObject by GUID.
 
void HandleGameObject (uint32 type, bool open)
 Open or close a GameObject registered via LoadObjectData.
 
void DoUseDoorOrButton (ObjectGuid guid, uint32 withRestoreTime=0, bool useAlternativeState=false)
 
void DoRespawnGameObject (ObjectGuid guid, uint32 timeToDespawn=MINUTE)
 
void DoRespawnGameObject (uint32 type)
 
void DoRespawnCreature (ObjectGuid guid, bool force=false)
 
void DoRespawnCreature (uint32 type, bool force=false)
 
void DoUpdateWorldState (uint32 worldstateId, uint32 worldstateValue)
 
void DoSendNotifyToInstance (char const *format,...)
 
void DoUpdateAchievementCriteria (AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=nullptr)
 
void DoStartTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
void DoStopTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
void DoRemoveAurasDueToSpellOnPlayers (uint32 spell)
 
void DoCastSpellOnPlayers (uint32 spell)
 
void DoCastSpellOnPlayer (Player *player, uint32 spell, bool includePets, bool includeControlled)
 
bool ServerAllowsTwoSideGroups ()
 
EncounterState GetBossState (uint32 id) const
 
CreatureBoundary const * GetBossBoundary (uint32 id) const
 
BossInfo const * GetBossInfo (uint32 id) const
 
uint32 GetPersistentData (uint32 index) const
 
void StorePersistentData (uint32 index, uint32 data)
 
virtual bool CheckAchievementCriteriaMeet (uint32, Player const *, Unit const *=nullptr, uint32=0)
 
virtual bool CheckRequiredBosses (uint32, Player const *=nullptr) const
 
bool _SkipCheckRequiredBosses (Player const *player=nullptr) const
 
void SetCompletedEncountersMask (uint32 newMask, bool save)
 
uint32 GetCompletedEncounterMask () const
 
void SendEncounterUnit (uint32 type, Unit *unit=nullptr, uint8 param1=0, uint8 param2=0)
 
virtual void FillInitialWorldStates (WorldPackets::WorldState::InitWorldStates &)
 
uint32 GetEncounterCount () const
 
void MarkAreaTriggerDone (uint32 id)
 
void ResetAreaTriggerDone (uint32 id)
 
bool IsAreaTriggerDone (uint32 id) const
 
virtual void DoAction (int32)
 
void DoForAllMinions (uint32 id, std::function< void(Creature *)> exec)
 
void StoreGameObjectState (ObjectGuid::LowType spawnId, uint8 state)
 
uint8 GetStoredGameObjectState (ObjectGuid::LowType spawnId) const
 
void LoadInstanceSavedGameobjectStateData ()
 
bool IsBossDone (uint32 bossId) const
 
bool AllBossesDone () const
 
bool AllBossesDone (std::initializer_list< uint32 > bossIds) const
 
TeamId GetTeamIdInInstance () const
 
void SetTeamIdInInstance (TeamId teamId)
 
bool IsTwoFactionInstance () const
 
- Public Member Functions inherited from ZoneScript
 ZoneScript ()
 
virtual ~ZoneScript ()
 
virtual uint32 GetCreatureEntry (ObjectGuid::LowType, CreatureData const *data)
 
virtual uint32 GetGameObjectEntry (ObjectGuid::LowType, uint32 entry)
 
virtual void SetGuidData (uint32, ObjectGuid)
 
virtual uint64 GetData64 (uint32) const
 
virtual void SetData64 (uint32, uint64)
 
virtual uint32 GetData (uint32) const
 
virtual void ProcessEvent (WorldObject *, uint32)
 

Private Attributes

ObjectGuid _magtheridonGUID
 
GuidSet _channelersSet
 
GuidSet _wardersSet
 
GuidSet _burningAbyssalsSet
 
GuidSet _cubesSet
 
GuidSet _columnSet
 

Additional Inherited Members

- Static Public Member Functions inherited from InstanceScript
static std::string GetBossStateName (uint8 state)
 
- Public Attributes inherited from InstanceScript
Map * instance
 
TaskScheduler scheduler
 
- Protected Member Functions inherited from InstanceScript
void SetHeaders (std::string const &dataHeaders)
 
void SetBossNumber (uint32 number)
 
void SetPersistentDataCount (uint32 number)
 
void LoadBossBoundaries (BossBoundaryData const &data)
 
void LoadDoorData (DoorData const *data)
 
void LoadMinionData (MinionData const *data)
 
void LoadObjectData (ObjectData const *creatureData, ObjectData const *gameObjectData)
 
void LoadSummonData (ObjectData const *data)
 
void SetSummoner (Creature *creature)
 
void AddObject (Creature *obj, bool add=true)
 
void RemoveObject (Creature *obj)
 
void AddObject (GameObject *obj, bool add=true)
 
void RemoveObject (GameObject *obj)
 
void AddObject (WorldObject *obj, uint32 type, bool add=true)
 
void RemoveObject (WorldObject *obj, uint32 type)
 
void AddDoor (GameObject *door, bool add=true)
 
void RemoveDoor (GameObject *door)
 
void AddMinion (Creature *minion, bool add=true)
 
void RemoveMinion (Creature *minion)
 
void UpdateDoorState (GameObject *door)
 
void UpdateMinionState (Creature *minion, EncounterState state)
 
bool ReadSaveDataHeaders (std::istringstream &data)
 
void ReadSaveDataBossStates (std::istringstream &data)
 
void ReadSavePersistentData (std::istringstream &data)
 
virtual void ReadSaveDataMore (std::istringstream &)
 
void WriteSaveDataHeaders (std::ostringstream &data)
 
void WriteSaveDataBossStates (std::ostringstream &data)
 
void WritePersistentData (std::ostringstream &data)
 
virtual void WriteSaveDataMore (std::ostringstream &)
 

Detailed Description

Constructor & Destructor Documentation

◆ instance_magtheridons_lair_InstanceMapScript()

instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::instance_magtheridons_lair_InstanceMapScript ( Map *  map)
inline
41 : InstanceScript(map)
42 {
47 }
#define DataHeader
Definition blackrock_depths.h:23
Definition InstanceScript.h:143
void SetBossNumber(uint32 number)
Definition InstanceScript.h:308
void LoadDoorData(DoorData const *data)
Definition InstanceScript.cpp:186
void LoadBossBoundaries(BossBoundaryData const &data)
Definition InstanceScript.cpp:156
void SetHeaders(std::string const &dataHeaders)
Definition InstanceScript.cpp:163
constexpr auto MAX_ENCOUNTER
Definition instance_blackrock_depths.cpp:24
DoorData const doorData[]
Definition instance_magtheridons_lair.cpp:28
BossBoundaryData const boundaries
Definition instance_magtheridons_lair.cpp:23

References boundaries, DataHeader, doorData, InstanceScript::LoadBossBoundaries(), InstanceScript::LoadDoorData(), MAX_ENCOUNTER, InstanceScript::SetBossNumber(), and InstanceScript::SetHeaders().

Member Function Documentation

◆ Initialize()

void instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

50 {
51 _channelersSet.clear();
52 _wardersSet.clear();
53 _burningAbyssalsSet.clear();
54 _cubesSet.clear();
55 _columnSet.clear();
56 }
GuidSet _columnSet
Definition instance_magtheridons_lair.cpp:248
GuidSet _wardersSet
Definition instance_magtheridons_lair.cpp:245
GuidSet _channelersSet
Definition instance_magtheridons_lair.cpp:244
GuidSet _burningAbyssalsSet
Definition instance_magtheridons_lair.cpp:246
GuidSet _cubesSet
Definition instance_magtheridons_lair.cpp:247

References _burningAbyssalsSet, _channelersSet, _columnSet, _cubesSet, and _wardersSet.

◆ IsAnyChannelerAlive()

bool instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::IsAnyChannelerAlive ( )
inline
59 {
60 return std::ranges::any_of(_channelersSet, [&](ObjectGuid const& guid)
61 {
62 if (Creature* channeler = instance->GetCreature(guid))
63 return channeler->IsAlive();
64 return false;
65 });
66 }
Definition Creature.h:47
Map * instance
Definition InstanceScript.h:149
Creature * GetCreature(ObjectGuid const &guid)
Definition Map.cpp:2442
Definition ObjectGuid.h:121

References _channelersSet, Map::GetCreature(), and InstanceScript::instance.

Referenced by OnUnitDeath().

◆ OnCreatureCreate()

void instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::OnCreatureCreate ( Creature *  creature)
inlineoverridevirtual

Reimplemented from ZoneScript.

69 {
70 switch (creature->GetEntry())
71 {
72 case NPC_MAGTHERIDON:
73 _magtheridonGUID = creature->GetGUID();
74 break;
76 _channelersSet.insert(creature->GetGUID());
77 break;
79 _wardersSet.insert(creature->GetGUID());
80 break;
82 _burningAbyssalsSet.insert(creature->GetGUID());
83 break;
84 }
85 }
uint32 GetEntry() const
Definition Object.h:123
static ObjectGuid GetGUID(Object const *o)
Definition Object.h:120
@ NPC_MAGTHERIDON
Definition magtheridons_lair.h:39
@ NPC_HELLFIRE_CHANNELER
Definition magtheridons_lair.h:40
@ NPC_HELLFIRE_WARDER
Definition magtheridons_lair.h:41
@ NPC_BURNING_ABYSSAL
Definition magtheridons_lair.h:44
ObjectGuid _magtheridonGUID
Definition instance_magtheridons_lair.cpp:243

References _burningAbyssalsSet, _channelersSet, _magtheridonGUID, _wardersSet, Object::GetEntry(), Object::GetGUID(), NPC_BURNING_ABYSSAL, NPC_HELLFIRE_CHANNELER, NPC_HELLFIRE_WARDER, and NPC_MAGTHERIDON.

◆ OnCreatureEvade()

void instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::OnCreatureEvade ( Creature *  creature)
inlineoverridevirtual

Reimplemented from ZoneScript.

108 {
110 return;
111
112 // Only a Channeler-phase wipe resets the encounter. Past the 2 minute auto-release he is
113 // loose with Channelers still up, and a reset there would disable the Manticron Cubes and
114 // open the door mid-fight.
115 if (Creature* magtheridon = instance->GetCreature(_magtheridonGUID))
116 if (magtheridon->AI()->GetData(DATA_MAGTHERIDON_RELEASED))
117 return;
118
120 }
@ IN_PROGRESS
Definition InstanceScript.h:59
@ NOT_STARTED
Definition InstanceScript.h:58
EncounterState GetBossState(uint32 id) const
Definition InstanceScript.h:252
@ DATA_MAGTHERIDON_RELEASED
Definition magtheridons_lair.h:34
@ DATA_MAGTHERIDON
Definition magtheridons_lair.h:28
bool SetBossState(uint32 id, EncounterState state) override
Definition instance_magtheridons_lair.cpp:166

References _magtheridonGUID, DATA_MAGTHERIDON, DATA_MAGTHERIDON_RELEASED, InstanceScript::GetBossState(), Map::GetCreature(), Object::GetEntry(), IN_PROGRESS, InstanceScript::instance, NOT_STARTED, NPC_HELLFIRE_CHANNELER, and SetBossState().

◆ OnCreatureRemove()

void instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::OnCreatureRemove ( Creature *  creature)
inlineoverridevirtual

Reimplemented from ZoneScript.

88 {
89 if (creature->GetEntry() == NPC_BURNING_ABYSSAL)
90 _burningAbyssalsSet.erase(creature->GetGUID());
91 }

References _burningAbyssalsSet, Object::GetEntry(), Object::GetGUID(), and NPC_BURNING_ABYSSAL.

◆ OnGameObjectCreate()

void instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::OnGameObjectCreate ( GameObject *  go)
inlineoverridevirtual

Reimplemented from ZoneScript.

123 {
124 switch (go->GetEntry())
125 {
127 AddDoor(go);
128 break;
130 _cubesSet.insert(go->GetGUID());
131 break;
139 _columnSet.insert(go->GetGUID());
140 break;
141 }
142 }
void AddDoor(GameObject *door, bool add=true)
Definition InstanceScript.cpp:341
@ GO_MAGTHERIDON_COLUMN4
Definition magtheridons_lair.h:64
@ GO_MAGTHERIDON_HALL
Definition magtheridons_lair.h:59
@ GO_MANTICRON_CUBE
Definition magtheridons_lair.h:57
@ GO_MAGTHERIDON_COLUMN5
Definition magtheridons_lair.h:65
@ GO_MAGTHERIDON_COLUMN2
Definition magtheridons_lair.h:62
@ GO_MAGTHERIDON_DOORS
Definition magtheridons_lair.h:56
@ GO_MAGTHERIDON_COLUMN0
Definition magtheridons_lair.h:60
@ GO_MAGTHERIDON_COLUMN1
Definition magtheridons_lair.h:61
@ GO_MAGTHERIDON_COLUMN3
Definition magtheridons_lair.h:63

References _columnSet, _cubesSet, InstanceScript::AddDoor(), Object::GetEntry(), Object::GetGUID(), GO_MAGTHERIDON_COLUMN0, GO_MAGTHERIDON_COLUMN1, GO_MAGTHERIDON_COLUMN2, GO_MAGTHERIDON_COLUMN3, GO_MAGTHERIDON_COLUMN4, GO_MAGTHERIDON_COLUMN5, GO_MAGTHERIDON_DOORS, GO_MAGTHERIDON_HALL, and GO_MANTICRON_CUBE.

◆ OnGameObjectRemove()

void instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::OnGameObjectRemove ( GameObject *  go)
inlineoverridevirtual

◆ OnUnitDeath()

void instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::OnUnitDeath ( Unit *  unit)
inlineoverridevirtual

Reimplemented from ZoneScript.

94 {
95 Creature* creature = unit ? unit->ToCreature() : nullptr;
96 if (!creature || creature->GetEntry() != NPC_HELLFIRE_CHANNELER)
97 return;
98
99 // IN_PROGRESS guard: stays inert during the hard-reset Respawn(true) cycle.
101 return;
102
103 if (Creature* magtheridon = instance->GetCreature(_magtheridonGUID))
104 magtheridon->AI()->DoAction(ACTION_RELEASE_MAGTHERIDON);
105 }
CreatureAI * AI() const
Definition Creature.h:144
Creature * ToCreature()
Definition Object.h:212
virtual void DoAction(int32)
Definition UnitAI.h:217
@ ACTION_RELEASE_MAGTHERIDON
Definition magtheridons_lair.h:49
bool IsAnyChannelerAlive()
Definition instance_magtheridons_lair.cpp:58

References _magtheridonGUID, ACTION_RELEASE_MAGTHERIDON, Creature::AI(), DATA_MAGTHERIDON, UnitAI::DoAction(), InstanceScript::GetBossState(), Map::GetCreature(), Object::GetEntry(), IN_PROGRESS, InstanceScript::instance, IsAnyChannelerAlive(), NPC_HELLFIRE_CHANNELER, and Object::ToCreature().

◆ SetBossState()

bool instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::SetBossState ( uint32  id,
EncounterState  state 
)
inlineoverridevirtual

Reimplemented from InstanceScript.

167 {
168 if (!InstanceScript::SetBossState(id, state))
169 return false;
170
171 if (id == DATA_MAGTHERIDON)
172 {
173 if (state == IN_PROGRESS)
174 {
175 for (ObjectGuid const& guid : _wardersSet)
176 if (Creature* warder = instance->GetCreature(guid))
177 if (warder->IsAlive())
178 {
179 warder->InterruptNonMeleeSpells(true);
180 warder->SetInCombatWithZone();
181 }
182 }
183 else
184 {
185 for (ObjectGuid const& guid : _cubesSet)
186 if (GameObject* cube = instance->GetGameObject(guid))
187 cube->SetGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
188
189 if (state == NOT_STARTED)
191
192 // Hard reset: vanish Channelers and their lingering Burning Abyssal summons.
193 if (state == NOT_STARTED || state == FAIL)
194 {
195 for (ObjectGuid const& guid : _channelersSet)
196 if (Creature* channeler = instance->GetCreature(guid))
197 channeler->Respawn(true);
198
199 for (ObjectGuid const& guid : _burningAbyssalsSet)
200 if (Creature* abyssal = instance->GetCreature(guid))
201 abyssal->DespawnOrUnsummon();
202
203 // Reset a still-caged Magtheridon: he is engaged from the Channeler pull on.
204 if (Creature* magtheridon = instance->GetCreature(_magtheridonGUID))
205 magtheridon->AI()->DoAction(ACTION_RESET_ENCOUNTER);
206 }
207 }
208 }
209 return true;
210 }
@ GO_READY
Definition GameObject.h:111
@ FAIL
Definition InstanceScript.h:60
@ GO_FLAG_NOT_SELECTABLE
Definition SharedDefines.h:1611
@ ACTION_RESET_ENCOUNTER
Definition boss_halion.cpp:157
Definition GameObject.h:120
virtual bool SetBossState(uint32 id, EncounterState state)
Definition InstanceScript.cpp:400
Creature * GetCreature(uint32 type)
Definition InstanceScript.cpp:120
GameObject * GetGameObject(uint32 type)
Definition InstanceScript.cpp:125
@ DATA_COLLAPSE
Definition magtheridons_lair.h:33
void SetData(uint32 type, uint32 data) override
Definition instance_magtheridons_lair.cpp:212

References _burningAbyssalsSet, _channelersSet, _cubesSet, _magtheridonGUID, _wardersSet, ACTION_RESET_ENCOUNTER, DATA_COLLAPSE, DATA_MAGTHERIDON, FAIL, Map::GetCreature(), Map::GetGameObject(), GO_FLAG_NOT_SELECTABLE, GO_READY, IN_PROGRESS, InstanceScript::instance, NOT_STARTED, InstanceScript::SetBossState(), and SetData().

Referenced by OnCreatureEvade(), and SetData().

◆ SetData()

void instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::SetData ( uint32  type,
uint32  data 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

213 {
214 switch (type)
215 {
217 // Start the encounter on the Channeler pull. The combat references this creates
218 // engage Magtheridon (boss_magtheridon::JustEnteredCombat), which anchors his
219 // release countdown here and not to when players can first hit him.
221 {
223 if (Creature* magtheridon = instance->GetCreature(_magtheridonGUID))
224 magtheridon->SetInCombatWithZone();
225 }
226 break;
228 for (ObjectGuid const& guid : _cubesSet)
229 if (GameObject* cube = instance->GetGameObject(guid))
230 cube->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
231 break;
232 case DATA_COLLAPSE:
233 for (ObjectGuid const& guid : _columnSet)
234 if (GameObject* column = instance->GetGameObject(guid))
235 column->SetGoState(GOState(data));
236 break;
237 default:
238 break;
239 }
240 }
GOState
Definition GameObjectData.h:707
@ DATA_CHANNELER_COMBAT
Definition magtheridons_lair.h:31
@ DATA_ACTIVATE_CUBES
Definition magtheridons_lair.h:32

References _columnSet, _cubesSet, _magtheridonGUID, DATA_ACTIVATE_CUBES, DATA_CHANNELER_COMBAT, DATA_COLLAPSE, DATA_MAGTHERIDON, InstanceScript::GetBossState(), Map::GetCreature(), Map::GetGameObject(), GO_FLAG_NOT_SELECTABLE, IN_PROGRESS, InstanceScript::instance, and SetBossState().

Referenced by SetBossState().

Member Data Documentation

◆ _burningAbyssalsSet

GuidSet instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::_burningAbyssalsSet
private

◆ _channelersSet

GuidSet instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::_channelersSet
private

◆ _columnSet

GuidSet instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::_columnSet
private

◆ _cubesSet

GuidSet instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::_cubesSet
private

◆ _magtheridonGUID

ObjectGuid instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::_magtheridonGUID
private

◆ _wardersSet

GuidSet instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::_wardersSet
private

The documentation for this struct was generated from the following file: