summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/script_commands.txt15
-rw-r--r--src/map/script.c14
2 files changed, 29 insertions, 0 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt
index f767f890d..c454509ee 100644
--- a/doc/script_commands.txt
+++ b/doc/script_commands.txt
@@ -1293,6 +1293,21 @@ and the script will terminate.
---------------------------------------
+*mesclear();
+
+This command will clear the dialog text and continue the script without player interaction.
+
+Example:
+ mes("This is how the 'mesclear' script command works.");
+ sleep2 3000;
+ mesclear(); // This will clear the dialog and continue to the next one.
+ mes("I will show you again.");
+ sleep2 3000;
+ mesclear(); // This will clear the dialog and continue to the next one.
+ mes("Bye!");
+
+---------------------------------------
+
*close()
This command will create a 'close' button in the message window for the
diff --git a/src/map/script.c b/src/map/script.c
index a11bc0c75..9c6c943d8 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -5961,6 +5961,19 @@ static BUILDIN(next)
return true;
}
+/// Clears the NPC dialog and continues the script without press next button.
+///
+/// mesclear();
+static BUILDIN(mesclear)
+{
+ struct map_session_data *sd = script->rid2sd(st);
+
+ if (sd != NULL)
+ clif->scriptclear(sd, st->oid);
+
+ return true;
+}
+
/// Ends the script and displays the button 'close' on the npc dialog.
/// The dialog is closed when the button is pressed.
///
@@ -25369,6 +25382,7 @@ static void script_parse_builtin(void)
BUILDIN_DEF(mes, "?"),
BUILDIN_DEF(mesf, "s*"),
BUILDIN_DEF(next,""),
+ BUILDIN_DEF(mesclear,""),
BUILDIN_DEF(close,""),
BUILDIN_DEF(close2,""),
BUILDIN_DEF(menu,"sl*"),