generated from Jaysyn/ModuleTemplate
Initial Commit
Initial Commit
This commit is contained in:
25
_module/nss/dynamic_lamp.nss
Normal file
25
_module/nss/dynamic_lamp.nss
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "x0_i0_petrify"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oLamp = OBJECT_SELF;
|
||||
effect eLight = EffectVisualEffect(VFX_DUR_LIGHT_YELLOW_20);
|
||||
int oTime = GetLocalInt(oLamp, "timeofday");
|
||||
int oTime2 = GetLocalInt(oLamp, "timeofday2");
|
||||
|
||||
if (((GetIsDay()==TRUE)||(GetIsDawn()==TRUE))&&(oTime!=1))
|
||||
{
|
||||
ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
|
||||
RemoveEffectOfType(oLamp, GetEffectType(eLight));
|
||||
SetLocalInt(oLamp, "timeofday", 1);
|
||||
SetLocalInt(oLamp, "timeofday2", 0);
|
||||
}
|
||||
|
||||
if (((GetIsNight()==TRUE)||(GetIsDusk()==TRUE))&&(oTime2!=1))
|
||||
{
|
||||
ActionPlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLight, oLamp);
|
||||
SetLocalInt(oLamp, "timeofday2", 1);
|
||||
SetLocalInt(oLamp, "timeofday", 0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user