1 EXP e Gold aleatórios Sáb 24 Nov 2012, 20:19
Halt
Administrador
[autor: Luca]
Ola galera, eu fis esse script fas um tempo pro meu jogo off, mas estou usando ele no netplay 2.0 na duvida desidi botar ele aqui.
Ele fas com que os mobs derem uma experiencia e ouro random.
Botar o scritp em sima de Main.
Tutorial no script! so os fortes entenderam meu protugues!
Ola galera, eu fis esse script fas um tempo pro meu jogo off, mas estou usando ele no netplay 2.0 na duvida desidi botar ele aqui.
Ele fas com que os mobs derem uma experiencia e ouro random.
Botar o scritp em sima de Main.
Tutorial no script! so os fortes entenderam meu protugues!
- Código:
#===============================================================================
# Creado por: Luca
# Para: RPG Maker XP
# Nome do Script: System Rand Exp Gold
# V: 1.0
#===============================================================================
#===============================================================================
# Instruçoes: Pegar sobre o script "Main".
#===============================================================================
#===============================================================================
# Modulo "SysRan_ExpGol"
#===============================================================================
module SysRan_ExpGol
#-------------------------------------------------------------------------------
# * Exp por default que dara o enemigo se for menor a 1.
#-------------------------------------------------------------------------------
EXP_DEFAULT = 1
#-------------------------------------------------------------------------------
# * Ouro que dara o enemigo se for menor a 1.
#-------------------------------------------------------------------------------
GOLD_DEFAULT = 1
#-------------------------------------------------------------------------------
# * Exp default.
#
# A = Valor negativo que é subtraído.
# B = Valor positivo que é somado.
#
# ENEMY_EXP_RAND_DEFAULT = [A, B]
#
# Nota: Si o mob da 20 exp e se o valor por default e:
# "[-5, 5]", el restara um aleatorio desde -5 ate 0 e somara um
# aleatorio desde 5 ate 0.
#-------------------------------------------------------------------------------
ENEMY_EXP_RAND_DEFAULT = [-5, 5]
#-------------------------------------------------------------------------------
# * Ouro default.
#
# A = Valor negativo que é subtraído.
# B = Valor positivo que é somado.
#
# ENEMY_GOLD_RAND_DEFAULT = [A, B]
#
# Nota: O mesmo que com a exp.
#-------------------------------------------------------------------------------
ENEMY_GOLD_RAND_DEFAULT = [-5, 5]
#-------------------------------------------------------------------------------
# * Exp que dara um enemigo especifico.
#
# A = Id do enemigo.
# A = Valor negativo que é subtraído.
# B = Valor positivo que é somado.
#
# ENEMY_RAND_EXP = {A => [B, C]}
#
# Nota: O mesmo de antes.
#-------------------------------------------------------------------------------
ENEMY_RAND_EXP = {
1 => [-5, 5]
}
#-------------------------------------------------------------------------------
# * Ouro que dara um enemigo espesifico.
#
# A = Id do enemigo.
# A = Valor negativo que é subtraído.
# B = Valor positivo que é somado.
#
# ENEMY_RAND_GOLD = {A => [B, C]}
#
# Nota: O mesmo que os anteriores.
#-------------------------------------------------------------------------------
ENEMY_RAND_GOLD = {
1 => [-5, 5]
}
end
#===============================================================================
# Clase "Scene_Battle"
#===============================================================================
class Scene_Battle
def start_phase5
@phase = 5
$game_system.me_play($game_system.battle_end_me)
$game_system.bgm_play($game_temp.map_bgm)
exp = 0
gold = 0
treasures = []
for enemy in $game_troop.enemies
unless enemy.hidden
if SysRan_ExpGol::ENEMY_RAND_EXP.include?(enemy.id)
exp_rand = SysRan_ExpGol::ENEMY_RAND_EXP[enemy.id]
else
exp_rand = SysRan_ExpGol::ENEMY_RAND_EXP_DEFAULT
end
if SysRan_ExpGol::ENEMY_RAND_GOLD.include?(enemy.id)
gold_rand = SysRan_ExpGol::ENEMY_RAND_GOLD[enemy.id]
else
gold_rand = SysRan_ExpGol::ENEMY_RAND_GOLD_DEFAULT
end
exp2 = rand(exp_rand[0].abs)
exp3 = rand(exp_rand[1])
exp += (enemy.exp - exp2) + exp3
exp = SysRan_ExpGol::EXP_DEFAULT if exp < 1
gold2 = rand(gold_rand[0].abs)
gold3 = rand(gold_rand[1])
gold += (enemy.gold - gold2) + gold3
gold = SysRan_ExpGol::GOLD_DEFAULT if gold < 1
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
treasures = treasures[0..5]
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
end