Eventers Lab & G+ Games (ELG+)
Olá, se você já é cadastrado no nosso fórum, faça seu login, se ainda não é, não perca tempo! Cadastre-se já!

Participe do fórum, é rápido e fácil

Eventers Lab & G+ Games (ELG+)
Olá, se você já é cadastrado no nosso fórum, faça seu login, se ainda não é, não perca tempo! Cadastre-se já!
Eventers Lab & G+ Games (ELG+)
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.
Entrar

Esqueci-me da senha

Últimos assuntos
» 2 Players no jogo (Backup RMB)
Script do Sistema Bancário EmptyDom Jul 31, 2011 5:39 pm por Rodrigo Vernaschi

» Chamar Bote
Script do Sistema Bancário EmptyDom Jul 31, 2011 5:16 pm por Rodrigo Vernaschi

» Caixa de Texto Acima do Personagem
Script do Sistema Bancário EmptyDom Jul 31, 2011 4:56 pm por Rodrigo Vernaschi

» Auto-Tile Speed
Script do Sistema Bancário EmptyDom Jul 31, 2011 4:49 pm por Rodrigo Vernaschi

» Apresentação Antes do Title
Script do Sistema Bancário EmptyDom Jul 31, 2011 4:35 pm por Rodrigo Vernaschi

» Anti-Hack System (Silver Link/Gold Link)
Script do Sistema Bancário EmptyDom Jul 31, 2011 4:26 pm por Rodrigo Vernaschi

» Anti Hack (AMIGO X)
Script do Sistema Bancário EmptyDom Jul 31, 2011 4:19 pm por Rodrigo Vernaschi

» Ajustar Volume Durante o Jogo
Script do Sistema Bancário EmptyDom Jul 31, 2011 3:58 pm por Rodrigo Vernaschi

» Músicas e poemas
Script do Sistema Bancário EmptyQua Out 20, 2010 8:19 pm por Memories


Script do Sistema Bancário

Ir para baixo

Script do Sistema Bancário Empty Script do Sistema Bancário

Mensagem por Vingador Seg Jan 04, 2010 11:43 pm

Sistema para depósito de dinheiro.
É estremamente sensível. Não tente modifica-lo.
As instruções estão no script.
Tente verificá-lo sempre que instalar um script novo.

Código:

# --------------------------------------------------------------------------------------
# script de Banco para RMVX criado por El Vingador Bruto
#
# para abir o banco, chame o script:$scene = Scene_Depository.new
#--------------------------------------------------------------------------------------
class Window_DepositoryCommand < Window_Selectable
# Nombre de los comandos
DEPOSITORY_COMMAND = [
  "Depositar",      # depósito ouro
  "Retirar",    # retirar ouro
]
# Defina los comandos
DEPOSITORY_HELP = [
  "Depositar Gold",  # Depositar oro
  "Retirar Gold",    # Retirarlo
]
end
class Window_DepositoryGold < Window_Base
# Numero de 0 maximos
GOLD_DIGITS = 7
end

class Scene_Depository
DEPOSIT_GOLD = "Inserir a quantidade que quer depositar"
WDEPOSIT_GOLD = "Inserir a quantidade que quer retirar"
end
#--------------------------------------------------------------------------
def call_depository
$game_player.straighten
$scene = Scene_Depository.new
end
#--------------------------------------------------------------------------------------
# Class Game_Party
#-------------------------------------------------------------------------------------
class Game_Party
alias initialize_Ray_Depository initialize
def initialize
  initialize_Ray_Depository
  @deposit_gold = 0
end
#--------------------------------------------------------------------------
# informacion de oro
#--------------------------------------------------------------------------
def deposit_gold
  @deposit_gold = 0 if @deposit_gold == nil
  return @deposit_gold
end
#--------------------------------------------------------------------------
# Recupere informacion del oro
#--------------------------------------------------------------------------
def gain_deposit_gold(number)
  @deposit_gold = 0 if @deposit_gold == nil
  @deposit_gold += number
end
def lose_deposit_gold(number)
  self.gain_deposit_gold(-number)
end
end

#---------------------------------------------------------------------------------
#  Window_DepositoryCommand
#---------------------------------------------------------------------------------

class Window_DepositoryCommand < Window_Selectable
def initialize
  super(0, 64, 545, 60)
  self.contents = Bitmap.new(width - 32, height - 32)
  @commands = DEPOSITORY_COMMAND
  @item_max = @commands.size
  @column_max = @commands.size
    @item_width = (width - 32) / @commands.size
 
    self.back_opacity = 160
  self.index = 0
  refresh
end
#--------------------------------------------------------------------------
# Actulizacion
#--------------------------------------------------------------------------
def refresh
  for i in [url=http://eventerslab.forumakers.com/mailto:0...@commands.size]0...@commands.size[/url]
    rect = Rect.new(@item_width * i, 0, @item_width, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.font.color = system_color
    self.contents.draw_text(rect, @commands[i], 1)
  end
end
#--------------------------------------------------------------------------------
# Cursor
#---------------------------------------------------------------------------------
def update_cursor_rect
  if index != -1
    self.cursor_rect.set(@item_width * index, 0, @item_width, 32)
  end
end
def update_help
  @help_window.set_text(DEPOSITORY_HELP[self.index])
end
end
#--------------------------------------------------------------------------------
#  Window_DepositoryGold
#---------------------------------------------------------------------------------

class Window_DepositoryGold < Window_Base
def initialize
  super(0, 128, 545, 285)
  @digits_max = GOLD_DIGITS
  dummy_bitmap = Bitmap.new(32, 32)
  @cursor_width = dummy_bitmap.text_size("0").width + 8
  dummy_bitmap.dispose
  self.contents = Bitmap.new(width - 32, height - 32)
  self.back_opacity = 160
  self.active = false
  self.visible = false
  @cursor_position = 0
  @max = 0
  @price = 0
  @index = 0
end
def price
  return @price
end
def price=(np)
  @price = [[np, 0].max, @max].min
  redraw_price
end
def reset(type)
  @price = 0
  @index = @digits_max - 1
  refresh(type)
end
def refresh(type)
  self.contents.clear
  domination = $game_party.gold
  cx = contents.text_size(domination).width
  @cursor_position = 332 - cx - @cursor_width * @digits_max
  self.contents.font.color = system_color
  self.contents.draw_text(0, 0, 608, 32, "Dinheiro que possui:")
  self.contents.draw_text(0, 64, 608, 32, "Depósito:")
  if type == 0
    self.contents.draw_text(0, 128, 608, 32, "Quantidade:")
    @max = $game_party.gold
  else
    self.contents.draw_text(0, 128, 608, 32, "Sacar:")
    @max = [10 ** @digits_max - $game_party.gold - 1, $game_party.deposit_gold].min
  end
  self.contents.font.color = normal_color
  self.contents.draw_text(4, 32, 326 - cx, 32, $game_party.gold.to_s, 2)
  self.contents.font.color = system_color
  self.contents.draw_text(332 - cx, 32, cx, 32, domination, 2)
  self.contents.font.color = normal_color
  self.contents.draw_text(4, 96, 326 - cx, 32, $game_party.deposit_gold.to_s, 2)
  self.contents.font.color = system_color
  self.contents.draw_text(332 - cx, 96, cx, 32, domination, 2)
  redraw_price
end
def redraw_price
  domination = $game_party.gold
  cx = contents.text_size(domination).width
  self.contents.fill_rect(0, 160, 608, 32, Color.new(0, 0, 0, 0))
  self.contents.font.color = normal_color
  text = sprintf("[url=http://eventerslab.forumakers.com/mailto:%0#{@digits_max}d]%0#{@digits_max}d[/url]", self.price)
  for i in 0...text.length
    x = @cursor_position + (i - 1) * @cursor_width
    self.contents.draw_text(x, 160, 32, 32, text[i, 1], 2)
  end
  self.contents.font.color = system_color
  self.contents.draw_text(332 - cx, 160, cx, 32, domination, 2)
end
#--------------------------------------------------------------------------
# Actualizacion del cursor
#--------------------------------------------------------------------------
def update_cursor_rect
  x = @cursor_position + @index * @cursor_width
  self.cursor_rect.set(x, 160, @cursor_width, 32)
end
def update
  super
  return unless self.active
  if Input.repeat?(Input::UP) || Input.repeat?(Input::DOWN)
    Sound.play_decision
    place = 10 ** (@digits_max - 1 - @index)
    n = self.price / place % 10
    self.price -= n * place
    n = (n + 1) % 10 if Input.repeat?(Input::UP)
    n = (n + 9) % 10 if Input.repeat?(Input::DOWN)
    self.price += n * place
  end
  if Input.repeat?(Input::RIGHT)
    if @digits_max >= 2
      Sound.play_decision   
      @index = (@index + 1) % @digits_max
    end
  end
  if Input.repeat?(Input::LEFT)
    if @digits_max >= 2
      Sound.play_decision
      @index = (@index + @digits_max - 1) % @digits_max
    end
  end
  update_cursor_rect
end
end
def item
  return @data[self.index]
end
#--------------------------------------------------------------------------------
#  Window_DepositoryNumber
#-------------------------------------------------------------------------------
class Window_DepositoryNumber < Window_Base
def initialize
  @digits_max = 2
  @number = 0
  dummy_bitmap = Bitmap.new(32, 32)
  @cursor_width = dummy_bitmap.text_size("0").width + 8
  dummy_bitmap.dispose
  @default_size = @cursor_width * @digits_max + 32
  super(0, 0, @default_size, 128)
  self.contents = Bitmap.new(width - 32, height - 32)
  self.z = 1000
  self.back_opacity = 160
  self.active = false
  self.visible = false
  @index = 0
  @item = nil
  refresh
  update_cursor_rect
end
#-------------------------------------------------------------------------
# Actualizacion del cursor
#--------------------------------------------------------------------------
def update_cursor_rect
  self.cursor_rect.set(@index * @cursor_width, 32, @cursor_width, 32)
end
def refresh
  self.contents.fill_rect(0, 32, width - 32, 32, Color.new(0, 0, 0, 0))
  self.contents.font.color = normal_color
  s = sprintf("%0*d", @digits_max, @number)
  for i in [url=http://eventerslab.forumakers.com/mailto:0...@digits_max]0...@digits_max[/url]
    self.contents.draw_text(i * @cursor_width + 4, 32, 32, 32, s[i,1])
  end
end
def set_text(string = " ")
  self.resize(self.contents.text_size(string).width + 40)
  self.contents.fill_rect(0, 0, width - 32, 32, Color.new(0, 0, 0, 0))
  self.contents.font.color = normal_color
  self.contents.draw_text(0, 0, width - 32, 32, string, 1)
  refresh
  centering
end
def resize(nw)
  self.width = nw
  buf = self.contents.dup
  self.contents.dispose
  self.contents = Bitmap.new(nw - 32, 96)
  self.contents.blt(0, 0, buf, buf.rect)
  buf.dispose
end
#-------------------------------------------------------------------------
# Movimiento central
#--------------------------------------------------------------------------
def centering
  self.x = 320 - self.width / 2
  self.y = 240 - self.height / 2
end
#-------------------------------------------------------------------------
# Actualizacion
#--------------------------------------------------------------------------
def update
  super
  return unless self.active
  if Input.repeat?(Input::UP) || Input.repeat?(Input::DOWN)
    $game_system.se_play($data_system.cursor_se)
    place = 10 ** (@digits_max - 1 - @index)
    n = self.number / place % 10
    self.number -= n * place
    n = (n + 1) % 10 if Input.repeat?(Input::UP)
    n = (n + 9) % 10 if Input.repeat?(Input::DOWN)
    self.number += n * place
    refresh
  end
  if Input.repeat?(Input::RIGHT)
    if @digits_max >= 2
      $game_system.se_play($data_system.cursor_se)
      @index = (@index + 1) % @digits_max
    end
  end
  if Input.repeat?(Input::LEFT)
    if @digits_max >= 2
        Sound.play_decision
      @index = (@index + @digits_max - 1) % @digits_max
    end
  end
  update_cursor_rect
end
end
#---------------------------------------------------------------------------------
#  Scene_Depository
#---------------------------------------------------------------------------------
class Scene_Depository
def main
  @spriteset = Spriteset_Map.new
  @dummy_window = Window_Base.new(0, 60, 545, 352)
  @help_window = Window_Help.new
  @dummy_window.back_opacity = 160
  @help_window.back_opacity = 160
  @command_window = Window_DepositoryCommand.new
  @gold_window = Window_DepositoryGold.new
  @number_window = Window_DepositoryNumber.new
  @command_window.help_window = @help_window
  Graphics.transition
  loop do
    Graphics.update
    Input.update
    update
    if $scene != self
      break
    end
  end
  Graphics.freeze
  @spriteset.dispose
  @dummy_window.dispose
  @help_window.dispose
  @command_window.dispose
  @gold_window.dispose
  @number_window.dispose
end
#------------------------------------------------------------------------
# Actualizacion
#--------------------------------------------------------------------------
def update
  @dummy_window.update
  @help_window.update
  @command_window.update
  @gold_window.update
  @number_window.update
  if @command_window.active
    update_command
    return
  end
  if @gold_window.active
    update_gold
    return
  end
  if @number_window.active
    update_number
    return
  end
end
def update_command
  if Input.trigger?(Input::B)
  Sound.play_decision
    $scene = Scene_Map.new
    return
  end
  if Input.trigger?(Input::C)
    Sound.play_decision
    case @command_window.index
    when 0
      @gold_window.active = true
      @gold_window.visible = true
      @gold_window.reset(0)
      @help_window.set_text(DEPOSIT_GOLD)
    when 1
      @gold_window.active = true
      @gold_window.visible = true
      @gold_window.reset(1)
      @help_window.set_text(WDEPOSIT_GOLD)
    when 2
      @item_window.active = true
      @item_window.visible = true
      @item_window.refresh(0)
    when 3
      @item_window.active = true
      @item_window.visible = true
      @item_window.refresh(1)
    end
    @command_window.active = false
    @dummy_window.visible = false
    return
  end
end
def update_gold
  if Input.trigger?(Input::B)
    Sound.play_decision
    @command_window.active = true
    @gold_window.active = false
    @gold_window.visible = false
    @dummy_window.visible = true
    return
  end
  if Input.trigger?(Input::C)
    price = @gold_window.price
    if price == 0
      Sound.play_decision
      @command_window.active = true
      @gold_window.active = false
      @gold_window.visible = false
      @dummy_window.visible = true
      return
    end
    Sound.play_decision
    case @command_window.index
    when 0
      $game_party.lose_gold(price)
      $game_party.gain_deposit_gold(price)
    when 1
      $game_party.gain_gold(price)
      $game_party.lose_deposit_gold(price)
    end
    @gold_window.reset(@command_window.index)
    return
  end
end
def update_number
  if Input.trigger?(Input::B)
  Sound.play_decision
    @number_window.active = false
    @number_window.visible = false
    return
  end
    @number_window.active = false
    @number_window.visible = false
    return
  end
end

Vingador
Vingador
Iniciante
Iniciante

Número de Mensagens : 16
Idade : 35
Localização : Araguari
Premios : <br>Script do Sistema Bancário Medal_gold_3: 0 Script do Sistema Bancário Medal_silver_3: 0 Script do Sistema Bancário Medal_bronze_3: 0
Reputação : 13
Pontos : 90
Data de inscrição : 04/01/2010

Ficha do personagem
Raça: Lich
Nível Maker: Mestre
Mensagem Pessoal: Me dê as suas armas mágicas!!!

http://www.orkut.com.br/Main#Profile?uid=4395857722134662547

Ir para o topo Ir para baixo

Ir para o topo

- Tópicos semelhantes

 
Permissões neste sub-fórum
Não podes responder a tópicos