summaryrefslogtreecommitdiff
path: root/npc/functions/weather.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/weather.txt')
-rw-r--r--npc/functions/weather.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/npc/functions/weather.txt b/npc/functions/weather.txt
index d15cb1fb4..482ab5243 100644
--- a/npc/functions/weather.txt
+++ b/npc/functions/weather.txt
@@ -47,6 +47,7 @@ OnInit:
bindatcmd "wevil", "#WeatherCore::OnEvil", 80, 80, 1;
bindatcmd "wnight", "#WeatherCore::OnNight", 80, 80, 1;
bindatcmd "wclear", "#WeatherCore::OnClear", 80, 80, 1;
+ bindatcmd "wreset", "#WeatherCore::OnReset", 99, 99, 1;
// Determine which maps are subject to weather, and how weather works:
@@ -78,6 +79,7 @@ OnInit:
// Icelands
htput(.wcore, "001-7", "iceland");
htput(.wcore, "019-1", "iceland");
+ htput(.wcore, "019-2", "iceland");
debugmes "[Weather.sys] Total Maps = " + htsize(.wcore);
// No "end" here, so server starts with weather
@@ -196,6 +198,21 @@ OnEvil:
// Clear works on any map
OnClear:
getmapxy(.@key$,.@a,.@b,0);
+ .@mk=getmapmask(.@key$);
+ if (.@mk & MASK_RAIN)
+ .@mk=.@mk^MASK_RAIN;
+ if (.@mk & MASK_SANDSTORM)
+ .@mk=.@mk^MASK_SANDSTORM;
+ if (.@mk & MASK_SNOW)
+ .@mk=.@mk^MASK_SNOW;
+ if (.@mk & MASK_NIGHT)
+ .@mk=.@mk^MASK_NIGHT;
+ setmapmask(.@key$, .@mk);
+ end;
+
+// Reset the whole map, including season, event and weather masks
+OnReset:
+ getmapxy(.@key$,.@a,.@b,0);
setmapmask(.@key$, MASK_NONE);
end;