RPG Maker VX Ace
Drop Item Sets
Introduction
This script allows you to set up “drop item sets”.
A drop item set is simply a collection of drop items: at the end of battle,
you can potentially receive drops from a chosen set.
Drop item sets are chosen depending on whether their condition is met.
The drop item set condition can be anything related to the state of the game
when the enemy dies, such as the skill that was used to defeat the enemy, or
certain properties of the battler that defeated the enemy, or the values of
game variables or switches.
Drop item sets allow you to further control which drops are available for the
party to obtain after winning a battle.
For example, suppose an enemy drops three items: Potion, Hi-Potion, and Gold Ore.
You organize the drops into two separate groups as folows:
Group 1: Potion, Hi-Potion
Group 2: Potion, Hi-Potion, Gold Ore
You then place a condition on the second group such that it will only drop if Hime is in the active battle party. This means that group 2 drop set will not be selected if Hime is not in the battle party, and therefore Gold Ore does not drop if Hime is not in the battle party.
The Code
License Terms
Attribution 3.0 Unported - You must attribute the work in the manner specified by the author or licensor. Commerical use allowed.
Instructions
Download
Get it at Hime Works!
Installation
Place this script below Materials and above Main
Usage
Start by setting the drop items for the enemy.
Then create drop item sets. By default, there are no sets, so none of the
enemies will drop anything
To create a drop item set, use a note-tag of the format
<drop-item set> drops: 1, 2, 3 priority: 7 condition: formula </drop-item set>
The drops is a list of drop item ID’s, corresponding to each drop in the
enemy’s list of drop items. The editor provides 3 drop items, so the first
drop is numbered 1. You can repeat the same drop multiple times in the list
if you want it to be dropped multiple times.
Priority determines whether the drop set should be checked before other sets.
For example, a priority 10 set is checked before a priorty 5 set.
The condition is a ruby statement that determines whether the set will be
chosen or not. When the set is chosen, then those drops are the ones that you
can potentially receive at the end of battle.
The condition comes with 5 variables for you to use
a - the Game_Battler that defeated this enemy b - this enemy c - the Game_Action used by the battler in `a` v - game variables s - game switches
Because drops, by default, are only rewarded when the enemy has been killed,
we only need to keep track of who killed the enemy. It’s possible that an event
kills the enemy, in which case `a` would be nil, and your formula will not
work as you expect (it will return false in these cases, so no errors).
Examples
Some conditions that you might use for drop item sets
Attacker's level. Maybe drops are only available if your level > 5 a.level > 5 Killing blow skill. Maybe a drop is only available if you kill using skill 23 c.item == $data_skills[23]
Version History
See Change Log
Credits & Thanks
Tsukihime @ Hime Works
Terms & Conditions
* Free to use in commercial/non-commercial projects
* No real support. The script is provided as-is
* Will do bug fixes, but no compatibility patches
* Features may be requested but no guarantees, especially if it is non-trivial
* Credits to Tsukihime in your project
* Preserve this header
Comments (4)
Leave a Reply
You must be logged in to post a comment.
Marked
Thanks for submitting this 🙂 I added a pastebin to the article so there is some form of inline script available rather than linking off-site only. I am thinking about setting up affiliations just within the scripts section here. There are so many talented authors who have their own sites based purely on their RGSS works. I think it would be great to display affiliate links within our scripts section for our visitors to find more scripts. Let me know if you're interested.
xTsukihime
I think it would be nice to have a link to my blog.
xTsukihime
Script updated. Summary of changes:
1. you can add drops directly to drop groups
2. conditions are evaluated based on the battler/action UPON enemy death. This means if your actor had state 23 applied when the enemy was killed, but then it wore off afterwards, at the end of battle the drop evaluation would still know that the actor had state 23 at that time.
ShinGamix
Nice to see another familiar face here Tsukihime.