diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-09-28 15:24:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-09-28 15:24:58 +0300 |
commit | d6cf585005cb59e3b3cebf026b60de42dfebcf6e (patch) | |
tree | 0a72b706c314d5defc5a22d3a89b1914bb0a4086 /src/emap | |
parent | f20f9547576153b536be337e47e7a6b79500e2c2 (diff) | |
download | evol-hercules-d6cf585005cb59e3b3cebf026b60de42dfebcf6e.tar.gz evol-hercules-d6cf585005cb59e3b3cebf026b60de42dfebcf6e.tar.bz2 evol-hercules-d6cf585005cb59e3b3cebf026b60de42dfebcf6e.tar.xz evol-hercules-d6cf585005cb59e3b3cebf026b60de42dfebcf6e.zip |
Allow get/set npc sit state by variable '.sit'.
Diffstat (limited to 'src/emap')
-rw-r--r-- | src/emap/script.c | 14 |
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; } |