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

Public Member Functions

 instance_gundrak_InstanceMapScript (Map *map)
 
void Initialize () override
 
void OnGameObjectCreate (GameObject *gameobject) override
 
void OnGameObjectRemove (GameObject *gameobject) override
 
void SetData (uint32 type, uint32) override
 
bool SetBossState (uint32 type, EncounterState state) override
 
void Update (uint32 diff) 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)
 

Public Attributes

ObjectGuid _sladRanAltarGUID
 
ObjectGuid _moorabiAltarGUID
 
ObjectGuid _drakkariAltarGUID
 
ObjectGuid _bridgeGUIDs [6]
 
uint32 _keysInCount
 
uint32 _activateTimer
 
- Public Attributes inherited from InstanceScript
Mapinstance
 
TaskScheduler scheduler
 

Additional Inherited Members

- Static Public Member Functions inherited from InstanceScript
static std::string GetBossStateName (uint8 state)
 
- 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_gundrak_InstanceMapScript()

instance_gundrak::instance_gundrak_InstanceMapScript::instance_gundrak_InstanceMapScript ( Map map)
inline
44 : InstanceScript(map)
45 {
47 }
#define DataHeader
Definition: blackrock_depths.h:23
Definition: InstanceScript.h:142
void SetHeaders(std::string const &dataHeaders)
Definition: InstanceScript.cpp:138

References DataHeader, and InstanceScript::SetHeaders().

Member Function Documentation

◆ Initialize()

void instance_gundrak::instance_gundrak_InstanceMapScript::Initialize ( )
inlineoverridevirtual

Reimplemented from InstanceScript.

57 {
60
61 _keysInCount = 0;
63 }
DoorData const doorData[]
Definition: instance_gundrak.cpp:22
@ MAX_ENCOUNTERS
Definition: deadmines.h:30
void SetBossNumber(uint32 number)
Definition: InstanceScript.h:285
void LoadDoorData(DoorData const *data)
Definition: InstanceScript.cpp:161
uint32 _activateTimer
Definition: instance_gundrak.cpp:54
uint32 _keysInCount
Definition: instance_gundrak.cpp:53

References _activateTimer, _keysInCount, doorData, InstanceScript::LoadDoorData(), MAX_ENCOUNTERS, and InstanceScript::SetBossNumber().

◆ OnGameObjectCreate()

void instance_gundrak::instance_gundrak_InstanceMapScript::OnGameObjectCreate ( GameObject gameobject)
inlineoverridevirtual

Reimplemented from InstanceScript.

66 {
67 switch (gameobject->GetEntry())
68 {
70 _sladRanAltarGUID = gameobject->GetGUID();
72 break;
74 _drakkariAltarGUID = gameobject->GetGUID();
76 break;
78 _moorabiAltarGUID = gameobject->GetGUID();
80 break;
82 _bridgeGUIDs[0] = gameobject->GetGUID();
84 break;
86 _bridgeGUIDs[1] = gameobject->GetGUID();
88 break;
90 _bridgeGUIDs[2] = gameobject->GetGUID();
92 break;
94 _bridgeGUIDs[3] = gameobject->GetGUID();
96 break;
98 _bridgeGUIDs[4] = gameobject->GetGUID();
100 break;
102 _bridgeGUIDs[5] = gameobject->GetGUID();
103 gameobject->SetGoState(GO_STATE_READY);
104 break;
105 case GO_ECK_DOORS:
110 AddDoor(gameobject);
111 break;
112 }
113 }
@ DONE
Definition: InstanceScript.h:60
@ GO_STATE_READY
Definition: GameObjectData.h:691
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:690
@ GO_STATE_ACTIVE_ALTERNATIVE
Definition: GameObjectData.h:692
@ GO_GAL_DARAH_DOORS0
Definition: gundrak.h:58
@ GO_GUNDRAK_BRIDGE
Definition: gundrak.h:53
@ GO_ALTAR_OF_MOORABI
Definition: gundrak.h:49
@ GO_STATUE_OF_MOORABI
Definition: gundrak.h:50
@ GO_STATUE_OF_DRAKKARI
Definition: gundrak.h:48
@ GO_ALTAR_OF_DRAKKARI
Definition: gundrak.h:47
@ GO_GAL_DARAH_DOORS1
Definition: gundrak.h:59
@ GO_STATUE_OF_SLAD_RAN
Definition: gundrak.h:46
@ GO_ECK_DOORS
Definition: gundrak.h:56
@ GO_ECK_UNDERWATER_GATE
Definition: gundrak.h:57
@ GO_STATUE_OF_GAL_DARAH
Definition: gundrak.h:51
@ GO_GAL_DARAH_DOORS2
Definition: gundrak.h:60
@ GO_ALTAR_OF_SLAD_RAN
Definition: gundrak.h:45
@ GO_GUNDRAK_COLLISION
Definition: gundrak.h:54
@ DATA_SLAD_RAN
Definition: gundrak.h:29
@ DATA_DRAKKARI_COLOSSUS
Definition: gundrak.h:31
@ DATA_MOORABI
Definition: gundrak.h:30
void SetGoState(GOState state)
Definition: GameObject.cpp:2477
uint32 GetEntry() const
Definition: Object.h:112
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:109
EncounterState GetBossState(uint32 id) const
Definition: InstanceScript.h:235
void AddDoor(GameObject *door, bool add=true)
Definition: InstanceScript.cpp:307
ObjectGuid _moorabiAltarGUID
Definition: instance_gundrak.cpp:50
ObjectGuid _bridgeGUIDs[6]
Definition: instance_gundrak.cpp:52
ObjectGuid _drakkariAltarGUID
Definition: instance_gundrak.cpp:51
ObjectGuid _sladRanAltarGUID
Definition: instance_gundrak.cpp:49

References _bridgeGUIDs, _drakkariAltarGUID, _keysInCount, _moorabiAltarGUID, _sladRanAltarGUID, InstanceScript::AddDoor(), DATA_DRAKKARI_COLOSSUS, DATA_MOORABI, DATA_SLAD_RAN, DONE, InstanceScript::GetBossState(), Object::GetEntry(), Object::GetGUID(), GO_ALTAR_OF_DRAKKARI, GO_ALTAR_OF_MOORABI, GO_ALTAR_OF_SLAD_RAN, GO_ECK_DOORS, GO_ECK_UNDERWATER_GATE, GO_GAL_DARAH_DOORS0, GO_GAL_DARAH_DOORS1, GO_GAL_DARAH_DOORS2, GO_GUNDRAK_BRIDGE, GO_GUNDRAK_COLLISION, GO_STATE_ACTIVE, GO_STATE_ACTIVE_ALTERNATIVE, GO_STATE_READY, GO_STATUE_OF_DRAKKARI, GO_STATUE_OF_GAL_DARAH, GO_STATUE_OF_MOORABI, GO_STATUE_OF_SLAD_RAN, and GameObject::SetGoState().

◆ OnGameObjectRemove()

void instance_gundrak::instance_gundrak_InstanceMapScript::OnGameObjectRemove ( GameObject gameobject)
inlineoverridevirtual

Reimplemented from InstanceScript.

116 {
117 switch (gameobject->GetEntry())
118 {
119 case GO_ECK_DOORS:
124 RemoveDoor(gameobject);
125 break;
126 }
127 }
void RemoveDoor(GameObject *door)
Definition: InstanceScript.cpp:329

References Object::GetEntry(), GO_ECK_DOORS, GO_ECK_UNDERWATER_GATE, GO_GAL_DARAH_DOORS0, GO_GAL_DARAH_DOORS1, GO_GAL_DARAH_DOORS2, and InstanceScript::RemoveDoor().

◆ SetBossState()

bool instance_gundrak::instance_gundrak_InstanceMapScript::SetBossState ( uint32  type,
EncounterState  state 
)
inlineoverridevirtual

Reimplemented from InstanceScript.

165 {
166 if (!InstanceScript::SetBossState(type, state))
167 {
168 if (state == DONE && (type == DATA_SLAD_RAN || type == DATA_MOORABI || type == DATA_DRAKKARI_COLOSSUS))
169 ++_keysInCount;
170 return false;
171 }
172
173 if (state != DONE)
174 return true;
175
176 switch (type)
177 {
178 case DATA_SLAD_RAN:
180 altar->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
181 break;
182 case DATA_MOORABI:
184 altar->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
185 break;
188 altar->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
189 break;
191 {
192 Position pos = {1624.70f, 891.43f, 95.08f, 1.2f};
193 if (instance->IsHeroic())
195 break;
196 }
197 }
198 return true;
199 }
@ NPC_ECK_THE_FEROCIOUS
Definition: gundrak.h:40
@ DATA_ECK_THE_FEROCIOUS_INIT
Definition: gundrak.h:33
@ GO_FLAG_NOT_SELECTABLE
Definition: SharedDefines.h:1607
Definition: GameObject.h:121
Definition: Position.h:28
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
bool IsHeroic() const
Definition: Map.h:452
TempSummon * SummonCreature(uint32 entry, Position const &pos, SummonPropertiesEntry const *properties=nullptr, uint32 duration=0, WorldObject *summoner=nullptr, uint32 spellId=0, uint32 vehId=0, bool visibleBySummonerOnly=false)
Definition: Object.cpp:2163

References _drakkariAltarGUID, _keysInCount, _moorabiAltarGUID, _sladRanAltarGUID, DATA_DRAKKARI_COLOSSUS, DATA_ECK_THE_FEROCIOUS_INIT, DATA_MOORABI, DATA_SLAD_RAN, DONE, Map::GetGameObject(), GO_FLAG_NOT_SELECTABLE, InstanceScript::instance, Map::IsHeroic(), NPC_ECK_THE_FEROCIOUS, InstanceScript::SetBossState(), and Map::SummonCreature().

Referenced by SetData().

◆ SetData()

void instance_gundrak::instance_gundrak_InstanceMapScript::SetData ( uint32  type,
uint32   
)
inlineoverridevirtual

Reimplemented from ZoneScript.

130 {
131 switch (type)
132 {
135 {
138 }
139 break;
142 statue->SetGoState(GO_STATE_READY);
143 break;
146 statue->SetGoState(GO_STATE_READY);
147 break;
150 statue->SetGoState(GO_STATE_READY);
151 break;
152 }
153
154 if (type >= GO_ALTAR_OF_SLAD_RAN)
155 {
156 for (uint8 i = 0; i < 3; ++i)
158 if (statue->GetGoState() != GO_STATE_READY)
159 return;
160 _activateTimer = 1;
161 }
162 }
std::uint8_t uint8
Definition: Define.h:109
@ NOT_STARTED
Definition: InstanceScript.h:57
bool SetBossState(uint32 type, EncounterState state) override
Definition: instance_gundrak.cpp:164

References _activateTimer, _bridgeGUIDs, DATA_ECK_THE_FEROCIOUS_INIT, DONE, InstanceScript::GetBossState(), Map::GetGameObject(), GO_ALTAR_OF_DRAKKARI, GO_ALTAR_OF_MOORABI, GO_ALTAR_OF_SLAD_RAN, GO_STATE_READY, InstanceScript::instance, NOT_STARTED, NPC_ECK_THE_FEROCIOUS, and SetBossState().

◆ Update()

void instance_gundrak::instance_gundrak_InstanceMapScript::Update ( uint32  diff)
inlineoverridevirtual

Reimplemented from InstanceScript.

202 {
203 if (!_activateTimer)
204 return;
205
206 _activateTimer += diff;
207 if (_activateTimer >= 5000)
208 {
209 _activateTimer = 0;
210 for (uint8 i = 0; i < 5; ++i)
212 go->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE);
213 }
214 }

References _activateTimer, _bridgeGUIDs, Map::GetGameObject(), GO_STATE_ACTIVE_ALTERNATIVE, and InstanceScript::instance.

Member Data Documentation

◆ _activateTimer

uint32 instance_gundrak::instance_gundrak_InstanceMapScript::_activateTimer

Referenced by Initialize(), SetData(), and Update().

◆ _bridgeGUIDs

ObjectGuid instance_gundrak::instance_gundrak_InstanceMapScript::_bridgeGUIDs[6]

Referenced by OnGameObjectCreate(), SetData(), and Update().

◆ _drakkariAltarGUID

ObjectGuid instance_gundrak::instance_gundrak_InstanceMapScript::_drakkariAltarGUID

Referenced by OnGameObjectCreate(), and SetBossState().

◆ _keysInCount

uint32 instance_gundrak::instance_gundrak_InstanceMapScript::_keysInCount

◆ _moorabiAltarGUID

ObjectGuid instance_gundrak::instance_gundrak_InstanceMapScript::_moorabiAltarGUID

Referenced by OnGameObjectCreate(), and SetBossState().

◆ _sladRanAltarGUID

ObjectGuid instance_gundrak::instance_gundrak_InstanceMapScript::_sladRanAltarGUID

Referenced by OnGameObjectCreate(), and SetBossState().