Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.



 
Trang ChínhPortalTìm kiếmLatest imagesĐăng kýĐăng Nhập
Bài gửiNgười gửiThời gian
GAME nhập vai - Gta San Andreas phiên bản multiplayer. Script vx hòm tiền 115/11/2014, 22:08
Tài nguyên game bang bang zing me Script vx hòm tiền 114/11/2014, 07:32
Hướng dẫn làm nhân vật di chuyển Script vx hòm tiền 114/11/2014, 06:57
Cách sử dụng code current Script vx hòm tiền 114/11/2014, 06:52
Em xin làm đoạn video do em tự dẫn giúp cho các anh chị nào không biết các công cụ trong game maker Script vx hòm tiền 114/11/2014, 06:50
Cần tài nguyên game Võ đài thần tiên Script vx hòm tiền 114/11/2014, 06:39
Tải RPG XP + Việt Hóa Script vx hòm tiền 127/9/2014, 18:50
Bản hướng dẫn RPGXP đây..... Script vx hòm tiền 127/9/2014, 13:43
can giup Script vx hòm tiền 127/9/2014, 13:40
can giup Script vx hòm tiền 127/9/2014, 13:36
sự thật về vtc academy hcm Script vx hòm tiền 122/10/2013, 20:07
[vnplay.org]MU Việt Season 6.3 - Reset Và Non Reset -Không Webshop - Open tháng 5 Script vx hòm tiền 14/5/2013, 15:35
Phần trang bị giống game diablo Script vx hòm tiền 113/3/2013, 18:31
Game4V và Event "Viết bài hay, nhận ngay quà tặng" Script vx hòm tiền 119/2/2012, 21:24
HELP: Failed to create process Script vx hòm tiền 113/12/2011, 11:27
Danh hiệu member Script vx hòm tiền 16/12/2011, 13:02
TRY.VN RA MẮT CỤM MÁY CHỦ MỚI : HOÀN MỸ - OPEN 22/11 - ĐỈNH CAO MU ONLINE Script vx hòm tiền 123/11/2011, 07:44
MU 24 Giờ - Cực khó dành cho game thủ đích thực - Open Beta vào lúc 11h ngày 11/11/2011 Script vx hòm tiền 119/11/2011, 18:55
wqswqdqw Script vx hòm tiền 123/10/2011, 21:51
Diễn đàn Make Game VN chính thức Script vx hòm tiền 131/8/2011, 10:29

Share | 
 

 Script vx hòm tiền

Xem chủ đề cũ hơn Xem chủ đề mới hơn Go down 
Tác giảThông điệp
duongtiep
Level 15
Level 15
duongtiep

Danh hiệu : The King
Tổng số bài gửi : 1229
MGV Xu : 2677
Danh tiếng : 45
Ngày tham gia : 10/12/2010
Đến từ : Quảng Ninh

Script vx hòm tiền Empty
Bài gửiTiêu đề: Script vx hòm tiền   Script vx hòm tiền I_icon_minitime16/12/2010, 11:23

Giới thiệu :
Script thiết lập chế độ hòm tiền (tức là cất tiền vào hòm đó )
Screenshot :
Script vx hòm tiền Warp329329

Script :
Code:
--------------------------------------------------------------------------------------
# Script de Banco para RMVX hecho por RayRpg
# tomando como base script de banco de KGC
# para RMXP
# para llamar 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 = "Insertar la cantidad a depositar"

WDEPOSIT_GOLD = "Insertar la cantidad a 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 0...@commands.size

    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, 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, "Gold que tienes:")

  self.contents.draw_text(0, 64, 608, 32, "Depósito:")

  if type == 0

    self.contents.draw_text(0, 128, 608, 32, "Cantidad:")

    @max = $game_party.gold

  else

    self.contents.draw_text(0, 128, 608, 32, "Retirada:")

    @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("%0#{@digits_max}d", 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 0...@digits_max

    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

Để gọi hòm tiền lên :
Mã:$scene = Scene_Depository.new

*************************************************
Nguồn : reinorpg.com
Tác giả : RayRpg
Chữ ký của duongtiep
Về Đầu Trang Go down
https://makegame.forumvi.com
L.V
Level 4
Level 4
L.V

Tổng số bài gửi : 197
MGV Xu : 341
Danh tiếng : 9
Ngày tham gia : 13/12/2010
Tuổi : 29
Đến từ : Cầu Xe Hội

Script vx hòm tiền Empty
Bài gửiTiêu đề: Re: Script vx hòm tiền   Script vx hòm tiền I_icon_minitime17/12/2010, 10:05

Thủ khố ! ... mỗi tọi ko cất đc đồ !
Chữ ký của L.V
Về Đầu Trang Go down
http://cauxe.come.vn
 

Script vx hòm tiền

Xem chủ đề cũ hơn Xem chủ đề mới hơn Về Đầu Trang 

 Similar topics

+
Trang 1 trong tổng số 1 trang

Permissions in this forum:Bạn không có quyền trả lời bài viết
 :: RPG VX :: Script-
Chuyển đến