diff options
author | Emistry <Equinox1991@gmail.com> | 2015-07-05 04:28:31 +0800 |
---|---|---|
committer | Emistry <Equinox1991@gmail.com> | 2015-07-05 04:28:31 +0800 |
commit | 25c5a610555f442005d562ad463a4f22efb6f744 (patch) | |
tree | e42d3a3ef9e4993e9f1a0abd0802877fc5ec866b | |
parent | 408e8ce47ec298b80e43b537efa58db5b74a19b8 (diff) | |
download | hercules-25c5a610555f442005d562ad463a4f22efb6f744.tar.gz hercules-25c5a610555f442005d562ad463a4f22efb6f744.tar.bz2 hercules-25c5a610555f442005d562ad463a4f22efb6f744.tar.xz hercules-25c5a610555f442005d562ad463a4f22efb6f744.zip |
Added script command `showscript "<message>"{,<GID>};`
Makes attached player or GID says a message like shouting a skill name,
the message will be seen to everyone around but not in chat window.
-rw-r--r-- | doc/script_commands.txt | 7 | ||||
-rw-r--r-- | src/map/script.c | 32 |
2 files changed, 39 insertions, 0 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt index ede73cb18..378a29f12 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -4109,6 +4109,13 @@ chat window. --------------------------------------- +*showscript "<message>"{,<GID>}; + +Makes attached player or GID says a message like shouting a skill name, the message +will be seen to everyone around but not in chat window. + +--------------------------------------- + *warp "<map name>",<x>,<y>; This command will take the invoking character to the specified map, and if diff --git a/src/map/script.c b/src/map/script.c index 87762f44e..b74f1d0ab 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -19660,6 +19660,37 @@ BUILDIN(channelmes) return true; } + +/** By Cydh +Display script message +showscript "<message>"{,<GID>}; +*/ +BUILDIN(showscript) { + struct block_list *bl = NULL; + const char *msg = script_getstr(st, 2); + int id = 0; + + if (script_hasdata(st, 3)) { + id = script_getnum(st, 3); + bl = map->id2bl(id); + } + else { + bl = st->rid ? map->id2bl(st->rid) : map->id2bl(st->oid); + } + + if (!bl) { + ShowError("buildin_showscript: Script not attached. (id=%, rid=%d, oid=%d)\n", id, st->rid, st->oid); + script_pushint(st, 0); + return false; + } + + clif->ShowScript(bl, msg); + + script_pushint(st, 1); + + return true; +} + /** place holder for the translation macro **/ BUILDIN(_) { return true; @@ -20297,6 +20328,7 @@ void script_parse_builtin(void) { BUILDIN_DEF(shopcount, "i"), BUILDIN_DEF(channelmes, "ss"), + BUILDIN_DEF(showscript, "s?"), BUILDIN_DEF(_,"s"), }; int i, len = ARRAYLENGTH(BUILDIN); |