Class BuyerBehaviour

Direct Known Subclasses:
QuestCompletedBuyerBehaviour

public class BuyerBehaviour extends MerchantBehaviour
Represents the behaviour of a NPC who is able to buy items from a player.
  • Constructor Details

  • Method Details

    • payPlayer

      protected void payPlayer(ItemParserResult res, Player player)
      Gives the money for the deal to the player. If the player can't carry the money, puts it on the ground.
      Parameters:
      res -
      player - The player who sells
    • transactAgreedDeal

      public boolean transactAgreedDeal(ItemParserResult res, EventRaiser seller, Player player)
      Transacts the deal that is described in BehaviourResult.
      Specified by:
      transactAgreedDeal in class TransactionBehaviour
      Parameters:
      seller - The NPC who buys
      player - The player who sells
      res - result of the Behaviour parsing
      Returns:
      true iff the transaction was successful, that is when the player has the item(s).
    • updatePlayerTransactions

      protected void updatePlayerTransactions(Player player, String merchant, ItemParserResult res)
      Updates stored information about Player-NPC commerce transactions.
      Parameters:
      player - Player to be updated.
      merchant - Name of merchant involved in transaction.
      res - Information about the transaction.