Package noppes.npcs.api.roles
Interface IRoleTrader
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
disableSlot(int slot)
prevent an item from being sold on that slotvoid
disableSlot(int slot, IPlayer player)
disables the slot for this playervoid
enableSlot(int slot)
allow an item to be sold on that slotvoid
enableSlot(int slot, IPlayer player)
enables the slot for this playerIItemStack[]
getCurrency(int slot)
java.lang.String
getMarket()
int
getPurchaseNum(int slot)
int
getPurchaseNum(int slot, IPlayer player)
IItemStack
getSellOption(int slot)
boolean
isSlotEnabled(int slot)
boolean
isSlotEnabled(int slot, IPlayer player)
void
removeSellOption(int slot)
void
resetPurchaseNum()
Sets the purchase count of all slots to 0void
resetPurchaseNum(int slot)
sets the purchase num for that slot to 0void
resetPurchaseNum(int slot, IPlayer player)
sets the purchase num for that slot and player to 0void
setMarket(java.lang.String name)
void
setSellOption(int slot, IItemStack currency, IItemStack sold)
void
setSellOption(int slot, IItemStack currency, IItemStack currency2, IItemStack sold)
-
-
-
Method Detail
-
setSellOption
void setSellOption(int slot, IItemStack currency, IItemStack currency2, IItemStack sold)
- Parameters:
slot
- Slot number 0-17currency
- Currency itemcurrency2
- Currency item number twosold
- Item to be sold by this npc
-
setSellOption
void setSellOption(int slot, IItemStack currency, IItemStack sold)
- Parameters:
slot
- Slot number 0-17currency
- Currency itemsold
- Item to be sold by this npc
-
getSellOption
IItemStack getSellOption(int slot)
- Parameters:
slot
-- Returns:
- The item being sold in this slot.
-
getCurrency
IItemStack[] getCurrency(int slot)
- Parameters:
slot
-- Returns:
- a ScriptItemStack array of size 2 which contains the currency of this trade
-
removeSellOption
void removeSellOption(int slot)
- Parameters:
slot
- Slot number 0-17
-
setMarket
void setMarket(java.lang.String name)
- Parameters:
name
- The trader Linked Market name
-
getMarket
java.lang.String getMarket()
- Returns:
- Get the currently set Linked Market name
-
getPurchaseNum
int getPurchaseNum(int slot)
- Parameters:
slot
-- Returns:
- the number of times an item has been sold on that slot
-
getPurchaseNum
int getPurchaseNum(int slot, IPlayer player)
- Parameters:
slot
-player
-- Returns:
- the number of times this player has purchased from this trader
-
resetPurchaseNum
void resetPurchaseNum()
Sets the purchase count of all slots to 0
-
resetPurchaseNum
void resetPurchaseNum(int slot)
sets the purchase num for that slot to 0- Parameters:
slot
-
-
resetPurchaseNum
void resetPurchaseNum(int slot, IPlayer player)
sets the purchase num for that slot and player to 0- Parameters:
slot
-player
-
-
isSlotEnabled
boolean isSlotEnabled(int slot)
- Parameters:
slot
-- Returns:
- if this slot is enabled
-
isSlotEnabled
boolean isSlotEnabled(int slot, IPlayer player)
- Parameters:
slot
-player
-- Returns:
- if this slot is enabled for this player
-
disableSlot
void disableSlot(int slot)
prevent an item from being sold on that slot- Parameters:
slot
-
-
disableSlot
void disableSlot(int slot, IPlayer player)
disables the slot for this player- Parameters:
slot
-player
-
-
enableSlot
void enableSlot(int slot)
allow an item to be sold on that slot- Parameters:
slot
-
-
enableSlot
void enableSlot(int slot, IPlayer player)
enables the slot for this player- Parameters:
slot
-player
-
-
-