aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/scripts/northrend/nexus/oculus/instance_oculus.cpp28
-rw-r--r--src/scripts/northrend/nexus/oculus/oculus.h5
2 files changed, 33 insertions, 0 deletions
diff --git a/src/scripts/northrend/nexus/oculus/instance_oculus.cpp b/src/scripts/northrend/nexus/oculus/instance_oculus.cpp
index 48bb1b5bcd7..00a0e5e2967 100644
--- a/src/scripts/northrend/nexus/oculus/instance_oculus.cpp
+++ b/src/scripts/northrend/nexus/oculus/instance_oculus.cpp
@@ -37,6 +37,8 @@ struct instance_oculus : public ScriptedInstance
uint8 m_auiEncounter[MAX_ENCOUNTER];
std::string str_data;
+ std::list<uint64> GameObjectList;
+
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
switch(pCreature->GetEntry())
@@ -56,12 +58,27 @@ struct instance_oculus : public ScriptedInstance
}
}
+ void OnGameObjectCreate(GameObject* pGO, bool bAdd)
+ {
+ if (pGO->GetEntry() == GO_DRAGON_CAGE_DOOR)
+ {
+ if (DATA_DRAKOS_EVENT == DONE)
+ pGO->SetGoState(GO_STATE_ACTIVE);
+ else
+ pGO->SetGoState(GO_STATE_READY);
+
+ GameObjectList.push_back(pGO->GetGUID());
+ }
+ }
+
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_DRAKOS_EVENT:
m_auiEncounter[0] = data;
+ if (data == DONE)
+ OpenCageDoors();
break;
case DATA_VAROS_EVENT:
m_auiEncounter[1] = data;
@@ -103,7 +120,18 @@ struct instance_oculus : public ScriptedInstance
return 0;
}
+
+ void OpenCageDoors()
+ {
+ if (GameObjectList.empty())
+ return;
+ for (std::list<uint64>::const_iterator itr = GameObjectList.begin(); itr != GameObjectList.end(); ++itr)
+ {
+ if (GameObject* pGO = instance->GetGameObject(*itr))
+ pGO->SetGoState(GO_STATE_ACTIVE);
+ }
+ }
std::string GetSaveData()
{
diff --git a/src/scripts/northrend/nexus/oculus/oculus.h b/src/scripts/northrend/nexus/oculus/oculus.h
index 6680e7cf0ba..93440dd6fc3 100644
--- a/src/scripts/northrend/nexus/oculus/oculus.h
+++ b/src/scripts/northrend/nexus/oculus/oculus.h
@@ -25,4 +25,9 @@ enum Bosses
CREATURE_EREGOS = 27656
};
+enum GameObjects
+{
+ GO_DRAGON_CAGE_DOOR = 193995
+};
+
#endif