06-04-2005, 01:00 PM
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.
No support is given. If you are the owner of the thread, please contact administration.
read the comment in the class Extra_drop. ;)
First, go to Scene_Battle 2
and replace your def start_phase5, with this one
Code:
def start_phase5
# フェーズ 5 �移行
@phase = 5
# �トル終� ME を演�
$game_system.me_play($game_system.battle_end_me)
# �トル開始�� BGM �戻�
$game_system.bgm_play($game_temp.map_bgm)
# EXP�ゴールド�トレジャーを�期化
exp = 0
gold = 0
treasures = []
# ループ
for enemy in $game_troop.enemies
# エãƒ?ミーã?Œéš� ã‚Œç� ¶æ…‹ã?§ã?ªã?„å� ´å?ˆ
unless enemy.hidden
# ç?²å¾— EXPã€?ゴールドを追å� �
exp += enemy.exp
gold += enemy.gold
#EDIT
item_get = $game_system.enemy_drops[enemy.id][0][0]
prob = $game_system.enemy_drops[enemy.id][0][1]
item_get1 = $game_system.enemy_drops[enemy.id][1][0]
prob1 = $game_system.enemy_drops[enemy.id][1][1]
item_get2 = $game_system.enemy_drops[enemy.id][2][0]
prob2 = $game_system.enemy_drops[enemy.id][2][1]
if rand(100) < prob
treasures.push($data_items[item_get])
end
if rand(100) < prob1
treasures.push($data_weapons[item_get1])
end
if rand(100) < prob2
treasures.push($data_armors[item_get2])
end
#EDIT
# トレジャー出�判定
=begin
if rand(100) < enemy.treasure_prob
if enemy.item_id > 0
treasures.push($data_items[enemy.item_id])
end
if enemy.weapon_id > 0
treasures.push($data_weapons[enemy.weapon_id])
end
if enemy.armor_id > 0
treasures.push($data_armors[enemy.armor_id])
end
end
=end
end
end
# トレジャー�数を 6 個����定
treasures = treasures[0..5]
# EXP �得
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if actor.cant_get_exp? == false
last_level = actor.level
actor.exp += exp
if actor.level > last_level
@status_window.level_up(i)
end
end
end
# ゴールド�得
$game_party.gain_gold(gold)
# トレジャー�得
for item in treasures
case item
when RPG::Item
$game_party.gain_item(item.id, 1)
when RPG::Weapon
$game_party.gain_weapon(item.id, 1)
when RPG::Armor
$game_party.gain_armor(item.id, 1)
end
end
# �トルリザルトウィンドウを作�
@result_window = Window_BattleResult.new(exp, gold, treasures)
# ウェイトカウントをè¨å®š
@phase5_wait_count = 100
end
then make a new script above the main, and put this in it
Code:
class Game_System
attr_accessor :enemy_drops
alias item_int initialize
def initialize
item_int
@enemy_drops = []
@enemy_drops.fill([], 1..$data_enemies.size)
end
end
class Extra_Drops
#written by rpgmaker
#Monster drop three items, based on drop percent
#Instruction
#item_id:drop percent, weapon_id:drop percent, armor_id:drop percent
#ex
#{1:10,2:10,3:10
#the first will give it first item in the database, with 10 percent probability
#add them after name of the monster in the monster database section
def get_item_ids
@gain_extra_id = []
@probability = []
for i in 1...$data_enemies.size
enemy = $data_enemies[i]
@name = $data_enemies[i].name
get_id = @name.index("{")
string = @name.slice!(get_id + 1, @name.size - 1)
@name.slice!("{")
new_str = string.split(',')
for k in 0...new_str.size
str = new_str[k].split(':')
@gain_extra_id.push(str[0])
@probability.push(str[1])
$game_system.enemy_drops[i].push([(str[0]).to_i,(str[1]).to_i])
end
end
end
end
extra_drop.zip (Size: 208.58 KB / Downloads: 1)
READ THIS
Code:
#Monster drop three items, based on drop percent
#Instruction
#item_id:drop percent, weapon_id:drop percent, armor_id:drop percent
#{1:10,2:10,3:10
#ex
#Ghost{1:10,2:10,3:10
#the first will give it first item in the database, with 10 percent probability
#add them after name of the monster in the monster database section
#note, you don't need to use the original drop item any more ,it is unless. But #remember to add something like that to ever monster name {1:10,2:10,3:10
#else you will get error. i will post an update soon, so that you will not require to #do it for every one