summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-12-23 12:54:04 -0300
committerJesusaves <cpntb1@ymail.com>2022-12-23 12:54:04 -0300
commitfaa336a7f64059f4fb376a386a4a716acd48a9b3 (patch)
tree9fe25b09de9802bc65d5b9f2f1b4af69dd405ae1
parent23d0fda8f2c6687447086632be908da684fb4021 (diff)
downloadtmwa-faa336a7f64059f4fb376a386a4a716acd48a9b3.tar.gz
tmwa-faa336a7f64059f4fb376a386a4a716acd48a9b3.tar.bz2
tmwa-faa336a7f64059f4fb376a386a4a716acd48a9b3.tar.xz
tmwa-faa336a7f64059f4fb376a386a4a716acd48a9b3.zip
mesn was missing, but now the three minimum functions are here!
-rw-r--r--src/map/script-fun.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp
index 9ee76a2..1788570 100644
--- a/src/map/script-fun.cpp
+++ b/src/map/script-fun.cpp
@@ -132,6 +132,23 @@ void builtin_mesq(ScriptState *st)
}
static
+void builtin_mesn(ScriptState *st)
+{
+ dumb_ptr<map_session_data> sd = script_rid2sd(st);
+ dumb_ptr<npc_data> nd;
+ nd = map_id_is_npc(st->oid);
+ script_nullpo_end(nd, "npc not found");
+ script_nullpo_end(sd, "player not found");
+ sd->state.npc_dialog_mes = 1;
+ RString mes = HARG(0) ? conv_str(st, &AARG(0)) : RString(nd->name.xislice_h(std::find(nd->name.begin(), nd->name.end(), '#'))); // strnpcinf
+ MString mesq;
+ mesq += "["_s;
+ mesq += mes;
+ mesq += "]"_s;
+ clif_scriptmes(sd, st->oid, RString(mesq));
+}
+
+static
void builtin_clear(ScriptState *st)
{
dumb_ptr<map_session_data> sd = script_rid2sd(st);
@@ -5553,6 +5570,7 @@ BuiltinFunction builtin_functions[] =
{
BUILTIN(mes, "?"_s, '\0'),
BUILTIN(mesq, "?"_s, '\0'),
+ BUILTIN(mesn, "?"_s, '\0'),
BUILTIN(clear, ""_s, '\0'),
BUILTIN(goto, "L"_s, '\0'),
BUILTIN(callfunc, "F"_s, '\0'),