RPG maker VX


Unirse al foro, es rápido y fácil

RPG maker VX
RPG maker VX
¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.
Últimos temas
» Script de menu
por maxi Jue 04 Dic 2014, 1:44 pm

» Ayuda intro animado!!!
por maxi Miér 03 Dic 2014, 9:41 pm

» ayuda con este engin
por maxi Miér 03 Dic 2014, 8:42 am

» Hud de Vida 100% Personalizable - Engine Sencillo! Sin Scripts :)
por davidaikago Jue 20 Nov 2014, 10:58 am

» Ultimate parallax control by:GDS [ace]
por arellano Miér 08 Oct 2014, 8:28 pm

» Script Touhou (animated) Map name (v1.4)
por davidaikago Miér 08 Oct 2014, 2:09 pm

» tutorial puerta nueva
por davidaikago Miér 08 Oct 2014, 9:08 am

» cámara de fotos
por davidaikago Miér 08 Oct 2014, 9:05 am

» Imperial Action System II Demo
por davidaikago Miér 08 Oct 2014, 8:47 am

» VE Batalla animada [ACE]
por FhierusIV Jue 18 Sep 2014, 10:57 am

» Nuevo Reglamento del Foro [Vigente desde Septiembre 2014]
por maxi Miér 17 Sep 2014, 8:37 am

» MOG|Animated Title
por Souta21 Mar 09 Sep 2014, 7:24 pm

» Tutorial Engine - Cambiar Character al Equipar Objeto
por maxi Lun 21 Jul 2014, 10:19 am

» Script de climas
por gambasoxd Sáb 19 Jul 2014, 8:58 am

» Script de contraseña(codigo) para abrir un cofre
por rpgame Jue 03 Jul 2014, 6:03 pm

¿Quién está en línea?
En total hay 1 usuario en línea: 0 Registrados, 0 Ocultos y 1 Invitado

Ninguno

[ Ver toda la lista ]


El record de usuarios en línea fue de 117 durante el Mar 09 Ago 2011, 3:39 pm

Orfebreria (KGC_COMPOSEITEM) [Resubido]

2 participantes

Ir abajo

Orfebreria (KGC_COMPOSEITEM) [Resubido] Empty Orfebreria (KGC_COMPOSEITEM) [Resubido]

Mensaje por Arquebuss Dom 25 Sep 2011, 5:08 pm

*Edito: ante el cierre del servidor de varga y descarga en el que subi el archivo edito el aporte para ingresar el codigo del Script
Bueno, hola compañeros del foro, pues me habia perdido ya hace un rato, pero aca regreso para compartir con ustedes un script que me parece no es muy conocido, se trata de KGC_COMPOSEITEM, que en pocas palabras es una orfebreria del FF IX.

Para los que no sepan para que servia dicha orfebreria, es para crear objetos apartir de otros objetos, me he tomado la molestia de documentarlo en español, y de hacer una demo, con algunos objetos, espero les guste y les sea de mucha utilidad, pues a mi parecer la orfebreria habre un mundo de posibilidades.

NOTA: Si tienen alguna duda del scriptt comentenla y si necesitan una guia para el manejo de la orfebreria (No creo, pues es muy simple) tambien comenten.

[Tienes que estar registrado y conectado para ver esa imagen]
y aca el link de la demo:
/*Link Caido*/

INSTRUCCIONES: Pegar antes del main
Forma de uso: Documentado por mi en español dentro de el Script.

Código:

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/    ?                Synthesize Items - KGC_ComposeItem              ? VX ?
#_/    ?                    Last Update: 2008/08/01                          ?
#_/    ?                  Translation by Mr. Anonymous                        ?
#_/    ?                Special credit to Moon for Testing                    ?
#_/-----------------------------------------------------------------------------
#_/  Install: Insert below KGC_UsableEquipment
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#          TEXTOS DE AYUDA Y USO DEL SCRIPT: ARQUEBUSS
#==============================================================================#
#                            ? Customization ?                                #
#==============================================================================#

module KGC
  module ComposeItem
  # Interruptor para activar la orfebreria
    COMPOSE_CALL_SWITCH = 10
   
  #Pasos para usar el Script en el evento
  #1.-Activar el interruptor del Script (por default es el 10)
  #2.-Insertar una tienda en el evento con los objetos que
  #  deseas crear (Solo los objetos ya creados "Organix")
  #3.-Desactivar el interruptor del Script (es el mismo que activaste al principio)
  #
  #NOTA: Los objetos que pongas en la tienda/orfebreria, son los unicos que se
  #pueden vender en esa tienda (Supongamos que solo pongo la organix), entonces
  #aunque tenga todos los objetos que pueden ser creados, solo podre comprar la
  #"organix" en esa tienda.
  #
  #Pasos para agregar los componentes del objeto final Ejemplo:"Organix"
  #
  # Los objetos que se pueden crear pueden ser 3 Objetos, Armas, Protectores
  #          RECIPE_ITEM  = []  # Objetos (Posiones, pergaminos, etc)
  #          RECIPE_WEAPON = []  # Armas (dagas, espadas, lanzas)
  #          RECIPE_ARMOR  = []  # Protectores (escudos, cascos, accesorios etc)
  #
  # Ahora la estructura para crear un objeto es esta;
  #  RECIPE_TIPO[ID] = [Costo, "Tipo:ID , cantidad"]
  #
  #  Glosario
  #  Costo:    La cantidad de dinero que se paga por hacer el objeto
  #  TIPO:    Se muestra en la parte superior (RECIPE_ITEM RECIPE_WEAPOM RECIPE ARMOR)
  #  Tipo:    (I = Objetos  W = Armas  A = Protectores)
  #  ID:      El numero del identificador en la base de datos (Organix = 03)
  #  Cantidad: La cantidad de x objetos que necesitas para crear el objeto
  #   
  #    NOTA: Si se omite la cantidad o se pone 0, el objeto que es necesario no
  #          sera eliminado en el momento de crear el objeto, sin embargo si
  #          es necesario tenerlo para poder crear el objeto.
  # 
  #  ¡¡IMPORTANTE!! NO BORRES LAS SIGUIENTES 3 LINEAS, DE LO CONTRARIO SE DESCOMPONE EL SCRIPT
  RECIPE_ITEM  = []  # Item
  RECIPE_WEAPON = []  # Weapon
  RECIPE_ARMOR  = []  # Armor
 
  #Es momento de crear algunos objetos al demo.
  #
  #NOTA: Se ruega tener orden al momento de hacer los objetos de orfebre
  #
  #Este es un ejemplo de como queda
  # Objeto[8]        = [Costo extra 0, "Ultrapocion x1" , "Eter x1"
  # RECIPE_ITEM[8]  = [0, "I:1,1", "I:2,1"]
 
  #Elixir          = Ultrapocion x1 + Eter x1
  #RECIPE_ITEM[8]  = [0, "I:1,1", "I:2,1"]
 
  #Sable mariposa  = 300G + Par de Dagas x1 + Matamagos x1
  #RECIPE_WEAPON[3] = [300, "W:1,1","W:2,1"]
 
  #Orgamix        = 700G + Matamagos x2
  #RECIPE_WEAPON[4] = [700, "W:2,2"]
 
  #Botas de Caza  = 300G + Gorra de Cuero x1 + Traje de Cuero x1
  #RECIPE_ARMOR[3] = [300, "A:1,1", "A:2,1"]
 
  #Capa Algodon    = 1000G + Manilla x1 + Sombrero x1
  #RECIPE_ARMOR[6] = [1000, "A:4,1", "A:5,1"] 
 
  # El nombre de la tienda, en este caso al activar el interruptor
  # cambia de comprar a orfebreria //Se puede cambiar el nombre si aso se quiere
  VOCAB_COMPOSE_ITEM = "Orfebreria"
                     
  #  Cambia la lista de materiales que necesitas para la elaboracion del OBJ
  #  SWITCH_INFO_BUTTON = Input::nil disables this.
  SWITCH_INFO_BUTTON = Input::X

  #Permite reducir el tamaño de la lista de objetos a crear
  COMPACT_MATERIAL_LIST = true
 
  # Oculta algunos parametros sobre los materiales necesarios para crear OBJ
  #  true = Para ocultar parametros
  #  false = Para no ocultarlos
  HIDE_COMMAND_WINDOW  = false
 
  #  Oculta la cantidad de dinero de la que dispones en la tienda de orfebreria
  HIDE_GOLD_WINDOW      = false
   
  #  true = No se muestra el costo del objeto si este es de 0
  #  false = Muestra el precio "0", de un objeto que no necesitas pagar mas
  HIDE_ZERO_COST        = true

  # No se conocer el uso de esta linea...
  SHOW_COMPOSED_RECIPE  = false
 
  #                  ? Hide Recipe Requirements Toggle ?
  #  This toggle allows you to hide recipe and materials required when you lack
  #    the items needed to create an item.
  #  true = Hide recipe and items required when you lack the items needed
  #  false = Show recipe requirements when you lack the items needed.
  HIDE_SHORTAGE_COST    = false
 
  #                      ? Unknown Recipe Toggle ?
  #  true = Hides the names of recipes that cannot be synthesized.
  #  false = All recipe names are visible.
  HIDE_SHORTAGE_MATERIAL = false
 
  # ? ?? or ???????????????
  #Recipes are not known or can not be lifted synthesis
  #  true  : ?? or ??????????
  #  false : ???????????
  # Not sure what this is supposed to do at the moment.
  NEED_RECIPE_OPEN_OR_CLEAR = false # fucks everything

  #                      ? Unknown Recipe Toggle ?
  #  true = Oculta el nombre de los objetos a crear hasta que sea creado almenos 1 ves
  #  false = Muestra el nombre de los objetos a crear aunque nunca los hayas creado
  MASK_UNKNOWN_RECIPE_NAME = false
 
  # Muestra un nombre para los objetos que aun no has creado.
  # NOTA: ES NECESARIO QUE MASK_UNKNOWN_RECIPE_NAME ESTE EN true
  UNKNOWN_NAME_MASK        = "???"
 
  #  true = Oculta la caracteristica del objeto a crear si no ha sido creado minimo 1 ves
  #  false = Todos los nombres se muestras, hayan o no sido creados
  HIDE_UNKNOWN_RECIPE_HELP = false
 
  #Muestra un texto de ayuda en lugar de el de cada objeto si no ha sido creado minimo 1 ves
  # NOTA: HIDE_UNKNOWN_RECIPE_HELP deve de estar en "true"
  UNKNOWN_RECIPE_HELP    = "Primero hay que obtener todos los recursos!"
 
  #true = Pide confirmacion antes de crear el objeto
  #false = lo crea una ves se seleccione la opcion de manera inmediata
  HIDE_SELL_CANCEL        = false
 
  end
end

################################################################################
#              NO TOCAR NADA DE LO DE ABAJO ACA ATENDAMENTE ARQUEBUSS          #
################################################################################

$imported = {} if $imported == nil
$imported["ComposeItem"] = true

module KGC::ComposeItem
  module Regexp
    # Recipe Tag
    RECIPE = /([IWA])\s*:\s*(\d+)(\s*,\s*\d+)?/i
  end
end


module KGC::Commands
  module_function

  def set_recipe_cleared(type, id, enabled = true)
    item = nil
    case type
    when 0, :item    # ????
      item = $data_items[id]
    when 1, :weapon  # ??
      item = $data_weapons[id]
    when 2, :armor  # ??
      item = $data_armors[id]
    end

    $game_party.set_recipe_cleared(item, enabled) if item != nil
  end
 
  def set_recipe_opened(type, id, enabled = true)
    item = nil
    case type
    when 0, :item    # ????
      item = $data_items[id]
    when 1, :weapon  # ??
      item = $data_weapons[id]
    when 2, :armor  # ??
      item = $data_armors[id]
    end

    $game_party.set_recipe_opened(item, enabled) if item != nil
  end
end



module Vocab
  # ????
  ComposeItem = KGC::ComposeItem::VOCAB_COMPOSE_ITEM
end

#???????????????????????????????????????

#==============================================================================
# ? RPG::BaseItem
#==============================================================================

class RPG::BaseItem
  #--------------------------------------------------------------------------
  # ? ?????
  #--------------------------------------------------------------------------
  @@__masked_name =
    KGC::ComposeItem::UNKNOWN_NAME_MASK  # ????
  @@__expand_masked_name = false        # ???????????

  if @@__masked_name != nil
    @@__expand_masked_name = (@@__masked_name.scan(/./).size == 1)
  end
  #--------------------------------------------------------------------------
  # ? ??????????????
  #--------------------------------------------------------------------------
  def create_compose_item_cache
    @__compose_cost = 0
    @__compose_materials = []

    # ?????
    recipe = nil
    case self
    when RPG::Item    # ????
      recipe = KGC::ComposeItem::RECIPE_ITEM[self.id]
    when RPG::Weapon  # ??
      recipe = KGC::ComposeItem::RECIPE_WEAPON[self.id]
    when RPG::Armor  # ??
      recipe = KGC::ComposeItem::RECIPE_ARMOR[self.id]
    end
    return if recipe == nil
    recipe = recipe.dup

    @__compose_cost = recipe.shift
    # ????????
    recipe.each { |r|
      if r =~ KGC::ComposeItem::Regexp::RECIPE
        material = Game_ComposeMaterial.new
        material.kind = $1.upcase                    # ????????
        material.id = $2.to_i                        # ??? ID ???
        if $3 != nil
          material.number = [$3[/\d+/].to_i, 0].max  # ??????
        end
        @__compose_materials << material
      end
    }
  end
  #--------------------------------------------------------------------------
  # ? ????
  #--------------------------------------------------------------------------
  def masked_name
    if KGC::ComposeItem::MASK_UNKNOWN_RECIPE_NAME
      if @@__expand_masked_name
        # ???????????
        return @@__masked_name * self.name.scan(/./).size
      else
        return @@__masked_name
      end
    else
      return self.name
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????
  #--------------------------------------------------------------------------
  def compose_cost
    create_compose_item_cache if @__compose_cost == nil
    return @__compose_cost
  end
  #--------------------------------------------------------------------------
  # ? ????????
  #--------------------------------------------------------------------------
  def compose_materials
    create_compose_item_cache if @__compose_materials == nil
    return @__compose_materials
  end
  #--------------------------------------------------------------------------
  # ? ???????
  #--------------------------------------------------------------------------
  def is_compose?
    return !compose_materials.empty?
  end
end

#???????????????????????????????????????

#==============================================================================
# ? Game_Party
#==============================================================================

class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # ? ???????????
  #--------------------------------------------------------------------------
  def clear_composed_flag
    @item_composed = {}
    @weapon_composed = {}
    @armor_composed = {}
  end
  #--------------------------------------------------------------------------
  # ? ????????????
  #--------------------------------------------------------------------------
  def clear_recipe_cleared_flag
    @item_recipe_cleared = {}
    @weapon_recipe_cleared = {}
    @armor_recipe_cleared = {}
  end
  #--------------------------------------------------------------------------
  # ? ????????????
  #--------------------------------------------------------------------------
  def clear_recipe_opened_flag
    @item_recipe_opened = {}
    @weapon_recipe_opened = {}
    @armor_recipe_opened = {}
  end
  #--------------------------------------------------------------------------
  # ? ???????????????
  #    item : ????
  #    flag : true..????  false..???
  #--------------------------------------------------------------------------
  def set_item_composed(item, flag = true)
    return false unless item.is_a?(RPG::BaseItem)  # ??????
    return false unless item.is_compose?          # ????????

    # ???????????????????
    clear_composed_flag if @item_composed == nil

    # ???????????
    case item
    when RPG::Item    # ????
      @item_composed[item.id] = flag
    when RPG::Weapon  # ??
      @weapon_composed[item.id] = flag
    when RPG::Armor  # ??
      @armor_composed[item.id] = flag
    end
  end
  #--------------------------------------------------------------------------
  # ? ???????????
  #    item : ????
  #--------------------------------------------------------------------------
  def item_composed?(item)
    return false unless item.is_a?(RPG::BaseItem)  # ??????
    return false unless item.is_compose?          # ????????

    # ???????????????????
    clear_composed_flag if @item_composed == nil

    # ??????
    case item
    when RPG::Item    # ????
      return @item_composed[item.id]
    when RPG::Weapon  # ??
      return @weapon_composed[item.id]
    when RPG::Armor  # ??
      return @armor_composed[item.id]
    end
    return false
  end
  #--------------------------------------------------------------------------
  # ? ???????????????
  #    item : ????
  #    flag : true..????  false..???
  #--------------------------------------------------------------------------
  def set_item_composed(item, flag = true)
    return false unless item.is_a?(RPG::BaseItem)  # ??????
    return false unless item.is_compose?          # ????????

    # ???????????????????
    clear_composed_flag if @item_composed == nil

    # ???????????
    case item
    when RPG::Item    # ????
      @item_composed[item.id] = flag
    when RPG::Weapon  # ??
      @weapon_composed[item.id] = flag
    when RPG::Armor  # ??
      @armor_composed[item.id] = flag
    end
  end
  #--------------------------------------------------------------------------
  # ? ???????
  #    item : ????
  #--------------------------------------------------------------------------
  def recipe_cleared?(item)
    return false unless item.is_a?(RPG::BaseItem)  # ??????
    return false unless item.is_compose?          # ????????

    # ?????????????????
    clear_recipe_cleared_flag if @item_recipe_cleared == nil

    # ??
    case item
    when RPG::Item    # ????
      return @item_recipe_cleared[item.id]
    when RPG::Weapon  # ??
      return @weapon_recipe_cleared[item.id]
    when RPG::Armor  # ??
      return @armor_recipe_cleared[item.id]
    end
    return false
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #    item : ????
  #    flag : true..??  false..???
  #--------------------------------------------------------------------------
  def set_recipe_cleared(item, flag = true)
    return false unless item.is_a?(RPG::BaseItem)  # ??????
    return false unless item.is_compose?          # ????????

    # ?????????????????
    clear_recipe_cleared_flag if @item_recipe_cleared == nil

    # ?????????
    case item
    when RPG::Item    # ????
      @item_recipe_cleared[item.id] = flag
    when RPG::Weapon  # ??
      @weapon_recipe_cleared[item.id] = flag
    when RPG::Armor  # ??
      @armor_recipe_cleared[item.id] = flag
    end
  end
  #--------------------------------------------------------------------------
  # ? ???????
  #    item : ????
  #--------------------------------------------------------------------------
  def recipe_opened?(item)
    return false unless item.is_a?(RPG::BaseItem)  # ??????
    return false unless item.is_compose?          # ????????

    # ?????????????????
    clear_recipe_opened_flag if @item_recipe_opened == nil

    # ??
    case item
    when RPG::Item    # ????
      return @item_recipe_opened[item.id]
    when RPG::Weapon  # ??
      return @weapon_recipe_opened[item.id]
    when RPG::Armor  # ??
      return @armor_recipe_opened[item.id]
    end
    return false
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #    item : ????
  #    flag : true..??  false..???
  #--------------------------------------------------------------------------
  def set_recipe_opened(item, flag = true)
    return false unless item.is_a?(RPG::BaseItem)  # ??????
    return false unless item.is_compose?          # ????????

    # ?????????????????
    clear_recipe_opened_flag if @item_recipe_opened == nil

    # ?????????
    case item
    when RPG::Item    # ????
      @item_recipe_opened[item.id] = flag
    when RPG::Weapon  # ??
      @weapon_recipe_opened[item.id] = flag
    when RPG::Armor  # ??
      @armor_recipe_opened[item.id] = flag
    end
  end
  #--------------------------------------------------------------------------
  # ? ???????????
  #    item : ????
  #--------------------------------------------------------------------------
  def item_can_compose?(item)
    return false unless item_compose_cost_satisfy?(item)
    return false unless item_compose_material_satisfy?(item)

    return true
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #    item : ????
  #--------------------------------------------------------------------------
  def item_compose_cost_satisfy?(item)
    return false unless item.is_a?(RPG::BaseItem)  # ??????
    return false unless item.is_compose?          # ????????

    return (gold >= item.compose_cost)
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #    item : ????
  #--------------------------------------------------------------------------
  def item_compose_material_satisfy?(item)
    return false unless item.is_a?(RPG::BaseItem)  # ??????
    return false unless item.is_compose?          # ????????

    item.compose_materials.each { |material|
      num = item_number(material.item)
      return false if num < material.number || num == 0  # ????
    }
    return true
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #    item : ????
  #--------------------------------------------------------------------------
  def number_of_composable(item)
    return 0 unless item.is_a?(RPG::BaseItem)  # ??????
    return 0 unless item.is_compose?          # ????????

    number = ($imported["LimitBreak"] ? item.number_limit : 99)
    if item.compose_cost > 0
      number = [number, gold / item.compose_cost].min
    end
    # ?????
    item.compose_materials.each { |material|
      next if material.number == 0  # ??? 0 ???
      n = item_number(material.item) / material.number
      number = [number, n].min
    }
    return number
  end
end

#???????????????????????????????????????

#==============================================================================
# ? Game_ComposeMaterial
#------------------------------------------------------------------------------
#  ??????????????????
#==============================================================================

class Game_ComposeMaterial
  #--------------------------------------------------------------------------
  # ? ??????????
  #--------------------------------------------------------------------------
  attr_accessor :kind                    # ??????? (/[IWA]/)
  attr_accessor :id                      # ????? ID
  attr_accessor :number                  # ???
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def initialize
    @kind = "I"
    @id = 0
    @number = 1
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def item
    case @kind
    when "I"  # ????
      return $data_items[@id]
    when "W"  # ??
      return $data_weapons[@id]
    when "A"  # ??
      return $data_armors[@id]
    else
      return nil
    end
  end
end

#???????????????????????????????????????

#==============================================================================
# ? Window_Base
#==============================================================================

class Window_Base < Window
  #--------------------------------------------------------------------------
  # ? ??????????
  #    item    : ???? (????????????)
  #    x      : ??? X ??
  #    y      : ??? Y ??
  #    enabled : ??????false ?????????
  #--------------------------------------------------------------------------
  def draw_compose_item_name(item, x, y, enabled = true)
    return if item == nil

    draw_icon(item.icon_index, x, y, enabled)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    masked = !$game_party.item_composed?(item) &&
      !$game_party.recipe_cleared?(item)
    self.contents.draw_text(x + 24, y, 172, WLH,
      masked ? item.masked_name : item.name)
  end
end

#???????????????????????????????????????

#==============================================================================
# ? Window_ComposeNumber
#------------------------------------------------------------------------------
#  ??????????????????????????????
#==============================================================================

class Window_ComposeNumber < Window_ShopNumber
  #--------------------------------------------------------------------------
  # ? ??????????
  #--------------------------------------------------------------------------
  attr_accessor :sell_flag                # ?????
  #--------------------------------------------------------------------------
  # ? ?????????
  #    x : ?????? X ??
  #    y : ?????? Y ??
  #--------------------------------------------------------------------------
  alias initialize_KGC_ComposeItem initialize unless $@
  def initialize(x, y)
    @sell_flag = false

    initialize_KGC_ComposeItem(x, y)
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def refresh
    y = 96
    self.contents.clear
    if @sell_flag
      draw_item_name(@item, 0, y)
    else
      draw_compose_item_name(@item, 0, y)
    end
    self.contents.font.color = normal_color
    self.contents.draw_text(212, y, 20, WLH, "x")
    self.contents.draw_text(248, y, 20, WLH, @number, 2)
    self.cursor_rect.set(244, y, 28, WLH)
    if !KGC::ComposeItem::HIDE_ZERO_COST || @price > 0
      draw_currency_value(@price * @number, 4, y + WLH * 2, 264)
    end
  end
end

#???????????????????????????????????????

#==============================================================================
# ? Window_ComposeItem
#------------------------------------------------------------------------------
#  ?????????????????????????????
#==============================================================================

class Window_ComposeItem < Window_ShopBuy
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def refresh
    @data = []
    for goods_item in @shop_goods
      case goods_item[0]
      when 0
        item = $data_items[goods_item[1]]
      when 1
        item = $data_weapons[goods_item[1]]
      when 2
        item = $data_armors[goods_item[1]]
      end
      # ??????????
      @data.push(item) if include?(item)
    end
    @item_max = @data.size
    create_contents
    for i in 0...@item_max
      draw_item(i)
    end
  end
  #--------------------------------------------------------------------------
  # ? ????????????????
  #    item : ????
  #--------------------------------------------------------------------------
  def include?(item)
    return false if item == nil          # ????? nil ??????
    return false unless item.is_compose?  # ?????????????

    # ????????
    if KGC::ComposeItem::SHOW_COMPOSED_RECIPE
      return true if $game_party.item_composed?(item)
    end
    # ?? or ????????
    if $game_party.recipe_cleared?(item) || $game_party.recipe_opened?(item)
      return true
    end
    # ????????
    if KGC::ComposeItem::HIDE_SHORTAGE_COST
      return false unless $game_party.item_compose_cost_satisfy?(item)
    end
    # ????????
    if KGC::ComposeItem::HIDE_SHORTAGE_MATERIAL
      return false unless $game_party.item_compose_material_satisfy?(item)
    end

    if KGC::ComposeItem::NEED_RECIPE_OPEN_OR_CLEAR
      # ?? or ???????
      unless $game_party.recipe_cleared?(item) ||
          $game_party.recipe_opened?(item)
        return false
      end
    end

    return true
  end
  #--------------------------------------------------------------------------
  # ? ??????????????????
  #    item : ????
  #--------------------------------------------------------------------------
  def enable?(item)
    return $game_party.item_can_compose?(item)
  end
  #--------------------------------------------------------------------------
  # ? ?????
  #    index : ????
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    number = $game_party.item_number(item)
    limit = ($imported["LimitBreak"] ? item.number_limit : 99)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    draw_compose_item_name(item, rect.x, rect.y, enable?(item))
    # ?????
    if !KGC::ComposeItem::HIDE_ZERO_COST || item.compose_cost > 0
      rect.width -= 4
      self.contents.draw_text(rect, item.compose_cost, 2)
    end
  end

  if KGC::ComposeItem::HIDE_UNKNOWN_RECIPE_HELP
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def update_help
    item = (index >= 0 ? @data[index] : nil)
    if item == nil || $game_party.item_composed?(item) ||
        $game_party.recipe_cleared?(item)
      # ????? nil or ???? or ?????? [Window_ShopBuy] ????
      super
    else
      @help_window.set_text(KGC::ComposeItem::UNKNOWN_RECIPE_HELP)
    end
  end
  end
end

#???????????????????????????????????????

#==============================================================================
# ? Window_ComposeStatus
#------------------------------------------------------------------------------
# ??????????????????????????????
#==============================================================================

class Window_ComposeStatus < Window_ShopStatus
  #--------------------------------------------------------------------------
  # ? ?????
  #--------------------------------------------------------------------------
  MODE_MATERIAL = 0  # ?????
  MODE_STATUS  = 1  # ??????????
  #--------------------------------------------------------------------------
  # ? ?????????
  #    x : ?????? X ??
  #    y : ?????? Y ??
  #--------------------------------------------------------------------------
  def initialize(x, y)
    @mode = MODE_MATERIAL
    super(x, y)
  end
  #--------------------------------------------------------------------------
  # ? ?????
  #--------------------------------------------------------------------------
  def change_mode
    case @mode
    when MODE_MATERIAL
      @mode = MODE_STATUS
    when MODE_STATUS
      @mode = MODE_MATERIAL
    end
    self.oy = 0
    refresh
  end
  #--------------------------------------------------------------------------
  # ? ??????????
  #--------------------------------------------------------------------------
  def create_contents
    if @mode == MODE_STATUS
      super
      return
    end

    self.contents.dispose
    ch = height - 32
    if @item != nil
      mag = (KGC::ComposeItem::COMPACT_MATERIAL_LIST ? 1 : 2)
      ch = [ch, WLH * (mag + @item.compose_materials.size * mag)].max
    end
    self.contents = Bitmap.new(width - 32, ch)
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def refresh
    create_contents
    self.contents.font.size = Font.default_size
    case @mode
    when MODE_MATERIAL
      draw_material_list
    when MODE_STATUS
      super
    end
  end
  #--------------------------------------------------------------------------
  # ? ????????
  #--------------------------------------------------------------------------
  def draw_material_list
    return if @item == nil
    number = $game_party.item_number(@item)
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 200, WLH, Vocab::Possession)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, 200, WLH, number, 2)
    self.contents.font.size = 16 if KGC::ComposeItem::COMPACT_MATERIAL_LIST
    mag = (KGC::ComposeItem::COMPACT_MATERIAL_LIST ? 1 : 2)
    @item.compose_materials.each_with_index { |material, i|
      y = WLH * (mag + i * mag)
      draw_material_info(0, y, material)
    }
  end
  #--------------------------------------------------------------------------
  # ? ???????
  #--------------------------------------------------------------------------
  def draw_material_info(x, y, material)
    m_item = material.item
    return if m_item == nil
    number = $game_party.item_number(m_item)
    enabled = (number > 0 && number >= material.number)
    draw_item_name(m_item, x, y, enabled)
    if KGC::ComposeItem::COMPACT_MATERIAL_LIST
      m_number = (material.number == 0 ? "-" : sprintf("%d", material.number))
      self.contents.draw_text(x, y, width - 32, WLH,
        sprintf("%s/%d", m_number, number), 2)
    else
      m_number = (material.number == 0 ? "-" : sprintf("%2d", material.number))
      self.contents.draw_text(x, y + WLH, width - 32, WLH,
        sprintf("%2s/%2d", m_number, number), 2)
    end
  end
end

#???????????????????????????????????????

#==============================================================================
# ? Scene_Map
#==============================================================================

class Scene_Map < Scene_Base
  #--------------------------------------------------------------------------
  # ? ????????????
  #--------------------------------------------------------------------------
  alias call_shop_KGC_ComposeItem call_shop
  def call_shop
    # ????????????
    if $game_switches[KGC::ComposeItem::COMPOSE_CALL_SWITCH]
      # ???????
      $game_temp.next_scene = nil
      $game_switches[KGC::ComposeItem::COMPOSE_CALL_SWITCH] = false
      $scene = Scene_ComposeItem.new
    else
      call_shop_KGC_ComposeItem
    end
  end
end

#???????????????????????????????????????

#==============================================================================
# ? Scene_ComposeItem
#------------------------------------------------------------------------------
# ?????????????????
#==============================================================================

class Scene_ComposeItem < Scene_Shop
  #--------------------------------------------------------------------------
  # ? ????
  #--------------------------------------------------------------------------
  def start
    super
    # ????????????
    if KGC::ComposeItem::HIDE_COMMAND_WINDOW
      @command_window.visible = false
      @gold_window.y = Graphics.height - @gold_window.height
      @gold_window.z = @status_window.z + 100
      @gold_window.visible = !KGC::ComposeItem::HIDE_GOLD_WINDOW

      @dummy_window.y = @command_window.y
      @dummy_window.height += @command_window.height
    end

    # [Scene_Shop] ????????????? @buy_window ???
    @buy_window.dispose
    @buy_window = Window_ComposeItem.new(0, @dummy_window.y)
    @buy_window.height = @dummy_window.height
    @buy_window.active = false
    @buy_window.visible = false
    @buy_window.help_window = @help_window

    # ?????????????
    @number_window.dispose
    @number_window = Window_ComposeNumber.new(0, @buy_window.y)
    @number_window.height = @buy_window.height
    @number_window.create_contents
    @number_window.active = false
    @number_window.visible = false

    @status_window.dispose
    @status_window = Window_ComposeStatus.new(@buy_window.width, @buy_window.y)
    @status_window.height = @buy_window.height
    @status_window.create_contents
    @status_window.visible = false

    # ????????????????????????????
    if KGC::ComposeItem::HIDE_COMMAND_WINDOW
      @command_window.active = false
      @dummy_window.visible = false
      @buy_window.active = true
      @buy_window.visible = true
      @buy_window.update_help
      @status_window.visible = true
      @status_window.item = @buy_window.item
    end
  end
  #--------------------------------------------------------------------------
  # ? ????????????
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::ComposeItem
    s2 = Vocab::ShopSell
    s3 = Vocab::ShopCancel
    # Added 4/11 [Mr. Anonymous]
    if KGC::ComposeItem::HIDE_SELL_CANCEL
      @command_window = Window_Command.new(150, [s1], 1)
    else
      @command_window = Window_Command.new(384, [s1, s2, s3], 3)
    end
    #@command_window = Window_Command.new(384, [s1, s2, s3], 3)
    @command_window.y = 56
    if $game_temp.shop_purchase_only
      @command_window.draw_item(1, false)
    end
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def update
    super
    if KGC::ComposeItem::SWITCH_INFO_BUTTON != nil &&
        Input.trigger?(KGC::ComposeItem::SWITCH_INFO_BUTTON)
      Sound.play_cursor
      @status_window.change_mode
    end
  end
  #--------------------------------------------------------------------------
  # ? ???????????
  #--------------------------------------------------------------------------
  def update_buy_selection
    @number_window.sell_flag = false

    # ????????????? B ??????????
    if KGC::ComposeItem::HIDE_COMMAND_WINDOW && Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
      return
    end

    @status_window.item = @buy_window.item
    if Input.trigger?(Input::C)
      @item = @buy_window.item
      # ?????????????
      if @item == nil
        Sound.play_buzzer
        return
      end

      # ????? or ??????????????????
      number = $game_party.item_number(@item)
      limit = ($imported["LimitBreak"] ? @item.number_limit : 99)
      if !$game_party.item_can_compose?(@item) || number == limit
        Sound.play_buzzer
        return
      end

      # ?????????
      Sound.play_decision
      max = $game_party.number_of_composable(@item)
      max = [max, limit - number].min
      @buy_window.active = false
      @buy_window.visible = false
      @number_window.set(@item, max, @item.compose_cost)
      @number_window.active = true
      @number_window.visible = true
      return
    end

    super
  end
  #--------------------------------------------------------------------------
  # ? ???????????
  #--------------------------------------------------------------------------
  def update_sell_selection
    @number_window.sell_flag = true
    super
  end
  #--------------------------------------------------------------------------
  # ? ???????
  #--------------------------------------------------------------------------
  def decide_number_input
    if @command_window.index != 0  # ????????
      super
      return
    end

    Sound.play_shop
    @number_window.active = false
    @number_window.visible = false
    # ????
    operation_compose
    @gold_window.refresh
    @buy_window.refresh
    @status_window.refresh
    @buy_window.active = true
    @buy_window.visible = true
  end
  def operation_compose
    $game_party.lose_gold(@number_window.number * @item.compose_cost)
    $game_party.gain_item(@item, @number_window.number)
    @item.compose_materials.each { |material|
      $game_party.lose_item(material.item,
        material.number * @number_window.number)
    }
    $game_party.set_item_composed(@item)
  end
end



Creditos al creador del sciprt, de donde lo encontre ya hace tiempo, no los pedia, pero no estaria mal darselos.


Última edición por Arquebuss el Miér 25 Abr 2012, 6:59 pm, editado 2 veces (Razón : El cierre de mega hiso caer el archivo.)
Arquebuss
Arquebuss
130
130

Masculino

Edad 30

Cantidad de envíos 151

Maker Cash 222

Reputación 39


Extras
Sobre mí::

Volver arriba Ir abajo

Orfebreria (KGC_COMPOSEITEM) [Resubido] Empty Re: Orfebreria (KGC_COMPOSEITEM) [Resubido]

Mensaje por Mike_182 Dom 25 Sep 2011, 5:15 pm

Muy buen script de alquimia, lo habia visto en otro lado pero igual mereces un +1 super verde!
Pero una pregunta...
¿Se pueden crear espadas o armas a partir de objetos?

Saludos !
Mike_182
Mike_182
Super Moderador
Super Moderador

Masculino

Edad 28

Cantidad de envíos 814

Maker Cash 1041

Reputación 150


Extras
Sobre mí::

Volver arriba Ir abajo

Orfebreria (KGC_COMPOSEITEM) [Resubido] Empty Re: Orfebreria (KGC_COMPOSEITEM) [Resubido]

Mensaje por Arquebuss Dom 25 Sep 2011, 5:38 pm

asi es mike, puedes crear protectores, armas y objetos, apartir de cualquier otra cosa,

Supongamos, crear Arma Artema, con 3 elixires y molde de arma artema.
Arquebuss
Arquebuss
130
130

Masculino

Edad 30

Cantidad de envíos 151

Maker Cash 222

Reputación 39


Extras
Sobre mí::

Volver arriba Ir abajo

Orfebreria (KGC_COMPOSEITEM) [Resubido] Empty Re: Orfebreria (KGC_COMPOSEITEM) [Resubido]

Mensaje por Mike_182 Dom 25 Sep 2011, 5:42 pm

Oh, geniaaal!
entonces no es el que vi, este es mucho mejor!
Muchas gracias Arquebuss.

Saludos !
Mike_182
Mike_182
Super Moderador
Super Moderador

Masculino

Edad 28

Cantidad de envíos 814

Maker Cash 1041

Reputación 150


Extras
Sobre mí::

Volver arriba Ir abajo

Orfebreria (KGC_COMPOSEITEM) [Resubido] Empty Re: Orfebreria (KGC_COMPOSEITEM) [Resubido]

Mensaje por Arquebuss Dom 25 Sep 2011, 5:57 pm

Se hace lo que se puede mike, espero te sirva en algun momento.
Arquebuss
Arquebuss
130
130

Masculino

Edad 30

Cantidad de envíos 151

Maker Cash 222

Reputación 39


Extras
Sobre mí::

Volver arriba Ir abajo

Orfebreria (KGC_COMPOSEITEM) [Resubido] Empty Re: Orfebreria (KGC_COMPOSEITEM) [Resubido]

Mensaje por Contenido patrocinado


Contenido patrocinado


Volver arriba Ir abajo

Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.