From e48ddae488b467c169682d5ce926b28936afa7be Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 15 Nov 2014 18:05:27 +0300 Subject: Impliment shop script command. --- src/map/script.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/map/script.c') diff --git a/src/map/script.c b/src/map/script.c index e54f6e2..1671f5c 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -140,3 +140,17 @@ BUILDIN(closeDialog) send_npccommand(script->rid2sd (st), st->oid, 5); return true; } + +BUILDIN(shop) +{ + getSD(); + struct npc_data *nd = npc->name2id (script_getstr(st, 2)); + if (!nd) + return false; + + st->state = sd->state.dialog == 1 ? CLOSE : END; + clif->scriptclose(sd, st->oid); + + clif->npcbuysell (sd, nd->bl.id); + return true; +} -- cgit v1.2.3-70-g09d2