Rune_PRC8/_module/nss/gen_doorlever_oc.nss
Jaysyn904 d1c309ae63 Initial commit
Initial commit
2024-09-13 09:10:39 -04:00

34 lines
992 B
Plaintext

//::///////////////////////////////////////////////
//:: Generic Door Lever (Open/Close)
//:: m1q2_DoorLever
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This script opens & unlocks the nearest door
or closes & locks it if it is already open.
WARNING: Be careful about players locking
each other into rooms.
*/
//:://////////////////////////////////////////////
//:: Created By: Rob Bartel
//:: Created On: Nov 28, 2001
//:://////////////////////////////////////////////
void main()
{
object oDoor = GetNearestObject(OBJECT_TYPE_DOOR);
int iDoorLocked = GetLocked(oDoor);
ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
if (iDoorLocked == TRUE)
{
AssignCommand(oDoor, ActionOpenDoor(oDoor));
SetLocked(oDoor, FALSE);
}
else
{
AssignCommand(oDoor, ActionCloseDoor(oDoor));
SetLocked(oDoor, TRUE);
}
}