summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorMatheus Macabu <mkbu95@gmail.com>2015-07-08 08:45:01 -0300
committerMatheus Macabu <mkbu95@gmail.com>2015-07-08 08:45:01 -0300
commit29f4963673b1f793448a083a21be3e6ae4d69c54 (patch)
tree8722f2e506fc7ba97070a79739f819f0ade4f03d /src/map/script.c
parentfb82e87c39227921fc3397a8763f0bdb0921a28b (diff)
parent7b1293c3caf76b5587aa3abe8df57b1083c2175d (diff)
downloadhercules-29f4963673b1f793448a083a21be3e6ae4d69c54.tar.gz
hercules-29f4963673b1f793448a083a21be3e6ae4d69c54.tar.bz2
hercules-29f4963673b1f793448a083a21be3e6ae4d69c54.tar.xz
hercules-29f4963673b1f793448a083a21be3e6ae4d69c54.zip
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 87762f44e..f2fce3a8f 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -19660,6 +19660,48 @@ 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=%d, 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;
+}
+
+BUILDIN(mergeitem)
+{
+ struct map_session_data *sd = script->rid2sd(st);
+
+ if (sd == NULL)
+ return true;
+
+ clif->openmergeitem(sd->fd, sd);
+
+ return true;
+}
/** place holder for the translation macro **/
BUILDIN(_) {
return true;
@@ -20297,6 +20339,8 @@ void script_parse_builtin(void) {
BUILDIN_DEF(shopcount, "i"),
BUILDIN_DEF(channelmes, "ss"),
+ BUILDIN_DEF(showscript, "s?"),
+ BUILDIN_DEF(mergeitem,""),
BUILDIN_DEF(_,"s"),
};
int i, len = ARRAYLENGTH(BUILDIN);