Class OutfitShopsList

java.lang.Object
games.stendhal.server.entity.npc.shop.OutfitShopsList

public class OutfitShopsList extends Object
Handles registering shops & configuring NPCs to sell outfits.
  • Method Details

    • get

      public static OutfitShopsList get()
      Retrieves singlton instance.
    • add

      public void add(String id, OutfitShopInventory inventory)
      Registers a new shop.
      Parameters:
      id - String identifier.
      inventory - Outfits inventory with prices.
    • getContents

      public Map<String,OutfitShopInventory> getContents()
    • get

      public OutfitShopInventory get(String id)
      Retrieves a registered shop.
      Parameters:
      id - String identifier.
      Returns:
      Outfits inventory or null if id isn't registered.
    • configureNPC

      public void configureNPC(SpeakerNPC npc, String id, Float priceFactor, String action, int expiration, String wearOffMessage, List<String> flags)
      Configures an NPC to use a shop.
      Parameters:
      npc - NPC to configure.
      id - Shop identifier.
      priceFactor - Skews prices of all items for this merchant.
      action - NPC action trigger, e.g. "lend", "borrow", "buy", etc.
      expiration - Amount of time player can wear outfit.
      wearOffMessage - Message to player when outfit expires.
      flags - Optional flags. Currently supported are 'resetOrig', 'noOffer', & 'returnable'.
    • configureNPC

      public void configureNPC(SpeakerNPC npc, String id, String action, int expiration, String wearOffMessage, List<String> flags)
      Configures an NPC to use a shop.
      Parameters:
      npc - NPC to configure.
      id - Shop identifier.
      action - NPC action trigger, e.g. "lend", "borrow", "buy", etc.
      expiration - Amount of time player can wear outfit.
      wearOffMessage - Message to player when outfit expires.
      flags - Optional flags. Currently supported are 'resetOrig', 'noOffer', & 'returnable'.
    • configureNPC

      public void configureNPC(String npc, String id, Float priceFactor, String action, int expiration, String wearOffMessage, List<String> flags)
      Configures an NPC to use a shop.
      Parameters:
      npc - Name of NPC to configure.
      id - Shop identifier.
      priceFactor - Skews prices of all items for this merchant.
      action - NPC action trigger, e.g. "lend", "borrow", "buy", etc.
      expiration - Amount of time player can wear outfit.
      wearOffMessage - Message to player when outfit expires.
      flags - Optional flags. Currently supported are 'resetOrig', 'noOffer', & 'returnable'.
    • configureNPC

      public void configureNPC(String npc, String id, String action, int expiration, String wearOffMessage, List<String> flags)
      Configures an NPC to use a shop.
      Parameters:
      npc - Name of NPC to configure.
      id - Shop identifier.
      action - NPC action trigger, e.g. "lend", "borrow", "buy", etc.
      expiration - Amount of time player can wear outfit.
      wearOffMessage - Message to player when outfit expires.
      flags - Optional flags. Currently supported are 'resetOrig', 'noOffer', & 'returnable'.
    • configureNPC

      @Deprecated public void configureNPC(SpeakerNPC npc, String id, String action, boolean offer, boolean canReturn, int expiration)
      Deprecated.
      Configures an NPC to use a shop.
      Parameters:
      npc - NPC to configure.
      id - Shop identifier.
      action - NPC action trigger, e.g. "lend", "borrow", "buy", etc.
      offer - Defines if the NPC should react to the word "offer".
      canReturn - If true, player can say "return" to get original outfit back.
      expiration - Amount of time player can wear outfit.
    • configureNPC

      @Deprecated public void configureNPC(SpeakerNPC npc, String id, String action, boolean offer, boolean canReturn)
      Deprecated.
      Configures an NPC to use a shop with outfits that do not expire.
      Parameters:
      npc - NPC to configure.
      id - Shop identifier.
      action - NPC action trigger, e.g. "lend", "borrow", "buy", etc.
      offer - Defines if the NPC should react to the word "offer".
      canReturn - If true, player can say "return" to get original outfit back.
    • configureNPC

      @Deprecated public void configureNPC(String name, String id, String action, boolean offer, boolean canReturn, int expiration)
      Deprecated.
      Configures an NPC to use a shop.
      Parameters:
      name - Name of NPC to configure.
      id - Shop identifier.
      action - NPC action trigger, e.g. "lend", "borrow", "buy", etc.
      offer - Defines if the NPC should react to the word "offer".
      canReturn - If true, player can say "return" to get original outfit back.
      expiration - Amount of time player can wear outfit.
    • configureNPC

      @Deprecated public void configureNPC(String name, String id, String action, boolean offer, boolean canReturn)
      Deprecated.
      Configures an NPC to use a shop with outfits that do not expire.
      Parameters:
      name - Name of NPC to configure.
      id - Shop identifier.
      action - NPC action trigger, e.g. "lend", "borrow", "buy", etc.
      offer - Defines if the NPC should react to the word "offer".
      canReturn - If true, player can say "return" to get original outfit back.