summaryrefslogtreecommitdiff
path: root/src/emap/script.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-27 23:23:23 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-27 23:23:23 +0300
commitf1031172f04112fe168f586bb8c980cef7cf59ca (patch)
tree616025fcf566e0f6398e5c780155bc83b1e9737b /src/emap/script.c
parentb27b261aff5f230d9fbd9cdf75dfd5540ef739b4 (diff)
downloadevol-hercules-f1031172f04112fe168f586bb8c980cef7cf59ca.tar.gz
evol-hercules-f1031172f04112fe168f586bb8c980cef7cf59ca.tar.bz2
evol-hercules-f1031172f04112fe168f586bb8c980cef7cf59ca.tar.xz
evol-hercules-f1031172f04112fe168f586bb8c980cef7cf59ca.zip
Allow get/set npc name by variable '.name$'.
Diffstat (limited to 'src/emap/script.c')
-rw-r--r--src/emap/script.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/emap/script.c b/src/emap/script.c
index 6675f78..47cd5f1 100644
--- a/src/emap/script.c
+++ b/src/emap/script.c
@@ -181,6 +181,16 @@ void escript_set_reg_npc_str(struct script_state* st, struct reg_db *n, int64 *n
script->reportsrc(st);
hookStop();
}
+ else if (!strcmp(name, ".name$"))
+ {
+ getND();
+ npc->setdisplayname(nd, str);
+// not working because cant sent brodcast with translated npc name. need add for_each function for this.
+// clif->clearunit_area(&nd->bl, CLR_OUTSIGHT);
+// safestrncpy(nd->name, str, sizeof(nd->name));
+// clif->spawn(&nd->bl);
+ hookStop();
+ }
}
char *escript_get_val_npcscope_str(struct script_state* st, struct reg_db *n, struct script_data* data)
@@ -192,6 +202,12 @@ char *escript_get_val_npcscope_str(struct script_state* st, struct reg_db *n, st
hookStop();
return map->list[nd->bl.m].name;
}
+ else if (!strcmp(name, ".name$"))
+ {
+ getNDReturn(0);
+ hookStop();
+ return nd->name;
+ }
return NULL;
}