HoS_PRC8/_mod/_module/nss/use_maze_exit.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

25 lines
848 B
Plaintext

//////////////////////////////////////////////////////////////////////////
// Use maze exit door
//////////////////////////////////////////////////////////////////////////
void main()
{
object oPC=GetLastUsedBy();
object oMe=OBJECT_SELF;
object oRet=GetLocalObject(oPC,"oMazeReturn");
if (GetIsOpen(oMe)==TRUE)
{ // go through door
if (oRet!=OBJECT_INVALID)
{ // teleport
AssignCommand(oPC,ClearAllActions());
AssignCommand(oPC,JumpToObject(oRet));
AssignCommand(oPC,DestroyObject(oRet));
AssignCommand(oPC,DeleteLocalObject(oPC,"oMazeReturn"));
} // teleport
} // go through door
else
{ // open door
ActionPlayAnimation(ANIMATION_PLACEABLE_OPEN,1.0,15.0);
DelayCommand(15.0,ActionPlayAnimation(ANIMATION_PLACEABLE_CLOSE,1.0,15.0));
} // open door
}