From c4d320e72a4060408c97a0207e9b82433cec9418 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 29 Nov 2014 18:18:16 +0300 Subject: Add script command to set distance to npc where clicks/selection can work. New script command: setnpcdistance N --- src/map/script.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/map/script.c') 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; +} -- cgit v1.2.3-70-g09d2