From 9b3a8b61d9cdb5ca1c620237f3835d620cfb1cba Mon Sep 17 00:00:00 2001 From: David Coles Date: Sun, 13 Sep 2020 14:49:38 -0700 Subject: [PATCH] Add open/close_merchant to runner_functions --- runner_functions.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/runner_functions.js b/runner_functions.js index efd776e..9b9b497 100644 --- a/runner_functions.js +++ b/runner_functions.js @@ -443,6 +443,30 @@ function unequip(slot) // show_json(character.slots) => to see slot options parent.socket.emit("unequip",{slot:slot}); } +/** + * Open Merchant stand. + * + * @param {number} [num=0] Inventory slot containing merchant stand. + */ +function open_merchant(num) +{ + num = num || 0; + if(!character.items[num]) return; + if(G.items[character.items[num].name].type !== "stand") { + parent.d_text("CAN'T OPEN", character); + return; + } + parent.open_merchant(num); +} + +/** + * Close Merchant stand. + */ +function close_merchant() +{ + parent.close_merchant(); +} + function trade(num,trade_slot,price,quantity) // where trade_slot is 1 to 16 - example, trade(0,4,1000) puts the first item in inventory to the 4th trade slot for 1000 gold [27/10/16] { if(!is_string(trade_slot) || !trade_slot.startsWith("trade")) trade_slot="trade"+trade_slot;