Aantioch_Infernum/_module/nss/haven_lever.nss
Jaysyn904 22947ad4b6 Initial Upload
Initial Upload
2023-08-08 16:22:17 -04:00

41 lines
1.2 KiB
Plaintext

//::///////////////////////////////////////////////
//:: OnUse: Toggle Activate
//:: x2_plc_used_act
//:: Copyright (c) 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*
Simple script to toggle the placeable animation
state for placeables that support Activate and
DeActivate Animations
Placeables are best set to be DeActivated by
default with this script.
*/
//:://////////////////////////////////////////////
//:: Created By: Georg Zoeller
//:: Created On: 2003-09-10
//:://////////////////////////////////////////////
void main()
{
object oPC = GetLastUsedBy();
object oTarget = GetObjectByTag("WATERPLANEDOOR");
// * note that nActive == 1 does not necessarily mean the placeable is active
// * that depends on the initial state of the object
int nActive = GetLocalInt (OBJECT_SELF,"X2_L_PLC_ACTIVATED_STATE");
// * Play Appropriate Animation
if (!nActive)
{
ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
SetLocked(oTarget, FALSE);
AssignCommand(oTarget, ActionOpenDoor(oTarget));
}
else
{
ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
}
// * Store New State
SetLocalInt(OBJECT_SELF,"X2_L_PLC_ACTIVATED_STATE",!nActive);
}