diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-02-06 09:45:14 -0200 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-02-06 09:45:14 -0200 |
commit | 8ee962687856ba7a76b6761aef345b4189c4fbe0 (patch) | |
tree | 033fc80caa6a6c4302c41c8520b5ded04cd3467e | |
parent | c8d3332047fa3d7100452f3edd75bce01ad338b2 (diff) | |
download | serverdata-8ee962687856ba7a76b6761aef345b4189c4fbe0.tar.gz serverdata-8ee962687856ba7a76b6761aef345b4189c4fbe0.tar.bz2 serverdata-8ee962687856ba7a76b6761aef345b4189c4fbe0.tar.xz serverdata-8ee962687856ba7a76b6761aef345b4189c4fbe0.zip |
@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.
-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); |