69 lines
2.0 KiB
Plaintext
69 lines
2.0 KiB
Plaintext
//////////////////////////////////////////////////////////////////////////////
|
|
// ou_element_tp
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
void fnClearPadlock()
|
|
{ // clear the settings
|
|
int nC=1;
|
|
object oWP;
|
|
object oOb;
|
|
DeleteLocalInt(GetModule(),"nWitchPadLockC");
|
|
oWP=GetWaypointByTag("ELEMENT_PADLOCK"+IntToString(nC));
|
|
while(nC<5)
|
|
{ // destroy shafts
|
|
oOb=GetLocalObject(oWP,"oShaft");
|
|
DeleteLocalInt(oWP,"nValue");
|
|
DestroyObject(oOb);
|
|
DeleteLocalObject(oWP,"oShaft");
|
|
nC++;
|
|
oWP=GetWaypointByTag("ELEMENT_PADLOCK"+IntToString(nC));
|
|
} // destroy shafts
|
|
} // clear the settings
|
|
|
|
string fnGetCombination()
|
|
{
|
|
string sRet="";
|
|
int nC=1;
|
|
object oWP=GetWaypointByTag("ELEMENT_PADLOCK"+IntToString(nC));
|
|
while(nC<5)
|
|
{
|
|
sRet=sRet+IntToString(GetLocalInt(oWP,"nValue"));
|
|
nC++;
|
|
oWP=GetWaypointByTag("ELEMENT_PADLOCK"+IntToString(nC));
|
|
}
|
|
return sRet;
|
|
}
|
|
|
|
void main()
|
|
{
|
|
object oPC=GetLastUsedBy();
|
|
object oDest;
|
|
string sCombo=fnGetCombination();
|
|
if (sCombo=="3412")
|
|
{ // witches magic room
|
|
oDest=GetWaypointByTag("COVEY_WITCHDEN");
|
|
if (oDest!=OBJECT_INVALID) AssignCommand(oPC,JumpToObject(oDest));
|
|
} // witches magic room
|
|
else if (sCombo=="3333")
|
|
{ // the hut
|
|
oDest=GetWaypointByTag("COVEY_HUTOUT");
|
|
if (oDest!=OBJECT_INVALID) AssignCommand(oPC,JumpToObject(oDest));
|
|
} // the hut
|
|
else if (sCombo=="4242")
|
|
{ // The pantry
|
|
oDest=GetWaypointByTag("COVEY_TP6");
|
|
if (oDest!=OBJECT_INVALID) AssignCommand(oPC,JumpToObject(oDest));
|
|
} // The Pantry
|
|
else if (sCombo=="1234")
|
|
{ // The Curio Display
|
|
oDest=GetWaypointByTag("COVEY_TP4");
|
|
if (oDest!=OBJECT_INVALID) AssignCommand(oPC,JumpToObject(oDest));
|
|
} // The Curio Display
|
|
else if (sCombo=="2233")
|
|
{ // The Mushroom Garden
|
|
oDest=GetWaypointByTag("COVEY_TP3");
|
|
if (oDest!=OBJECT_INVALID) AssignCommand(oPC,JumpToObject(oDest));
|
|
} // The Mushroom Garden
|
|
fnClearPadlock();
|
|
DelayCommand(1.0,DestroyObject(OBJECT_SELF));
|
|
}
|