Extra Drops
Last Updated: 2011.12.17 Download Link Github Link Enemies by default only drop three items maximum in RPG Maker VX Ace. The drop rates are also limited to rates that can only be achieved through d…
That fixed it! Thanks. BTW, it is possible for an enemy to drop more than one of a specific item for just one enemy. For example, have one slime drop 3 potions instead of 1.
Ok. Good to know. Let me know what you got.
#==============================================================================
#
# ▼ Yanfly Engine Ace - Extra Drops v1.01
# -- Last Updated: 2011.12.31
# -- Level: Normal
# -- Requires: n/a
# -- Mod to add additional drop items
#==============================================================================
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Enemy Notetags - These notetags go in the enemies notebox in the database.
# -----------------------------------------------------------------------------
# <drop Ix z: y%>
# <drop Wx z: y%>
# <drop Ax z: y%>
# Causes enemy to drop item, weapon, or armour (marked by I, W, or A) x at a
# rate of y percent. Insert multiples of this tag to increase the number of
# drops an enemy can possibly have. z = how many items to give
#
#==============================================================================
module YEA
module REGEXP
module ENEMY
DROP_PLUS = /<(?:DROP|drop)[ ]([IWA])(\d+) (\d+):[ ](\d+)([%%])>/i
end # ENEMY
end # REGEXP
end # YEA
class RPG::Enemy < RPG::BaseItem
def load_notetags_edr
@extra_drops = []
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when YEA::REGEXP::ENEMY::DROP_PLUS
case $1.upcase
when "I"; kind = 1
when "W"; kind = 2
when "A"; kind = 3
else; next
end
item = RPG::Enemy::DropItem.new
item.kind = kind
item.data_id = $2.to_i
item.drop_quantity = $3.to_i
item.drop_rate = $4.to_i * 0.01
@extra_drops.push(item)
end
} # self.note.split
#---
end
end
class RPG::Enemy::DropItem
attr_accessor :drop_quantity
end
class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# overwrite method: make_extra_drops
#--------------------------------------------------------------------------
def make_extra_drops
result = []
for drop in enemy.extra_drops
next if rand > drop.drop_rate
drop.drop_quantity.times do
result.push(item_object(drop.kind, drop.data_id))
end
end
return result
end
end # Game_Enemy
Original thread: https://forums.rpgmakerweb.com/threads/yanfly-extra-drops-issue.141582/