From faa336a7f64059f4fb376a386a4a716acd48a9b3 Mon Sep 17 00:00:00 2001
From: Jesusaves <cpntb1@ymail.com>
Date: Fri, 23 Dec 2022 12:54:04 -0300
Subject: mesn was missing, but now the three minimum functions are here!

---
 src/map/script-fun.cpp | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

(limited to 'src')

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
@@ -131,6 +131,23 @@ void builtin_mesq(ScriptState *st)
     clif_scriptmes(sd, st->oid, RString(mesq));
 }
 
+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)
 {
@@ -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'),
-- 
cgit v1.2.3-70-g09d2