summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/script_commands.txt11
-rw-r--r--src/map/script.c11
2 files changed, 22 insertions, 0 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index 3467a5366..36b52988b 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -7558,6 +7558,17 @@ config, and will not work properly if the NPC has a mob sprite.
---------------------------------------
+*setnpcdistance <distance>
+
+This command can reduce distance from where npc can be clicked.
+Usefull to use from OnInit event.
+
+ // Set distance to one tile on server load
+ OnInit:
+ setnpcdistance 1;
+
+---------------------------------------
+
*day;
*night;
diff --git a/src/map/script.c b/src/map/script.c
index a458bab49..5be4347ec 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -13311,6 +13311,16 @@ BUILDIN(npcstop) {
return true;
}
+BUILDIN(setnpcdistance) {
+ struct npc_data *nd = (struct npc_data *) map->id2bl (st->oid);
+ if (!nd)
+ return false;
+
+ nd->area_size = script_getnum(st, 2);
+
+ return true;
+}
+
/*==========================================
* getlook char info. getlook(arg)
@@ -19378,6 +19388,7 @@ void script_parse_builtin(void) {
BUILDIN_DEF(npcspeed,"i"), // [Valaris]
BUILDIN_DEF(npcwalkto,"ii"), // [Valaris]
BUILDIN_DEF(npcstop,""), // [Valaris]
+ BUILDIN_DEF(setnpcdistance,"i"), // [4144]
BUILDIN_DEF(getmapxy,"rrri?"), //by Lorky [Lupus]
BUILDIN_DEF(checkoption1,"i"),
BUILDIN_DEF(checkoption2,"i"),