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 link
https://raw.githubusercontent.com/ovate/VIPArcher-rggs3/main/VA_EnemyDropExpansion
Spoiler: Code 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
本贴来自国际rpgmaker官方论坛作者:ovate处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/enemy-drop-expansion.90994/