- Joined
- May 30, 2015
- Messages
- 816
- Reaction score
- 848
- First Language
- English
- Primarily Uses
Random Equipment Prefixes & Affixes
By DreamX
Introduction/Features
With notetags, you can specify random traits for an equipment by using an affix and/or prefix item.
Do not use prefix/suffix notetags with starting items. If you want an actor to start with an randomized item, add the item to the party and then equip them with it.
Patch Notes
v1.24:
Note: This version does not allow for independent items (randomized) to be used as augments. I'll try to find a solution but Yanfly's plugin isn't supposed to be using independent items for augments.
There's a link to the last version (1.23d) in the topic post if you prefer it.
-Added compatibility with large icon display in Item Core and Shop Core, for icon overlays
-Added new notetags to use more than one prefix/suffix, with chances you can
decide per individual item or item set
-Added new notetags to pre-augment item with augments, with chances you can decide per individual item or item set
-This version may possibly not work correctly with saves of older versions
Other New Notetags:
<prefixSuffixDontAddName> Won't add the prefix/suffix name
<prefixSuffixNoNameSpace> Doesn't add space when adding prefix/suffix name
<prefixSuffixCapitalizeFirstLetter> Will capitalize the first letter of the new item's name
and lower case every other letter
I tested:
-Everything new that was added
-Adding Upgrades to randomized items
-Drops with and without YEP Victory Aftermath
-Drops with Yanfly Extra Enemy Drops
-Saving/Loading
-Removing augments from pre-augmented items
-Pre-augmenting items in Hime's Shop Core
-Buying pre-augmented items in Hime's Shop Core
-Removing augments from pre-augmented items bought from Hime's Shop Core
-Buying multiple randomized items from Hime's Shop Core
Past Patch Notes:
How to Use
Right click the script link and select save link as a .js file.
Place UNDER Yanfly plugins.
v1.24 Help:
* This plugin must be named DreamX_RandomPrefixesSuffixes in order for
* parameters to work properly.
*
* Requires Yanfly Item Core.
* Items may only be randomized if there item type is independent (check Item
* Core parameters. By default weapons and armors are independent, but regular
* items are not. You'll need to change the parameters from the default for
* regular items).
*
* ============================================================================
* How Items Are Combined
* ============================================================================
* If the base item is named "Sword", the prefix item is named "Strong"
* and the suffix item is named "Of Fire"
* You would get Strong Sword Of Fire.
*
* The new item have the traits of both prefix and suffix items and add their
* params. For example, if the prefix item has +10 ATK and the base item has
* +20 ATK, the new item wil have +30 ATK.
* Meta will be a combination of the prefix and suffix item meta, in other words,
* the notetags.
* Price will be the original plus the prices of the prefix and suffix item.
* Note will be the notes of the original, the prefix and the suffix items
* except that the meta and prefix notetag portions will be removed.
*
* ============================================================================
* Affix Choices
* ============================================================================
* You can have unlimited amounts of prefix and suffix combinations.
* Each set of choices should begin on its own line.
* You can enter ranges to select randomly for a set of numbers (ids).
* After a number or set of numbers, you will enter the chance.
* If the chances do not add up to 100%, there is a chance none will be chosen.
* It's up to you use percentages that add up to less than or equal to 100%.
* Not doing so many result in undesired results.
*
* Here's an example with suffixes.
* <Suffixes>
* 5-8 11 50% 10 50%
* 7 100%
* </Suffixes>
* In this example, one id from 5-8, and 11 has a 50% chance of being chosen,
* and id 10 has a 50% of being chosen.
* Then, 7 has a 100% chance of being chosen.
*
* Here's another example with prefixes this time.
* <Prefixes>
* 12-15 20 22 25%
* </Prefixes>
* In this example, one id from 12-15, 20 or 22 has a 25% of being chosen.
* So, there is a 75% of none being chosen.
*
* ============================================================================
* Augment Choices
* ============================================================================
* Augment choices work much the same way as affix choices, except you will
* also be what type of augment the augment is. The augment ids should be for
* the item part of the database only, not weapon/armor. The augments will be
* applied when the new item is created.
*
* <Prefix Suffix Augments>
* Glyph 17-19 50% 20-23 26 50%
* </Prefix Suffix Augments>
*
* In this example, the augment type is Glyph. There is a 50% chance to use 17,
* 18 or 19 as the augment, and a 50% chance to use 20, 21, 22, 23 or 26
* instead.
*
* You can use multiple lines. Here's another example.
* <Prefix Suffix Augments>
* Glyph 17-19 50% 20-23 26 50%
* Orb 50-56 25% 7 50%
* </Prefix Suffix Augments>
* ============================================================================
* Affix Choices (Old Notetags)
* ============================================================================
* Add <prefix:x,y,z> and/or <suffix:x,y,z> to a weapon/armor's note
* with the letters being weapon/armor ids. You can have as many ids
* as you want. The ids must be the same type as the base item,
* ie. weapon ids for a weapon, etc.
* When the party gains that equipment, it'll randomly choose a prefix
* and/or suffix and add the traits, params, price and meta to a new item,
* also changing the name. The new item is then added instead of the
* base item.
*
* Example: <prefix: 2, 4, 5-10, 12, 26> <suffix:7,2>
*
* As you can see, you can add item id ranges. In addition to the single ids,
* item ids 5, 6, 7, 8, 9 and 10 will be added to the pool in this example.
* ============================================================================
* Notetags For Prefix and Suffix Items:
* ============================================================================
* <prefixSuffixDontAddName> Won't add the prefix/suffix name
*
* <prefixSuffixNoNameSpace>
* There will be no added space when adding the prefix/suffix name for this
* item.
*
* <prefixSuffixCapitalizeFirstLetter> Will capitalize the first letter of the
* new item's name and lower case every other letter
*
* <prefixSuffixReplaceAnim>
* The new item will have the animation of this prefix/suffix item.
* ---
* <prefixSuffixReplaceIcon>
* The new item will have the icon of the prefix/suffix item.
* ---
* <prefixSuffixName:x>
* The prefix/suffix item name when added to the new item will be x.
* This is useful if you want to have a different name in the database.
* ---
* <prefixSuffixReplaceWeaponType>
* The new item will have the weapon type of the prefix/suffix item.
* Weapons only.
* ---
* <prefixSuffixReplaceArmorType>
* The new item will have the armor type of the prefix/suffix item.
* Armor only.
* ---
* <prefixSuffixUseWeaponDatabase>
* The new item uses prefix/suffix items from the weapon database instead of
* the armor database.
* Armor only.
* ---
* <prefixSuffixUseArmorDatabase>
* The new item uses prefix/suffix items from the armor database instead of
* the weapon database.
* Weapon only.
* ---
* <prefixSuffixCombineSuccess>
* The new item's success rate will be combined with that of the prefix/suffix
* item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixCombineVariance>
* The new item's damage variance will be combined with that of the prefix/suffix
* item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixCombineDamageFormula>
* The new item's damage formula will be combined with that of the prefix/suffix
* item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixReplaceConsumable>
* The new item's consumable type (yes or no) will be replaced by that of the
* prefix-suffix item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixReplaceHitType>
* The new item's hit type will be replaced by that of the prefix-suffix item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixReplaceOccasion>
* The new item's occasion type will be replaced by that of the prefix-suffix
* item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixReplaceItemType>
* The new item's item type will be replaced by that of the prefix-suffix item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixReplaceScope>
* The new item's scope will be replaced by that of the prefix-suffix item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixReplaceCriticalHits>
* The new item's critical hit type (yes or no) will be replaced by that of the
* prefix-suffix item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixReplaceDamageType>
* The new item's damage type will be replaced by that of the prefix-suffix
* item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixReplaceDamageElement>
* The new item's damage element will be replaced by that of the prefix-suffix
* item.
* Regular (non-weapon, non-armor) items only.
* ---
* <OverlayIcon>
* This will allow the new item derived from this item to have its icon
* overlay or by overlayed with another item. It must exist on at least two of
* the following items when the new item is being made: the base item, prefix
* item or suffix item.
* --
* <OverlayIconOrder: x> with x as the order. This will determine the order
* in which the icons are overlayed. Lower values are placed first, with
* higher values overlayed on top of those.
* ============================================================================
* Affix Parameters
* ============================================================================
* <prefixSuffixParameters: ATK 5|10 DEF -10|20>
* Here is an example of how to add random bonus parameter values. Put this in
* a prefix or suffix item.
*
* We put the name of the parameter first, then the range of possible values.
* The first number (5 for ATK or -10 for DEF in this example) must be equal to
* or less than the second number (10 for ATK or 20 for DEF in this example).
* Here are the parameter names: MHP, MMP, ATK, DEF, MAT, MDF, AGI, LUK
*
* If you want to guarantee a certain value, it is better to just use the
* database.
*
* For the plugin parameter "Bonus Parameter Text", here are the text codes:
* %1 - The + sign if the bonus is positive.
* %2 - The highest value of the random parameter bonuses applied on the item.
* Can be negative.
* ============================================================================
* Affix/Augment Requirements
* ============================================================================
* <Prefix Suffix Requirement>
* x
* </Prefix Suffix Requirement>
* Replace x with code. This is a requirement for prefix/suffix or augment item.
*
* Example:
* <Prefix Suffix Requirement>
* $gameSwitches.value(1);
* </Prefix Suffix Requirement>
* In this example, it requires that switch 1 is on.
* ============================================================================
* Affix Effects
* ============================================================================
* <Prefix Suffix Effect>
* var atkBonus = Math.floor((Math.random() * 100) + 50);
* newItem.params[2] += atkBonus;
* newItem.name += " +" + atkBonus;
* newItem.price += atkBonus;
* </Prefix Suffix Effect>
*
* Here's an example of how to add a custom effect to the new item from the
* prefix/suffix item. You'll need to know some javascript.
*
* In this example, we are applying a random ATK bonus between 50 and 150 to
* the new item and also adding that bonus to the name of the new item. In
* additon, we also add to the price the ATK bonus.
*
* Here are the variables provided to you by plugin for these effects:
* item - the prefix/suffix item the effect is taken from.
* baseItem - the baseItem.
* newItem = the new item to be created.
* ============================================================================
* Affix Chance Type For Old Notetags
* ============================================================================
* This section is for use for the <suffix: x> and <suffix: x> notetags only.
*
* <prefixSuffixChance:x>
* Replace x with the percent chance of getting that prefix or suffix.
* Example: <prefixSuffixChance:25> for a 25% chance.
*
* Every prefix/suffix with the same percentage gets added to the same percentage
* pool.
* A random number between 1 and 100 will be generated and the lowest
* percentage pool that the random number is less than or equal to will be
* chosen.
*
* For example, if the pools are 10%, 20% and 30% and the random number was 15,
* you get a prefix/suffix from the pool with percentage 20%.
*
* If you get over the highest percentage, you will get one of the
* prefixes/suffixes from the highest percentage pool. Having a combined
* percentage (total of all chances for all prefix/suffix choices for a base
* item) of 100 is recommended but not required.
*
* If none of the prefix or suffix items for the base item have a chance notetag,
* then the item will be randomly chosen as normal with each prefix or suffix
* having an equal probability.
*
* If at least one but not all of the prefix/suffix items for the base item has
* a chance notetag, then the prefix/suffixes that don't have a percent notetag
* will be assigned the default chance specified in the parameter for this
* plugin.
* ============================================================================
* Function Calls provided by this plugin
* ============================================================================
* For use in custom requirements:
*
* this.averagePartyLevel()
* Returns the average level of the party.
*
* this.averagePartyBattleMemberLevel()
* Returns the average level of party battle members.
* ============================================================================
* Terms Of Use
* ============================================================================
* Free to use and modify for commercial and noncommercial games, with credit.
* Credit Yanfly. This script uses code from their Item Core plugin.
* ============================================================================
* Credits
* ============================================================================
* DreamX
* Yanfly for Item Core plugin.
Script (Latest)
Script (v1.23d)
Script (v1.19a)
Compatibility
Set under Yanfly plugins and any other plugin that modifies items/equipping.
By DreamX
Introduction/Features
With notetags, you can specify random traits for an equipment by using an affix and/or prefix item.
Do not use prefix/suffix notetags with starting items. If you want an actor to start with an randomized item, add the item to the party and then equip them with it.
Patch Notes
v1.24:
Note: This version does not allow for independent items (randomized) to be used as augments. I'll try to find a solution but Yanfly's plugin isn't supposed to be using independent items for augments.
There's a link to the last version (1.23d) in the topic post if you prefer it.
-Added compatibility with large icon display in Item Core and Shop Core, for icon overlays
-Added new notetags to use more than one prefix/suffix, with chances you can
decide per individual item or item set
-Added new notetags to pre-augment item with augments, with chances you can decide per individual item or item set
-This version may possibly not work correctly with saves of older versions
Other New Notetags:
<prefixSuffixDontAddName> Won't add the prefix/suffix name
<prefixSuffixNoNameSpace> Doesn't add space when adding prefix/suffix name
<prefixSuffixCapitalizeFirstLetter> Will capitalize the first letter of the new item's name
and lower case every other letter
I tested:
-Everything new that was added
-Adding Upgrades to randomized items
-Drops with and without YEP Victory Aftermath
-Drops with Yanfly Extra Enemy Drops
-Saving/Loading
-Removing augments from pre-augmented items
-Pre-augmenting items in Hime's Shop Core
-Buying pre-augmented items in Hime's Shop Core
-Removing augments from pre-augmented items bought from Hime's Shop Core
-Buying multiple randomized items from Hime's Shop Core
Past Patch Notes:
1.23a - Fixes a bug where the default parameter bonuses would go up to min + max, instead of between min & max.
1.23 allows for icon overlay. Quickly made example of what it can look like:

The icons are drawn on top of each other. You can specify the order.
* <OverlayIcon>
* This will allow the new item derived from this item to have its icon
* overlay or by overlayed with another item. It must exist on at least two of the
* following items when the new item is being made: the base item, prefix item
* or suffix item.
* --
* <OverlayIconOrder: x> with x as the order. This will determine the order
* in which the icons are overlayed. Lower values are placed first, with
* higher values overlayed on top of those.
v1.22 - Was skipped for some reason.
v1.21a - Fixes resetting variance from Item Core from unequipping, fixes slot display from Yanfly Item Upgrade Slots.
v1.20d - Allows for proper custom parameter setting with Quasi's Param Plus. Make sure to have the latest version of their plugin.
v1.20c: Fixes item upgrade slot number not being shown when using Yanfly Item Upgrade Slots.
v1.20b: Fixes bugs with Yanfly Attach Augments and few others of theirs.
v1.20a: fixes a bug that caused shop core randomization not to work.
v1.20:
The plugin now requires Item Core. Items may only be randomized if the item type is independent (check Item Core parameters. By default weapons and armors are independent, but regular items are not. You'll need to change the parameters from the default for regular items).
The plugin must now be named DreamX_RandomPrefixesSuffixes
Previous saves are not compatible with this version. But should fix save issues.
You will need to redo the parameters.
Regular non-weapon/armor items can now be randomized.
Compatible with all Yanfly plugin notetags as of 4/28/16.
Fixes empty bonus text still causing the sign bonus to be shown.
You can now use 0 in the range for random bonus parameters.
Many notetags have been renamed or added. Check help file for more information. You can use a parameter to keep the old tags if you want, but I suggest you rename them. My recommendation is to use a text editor like notepad++, open the weapon and armor json files (after backing them up!) and convert them for both files at the same time.
Here are the conversions:
<affix:x> to <suffix:x>
<prefixAffixReplaceAnim:1> to <prefixSuffixReplaceAnim>
<prefixAffixReplaceIcon:1> to <prefixSuffixReplaceIcon>
<prefixAffixName:x> to <prefixSuffixName:x>
<prefixAffixParameters:x> to <prefixSuffixParameters:x>
<prefixAffixChance:x> to <prefixSuffixChance:x>
Prefix Affix to Prefix Suffix
DreamX.RandomPrefixAffix to DreamX.RandomPrefixSuffix
1.19 -Added parameter for added price for prefix/affix items with random bonus stats.
* Use <prefixAffixName:x> with x as the name to override the database name
* for this item when making the new item. This means you can name the
* database item in a way convenient for you, but have the name display
* differently in-game, as whatever you put in the notetag.
1.17 - You can now add item ranges instead of having to do them one by one.
Like this: 5-10
In that example, item ids 5, 6, 7, 8, 9 and 10 will be added to the pool.
You can now apply a custom js effect from a prefix/affix item.
* Here's an example of how to add a custom effect to the new item from the prefix/affix item.
* You'll need to know some javascript.
*
* <Prefix Affix Effect>
* var atkBonus = Math.floor((Math.random() * 100) + 50);
* newItem.params[2] += atkBonus;
* newItem.name += " +" + atkBonus;
* newItem.price += atkBonus;
* </Prefix Affix Effect>
*
* In this example, we are applying a random ATK bonus between 50 and 150 to
* the new item and also adding that bonus to the name of the new item. In
* additon, we also add to the price the ATK bonus.
*
* Here are the variables provided to you by plugin for these effects:
* item - the prefix/affix item the effect is taken from.
* baseItem - the baseItem.
* newItem = the new item to be created.
v1.16:
* Here's an example of how to add a custom requirement to a prefix or affix
* item. You'll need a bit of javascript knowledge.
*
* <Prefix Affix Requirement>
* $gameSwitches.value(1);
* </Prefix Affix Requirement>
*
* This will require that switch 1 is on.
*
* Here's an another example using a function provided by this plugin.
* <Prefix Affix Requirement>
* DreamX.RandomPrefixAffix.averagePartyLevel() > 5 && DreamX.RandomPrefixAffix.averagePartyLevel() < 10;
* </Prefix Affix Requirement>
*
* In this example, the requirement is that the average party level is above 5
* but below 10.
*
* Another function provided by this program is
* DreamX.RandomPrefixAffix.averagePartyBattleMemberLevel
* It returns the average level of all of the battle members in the party,
* instead of the whole party. You can use this function the same way as above.
*
* If you're having trouble with javascript, I recommend either asking in the
* thread for this plugin or somewhere else in the javascript section, or google
* it, etc.
v1.15 - Adds random bonus parameters. See help for more info.
v1.14 - Fixes an issue with unequippable armors when loading a save.
v1.13a - Also fixes drops when you're not using Yanfly's Victory Aftermath.
v1.13 - Fix drops mismatching what is displayed in the battle result.
v1.12 - Fixed bug with Yanfly plugin note parsing.
v1.11 -
Compatibility
Now compatible with all Yanfly plugin notes/notetags as of 3/19/16.
Percent Chances
Use <prefixAffixChance:x> with x being the percent chance of getting that prefix or affix.
Example: <prefixAffixChance:25> for a 25% chance.
Every prefix/affix with the same percentage gets added to the same percentage pool.
A random number between 1 and 100 will be generated and the lowest percentage pool that the random number is less than or equal to will be chosen.
For example, if the pools are 10%, 20% and 30% and the random number was 15, you get a prefix/affix from the pool with percentage 20%.
If you get over the highest percentage, you will get one of the prefixes/affixes from the highest percentage pool. Having a combined percentage (total of all chances for all prefix/affix choices for a base item) of 100 is recommended but not required.
If none of the prefix or affix items for the base item have a chance notetag, then the item will be randomly chosen as normal with each prefix or affix having an equal probability.
If at least one but not all of the prefix/affix items for the base item has a chance notetag, then the prefix/affixes that don't have a percent notetag will be assigned the default chance specified in the parameter for this plugin.
-
Error Handling
If you use the wrong notetags for the prefix/affix (like IDs that don't exist), the player simply doesn't get an item instead of the game crashing.
v1.10 - Fixed an issue where you could not equip prefix/affix items from a previous save, if you were using Yanfly's Item Core. Very important to update!
v1.09 - The descriptions of the base item, the prefix item and the affix item are now added together.
v1.08 - Compatibility with Yanfly's Auto Passive States & Buff States Core.
v1.07 - Compatible with Yanfly's Item Core notetags.
v1.06: Compatibility with Yanfly's Item Core. Previously, if you had independent items on, items with affix/prefix might be added to the party if one actor in the database (who may not even be in the party) had it as starting equipment.
v1.05b - Fixed actors not being equipped with their starting equipment.
v1.05 - Compatible with Yanfly's Victory Aftermath. Also compatible with Mr. Triviel's Item Salvage plugin and should be compatible with any other plugin that uses an item's notes but in a way different from the standard <metaTag:x>.
1.04 - Battle item drops now display the name with the correct prefix and affix.
1.03 - Fixed always getting the same prefix/affix when you receive multiple of an equipment at a time.
1.23 allows for icon overlay. Quickly made example of what it can look like:

The icons are drawn on top of each other. You can specify the order.
* <OverlayIcon>
* This will allow the new item derived from this item to have its icon
* overlay or by overlayed with another item. It must exist on at least two of the
* following items when the new item is being made: the base item, prefix item
* or suffix item.
* --
* <OverlayIconOrder: x> with x as the order. This will determine the order
* in which the icons are overlayed. Lower values are placed first, with
* higher values overlayed on top of those.
v1.22 - Was skipped for some reason.
v1.21a - Fixes resetting variance from Item Core from unequipping, fixes slot display from Yanfly Item Upgrade Slots.
v1.20d - Allows for proper custom parameter setting with Quasi's Param Plus. Make sure to have the latest version of their plugin.
v1.20c: Fixes item upgrade slot number not being shown when using Yanfly Item Upgrade Slots.
v1.20b: Fixes bugs with Yanfly Attach Augments and few others of theirs.
v1.20a: fixes a bug that caused shop core randomization not to work.
v1.20:
The plugin now requires Item Core. Items may only be randomized if the item type is independent (check Item Core parameters. By default weapons and armors are independent, but regular items are not. You'll need to change the parameters from the default for regular items).
The plugin must now be named DreamX_RandomPrefixesSuffixes
Previous saves are not compatible with this version. But should fix save issues.
You will need to redo the parameters.
Regular non-weapon/armor items can now be randomized.
Compatible with all Yanfly plugin notetags as of 4/28/16.
Fixes empty bonus text still causing the sign bonus to be shown.
You can now use 0 in the range for random bonus parameters.
Many notetags have been renamed or added. Check help file for more information. You can use a parameter to keep the old tags if you want, but I suggest you rename them. My recommendation is to use a text editor like notepad++, open the weapon and armor json files (after backing them up!) and convert them for both files at the same time.
Here are the conversions:
<affix:x> to <suffix:x>
<prefixAffixReplaceAnim:1> to <prefixSuffixReplaceAnim>
<prefixAffixReplaceIcon:1> to <prefixSuffixReplaceIcon>
<prefixAffixName:x> to <prefixSuffixName:x>
<prefixAffixParameters:x> to <prefixSuffixParameters:x>
<prefixAffixChance:x> to <prefixSuffixChance:x>
Prefix Affix to Prefix Suffix
DreamX.RandomPrefixAffix to DreamX.RandomPrefixSuffix
1.19 -Added parameter for added price for prefix/affix items with random bonus stats.
* Use <prefixAffixName:x> with x as the name to override the database name
* for this item when making the new item. This means you can name the
* database item in a way convenient for you, but have the name display
* differently in-game, as whatever you put in the notetag.
1.17 - You can now add item ranges instead of having to do them one by one.
Like this: 5-10
In that example, item ids 5, 6, 7, 8, 9 and 10 will be added to the pool.
You can now apply a custom js effect from a prefix/affix item.
* Here's an example of how to add a custom effect to the new item from the prefix/affix item.
* You'll need to know some javascript.
*
* <Prefix Affix Effect>
* var atkBonus = Math.floor((Math.random() * 100) + 50);
* newItem.params[2] += atkBonus;
* newItem.name += " +" + atkBonus;
* newItem.price += atkBonus;
* </Prefix Affix Effect>
*
* In this example, we are applying a random ATK bonus between 50 and 150 to
* the new item and also adding that bonus to the name of the new item. In
* additon, we also add to the price the ATK bonus.
*
* Here are the variables provided to you by plugin for these effects:
* item - the prefix/affix item the effect is taken from.
* baseItem - the baseItem.
* newItem = the new item to be created.
v1.16:
* Here's an example of how to add a custom requirement to a prefix or affix
* item. You'll need a bit of javascript knowledge.
*
* <Prefix Affix Requirement>
* $gameSwitches.value(1);
* </Prefix Affix Requirement>
*
* This will require that switch 1 is on.
*
* Here's an another example using a function provided by this plugin.
* <Prefix Affix Requirement>
* DreamX.RandomPrefixAffix.averagePartyLevel() > 5 && DreamX.RandomPrefixAffix.averagePartyLevel() < 10;
* </Prefix Affix Requirement>
*
* In this example, the requirement is that the average party level is above 5
* but below 10.
*
* Another function provided by this program is
* DreamX.RandomPrefixAffix.averagePartyBattleMemberLevel
* It returns the average level of all of the battle members in the party,
* instead of the whole party. You can use this function the same way as above.
*
* If you're having trouble with javascript, I recommend either asking in the
* thread for this plugin or somewhere else in the javascript section, or google
* it, etc.
v1.15 - Adds random bonus parameters. See help for more info.
v1.14 - Fixes an issue with unequippable armors when loading a save.
v1.13a - Also fixes drops when you're not using Yanfly's Victory Aftermath.
v1.13 - Fix drops mismatching what is displayed in the battle result.
v1.12 - Fixed bug with Yanfly plugin note parsing.
v1.11 -
Compatibility
Now compatible with all Yanfly plugin notes/notetags as of 3/19/16.
Percent Chances
Use <prefixAffixChance:x> with x being the percent chance of getting that prefix or affix.
Example: <prefixAffixChance:25> for a 25% chance.
Every prefix/affix with the same percentage gets added to the same percentage pool.
A random number between 1 and 100 will be generated and the lowest percentage pool that the random number is less than or equal to will be chosen.
For example, if the pools are 10%, 20% and 30% and the random number was 15, you get a prefix/affix from the pool with percentage 20%.
If you get over the highest percentage, you will get one of the prefixes/affixes from the highest percentage pool. Having a combined percentage (total of all chances for all prefix/affix choices for a base item) of 100 is recommended but not required.
If none of the prefix or affix items for the base item have a chance notetag, then the item will be randomly chosen as normal with each prefix or affix having an equal probability.
If at least one but not all of the prefix/affix items for the base item has a chance notetag, then the prefix/affixes that don't have a percent notetag will be assigned the default chance specified in the parameter for this plugin.
-
Error Handling
If you use the wrong notetags for the prefix/affix (like IDs that don't exist), the player simply doesn't get an item instead of the game crashing.
v1.10 - Fixed an issue where you could not equip prefix/affix items from a previous save, if you were using Yanfly's Item Core. Very important to update!
v1.09 - The descriptions of the base item, the prefix item and the affix item are now added together.
v1.08 - Compatibility with Yanfly's Auto Passive States & Buff States Core.
v1.07 - Compatible with Yanfly's Item Core notetags.
v1.06: Compatibility with Yanfly's Item Core. Previously, if you had independent items on, items with affix/prefix might be added to the party if one actor in the database (who may not even be in the party) had it as starting equipment.
v1.05b - Fixed actors not being equipped with their starting equipment.
v1.05 - Compatible with Yanfly's Victory Aftermath. Also compatible with Mr. Triviel's Item Salvage plugin and should be compatible with any other plugin that uses an item's notes but in a way different from the standard <metaTag:x>.
1.04 - Battle item drops now display the name with the correct prefix and affix.
1.03 - Fixed always getting the same prefix/affix when you receive multiple of an equipment at a time.
How to Use
Right click the script link and select save link as a .js file.
Place UNDER Yanfly plugins.
v1.24 Help:
* This plugin must be named DreamX_RandomPrefixesSuffixes in order for
* parameters to work properly.
*
* Requires Yanfly Item Core.
* Items may only be randomized if there item type is independent (check Item
* Core parameters. By default weapons and armors are independent, but regular
* items are not. You'll need to change the parameters from the default for
* regular items).
*
* ============================================================================
* How Items Are Combined
* ============================================================================
* If the base item is named "Sword", the prefix item is named "Strong"
* and the suffix item is named "Of Fire"
* You would get Strong Sword Of Fire.
*
* The new item have the traits of both prefix and suffix items and add their
* params. For example, if the prefix item has +10 ATK and the base item has
* +20 ATK, the new item wil have +30 ATK.
* Meta will be a combination of the prefix and suffix item meta, in other words,
* the notetags.
* Price will be the original plus the prices of the prefix and suffix item.
* Note will be the notes of the original, the prefix and the suffix items
* except that the meta and prefix notetag portions will be removed.
*
* ============================================================================
* Affix Choices
* ============================================================================
* You can have unlimited amounts of prefix and suffix combinations.
* Each set of choices should begin on its own line.
* You can enter ranges to select randomly for a set of numbers (ids).
* After a number or set of numbers, you will enter the chance.
* If the chances do not add up to 100%, there is a chance none will be chosen.
* It's up to you use percentages that add up to less than or equal to 100%.
* Not doing so many result in undesired results.
*
* Here's an example with suffixes.
* <Suffixes>
* 5-8 11 50% 10 50%
* 7 100%
* </Suffixes>
* In this example, one id from 5-8, and 11 has a 50% chance of being chosen,
* and id 10 has a 50% of being chosen.
* Then, 7 has a 100% chance of being chosen.
*
* Here's another example with prefixes this time.
* <Prefixes>
* 12-15 20 22 25%
* </Prefixes>
* In this example, one id from 12-15, 20 or 22 has a 25% of being chosen.
* So, there is a 75% of none being chosen.
*
* ============================================================================
* Augment Choices
* ============================================================================
* Augment choices work much the same way as affix choices, except you will
* also be what type of augment the augment is. The augment ids should be for
* the item part of the database only, not weapon/armor. The augments will be
* applied when the new item is created.
*
* <Prefix Suffix Augments>
* Glyph 17-19 50% 20-23 26 50%
* </Prefix Suffix Augments>
*
* In this example, the augment type is Glyph. There is a 50% chance to use 17,
* 18 or 19 as the augment, and a 50% chance to use 20, 21, 22, 23 or 26
* instead.
*
* You can use multiple lines. Here's another example.
* <Prefix Suffix Augments>
* Glyph 17-19 50% 20-23 26 50%
* Orb 50-56 25% 7 50%
* </Prefix Suffix Augments>
* ============================================================================
* Affix Choices (Old Notetags)
* ============================================================================
* Add <prefix:x,y,z> and/or <suffix:x,y,z> to a weapon/armor's note
* with the letters being weapon/armor ids. You can have as many ids
* as you want. The ids must be the same type as the base item,
* ie. weapon ids for a weapon, etc.
* When the party gains that equipment, it'll randomly choose a prefix
* and/or suffix and add the traits, params, price and meta to a new item,
* also changing the name. The new item is then added instead of the
* base item.
*
* Example: <prefix: 2, 4, 5-10, 12, 26> <suffix:7,2>
*
* As you can see, you can add item id ranges. In addition to the single ids,
* item ids 5, 6, 7, 8, 9 and 10 will be added to the pool in this example.
* ============================================================================
* Notetags For Prefix and Suffix Items:
* ============================================================================
* <prefixSuffixDontAddName> Won't add the prefix/suffix name
*
* <prefixSuffixNoNameSpace>
* There will be no added space when adding the prefix/suffix name for this
* item.
*
* <prefixSuffixCapitalizeFirstLetter> Will capitalize the first letter of the
* new item's name and lower case every other letter
*
* <prefixSuffixReplaceAnim>
* The new item will have the animation of this prefix/suffix item.
* ---
* <prefixSuffixReplaceIcon>
* The new item will have the icon of the prefix/suffix item.
* ---
* <prefixSuffixName:x>
* The prefix/suffix item name when added to the new item will be x.
* This is useful if you want to have a different name in the database.
* ---
* <prefixSuffixReplaceWeaponType>
* The new item will have the weapon type of the prefix/suffix item.
* Weapons only.
* ---
* <prefixSuffixReplaceArmorType>
* The new item will have the armor type of the prefix/suffix item.
* Armor only.
* ---
* <prefixSuffixUseWeaponDatabase>
* The new item uses prefix/suffix items from the weapon database instead of
* the armor database.
* Armor only.
* ---
* <prefixSuffixUseArmorDatabase>
* The new item uses prefix/suffix items from the armor database instead of
* the weapon database.
* Weapon only.
* ---
* <prefixSuffixCombineSuccess>
* The new item's success rate will be combined with that of the prefix/suffix
* item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixCombineVariance>
* The new item's damage variance will be combined with that of the prefix/suffix
* item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixCombineDamageFormula>
* The new item's damage formula will be combined with that of the prefix/suffix
* item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixReplaceConsumable>
* The new item's consumable type (yes or no) will be replaced by that of the
* prefix-suffix item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixReplaceHitType>
* The new item's hit type will be replaced by that of the prefix-suffix item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixReplaceOccasion>
* The new item's occasion type will be replaced by that of the prefix-suffix
* item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixReplaceItemType>
* The new item's item type will be replaced by that of the prefix-suffix item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixReplaceScope>
* The new item's scope will be replaced by that of the prefix-suffix item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixReplaceCriticalHits>
* The new item's critical hit type (yes or no) will be replaced by that of the
* prefix-suffix item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixReplaceDamageType>
* The new item's damage type will be replaced by that of the prefix-suffix
* item.
* Regular (non-weapon, non-armor) items only.
* ---
* <prefixSuffixReplaceDamageElement>
* The new item's damage element will be replaced by that of the prefix-suffix
* item.
* Regular (non-weapon, non-armor) items only.
* ---
* <OverlayIcon>
* This will allow the new item derived from this item to have its icon
* overlay or by overlayed with another item. It must exist on at least two of
* the following items when the new item is being made: the base item, prefix
* item or suffix item.
* --
* <OverlayIconOrder: x> with x as the order. This will determine the order
* in which the icons are overlayed. Lower values are placed first, with
* higher values overlayed on top of those.
* ============================================================================
* Affix Parameters
* ============================================================================
* <prefixSuffixParameters: ATK 5|10 DEF -10|20>
* Here is an example of how to add random bonus parameter values. Put this in
* a prefix or suffix item.
*
* We put the name of the parameter first, then the range of possible values.
* The first number (5 for ATK or -10 for DEF in this example) must be equal to
* or less than the second number (10 for ATK or 20 for DEF in this example).
* Here are the parameter names: MHP, MMP, ATK, DEF, MAT, MDF, AGI, LUK
*
* If you want to guarantee a certain value, it is better to just use the
* database.
*
* For the plugin parameter "Bonus Parameter Text", here are the text codes:
* %1 - The + sign if the bonus is positive.
* %2 - The highest value of the random parameter bonuses applied on the item.
* Can be negative.
* ============================================================================
* Affix/Augment Requirements
* ============================================================================
* <Prefix Suffix Requirement>
* x
* </Prefix Suffix Requirement>
* Replace x with code. This is a requirement for prefix/suffix or augment item.
*
* Example:
* <Prefix Suffix Requirement>
* $gameSwitches.value(1);
* </Prefix Suffix Requirement>
* In this example, it requires that switch 1 is on.
* ============================================================================
* Affix Effects
* ============================================================================
* <Prefix Suffix Effect>
* var atkBonus = Math.floor((Math.random() * 100) + 50);
* newItem.params[2] += atkBonus;
* newItem.name += " +" + atkBonus;
* newItem.price += atkBonus;
* </Prefix Suffix Effect>
*
* Here's an example of how to add a custom effect to the new item from the
* prefix/suffix item. You'll need to know some javascript.
*
* In this example, we are applying a random ATK bonus between 50 and 150 to
* the new item and also adding that bonus to the name of the new item. In
* additon, we also add to the price the ATK bonus.
*
* Here are the variables provided to you by plugin for these effects:
* item - the prefix/suffix item the effect is taken from.
* baseItem - the baseItem.
* newItem = the new item to be created.
* ============================================================================
* Affix Chance Type For Old Notetags
* ============================================================================
* This section is for use for the <suffix: x> and <suffix: x> notetags only.
*
* <prefixSuffixChance:x>
* Replace x with the percent chance of getting that prefix or suffix.
* Example: <prefixSuffixChance:25> for a 25% chance.
*
* Every prefix/suffix with the same percentage gets added to the same percentage
* pool.
* A random number between 1 and 100 will be generated and the lowest
* percentage pool that the random number is less than or equal to will be
* chosen.
*
* For example, if the pools are 10%, 20% and 30% and the random number was 15,
* you get a prefix/suffix from the pool with percentage 20%.
*
* If you get over the highest percentage, you will get one of the
* prefixes/suffixes from the highest percentage pool. Having a combined
* percentage (total of all chances for all prefix/suffix choices for a base
* item) of 100 is recommended but not required.
*
* If none of the prefix or suffix items for the base item have a chance notetag,
* then the item will be randomly chosen as normal with each prefix or suffix
* having an equal probability.
*
* If at least one but not all of the prefix/suffix items for the base item has
* a chance notetag, then the prefix/suffixes that don't have a percent notetag
* will be assigned the default chance specified in the parameter for this
* plugin.
* ============================================================================
* Function Calls provided by this plugin
* ============================================================================
* For use in custom requirements:
*
* this.averagePartyLevel()
* Returns the average level of the party.
*
* this.averagePartyBattleMemberLevel()
* Returns the average level of party battle members.
* ============================================================================
* Terms Of Use
* ============================================================================
* Free to use and modify for commercial and noncommercial games, with credit.
* Credit Yanfly. This script uses code from their Item Core plugin.
* ============================================================================
* Credits
* ============================================================================
* DreamX
* Yanfly for Item Core plugin.
Script (Latest)
Script (v1.23d)
Script (v1.19a)
Compatibility
Set under Yanfly plugins and any other plugin that modifies items/equipping.
Last edited by a moderator: