Initial Commit

Initial Commit.
This commit is contained in:
Jaysyn904
2025-09-14 15:40:46 -04:00
parent 7083b33d71
commit 1eefc84201
19230 changed files with 11539227 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
////////////////////////////////////////////////////////////////////////////////
// Automatically turn lights on during the night or off during the day
////////////////////////////////////////////////////////////////////////////////
// Modified By: Stephen M. LaBar, Jr.
// Modified On: 08/07/2002
////////////////////////////////////////////////////////////////////////////////
// Currently this goes into the OnHeartbeat event handler for an invisible
// object located in a high traffic area. For ease of use I named my invisible
// object LightOnOff.
////////////////////////////////////////////////////////////////////////////////
// Make a custom placeable light with the tag LampPost and place it in whatever
// area you want in your module.
////////////////////////////////////////////////////////////////////////////////
void main()
{
object oLamp;
int nNth=0;
oLamp = GetObjectByTag("LampPost", nNth);
int validDay = GetIsDawn() || GetIsDay();
int validNight = GetIsDusk() || GetIsNight();
// This part of the script only runs one time.
if (GetLocalInt (OBJECT_SELF,"RUNONCE") != 1)
{
while (GetIsObjectValid(oLamp))
{
SetLocalInt(OBJECT_SELF,"RUNONCE",1);
PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
SetPlaceableIllumination(oLamp, FALSE);
SetLocalInt(OBJECT_SELF,"NW_L_AMION",0);
RecomputeStaticLighting(GetArea(oLamp));
nNth++;
oLamp = GetObjectByTag("LampPost", nNth);
};
}
// This part of the script only runs once at validNight.
if (validNight && GetLocalInt(OBJECT_SELF, "NW_L_AMION") == 0 )
{
while (GetIsObjectValid(oLamp))
{
PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
SetPlaceableIllumination(oLamp, TRUE);
SetLocalInt(OBJECT_SELF,"NW_L_AMION",1);
RecomputeStaticLighting(GetArea(oLamp));
nNth++;
oLamp = GetObjectByTag("LampPost", nNth);
};
}
// This part of the script only runs once at validDay.
if (validDay && GetLocalInt(OBJECT_SELF, "NW_L_AMION") == 1)
{
while (GetIsObjectValid(oLamp))
{
PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
SetPlaceableIllumination(oLamp, FALSE);
SetLocalInt(OBJECT_SELF,"NW_L_AMION",0);
RecomputeStaticLighting(GetArea(oLamp));
nNth++;
oLamp = GetObjectByTag("LampPost", nNth);
};
}
}