Class LuaMerchantHelper
java.lang.Object
games.stendhal.server.core.scripting.lua.LuaMerchantHelper
Exposes merchant handling classes & functions to Lua.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(String merchantType, SpeakerNPC npc, Object prices, Boolean addOffer) Adds merchant behavior to a SpeakerNPC.voidaddBuyer(SpeakerNPC npc, Object prices, boolean addOffer) Adds merchant buyer behavior to a SpeakerNPC.voidaddSeller(SpeakerNPC npc, Object prices, boolean addOffer) Adds merchant seller behavior to a SpeakerNPC.static LuaMerchantHelperget()Retrieves the static instance.
-
Field Details
-
shops
-
-
Method Details
-
get
Retrieves the static instance.- Returns:
- Static MerchantHelper instance.
-
add
Adds merchant behavior to a 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<String, Int> or LuaTable).addOffer- If `true`, will add default replies for "offer" (default: `true`).
-
addSeller
Adds merchant seller behavior to a SpeakerNPC.- Parameters:
npc- The SpeakerNPC to add the behavior to.prices- List of items & their prices (can be instance of either Map<String, Int> or LuaTable).addOffer- If `true`, will add default replies for "offer" (default: `true`).
-
addBuyer
Adds merchant buyer behavior to a SpeakerNPC.- Parameters:
npc- The SpeakerNPC to add the behavior to.prices- List of items & their prices (can be instance of either Map<String, Int> or LuaTable).addOffer- If `true`, will add default replies for "offer" (default: `true`).
-