summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-09-21 00:14:12 -0300
committerJesusaves <cpntb1@ymail.com>2018-09-21 00:14:12 -0300
commitddb98d5e071ab90491237ac7a0d5159a695fbc42 (patch)
treeef37f4e2eff14a315b793486b5698d78b0276304 /npc/functions
parentee1e72d4d174af52287aaaf8e0edded23f237222 (diff)
downloadserverdata-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.txt18
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,{