summaryrefslogtreecommitdiff
path: root/src/emap/script.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-10-16 00:01:32 +0300
committerAndrei Karas <akaras@inbox.ru>2015-10-16 00:02:53 +0300
commit42cd207c4c5f0be387f85f4c89bdcf21929a7f84 (patch)
tree59c38e8d75180a252419af867d747191faa361a2 /src/emap/script.c
parentab731862f899dd87b84613ebf12a82cdc73e094f (diff)
downloadplugin-42cd207c4c5f0be387f85f4c89bdcf21929a7f84.tar.gz
plugin-42cd207c4c5f0be387f85f4c89bdcf21929a7f84.tar.bz2
plugin-42cd207c4c5f0be387f85f4c89bdcf21929a7f84.tar.xz
plugin-42cd207c4c5f0be387f85f4c89bdcf21929a7f84.zip
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"
Diffstat (limited to 'src/emap/script.c')
-rw-r--r--src/emap/script.c21
1 files changed, 21 insertions, 0 deletions
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;
+}