summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnnieRuru <jeankof@ymail.com>2015-12-21 09:01:59 +0800
committerHaru <haru@dotalux.com>2015-12-22 01:51:57 +0100
commit91c12a9358fe4a30d7b21862efa82e7466e2ab47 (patch)
treeba0dbceff8e63551c0c66fb0c1d9ec28cb32bd6d /src
parent1c3378e161859ca6da728ea5cb0a5dc07fff5364 (diff)
downloadhercules-91c12a9358fe4a30d7b21862efa82e7466e2ab47.tar.gz
hercules-91c12a9358fe4a30d7b21862efa82e7466e2ab47.tar.bz2
hercules-91c12a9358fe4a30d7b21862efa82e7466e2ab47.tar.xz
hercules-91c12a9358fe4a30d7b21862efa82e7466e2ab47.zip
Update *message script command to allow to use account ID
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r--src/map/script.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/map/script.c b/src/map/script.c
index fedfc895c..c5bb418d5 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -13834,16 +13834,21 @@ BUILDIN(movenpc) {
/*==========================================
* message [MouseJstr]
*------------------------------------------*/
-BUILDIN(message) {
- const char *msg,*player;
- TBL_PC *pl_sd = NULL;
+BUILDIN(message)
+{
+ const char *message;
+ TBL_PC *sd = NULL;
- player = script_getstr(st,2);
- msg = script_getstr(st,3);
+ if (script_isstringtype(st,2))
+ sd = script->nick2sd(st, script_getstr(st,2));
+ else
+ sd = script->id2sd(st, script_getnum(st,2));
- if ((pl_sd = script->nick2sd(st, (char*)player)) == NULL)
+ if (sd == NULL)
return true;
- clif->message(pl_sd->fd, msg);
+
+ message = script_getstr(st,3);
+ clif->message(sd->fd, message);
return true;
}
@@ -20358,7 +20363,7 @@ void script_parse_builtin(void) {
BUILDIN_DEF(atcommand,"s"), // [MouseJstr]
BUILDIN_DEF2(atcommand,"charcommand","s"), // [MouseJstr]
BUILDIN_DEF(movenpc,"sii?"), // [MouseJstr]
- BUILDIN_DEF(message,"ss"), // [MouseJstr]
+ BUILDIN_DEF(message,"vs"), // [MouseJstr]
BUILDIN_DEF(npctalk,"s?"), // [Valaris]
BUILDIN_DEF(mobcount,"ss"),
BUILDIN_DEF(getlook,"i"),