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
 
void OnCreatureCreate (Creature *creature) override
 
void OnCreatureRemove (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 Initialize ()
 
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
 
CreatureGetCreature (uint32 type)
 
GameObjectGetGameObject (uint32 type)
 
virtual void OnPlayerEnter (Player *)
 
virtual void OnPlayerAreaUpdate (Player *, uint32, uint32)
 
virtual void OnPlayerInWaterStateUpdate (Player *, bool)
 
void HandleGameObject (ObjectGuid guid, bool open, GameObject *go=nullptr)
 
void DoUseDoorOrButton (ObjectGuid guid, uint32 withRestoreTime=0, bool useAlternativeState=false)
 
void DoRespawnGameObject (ObjectGuid guid, uint32 timeToDespawn=MINUTE)
 
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 ()
 
virtual bool SetBossState (uint32 id, EncounterState state)
 
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
 
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 (WorldPacket &)
 
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
 
- 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 OnCreatureCreate (Creature *)
 
virtual void OnCreatureRemove (Creature *)
 
virtual void OnGameObjectCreate (GameObject *)
 
virtual void OnGameObjectRemove (GameObject *)
 
virtual void OnUnitDeath (Unit *)
 
virtual void OnCreatureEvade (Creature *)
 
virtual ObjectGuid GetGuidData (uint32) const
 
virtual void SetGuidData (uint32, ObjectGuid)
 
virtual uint64 GetData64 (uint32) const
 
virtual void SetData64 (uint32, uint64)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void ProcessEvent (WorldObject *, uint32)
 

Private Attributes

ObjectGuid _magtheridonGUID
 
GuidSet _wardersSet
 
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
Mapinstance
 
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 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
45 : InstanceScript(map)
46 {
52 }
#define MAX_ENCOUNTER
Definition: violet_hold.h:21
MinionData const minionData[]
Definition: instance_magtheridons_lair.cpp:33
DoorData const doorData[]
Definition: instance_magtheridons_lair.cpp:27
BossBoundaryData const boundaries
Definition: instance_magtheridons_lair.cpp:22
#define DataHeader
Definition: blackrock_depths.h:23
Definition: InstanceScript.h:142
void SetBossNumber(uint32 number)
Definition: InstanceScript.h:285
void LoadMinionData(MinionData const *data)
Definition: InstanceScript.cpp:149
void LoadDoorData(DoorData const *data)
Definition: InstanceScript.cpp:161
void LoadBossBoundaries(BossBoundaryData const &data)
Definition: InstanceScript.cpp:131
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:138

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

Member Function Documentation

◆ Initialize()

void instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

55 {
56 _wardersSet.clear();
57 _cubesSet.clear();
58 _columnSet.clear();
59 }
GuidSet _columnSet
Definition: instance_magtheridons_lair.cpp:187
GuidSet _wardersSet
Definition: instance_magtheridons_lair.cpp:185
GuidSet _cubesSet
Definition: instance_magtheridons_lair.cpp:186

References _columnSet, _cubesSet, and _wardersSet.

◆ OnCreatureCreate()

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

Reimplemented from InstanceScript.

62 {
63 switch (creature->GetEntry())
64 {
65 case NPC_MAGTHERIDON:
66 _magtheridonGUID = creature->GetGUID();
67 break;
69 AddMinion(creature);
70 break;
72 _wardersSet.insert(creature->GetGUID());
73 break;
74 }
75 }
@ NPC_MAGTHERIDON
Definition: magtheridons_lair.h:38
@ NPC_HELLFIRE_CHANNELER
Definition: magtheridons_lair.h:39
@ NPC_HELLFIRE_WARDER
Definition: magtheridons_lair.h:40
uint32 GetEntry() const
Definition: Object.h:112
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
void AddMinion(Creature *minion, bool add=true)
Definition: InstanceScript.cpp:334
ObjectGuid _magtheridonGUID
Definition: instance_magtheridons_lair.cpp:184

References _magtheridonGUID, _wardersSet, InstanceScript::AddMinion(), Object::GetEntry(), Object::GetGUID(), NPC_HELLFIRE_CHANNELER, NPC_HELLFIRE_WARDER, and NPC_MAGTHERIDON.

◆ OnCreatureRemove()

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

Reimplemented from InstanceScript.

78 {
79 switch (creature->GetEntry())
80 {
82 RemoveMinion(creature);
83 break;
84 }
85 }
void RemoveMinion(Creature *minion)
Definition: InstanceScript.cpp:346

References Object::GetEntry(), NPC_HELLFIRE_CHANNELER, and InstanceScript::RemoveMinion().

◆ OnGameObjectCreate()

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

Reimplemented from InstanceScript.

88 {
89 switch (go->GetEntry())
90 {
92 AddDoor(go);
93 break;
95 _cubesSet.insert(go->GetGUID());
96 break;
104 _columnSet.insert(go->GetGUID());
105 break;
106 }
107 }
@ GO_MAGTHERIDON_COLUMN4
Definition: magtheridons_lair.h:55
@ GO_MAGTHERIDON_HALL
Definition: magtheridons_lair.h:50
@ GO_MANTICRON_CUBE
Definition: magtheridons_lair.h:48
@ GO_MAGTHERIDON_COLUMN5
Definition: magtheridons_lair.h:56
@ GO_MAGTHERIDON_COLUMN2
Definition: magtheridons_lair.h:53
@ GO_MAGTHERIDON_DOORS
Definition: magtheridons_lair.h:47
@ GO_MAGTHERIDON_COLUMN0
Definition: magtheridons_lair.h:51
@ GO_MAGTHERIDON_COLUMN1
Definition: magtheridons_lair.h:52
@ GO_MAGTHERIDON_COLUMN3
Definition: magtheridons_lair.h:54
void AddDoor(GameObject *door, bool add=true)
Definition: InstanceScript.cpp:307

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

◆ SetBossState()

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

Reimplemented from InstanceScript.

132 {
133 if (!InstanceScript::SetBossState(id, state))
134 return false;
135
136 if (id == DATA_MAGTHERIDON)
137 {
138 if (state == IN_PROGRESS)
139 {
140 for (ObjectGuid const& guid : _wardersSet)
141 if (Creature* warder = instance->GetCreature(guid))
142 if (warder->IsAlive())
143 {
144 warder->InterruptNonMeleeSpells(true);
145 warder->SetInCombatWithZone();
146 }
147 }
148 else
149 {
150 for (ObjectGuid const& guid : _cubesSet)
151 if (GameObject* cube = instance->GetGameObject(guid))
152 cube->SetGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
153
154 if (state == NOT_STARTED)
156 }
157 }
158 return true;
159 }
@ IN_PROGRESS
Definition: InstanceScript.h:58
@ NOT_STARTED
Definition: InstanceScript.h:57
@ GO_READY
Definition: GameObject.h:112
@ DATA_COLLAPSE
Definition: magtheridons_lair.h:33
@ DATA_MAGTHERIDON
Definition: magtheridons_lair.h:28
@ GO_FLAG_NOT_SELECTABLE
Definition: SharedDefines.h:1607
Definition: Creature.h:46
Definition: GameObject.h:121
Definition: ObjectGuid.h:118
virtual bool SetBossState(uint32 id, EncounterState state)
Definition: InstanceScript.cpp:351
Map * instance
Definition: InstanceScript.h:148
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3319
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3314
void SetData(uint32 type, uint32 data) override
Definition: instance_magtheridons_lair.cpp:161

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

◆ SetData()

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

Reimplemented from ZoneScript.

162 {
163 switch (type)
164 {
167 if (Creature* magtheridon = instance->GetCreature(_magtheridonGUID))
168 magtheridon->SetInCombatWithZone();
169 break;
171 for (ObjectGuid const& guid : _cubesSet)
172 if (GameObject* cube = instance->GetGameObject(guid))
173 cube->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
174 break;
175 case DATA_COLLAPSE:
176 for (ObjectGuid const& guid : _columnSet)
177 if (GameObject* column = instance->GetGameObject(guid))
178 column->SetGoState(GOState(data));
179 break;
180 }
181 }
GOState
Definition: GameObjectData.h:689
@ DATA_CHANNELER_COMBAT
Definition: magtheridons_lair.h:31
@ DATA_ACTIVATE_CUBES
Definition: magtheridons_lair.h:32
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:235

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, and InstanceScript::instance.

Referenced by SetBossState().

Member Data Documentation

◆ _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

Referenced by OnCreatureCreate(), and SetData().

◆ _wardersSet

GuidSet instance_magtheridons_lair::instance_magtheridons_lair_InstanceMapScript::_wardersSet
private