2º Script: Network
- Screenshot:
troque o seu por esse:
Aqui
-> linha 340
- Código:
send += "@conta = '#{$game_party.conta}';"
-> linha 489
- Código:
send += "@conta = '#{$game_party.conta}';"
3º Script: [GM] Game Party
- Screenshot:
troque o seu por esse:
- Código:
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# This class handles the party. It includes information on amount of gold
# and items. Refer to "$game_party" for the instance of this class.
#==============================================================================
# * Modified By: Nanzin
#------------------------------------------------------------------------------
class Game_Party
attr_accessor :items
attr_accessor :weapons
attr_accessor :armors
#--------------------------------------------------------------------------
# * Gain Items (or lose)
# item_id : item ID
# n : quantity
#--------------------------------------------------------------------------
def gain_item(item_id, n)
# Update quantity data in the hash.
if item_id > 0
@items[item_id] = [[item_number(item_id) + n, 0].max, 9999].min
end
$item_w.refresh if $item_w.visible
#$janela_gold_w.refresh if $item_w.visible
salvar
end
#--------------------------------------------------------------------------
# ● Lose Items
# item_id : item ID
# n : quantity
#--------------------------------------------------------------------------
def lose_item(item_id, n)
# 调用 gain_item 的数值逆转
gain_item(item_id, -n)
if $item_w != nil
$item_w.refresh if $item_w.visible
#$janela_gold_w.refresh if $item_w.visible
end
salvar
end
#--------------------------------------------------------------------------
# * Gain Weapons (or lose)
# weapon_id : weapon ID
# n : quantity
#--------------------------------------------------------------------------
def gain_weapon(weapon_id, n)
# Update quantity data in the hash.
if weapon_id > 0
@weapons[weapon_id] = [[weapon_number(weapon_id) + n, 0].max, 999999].min
end
$item_w.refresh if $item_w.visible
#$janela_gold_w.refresh if $item_w.visible
salvar
end
#--------------------------------------------------------------------------
# * Gain Armor (or lose)
# armor_id : armor ID
# n : quantity
#--------------------------------------------------------------------------
def gain_armor(armor_id, n)
# Update quantity data in the hash.
if armor_id > 0
@armors[armor_id] = [[armor_number(armor_id) + n, 0].max, 9999999999].min
end
$item_w.refresh if $item_w.visible
#$janela_gold_w.refresh if $item_w.visible
salvar
end
#--------------------------------------------------------------------------
# * Gain Gold (or lose)
# n : amount of gold
#--------------------------------------------------------------------------
def gain_gold(n)
@gold = [[@gold + n, 0].max, 9999].min
Network::Main.send_gold
$game_party.gain_item(Item_Ouro::Item_Id.to_i,n)
$item_w.refresh if $item_w.visible
$janela_gold_w.refresh if $item_w.visible
salvar
end
def guarda_conta(n)
@conta = [[@conta + n,0].max, 999999].min
Network::Main.send_conta
salvar
end
#--------------------------------------------------------------------------
# * Lose Gold
# n : amount of gold
#--------------------------------------------------------------------------
def lose_gold(n)
# Reverse the numerical value and call it gain_gold
gain_gold(-n)
Network::Main.send_gold
$game_party.lose_item(Item_Ouro::Item_Id.to_i,n)
$item_w.refresh if $item_w.visible
$janela_gold_w.refresh if $item_w.visible
salvar
end
def retira_conta(n)
guarda_conta(-n)
Network::Main.send_conta
salvar
end
end
-> linha 83
- Código:
def guarda_conta(n)
@conta = [[@conta + n,0].max, 999999].min
Network::Main.send_conta
salvar
end
-> linha 103
- Código:
def retira_conta(n)
guarda_conta(-n)
Network::Main.send_conta
salvar
end
Part 3 (Final)
Última edição por Nanzin em Seg Nov 28, 2011 11:13 pm, editado 1 vez(es)