Полезный и очень простой скрипт для создания хранилища ваших предметов, золота и прочего!

Настройка и установка наипростейшая, справится любой. Скрипт руссифицирован и поэтому не надо ничего переводить!

Установка

1.Скопировать текст
2.открыть свой проект в RPG Maker Vx Ace
3.Открыть вкладку "Редактор Скриптов"/ нажать F11 на клавиатуре.
4.Найти строчку "пользовательские" в левой стороне окна.
5.Добавить строчку для скриптов можно кнопкой Insert на клавиатуре.
6.Вставить скрипт в поле для ввода

Сам скрипт

#===============================================================================
# Разработан на основе скрипта $D13x - Bank Account
#===============================================================================
# Описание
#-------------------------------------------------------------------------------
# Создает механизм сохранения предметов на будущее
#===============================================================================
# Инструкция
#-------------------------------------------------------------------------------
# 1.Скопировать скрипт перед Main
# 2.Создать Событие с вызовом скрипта SceneManager.call(Scene_Chest_Item)
#===============================================================================
# Команды для события
#-------------------------------------------------------------------------------
# $chest_item.gain_cash(amount)           //Добавляет денег в сундук
# $chest_item.lose_cash(amount)           //Отнимает деньги из сундука
# $chest_item.add_to_items(id, amount)    //Добавляет вещь в сундук
# $chest_item.add_to_weapons(id, amount)  //Добавляет оружие в сундук
# $chest_item.add_to_armors(id, amount)   //Добавляет броню в сундук
# SceneManager.call(Scene_Chest_Item)     //Вызов GUI скрипта
#===============================================================================
module Game_Storage
#===============================================================================
  #-----------------------------------------------------------------------------
  # Начальная сумма денег в сундуке
  #-----------------------------------------------------------------------------
  Initial_CASH = 0
  #-----------------------------------------------------------------------------
  # Какие вещи будут с начала игры в сундуке
  # Формат = [ [ID вещи, кол-во], [ID вещи, кол-во] ]
  #-----------------------------------------------------------------------------
  Initial_Items = [ [1, 1], [2, 2] ]
  #-----------------------------------------------------------------------------
  # Какое оружие будут с начала игры в сундуке
  # Формат = [ [ID оружия, кол-во], [ID оружия, кол-во] ]
  #-----------------------------------------------------------------------------
  Initial_Weapons = [ [1, 1] ]
  #-----------------------------------------------------------------------------
  # Какая броня будут с начала игры в сундуке
  # Формат = [ [ID брони, кол-во], [ID брони, кол-во] ]
  #-----------------------------------------------------------------------------
  Initial_Armors = [ [1, 1] ]
end
#===============================================================================
module PC_Scene
#===============================================================================
  Money_Vocab  = "Деньги"
  Money_Prefix = "%s G"
  Money_Icon   = 361
  Money_Icon_x  = 0
  Money_Text_x  = 25
  #-----------------------------------------------------------------------------
  Value_Prefix = "x%s"
  #-----------------------------------------------------------------------------
  Items_Vocab   = "Вещи"
  Weapons_Vocab = "Оружие"
  Armors_Vocab  = "Броня"
  #-----------------------------------------------------------------------------
  Current_Money_Vocab = "В рюкзаке :"
  Chest_Item_Money_Vocab  = "В сундуке :"
  #-----------------------------------------------------------------------------
  Deposit_Vocab   = "Положить"
  Deposit_Info    = "Положить деньги, вещи или экипировку в сундук."
  Deposit_Cash    = "Положить деньги в сундук."
  Deposit_Items   = "Положить вещи в сундук."
  Deposit_Weapons = "Положить оружие в сундук."
  Deposit_Armors  = "Положить броню в сундук."
  #-----------------------------------------------------------------------------
  Withdraw_Vocab   = "Забрать"
  Withdraw_Info    = "Забрать деньги, вещи или экипировку из сундука."
  Withdraw_Cash    = "Забрать деньги из сундука."
  Withdraw_Items   = "Забрать вещи из сундука."
  Withdraw_Weapons = "Забрать оружие из сундука."
  Withdraw_Armors  = "Забрать броню из сундука."
end
#===============================================================================
module DataManager
#===============================================================================
  #-----------------------------------------------------------------------------
  class << self ;
    alias :cgo_chest_item_account :create_game_objects
    alias :msc_chest_item_account :make_save_contents
    alias :esc_chest_item_account :extract_save_contents
  end
  #-----------------------------------------------------------------------------
  def self.create_game_objects
    cgo_chest_item_account
    $chest_item = Chest_Item_Account.new
  end
  #-----------------------------------------------------------------------------
  def self.make_save_contents
    contents = msc_chest_item_account
    contents[:chest_item] = $chest_item
    contents
  end
  #-----------------------------------------------------------------------------
  def self.extract_save_contents(contents)
    esc_chest_item_account(contents)
    $chest_item = contents[:chest_item].nil? ? Chest_Item_Account.new : contents[:chest_item]
  end
end
#===============================================================================
class Chest_Item_Account
#===============================================================================
  #-----------------------------------------------------------------------------
  include Game_Storage
  #-----------------------------------------------------------------------------
  attr_reader :cash
  attr_reader :items
  attr_reader :weapons
  attr_reader :armors
  #-----------------------------------------------------------------------------
  def initialize
    init_pis
    get_initial_stored_items
    get_initial_stored_weapons
    get_initial_stored_armors
  end
  #-----------------------------------------------------------------------------
  def init_pis
    @cash    = Initial_CASH
    @items   = []
    @weapons = []
    @armors  = []
  end
  #-----------------------------------------------------------------------------
  def get_initial_stored_items
    for info in Game_Storage::Initial_Items
      next if info[0] == nil || info[0] <= 0
      add_to_items(info[0], info[1])
    end
  end
  #-----------------------------------------------------------------------------
  def get_initial_stored_weapons
    for info in Game_Storage::Initial_Weapons
      next if info[0] == nil || info[0] <= 0
      add_to_weapons(info[0], info[1])
    end
  end
  #-----------------------------------------------------------------------------
  def get_initial_stored_armors
    for info in Game_Storage::Initial_Armors
      next if info[0] == nil || info[0] <= 0
      add_to_armors(info[0], info[1])
    end
  end
  #-----------------------------------------------------------------------------
  def add_to_items(item_id, amount)
    return if item_id == nil || item_id <= 0 || amount == nil || amount <= 0
    @items.push([ $data_items[item_id] , amount ])
  end
  #-----------------------------------------------------------------------------
  def add_to_weapons(item_id, amount)
    return if item_id == nil || item_id <= 0 || amount == nil || amount <= 0
    weapon = [$data_weapons[item_id], amount]
    @weapons.push(weapon)
  end
  #-----------------------------------------------------------------------------
  def add_to_armors(item_id, amount)
    return if item_id == nil || item_id <= 0 || amount == nil || amount <= 0
    armor = [$data_armors[item_id],amount]
    @armors.push(armor)
  end
  #-----------------------------------------------------------------------------
  def gain_cash(amount)
    @cash += amount
  end
  #-----------------------------------------------------------------------------
  def lose_cash(amount)
    @cash -= amount
    @cash = 0 if @cash < 0
  end
end
#===============================================================================
class Window_Player_PC_Number < Window_ShopNumber
#===============================================================================
  #-----------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y, window_height)
  end
  #-----------------------------------------------------------------------------
  def window_width
    return Graphics.width / 2
  end
  #-----------------------------------------------------------------------------
  def window_height
    return line_height + 24
  end
  #-----------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_the_item
    draw_number
  end
  #-----------------------------------------------------------------------------
  def draw_number
    change_color(normal_color)
    if @item
      change_color(normal_color, true)
    end
    tx = sprintf(PC_Scene::Value_Prefix, @number)
    draw_text(0,0,window_width-(standard_padding*2), line_height, tx, 2)
  end
  #-----------------------------------------------------------------------------
  def draw_the_item
    change_color(normal_color)
    x  = PC_Scene::Money_Text_x
    ix = PC_Scene::Money_Icon_x
    y  = item_y
    w  = window_width
    if @item == $data_items[0]
      draw_icon(PC_Scene::Money_Icon, ix, y, true)
      draw_text(x, y, w, line_height, PC_Scene::Money_Vocab)
     
    else
      draw_icon(@item.icon_index, ix, y, true)
      change_color(normal_color, true)
      draw_text(x, y, w, line_height, @item.name)
    end
  end
  #----------------------------------------------------------------------------
  def item_y
    return 0
  end
  #-----------------------------------------------------------------------------
  def figures
    return 4
  end
  #-----------------------------------------------------------------------------
  def update_number
    super
  end
  #-----------------------------------------------------------------------------
  def update_cursor
    cursor_rect.set(0, 0, 0, 0)
  end
  #-----------------------------------------------------------------------------
  def change_number(amount)
    @number = [[@number + amount, @max].min, 0].max
  end
  #-----------------------------------------------------------------------------
  def set(item, max, price, currency_unit = nil)
    @item = item
    @max = max
    @price = price
    @currency_unit = currency_unit if currency_unit
    @number = @item == $data_items[0] ? 0 : 1
    refresh
  end
end
#===============================================================================
class Window_Chest_Item_Help < Window_Base
#===============================================================================
  def initialize(line_number = 2)
    super(0, 0, Graphics.width/4*3, fitting_height(line_number))
    @item = nil
  end
  #--------------------------------------------------------------------------
  def set_text(text)
    if text != @text
      @text = text
      refresh
    end
  end
  #--------------------------------------------------------------------------
  def clear
    set_text("")
  end
  #--------------------------------------------------------------------------
  def set_item(item)
    return if @item == item
    @item = item
    refresh
    set_text(item ? item.description : "")
  end
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_text_ex(4, 0, @text)
  end
  #--------------------------------------------------------------------------
  def reset_font_settings
    change_color(normal_color)
    self.contents.font.name = ["VL Gothic","Serif","Arial"]
    self.contents.font.size = 15
    self.contents.font.bold = true
  end
end
#===============================================================================
class Window_PC_GOLD < Window_Gold
#===============================================================================
  #-----------------------------------------------------------------------------
  def window_width
    return ((Graphics.width / 4 * 2))
  end
  #-----------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_gold
  end
  #-----------------------------------------------------------------------------
  def draw_gold
    x = 0 ; y = 0
    change_color(normal_color)
    draw_text(x, y, window_width, line_height, PC_Scene::Current_Money_Vocab)
    draw_text(x, y, window_width-24, line_height, unit, 2)
  end
  #-----------------------------------------------------------------------------
  def unit
    sprintf(PC_Scene::Money_Prefix, value)
  end
end
#==============================================================================
class Window_PC_GOLD_InChest_Item < Window_PC_GOLD
#==============================================================================
  #-----------------------------------------------------------------------------
  def draw_gold
    x = 0 ; y = 0
    change_color(normal_color)
    draw_text(x, y, window_width, line_height, PC_Scene::Chest_Item_Money_Vocab)
    draw_text(x, y, window_width-24, line_height, unit, 2)
  end
  #-----------------------------------------------------------------------------
  def value
    $chest_item.cash
  end
end
#===============================================================================
class Window_Player_PC_Command < Window_Command
#===============================================================================
  #-----------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y)
    draw_items_info
    type
  end
  #-----------------------------------------------------------------------------
  def change_type(type = :items)
    @type = type
  end
  #-----------------------------------------------------------------------------
  def type
    @type
  end
  #-----------------------------------------------------------------------------
  def window_width
    return Graphics.width - (Graphics.width / 4 * 2)
  end
  #-----------------------------------------------------------------------------
  def window_height
    return Graphics.height - fitting_height(6)
  end
  #-----------------------------------------------------------------------------
  def make_command_list
    case @type
    when :items
      for item in $chest_item.items
        add_item_command(item)
      end
    when :weapons
      for item in $chest_item.weapons
        add_item_command(item)
      end     
    when :armors
      for item in $chest_item.armors
        add_item_command(item)
      end     
    end
  end
  #-----------------------------------------------------------------------------
  def add_item_command(item)
    add_command(""  , :avail_item, true)
  end 
  #-----------------------------------------------------------------------------
  def draw_items_info
    x = 0 ; y = 0
    case @type
    when :items
      for item in $chest_item.items
        y = draw_infoo(x, y, item)
      end
    when :weapons
      for item in $chest_item.weapons
        y = draw_infoo(x, y, item)
      end
    when :armors
      for item in $chest_item.armors
        y = draw_infoo(x, y, item)
      end
    end
  end
  #-----------------------------------------------------------------------------
  def draw_infoo(x, y, item)
    draw_icon(item[0].icon_index, x, y, true)
    change_color(normal_color)
    draw_text(x+25, y, window_width-50, line_height, item[0].name, 0)
    draw_text(x, y, window_width-25, line_height, "x#{item[1]} ", 2)
    return y + line_height
  end
  #-----------------------------------------------------------------------------
  def refresh
    super
    draw_items_info
  end
end
#==============================================================================
class Window_Player_PC_Bag_Command < Window_Player_PC_Command
#==============================================================================
  #-----------------------------------------------------------------------------
  def make_command_list
    case @type
    when :items
      for item in $game_party.items
        add_item_command(item)
      end
    when :weapons
      for item in $game_party.weapons
        add_item_command(item)
      end     
    when :armors
      for item in $game_party.armors
        add_item_command(item)
      end     
    end
  end
  #-----------------------------------------------------------------------------
  def add_item_command(item)
    add_command(""  , :avail_item, true)
  end 
  #-----------------------------------------------------------------------------
  def draw_items_info
    x = 0
    y = 0
    case @type
    when :items
      for item in $game_party.items
        y = draw_infoo(x, y, item)
      end
    when :weapons
      for item in $game_party.weapons
        y = draw_infoo(x, y, item)
      end
    when :armors
      for item in $game_party.armors
        y = draw_infoo(x, y, item)
      end
    end
  end
  #-----------------------------------------------------------------------------
  def draw_infoo(x, y, item)
    draw_icon(item.icon_index, x, y, true)
    change_color(normal_color)
    draw_text(x+25, y, window_width-50, line_height, item.name, 0)
    item_count = $game_party.item_number(item)
    draw_text(x, y, window_width-25, line_height, "x#{item_count} ", 2)
    return y + line_height
  end
end
#===============================================================================
class Window_Player_PC_Action_Command < Window_Command
#===============================================================================
  #-----------------------------------------------------------------------------
  def window_width
    return Graphics.width/4
  end
  #-----------------------------------------------------------------------------
  def make_command_list
    add_command(PC_Scene::Deposit_Vocab,  :deposit)
    add_command(PC_Scene::Withdraw_Vocab, :withdraw)
  end
end
#==============================================================================
class Window_Player_PC_Action_Command_2 < Window_HorzCommand
#==============================================================================
  #-----------------------------------------------------------------------------
  def window_width
    return Graphics.width
  end
  #-----------------------------------------------------------------------------
  def make_command_list
    add_command(PC_Scene::Money_Vocab,   :cash)
    add_command(PC_Scene::Items_Vocab,   :items)
    add_command(PC_Scene::Weapons_Vocab, :weapons)
    add_command(PC_Scene::Armors_Vocab,  :armors)
  end
  #-----------------------------------------------------------------------------
  def col_max
    return 4
  end
end
#===============================================================================
class Scene_Chest_Item < Scene_MenuBase
#===============================================================================
  #-----------------------------------------------------------------------------
  def start
    super
    create_help_window
    create_action_commands
    create_action_commands_2
    create_main_commands
    create_player_bag_commands
    create_number_window
    create_gold_window
    create_chest_item_gold_window
  end
  #-----------------------------------------------------------------------------
  def create_help_window
    @help_window = Window_Chest_Item_Help.new
    @help_window.viewport = @viewport
    @help_window.x = Graphics.width / 4
  end
  #-----------------------------------------------------------------------------
  def create_gold_window
    @gold_window = Window_PC_GOLD.new
    @gold_window.x = 0
    @gold_window.y = @action_com_wind_2.y + @action_com_wind_2.height
  end 
  #-----------------------------------------------------------------------------
  def create_chest_item_gold_window
    @chest_item_gold_window = Window_PC_GOLD_InChest_Item.new
    @chest_item_gold_window.x = ((Graphics.width / 4 * 2))
    @chest_item_gold_window.y = @action_com_wind_2.y + @action_com_wind_2.height
  end
  #-----------------------------------------------------------------------------
  def create_action_commands
    wx = @help_window.x
    wy = @help_window.height
    @action_com_wind = Window_Player_PC_Action_Command.new(0, 0)
    @action_com_wind.set_handler(:deposit, method(:command_trigger_nxt_choice))
    @action_com_wind.set_handler(:withdraw, method(:command_trigger_nxt_choice))
    @action_com_wind.set_handler(:cancel,    method(:return_scene))
    @my_current_symbol = :deposit
  end
  #-----------------------------------------------------------------------------
  def create_action_commands_2
    y = @help_window.height
    @action_com_wind_2 = Window_Player_PC_Action_Command_2.new(0, y)
    @action_com_wind_2.set_handler(:cash,      method(:command_trigger_cash))
    @action_com_wind_2.set_handler(:items,     method(:command_trigger_items))
    @action_com_wind_2.set_handler(:weapons,   method(:command_trigger_weapons))
    @action_com_wind_2.set_handler(:armors,    method(:command_trigger_armors))
    @action_com_wind_2.set_handler(:cancel,    method(:command_back_to_firstchoice))
    @action_com_wind_2.deactivate
    @action_com_wind_2.select(-1)
  end
  #-----------------------------------------------------------------------------
  def create_main_commands
    wx = Graphics.width / 2
    wy = @action_com_wind_2.y + (@action_com_wind_2.height * 2)
    @main_com_wind = Window_Player_PC_Command.new(wx, wy)
    @main_com_wind.set_handler(:avail_item, method(:command_items))
    @main_com_wind.set_handler(:cancel,     method(:command_back_to_2nd_choice))
    @main_com_wind.deactivate
    @main_com_wind.select(-1)
  end
  #-----------------------------------------------------------------------------
  def create_player_bag_commands
    wx = 0
    wy = @action_com_wind_2.y + (@action_com_wind_2.height * 2)
    @bag_com_wind = Window_Player_PC_Bag_Command.new(wx, wy)
    @bag_com_wind.set_handler(:avail_item, method(:command_items))
    @bag_com_wind.set_handler(:cancel,     method(:command_back_to_2nd_choice))
    @bag_com_wind.deactivate
    @bag_com_wind.select(-1)
  end
  #-----------------------------------------------------------------------------
  def create_number_window
    wx = Graphics.width / 4
    wy = @action_com_wind.y + @action_com_wind.height
    @number_window = Window_Player_PC_Number.new(wx, wy)
    @number_window.viewport = @viewport
    @number_window.set_handler(:ok,     method(:confirm_numbers))
    @number_window.set_handler(:cancel, method(:cancel_numbers))
    @number_window.hide
  end
  #-----------------------------------------------------------------------------
  def command_trigger_nxt_choice
    @action_com_wind_2.activate
    @action_com_wind_2.select(0)
  end
  #-----------------------------------------------------------------------------
  def command_trigger_cash
    item = $data_items[0]
    case @action_com_wind.current_symbol
    when :deposit  ; max = $game_party.gold
      price = $game_party.gold == 0 ? 0 : 1
    when :withdraw ; max = $chest_item.cash
      price = $chest_item.cash == 0 ? 0 : 1
    end
    @action_com_wind_2.deactivate
    @number_window.set(item, max, price)
    @number_window.open
    @number_window.activate
    @number_window.show
  end
  #-----------------------------------------------------------------------------
  def command_trigger_items
    @action_com_wind_2.deactivate
    case @action_com_wind.current_symbol
    when :deposit
      @bag_com_wind.activate
      @bag_com_wind.select(0)
    when :withdraw
      @main_com_wind.activate
      @main_com_wind.select(0)
    end
  end
  #-----------------------------------------------------------------------------
  def command_trigger_weapons
    @action_com_wind_2.deactivate
    case @action_com_wind.current_symbol
    when :deposit
      @bag_com_wind.activate
      @bag_com_wind.select(0)
    when :withdraw
      @main_com_wind.activate
      @main_com_wind.select(0)
    end
  end
  #-----------------------------------------------------------------------------
  def command_trigger_armors
    @action_com_wind_2.deactivate
    case @action_com_wind.current_symbol
    when :deposit
      @bag_com_wind.activate
      @bag_com_wind.select(0)
    when :withdraw
      @main_com_wind.activate
      @main_com_wind.select(0)
    end
  end
  #-----------------------------------------------------------------------------
  def command_back_to_firstchoice
    @action_com_wind_2.deactivate
    @action_com_wind_2.select(-1)
    @action_com_wind.activate
  end
  #-----------------------------------------------------------------------------
  def command_back_to_2nd_choice
    @main_com_wind.deactivate
    @main_com_wind.select(-1)
    @bag_com_wind.deactivate
    @bag_com_wind.select(-1)
    @action_com_wind_2.activate
  end
  #-----------------------------------------------------------------------------
  def command_items
    case @action_com_wind_2.current_symbol
    when:items
      case @action_com_wind.current_symbol
      when :deposit
        item = $data_items[$game_party.items[@bag_com_wind.index].id]
        max = $game_party.item_number(item)
      when :withdraw
        item = $chest_item.items[@main_com_wind.index][0]
        max = $chest_item.items[@main_com_wind.index][1]
      end
    when :weapons
      case @action_com_wind.current_symbol
      when :deposit
        item = $data_weapons[$game_party.weapons[@bag_com_wind.index].id]
        max  = $game_party.item_number(item)
      when :withdraw
        item = $chest_item.weapons[@main_com_wind.index][0]
        max  = $chest_item.weapons[@main_com_wind.index][1]
      end
    when :armors
      case @action_com_wind.current_symbol
      when :deposit
        item = $data_armors[$game_party.armors[@bag_com_wind.index].id]
        max  = $game_party.item_number(item)
      when :withdraw
        item = $chest_item.armors[@main_com_wind.index][0]
        max  = $chest_item.armors[@main_com_wind.index][1]
      end
    end
    price = 1
    @number_window.set(item, max, price)
    @number_window.activate
    @number_window.show
  end
  #-----------------------------------------------------------------------------
  def confirm_numbers
    case @action_com_wind.current_symbol
    when :deposit
      case @action_com_wind_2.current_symbol
      when :cash
        deposit_cash(@number_window.number)
        @action_com_wind_2.activate
      when :items
        deposit_items(@number_window.number)
        @bag_com_wind.activate
      when :weapons
        deposit_weapons(@number_window.number)
        @bag_com_wind.activate
      when :armors
        deposit_armors(@number_window.number)
        @bag_com_wind.activate
      end
    when :withdraw
      case @action_com_wind_2.current_symbol
      when :cash
        withdraw_cash(@number_window.number)
        @action_com_wind_2.activate
      when :items
        withdraw_items(@number_window.number)
        @main_com_wind.activate
      when :weapons
        withdraw_weapons(@number_window.number)
        @main_com_wind.activate
      when :armors
        withdraw_armors(@number_window.number)
        @main_com_wind.activate
      end
    end
    @number_window.deactivate
    @number_window.hide
  end
  #-----------------------------------------------------------------------------
  def cancel_numbers
    case @action_com_wind.current_symbol
    when :deposit
      case @action_com_wind_2.current_symbol
      when :cash
        @action_com_wind_2.activate
      when :items, :weapons, :armors
        @bag_com_wind.activate
      end
    when :withdraw
      case @action_com_wind_2.current_symbol
      when :cash
        @action_com_wind_2.activate
      when :items, :weapons, :armors
        @main_com_wind.activate
      end
    end
    @number_window.deactivate
    @number_window.hide
  end
  #-----------------------------------------------------------------------------
  def deposit_cash(amount)
    $game_party.lose_gold(amount)
    $chest_item.gain_cash(amount)
    @gold_window.refresh
    @chest_item_gold_window.refresh
  end
  #-----------------------------------------------------------------------------
  def withdraw_cash(amount)
    $game_party.gain_gold(amount)
    $chest_item.lose_cash(amount)
    @gold_window.refresh
    @chest_item_gold_window.refresh
  end
  #-----------------------------------------------------------------------------
  def deposit_items(amount)
    inv_item = $game_party.items[@bag_com_wind.index].id
    $game_party.lose_item($data_items[inv_item], amount)
    already_had_item = false
    $chest_item.items.each {|item|
    item[1] += amount if item[0].id == inv_item
    already_had_item = true if item[0].id == inv_item ; }
    $chest_item.add_to_items(inv_item, amount) if !already_had_item
    @bag_com_wind.refresh
    @main_com_wind.refresh
    @bag_com_wind.activate
  end
  #-----------------------------------------------------------------------------
  def withdraw_items(amount)
    gsi = $chest_item.items[@main_com_wind.index]
    gsi[1] -= amount
    $game_party.gain_item(gsi[0], amount)
    if gsi[1] < 1
      $chest_item.items.delete_at(@main_com_wind.index)
      @main_com_wind.index = 0
    end
    @main_com_wind.refresh
    @bag_com_wind.refresh
    @main_com_wind.activate
  end
  #-----------------------------------------------------------------------------
  def deposit_weapons(amount)
    inv_item = $game_party.weapons[@bag_com_wind.index].id
    $game_party.lose_item($data_weapons[inv_item], amount)
    already_had_item = false
    $chest_item.weapons.each {|item|
    item[1] += amount if item[0].id == inv_item
    already_had_item = true if item[0].id == inv_item ; }
    $chest_item.add_to_weapons(inv_item, amount) if !already_had_item
    @bag_com_wind.refresh
    @main_com_wind.refresh
    @bag_com_wind.activate
  end
  #-----------------------------------------------------------------------------
  def withdraw_weapons(amount)
    gsi = $chest_item.weapons[@main_com_wind.index]
    gsi[1] -= amount
    $game_party.gain_item(gsi[0], amount)
    if gsi[1] < 1
      $chest_item.weapons.delete_at(@main_com_wind.index)
      @main_com_wind.index = 0
    end
    @main_com_wind.refresh
    @bag_com_wind.refresh
    @main_com_wind.activate
  end
  #-----------------------------------------------------------------------------
  def deposit_armors(amount)
    inv_item = $game_party.armors[@bag_com_wind.index].id
    $game_party.lose_item($data_armors[inv_item], amount)
    already_had_item = false
    $chest_item.items.each {|item|
    item[1] += amount if item[0].id == inv_item
    already_had_item = true if item[0].id == inv_item ; }
    $chest_item.add_to_armors(inv_item, amount) if !already_had_item
    @bag_com_wind.refresh
    @main_com_wind.refresh
    @bag_com_wind.activate
  end
  #-----------------------------------------------------------------------------
  def withdraw_armors(amount)
    gsi = $chest_item.armors[@main_com_wind.index]
    gsi[1] -= amount
    $game_party.gain_item(gsi[0], amount)
    if gsi[1] < 1
      $chest_item.armors.delete_at(@main_com_wind.index)
      @main_com_wind.index = 0
    end
    @main_com_wind.refresh
    @bag_com_wind.refresh
    @main_com_wind.activate
  end
  #-----------------------------------------------------------------------------
  def update
    super
    update_help_text
    update_wind_type
  end
  #-----------------------------------------------------------------------------
  def update_help_text
    if @action_com_wind.active
      update_text_one
    elsif @action_com_wind_2.active
      update_text_two
    elsif @main_com_wind.active
      update_text_three
    end
  end
  #-----------------------------------------------------------------------------
  def update_text_one
    text = @action_com_wind.current_symbol == :deposit ?
    PC_Scene::Deposit_Info : PC_Scene::Withdraw_Info
    @help_window.set_text(text)
  end
  #-----------------------------------------------------------------------------
  def update_text_two
    case @action_com_wind_2.current_symbol
    when :cash  ;
      text = @action_com_wind.current_symbol == :deposit ?
      PC_Scene::Deposit_Cash : PC_Scene::Withdraw_Cash
    when :items ; text = PC_Scene::Withdraw_Info
      text = @action_com_wind.current_symbol == :deposit ?
      PC_Scene::Deposit_Items : PC_Scene::Withdraw_Items
    when :weapons ; text = PC_Scene::Withdraw_Info
      text = @action_com_wind.current_symbol == :deposit ?
      PC_Scene::Deposit_Weapons : PC_Scene::Withdraw_Weapons
    when :armors ; text = PC_Scene::Withdraw_Info
      text = @action_com_wind.current_symbol == :deposit ?
      PC_Scene::Deposit_Armors : PC_Scene::Withdraw_Armors
    end
    @help_window.set_text(text)
  end
  #-----------------------------------------------------------------------------
  def update_text_three
    case @action_com_wind_2.current_symbol
    #when :cash  ;
    when :items ; text = PC_Scene::Withdraw_Info
      text = $chest_item.items[@main_com_wind.index] == nil ?
      "" : $chest_item.items[@main_com_wind.index][0]
    when :weapons ; text = PC_Scene::Withdraw_Info
      text = $chest_item.weapons[@main_com_wind.index] == nil ?
      "" : $chest_item.weapons[@main_com_wind.index][0]
    when :armors ; text = PC_Scene::Withdraw_Info
      text = $chest_item.armors[@main_com_wind.index] == nil ?
      "" : $chest_item.armors[@main_com_wind.index][0]
    end
    return if text = ""
    @help_window.set_item(text)
  end
  #-----------------------------------------------------------------------------
  def update_wind_type
    if @main_com_wind.type != @action_com_wind_2.current_symbol
      @main_com_wind.change_type(@action_com_wind_2.current_symbol)
      @main_com_wind.refresh
    end
    if @bag_com_wind.type != @action_com_wind_2.current_symbol
      @bag_com_wind.change_type(@action_com_wind_2.current_symbol)
      @bag_com_wind.refresh
    end
  end
end

Теги: Скрипты,RPG Maker VX Ace