48 lines
1.3 KiB
Plaintext
48 lines
1.3 KiB
Plaintext
/////////////////////////////////////////////////////////////////////////////
|
|
// Close 10 sec + lock
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
void fnEscape(object oNPC,object oDest)
|
|
{ //
|
|
if (GetLocalInt(oNPC,"bEscapeShout")==FALSE)
|
|
{ // say I'm free
|
|
if (d4()<3) AssignCommand(oNPC,SpeakString("I'm free!!"));
|
|
SetLocalInt(oNPC,"bEscapeShout",TRUE);
|
|
} // say I'm free
|
|
if (GetIsObjectValid(oNPC))
|
|
{ // valid NPC
|
|
if (GetDistanceBetween(oNPC,oDest)>3.0)
|
|
{ // move
|
|
AssignCommand(oNPC,ActionMoveToObject(oDest,TRUE,1.0));
|
|
DelayCommand(8.0,fnEscape(oNPC,oDest));
|
|
} // move
|
|
else
|
|
{ //
|
|
DestroyObject(oNPC);
|
|
} //
|
|
} // valid NPC
|
|
} // fnEscape()
|
|
|
|
|
|
|
|
void main()
|
|
{
|
|
object oMe=OBJECT_SELF;
|
|
object oWP=GetWaypointByTag("BACKUP_GUARDS");
|
|
object oOb;
|
|
int nN=1;
|
|
DelayCommand(60.0,AssignCommand(oMe,ActionCloseDoor(oMe)));
|
|
DelayCommand(62.0,SetLocked(oMe,TRUE));
|
|
DelayCommand(62.5,AssignCommand(oMe,ActionSpeakString("*click*")));
|
|
if (GetIsObjectValid(oWP))
|
|
{ // make prisoners escape
|
|
oOb=GetNearestObjectByTag("PRISONERS",oMe,nN);
|
|
while(GetIsObjectValid(oOb))
|
|
{ //
|
|
fnEscape(oOb,oWP);
|
|
nN++;
|
|
oOb=GetNearestObjectByTag("PRISONERS",oMe,nN);
|
|
} //
|
|
} // make prisoners escape
|
|
}
|