generated from Jaysyn/ModuleTemplate
Initial commit
Initial commit
This commit is contained in:
40
_module/nss/opw_light_onoff.nss
Normal file
40
_module/nss/opw_light_onoff.nss
Normal file
@@ -0,0 +1,40 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Olander's - Turn Lights On Off (From nw_o2_onoff)
|
||||
// opw_auto_lights
|
||||
// By:Don Anderson
|
||||
// dandersonru@msn.com
|
||||
//
|
||||
// Place this on the OnUsed Event of a Placeable for Lighting
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
if (GetLocalInt(OBJECT_SELF,"NW_L_AMION") == 0)
|
||||
{
|
||||
object oSelf = OBJECT_SELF;
|
||||
PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
|
||||
DelayCommand(0.4,SetPlaceableIllumination(oSelf, TRUE));
|
||||
SetLocalInt(OBJECT_SELF,"NW_L_AMION",1);
|
||||
DelayCommand(0.5,RecomputeStaticLighting(GetArea(oSelf)));
|
||||
effect eLight = EffectVisualEffect(VFX_DUR_LIGHT_YELLOW_20);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLight, oSelf);
|
||||
}
|
||||
else
|
||||
{
|
||||
object oSelf = OBJECT_SELF;
|
||||
PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
|
||||
DelayCommand(0.4,SetPlaceableIllumination(oSelf, FALSE));
|
||||
SetLocalInt(OBJECT_SELF,"NW_L_AMION",0);
|
||||
DelayCommand(0.9,RecomputeStaticLighting(GetArea(oSelf)));
|
||||
effect eEffect = GetFirstEffect(oSelf);
|
||||
while (GetIsEffectValid(eEffect) == TRUE)
|
||||
{
|
||||
if (GetEffectType(eEffect) == EFFECT_TYPE_VISUALEFFECT) RemoveEffect(oSelf, eEffect);
|
||||
eEffect = GetNextEffect(oSelf);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user