Conditional Drops

What does it do?
Allows enemies drop an extra item if a condition is fulfilled. (killing it with elemental attack, or having some state on death, etc)
Enemies can have multiple conditional drops and different conditions for each of them.
Enemies can also “drop” variables, increasing a variable on death if condition is fulfilled. Make condition a simple true to make it increase variable forever. Perfect for kill X monsters quests.

Author: Mr Trivel
Name: Conditional Drops
Created: 2014-10-03
Version: 1.1

Terms of Use

Requirements: None

Instructions:
Set up Enemy notetag.

<Get Code Here: Link>


4 responses to “Conditional Drops

  • Chaos_Kitsune29

    have you considered adding the ability to add multiple conditional drops to one enemy?

    so that, say you kill a slime with a fire attack it will drop slime powder, but if you kill it while it’s poisoned you get corrosive fluid.

    tried it as is, and it only acknowledges the bottommost drop tag.

    also, prioritization of conditions, so that if the player kills a poisoned slime with fire you have the option of having the slime only drop one or the other of the conditional items, dependant on how the script is configured.

  • kitewinter

    Hey!
    I dig the functionality of your script, but I’m getting the following 2 crashes during battletesting:

    “Script ‘Mr Trivel Conditional Drops’ line 131: NoMethodError occurred.
    undefined method `any?’ for nil:NilClass”
    after battles without conditional drops, and

    “Script ‘Mr Trivel Conditional Drops’ line 119: NoMethodError occurred.
    undefined method `[]’ for nil:NilClass”
    if a monster has conditional drops
    (

    in this case)
    and the battle crashes on start.

    Any idea why this might be happening?

    • Mr Trivel

      I fixed the crash if enemies don’t have conditional drops.
      As for the 2nd crash – make sure you have full notetags for conditional drop. E.g. it’ll crash if you only have c_drop but missing c_chance and c_type.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: