From 8ee962687856ba7a76b6761aef345b4189c4fbe0 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Wed, 6 Feb 2019 09:45:14 -0200 Subject: @wset allows to manually enable/disable a map mask with total control. Dangerous command. Refer to db/constants.conf. Never, ever disable mask 1. You have been warned. --- npc/functions/weather.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/npc/functions/weather.txt b/npc/functions/weather.txt index 9e4006d08..15c9a4adc 100644 --- a/npc/functions/weather.txt +++ b/npc/functions/weather.txt @@ -50,6 +50,7 @@ OnInit: bindatcmd "wnight", "#WeatherCore::OnNight", 80, 80, 1; bindatcmd "wclear", "#WeatherCore::OnClear", 80, 80, 1; bindatcmd "wreset", "#WeatherCore::OnReset", 99, 99, 1; + bindatcmd "wset", "#WeatherCore::OnManual", 99, 99, 1; // Determine which maps are subject to weather, and how weather works: @@ -224,6 +225,26 @@ OnEvil: WeatherSwitch(MASK_EVILSANCTUM); end; +OnManual: + if (!.@atcmd_numparameters) { + dispbottom l("Syntax: @wset "); + end; + } + + // Never allow negative numbers, or to disable map mask 1 (never, EVER, do such insane thing) + .@rq = atoi(.@atcmd_parameters$[0]); + if (.@rq <= 1 || .@rq % 2 == 1) { + dispbottom l("Invalid map mask"); + end; + } + + // + getmapxy(.@key$,.@a,.@b,0); + .@mk=getmapmask(.@key$); + .@mk=.@mk^.@rq; + setmapmask(.@key$, .@mk); + end; + // Clear works on any map OnClear: getmapxy(.@key$,.@a,.@b,0); -- cgit v1.2.3-70-g09d2