Initial commit. Updated release archive.
This commit is contained in:
32
_module/nss/door_switch_ou.nss
Normal file
32
_module/nss/door_switch_ou.nss
Normal file
@@ -0,0 +1,32 @@
|
||||
void main()
|
||||
{
|
||||
//SCD_SWITCH_XXXXXXXX
|
||||
object oPC=GetLastUsedBy();
|
||||
string tag=GetTag(OBJECT_SELF);
|
||||
int length=GetStringLength(tag);
|
||||
string right=GetStringRight(tag, length-14);
|
||||
string time=GetStringLeft(tag, 14);
|
||||
time=GetStringRight(time, 2);
|
||||
int minutes=StringToInt(time);
|
||||
float seconds=IntToFloat(minutes)*60;
|
||||
// SpeakString(right, TALKVOLUME_TALK);
|
||||
string total="SCD_DOOR_" + right;
|
||||
// SpeakString(total, TALKVOLUME_TALK);
|
||||
object oDoor=GetObjectByTag(total, 0);
|
||||
int i=0;
|
||||
while(GetIsObjectValid(oDoor))
|
||||
{
|
||||
i++;
|
||||
if(i==1)
|
||||
{
|
||||
AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE));
|
||||
AssignCommand(OBJECT_SELF, PlaySound("as_dr_stonlgcl1"));
|
||||
FloatingTextStringOnCreature("You hear a door open somewhere nearby", oPC, TRUE);
|
||||
}
|
||||
SetLocked(oDoor, FALSE);
|
||||
ActionOpenDoor(oDoor);
|
||||
DelayCommand(seconds, ActionCloseDoor(oDoor));
|
||||
DelayCommand(seconds, SetLocked(oDoor, TRUE));
|
||||
oDoor=GetObjectByTag(total, i);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user