diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/npc-parse.cpp | 5 | ||||
-rw-r--r-- | src/map/npc.cpp | 21 | ||||
-rw-r--r-- | src/map/npc.hpp | 2 | ||||
-rw-r--r-- | src/map/script-fun.cpp | 38 | ||||
-rw-r--r-- | src/map/tmw.cpp | 4 |
5 files changed, 30 insertions, 40 deletions
diff --git a/src/map/npc-parse.cpp b/src/map/npc-parse.cpp index bdb212c..443a1e7 100644 --- a/src/map/npc-parse.cpp +++ b/src/map/npc-parse.cpp @@ -154,10 +154,7 @@ bool npc_load_warp(ast::npc::Warp& warp) nd->flag = 0; nd->name = warp.name.data; - if (!battle_config.warp_point_debug) - nd->npc_class = WARP_CLASS; - else - nd->npc_class = WARP_DEBUG_CLASS; + nd->npc_class = WARP_CLASS; nd->speed = 200_ms; nd->option = Opt0::ZERO; nd->opt1 = Opt1::ZERO; diff --git a/src/map/npc.cpp b/src/map/npc.cpp index 3320039..56c33cc 100644 --- a/src/map/npc.cpp +++ b/src/map/npc.cpp @@ -482,27 +482,6 @@ int npc_event(dumb_ptr<map_session_data> sd, NpcEvent eventname, return 0; } -static -void npc_command_sub(NpcEvent key, struct event_data *ev, NpcName npcname, XString command) -{ - if (ev->nd->name == npcname - && key.label.startswith("OnCommand"_s)) - { - XString temp = key.label.xslice_t(9); - - if (command == temp) - run_script(ScriptPointer(borrow(*ev->nd->scr.script), ev->pos), BlockId(), ev->nd->bl_id); - } -} - -int npc_command(dumb_ptr<map_session_data>, NpcName npcname, XString command) -{ - for (auto& pair : ev_db) - npc_command_sub(pair.first, &pair.second, npcname, command); - - return 0; -} - /*========================================== * 接触型のNPC処理 *------------------------------------------ diff --git a/src/map/npc.hpp b/src/map/npc.hpp index c856a8c..b587f5f 100644 --- a/src/map/npc.hpp +++ b/src/map/npc.hpp @@ -41,12 +41,10 @@ constexpr BlockId START_NPC_NUM = wrap<BlockId>(110000000); // TODO make these species, see npc_class in npc_data constexpr Species WARP_CLASS = wrap<Species>(45); constexpr Species FAKE_NPC_CLASS = wrap<Species>(127); -constexpr Species WARP_DEBUG_CLASS = wrap<Species>(722); constexpr Species INVISIBLE_CLASS = wrap<Species>(32767); int npc_event_dequeue(dumb_ptr<map_session_data> sd); int npc_event(dumb_ptr<map_session_data> sd, NpcEvent npcname, int); -int npc_command(dumb_ptr<map_session_data> sd, NpcName npcname, XString command); int npc_touch_areanpc(dumb_ptr<map_session_data>, Borrowed<map_local>, int, int); int npc_click(dumb_ptr<map_session_data>, BlockId); int npc_scriptcont(dumb_ptr<map_session_data>, BlockId); diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 8fa4ea4..fd618f8 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -2185,7 +2185,7 @@ void builtin_emotion(ScriptState *st) { int type; type = conv_num(st, &AARG(0)); - if (type < 0 || type > 100) + if (type < 0 || type > 200) return; clif_emotion(map_id2bl(st->oid), type); } @@ -2214,15 +2214,6 @@ void builtin_mapwarp(ScriptState *st) // Added by RoVeRT } static -void builtin_cmdothernpc(ScriptState *st) // Added by RoVeRT -{ - NpcName npc = stringish<NpcName>(ZString(conv_str(st, &AARG(0)))); - ZString command = ZString(conv_str(st, &AARG(1))); - - npc_command(map_id2sd(st->rid), npc, command); -} - -static void builtin_mobcount_sub(dumb_ptr<block_list> bl, NpcEvent event, int *c) { if (event == bl->is_mob()->npc_event) @@ -2311,6 +2302,31 @@ void builtin_getitemname(ScriptState *st) } static +void builtin_getitemlink(ScriptState *st) +{ + struct script_data *data; + AString buf; + data = &AARG(0); + ZString name = conv_str(st, data); + + ItemNameId item_id; + Option<P<struct item_data>> item_data_ = itemdb_searchname(name); + OMATCH_BEGIN (item_data_) + { + OMATCH_CASE_SOME (item_data) + { + buf = STRPRINTF("[@@%d|%s@@]"_fmt, item_data->nameid, item_data->jname); + } + OMATCH_CASE_NONE () + { + buf = STRPRINTF("Unknown Item: %s"_fmt, name); + } + } + OMATCH_END (); + push_str<ScriptDataStr>(st->stack, buf); +} + +static void builtin_getspellinvocation(ScriptState *st) { RString name = conv_str(st, &AARG(0)); @@ -3169,11 +3185,11 @@ BuiltinFunction builtin_functions[] = BUILTIN(pvpoff, "M"_s, '\0'), BUILTIN(emotion, "i"_s, '\0'), BUILTIN(mapwarp, "MMxy"_s, '\0'), - BUILTIN(cmdothernpc, "ss"_s, '\0'), BUILTIN(mobcount, "ME"_s, 'i'), BUILTIN(marriage, "P"_s, 'i'), BUILTIN(divorce, ""_s, 'i'), BUILTIN(getitemname, "I"_s, 's'), + BUILTIN(getitemlink, "I"_s, 's'), BUILTIN(getspellinvocation, "s"_s, 's'), BUILTIN(getpartnerid2, ""_s, 'i'), BUILTIN(getinventorylist, ""_s, '\0'), diff --git a/src/map/tmw.cpp b/src/map/tmw.cpp index 3f6bb3a..df76720 100644 --- a/src/map/tmw.cpp +++ b/src/map/tmw.cpp @@ -109,8 +109,8 @@ int tmw_CheckChatSpam(dumb_ptr<map_session_data> sd, XString message) (sd->chat_lines_in >= battle_config.chat_spam_warn || sd->chat_total_repeats >= battle_config.chat_spam_warn)) { - clif_displaymessage(sd->sess, "WARNING: You are about to be automatically banned for spam!"_s); - clif_displaymessage(sd->sess, "WARNING: Please slow down, do not repeat, and do not SHOUT!"_s); + clif_displaymessage(sd->sess, "##1WARNING : ##BYou are about to be automatically banned for spam!"_s); + clif_displaymessage(sd->sess, "##1WARNING : ##BPlease slow down, do not repeat, and do not SHOUT!"_s); } return 0; |