generated from Jaysyn/ModuleTemplate
Initial Commit
Initial Commit
This commit is contained in:
35
_module/nss/lever.nss
Normal file
35
_module/nss/lever.nss
Normal file
@@ -0,0 +1,35 @@
|
||||
void main()
|
||||
{
|
||||
object oPC = GetLastUsedBy();
|
||||
object oDummy = GetNearestObjectByTag("ArmorStand");
|
||||
int nActive = GetLocalInt (OBJECT_SELF,"X2_L_PLC_ACTIVATED_STATE");
|
||||
int iSetting;
|
||||
|
||||
if (GetReputation(oDummy, oPC) > 10)
|
||||
{
|
||||
iSetting = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
iSetting = 50;
|
||||
}
|
||||
|
||||
if (!nActive)
|
||||
{
|
||||
ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
|
||||
SetStandardFactionReputation(STANDARD_FACTION_COMMONER, iSetting, oPC);
|
||||
ClearPersonalReputation(oPC, oDummy);
|
||||
AssignCommand(oDummy, ClearAllActions());
|
||||
}
|
||||
else
|
||||
{
|
||||
ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
|
||||
SetStandardFactionReputation(STANDARD_FACTION_COMMONER, iSetting, oPC);
|
||||
ClearPersonalReputation(oPC, oDummy);
|
||||
AssignCommand(oDummy, ClearAllActions());
|
||||
}
|
||||
// Store New State
|
||||
SetLocalInt(OBJECT_SELF,"X2_L_PLC_ACTIVATED_STATE",!nActive);
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user