Class LuaMerchantHelper
java.lang.Object
games.stendhal.server.core.scripting.lua.LuaMerchantHelper
Exposes merchant handling classes & functions to Lua.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add(String merchantType, SpeakerNPC npc, Object prices, Boolean addOffer)
Adds merchant behavior to a SpeakerNPC.void
addBuyer(SpeakerNPC npc, Object prices, boolean addOffer)
Adds merchant buyer behavior to a SpeakerNPC.void
addSeller(SpeakerNPC npc, Object prices, boolean addOffer)
Adds merchant seller behavior to a SpeakerNPC.static LuaMerchantHelper
get()
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. FIXME: LuaTable not working for "prices" object- 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 Mapor LuaTable). addOffer
- Iftrue
, 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 Mapor LuaTable). addOffer
- Iftrue
, 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 Mapor LuaTable). addOffer
- Iftrue
, will add default replies for "offer" (default:true
).
-