More Enemy Drops

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

RPG Maker MV allows you to create up to three item drops for an enemy. When the battle is over, the player may receive up to any of these 3 items.

When you specify drops, you use something called a “denominator” probability, which is basically you specifying the chances of the item dropping as a fraction of 1.

moreEnemyDrops2

For example, if an item had a 1/2 chance to drop, then it has a 50% chance to drop. If an item had a 1/3 chance to drop, then it has a 33.33% chance to drop.

Unfortunately, with this system, you could never have any probabilities in between.

This plugin addresses two issues:

  1. You can specify more drops
  2. You can specify probability using percentages

This should give you more flexibility when designing your enemies.
Want more freedom when it comes to enemy drops? Give this plugin a try!

Download

Plugin: download here (right click, save as)

Installation

Download the plugin and place it in the “plugins” folder in your project’s “js” folder. Then open your Plugin Manager (F10), double-click an empty row, and select the MoreEnemyDrops plugin. Please do not change the name.

Once it is in your list of plugins, turn the plugin on.

Usage

Understanding Item Codes

Before we begin, you must first understand a concept that I call “Item Codes”. The item code is a way for you to quickly specify what kind of item you want, and the ID of the item.

If you already understand item codes you can just skip this part. Here is a quick summary:

itemCodes1

This is how item codes looks like:

a11
w23
i42

The first letter represents the item kind.

a - armor
w - weapon
i - item

The number after is the database ID. So if you write

w23

That means the enemy will drop weapon 23.

Adding More Drops to Enemies

To create enemy drops, you would use a note-tag that looks like this:

<enemy drop>
  item_code: "ID",
  amount: number,
  chance: "FORMULA"
</enemy drop>

Take note of those commas: if you have additional options, you must include a comma.

Choosing which Item to Drop

`item_code` is the code that was described above. This indicates which item will be dropped.
The simplest note-tag you can write is

<enemy drop>
  item_code: "i4"
</enemy drop>

Which will drop item 4 with 100% chance.

Setting up Drop Chance

`chance` is a formula that evaluates to a number as a percentage. So for example, you could write numbers

<enemy drop>
  item_code: "w3",
  chance: "25"
</enemy drop>

Which means there’s a 25% chance to drop weapon 3.

Alternatively, you can use javascript code if you know how to write them. For example, this plugin gives you a special formula variable called `v` which gives you access to the game variables.

<enemy drop>
  item_code: "w3",
  chance: "v.value(3) * 10"
</enemy drop>

Which results in a chance equal to 10 times the value of variable 3. If variable 3 was 0, then you have no chance. If the variable was 10, then 10 times 10 equals 100, so you have 100% chance.

You can also use the formula variable “s” to give you access to switches.So for example,

<enemy drop>
  item_code: "a5",
  chance: "s.value(2) === false ? 0 : 100"
</enemy drop>

Which means if switch 2 is OFF, it drops armor 5 with 0% chance, but if that switch is ON, then you get it 100%.

Chance is not necessary, so f you don’t specify a chance, then it is assumed to drop at 100%.

Setting up Drop Amounts

The `amount` option tells the game how much of that item should drop. For example, if you write

<enemy drop>
 item_code: "w3",
 amount: 2
 </enemy drop>

Then it will drop two of weapon 3 if you receive this drop.

If you don’t specify an amount, then the game assumes you will only get 1.

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

You may also like...

7 Responses

  1. Sundricat says:

    Would it be possible to have conditions for the item drop? For example, you only want to have Slimes drop a Dungeon Key if you either don’t have the key or the prisoner is freed.

  2. Paul says:

    Hi,
    can I use this plugin to control the random dropping out of enemies of GOLD or EXP?
    And how to be with a random amount items? For example I need to get from one enemy dropped out from 20 to 100 identical items in 100% of cases.

  3. wsensor says:

    Sorry this is long T_T

    It would be cool if you could specify drops based on skill/weapon/armor/accessory/class/herochar/element/attacktype used and such. Also a way to effect experience/gold drops too.

    IE: Hunting a monster while using the skill Hunt/Harvest/Poach would give you a chance at the item or a higher chance if it was already a drop
    IE: Using the skill Poach would give a higher chance to get items from the monster but lowers experience

    Also items could increase the chance of something.
    IE: Using a bladed weapon could give you a chance to get more meat but lower the chance to get leather from monsters.
    IE: Being a thief while wearing thief glvoes might get you more gold/items when defeating certain mobs.

    Using a fire spell on a plant monster such as a tree could be set up to give you charcoal at the end of the battle if it is in a burned state or dies to the fire attack.

    Different things like this would be cool to use.

    • Hime says:

      Those are good ideas. I will look into ways to provide drop conditions, as well as ways to change drop rates for specific drops.

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax