HACKEADO!
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Bestiario.!Menu de Monstros By: Pezinho

3 participantes

Ir para baixo

Bestiario.!Menu de Monstros  By: Pezinho Empty Bestiario.!Menu de Monstros By: Pezinho

Mensagem  Kyo Ter Mar 29, 2011 9:19 am

Introdução

Esse script cria um Bestiário, que é uma lista de todos os monstros já derrotados.

Características

• Mostra uma lista com todos monstros já derrotados
• Permite configurar como é mostrado o total de monstros derrotado: não mostrar, mostrar apenas o valor total, mostrar porcentagem.
• Permite configurar se o item derrubado pelo monstro será mostrado apenas se ele o derrubar ou se sempre será mostrado
• Permite configurar para mostrar o sprite animado do inimigo.

Screenshots

Spoiler:

Spoiler:

Como usar

Para instalá-lo, apenas cole o script acima do main.

Para abrir o bestário, use o comando de eventos chamar script e adicione nele a seguinte linha:
$scene = Scene_MonsterBook.new

ara que um monstro não apareça *nunca* na lista você deve criar um atributo na aba de sistemas chamado
"Não_Mostrar" e deixar a "resistência" do monstro contra aquele atributo em "A"

Outras configurações você encontra no próprio script

Demo

Não necessita de Demo

Script

Spoiler:

Postado Por:Pezinhoo.! XD e é sóoh isso *-* Flw.! ^-^
Kyo
Kyo
Administrador
Administrador

Mensagens : 37
Data de inscrição : 26/03/2011

https://historicomaker.forumeiros.net

Ir para o topo Ir para baixo

Bestiario.!Menu de Monstros  By: Pezinho Empty Re: Bestiario.!Menu de Monstros By: Pezinho

Mensagem  henry11 Ter Mar 29, 2011 2:34 pm

Belo sistema!Pena que não uso o XP!
henry11
henry11
Moderador
Moderador

Mensagens : 16
Data de inscrição : 26/03/2011
Idade : 25
Localização : Em algum lugar do mundo

http://rmvxbrasil.forumeiros.com/

Ir para o topo Ir para baixo

Bestiario.!Menu de Monstros  By: Pezinho Empty Re: Bestiario.!Menu de Monstros By: Pezinho

Mensagem  naruto10 Ter Mar 29, 2011 7:42 pm

Eu acho que tenho um bestiário para Vx aqui:

Código:
#===============================================================
# ● [VX] ◦ Livro dos Montros II ◦ □
#--------------------------------------------------------------
# Criado por Woratana [woratana@hotmail.com]
# Traduzido e Modificado por Toyota ( DJJ, MRM, RMB, RRM )
# Criado: 14/10/2009
# Version: 2.3
# Agradecimentos: Momomo :  pela versão XP
#--------------------------------------------------------------
# ** Atualizações
#--------------------------------------------------------------
# - Adiciona qualuqer monstro do database no livro.
# - Mostra o nome dos monstros depois da luta.
# - Todos os texto são editaveis
# - Pode deletar ou completar o Livro.
# - Pode escolher os monstros do livro.
# - Compara os monstros com o jogador.
# - Pode deixar switches de adicionamento ligadas e desligadas.
# - Pode esconder informações de alguns monstros secretos.
#--------------------------------------------------------------
# ** Como usar:
#--------------------------------------------------------------
# * Chame o script com:
#  $scene = Scene_MonsterBook.new

# * Complete o Livro dos Monstros com:
#  $game_system.set_monbook_complete

# * Delete todos os Monstros com:
#  $game_system.reset_monbook
#--------------------------------------------------------------
# * SMostre a informação do monstro com :
#  $game_system.monbook[id do monstro] = true

# * Esconda a informação do monstro como:
#  $game_system.monbook[id do monstro] = false

# * Mude 'id do monstro' para o  ID  do inimigo que você quer
# ** e.g. $game_system.monbook[10] = true
#===============================================================

module Wora_Monbook

#===============================================================
# ** [Início] - Configuração - Configure somente aqui
#-------------------------------------------------------------- 
  SHOW_IN_MENU = true # Mostrar o livro no Menu? (true ( s ) / false ( n ))
  MENU_COMMAND = 'Livro dos Monstros' # Nome do livro no menu.
  MENU_INDEX = 4 # Numero do lugar do livro no menu.
 
  TEXT_TITLE = 'Livro dos Montros'
  # Título do Livro (mostra no topo da tela).
  TEXT_FOUND = 'Encontrados: '
  # Texto dos inimigos que você achou.
  TEXT_COMPLETED = 'Completado: '
  # Texto da porcetagem do livro.
 
  TEXT_DOT = '.'
  # Texto do ponto que mostra o inimigo ('.' que faz '2.' tbm pode '-' que faz '2-' )
 
  COMPARE_STATUS = true
  # Usar Sistema de Comparação? Ele compara os status do monstro com o
  # personagem de maior nivel. Mostra VERDE se o inimigo for menor.
  # Mostra VERMELHO e CINZA se for maior (true(sim) / false(não))
 
  NO_RECORD_SWITCH = 10
# Se essa switch estiver ON ( ligada ) o monstro só será adicionadono livro
#se o personagem  derrotar o monstro.
 
  NO_DATA_MONSTER = []
  # Lista de ID de monstros que você quer que não seja mostrado no livro.
  # Exemplo: [1, 3, 5]  os monstros de ID 1, 3, e 5 não estarão no livro.
#===============================================================
end

#===============================================================
# ** [Alias] Game_System
#--------------------------------------------------------------
class Game_System
  attr_accessor :monbook
  alias :wora_monbook_gamsys_ini :initialize
  def initialize
    wora_monbook_gamsys_ini
    create_monbook
  end
 
  def create_monbook
    @monbook ||= Array.new($data_enemies.size) {false}
  end
 
  def set_monbook_complete
    @monbook = Array.new($data_enemies.size) {true}
    @monbook[0] = false
  end
 
  def reset_monbook
    @monbook = Array.new($data_enemies.size) {false}
  end
end

#===============================================================
# ** [Alias] Game_Troop
#--------------------------------------------------------------
class Game_Troop < Game_Unit
  alias :wora_monbook_gamtroop_setup :setup
  def setup(*args)
    wora_monbook_gamtroop_setup(*args)
    $game_system.create_monbook
    unless $game_switches[Wora_Monbook::NO_RECORD_SWITCH]
      @enemies.each {|e| $game_system.monbook[e.enemy_id] = true }
    end
  end
end

#===============================================================
# ** Ajuda para o Livro
#--------------------------------------------------------------
class Window_MonsterBHelp < Window_Base
  include Wora_Monbook
 
  def initialize
    super(0, 0, 544, WLH + 32)
    # Linha do título.
    contents.font.color = system_color
    contents.draw_text(0, 0, contents.width, WLH, TEXT_TITLE)
    # Calcula a porcetagem completada.
    found_count = 0
    $game_system.monbook.each {|e| found_count += 1 if e }
    percent_count = (found_count * 100) / ($data_enemies.size - 1)
    # Coleta Switches e variaveis de um monstros.
    found_text = found_count.to_s + '/' + ($data_enemies.size - 1).to_s
    percent_text = percent_count.to_s + '%'
    mid_text = ' | '
    right_text = TEXT_FOUND + found_text + mid_text + TEXT_COMPLETED +
  percent_text
    # Calcula o tamanho de texto
    found_t_width = contents.text_size(TEXT_FOUND).width
    found_width = contents.text_size(found_text).width
    percent_t_width = contents.text_size(TEXT_COMPLETED).width
    mid_width = contents.text_size(mid_text).width
    right_width = contents.text_size(right_text).width
    # Escreve o nome de monstro e porcetagem.
    contents.font.color = normal_color
    contents.draw_text(contents.width - right_width, 0, contents.width, WLH,
  TEXT_FOUND)
    contents.draw_text(contents.width - right_width + found_t_width +
  found_width, 0, contents.width, WLH, mid_text + TEXT_COMPLETED)
    contents.font.color = crisis_color
    contents.draw_text(contents.width - right_width + found_t_width, 0,
  contents.width, WLH, found_text)
    contents.draw_text(contents.width - right_width + found_t_width +
  found_width + mid_width + percent_t_width, 0, contents.width, WLH,
  percent_text)
  end
end

#===============================================================
# ** Window_MonsterBDetail
#--------------------------------------------------------------
class Window_MonsterBDetail < Window_Base
  def initialize(window_temp)
    super(window_temp.x, window_temp.y, window_temp.width, window_temp.height)
    self.opacity = 0
    @win_image = Window_Base.new(self.x, self.y, self.width, self.height)
    self.z = @win_image.z + 1
    @last_enemy = 0
  end
 
  def visible=(bool)
    super
    @win_image.visible = bool
  end
 
  def dispose
    @win_image.dispose
    super
  end
 
  def write_detail(enemy_id)
    return if @last_enemy == enemy_id
    contents.clear
    @win_image.contents.clear
    @last_enemy = enemy_id
    data = $data_enemies[enemy_id]
    # Desenha grafico de inimigo.
    bitmap = Cache.battler(data.battler_name, data.battler_hue)
    bw = bitmap.width < 160 ? (160 - bitmap.width) / 2 : 0
    bh = contents.height - bitmap.height
    @win_image.contents.blt(bw, bh, bitmap, bitmap.rect)
    bitmap.dispose
    # Escrvee Nomes
    contents.font.color = normal_color
    contents.draw_text(0, 0, contents.width, WLH,
  data.id.to_s + Wora_Monbook::TEXT_DOT + ' ' + data.name)
    # Escreve Status.
    hpx = 120
    draw_enemy_stat(data, contents.width - (hpx * 2) - 32, 0, hpx, 'hp')
    draw_enemy_stat(data, contents.width - hpx, 0, hpx, 'mp')
    draw_enemy_stat(data, contents.width - (hpx * 2) - 32, WLH * 2, hpx, 'atk')
    draw_enemy_stat(data, contents.width - hpx, WLH * 2, hpx, 'def')
    draw_enemy_stat(data, contents.width - (hpx * 2) - 32, WLH * 3, hpx, 'spi')
    draw_enemy_stat(data, contents.width - hpx, WLH * 3, hpx, 'agi')
    draw_enemy_stat(data, contents.width - (hpx * 2) - 32, WLH * 4, hpx, 'hit')
    draw_enemy_stat(data, contents.width - hpx, WLH * 4, hpx, 'eva')
    draw_enemy_stat(data, contents.width - (hpx * 2) - 32, WLH * 6, hpx, 'exp')
    draw_enemy_stat(data, contents.width - hpx, WLH * 6, hpx, 'gold')
    rect = Rect.new(contents.width - (hpx * 2) - 8, (WLH * 8) - 8, 216,
  (WLH * 4) + 16)
    contents.fill_rect(rect, Color.new(0,0,0,140))
    lsize = 2 # Tamanho da linha
    lcolor = Color.new(255,255,255,160) # Cor da linha
    contents.fill_rect(rect.x, rect.y, lsize, rect.height, lcolor)
    contents.fill_rect(rect.x, rect.y, rect.width, lsize, lcolor)
    contents.fill_rect(rect.x + rect.width - lsize, rect.y, lsize,
  rect.height, lcolor)
    contents.fill_rect(rect.x, rect.y + rect.height - lsize, rect.width,
  lsize, lcolor)
    contents.font.color = system_color
    contents.draw_text(contents.width - (hpx * 2), WLH * 8, 200, WLH,
  'Item')
    draw_enemy_drop(data, 1, contents.width - (hpx * 2), WLH * 9)
    contents.font.color = system_color
    contents.draw_text(contents.width - (hpx * 2), WLH * 10, 200, WLH,
  'Item')
    draw_enemy_drop(data, 2, contents.width - (hpx * 2), WLH * 11)
  end

  def draw_enemy_stat(actor, x, y, width, stat)
    color1 = system_color
    color2 = normal_color
    slash = false
    # Procura o Nível mais mais alto.
    if Wora_Monbook::COMPARE_STATUS
      hactor = ($game_party.members.sort {|a,b| a.level <=> b.level })
      hactor = hactor[hactor.size - 1]
    end
    case stat
    when 'hp'
      vocab = Vocab::hp
      number = actor.maxhp
      hnumber = hactor.maxhp if Wora_Monbook::COMPARE_STATUS
      slash = true
    when 'mp'
      vocab = Vocab::mp
      number = actor.maxmp
      hnumber = hactor.maxmp if Wora_Monbook::COMPARE_STATUS
      slash = true
    when 'atq'
      vocab = Vocab::atk
      number = actor.atk
      hnumber = hactor.atk if Wora_Monbook::COMPARE_STATUS
    when 'def'
      vocab = Vocab::def
      number = actor.def
      hnumber = hactor.def if Wora_Monbook::COMPARE_STATUS
    when 'spi'
      vocab = Vocab::spi
      number = actor.spi
      hnumber = hactor.spi if Wora_Monbook::COMPARE_STATUS
    when 'agi'
      vocab = Vocab::agi
      number = actor.agi
      hnumber = hactor.agi if Wora_Monbook::COMPARE_STATUS
    when 'hit'
      vocab ='HIT'
      number = actor.hit
      hnumber = hactor.hit if Wora_Monbook::COMPARE_STATUS
    when 'EVA'
      vocab = 'ESQ'
      number = actor.eva
      hnumber = hactor.eva if Wora_Monbook::COMPARE_STATUS
    when 'EXP'
      vocab = 'EXP'
      number = actor.exp
      color2 = crisis_color
    when 'gold'
      vocab = 'Ouro'
      number = actor.gold
      color2 = crisis_color
    end
    if Wora_Monbook::COMPARE_STATUS and !hnumber.nil?
      if hnumber > number # Higher
        color2 = power_up_color
      elsif hnumber < number # Less
        color2 = power_down_color
      elsif hnumber == number # Equal
        color2 = normal_color
      end
    end
    contents.font.color = color1
    contents.draw_text(x, y, 50, WLH, vocab)
    xr = x + width
    contents.font.color = color2
    if slash
      contents.draw_text(xr - 95, y, 40, WLH, number, 2)
      contents.draw_text(xr - 55, y, 11, WLH, '/', 2)
    end
    w_ava = slash ? 40 : 80
    contents.draw_text(xr - w_ava, y, w_ava, WLH, number, 2)
  end
 
  def draw_enemy_drop(actor, drop_id, x, y)
    drop = eval('actor.drop_item' + drop_id.to_s)
    if drop.kind.zero?
      contents.font.color = normal_color
      contents.draw_text(x, y, 200, WLH, "  ---------")
    else
      case drop.kind
      when 1; item = $data_items[drop.item_id]
      when 2; item = $data_weapons[drop.weapon_id]
      when 3; item = $data_armors[drop.armor_id]
      end
      draw_item_name(item, x, y)
    end
  end
end
#===============================================================
# ** Scene_MonsterBook
#--------------------------------------------------------------
class Scene_MonsterBook < Scene_Base
  def initialize(from_menu = false)
    @from_menu = from_menu
  end
 
  def start
    super
    create_menu_background
    $game_system.create_monbook
    @window_help = Window_MonsterBHelp.new
    # Cria a lista
    monlist = []
    $game_system.monbook.each_index do |i|
      next if i == 0 # Se o index em $data_enemies não existe
      # Se o jogador achar o monstro.
      if $game_system.monbook[i] and
    !Wora_Monbook::NO_DATA_MONSTER.include?(i)
        montext = i.to_s + Wora_Monbook::TEXT_DOT + ' ' + $data_enemies[i].name
      else # Se o jogador não achar.
        montext = i.to_s + Wora_Monbook::TEXT_DOT
      end
      monlist << montext
    end
    @window_monlist = Window_Command.new(544, monlist, 2)
    @window_monlist.y = @window_help.height
    @window_monlist.height = Graphics.height - @window_help.height
    @window_monlist.active = true
    @window_mondetail = Window_MonsterBDetail.new(@window_monlist)
    @window_mondetail.visible = false
  end
 
  def update
    super
    if @window_monlist.active
      @window_monlist.update
      if Input.trigger?(Input::C)
        # Ver detalhes de monstro.
        if $game_system.monbook[@window_monlist.index + 1] and
        !Wora_Monbook::NO_DATA_MONSTER.include?(@window_monlist.index + 1)
          Sound.play_decision
          @window_monlist.active = false
          @window_monlist.visible = false
          @window_mondetail.active = true
          @window_mondetail.visible = true
          @window_mondetail.write_detail(@window_monlist.index + 1)
        else
          Sound.play_cancel
        end
      elsif Input.trigger?(Input::B)
        Sound.play_cancel
        # Retornar
        $scene = @from_menu ? Scene_Menu.new(Wora_Monbook::MENU_INDEX) :
      Scene_Map.new
      end
    elsif @window_mondetail.active
      if Input.trigger?(Input::B)
        Sound.play_cancel
        @window_monlist.active = true
        @window_monlist.visible = true
        @window_mondetail.active = false
        @window_mondetail.visible = false
      end
    end
  end
 
  def terminate
    super
    dispose_menu_background
    @window_help.dispose
    @window_monlist.dispose
    @window_mondetail.dispose
  end
end

#=============================================================
# * Window_Command Insert Tool
#=============================================================
class Window_Command < Window_Selectable
  unless method_defined? :wora_cominstool_wincom_ini
    alias wora_cominstool_wincom_ini initialize
    alias wora_cominstool_wincom_drawitem draw_item
  end
 
  #------------------------------------
  # * [Alias] Initialize
  #------------------------------------
  def initialize(*args)
    @disabled_commands = [] # Array to keep track of disabled commands
    wora_cominstool_wincom_ini(*args)
  end
 
  #------------------------------------
  # * [Alias] Draw_Item
  #------------------------------------
  def draw_item(*args)
    wora_cominstool_wincom_drawitem(*args)
    # Set array's index to 1 if command is disabled
    @disabled_commands[args[0]] = args[1].nil? || args[1] ? nil : true
  end
 
  #------------------------------------
  # * Insert Command
  #------------------------------------
  def ins_command(index, text)
    @commands.insert(index, text) # Insert new commands
    @disabled_commands.insert(index, nil)
    # Set new height for window
    old_disabled_commands = @disabled_commands.dup
    self.height = (@commands.size + @column_max - 1) / @column_max * WLH + 32
    @item_max = @commands.size # Update @item_max to make refresh works correctly
    create_contents            # Create new content because window's size changed
    refresh                    # Redraw window's contents
    old_disabled_commands.each_index do |i|
      if !old_disabled_commands[i].nil?
        draw_item(i, false)    # Draw commands that disabled before
      end
    end
  end
 
  #------------------------------------
  # * Add Command
  #------------------------------------
  def add_command(text)
    ins_command(@commands.size, text) # Add new command to new index
  end
end

#=============================================================
# * Add command linked to Monster Book in Menu
#=============================================================
if Wora_Monbook::SHOW_IN_MENU
  class Scene_Menu < Scene_Base 
    #--------------------------------------------------------------------------
    # * Sort New Command(s)
    #--------------------------------------------------------------------------
    def wsort_newcommand
      @wsorted_command ||= [] # Array to collect sorted commands
      wnewcommand = @wnewcommand - @wsorted_command # Remove sorted commands
      wnewcommand.sort.each {|i| @menu_index += 1 if @menu_index >= i }
      @command_window.index = @menu_index # Set window's index to new index
      @wsorted_command = @wsorted_command + @wnewcommand # Add sorted commands
    end

    #--------------------------------------------------------------------------
    # * [Alias] Create Command Window
    #--------------------------------------------------------------------------
    alias wora_menucomorg_scemenu_crecomwin create_command_window
    def create_command_window(*args)
      wora_menucomorg_scemenu_crecomwin(*args)
      # Insert new command
      @command_window.ins_command(Wora_Monbook::MENU_INDEX,
    Wora_Monbook::MENU_COMMAND)
      # Set index to correct one if @menu_index is after/equal to new command
      @wnewcommand ||= []
      @wnewcommand << Wora_Monbook::MENU_INDEX
      wsort_newcommand
    end

    #--------------------------------------------------------------------------
    # * [Alias] Update Command Selection
    #--------------------------------------------------------------------------
    alias wora_menucomorg_scemenu_updcomsel update_command_selection
    def update_command_selection(*args)
      @menucomorpg_change = false
      # If player choose new command
      if Input.trigger?(Input::C) and @command_window.index ==
      Wora_Monbook::MENU_INDEX
        Sound.play_decision
        $scene = Scene_MonsterBook.new(true)
      else # If player choose index after new command
        if Input.trigger?(Input::C) and @command_window.index >
        Wora_Monbook::MENU_INDEX
          @command_window.index -= 1 # Decrease index to make old update works
          @menucomorpg_change = true
        end
        wora_menucomorg_scemenu_updcomsel(*args)
      end
      @command_window.index += 1 if @menucomorpg_change # Increase index back
    end
   
    #--------------------------------------------------------------------------
    # * [Alias] Update Actor Selection
    #--------------------------------------------------------------------------
    alias wora_menucomorg_scemenu_updactsel update_actor_selection
    def update_actor_selection(*args)
      @menucomorpg_change = false
      # If player choose index after new command
      if Input.trigger?(Input::C) and @command_window.index >
      Wora_Monbook::MENU_INDEX
        @command_window.index -= 1 # Decrease index to make old update works
        @menucomorpg_change = true
      end
      wora_menucomorg_scemenu_updactsel(*args)
      @command_window.index += 1 if @menucomorpg_change # Increase index back
    end
  end
end
naruto10
naruto10
Membro Novato
Membro Novato

Mensagens : 7
Data de inscrição : 26/03/2011

Ir para o topo Ir para baixo

Bestiario.!Menu de Monstros  By: Pezinho Empty Re: Bestiario.!Menu de Monstros By: Pezinho

Mensagem  Conteúdo patrocinado


Conteúdo patrocinado


Ir para o topo Ir para baixo

Ir para o topo


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