From f1031172f04112fe168f586bb8c980cef7cf59ca Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 27 Sep 2015 23:23:23 +0300 Subject: Allow get/set npc name by variable '.name$'. --- src/emap/script.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/emap/script.c') 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; } -- cgit v1.2.3-70-g09d2