Introduction
This plugin was a request I received to be able to use equipment for effects in battle. Apparently the request was motivated by Dragon Quest, but it reminded me of the Shining Force and Phantasy Star games.
I have tested the basic functionality, please let me know if you encounter any errors. I will consider making compatibility patches if the other plugin is free to use (or one I own, such as a Yanfly product) and unobfuscated. Otherwise, other authors are free to modify this code to make it compatible with theirs so long as I am still credited.
Spoiler: Features
Using this plugin, you can assign weapons and armor to have the function of consumable items or skills in your database. You will then be able to go into the Items menu in battle, and any equipment with that assignation the current actor has equipped will show up to be used.
There are a number of options that can be configured. The default functionality lets the player freely activate equipped items as their turn in battle. You can instead impose a limit so each actor may only activate each item once per battle. If using Yanfly's Item Core, you can also set a specific number of charges per item, and whether or not they recharge automatically.
Finally, you can specify a chance that an item will "crack" when activated. This does not impair its basic weapon/armor functionality, but prevents it from being activated again until the item is repaired. This option requires the use of Yanfly's Item Core with the parameters set to make weapons and armor independent items. You can also set a second chance that when an item cracks it will break, destroying and immediately removing the item.
Spoiler: Screenshots
Spoiler: How to Use
Use the following notetag in the notebox of your Weapons or Armor:
<activateequipment: [skill/item] ID>
Example: <activateequipment: skill 14>
The word specifies whether the equipment is referencing a skill or item in your database. The ID determines which skill or item. Note that any costs associated with a skill are ignored when activating it from equipment.
<activateonce>
This notetag limits the equipment to being activated once per actor per battle.
<cancrack: [chance]>
Example: <cancrack: 40> would give the equipment a 40% chance to crack
This does not change how frequently the equipment can be activated, but gives each activation the specified percent chance to crack. A cracked item still has all of its parameters and functions normally as equipment, but is not available to be activated again in battle. Once it's repaired, it can be activated again normally. This notetag will not function unless your project also has Yanfly's Item Core and weapons and armor are set to be independent items.
<crackbreak: [chance]>
Example: <crackbreak: 33> would give the equipment a 40% chance to break when it cracks
This gives the equipment a chance to break and be permanently destroyed each time it cracks. This will have no effect unless the <cancrack> notetag is on the item.
<breaktext: [text]>
Example: <breaktext: The Holy Ring shatters into hundreds of pieces!>
This will allow you to create a custom message to display when a piece of equipment breaks. If specified, it will display after the crack message.
<activatecharges: [number]>
Example: <activatecharges: 4>
This will give the equipment a certain number of charges. Activating the equipment in battle spends one charge and equipment cannot be activated when it has no charges left. Charges will replenish at the start of each battle unless otherwise specified.
<chargespersist>
This notetag causes charges to persist between battles instead of refilling automatically.
Spoiler: Plugin Commands / Script Calls
RepairEquipment
This plugin command will repair all cracked equipment owned by the party.
RechargeEquipment
This plugin command will reset all equipment owned by the party to their maximum charges.
CrackRepair(item)
This function can be used to repair an individual cracked equipment. This may be useful if you want to have vendors that charge for each repair, or if you want an actor to be able to repair their own items during battle.
IsCracked(item)
This will return whether a specified weapon/armor is cracked.
RechargeItem(item)
This function can be used to reset an individual piece of equipment back to its maximum charges.
item.charges
This variable tracks an item's current number of charges.
actor.activating
If an actor is activating a piece of equipment, a copy of it will be stored in this variable for the duration of that action.
Terms and Credits
Free for non-commercial and commercial use. Credit ATT_Turan.