diff options
-rw-r--r-- | npc/functions/weather.txt | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/npc/functions/weather.txt b/npc/functions/weather.txt index 17894535e..cc7285721 100644 --- a/npc/functions/weather.txt +++ b/npc/functions/weather.txt @@ -7,6 +7,20 @@ 000-0,0,0,0 script #WeatherCore NPC_HIDDEN,{ end; +/* + * removemapflag("<map name>", <flag>) + * setmapflag("<map name>", <flag>{, <val>}) + * getmapflag("<map name>", <flag>) + + mf_snow: 16 + + mf_jexp: 39 + mf_bexp: 40 + + setmapflag(.@key$, mf_nightenabled); + removemapflag(.@key$, mf_nightenabled); + +*/ OnInit: // Bind commands @@ -95,10 +109,13 @@ OnMinute45: // Is it night time? // For convenience, night time is from 00:15 to 00:45, every hour. // 2 = GETTIME_MINUTE - if (gettime(2) >= 15 && gettime(2) < 45) + if (gettime(2) >= 15 && gettime(2) < 45) { + setmapflag(.@key$, mf_nightenabled); addmapmask .@key$, MASK_NIGHT; - else if (getmapmask(.@key$) & MASK_NIGHT) + } else if (getmapmask(.@key$) & MASK_NIGHT) { + removemapflag(.@key$, mf_nightenabled); removemapmask .@key$, MASK_NIGHT; + } } htidelete(.@hti); |