diff options
Diffstat (limited to 'npc/functions/weather.txt')
-rw-r--r-- | npc/functions/weather.txt | 21 |
1 files changed, 21 insertions, 0 deletions
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 <map_mask>"); + 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; + } + + // <Insert a helpful comment here> + 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); |