summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-09-22 16:11:06 -0300
committerJesusaves <cpntb1@ymail.com>2018-09-22 16:11:06 -0300
commit46389c46f3d9fd0bbb630fcfe44adbbfa67dfb3c (patch)
treeff8ad9a70d912efd8add348b06e60d9c4f479383
parent90a246e7968c5781a0f6169de209b05567ab6658 (diff)
downloadserverdata-46389c46f3d9fd0bbb630fcfe44adbbfa67dfb3c.tar.gz
serverdata-46389c46f3d9fd0bbb630fcfe44adbbfa67dfb3c.tar.bz2
serverdata-46389c46f3d9fd0bbb630fcfe44adbbfa67dfb3c.tar.xz
serverdata-46389c46f3d9fd0bbb630fcfe44adbbfa67dfb3c.zip
Register Nivalis Port on weather cycle, update @wclear, and implement @wreset (ADM Only)
-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;