From 42cd207c4c5f0be387f85f4c89bdcf21929a7f84 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 16 Oct 2015 00:01:32 +0300 Subject: Add script function and packet to set group of cells to given mask (gat value) New script function: setcells "map name", x1, y1, x2, y2, mask, "wall name" --- src/emap/script.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/emap/script.c') diff --git a/src/emap/script.c b/src/emap/script.c index 7eaa074..530a13f 100644 --- a/src/emap/script.c +++ b/src/emap/script.c @@ -26,6 +26,7 @@ #include "emap/script.h" #include "emap/clif.h" #include "emap/lang.h" +#include "emap/map.h" #include "emap/scriptdefines.h" #include "emap/send.h" #include "emap/data/bgd.h" @@ -1806,3 +1807,23 @@ BUILDIN(checkNpcCell) return true; } + +BUILDIN(setCells) +{ + int m; + + const char *mapname = script_getstr(st, 2); + int x1 = script_getnum(st, 3); + int y1 = script_getnum(st, 4); + int x2 = script_getnum(st, 5); + int y2 = script_getnum(st, 6); + int mask = script_getnum(st, 7); + const char *name = script_getstr(st, 8); + + if ((m = map->mapname2mapid(mapname)) < 0) + return true; // Invalid Map + + emap_iwall_set2(m, x1, y1, x2, y2, mask, name); + + return true; +} -- cgit v1.2.3-70-g09d2