diff options
author | Jesusaves <cpntb1@ymail.com> | 2018-09-21 00:14:12 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2018-09-21 00:14:12 -0300 |
commit | ddb98d5e071ab90491237ac7a0d5159a695fbc42 (patch) | |
tree | ef37f4e2eff14a315b793486b5698d78b0276304 /npc/functions | |
parent | ee1e72d4d174af52287aaaf8e0edded23f237222 (diff) | |
download | serverdata-ddb98d5e071ab90491237ac7a0d5159a695fbc42.tar.gz serverdata-ddb98d5e071ab90491237ac7a0d5159a695fbc42.tar.bz2 serverdata-ddb98d5e071ab90491237ac7a0d5159a695fbc42.tar.xz serverdata-ddb98d5e071ab90491237ac7a0d5159a695fbc42.zip |
Try a different day/night cycle
Diffstat (limited to 'npc/functions')
-rw-r--r-- | npc/functions/weather.txt | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/npc/functions/weather.txt b/npc/functions/weather.txt index 464af8c96..9a589dea1 100644 --- a/npc/functions/weather.txt +++ b/npc/functions/weather.txt @@ -6,11 +6,23 @@ // is_night() function script is_night { - // For convenience, night time is from 00:15 to 00:45, every hour. + // Night time depends on season. + // Summer: Day > Night + // Winter: Night > Day + // Autumn/Spring: Day = Night + // + // By default, each period lasts a whole hour, give or take 15 minutes (?) // 2 = GETTIME_MINUTE - if (gettime(2) >= 15 && gettime(2) < 45) + // 3 = GETTIME_HOUR + if (gettime(3) % 1) { + if (season() == SUMMER && gettime(2) <= 15) + return 0; return 1; - return 0; + } else { + if (season() == WINTER && gettime(2) >= 45) + return 1; + return 0; + } } 000-0,0,0,0 script #WeatherCore NPC_HIDDEN,{ |