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
Requirements: None
Instructions:
Set up Enemy notetag.
<Get Code Here: Link>
February 25th, 2015 at 4:59 am
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.
March 22nd, 2016 at 8:12 pm
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?
March 22nd, 2016 at 8:31 pm
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.
March 23rd, 2016 at 3:59 pm
Thanks a lot for the quick reply! It’s working now.