PH Warehouse

PH Warehouse

Publish Date: June 07, 2016

Introduction

  • This plugin allows the creation of warehouses where you can store items in the game.

License

Download

Installation

  • Download the JS file and include it into the /plugins folder of your project.
  • Open the Plugin Manager, select the file PH_Warehouse.js, and turn it on.

Plugin Commands

  • PHWarehouse create <Title of the Warehouse>
    Creates a warehouse
     
  • PHWarehouse create <Title of the Warehouse:50>
    Creates a warehouse and sets its maximum capacity to 50
     
  • PHWarehouse create <Title of the Warehouse:50:rule_name>
    Creates a warehouse, sets its maximum capacity to 50 and sets a rule
     
  • PHWarehouse show <Title of the Warehouse>
    Shows a warehouse
     
  • PHWarehouse remove <Title of the Warehouse>
    Removes a warehouse
     
  • PHWarehouse loot item <Title of the Warehouse:id:quantity>
    Add an item for loot bonus inside a created warehouse
     
  • PHWarehouse loot weapon <Title of the Warehouse:id:quantity>
    Add a weapon for loot bonus inside a created warehouse
     
  • PHWarehouse loot armor <Title of the Warehouse:id:quantity>
    Add an armor for loot bonus inside a created warehouse
     
  • PHWarehouse loot keyItem <Title of the Warehouse:id:quantity>
    Add a key item for loot bonus inside a created warehouse
     
  • PHWarehouse add item <Title of the Warehouse:id:quantity>
    Add an item immediately inside a created warehouse
     
  • PHWarehouse add weapon <Title of the Warehouse:id:quantity>
    Add a weapon immediately inside a created warehouse
     
  • PHWarehouse add armor <Title of the Warehouse:id:quantity>
    Add an armor immediately inside a created warehouse
     
  • PHWarehouse add keyItem <Title of the Warehouse:id:quantity>
    Add a key item immediately inside a created warehouse
     
  • PHWarehouse capacity set <Title of the Warehouse:quantity>
    Set a new maximum capacity for a warehouse already created
     
  • PHWarehouse capacity increase <Title of the Warehouse:quantity>
    Increase the maximum capacity for a warehouse already created
     
  • PHWarehouse capacity decrease <Title of the Warehouse:quantity>
    Decrease the maximum capacity for a warehouse already created

Parameters

  • All Together
    Defines whether or not you want to show the items in separated categories (0: false, 1: true).
     
  • Stack Item Quantity
    Defines whether or not you want to consider stacked items as a single space in the capacity (0: false, 1: true).
     
  • Withdraw Text
    Text shown in option "Withdraw".
     
  • Deposit Text
    Text shown in option "Deposit".
     
  • Available Space Text
    Text shown in option "All" if the parameter "All Together" is set as true.
     
  • All Text
    Text shown in the information window.

Script Calls

  • PHPlugins.PHWarehouse.getMaxCapacity("Title of the Warehouse")
    Gets the maximum capacity of a warehouse (returns a number).
     
  • PHPlugins.PHWarehouse.getCurrentCapacity("Title of the Warehouse")
    Gets the current capacity of a warehouse (returns a number).
     
  • PHPlugins.PHWarehouse.exist("Title of the Warehouse")
    Checks if a warehouse exists (returns true or false).
     
  • PHPlugins.PHWarehouse.hasItem("Title of the Warehouse", id)
    Verifies if a warehouse has a particular item and returns the quantity of this item inside the warehouse.
     
  • PHPlugins.PHWarehouse.hasWeapon("Title of the Warehouse", id)
    Verifies if a warehouse has a particular weapon and returns the quantity of this item inside the warehouse.
     
  • PHPlugins.PHWarehouse.hasArmor("Title of the Warehouse", id)
    Verifies if a warehouse has a particular armor and returns the quantity of this item inside the warehouse.
     
  • PHPlugins.PHWarehouse.hasKeyItem("Title of the Warehouse", id)
    Verifies if a warehouse has a particular key item and returns the quantity of this item inside the warehouse.

Rule Configuration

  • Rules are a simple way to manage which items you can store in a specific warehouse. In order to create a rule for your warehouse, you have to create a Common Event in the database called "PHWarehouse". Inside of that Common Event, you will create some comments in order to populate the rules for warehouses. These comments must have the following format:
{Title of the Rule}
[commands]
 
  • The [commands] you can specify are as follow:
    • item: 1 (Just allow the storage of the item with id 1)
    • item: 1, 2, 3, 4 (Allows the storage of items with id 1, 2, 3 and 4)
    • item: no (Does not allow the storage of items)
    • item-n: 1 (Allows the storage of any item except the one with id 1)
      (If you don't specify the command "item" in the rule, all items will be allowed to be stored)
       
    • weapon: 1 (Just allow the storage of the weapon with id 1)
    • weapon: 1, 2, 3, 4 (Allows the storage of weapons with id 1, 2, 3 and 4)
    • weapon: no (Does not allow the storage of weapons)
    • weapon-n: 1 (Allows the storage of any weapon except the one with id 1)
      (If you don't specify the command "weapon" in the rule, all weapons will be allowed to be stored)
       
    • armor: 1 (Just allow the storage of the armor with id 1)
    • armor: 1, 2, 3, 4 (Allows the storage of armors with id 1, 2, 3 and 4)
    • armor: no (Does not allow the storage of armors)
    • armor-n: 1 (Allows the storage of any armor except the one with id 1)
      (If you don't specify the command "armor" in the rule, all armors will be allowed to be stored)
       
    • keyItem: 1 (Just allow the storage of the key item with id 1)
    • keyItem: 1, 2, 3, 4 (Allows the storage of key items with id 1, 2, 3 and 4)
    • keyItem: no (Does not allow the storage of key items)
    • keyItem-n: 1 (Allows the storage of any key item except the one with id 1)
      (If you don't specify the command "keyItem" in the rule, all key items will be allowed to be stored)

How to Use (Illustrative Example)

  • So, this plugin allows you to make simple and sophisticated configurations.
  • I'll present some examples about how you can configure different warehouses in the same game.
     
    1. Simple (and the easiest) Configuration:
      This is the easiest way to create warehouses. You just use 2 plugin commands, one for creating the warehouse, and one for showing the warehouse. Pretty straightforward.



       
    2. Using Loot Bonus:
      This is a new feature. Now, you can add a loot bonus inside a created warehouse. The idea is that you create a warehouse and then add the loots you want. After showing the warehouse for the first time, you will not be able to add more loots inside that warehouse.


       
    3. Using Rules:
      Rules are a simple way to manage which items the player can store in a specific warehouse.
      Here in this post, you will see a section called Rule Commands. Make sure to read that section if you want to get deep into the creation of rules.
      In the following images, you'll see some examples of rules.
      I applied a rule called Just Items when I created the warehouse, and the specifications for that rule are inside the common event PHWarehouse.



       
    4. Using Exception Rules:
      Exception rules are the opposite of regular rules. Instead of saying what kind of items the warehouse will be able to store, you will specify which kind of items the warehouse MUST NOT store at all.


       
    5. Using Script Commands:
      There are some script commands that can make your life easier when managing warehouses throughout the game.
      The list with script commands is also written in this post.


       

Screenshots

Changelog

  • 05/30/2016: Version 1.2.1 (Stack items as a single space in your storage. Increase/Decrease the maximum capacity of a warehouse. Bug fixes).
  • 05/29/2016: Version 1.2 (All Together option allows you to see all the items in just one category. It also provides compatibility with Shaz_NoCategory and MrTS_LimitedInventory plugins).
  • 11/19/2015: Bug fixed in the global variable that receives the parameters. Also, a small modification in the Script commands.
  • 11/17/2015: Version 1.1
  • 11/16/2015: Fixed issue that allowed items remain in the storage after initiating a new game.
  • 11/14/2015: Version 1.0

Social Links

Copyright © 2018 - Gustavo Fernandes - All rights reserved

Cookies and Privacy Policy