Raven BellamyLun Ene 21, 2013 1:02 am
Usuario Nv9
Script Inventario Avanzado
No dejo imagenes porque me da pereza subir pero despues subo =D
Créditos:
Script creado por Dark Chocobo.
Descripción
Crea un menú de objetos (inventario) más complejo dividido por categorías de objetos y con opciones de descarte de objetos y organización.
Instrucciones:
1.- El script comenzará a funcionar en cuanto lo pongas sobre Main.
2.- Puedes renombrar las opciones en las líneas 33 a 36.
3.- Puedes configurar la velocidad con la que el menú pasa entre las categorias y las opciones (entre 1 y 5) en la línea 37.
- Código:
CODE
=begin
[ =================================================================== ]
[ =================================================================== ]
[ ============= ] SCRIPT CREADO POR: [ ============= ]
[ ============= ] [ ============= ]
[ ============= ] >>> Dark Chocobo [ ============= ]
[ ============= ] [ ============= ]
[ ============= ] [ ============= ]
[ ============= ] > Menú Objetos < [ ============= ]
[ ============= ] [ ============= ]
[ =================================================================== ]
[ ============ ] Más scripts de Dark Chocobo en: [ ============ ]
[ ============ ] DarkChocoboScripts.4shared.com [ ============ ]
[ =================================================================== ]
[ =============== ] : Comunidad RPG Maker VX : [ ============== ]
[ ===== ] editado[ ==== ]
[ =================================================================== ]
[ =================================================================== ]
Resumen:
- Crea un menú de objetos más complejo dividido por categorías de objetos y
con opciones de descarte de objetos y organización.
Instrucciones:
- Puedes renombrar las opciones en las líneas 33 a 36.
- Puedes configurar la velocidad con la que el menú pasa entre las
categorias y las opciones en la línea 37.
=end
# Crea las configuraciones iniciales del script.
$DarkChocoboScripts = {} if $DarkChocoboScripts.nil?
$DarkChocoboScripts["Menu de Itens"] = {}
$DarkChocoboScripts["Menu de Itens"]["Categorias"] = []
$DarkChocoboScripts["Menu de Itens"]["Categorias"][0] = "General"
$DarkChocoboScripts["Menu de Itens"]["Categorias"][1] = "Raros"
$DarkChocoboScripts["Menu de Itens"]["Categorias"][2] = "Equipo"
$DarkChocoboScripts["Menu de Itens"]["Categorias"][3] = "Todos"
$DarkChocoboScripts["Menu de Itens"]["Speed"] = 2 # Velocidad de cambio de menú de categorías a menu de opciones (1~5)
class DC_Menu_de_Itens_Check
def draw_item?(item, index)
return true unless $scene.is_a?(Scene_Item)
case index
when 0
return false unless item.is_a?(RPG::Item)
return item.consumable
when 1
return false unless item.is_a?(RPG::Item)
return item.price == 0
when 2
return true unless item.is_a?(RPG::Item)
return false
else
return true
end
end
end
$DarkChocoboScripts["Menu de Itens"]["Check"] = DC_Menu_de_Itens_Check.new
class Scene_Item < Scene_Base
def return_scene
@item_window.active = false
@item_window.index = -1
@command_window.active = true
end
alias dc_menu_de_itens_start start
def start
dc_menu_de_itens_start
@item_window.active = false
@command_window = Window_Command.new(544, ["Usar", "Descartar", "Organizar"], 3)
@command_window.active = false
@command_window.y = 112
@command_window.height = 0
@command_window.viewport = @viewport
@category_window = Window_Command.new(544, $DarkChocoboScripts["Menu de Itens"]["Categorias"], $DarkChocoboScripts["Menu de Itens"]["Categorias"].size)
@category_window.y = 56
@item_window.y += 56
@item_window.height -= 56
@item_window.index = -1
@item_window.refresh(@category_window.index)
end
alias dc_menu_de_itens_terminate terminate
def terminate
dc_menu_de_itens_terminate
@category_window.dispose
@command_window.dispose
end
alias dc_menu_de_itens_update update
def update
dc_menu_de_itens_update
refresh_item_window = @category_window.index
@category_window.update
@item_window.refresh(@category_window.index) if refresh_item_window != @category_window.index
@command_window.update
if @category_window.active
dc_update_category_selection
elsif @command_window.active
dc_update_command_selection
end
end
def update_item_selection
if Input.trigger?(Input::B)
Sound.play_cancel
return_scene
elsif Input.trigger?(Input::C)
@item = @item_window.item
if @item != nil
$game_party.last_item_id = @item.id
end
if @command_window.index == 0
if $game_party.item_can_use?(@item)
Sound.play_decision
determine_item
else
Sound.play_buzzer
end
elsif @command_window.index == 1
discart_item
end
end
end
def discart_item
if @item_window.item == nil
Sound.play_buzzer
return
end
$game_party.gain_item(@item_window.item, -1)
Audio.se_play("Audio/SE/Equip", 70, 100)
@item_window.refresh(@category_window.index)
end
def dc_update_category_selection
if Input.trigger?(Input::C)
Sound.play_decision
loop do
Graphics.update
@category_window.height -= $DarkChocoboScripts["Menu de Itens"]["Speed"]
@command_window.height += $DarkChocoboScripts["Menu de Itens"]["Speed"]
@command_window.y -= $DarkChocoboScripts["Menu de Itens"]["Speed"]
break if @command_window.height >= 56 or @category_window.height <= 0
end
@command_window.height = 56
@command_window.y = 56
@command_window.active = true
@category_window.height = 0
@category_window.active = false
elsif Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Menu.new(0)
end
end
def dc_update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
loop do
Graphics.update
@category_window.height += $DarkChocoboScripts["Menu de Itens"]["Speed"]
@command_window.height -= $DarkChocoboScripts["Menu de Itens"]["Speed"]
@command_window.y += $DarkChocoboScripts["Menu de Itens"]["Speed"]
break if @command_window.height <= 0 or @category_window.height >= 56
end
@command_window.height = 0
@command_window.y = 118
@command_window.active = false
@category_window.height = 56
@category_window.active = true
elsif Input.trigger?(Input::C)
Sound.play_decision
case @command_window.index
when 0, 1
@item_window.active = true
@item_window.index = 0
@command_window.active = false
when 2
$game_party.dc_sort_items
@item_window.refresh(@category_window.index)
end
end
end
end
class Window_Item < Window_Selectable
def refresh(index = nil)
@data = []
for item in $game_party.dc_item_order#items
unless $scene.is_a?(Scene_Item)
next unless include?(item)
@data.push(item)
next
end
if $DarkChocoboScripts["Menu de Itens"]["Check"].draw_item?(item, index)
@data.push(item)
end
if item.is_a?(RPG::Item) and item.id == $game_party.last_item_id then self.index = @data.size - 1 end
end
@data.push(nil) if include?(nil)
@item_max = @data.size
create_contents
for i in 0...@item_max
draw_item(i)
end
end
end
class Game_Party < Game_Unit
alias dc_menu_de_itens_initialize initialize
def initialize
dc_menu_de_itens_initialize
@dc_item_order = []
end
def dc_item_order
return @dc_item_order
end
def gain_item(item, n, include_equip = false)
number = item_number(item)
case item
when RPG::Item
if @items[item.id] == 0 or @items[item.id] == nil then @dc_item_order.push(item) end
@items[item.id] = [[number + n, 0].max, 99].min
if @items[item.id] == 0 or @items[item.id] == nil then @dc_item_order.delete(item) end
when RPG::Weapon
if @weapons[item.id] == 0 or @weapons[item.id] == nil then @dc_item_order.push(item) end
@weapons[item.id] = [[number + n, 0].max, 99].min
if @weapons[item.id] == 0 or @weapons[item.id] == nil then @dc_item_order.delete(item) end
when RPG::Armor
if @armors[item.id] == 0 or @armors[item.id] == nil then @dc_item_order.push(item) end
@armors[item.id] = [[number + n, 0].max, 99].min
if @armors[item.id] == 0 or @armors[item.id] == nil then @dc_item_order.delete(item) end
end
n += number
if include_equip and n < 0
for actor in members
while n < 0 and actor.equips.include?(item)
actor.discard_equip(item)
n += 1
end
end
end
end
def dc_sort_items
@dc_item_order = items
end
end