From 46389c46f3d9fd0bbb630fcfe44adbbfa67dfb3c Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 22 Sep 2018 16:11:06 -0300 Subject: Register Nivalis Port on weather cycle, update @wclear, and implement @wreset (ADM Only) --- npc/functions/weather.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'npc/functions/weather.txt') 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 @@ -195,6 +197,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; -- cgit v1.2.3-60-g2f50