Enemy Drop Expansion

Enemy Drop Expansion 2014/11/01

Creator name: VIPArcher​

Introduction
This script allows more drops from enemies.

Instructions:
Put <drops kind ID X%> inside enemy's Note field
Which kind:
i => Item
w => Weapons
a => Armors
ID: Item number index
X: probability (example, 5 is 5%)

Example: <drops w 5 55%> is 55% of dropping a weapon id 5

Note: Remember the id of the number you're putting after kind, please don't forget to include a space between information.

Preview:
Tools > Database > Enemies on Note (lower right corner)

4pvz4-.png


How to Use
Paste this script above Main.

Script link
https://raw.githubusercontent.com/ovate/VIPArcher-rggs3/main/VA_EnemyDropExpansion

Spoiler: Code
Code:
#==============================================================================
# ■ Enemy Drop Expansion
# By :VIPArcher [email: [email hidden]]
#  -- The script comes from http://rm.66rpg.com Please keep the information above.
#  Feel free to use/ reprint
#==============================================================================
# Instructions:
#   Put <drops kind ID X%> in enemy's note field
#   Indicator: i => Item
#              w => Weapons
#              a => Armors
#          ID: Item number index
#           X: probability (example, 5 is 5%)
#   Example: <drops w 5 55%> is 55% of dropping a weapon id 5
#   Note: Remember the id of the # you're putting after kind,
#    please don't forget to include a space between information.
#==============================================================================
$VIPArcherScript ||= {};$VIPArcherScript[:expand_drop] = 20141101
#--------------------------------------------------------------------------------
class RPG::Enemy < RPG::BaseItem
  #--------------------------------------------------------------------------
  # ● Get notes of expanded drop information
  #--------------------------------------------------------------------------
  def get_extra_drop_item
    expand_drop_item = []
    self.note.split(/[\r\n]+/).each{ |line|
      if line =~ /<drops((?:\s+\w+){3})%>/
        expand_item = $1.lstrip.split(/\s+/)
        expand_drop_item.push(expand_item)
      end}
    return expand_drop_item
  end
  #--------------------------------------------------------------------------
  # ● Create examples of extended drop items
  #--------------------------------------------------------------------------
  def make_drop_item(drop_item)
    return nil if drop_item == []
    di = RPG::Enemy::DropItem.new
    di.kind = ["","i","w","a"].index(drop_item[0])
    di.data_id = drop_item[1].to_i
    di.denominator = 100 / drop_item[2].to_f
    return di
  end
  #--------------------------------------------------------------------------
  # ● Create an array of drop item information
  #--------------------------------------------------------------------------
  alias extra_drop_items drop_items
  def drop_items
    items = extra_drop_items.clone
    get_extra_drop_item.each{|item| items.push(make_drop_item(item)) if item}
    return items
  end
end

Credit and Thanks:
VIPArcher

Terms of Use- Free for commercial and non-commercial use.

License - MIT License: http://opensource.org/licenses/mit-license.php
Pretty useful for creating a "gold slime" type of enemy. Thanks for sharing!

Original thread: https://forums.rpgmakerweb.com/threads/enemy-drop-expansion.90994/