From e03ecd6bdc47fbd4007bfdab07c2402b540d1778 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 21 Mar 2013 13:12:17 -0700 Subject: Restore shop script function --- src/map/script.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/map/script.cpp b/src/map/script.cpp index f56cabb..86f6ee6 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -4240,6 +4240,24 @@ void builtin_isin(ScriptState *st) } +// Trigger the shop on a (hopefully) nearby shop NPC +static +void builtin_shop(ScriptState *st) +{ + struct map_session_data *sd = script_rid2sd(st); + struct npc_data *nd; + + if (!sd) + return; + + nd = npc_name2id(conv_str(st, &(st->stack->stack_data[st->start + 2]))); + if (!nd) + return; + + builtin_close(st); + clif_npcbuysell(sd, nd->bl.id); +} + /*========================================== * Check whether the PC is dead *------------------------------------------ @@ -5183,6 +5201,7 @@ BuiltinFunction builtin_functions[] = BUILTIN(getsavepoint, "i"), BUILTIN(areatimer, "MxyxytE"), BUILTIN(isin, "Mxyxy"), + BUILTIN(shop, "s"), BUILTIN(isdead, ""), BUILTIN(unequipbyid, "i"), BUILTIN(getx, ""), @@ -5190,4 +5209,3 @@ BuiltinFunction builtin_functions[] = BUILTIN(getmap, ""), {NULL, NULL, NULL}, }; - -- cgit v1.2.3-60-g2f50