summaryrefslogtreecommitdiff
path: root/src/emap/script_buildins.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-05 16:40:07 +0000
committerAndrei Karas <akaras@inbox.ru>2016-09-05 16:40:07 +0000
commit0e6ece8a66e20e35229f1027d2d1135f0c6d943a (patch)
tree490f2288958a4a00181d12ec44f59f89c44cb77d /src/emap/script_buildins.c
parentf8f24eccf6562af825f298851710848c2212cf61 (diff)
parentafe633e723eec6a856ef2c4675d2e1b69d1fa9f4 (diff)
downloadevol-hercules-0e6ece8a66e20e35229f1027d2d1135f0c6d943a.tar.gz
evol-hercules-0e6ece8a66e20e35229f1027d2d1135f0c6d943a.tar.bz2
evol-hercules-0e6ece8a66e20e35229f1027d2d1135f0c6d943a.tar.xz
evol-hercules-0e6ece8a66e20e35229f1027d2d1135f0c6d943a.zip
Merge branch 'slide' into 'master' s20160912s20160911
add slide buildin See merge request !3
Diffstat (limited to 'src/emap/script_buildins.c')
-rw-r--r--src/emap/script_buildins.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c
index 75c3308..1acae6b 100644
--- a/src/emap/script_buildins.c
+++ b/src/emap/script_buildins.c
@@ -2175,3 +2175,27 @@ BUILDIN(input)
}
return true;
}
+
+BUILDIN(slide)
+{
+ getSDReturn(false);
+ const int x = script_getnum(st,2);
+ const int y = script_getnum(st,3);
+ const int16 m = sd->bl.m;
+
+ if (x < 0 || x >= map->list[m].xs || y < 0 || y >= map->list[m].ys)
+ {
+ ShowError("slide: attempt to place player %s (%d:%d) on invalid coordinates (%d,%d)\n", sd->status.name, sd->status.account_id, sd->status.char_id, x, y);
+ script->reportsrc(st);
+ return false;
+ }
+
+ if (map->getcell(m, &sd->bl, x, y, CELL_CHKNOPASS) && pc_get_group_level(sd) < battle->bc->gm_ignore_warpable_area)
+ {
+ return false;
+ }
+
+ clif->slide(&sd->bl, x, y);
+ unit->movepos(&sd->bl, x, y, 1, 0);
+ return true;
+}