diff options
author | Jesusaves <cpntb1@ymail.com> | 2018-06-19 09:01:15 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2018-06-19 09:01:15 -0300 |
commit | 577b6b5249794a5f3b5c9600c637c8e82429f1dd (patch) | |
tree | 2f130f3676c45e1bf660de2874a319f77f94ec5a /npc | |
parent | a592704f4d2baa8f56f7dd6ded23fa4c25b2018d (diff) | |
download | serverdata-577b6b5249794a5f3b5c9600c637c8e82429f1dd.tar.gz serverdata-577b6b5249794a5f3b5c9600c637c8e82429f1dd.tar.bz2 serverdata-577b6b5249794a5f3b5c9600c637c8e82429f1dd.tar.xz serverdata-577b6b5249794a5f3b5c9600c637c8e82429f1dd.zip |
Sanitization.
Useful commands: @wsnow @wrain @wsand @wevil @wnight @wclear
Weather won't affect anything on gameplay yet.
Diffstat (limited to 'npc')
-rw-r--r-- | npc/functions/weather.txt | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/npc/functions/weather.txt b/npc/functions/weather.txt index ea10a3c0d..17894535e 100644 --- a/npc/functions/weather.txt +++ b/npc/functions/weather.txt @@ -7,6 +7,7 @@ 000-0,0,0,0 script #WeatherCore NPC_HIDDEN,{ end; + OnInit: // Bind commands bindatcmd "wsnow", "#WeatherCore::OnSnow", 80, 80, 1; @@ -104,35 +105,48 @@ OnMinute45: debugmes "[Weather.sys] Weather reloaded"; end; + // Function to check stuff + // WeatherSwitch ( MASK ) + function WeatherSwitch { + // Get map + getmapxy(.@key$,.@a,.@b,0); + + // Sanitize + .@m$ = htget(.wcore, .@key$, "Not found"); + + // Change Weather or abort + if (.@m$ == "Not found") + dispbottom l("Command not permitted on this map! Check npc/functions/weather.conf"); + else + addmapmask(.@key$, MASK_RAIN); + return; + } + // Some commands, for GMs manually override weather OnRain: - getmapxy(.@key$,.@a,.@b,0); - addmapmask .@key$, MASK_RAIN; + WeatherSwitch(MASK_RAIN); end; OnSand: - getmapxy(.@key$,.@a,.@b,0); - addmapmask .@key$, MASK_SANDSTORM; + WeatherSwitch(MASK_SANDSTORM); end; OnSnow: - getmapxy(.@key$,.@a,.@b,0); - addmapmask .@key$, MASK_SNOW; + WeatherSwitch(MASK_SNOW); end; OnNight: - getmapxy(.@key$,.@a,.@b,0); - addmapmask .@key$, MASK_NIGHT; + WeatherSwitch(MASK_NIGHT); end; OnEvil: - getmapxy(.@key$,.@a,.@b,0); - addmapmask .@key$, MASK_EVILSANCTUM; + WeatherSwitch(MASK_EVILSANCTUM); end; +// Clear works on any map OnClear: getmapxy(.@key$,.@a,.@b,0); - setmapmask .@key$, MASK_NONE; + setmapmask(.@key$, MASK_NONE); end; } |