summaryrefslogtreecommitdiff
path: root/src/emap/script.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-27 18:46:45 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-27 18:46:45 +0300
commit2b4cd428adf9ca821776e101278a4afb26dd2b66 (patch)
tree5390e03e95ab5a1ed06e024b301a7159799774e7 /src/emap/script.c
parenta04eeef27f16ba4fbe31e5e178313e6e718af4c8 (diff)
downloadplugin-2b4cd428adf9ca821776e101278a4afb26dd2b66.tar.gz
plugin-2b4cd428adf9ca821776e101278a4afb26dd2b66.tar.bz2
plugin-2b4cd428adf9ca821776e101278a4afb26dd2b66.tar.xz
plugin-2b4cd428adf9ca821776e101278a4afb26dd2b66.zip
Allow get/set npc distance by using variable '.distance'.
Diffstat (limited to 'src/emap/script.c')
-rw-r--r--src/emap/script.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/emap/script.c b/src/emap/script.c
index bb414b1..56c22b8 100644
--- a/src/emap/script.c
+++ b/src/emap/script.c
@@ -66,6 +66,11 @@ void escript_set_reg_npc_num(struct script_state* st, struct reg_db *n, int64 *n
nd->vd->sex = *val;
clif->spawn(&nd->bl);
}
+ else if (!strcmp(name, ".distance"))
+ {
+ getND();
+ nd->area_size = *val;
+ }
}
int escript_get_val_npcscope_num(struct script_state* st, struct reg_db *n, struct script_data* data)
@@ -81,8 +86,15 @@ int escript_get_val_npcscope_num(struct script_state* st, struct reg_db *n, stru
else if (!strcmp(name, ".sex"))
{
getNDReturn(0);
+ hookStop();
return nd->vd->sex;
}
+ else if (!strcmp(name, ".distance"))
+ {
+ getNDReturn(0);
+ hookStop();
+ return nd->area_size;
+ }
return 0;
}