|
@@ -22083,12 +22083,16 @@ BUILDIN_FUNC(getvar) {
|
|
|
|
|
|
/**
|
|
/**
|
|
* Display script message
|
|
* Display script message
|
|
- * showscript "<message>"{,<GID>};
|
|
|
|
|
|
+ * showscript "<message>"{,<GID>,<flag>};
|
|
|
|
+ * @param flag: Specify target
|
|
|
|
+ * AREA - Message is sent to players in the vicinity of the source (default).
|
|
|
|
+ * SELF - Message is sent only to player attached.
|
|
**/
|
|
**/
|
|
BUILDIN_FUNC(showscript) {
|
|
BUILDIN_FUNC(showscript) {
|
|
struct block_list *bl = NULL;
|
|
struct block_list *bl = NULL;
|
|
const char *msg = script_getstr(st,2);
|
|
const char *msg = script_getstr(st,2);
|
|
int id = 0;
|
|
int id = 0;
|
|
|
|
+ send_target target = AREA;
|
|
|
|
|
|
if (script_hasdata(st,3)) {
|
|
if (script_hasdata(st,3)) {
|
|
id = script_getnum(st,3);
|
|
id = script_getnum(st,3);
|
|
@@ -22104,7 +22108,15 @@ BUILDIN_FUNC(showscript) {
|
|
return SCRIPT_CMD_FAILURE;
|
|
return SCRIPT_CMD_FAILURE;
|
|
}
|
|
}
|
|
|
|
|
|
- clif_showscript(bl, msg);
|
|
|
|
|
|
+ if (script_hasdata(st, 4)) {
|
|
|
|
+ target = static_cast<send_target>(script_getnum(st, 4));
|
|
|
|
+ if (target == SELF && map_id2sd(bl->id) == NULL) {
|
|
|
|
+ ShowWarning("script: showscript: self can't be used for non-players objects.\n");
|
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ clif_showscript(bl, msg, target);
|
|
|
|
|
|
script_pushint(st,1);
|
|
script_pushint(st,1);
|
|
return SCRIPT_CMD_SUCCESS;
|
|
return SCRIPT_CMD_SUCCESS;
|
|
@@ -24189,7 +24201,7 @@ struct script_function buildin_func[] = {
|
|
BUILDIN_DEF(npcshopupdate,"sii?"),
|
|
BUILDIN_DEF(npcshopupdate,"sii?"),
|
|
BUILDIN_DEF(getattachedrid,""),
|
|
BUILDIN_DEF(getattachedrid,""),
|
|
BUILDIN_DEF(getvar,"vi"),
|
|
BUILDIN_DEF(getvar,"vi"),
|
|
- BUILDIN_DEF(showscript,"s?"),
|
|
|
|
|
|
+ BUILDIN_DEF(showscript,"s??"),
|
|
BUILDIN_DEF(ignoretimeout,"i?"),
|
|
BUILDIN_DEF(ignoretimeout,"i?"),
|
|
BUILDIN_DEF(geteleminfo,"i?"),
|
|
BUILDIN_DEF(geteleminfo,"i?"),
|
|
BUILDIN_DEF(setquestinfo_level,"iii"),
|
|
BUILDIN_DEF(setquestinfo_level,"iii"),
|