64 lines
1.8 KiB
Plaintext
64 lines
1.8 KiB
Plaintext
void main()
|
|
{
|
|
PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
|
|
PlaySound("gui_magbag_full");
|
|
string sCombination = GetLocalString(GetArea(OBJECT_SELF), "combination");
|
|
string sCodeEntered = GetLocalString(GetArea(OBJECT_SELF), "codeentered");
|
|
sCodeEntered = sCodeEntered + GetStringRight(GetTag(OBJECT_SELF) ,1);
|
|
if(sCodeEntered == sCombination && sCodeEntered != "")
|
|
{
|
|
PlaySound("as_cv_flute1");
|
|
ExecuteScript("di_dooropener", GetObjectByTag("di_f2CorriDoor"));
|
|
}
|
|
else if(GetStringLength(sCodeEntered) > 7)
|
|
{
|
|
PlaySound("gui_cannotequip");
|
|
sCodeEntered = "";
|
|
int i;
|
|
for(i=1; i<=8; i++)
|
|
{
|
|
object oCrystal = GetObjectByTag("DI_C" + IntToString(i));
|
|
ExecuteScript("di_cflash", oCrystal);
|
|
}
|
|
// spawn ugly critter here...
|
|
location lLoc = GetLocation(GetObjectByTag("DI_chain"));
|
|
int c = Random(9);
|
|
string sResRef;
|
|
if(c==0)
|
|
{
|
|
sResRef = "di_dread_viper";
|
|
}
|
|
else if (c==1)
|
|
{
|
|
sResRef = "di_dread_crab";
|
|
}
|
|
else if (c==2)
|
|
{
|
|
sResRef = "di_dread_scorpio";
|
|
}
|
|
else if (c==3)
|
|
{
|
|
sResRef = "di_filthy_wretch";
|
|
}
|
|
else if (c==4)
|
|
{
|
|
sResRef = "di_flotsam";
|
|
CreateObject(OBJECT_TYPE_CREATURE, "di_getsam", lLoc, FALSE);
|
|
}
|
|
else if (c==5)
|
|
{
|
|
sResRef = "di_mangy_curr";
|
|
}
|
|
else if (c==6)
|
|
{
|
|
sResRef = "di_sharieking_el";
|
|
}
|
|
else
|
|
{
|
|
sResRef = "di_scabrous_dog";
|
|
}
|
|
CreateObject(OBJECT_TYPE_CREATURE, sResRef, lLoc, FALSE);
|
|
}
|
|
SetLocalString(GetArea(OBJECT_SELF), "codeentered", sCodeEntered);
|
|
}
|