Buying and Selling (how to be a customer)
Let’s say you find an NPC shop and you want to use it. Approach it and right-click it. This will show a list of what the NPC has to offer you.
[You must be registered and logged in to see this image.]
In the above example, 94 pieces of Cooked Fish are for sale, at 10 Gil each. The NPC will NOT buy any from you though (S:–).
If you want to buy something from it, look at what the buy price is (the number after B:)… and make sure it has stock (Q: is more than zero), then use:
/npc buy <SLOT> <QUANTITY>
Maybe you want to sell something to the NPC. Find the item in the list, make sure there’s a price after S:… and use:
/npc sell <SLOT> <QUANTITY>
Setting Up the Shop
You also need to tell the shopkeeper what he should buy or sell. Each NPC can work with up to 8 items (since you can only use 8 slots for each one).
To see how this works, right-click your NPC:
…you’ll see that he has 8 slots, but they’re all empty.
To set the items, use this format:
/npc setup <SLOT> <ITEM> <LOTQUANTITY> <BUYPRICE> <SELLPRICE> <BUY?> <SELL?>
It may seem complicated, so use these definitions and examples:
SLOT = The slot# to put the item in (use /npc list to refresh your memory of what slots are there)
ITEM = The item to work with. Use the name or ID. Use /searchitem to find IDs.
LOTQUANTITY = The number of that item to sell when the buyer pays the price you entered. In most cases, this should be 1.
BUYPRICE = The price you want to sell the item for
SELLPRICE = The price you want to buy the item for. (this let’s people sell their stuff to your shop!)
BUY = “true” or “false” – do you want to sell this item to people?
SELL = “true” or “false” – do you want to buy this item from people?
(BUY and SELL are from the customer’s perspective!)
So let’s say I want to sell obsidian in slot1 … at 50 Gil for each block… and I don’t want to buy it from people:
/npc setup 1 obsidian 1 50 0 true false
Now repeat that command for each of your slots you want to use… just remember you won’t be able to sell anything until you STOCK the slots.
Stocking the Shop
If you want to sell items to people, you need to stock the shop! i.e., you need to put the items on the shopkeeper so he has them to give to people.
This is easy! The command is:
/npc stock <SLOT> <QUANTITY>
So, back to our example. I want to sell obsidian in slot #1… and I have 57 blocks in my inventory ready to sell. I type:
/npc stock 1 57
The 57 blocks are removed from my inventory and added to the NPC.
Maybe you don’t want to sell items anymore and you want them back… then use:
/npc unstock <SLOT> <QUANTITY>
Adjusting the Shop
Maybe you decide you don’t want to sell or buy a particular item anymore, and you want to use its slot for something else. Then you use after right-clicking the NPC:
/npc adjust
Type that command in-game to see how to alter the slot setup on your NPC.
Will probably be better off on the Wiki at some point.