Equipment Overhaul

From PocketWiki

Jump to: navigation, search

Download Equipment Overhaul

Contents

Equipment Overhaul
Link Click Here
Image:YEM_Demo.jpg This script is included in the
Yanfly Engine Melody Demo
Last Update 2010.08.23
Author(s) Yanfly
$imported $imported["EquipmentOverhaul"]
Terms of Usage
Equipment Overhaul along with other Yanfly Engine scripts may be used for both non-commercial and commercial games. Providing credit is not necessary, but please do not claim credit.
Version History
o 2010.08.23 - Bugfix regarding equipment optimization.
o 2010.08.16 - Bugfix regarding unequipping items with MaxHP and MaxMP.
o 2010.06.24 - Unequip bug has been fixed.
o 2010.06.03 - Efficiency update.
o 2010.05.24 - Converted to Yanfly Engine Melody.
Discussion and FAQ

Introduction

This script essentially redefines the way the equipment system works while keeping the core without rewriting too much. It will also recalculate the stats applied through equipment by the order of operations properly so that the numbers aren't a jumbled up uncontrollable mess. In addition to fixing the calculation regarding the order of operations, this script also changes the equipment scene with a different layout and more efficient methods.

Equipment can also require certain conditions to be met first before being able to be equipped. These conditions include reaching a certain level, having more or less than a certain number for their stat, or even having a switch to be enabled. These requirements can be done through simple tags.

An aptitude system is also included in the script, where certain classes can receive more or less bonus from certain stat increases from equipment. For example, a warrior will receive less INT than a mage would from a piece of equipment. Aptitude is also flexible and can be adjusted through items, too.

How to Use

To install this script, open up your script editor and copy/paste this script to an open slot below ▼ Materials but above ▼ Main. Remember to save.

Overview

Players are treated to a new equipment screen.

Basic Settings

The following below will adjust the basic settings and vocabulary that will display throughout the script. Change them as you see fit.

    COMMANDS =[
      :manual,    # Manually equips weapons and armours.
      :optimize,  # Optimize equipping automatically.
      :aptitude,  # Enter aptitude attuning menu.
      :mastery,   # View Mastery menu.
    ] # Do not remove this.

This adjusts the commands used within the equip scene. The command window is the window that lets you switch between various equip scene options.


    VOCAB ={
      :manual   => "Manual",
      :optimize => "Optimize",
      :aptitude => "Aptitude",
      :mastery  => "Weaponry",
      :twohand  => "2-Hand",
      :arrow    => "→",
      :noequip  => "<No Equipment>",
      :unequip  => "Unequip",
      :amount   => ":%2d",
      :apt_rate => "%s Rate",
    } # Do not remove this.

The following determines the vocabulary used for the remade equip scene. Adjust it accordingly to set the way text is displayed.


    STAT_VOCAB ={
      :hit  => "HIT", # Stat that modifies hit rate.
      :eva  => "EVA", # Stat that modifies evasion rate.
      :cri  => "CRI", # Stat that modifies critical rate.
      :odds => "AGR", # Stat that modifies aggro rate.
    } # Do not remove this.

Some of the more unusual stats do not have defined vocabulary to go along with it. Adjust the following hash to give them names.


    SHOWN_STATS = [:maxhp, :maxmp, :atk, :def, :spi, :res, :dex, :agi]

These are the stats shown inside of the equip scene menu and they order they'll appear in. If a stat applied by a script doesn't exist, it'll be ignored and the next command will be shifted up by one.

Legal Stats: :hp, :mp, :atk, :def, :spi, :res, :dex, :agi, :hit, :eva, :cri, :odds


    UNEQUIP_ICON = 98

This is the icon used for unequipping items.


    CATEGORY_FONT_SIZE = 16

This adjusts the font size used for the equip type categories.


    STAT_FONT_SIZE = 16

This adjusts the font size used for the stat types.

Change the equip types both before the game starts and mid-game.

Equip Settings

The following allows you to adjust the rules and such governing equipping and unequipping items. Here, you can add additional item slots, remove them, and even change the rules for some. To label certain armours as different equip types, use the <equip type: phrase> and replace it with the named category item within the TYPE_RULES hash.

    TYPE_LIST =[
      :shield,   # Shield slot for equippable shield type armours.
      :helmet,   # Helmet slot for equippable headgear type armours.
      :armour,   # Armour slot for equippable bodygear type armours.
      :cloak,    # Cloak slot for equippable mantle type armours.
      :other,    # 1st Accessory slot for misc armours.
      :other,    # 2nd Accessory slot for misc armours.
      :other,    # 3rd Accessory slot for misc armours.
    ] # Do not remove this

This determines the order of equipment inside the equipment scene. Note that this does not include weapons as they're automatically the first piece of equipment by default.


    TYPE_RULES ={
    # Type     => [     Name, Kind, Empty?, Optimize],
      :weapon  => [ "Weapon",  nil,  false,     true],
      :shield  => [ "Shield",    0,   true,     true],
      :helmet  => [ "Helmet",    1,   true,     true],
      :armour  => [ "Armour",    2,   true,     true],
      :other   => [  "Other",    3,   true,    false],
      :cloak   => [  "Cloak",    4,   true,     true],
    } # Do not remove this.

Adjust the following below to determine the ruleset adjusted for equip equip type following the pre-made template. Here's what each does:

     Name - The name of the equip type. When using tag, refer to this.
     Kind - The kind number associated with the equip type.
   Empty? - Whether or not the equipment slot can be empty.
 Optimize - When optimizing, include this equipment type or not.


    OPTIMIZE_SETTINGS ={ # Do not delete :unlisted from the keys.
      :unlisted => [:def, :res, :maxhp, :spi, :maxmp, :agi, :atk],
      :weapon   => [:atk, :spi, :maxmp, :agi, :maxhp, :def, :res],
    } # Do not remove this.

This will determine the stat order at which items are optimized for each equipment type. If type is unlisted, it will pull from the :unlisted category which can also be defined here.


To change an actor's equip types mid-game, use the following event calls.

array = [:other, :other, :other]
$game_actors[x].equip_type = array

This changes the actors equip types to set array. Any unequippable items will be purged and thrown back into the inventory. This does not include weapon and weapon will be automatically excluded to maintain compatibility.

$game_actors[x].add_equip_type(type)

This adds an equip type onto the pre-existing equip types. It opens up an extra expanded slot at the very end of the list. This does not include weapon and weapon will be automatically excluded to maintain comptability.

$game_actors[x].delete_last_equip_type

This removes the last type in the current equip types. The item in the previous types are dropped. This will not delete weapon types to maintain compatibility.


To apply certain equips to certain types, use the following notetag:

<equip type: phrase>

This changes the equip type of the item to whatever the phrase is. This tag exists for using more than the 4 types of armour equips available to RPG Maker. To understand how this works better, read the Equip Settings part of the module and adjust the settings there accordingly. Used for armours only.

Allow your equipment to adjust MaxHP and MaxMP as well as boost stats past the original limitation of 500.

Base Stat Settings

For those who would love to redefine the way their game calculates their base stats, edit the following options below and use a formula you prefer. Otherwise, leave this alone as they are the default settings. The settings below are only the MaxHP, MaxMP, ADSA, and HECO stats available. This will allow you to modify them without needing to alter the base scripts.

The following hash contains the basic stat retrieval formula. Modify it if you wish, but make sure they remain in quote format to work.

    BASE_STAT ={
      :maxhp => "actor.parameters[0, @level]",
      :maxmp => "actor.parameters[1, @level]",
      :atk   => "actor.parameters[2, @level]",
      :def   => "actor.parameters[3, @level]",
      :spi   => "actor.parameters[4, @level]",
      :agi   => "actor.parameters[5, @level]",
      :hit   => "95",
      :eva   => "5",
      :cri   => "4 + ((actor.critical_bonus) ? 4 : 0)",
      :odds  => "4 - self.class.position",
    } # Do not remove this.

Notetags

These are notetags that you may place into your weapon and armour noteboxes to allow them to have unique properties.

<stat: +x>
<stat: -x>
<stat: +x%>
<stat: -x%>

This will allow the piece of equipment to raise or lower the stat by x in either a set amount or percentile amount. Note that percents are calculated before set values. Percents are also ignored from equip optimization. This tag will allow you to go past the 500 maximum value that the editor has. Replace stat with one of the following: MaxHP, MaxMP, ATK, DEF, SPI, AGI, HIT, EVA, CRI, ODDS


<trait: phrase>

This will give your piece of equipment some unique traits. Just replace the word phrase inside the tag with one of the following:

  super guard      - Guarding reduces damage by 4x instead of 2x.
  pharmacology     - Items used will have double effect.
  fast attack      - Early turn initiative.
  dual attack      - Normal attacks hit twice.
  prevent critical - Criticals cannot occur on battler.
  half mp cost     - MP skills cost only half.
  double exp gain  - Inflicted actor gains double exp.
  auto hp recover  - Inflicted actor gains HP each turn and step.


<auto state: x>
<auto states: x,x>

This will cause the piece of equipment to have states x automatically on the actor so long as the actor has the item equipped. Once unequipped, the state will no longer be applied to the actor.


<require above: stat x>
<require under: stat x>

This will make your piece of equipment require certain stat conditions to be met. If above, it is greater than or equal to. If under, it is less than or equal to. Replace stat with one of the following: Level, MaxHP, MaxMP, ATK, DEF, SPI, RES, DEX, AGI, HIT, EVA, CRI, ODDS


<require switch: x>
<require switches: x,x>

This will require the switch x to be on before the piece of equipment can be worn by the actor. If it isn't on, it'll be greyed out until available.


<require variable x: above y>
<require variable x: under y>

This will require the variable x to be above/under y in order for the item to become equippable by the actor.


<2 hand text: phrase>

This will replace the default two-handed text with whatever you've inserted for phrase. Case sensitive. Weapons only.


<equip type: phrase>

This changes the equip type of the item to whatever the phrase is. This tag exists for using more than the 4 types of armour equips available to RPG Maker. To understand how this works better, read the Equip Settings part of the module and adjust the settings there accordingly. Used for armours only.

The aptitude system allows classes that are more adaptive to certain stats to receive better benefits from it.

Aptitude Settings

The following allows you to adjust how much benefit and gain each class gains for each stat when equipping weapons and armours. For instance, a warrior will only benefit from 80% of an SPI boost compared to a mage.

    USE_APTITUDE_SYSTEM = true

Set this to true if you wish to use the aptitude system for your game.


    APTITUDE ={ # Class 0 is the common class. Do not delete it.
    # ClassID => [MaxHP, MaxMP,   ATK,   DEF,   SPI,   RES,   DEX,   AGI]
            0 => [  100,   100,   100,   100,   100,   100,   100,   100],
            1 => [  110,   100,   110,   100,    90,    90,   100,   110],
            2 => [  120,    90,   120,   100,    80,   100,   110,   100],
            3 => [   90,   110,    80,   100,   110,   120,    90,   100],
            4 => [   80,   120,    80,   100,   120,   110,    90,   100],
            5 => [  105,    95,   105,   100,   105,   110,    90,    90],
            6 => [   95,   105,   105,   100,   110,   105,    90,    90],
            7 => [  120,    80,   120,    90,    90,    80,   120,   100],
            8 => [   90,   110,    90,    80,   110,    80,   120,   120],
    } # Do not remove this.

This hash adjusts the starting aptitude rates for each class. These rates determine how much of a stat bonus is applied to each individual stat for each piece of equipment.


    MINIMUM_APTITUDE = 10
    MAXIMUM_APTITUDE = 255

This determines the maximum and minimum aptitudes possible. Anything more or anything less will be treated as the minimum or maximum.


    SHOW_APT_BOOSTS = true

This will reveal all aptitude boost items for your game if your game has any. Set this to false and it will only reveal aptitude boosts that the player has.


These following notetags modify items.

<stat aptitude: +x%>
<stat aptitude: -x%>

This will raise or lower the stat's aptitude by x%. Replace stat with one of the following: MaxHP, MaxMP, ATK, DEF, SPI, RES, DEX, or AGI

And that's it for Equipment Overhaul!