Auteur : Deke
Fonction : Permet de donner un objet aléatoire à la fin de combat
Image(s): Aucune
Ressource(s) : aucune
Remarque : Testé et fonctionnel.
Installation : Allez dans l'éditeur de script ( F11 ) et créez un script au dessus de "Main" , nommez le " Scene_Battle 5 " et collez ce script.
Utilisation : Aucune
Code:
#===========================================================
#class Scene_Battle 5
#----------------------------------------------------------------------------------------------------------------------
#-written by Deke
#----------------------------------------------------------------------------------------------------------------------
#
# The purpose of this class is to generate random loot drops at the end of winning battles.
#This script work independently of the item drops programed in for monsters. This script allows
#easy customization of the frequency and quality of loots by simple modifications of the configure
#method-see description below (how this script works) to see what each value does.
#
#Optional feature A-Don't drop weapons/armors/items with price 0
# This option makes it so that equipment with price 0 is excluded from being dropped by monsters
# at random. Some of the items in the database have a default price of zero and have no effect.
# They are really only for event processing purposes, they really should be dropped at random.
# This also creates an easy way to designate an weapon/armor/item as "non" droppable. Simply
# set the price of the equipment to 0. By default this option is set to true.
#
#Optional feature B- Don't drop "flagged" items
#Credit RPG Advocate for creating the elemental taggin trick
# Certain weapons/armors/ and items can be designated as unique (random monsters won't drop
# them). This option requires some addition script modification. It is only recommended if you
# want to have non droppable items that the player can sell back at a later time for profit. By default
# this option is set to off. See comments at the very end of this script for information on how
# to implement this option.
#
#Optional feature C-Debug mode
# This option is allows the game tester to see what weapons/items/armor have a potential of being
# dropped. After a victory, the list of possible weapons/items/armors is displayed. This allows the
# tester to determine if the value of the "quality percentage" should be modified. By default this
# option is off.
#
#============================================================
# HOW THIS SCRIPT WORKS
#-----------------------------------------------------------------------------------------------------------------------
# Basically this script creates sorted list of weapons, armor, and items from cheapest to most
#expensive. (Actually the list are of the equipment I.D.'s) It also creates a list of experience from
#monster from the fewest eqperience to the most experience. Then the program determines a
#percentile of difficultly" based on the experience gained versus the possible experienced gained from
#any monster.
# Next, the program generats some random numbers to determine if you the party gains any
#weapons/armors/items. If the party gains equipment the "percentile cost" of that equipment should
#roughly correlate with the percentile of difficulty. Basically, what this mean is that if you kill a monster
#that gives you more exp than 30% of the monsters and you succeed at getting equipment, the cost
#of the equipments will be higher than approximatley 30% of that equipment of that type. Of course,
#there are some random variations thrown to create variety.
# Here's a list of the variables to edit to customize loot dropping.
# @option_a and option_b: see above
# @weapon_per, @armor_per, @item_per
# the percentage change that the equipment drops after a succesful battle
# Remember that armor also includes shields and accesories, so the percentage should
# proabably be higher.
# @weapon_quality_per,@armor_quality_per,@item_quality_per
# This value determines how much variance there is loot drops.
# The lower the number, the closer the loot cost percentile correlates with the difficulty percentile.
# @two_weapon_per,@two_armor_per,@two_item_per
# the percentage change that two of that type of equipment drop.
# @loot_size
# the maximum number of loots allowable after a battle INCLUDING monster specific drops
#NOTE: If this program starts to lag- it doesn't with the standard size equipment list. You may want
# to change @weapon_set, @armor_set, and @item_set, AND @exp_set to global variables.
# Just use the find and replace feature and change @weapon_set to $weapon_set... Also change
# the statements if @weapon_set==nil to $weapon_set==[]. Finally, in the Scene_Title class
# add the following lines of code right after the begining of the main method:
# $weapon_set=[]
# $armor_set=[]
# $item_set=[]
# $exp_set=[]
#Making this change will mean that the sort funcitons only run the once in the game. Sorting functions
#have the potential to take up a lot of time if the size of the equipment arrays get larg.e
#==========================================================
class Scene_Battle
#--------------------------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------------------
#This method sets the values for such thing as dropped percentages.
def configure
@option_a=true
@option_b=false
if @option_b
@unique=20
end
@option_c=false
@weapon_prob=10
@two_weapon_prob=1
@armor_prob = 20
@two_armor_prob=2
@item_prob=12
@two_item_prob=2
@weapon_quality_per=12
@armor_quality_per=12
@item_quality_per=18
@loot_size=5
end