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);
int nValue;
// Get the creature who triggered this event.
object oPC = GetLastUsedBy();
// Have text appear over the PC's head.
FloatingTextStringOnCreature("You hear a heavy clicking sound from deep in the sewers.", oPC);
// Set a local integer.
nValue = GetLocalInt(oPC, "lever_sewer") + 1;
SetLocalInt(oPC, "lever_sewer", nValue);
// Only fire once.
if ( GetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF)) )
return;
SetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF), TRUE);
}





Retour en haut







