Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,893
First Language
English
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.

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, 3priority: 7condition: formuladrop: w1 0.6drop: a4 0.23drop: i7 1</drop-item set>The drops is a list of drop item ID's, corresponding to each drop in theenemy'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.

In addition to pulling drop items from a list, you can also manually add drops

to each group using the `drop` option. The drop option takes an object ID,

where you choose "w" for weapon, "a" for armor, and "i" for item, followed

by the database ID. The second value is the droprate, as a percentage. So

0.6 means 60%, 0.23 means 23%, and 1 means 100%

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 enemyb - this enemyc - the Game_Action used by the battler in `a`v - game variabless - game switchesBecause 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

Code:
Attacker's level.Maybe drops are only available if your level > 5   a.level > 5Killing blow skill.Maybe a drop is only available if you kill using skill 23   c.item == $data_skills[23]Attacker's stateSet requires attacker to have state 23 applied when enemy was killed   a.state?(23)Attack elementSet requires the damage to have element 5 (not including features)   c.item.damage.element_id == 5
 
Last edited by a moderator:

ShinGamix

DS Style 4Ever!
Veteran
Joined
Mar 18, 2012
Messages
3,908
Reaction score
461
First Language
April Fools
Primarily Uses
N/A
Exactly what I needed!!!
 

NecroNeko

Veteran
Veteran
Joined
Jan 10, 2013
Messages
80
Reaction score
0
First Language
german
Primarily Uses
I really like the idea behind this script. I have a question about the condition regarding the killing below. Would it be possible to check what element the skill had?

For an example: I'm fighting an enemy made of wood. If you simply kill him he drops a piece of wood and if you kill him with a fire elemental attack he drops charcoal. Is this possible, and if it is what would the code be? Thanks in advance :] I really like this script the more I think about it <3
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,893
First Language
English
Fire elemental attack can be from a lot of things: the skill's element, any features attached to the battler from things like weapons or states.

For example, checking the skill/item's damage type is element 5 would be

Code:
c.item.damage.element_id == 5
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,893
First Language
English
Script updated with the ability to manually add drop items to a group, rather than indexing it from a list of drop items.

<drop-item set> drop: w1 0.6 drop: a4 0.23 drop: i7 1</drop-item set>This will add weapon 1 with 60% drop rate, armor 4 with 23% droprate, and item 7 with 100% drop rate.You may only specify one item per `drop` option. You can have an unlimited number of options.

You can mix the `drops` and `drop` options as well.
 
Last edited by a moderator:

pinkapinkie

Veteran
Veteran
Joined
Mar 30, 2012
Messages
69
Reaction score
6
First Language
Italian
Primarily Uses
How would I set a condition that requires actor ID x to be in the party?
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,893
First Language
English
One way is to write

Code:
$game_party.members.include?($game_actors[x])
Or adding something to the scripts
Code:
class Game_Party < Game_Unit  def in_party?(actor_id)    @actors.include?(actor_id)  endend
And then you can write
Code:
$game_party.in_party?(x)
 

pinkapinkie

Veteran
Veteran
Joined
Mar 30, 2012
Messages
69
Reaction score
6
First Language
Italian
Primarily Uses
Thanks for the quick response!
 

pinkapinkie

Veteran
Veteran
Joined
Mar 30, 2012
Messages
69
Reaction score
6
First Language
Italian
Primarily Uses
What if i want only enemies tagged with item set to drop under condition? All the other should drop normally. Or do I have to set a condition for every single enemy in the database?
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,893
First Language
English
Yes, if that's how you want a particular drop to be designed.


If I start adding special rules, people will then ask for even more special rules (eg: all, EXCEPT this one).
 

XinChao

Veteran
Veteran
Joined
Jun 11, 2012
Messages
117
Reaction score
3
Primarily Uses
Got error Game Interpreter 1411 no method error occurred.

What I did put this script on the tag.

<drop-item set>

drop: i1 1

drop: w1 1

</drop-item set>

 

Another question does it drop the item the ground or it just says you received the item after defeat enemy? How do I disable the message saying you receive item... What I am asking for how I can make enemy drop item on the ground to pick up by player?
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,893
First Language
English
Where did you put that? In the enemy or in a troop or in a script call?


Also if you're using VX, this script may not support VX.
 

joeyjoejoe

Villager
Member
Joined
Dec 26, 2012
Messages
15
Reaction score
1
First Language
English
Primarily Uses
Hey, great script.

I am able to use it except for one part, line 199 and 200 give me "no marshal_dump is defined for class Sprite_Object (TypeError). Seems like Yami Engine Symphony 1.16c is messing with the game_action part of the script (specifically when you check what killed the enemy). Besides this it's great. :) Thanks so much for releasing it, makes item fetch quests a breeze.
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
212
First Language
English
Primarily Uses
Note: It's called a drop table, Hime.

Now with that out of the way lol, this is awesome, especially since you can set up conditions. Without the condition option, it would be just a ok script(I mean how many damn items must you have a enemy drop, It's not like these are MMO games afterall), but with the ability to add conditions, this is awesome Hime, great job.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,893
First Language
English
Drop table does sound better. When I wrote the script I just thought of it as different sets of drops.

Hey, great script.


I am able to use it except for one part, line 199 and 200 give me "no marshal_dump is defined for class Sprite_Object (TypeError). Seems like Yami Engine Symphony 1.16c is messing with the game_action part of the script (specifically when you check what killed the enemy). Besides this it's great. :) Thanks so much for releasing it, makes item fetch quests a breeze.
Just get rid of the marshal load and marshal dump.


I did that so that if anything about the battler changed before you checked it, you would still have access to that information.


For example if you wanted to know whether the battler had a state applied or not.


Evidently now that I think about it, this would not be necessary if drops were determined when a battler was defeated, and then during the battle-end phase it would simply retrieve the list of drops from all the corpses and present them to you.
 
Last edited by a moderator:

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
212
First Language
English
Primarily Uses
OMG I just thought of a great use for this script, it occurred to me that with some troop eventing(plus that end battle event bug fix script), this could be used to create speed challenge bonus drops, very easily infact(mad replay value mechanic there) 

Speed challenge run+Arena... Wait a second, I may have to actually use this script :) The temptation is so strong, It's not funny.
 
Last edited by a moderator:

ClockworksGod

Villager
Member
Joined
Mar 13, 2013
Messages
19
Reaction score
0
First Language
English
Primarily Uses
Ok, so I need some help understanding how to use the Variables condition...

My game has a bestiary which is filled up by using pages collected from enemies. So, you kill a bat, get the page as an item, then use the page to add the Bat entry to the bestiary. What I want this script for is to make it so enemies will only drop their bestiary page if you haven't used their page. So, so far what I've done is created one variable for each type of enemy and then make it so that when that enemy's page item is used, it switches that enemy's bestiary variable to on. I want to call that variable to determine if the page should be dropped from future kills. 
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,893
First Language
English
You would create at least two sets: one set has the page, other set does not.

Suppose variable 3 controls whether bat 3's page has been collected. If the variable is equal to 0, then it has not been collected yet. The set with the page will have the condition

Code:
condition: v[3] == 0
The set with the page will have higher priority because you want it to be checked first before checking the one without.
 

Latest Threads

Latest Profile Posts

I'm glad I'm sticking to my guns on having fighting game mechanics in my game, from what I've read, it's not for everyone. but for the most part, I've made it so you don't have to use them motion inputs for attacks if you don't want to.
And my project's just entered the Lunar New Year Sale 2022... Let's see if it reaches it's goal of $ 7,77.
Ohmygoodness I played Dicey Dungeons for the first time last night. Gave me SO MANY IDEAS for how to fix Heidi.
d757 going live today

Forum statistics

Threads
118,722
Messages
1,118,203
Members
155,865
Latest member
flawlesscozy
Top