summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}