mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 16:38:42 +01:00
Fix Script Stratholme.
- fix doors opening/closing when encounters are completed or during instance reload. --HG-- branch : trunk
This commit is contained in:
@@ -49,7 +49,7 @@ EndScriptData */
|
||||
|
||||
struct instance_stratholme : public ScriptedInstance
|
||||
{
|
||||
instance_stratholme(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
|
||||
instance_stratholme(Map* pMap) : ScriptedInstance(pMap) {}
|
||||
|
||||
uint32 Encounter[MAX_ENCOUNTER];
|
||||
|
||||
@@ -107,8 +107,8 @@ struct instance_stratholme : public ScriptedInstance
|
||||
//change to DONE when crystals implemented
|
||||
if (Encounter[1] == IN_PROGRESS && Encounter[2] == IN_PROGRESS && Encounter[3] == IN_PROGRESS)
|
||||
{
|
||||
UpdateGoState(portGauntletGUID,0,false);
|
||||
UpdateGoState(portSlaugtherGUID,0,false);
|
||||
HandleGameObject(portGauntletGUID, true);
|
||||
HandleGameObject(portSlaugtherGUID, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -147,28 +147,52 @@ struct instance_stratholme : public ScriptedInstance
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
{
|
||||
case GO_SERVICE_ENTRANCE: serviceEntranceGUID = pGo->GetGUID(); break;
|
||||
case GO_SERVICE_ENTRANCE:
|
||||
serviceEntranceGUID = pGo->GetGUID();
|
||||
break;
|
||||
case GO_GAUNTLET_GATE1:
|
||||
//weird, but unless flag is set, client will not respond as expected. DB bug?
|
||||
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_LOCKED);
|
||||
gauntletGate1GUID = pGo->GetGUID();
|
||||
break;
|
||||
case GO_ZIGGURAT1: ziggurat1GUID = pGo->GetGUID(); break;
|
||||
case GO_ZIGGURAT2: ziggurat2GUID = pGo->GetGUID(); break;
|
||||
case GO_ZIGGURAT3: ziggurat3GUID = pGo->GetGUID(); break;
|
||||
case GO_ZIGGURAT1:
|
||||
ziggurat1GUID = pGo->GetGUID();
|
||||
if (GetData(TYPE_BARONESS) == IN_PROGRESS)
|
||||
HandleGameObject(0, true, pGo);
|
||||
break;
|
||||
case GO_ZIGGURAT2:
|
||||
ziggurat2GUID = pGo->GetGUID();
|
||||
if (GetData(TYPE_NERUB) == IN_PROGRESS)
|
||||
HandleGameObject(0, true, pGo);
|
||||
break;
|
||||
case GO_ZIGGURAT3:
|
||||
ziggurat3GUID = pGo->GetGUID();
|
||||
if (GetData(TYPE_PALLID) == IN_PROGRESS)
|
||||
HandleGameObject(0, true, pGo);
|
||||
break;
|
||||
case GO_ZIGGURAT4:
|
||||
ziggurat4GUID = pGo->GetGUID();
|
||||
if (TYPE_BARON == DONE || TYPE_RAMSTEIN == DONE)
|
||||
if (GetData(TYPE_BARON) == DONE || GetData(TYPE_RAMSTEIN) == DONE)
|
||||
HandleGameObject(0, true, pGo);
|
||||
break;
|
||||
case GO_ZIGGURAT5:
|
||||
ziggurat5GUID = pGo->GetGUID();
|
||||
if (TYPE_BARON == DONE || TYPE_RAMSTEIN == DONE)
|
||||
if (GetData(TYPE_BARON) == DONE || GetData(TYPE_RAMSTEIN) == DONE)
|
||||
HandleGameObject(0, true, pGo);
|
||||
break;
|
||||
case GO_PORT_GAUNTLET: portGauntletGUID = pGo->GetGUID(); break;
|
||||
case GO_PORT_SLAUGTHER: portSlaugtherGUID = pGo->GetGUID(); break;
|
||||
case GO_PORT_ELDERS: portElderGUID = pGo->GetGUID(); break;
|
||||
case GO_PORT_GAUNTLET:
|
||||
portGauntletGUID = pGo->GetGUID();
|
||||
if (GetData(TYPE_BARONESS) == IN_PROGRESS && GetData(TYPE_NERUB) == IN_PROGRESS && GetData(TYPE_PALLID) == IN_PROGRESS)
|
||||
HandleGameObject(0, true, pGo);
|
||||
break;
|
||||
case GO_PORT_SLAUGTHER:
|
||||
portSlaugtherGUID = pGo->GetGUID();
|
||||
if (GetData(TYPE_BARONESS) == IN_PROGRESS && GetData(TYPE_NERUB) == IN_PROGRESS && GetData(TYPE_PALLID) == IN_PROGRESS)
|
||||
HandleGameObject(0, true, pGo);
|
||||
break;
|
||||
case GO_PORT_ELDERS:
|
||||
portElderGUID = pGo->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,29 +225,28 @@ struct instance_stratholme : public ScriptedInstance
|
||||
case TYPE_BARONESS:
|
||||
Encounter[1] = data;
|
||||
if (data == IN_PROGRESS)
|
||||
UpdateGoState(ziggurat1GUID,GO_STATE_ACTIVE,false);
|
||||
HandleGameObject(ziggurat1GUID, true);
|
||||
if (data == IN_PROGRESS) //change to DONE when crystals implemented
|
||||
StartSlaugtherSquare();
|
||||
break;
|
||||
case TYPE_NERUB:
|
||||
Encounter[2] = data;
|
||||
if (data == IN_PROGRESS)
|
||||
UpdateGoState(ziggurat2GUID,GO_STATE_ACTIVE,false);
|
||||
HandleGameObject(ziggurat2GUID, true);
|
||||
if (data == IN_PROGRESS) //change to DONE when crystals implemented
|
||||
StartSlaugtherSquare();
|
||||
break;
|
||||
case TYPE_PALLID:
|
||||
Encounter[3] = data;
|
||||
if (data == IN_PROGRESS)
|
||||
UpdateGoState(ziggurat3GUID,GO_STATE_ACTIVE,false);
|
||||
HandleGameObject(ziggurat3GUID, true);
|
||||
if (data == IN_PROGRESS) //change to DONE when crystals implemented
|
||||
StartSlaugtherSquare();
|
||||
break;
|
||||
case TYPE_RAMSTEIN:
|
||||
if (data == IN_PROGRESS)
|
||||
{
|
||||
if (Encounter[4] != IN_PROGRESS)
|
||||
UpdateGoState(portGauntletGUID,GO_STATE_READY,false);
|
||||
HandleGameObject(portGauntletGUID, false);
|
||||
|
||||
uint32 count = abomnationGUID.size();
|
||||
for (std::set<uint64>::iterator i = abomnationGUID.begin(); i != abomnationGUID.end(); ++i)
|
||||
@@ -246,6 +269,10 @@ struct instance_stratholme : public ScriptedInstance
|
||||
else
|
||||
debug_log("TSCR: Instance Stratholme: %u Abomnation left to kill.",count);
|
||||
}
|
||||
|
||||
if (data == NOT_STARTED)
|
||||
HandleGameObject(portGauntletGUID, true);
|
||||
|
||||
if (data == DONE)
|
||||
{
|
||||
SlaugtherSquare_Timer = 300000;
|
||||
@@ -285,6 +312,8 @@ struct instance_stratholme : public ScriptedInstance
|
||||
HandleGameObject(ziggurat4GUID, true);
|
||||
HandleGameObject(ziggurat5GUID, true);
|
||||
}
|
||||
if (data == DONE)
|
||||
HandleGameObject(portGauntletGUID, true);
|
||||
Encounter[5] = data;
|
||||
break;
|
||||
case TYPE_SH_AELMAR:
|
||||
@@ -332,9 +361,13 @@ struct instance_stratholme : public ScriptedInstance
|
||||
loadStream >> Encounter[0] >> Encounter[1] >> Encounter[2] >> Encounter[3]
|
||||
>> Encounter[4] >> Encounter[5];
|
||||
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (Encounter[i] == IN_PROGRESS)
|
||||
Encounter[i] = NOT_STARTED;
|
||||
// Do not reset 1, 2 and 3. they are not set to done, yet .
|
||||
if (Encounter[0] == IN_PROGRESS)
|
||||
Encounter[0] = NOT_STARTED;
|
||||
if (Encounter[4] == IN_PROGRESS)
|
||||
Encounter[4] = NOT_STARTED;
|
||||
if (Encounter[5] == IN_PROGRESS)
|
||||
Encounter[5] = NOT_STARTED;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
@@ -397,8 +430,8 @@ struct instance_stratholme : public ScriptedInstance
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
pBaron->SummonCreature(C_BLACK_GUARD,4032.84,-3390.24,119.73,4.71,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000);
|
||||
|
||||
UpdateGoState(ziggurat4GUID,GO_STATE_ACTIVE,false);
|
||||
UpdateGoState(ziggurat5GUID,GO_STATE_ACTIVE,false);
|
||||
HandleGameObject(ziggurat4GUID, true);
|
||||
HandleGameObject(ziggurat5GUID, true);
|
||||
debug_log("TSCR: Instance Stratholme: Black guard sentries spawned. Opening gates to baron.");
|
||||
}
|
||||
SlaugtherSquare_Timer = 0;
|
||||
|
||||
Reference in New Issue
Block a user