summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-29 18:18:16 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-29 18:18:16 +0300
commitc4d320e72a4060408c97a0207e9b82433cec9418 (patch)
treeb9fc8bf0551152ab30da87bb7ec281dccf498611 /src/map/script.c
parentf518402fc06a3bc4824af47e6c979ce649326cf4 (diff)
downloadevol-hercules-c4d320e72a4060408c97a0207e9b82433cec9418.tar.gz
evol-hercules-c4d320e72a4060408c97a0207e9b82433cec9418.tar.bz2
evol-hercules-c4d320e72a4060408c97a0207e9b82433cec9418.tar.xz
evol-hercules-c4d320e72a4060408c97a0207e9b82433cec9418.zip
Add script command to set distance to npc where clicks/selection can work.
New script command: setnpcdistance N
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index e7a3df4..51e5818 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -24,8 +24,10 @@
#include "map/scriptdefines.h"
#include "map/send.h"
#include "map/data/mapd.h"
+#include "map/data/npcd.h"
#include "map/data/session.h"
#include "map/struct/mapdext.h"
+#include "map/struct/npcdext.h"
#include "map/struct/sessionext.h"
#include "map/utils/formatutils.h"
@@ -648,3 +650,17 @@ BUILDIN(getPcSit)
script_pushint(st, pc_issit (sd));
return true;
}
+
+BUILDIN(setNpcDistance)
+{
+ struct npc_data *nd = (struct npc_data *) map->id2bl (st->oid);
+ if (!nd)
+ return false;
+
+ struct NpcdExt *data = npcd_get(nd);
+ if (!data)
+ return false;
+
+ data->areaSize = script_getnum(st, 2);
+ return true;
+}