summaryrefslogtreecommitdiff
path: root/src/emap/script.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-28 15:24:58 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-28 15:24:58 +0300
commitd6cf585005cb59e3b3cebf026b60de42dfebcf6e (patch)
tree0a72b706c314d5defc5a22d3a89b1914bb0a4086 /src/emap/script.c
parentf20f9547576153b536be337e47e7a6b79500e2c2 (diff)
downloadplugin-d6cf585005cb59e3b3cebf026b60de42dfebcf6e.tar.gz
plugin-d6cf585005cb59e3b3cebf026b60de42dfebcf6e.tar.bz2
plugin-d6cf585005cb59e3b3cebf026b60de42dfebcf6e.tar.xz
plugin-d6cf585005cb59e3b3cebf026b60de42dfebcf6e.zip
Allow get/set npc sit state by variable '.sit'.
Diffstat (limited to 'src/emap/script.c')
-rw-r--r--src/emap/script.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/emap/script.c b/src/emap/script.c
index 81593dc..1b6b9f0 100644
--- a/src/emap/script.c
+++ b/src/emap/script.c
@@ -110,7 +110,6 @@ void escript_set_reg_npc_num(struct script_state* st, struct reg_db *n, int64 *n
else if (!strcmp(name, ".speed"))
{
getND();
-
unit->bl2ud2(&nd->bl); // ensure nd->ud is safe to edit
nd->speed = *val;
nd->ud->state.speed_changed = 1;
@@ -122,6 +121,13 @@ void escript_set_reg_npc_num(struct script_state* st, struct reg_db *n, int64 *n
script->reportsrc(st);
hookStop();
}
+ else if (!strcmp(name, ".sit"))
+ {
+ getND();
+ nd->vd->dead_sit = (*val) ? 2 : 0;
+ clif->sitting(&nd->bl);
+ hookStop();
+ }
}
int escript_get_val_npcscope_num(struct script_state* st, struct reg_db *n, struct script_data* data)
@@ -182,6 +188,12 @@ int escript_get_val_npcscope_num(struct script_state* st, struct reg_db *n, stru
hookStop();
return nd->chat_id;
}
+ else if (!strcmp(name, ".sit"))
+ {
+ getNDReturn(0);
+ hookStop();
+ return nd->vd->dead_sit == 2 ? 1 : 0;
+ }
return 0;
}