PoA_PRC8/_module/nss/membercheck3.nss

36 lines
843 B
Plaintext
Raw Permalink Normal View History

2022-10-07 14:20:31 -04:00
void main()
{
// * 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);
}
else
{
ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
}
// * Store New State
SetLocalInt(OBJECT_SELF,"X2_L_PLC_ACTIVATED_STATE",!nActive);
object oPC = GetLastOpenedBy();
object oTarget;
location lTarget;
if(!GetIsPC(oPC)) return;
if (GetLocalInt(oPC, "IMemberA")<= 0)
{
oTarget = GetWaypointByTag("home");
lTarget = GetLocation(oTarget);
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToLocation(lTarget));
}
}