Arena RPG Maker
Olá, visitante!
Seja bem-vindo ao fórum Arena RPG Maker, caso queira aprender sobre criação de jogos, está no fórum certo. Esperamos que possa aprender tanto quanto possa nos ensinar aqui.

Atenciosamente,
Equipe Arena RPG Maker.
Arena RPG Maker
Olá, visitante!
Seja bem-vindo ao fórum Arena RPG Maker, caso queira aprender sobre criação de jogos, está no fórum certo. Esperamos que possa aprender tanto quanto possa nos ensinar aqui.

Atenciosamente,
Equipe Arena RPG Maker.
Arena RPG Maker

Estamos de volta o/ ... Ou não.Eu amo a -Dark
Doações para o fórum abertas, clique aqui e saiba mais.
Últimos assuntos
» Ainda temos gente aqui?
Classificar Inventario EmptyQui 25 Nov 2021, 14:04 por Halt

» [Dúvida] Como tirar a porcentagem de esquiva
Classificar Inventario EmptySex 19 Nov 2021, 17:14 por Halt

» Pokémon Genesis Online! (PGO)
Classificar Inventario EmptyQua 05 Jul 2017, 18:08 por Lexar

» Tileset Converter to MV
Classificar Inventario EmptySex 12 maio 2017, 14:07 por Douggi

» Pack Resources, Sprites e etc
Classificar Inventario EmptyQua 23 Dez 2015, 12:30 por raydengv

» Download RPG Maker 2003 + RTP em português
Classificar Inventario EmptyTer 22 Dez 2015, 11:14 por ::KimMax::

» Fantasy Art Online
Classificar Inventario EmptyDom 18 Out 2015, 18:42 por daviih123

» Você vai ter medo do Nerve gear?
Classificar Inventario EmptySáb 25 Jul 2015, 17:02 por Kirito-kun

» O Barato é louco
Classificar Inventario EmptySáb 27 Jun 2015, 16:26 por Halt

» Download RPG Maker 2000 + RTP em português
Classificar Inventario EmptyQui 21 maio 2015, 20:28 por Wismael


Você não está conectado. Conecte-se ou registre-se

Ver o tópico anterior Ver o tópico seguinte Ir para baixo  Mensagem [Página 1 de 1]

1Classificar Inventario Empty Classificar Inventario Dom 07 Out 2012, 00:41

Carlos

Carlos
Administrador
Administrador
Introdução:

Esse Script permite que você possa organizar o inventario em até 15 Classes.

Screenshots:

Spoiler:

Como usar:

Cole acima do main

Instruções para configurar no começo do script.

Script:

Código:
#===============================================================================
# Organizar Inventário
# por XRXS
#===============================================================================
# Este script permite que você organize o inventário, separando os
# itens por categorias.
# Para criar seu próprio estilo de organização você deve ir até o
# modulo XRXS_MP2_Fixed_Variable.
# Você define o nome de cada categoria em "KIND_NAMES",
# e em "KIND_KINDS" você define o tipo de item que cada categoria mostra.
#===============================================================================

#==============================================================================
# XRXS_MP2_Fixed_Variable
#==============================================================================
module XRXS_MP2_Fixed_Variable
  #Definição dos nomes dos comandos de menu.
  KIND_NAMES = ["Itens", "Armas", "Escudos ", "Elmos","Armaduras", "Acessórios"]
  # Tipos de itens exibidos em cada função
  KIND_KINDS = [0, 1, 3, 4, 5, 6]
  #nil = todos os itens (inv
  #0 = Itens
  #1 = Armas
  #2 = Equipamentos de Defesa de todos os tipos
  #3 = Escudos
  #4 = Elmos
  #5 = Armaduras
  #6 = Acessórios
  #7 = Itens que não afetam nenhum alvo
  #8 = Itens que só podem ser usados em batalha
  #9 = Itens que só podem ser usados no menu
  #10= Itens que não podem ser usados
  #11= Itens que ao ser usados chamam eventos comuns
  #12= Itens de preço zero
  #13= Itens de aumento de atributo
  #14= Itens de cura
  #15= Itens com elemento
 
  # IMPORTANTE:
  # A ordem que você define em "KIND_KINDS" deve ser a mesma ordem
  # do tipo do item que vc definiu em "KIND_NAMES"
  # então se o 3º tipo você definiu como "Acessórios" por exemplo.
  # o 3º Valor em "KIND_KINDS" deve ser 6.
 
end

#==============================================================================
# Window_Item
#==============================================================================
class Window_Item < Window_Selectable
  #--------------------------------------------------------------------------
  include XRXS_MP2_Fixed_Variable
  #--------------------------------------------------------------------------
  alias xrxs_mp2_initialize initialize
  alias xrxs_mp2_refresh refresh
  #--------------------------------------------------------------------------
  def initialize
    xrxs_mp2_initialize
    if not $scene.is_a?(Scene_Battle)
      self.y += 64
      self.height -= 64
    end
    @itemkind = KIND_KINDS[0]
    refresh
  end
  #--------------------------------------------------------------------------
  def refresh
    if @itemkind == nil
      xrxs_mp2_refresh
      return
    end
      if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    @item_max = data_sdgs(@itemkind)
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_itemkind_index(itemkind_index)
    @itemkind = KIND_KINDS[itemkind_index]
    refresh
  end
  #--------------------------------------------------------------------------
  def data_sdgs(itemkind)
    @data = []
    if $scene.is_a?(Scene_Battle)
      get_data(0, false)
    elsif itemkind.is_a?(Numeric) or itemkind.nil?
      get_data(itemkind, false)
    elsif itemkind.is_a?(Array)
      for i in 0...itemkind.size
        get_data(itemkind[i], false)
      end
    end
    return @data.size
  end
  #--------------------------------------------------------------------------
  def get_data(itemkind, refresh = false)
    case itemkind
    when nil
      set_own_item_data
      set_own_weapon_data
      set_own_armor_data
    when 0 
      set_own_item_data
    when 1 
      set_own_weapon_data
    when 2 
      set_own_armor_data
    when 3
      set_own_armor_shield_data
    when 4
      set_own_armor_helm_data
    when 5
      set_own_armor_mail_data
    when 6
      set_own_armor_accessory_data
    when 7
      set_own_item_noscope_data
    when 8
      set_own_item_battleonly_data
    when 9
      set_own_item_menuonly_data
    when 10
      set_own_item_unusable_data
    when 11
      set_own_item_commonevent_data
    when 12
      set_own_item_zeroprice_data
    when 13
      set_own_item_parameterup_data
    when 14
      set_own_item_recovers_data
    when 15
      set_own_item_elements_data
    when -3
      last_data = @data.dup
      @data.clear
      set_own_armor_shield_data
      @data = last_data - @data
    when -4
      last_data = @data.dup
      @data.clear
      set_own_armor_helm_data
      @data = last_data - @data
    when -5
      last_data = @data.dup
      @data.clear
      set_own_armor_mail_data
      @data = last_data - @data
    when -6
      last_data = @data.dup
      @data.clear
      set_own_armor_accessory_data
      @data = last_data - @data
    when -7
      last_data = @data.dup
      @data.clear
      set_own_item_noscope_data
      @data = last_data - @data
    when -8
      last_data = @data.dup
      @data.clear
      set_own_item_battleonly_data
      @data = last_data - @data
    when -9
      last_data = @data.dup
      @data.clear
      set_own_item_menuonly_data
      @data = last_data - @data
    when -10
      last_data = @data.dup
      @data.clear
      set_own_item_unusable_data
      @data = last_data - @data
    when -11
      last_data = @data.dup
      @data.clear
      set_own_item_commonevent_data
      @data = last_data - @data
    when -12
      last_data = @data.dup
      @data.clear
      set_own_item_zeroprice_data
      @data = last_data - @data
    when -13
      last_data = @data.dup
      @data.clear
      set_own_item_parameterup_data
      @data = last_data - @data
    when -14
      last_data = @data.dup
      @data.clear
      set_own_item_recovers_data
      @data = last_data - @data
    when -15
      last_data = @data.dup
      @data.clear
      set_own_item_elements_data
      @data = last_data - @data
    else
      if refresh
        xrxs_mp2_refresh
      else
        @data = []
      end
    end
    return
  end
  #--------------------------------------------------------------------------
  def set_own_item_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        @data.push($data_items[i])
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_weapon_data
    for i in 1...$data_weapons.size
      if $game_party.weapon_number(i) > 0
        @data.push($data_weapons[i])
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_armor_data
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        @data.push($data_armors[i])
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_armor_shield_data
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        if $data_armors[i].kind == 0 and !@data.include?($data_armors[i])
          @data.push($data_armors[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_armor_helm_data
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        if $data_armors[i].kind == 1 and !@data.include?($data_armors[i])
          @data.push($data_armors[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_armor_mail_data
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        if $data_armors[i].kind == 2 and !@data.include?($data_armors[i])
          @data.push($data_armors[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_armor_accessory_data
    for i in 1...$data_armors.size
      if $game_party.armor_number(i) > 0
        if $data_armors[i].kind == 3 and !@data.include?($data_armors[i])
          @data.push($data_armors[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_noscope_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].scope == 0 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_battleonly_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].occasion == 1 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_menuonly_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].occasion == 2 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_unusable_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].occasion == 3 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_commonevent_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].common_event_id > 0 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_zeroprice_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].price == 0 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_parameterup_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].parameter_type > 0 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def set_own_item_recovers_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if ($data_items[i].recover_hp_rate > 0 or
          $data_items[i].recover_hp > 0 or
          $data_items[i].recover_sp_rate > 0 or
          $data_items[i].recover_sp > 0 or
          $data_items[i].minus_state_set.size > 0) and
          !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end

  end
  #--------------------------------------------------------------------------
  def set_own_item_elements_data
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if $data_items[i].element_set.size > 0 and !@data.include?($data_items[i])
          @data.push($data_items[i])
        end
      end
    end
  end
end

#==============================================================================
# Window_Itemkind
#==============================================================================
class Window_Itemkind < Window_Selectable
  #--------------------------------------------------------------------------
  include XRXS_MP2_Fixed_Variable
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    @commands = KIND_NAMES
    @item_max = KIND_NAMES.size
    @column_max = KIND_NAMES.size
    @disabled = []
    for i in 0...@item_max
      @disabled[i] = false
    end
    self.active = true
    self.index = 0
    refresh
  end
  #--------------------------------------------------------------------------
  def disable(index)
    @disabled[index] = true
    refresh
  end
  #--------------------------------------------------------------------------
  def disabled?(index)
    return @disabled[index]
  end
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...KIND_NAMES.size
      draw_item(i, (@disabled[i] ? disabled_color : normal_color))
    end
  end
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    x = 304 + (index - KIND_NAMES.size/2.0) * 600/KIND_NAMES.size
    rect = Rect.new(x, 0, 600/KIND_NAMES.size, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], 1)
  end
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if index != -1
      return unless self.active
      x = 304 + (index - KIND_NAMES.size/2.0) * 600/KIND_NAMES.size
      self.cursor_rect.set(x, 0, 600/KIND_NAMES.size, 32)
      update_help
    end
  end
  #--------------------------------------------------------------------------
  def update_help
    return if @help_window.nil?
    @help_window.set_text(KIND_NAMES[self.index] + " - Selecione o item desejado.")
  end
end

#==============================================================================
# Scene_Item
#==============================================================================
class Scene_Item
  #--------------------------------------------------------------------------
  include XRXS_MP2_Fixed_Variable
  #--------------------------------------------------------------------------
  alias xrxs_mp2_update update
  alias xrxs_mp2_update_item update_item
  #--------------------------------------------------------------------------
  def main
    @help_window = Window_Help.new
    @item_window = Window_Item.new
    @kind_window = Window_Itemkind.new
    @item_window.help_window = @help_window
    @kind_window.help_window = @help_window
    for i in 0...KIND_NAMES.size
      @kind_window.disable(i) if @item_window.data_sdgs(KIND_KINDS[i]) == 0
    end
    @target_window = Window_Target.new
    @target_window.visible = false
    @target_window.active = false
    @kind_window.active = true
    @item_window.active = false
    @item_window.index = -1
    @now_itemkind = nil
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @help_window.dispose
    @item_window.dispose
    @target_window.dispose   
    @kind_window.dispose
  end
  #--------------------------------------------------------------------------
  def update
    xrxs_mp2_update
    if @now_itemkind != @kind_window.index
      @item_window.set_itemkind_index(@kind_window.index)
      @now_itemkind = @kind_window.index
    end
    @kind_window.update
    if @kind_window.active
      update_kind
      return
    end
  end
  #--------------------------------------------------------------------------
  def update_item
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @kind_window.active = true
      @item_window.active = false
      @item_window.index = -1
      Input.update
      return
    end
    xrxs_mp2_update_item
  end
  #--------------------------------------------------------------------------
  def update_kind
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(0)
      return
    end
    if Input.trigger?(Input::C)
      if @kind_window.disabled?(@kind_window.index)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      @item_window.active = true
      @item_window.index = 0
      @kind_window.active = false
      return
    end
  end
end

Créditos:
Spoiler:

https://arenarpgmaker.forumeiros.com

Ver o tópico anterior Ver o tópico seguinte Ir para o topo  Mensagem [Página 1 de 1]

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