Tenta agora,caso de erro me avise.
- Spoiler:
- Código:
# Declaraçao da Classe/Janela da Loja
class Loja_Cash < Window_Base
def initialize
super(50,50,280,200)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 200
self.z = 99999
@dragable = true
@closable = true
# Comprar Poção Sagrada
pocao_sagrada_compra1 = Button.new(self,195,73,"Comprar"){pocao_sagrada_compra}
# Info Poção Sagrada
pocao_sagrada_info1 = Button.new(self,160,73,"Info"){pocao_sagrada_info}
# Comprar Set Celestial
set_celestial_compra1 = Button.new(self,195,103,"Comprar"){set_celestial_compra}
# Info Set Celestial
set_celestial_info2 = Button.new(self,160,103,"Info"){set_celestial_info}
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(85,0,132,32,"Loja Cash")
self.contents.draw_text(0,145,132,32,"¢ " + $game_variables[12].to_s)
self.contents.draw_text(30,50,132,32,"Poção Sagrada")
self.contents.draw_text(30,80,132,32,"Set Celestial")
# Ícone da Poção Sagrada
poçao = RPG::Cache.icon("pocao")
poçao_rect = Rect.new(0,0,poçao.width,poçao.height)
self.contents.blt(-2,50,poçao,poçao_rect)
# Ícone Set Celestial
poçao = RPG::Cache.icon("Armor - Golden")
poçao_rect = Rect.new(0,0,poçao.width,poçao.height)
self.contents.blt(0,80,poçao,poçao_rect)
end
# Comprar Poção Sagrada
def pocao_sagrada_compra
if $game_variables[12] >= 50
$game_party.gain_item(003, 10)
$game_variables[12] -= 50
self.refresh
$game_temp.chat_log.push("Você comprou 10 Poções Sagradas")
else
$game_temp.chat_log.push("Você não tem cash suficiente!")
end
end
# Info Poção Sagrada
def pocao_sagrada_info
$info_pocao_sagrada.visible = true
$info_pocao_sagrada.active = true
end
# Comprar Set Celestial
def set_celestial_compra
if $game_variables[12] >= 240
$game_party.gain_armor(004, 1)
$game_party.gain_armor(016, 1)
$game_variables[12] -= 240
self.refresh
$game_temp.chat_log.push("Você comprou Set Celestial")
else
$game_temp.chat_log.push("Você não tem cash suficiente!")
end
end
# Info Set Celestial
def set_celestial_info
$info_sc.visible = true
$info_sc.active = true
end
end
#-----------------------------------------------------------------
# Janela: Poção Sagrada
#-----------------------------------------------------------------
class Info_Pocao_Sagrada < Window_Base
def initialize
super(330,50,250,135)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 200
self.z = 99999
@dragable = true
@closable = true
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(0, 0, 132, 32, "Nome:")
self.contents.draw_text(100, 0, 132, 32, "Poção Sagrada")
self.contents.draw_text(0, 20, 132, 32, "Função:")
self.contents.draw_text(100, 20, 132, 32, "Rec. todo o Hp")
self.contents.draw_text(0, 40, 132, 32, "Classe:")
self.contents.draw_text(100, 40, 132, 32, "Todos")
self.contents.draw_text(0, 60, 132, 32, "Quantidade:")
self.contents.draw_text(100, 60, 132, 32, "10")
self.contents.draw_text(0, 80, 132, 32, "Preço:")
self.contents.draw_text(100, 80, 132, 32, "¢50")
end
end
#-----------------------------------------------------------------
# Janela: Set Celestial
#-----------------------------------------------------------------
class Info_Set_Celestial < Window_Base
def initialize
super(330,50,250,135)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 200
self.z = 99999
@dragable = true
@closable = true
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(0, 0, 132, 32, "Nome:")
self.contents.draw_text(100, 0, 132, 32, "Set Celestial")
self.contents.draw_text(0, 20, 132, 32, "Classe:")
self.contents.draw_text(100, 20, 132, 32, "Iniciante")
self.contents.draw_text(0, 40, 132, 32, "Def. Total:")
self.contents.draw_text(100, 40, 132, 32, "194")
self.contents.draw_text(0, 60, 132, 32, "Quantidade:")
self.contents.draw_text(100, 60, 132, 32, "1")
self.contents.draw_text(0, 80, 132, 32, "Preço:")
self.contents.draw_text(100, 80, 132, 32, "¢240")
end
end