Shops
Before we leave the tunnel and move on with the rest of the scenario, there's one more thing we should add. Nearly all scenarios need a way for the player to buy and sell items. Add the following talk nodes:
begintalknode 7; state = 2; nextstate = -1; question = "Let's see what weapons you have for sale."; text1 = "_Thank you for your business,_ the merchant says."; code = begin_shop_mode("Travelling Merchant's Weapons", "The merchant has some weapons that you can buy.", 1, 2, 2); break; begintalknode 8; state = 2; nextstate = -1; question = "Let's see what food you have for sale."; text1 = "_Thank you for your business,_ the merchant says."; code = begin_shop_mode("Travelling Merchant's Food", "The merchant has some food that you can buy.", 5, 2, 2); break;
begin_shop_mode opens up a shop window. You need to provide a shop name, description, shop number, and the sell rate and buy rate (if you choose 2 and 2, the shop will sell and buy items at the normal rate). What's the shop number? Like quests, shops need to be defined in the scenario script. However, they get defined in the START_SCEN_STATE, not the LOAD_SCEN_STATE. If you open pesky.txt, you'll find that a few shops have already been created. Feel free to add your own add_item_to_shop calls to change what each store provides, or create a new store entirely.
Those two shops are all we'll be adding in this section, but when making larger scenarios it's important to have enough services available. Shops to support every party build, an inn so the party can rest, a healer who can resurrect dead party members. But for this scenario, it's time to move on to the outdoors.