Enemy Drop Expansion

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
654
Reaction score
1,102
First Language
English
Primarily Uses
N/A
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)



How to Use
Paste this script above Main.

Script

Code:
#==============================================================================
# ■ Enemy Drop Expansion
# By :VIPArcher [email: VIPArcher@sina.com]
#  -- 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
 
Last edited:

Canini

Veteran
Veteran
Joined
Mar 29, 2016
Messages
1,015
Reaction score
679
First Language
Swedish
Primarily Uses
RMVXA
Pretty useful for creating a "gold slime" type of enemy. Thanks for sharing!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Just realized I have a few Steam gifts floating around. Anyone need RPG Maker MV or XP (Steam only)? Send me a message and I will send them on over!
*when you can do the Unity tutorials, but when you actually try and convert it to your own knowledge, it fails horribly*
Hi, I made a game for a competition. I need some players to help play and vote for the best game.

https://ekamu.itch.io/not4ever
don’t forget to rate the game here


Voting is open until 12 August.

Thanks.
Progresses. Tonight: refinemment, column, pitfall, bump and gutter (I'll leave doors for last, they are scary).
What is your favourite rpg maker plugin?

Forum statistics

Threads
100,573
Messages
977,363
Members
132,159
Latest member
wintyyy
Top