summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-15 18:05:27 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-15 18:05:27 +0300
commite48ddae488b467c169682d5ce926b28936afa7be (patch)
treed9b2961c30baf8532e32d68be9ad0c8f3347d142 /src/map/script.c
parent403a522d51434252a27578a84bb09da25ae1d6ab (diff)
downloadevol-hercules-e48ddae488b467c169682d5ce926b28936afa7be.tar.gz
evol-hercules-e48ddae488b467c169682d5ce926b28936afa7be.tar.bz2
evol-hercules-e48ddae488b467c169682d5ce926b28936afa7be.tar.xz
evol-hercules-e48ddae488b467c169682d5ce926b28936afa7be.zip
Impliment shop script command.
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c14
1 files changed, 14 insertions, 0 deletions
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;
+}