VictorJ - Storage Script
2 participantes
Brasil G4mes :: Scripts :: Scripts RGSS3
Página 1 de 1
VictorJ - Storage Script
VX Storage Script v1.2
por VitorJ
Introdução
"Eu criei esse script para deixar um ar mais realista ao jogo, Podendo guardar itens, e dinheiro e pega-los quando quiser
Pagando uma taxa de juros costumizavel...
O script esta em teste. Qualquer bug, Sem flame. Apenas reporte o bug. Obrigado." - VictorJ
Características
Change log
Script criado.
Adicionada a possibilidade de desativar o deposito/saque de dinheiro/item e desativar a taxa de juros.
Screenshots
Como usar
Pegue o script e cole-o a cima do main, e costumize a seu gosto. Lembre-se de mudar os icones das opções
Download
Download
Script
v1.2
Observações do Autor
Use e Abuse, Com os creditos.
por VitorJ
Introdução
"Eu criei esse script para deixar um ar mais realista ao jogo, Podendo guardar itens, e dinheiro e pega-los quando quiser
Pagando uma taxa de juros costumizavel...
O script esta em teste. Qualquer bug, Sem flame. Apenas reporte o bug. Obrigado." - VictorJ
Características
- Deixa o jogo realista
- Pode colocar icones para deixar mais bonito
Change log
- v1.0:
Script criado.
- v1.2:
Adicionada a possibilidade de desativar o deposito/saque de dinheiro/item e desativar a taxa de juros.
Screenshots
- Spoiler:
Como usar
Pegue o script e cole-o a cima do main, e costumize a seu gosto. Lembre-se de mudar os icones das opções
Download
Download
Script
v1.2
- Spoiler:
- Código:
#==============================================================================#
# Sistema de banco por VitorJ
#==============================================================================#
# Aperte CTRL+F e coloque a Tag para ir direto para a classe.
#==============================================================================#
# Classes criadas com esse Script:
# Game_Storage [GMS], Window_Storage_Gold [WSG], Window_Storage_Items [WSI]
# Window_StorageNumber [WSN], Window_Storage_Command [WSC], Scene_Storage [SS1]
# Window_Storage_Help [WSH], Window_User_Items [WUI]
#==============================================================================#
# Classes modificadas com esse Script:
# Scene_File [SNF], Scene_Title [SNT], Game_Party [GP1].
#==============================================================================#
# Comandos.
# $game_storage.change_tax(g_tax,e_tax)
# No lugar de e_tax coloque a taxa de juros para o equipamentos e
# No lugar de g_tax coloque a taxa de juros para o gold
# $game_storage.gain_item(item,qnt) para adicionar um item ao banco
# $game_storage.lose_item(item,qnt) para retirar um item do banco
# No lugar de item coloque o item a ser recebido/retirado.
# $data_weapons[id] para armas
# $data_armors[id] para armaduras
# $data_items[id] para itens
# no lugar de id coloque o ID do item
#==============================================================================#
module Sto_Edit
STORAGE = "Banco" # Nome do Banco
TAX = "Juros" # Nome do juros
ITEM_MAX = 30 # O maximo de itens de cada tipo no banco
G_MAX = 9999999 # Maximo de gold no banco
PG_MAX = 9999999 # Maximo de gold com o personagen (Não vai mudar o maximo, É só para o script saber qual é.)
T_HELP = 60 # Quanto tempo vai ficar a janela de help (em frames)
HELP_TEXT = [
"Saque efetuado com sucesso.", # Mensagen de saque de dinheiro
"Deposito efetuado com sucesso.", # Mensagen de deposito de dinheiro
"Não possui dinheiro no banco.", # Mensagen ao tentar sacar dinheiro sem ter
"Você não possui dinheiro.", # Mensagen ao tentar depositar dinheiro sem ter
"Você esta com a quantia maxima.", # Mensagen ao tentar sacar dinheiro carregando o maximo
"Seu banco esta com a quantia maxima.", # Mensagen ao tentar depoistar dinheiro com o maximo no banco
"Não possui itens no banco.", # Mensagen ao tentar pegar um item sem ter algun no banco
"Você possui itens nessa sessão.", # Mensagen ao tentar pegar um item sem ter algun na sessão(Armar,Armaduras e Itens)
"Você não possui o dinheiro do juros.", # Mensagen ao tentar pegar um item sem ter o dinheiro do juros
"Item retirado com sucesso", # Mensagen de retirada de item
"Item guardado com sucesso", # Mensagen de deposito de item
"Você não possui itens.", # Mensagen ao tentar depositar um iten sem ter algum
"Você não possui itens dessa sessão.", # Mensagen ao tentar depositar um iten sem ter algum da sessão(Armar,Armaduras e Itens)
]
#▼Qual o nome de cada opção?▼
OPT = [
"Pegar Dinheiro", # Opção de saque de dinheiro
"Guardar Dinheiro", # Opção de deposito de dinheiro
"Pegar Item", # Opção de pegar itens
"Guardar Item", # Opção de guardar itens
"Sair", # Opção de sair
]
OPT_I = [216,217,218,219,220]
# ▲Qual o numero do icone?▲(Na mesma ordem das opções)
# São nescessarios mesmo se desativar os icones nas opções
#▼Nome das opções de saque de equipamentos▼
OPT2 = ["Armas", # Opção de saque de arma
"Armaduras", # Opção de saque de armadura
"Itens", # Opção de saque de item
"Sair", # Sair
]
OPT2_I = [221,222,223,220]
# ▲Qual o numero do icone?▲(Na mesma ordem das opções)
ICO = true # Vai usar icones nas opções?
G_TAX = 10 # Taxa de juros inicial para gold em porcentagen
E_TAX = 5 # Gold cobrado por cada equipamento
#V 1.2
A_TAX = true # Sera cobrado taxa?
GOLD = true # Habilitar deposito de dinheiro?
ITEM = true # Habilitar deposito de itens?
H_FIX = "Bem vindo ao banco." # Mensagen fixa caso esteja desabilitado o deposito de dinheiro.
end
######################
# Game_Storage [GMS] #
######################
class Game_Storage
attr_reader :gold # Quantidade de Gold no Banco
attr_reader :weapons # Quantidade de armas guardadas no Banco
attr_reader :armors # Quantidade de armaduras guardadas no Banco
attr_reader :items # Quantidade dos itens guardados no Banco
attr_reader :g_tax # Juros para gold
attr_reader :e_tax # Juros para equipamentos
def initialize
@gold = 0
@g_tax = Sto_Edit::G_TAX
@g_tax = 0 if Sto_Edit::A_TAX == false
@e_tax = Sto_Edit::E_TAX
@e_tax = 0 if Sto_Edit::A_TAX == false
@weapons = {}
@armors = {}
@items = {}
end
def change_tax(g_tax,e_tax)
@g_tax = g_tax
@e_tax = e_tax
@g_tax = 0 if Sto_Edit::A_TAX == false
@e_tax = 0 if Sto_Edit::A_TAX == false
end
def gain_gold(n)
@gold = [[@gold + n, 0].max, Sto_Edit::G_MAX].min
end
def lose_gold(n)
gain_gold(-n)
end
def total_qnt
w = @weapons.size
a = @armors.size
i = @items.size
result = w+a+i
return result
end
def item_number(item)
case item
when RPG::Item
number = @items[item.id]
when RPG::Weapon
number = @weapons[item.id]
when RPG::Armor
number = @armors[item.id]
end
return number == nil ? 0 : number
end
def gain_item(item, n)
number = item_number(item)
case item
when RPG::Item
@items[item.id] = [[number + n, 0].max, 99].min
when RPG::Weapon
@weapons[item.id] = [[number + n, 0].max, 99].min
when RPG::Armor
@armors[item.id] = [[number + n, 0].max, 99].min
end
check(item)
end
def lose_item(item, n)
gain_item(item, -n)
end
def check(item)
number = item_number(item)
case item
when RPG::Item
@items.delete(item.id) if number == 0
when RPG::Weapon
@weapons.delete(item.id) if number == 0
when RPG::Armor
@armors.delete(item.id) if number == 0
end
end
end
####################
# Game_Party [GP1] #
####################
class Game_Party < Game_Unit
def get_weapons
return @weapons
end
def get_armors
return @armors
end
def get_items
return @items
end
end
####################
# Scene_File [SNF] #
####################
class Scene_File < Scene_Base
def write_save_data(file)
characters = []
for actor in $game_party.members
characters.push([actor.character_name, actor.character_index])
end
$game_system.save_count += 1
$game_system.version_id = $data_system.version_id
@last_bgm = RPG::BGM::last
@last_bgs = RPG::BGS::last
Marshal.dump(characters, file)
Marshal.dump(Graphics.frame_count, file)
Marshal.dump(@last_bgm, file)
Marshal.dump(@last_bgs, file)
Marshal.dump($game_system, file)
Marshal.dump($game_message, file)
Marshal.dump($game_switches, file)
Marshal.dump($game_variables, file)
Marshal.dump($game_self_switches, file)
Marshal.dump($game_actors, file)
Marshal.dump($game_party, file)
Marshal.dump($game_troop, file)
Marshal.dump($game_map, file)
Marshal.dump($game_player, file)
Marshal.dump($game_storage, file)
end
def read_save_data(file)
characters = Marshal.load(file)
Graphics.frame_count = Marshal.load(file)
@last_bgm = Marshal.load(file)
@last_bgs = Marshal.load(file)
$game_system = Marshal.load(file)
$game_message = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
$game_self_switches = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)
$game_storage = Marshal.load(file)
if $game_system.version_id != $data_system.version_id
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end
end
end
#####################
# Scene_Title [SNT] #
#####################
class Scene_Title < Scene_Base
def create_game_objects
$game_temp = Game_Temp.new
$game_message = Game_Message.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
$game_storage = Game_Storage.new
end
end
#############################
# Window_Storage_Gold [WSG] #
#############################
class Window_Storage_Gold < Window_Base
def initialize
super(0, 9, 544, 24+32)
refresh
end
def refresh
self.contents.clear
gold = $game_storage.gold
gold_text = "#{Vocab::gold} no #{Sto_Edit::STORAGE}: #{gold}"
gold_text = Sto_Edit::H_FIX if Sto_Edit::GOLD == false
self.contents.draw_text(0, 0, 544, 24, gold_text,0)
gold = $game_party.gold
gold_text = "#{Vocab::gold} Carregado: #{gold}"
self.contents.draw_text(-64, 0, 544, 24, gold_text,2) if Sto_Edit::GOLD == true
end
end
##############################
# Window_Storage_Items [WSI] #
##############################
class Window_Storage_Items < Window_Selectable
attr_reader :ind_item
def initialize(type)
column_max = 1
super(0, 24+32+9, 544-(196+32), 13 * 24 + 32, 32)
@height = height
@sto = $game_storage
@type = type
case type
when 0
max = @sto.weapons.size
when 1
max = @sto.armors.size
when 2
max = @sto.items.size
end
@ind_item = []
@item_max = max
@column_max = column_max
self.contents.dispose
self.contents = Bitmap.new(width - 32, [height - 32, @item_max * 24].max)
refresh
self.index = 0
end
def reinitialize
height = @height
case @type
when 0
max = @sto.weapons.size
when 1
max = @sto.armors.size
when 2
max = @sto.items.size
end
@item_max = max
self.contents.clear
self.contents = Bitmap.new(width - 32, [height - 32, @item_max * 24].max)
@ind_item.clear
refresh
end
def refresh
case @type
when 0
draw_weapons
when 1
draw_armors
when 2
draw_items
end
end
def draw_weapons
@data = []
for item in @sto.weapons
if @sto.item_number($data_weapons[item[0]]) > 0
if item != nil
i += 1 if i != nil
i = 0 if i == nil
rect = item_rect(0)
add_y = i*24
rect.y += add_y
item = $data_weapons[item[0]]
@ind_item[i] = item
self.contents.clear_rect(rect)
number = @sto.item_number(item)
rect.width -= 4
draw_item_name(item, rect.x, rect.y)
self.contents.draw_text(rect, sprintf(":%2d", number), 2)
end
end
end
end
def draw_armors
@data = []
for item in @sto.armors
if @sto.item_number($data_armors[item[0]]) > 0
if item != nil
i += 1 if i != nil
i = 0 if i == nil
rect = item_rect(0)
add_y = i*24
rect.y += add_y
item = $data_armors[item[0]]
@ind_item[i] = item
self.contents.clear_rect(rect)
number = @sto.item_number(item)
rect.width -= 4
draw_item_name(item, rect.x, rect.y)
self.contents.draw_text(rect, sprintf(":%2d", number), 2)
end
end
end
end
def draw_items
@data = []
for item in @sto.items
if @sto.item_number($data_items[item[0]]) > 0
if item != nil
i += 1 if i != nil
i = 0 if i == nil
rect = item_rect(0)
add_y = i*24
rect.y += add_y
item = $data_items[item[0]]
@ind_item[i] = item
self.contents.clear_rect(rect)
number = @sto.item_number(item)
rect.width -= 4
draw_item_name(item, rect.x, rect.y)
self.contents.draw_text(rect, sprintf(":%2d", number), 2)
end
end
end
end
end
###########################
# Window_User_Items [WUI] #
###########################
class Window_User_Items < Window_Selectable
attr_reader :ind_item
def initialize(type)
column_max = 1
super(0, 24+32+9, 544-(196+32), 13 * 24 + 32, 32)
@height = height
@sto = $game_party
@type = type
case type
when 0
max = @sto.get_weapons.size
when 1
max = @sto.get_armors.size
when 2
max = @sto.get_items.size
end
@ind_item = []
@item_max = max
@column_max = column_max
self.contents.dispose
self.contents = Bitmap.new(width - 32, [height - 32, @item_max * 24].max)
refresh
self.index = 0
end
def reinitialize
height = @height
case @type
when 0
max = @sto.get_weapons.size
when 1
max = @sto.get_armors.size
when 2
max = @sto.get_items.size
end
@item_max = max
self.contents.clear
self.contents = Bitmap.new(width - 32, [height - 32, @item_max * 24].max)
@ind_item.clear
refresh
end
def refresh
case @type
when 0
draw_weapons
when 1
draw_armors
when 2
draw_items
end
end
def draw_weapons
@data = []
for item in @sto.get_weapons
if @sto.item_number($data_weapons[item[0]]) > 0
if item != nil
i += 1 if i != nil
i = 0 if i == nil
rect = item_rect(0)
add_y = i*24
rect.y += add_y
item = $data_weapons[item[0]]
@ind_item[i] = item
self.contents.clear_rect(rect)
number = @sto.item_number(item)
rect.width -= 4
draw_item_name(item, rect.x, rect.y)
self.contents.draw_text(rect, sprintf(":%2d", number), 2)
end
end
end
end
def draw_armors
@data = []
for item in @sto.get_armors
if @sto.item_number($data_armors[item[0]]) > 0
if item != nil
i += 1 if i != nil
i = 0 if i == nil
rect = item_rect(0)
add_y = i*24
rect.y += add_y
item = $data_armors[item[0]]
@ind_item[i] = item
self.contents.clear_rect(rect)
number = @sto.item_number(item)
rect.width -= 4
draw_item_name(item, rect.x, rect.y)
self.contents.draw_text(rect, sprintf(":%2d", number), 2)
end
end
end
end
def draw_items
@data = []
for item in @sto.get_items
if @sto.item_number($data_items[item[0]]) > 0
if item != nil
i += 1 if i != nil
i = 0 if i == nil
rect = item_rect(0)
add_y = i*24
rect.y += add_y
item = $data_items[item[0]]
@ind_item[i] = item
self.contents.clear_rect(rect)
number = @sto.item_number(item)
rect.width -= 4
draw_item_name(item, rect.x, rect.y)
self.contents.draw_text(rect, sprintf(":%2d", number), 2)
end
end
end
end
end
################################
# Window_Storage_Command [WSC] #
################################
class Window_Storage_Command < Window_Selectable
attr_reader :commands # Comandos
def initialize(width, commands,type=0, column_max = 1, row_max = 0, spacing = 32)
if row_max == 0
row_max = (commands.size + column_max - 1) / column_max
end
super(0, 0, width, row_max * 24 + 32, spacing)
@commands = commands
@item_max = commands.size
@column_max = column_max
@type = type
refresh
self.index = 0
end
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
def draw_item(index)
rect = item_rect(index,1)
rect.x += 4
if Sto_Edit::ICO
ic = Sto_Edit::OPT_I
if Sto_Edit::GOLD == false
ic = [Sto_Edit::OPT_I[2],Sto_Edit::OPT_I[3],Sto_Edit::OPT_I[4]]
end
if Sto_Edit::ITEM == false
ic = [Sto_Edit::OPT_I[0],Sto_Edit::OPT_I[1],Sto_Edit::OPT_I[4]]
end
ic = Sto_Edit::OPT2_I if @type == 1
draw_icon(ic[index], rect.x, rect.y)
rect.x += 24
end
rect.width -= 8
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
self.contents.font.color.alpha = 255
self.contents.draw_text(rect, @commands[index])
end
def item_rect(index,type=0)
if @type == 0
rect = Rect.new(0, 0, 0, 0)
spacing = @spacing
rect.width = (contents.width + @spacing) / @column_max - spacing
rect.height = 24
rect.x = index % @column_max * (rect.width + spacing)
rect.y = index / @column_max * 24
return rect
elsif @type == 1
rect = Rect.new(0, 0, 0, 0)
spacing = 0
spacing = -16 if type == 0
rect.width = (contents.width + @spacing) / @column_max + spacing
rect.height = 24
spacing = 5
spacing = -10 if type == 0
rect.x = index % @column_max * (rect.width - spacing)
rect.y = index / @column_max * 24
return rect
end
end
end
##############################
# Window_StorageNumber [WSN] #
##############################
class Window_StorageNumber < Window_Base
def initialize(x, y)
@h = (3*24)+32
@h = (3*24)+16 if Sto_Edit::A_TAX == false
super(x, y, 416, @h)
@item = nil
@max = 0
@price = 0
@number = 0
end
def set(item, max,trans)
@item = item
@max = max
@price = $game_storage.g_tax
@price = $game_storage.e_tax if item != "gold"
@number = 0
@trans = trans
refresh
end
def number
return @number
end
def refresh
y = 0
x = 0
self.contents.clear
draw_item_name(@item, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x, y+24, 20, 24, "×")
self.contents.draw_text(x+24, y+24, 3*24, 24, @number, 2)
self.cursor_rect.set(x+24, y+24, (3*24)+6, 24)
self.contents.draw_text(x, y+(2*24), 128, 24, Sto_Edit::TAX) if Sto_Edit::A_TAX == true
draw_currency_value(@price * @number, 4, y + (2*24), 264) if @item != "gold" if Sto_Edit::A_TAX == true
tax = @number * @price / 100 if Sto_Edit::A_TAX == true
draw_currency_value(tax, 4, y + (2*24), 264) if @item == "gold" if Sto_Edit::A_TAX == true
end
def draw_item_name(item, x, y, enabled = true)
if item != nil and item != "gold"
draw_icon(item.icon_index, x, y, enabled)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(x + 24, y, 172, 24, item.name)
elsif item == "gold"
draw_icon(Sto_Edit::OPT_I[0], x, y, enabled) if @trans == 0
draw_icon(Sto_Edit::OPT_I[1], x, y, enabled) if @trans == 1
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
text = Sto_Edit::OPT[0]
text = Sto_Edit::OPT[1] if @trans == 1
self.contents.draw_text(x + 24, y, 172, 24, text)
end
end
def update
super
if self.active
last_number = @number
if Input.repeat?(Input::RIGHT) and @number < @max
@number += 1
end
if Input.repeat?(Input::LEFT) and @number > 0
@number -= 1
end
if Input.repeat?(Input::UP) and @number < @max
@number = [@number + 10, @max].min
end
if Input.repeat?(Input::DOWN) and @number > 0
@number = [@number - 10, 0].max
end
if @number != last_number
Sound.play_cursor
refresh
end
end
end
end
#############################
# Window_Storage_Help [WSH] #
#############################
class Window_Storage_Help < Window_Base
def initialize
super(0, 9, 544, 24 + 32)
end
def set_text(text)
if text != @text
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, self.width - 40, 24, text, 1)
@text = text
end
end
end
#############################
# Window_Storage_Info [WSI] #
#############################
class Window_Storage_Info < Window_Base
def initialize(x,y)
super(x, y, (196+32), (2*24)+32)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = normal_color
text = "#{Sto_Edit::TAX} de #{Vocab::gold}: #{$game_storage.g_tax}%"
self.contents.draw_text(4, 0, self.width-24, 24, text)
text = "#{Sto_Edit::TAX} de #{Vocab::item}: #{$game_storage.e_tax}"
self.contents.draw_text(4, 24, self.width-24, 24, text)
end
end
#######################
# Scene_Storage [SS1] #
#######################
class Scene_Storage < Scene_Base
def start
super
create_menu_background
@gold_window = Window_Storage_Gold.new
@help_window = Window_Storage_Help.new
@help_window.visible = false
@item_window = []
@item_window2 = []
@item = ""
@t = 0
@t2 = 0
@i = 0
@dd = [0,1,2,3,4]
@dd = [nil,nil,0,1,2] if Sto_Edit::GOLD == false
@dd = [0,1,nil,nil,2] if Sto_Edit::ITEM == false
for i in 0..2
@item_window[i] = Window_Storage_Items.new(i)
@item_window[i].active = false
@item_window[i].visible = false
@item_window2[i] = Window_User_Items.new(i)
@item_window2[i].active = false
@item_window2[i].visible = false
end
w = @item_window[0]
@dummy_window = Window_Base.new(w.x,w.y,w.width,w.height)
create_commands
w = @command_window
@info_window = Window_Storage_Info.new(w.x,(w.y+w.height)+16)
@info_window.visible = false if Sto_Edit::A_TAX == false
@number_window = Window_StorageNumber.new((544/8),(416/4))
@number_window.visible = false
end
def create_commands
@opt = Sto_Edit::OPT
if Sto_Edit::GOLD == false
@opt = [Sto_Edit::OPT[2],Sto_Edit::OPT[3],Sto_Edit::OPT[4]]
end
if Sto_Edit::ITEM == false
@opt = [Sto_Edit::OPT[0],Sto_Edit::OPT[1],Sto_Edit::OPT[4]]
end
@command_window = Window_Storage_Command.new((196+32), @opt)
@command_window.x = @item_window[0].width
@command_window.y = @item_window[0].y
@command_window2 = Window_Storage_Command.new(544, Sto_Edit::OPT2,1,4)
@command_window2.y = 416/4
@command_window2.visible = false
@command_window2.active = false
@command_window2.index = -1
end
def update
@info_window.refresh
@gold_window.refresh
@i = @command_window2.index
@i = 2 if @i > 2
if @t > 0
@t -= 1
@gold_window.visible = false
@help_window.visible = true
else
@help_window.visible = false
@gold_window.visible = true
end
if @t2 > 0
@t2 -= 1
end
if @command_window.active
update_main_commands
@command_window.update
end
if @number_window.active
update_number
@number_window.update
end
if @command_window2.active
update_sub_commands
@command_window2.update
end
for i in 0..2
if @item_window[i].active
update_item_withdraw
@item_window[i].update
end
end
for i in 0..2
if @item_window2[i].active
update_item_deposit
@item_window2[i].update
end
end
for i in 0..2
@item_window[i].update
@item_window2[i].update
end
end
def update_main_commands
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
end
if Input.trigger?(Input::C)
@t2 = 5
case @command_window.index
when @dd[0]
no_gold = false
max_gold = false
no_gold = true if $game_storage.gold == 0
max_gold = true if $game_party.gold == Sto_Edit::PG_MAX
if no_gold
Sound.play_buzzer
@t = Sto_Edit::T_HELP
@help_window.set_text(Sto_Edit::HELP_TEXT[2])
elsif max_gold
Sound.play_buzzer
@t = Sto_Edit::T_HELP
@help_window.set_text(Sto_Edit::HELP_TEXT[4])
else
Sound.play_decision
@command_window.active = false
@number_window.active = true
max = (Sto_Edit::PG_MAX)-($game_party.gold)
max = $game_storage.gold if max > $game_storage.gold
@number_window.set("gold", max,0)
@number_window.visible = true
end
when @dd[1]
no_gold = false
max_gold = false
no_gold = true if $game_party.gold == 0
max_gold = true if $game_storage.gold == Sto_Edit::G_MAX
if no_gold
Sound.play_buzzer
@t = Sto_Edit::T_HELP
@help_window.set_text(Sto_Edit::HELP_TEXT[3])
elsif max_gold
Sound.play_buzzer
@t = Sto_Edit::T_HELP
@help_window.set_text(Sto_Edit::HELP_TEXT[5])
else
Sound.play_decision
@command_window.active = false
@number_window.active = true
max = (Sto_Edit::G_MAX)-($game_storage.gold)
max = $game_party.gold if max > $game_party.gold
@number_window.set("gold",max,1)
@number_window.visible = true
end
when @dd[2]
no_item = false
no_item = true if $game_storage.total_qnt == 0
if no_item
Sound.play_buzzer
@t = Sto_Edit::T_HELP
@help_window.set_text(Sto_Edit::HELP_TEXT[6])
else
Sound.play_decision
@command_window2.visible = true
@command_window2.active = true
@command_window2.index = 0
end
when @dd[3]
no_item = false
qnt = ($game_party.get_weapons.size)+($game_party.get_items.size)+($game_party.get_armors.size)
no_item = true if qnt == 0
if no_item
Sound.play_buzzer
@t = Sto_Edit::T_HELP
@help_window.set_text(Sto_Edit::HELP_TEXT[11])
else
Sound.play_decision
@command_window2.visible = true
@command_window2.active = true
@command_window2.index = 0
end
when @dd[4]
$scene = Scene_Map.new
end
end
end
def update_number
if Input.trigger?(Input::B)
Sound.play_cancel
@t2 = 5
if (@command_window.index == @dd[0] or @command_window.index == @dd[1])
@number_window.visible = false
@number_window.active = false
@command_window.active = true
end
if (@command_window.index == @dd[2] or @command_window.index == @dd[3])
@number_window.visible = false
@number_window.active = false
@item_window[@i].active = true if @command_window.index == @dd[2]
@item_window2[@i].active = true if @command_window.index == @dd[3]
end
end
if Input.trigger?(Input::C) and @t2 == 0
numb = @number_window.number
if (@command_window.index == @dd[0] or @command_window.index == @dd[1])
Sound.play_decision
case @command_window.index
when @dd[0]
tax = numb * $game_storage.g_tax / 100
change_gold(numb-tax,numb,0,1) if numb > 0
when 1
tax = numb * $game_storage.g_tax / 100
change_gold(numb,numb-tax,1,0) if numb > 0
end
if numb == 0
Sound.play_buzzer
@t2 = 5
end
@number_window.visible = false
@number_window.active = false
@command_window.active = true
else
case @command_window.index
when @dd[2]
tax = numb * $game_storage.e_tax
if numb > 0 and $game_party.gold >= tax
Sound.play_decision
change_item(@item,numb,0)
$game_party.lose_gold(tax)
@number_window.visible = false
@number_window.active = false
@t2 = 5
@item_window2[@i].reinitialize
@item_window2[@i].update
@item_window[@i].reinitialize
@item_window[@i].active = true
elsif $game_party.gold < tax
Sound.play_buzzer
@t = Sto_Edit::T_HELP
@help_window.set_text(Sto_Edit::HELP_TEXT[8])
elsif numb == 0
Sound.play_buzzer
@number_window.visible = false
@number_window.active = false
@t2 = 5
@item_window[@i].active = true if @i < 3
end
when @dd[3]
tax = numb * $game_storage.e_tax
if numb > 0 and $game_party.gold >= tax
Sound.play_decision
change_item(@item,numb,1)
$game_party.lose_gold(tax)
@number_window.visible = false
@number_window.active = false
@t2 = 5
@item_window2[@i].reinitialize
@item_window[@i].reinitialize
@item_window[@i].update
@item_window2[@i].active = true
elsif $game_party.gold < tax
Sound.play_buzzer
@t = Sto_Edit::T_HELP
@help_window.set_text(Sto_Edit::HELP_TEXT[8])
elsif numb == 0
Sound.play_buzzer
@number_window.visible = false
@number_window.active = false
@t2 = 5
@item_window2[@i].active = true
end
end
end
end
end
def change_item(valor1,valor2,valor3)
@t = Sto_Edit::T_HELP
if valor3 == 0
$game_party.gain_item(valor1,valor2)
$game_storage.lose_item(valor1,valor2)
@help_window.set_text(Sto_Edit::HELP_TEXT[9])
elsif valor3 == 1
$game_party.lose_item(valor1,valor2)
$game_storage.gain_item(valor1,valor2)
@help_window.set_text(Sto_Edit::HELP_TEXT[10])
end
end
def change_gold(valor1,valor2,valor3,valor4)
$game_party.gain_gold(valor1) if valor3 == 0
$game_party.lose_gold(valor1) if valor3 == 1
$game_storage.gain_gold(valor2) if valor4 == 0
$game_storage.lose_gold(valor2) if valor4 == 1
@t = Sto_Edit::T_HELP
case valor3
when 0
@help_window.set_text(Sto_Edit::HELP_TEXT[0])
when 1
@help_window.set_text(Sto_Edit::HELP_TEXT[1])
end
end
def update_sub_commands
@command_window.active = false
case @command_window.index
when @dd[2]
case @command_window2.index
when 0
@dummy_window.visible = false
@item_window[0].visible = true
@item_window[1].visible = false
@item_window[2].visible = false
when 1
@dummy_window.visible = false
@item_window[0].visible = false
@item_window[1].visible = true
@item_window[2].visible = false
when 2
@dummy_window.visible = false
@item_window[0].visible = false
@item_window[1].visible = false
@item_window[2].visible = true
when 3
@dummy_window.visible = true
@item_window[0].visible = false
@item_window[1].visible = false
@item_window[2].visible = false
end
if Input.trigger?(Input::B)
Sound.play_cancel
@dummy_window.visible = true
@item_window[0].visible = false
@item_window[1].visible = false
@item_window[2].visible = false
@command_window2.visible = false
@command_window2.active = false
@command_window.active = true
end
when @dd[3]
case @command_window2.index
when 0
@dummy_window.visible = false
@item_window2[0].visible = true
@item_window2[1].visible = false
@item_window2[2].visible = false
when 1
@dummy_window.visible = false
@item_window2[0].visible = false
@item_window2[1].visible = true
@item_window2[2].visible = false
when 2
@dummy_window.visible = false
@item_window2[0].visible = false
@item_window2[1].visible = false
@item_window2[2].visible = true
when 3
@dummy_window.visible = true
@item_window2[0].visible = false
@item_window2[1].visible = false
@item_window2[2].visible = false
end
if Input.trigger?(Input::B)
Sound.play_cancel
@dummy_window.visible = true
@item_window2[0].visible = false
@item_window2[1].visible = false
@item_window2[2].visible = false
@command_window2.visible = false
@command_window2.active = false
@command_window.active = true
end
end
if Input.trigger?(Input::C) and @t2 == 0
@t2 = 5
case @command_window.index
when @dd[2]
case @command_window2.index
when 0
no_item = false
no_item = true if $game_storage.weapons.size == 0
if no_item
Sound.play_buzzer
@t = Sto_Edit::T_HELP
@help_window.set_text(Sto_Edit::HELP_TEXT[7])
else
Sound.play_decision
@command_window2.visible = false
@command_window2.active = false
@item_window[@i].active = true
end
when 1
no_item = false
no_item = true if $game_storage.armors.size == 0
if no_item
Sound.play_buzzer
@t = Sto_Edit::T_HELP
@help_window.set_text(Sto_Edit::HELP_TEXT[7])
else
Sound.play_decision
@command_window2.visible = false
@command_window2.active = false
@item_window[@i].active = true
end
when 2
no_item = false
no_item = true if $game_storage.items.size == 0
if no_item
Sound.play_buzzer
@t = Sto_Edit::T_HELP
@help_window.set_text(Sto_Edit::HELP_TEXT[7])
else
Sound.play_decision
@command_window2.visible = false
@command_window2.active = false
@item_window[@i].active = true
end
when 3
Sound.play_decision
@dummy_window.visible = true
@item_window[0].visible = false
@item_window[1].visible = false
@item_window[2].visible = false
@command_window2.visible = false
@command_window2.active = false
@command_window.active = true
end
when @dd[3]
case @command_window2.index
when 0
no_item = false
no_item = true if $game_party.get_weapons.size == 0
if no_item
Sound.play_buzzer
@t = Sto_Edit::T_HELP
@help_window.set_text(Sto_Edit::HELP_TEXT[12])
else
Sound.play_decision
@command_window2.visible = false
@command_window2.active = false
@item_window2[@i].active = true
end
when 1
no_item = false
no_item = true if $game_party.get_armors.size == 0
if no_item
Sound.play_buzzer
@t = Sto_Edit::T_HELP
@help_window.set_text(Sto_Edit::HELP_TEXT[12])
else
Sound.play_decision
@command_window2.visible = false
@command_window2.active = false
@item_window2[@i].active = true
end
when 2
no_item = false
no_item = true if $game_party.get_items.size == 0
if no_item
Sound.play_buzzer
@t = Sto_Edit::T_HELP
@help_window.set_text(Sto_Edit::HELP_TEXT[12])
else
Sound.play_decision
@command_window2.visible = false
@command_window2.active = false
@item_window2[@i].active = true
end
when 3
Sound.play_decision
@dummy_window.visible = true
@item_window2[0].visible = false
@item_window2[1].visible = false
@item_window2[2].visible = false
@command_window2.visible = false
@command_window2.active = false
@command_window.active = true
end
end
end
end
def update_item_withdraw
if Input.trigger?(Input::B) and @t2 == 0
Sound.play_cancel
@item_window[@i].index = 0
@item_window[@i].active = false
@command_window2.visible = true
@command_window2.active = true
end
if Input.trigger?(Input::C) and @t2 == 0
Sound.play_decision
if @item_window[@i].ind_item.size > 0
@item = @item_window[@i].ind_item[@item_window[@i].index]
@item_window[@i].active = false
@number_window.active = true
max = $game_storage.item_number(@item)
@number_window.set(@item,max,0)
@number_window.visible = true
else
@item_window[@i].index = 0
@item_window[@i].active = false
@command_window2.visible = true
@command_window2.active = true
end
end
end
def update_item_deposit
if Input.trigger?(Input::B) and @t2 == 0
Sound.play_cancel
@item_window2[@i].index = 0
@item_window2[@i].active = false
@command_window2.visible = true
@command_window2.active = true
end
if Input.trigger?(Input::C) and @t2 == 0
Sound.play_decision
if @item_window2[@i].ind_item.size > 0
@item = @item_window2[@i].ind_item[@item_window2[@i].index]
@item_window2[@i].active = false
@number_window.active = true
max = $game_party.item_number(@item)
@number_window.set(@item,max,0)
@number_window.visible = true
else
@item_window2[@i].index = 0
@item_window2[@i].active = false
@command_window2.visible = true
@command_window2.active = true
end
end
end
def terminate
for i in 0..2
@item_window[i].dispose
@item_window2[i].dispose
end
@info_window.dispose
@help_window.dispose
@number_window.dispose
@dummy_window.dispose
@command_window.dispose
@command_window2.dispose
@gold_window.dispose
dispose_menu_background
end
end
VitorJ, Por criar o script.
Observações do Autor
Use e Abuse, Com os creditos.
MEjoao- Membro
- Mensagens : 569
Fama : 41
Tópicos semelhantes
» Script De Montaria
» Problemas com Script
» Script de Som nas Mensagenas
» Script de Salto em Conjunto
» Script de Refiner
» Problemas com Script
» Script de Som nas Mensagenas
» Script de Salto em Conjunto
» Script de Refiner
Brasil G4mes :: Scripts :: Scripts RGSS3
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos