Introduction
Exposes merchant handling classes & functions to Lua.
Members
merchants.shops
merchants.shops
- This is the {@link games.stendhal.server.entity.npc.ShopList} instance.
- Public methods: TODO
Methods
merchants:add
merchants:add(merchantType, npc, prices, addOffer)
- Adds merchant behavior to a {@link games.stendhal.server.entity.npc.SpeakerNPC}.
- Parameters:
- merchantType: If set to "buyer", will add buyer behavior, otherwise will be "seller".
- npc: The SpeakerNPC to add the behavior to.
- prices: List of items & their prices (can be instance of either Map
or a Lua table). - addOffer: If
true
, will add default replies for "offer" (default:true
).
merchants:addSeller
merchants:addSeller(npc, prices, addOffer)
- Adds seller behavior to a {@link games.stendhal.server.entity.npc.SpeakerNPC}.
- Parameters:
- npc: The SpeakerNPC to add the behavior to.
- prices: List of items & their prices (can be instance of either Map
or a Lua table). - addOffer: If
true
, will add default replies for "offer" (default:true
).
merchants:addBuyer
merchants:addBuyer(npc, prices, addOffer)
- Adds buyer behavior to a {@link games.stendhal.server.entity.npc.SpeakerNPC}.
- Parameters:
- npc: The SpeakerNPC to add the behavior to.
- prices: List of items & their prices (can be instance of either Map
or a Lua table). - addOffer: If
true
, will add default replies for "offer" (default:true
).