Jump to content
Rpg²S Forum

pilukke96

Utenti
  • Posts

    20
  • Joined

  • Last visited

Posts posted by pilukke96

  1. Ciao a tutti,

    volevo chiedervi come si fa a impostare una variabile con il valore espresso in un commento sia da evento che da database (tipo la maggior parte degli abs che imposta le caratteristiche del mostro attraverso un commento).

    Grazie in anticipo

     

    P.S no, non mi e' possibile impostarla in altri modi

  2. Ok scusami, comunque questo e` lo script

     

     

    #==============================================================================

    # * Resolução 640X480 para VX[resolução XP]

    #------------------------------------------------------------------------------

    # Résolution 640x480 (pour RPG Maker VX) par Krazplay

    # Version 1.0 (23/01/2008)

    # Dernière version, commentaires : http://rpgmaker/forum/index.php?topic=12460

    #------------------------------------------------------------------------------

    # Ce script ne fait pas que changer la résolution, il modifie pas mal de choses

    # pour que le jeu soit adapté à sa nouvelle résolution.

    # Sachant que ce script redéfinit pas mal de méthodes, il est vivement conseillé

    # de le placer au-dessus de vos autres scripts ajoutés (mais en-dessous de ceux

    # de base, à part Main évidemment)

    #

    # Résolution de base : 544x416 (17x13 cases de 32 pixels)

    # Nouvelle résolution : 640x480 (20x15 cases de 32 pixels)

    # On gagne donc 96x64 pixels

    #------------------------------------------------------------------------------

    # Toutes les méthodes modifiées :

    #

    # ? Game_Map : calc_parallax_x, calc_parallax_y, setup_scroll,

    # scroll_down, scroll_right

    # ? Game_Player : center

    # ? Sprite_Base : start_animation

    # ? Sprite_Timer : initialize

    # ? Spriteset_Map : create_viewports

    # ? Spriteset_Battle : create_viewports, create_enemies, create_battleback,

    # create_battlefloor

    # ? Window_Help, Window_SkillStatus, Window_Equip : initialize

    # ? Window_Status, Window_SaveFile, Window_NumberInput : initialize

    # ? Window_ShopBuy, Window_ShopStatus : initialize

    # ? Window_MenuStatus : initialize, refresh, update_cursor

    # ? Window_Message : initialize, reset_window

    # ? Scene_Title : create_title_graphic, create_command_window

    # ? Scene_Menu : start

    # ? Scene_Item : start, show_target_window, hide_target_window

    # ? Scene_Skill : start, show_target_window, hide_target_window

    # ? Scene_Equip : create_item_windows

    # ? Scene_End : create_command_window

    # ? Scene_Shop : start

    # ? Scene_Battle : create_info_viewport, start_skill_selection,

    # start_item_selection

    #==============================================================================

     

    # Agrandir les images Title.png et BattleFloor.png si elles sont trop petites.

    AGRANDIR_IMAGES = true

    Graphics.resize_screen(640, 480)

     

    #==============================================================================

    # ¦ Game_Objects

    #==============================================================================

     

    # ? Game_Map #

    class Game_Map

    def calc_parallax_x(bitmap)

    if bitmap == nil

    return 0

    elsif @parallax_loop_x

    return @parallax_x / 16

    elsif loop_horizontal?

    return 0

    else

    w1 = bitmap.width - 640

    w2 = @map.width * 32 - 640

    if w1 <= 0 or w2 <= 0

    return 0

    else

    return @parallax_x * w1 / w2 / 8

    end

    end

    end

     

    def calc_parallax_y(bitmap)

    if bitmap == nil

    return 0

    elsif @parallax_loop_y

    return @parallax_y / 16

    elsif loop_vertical?

    return 0

    else

    h1 = bitmap.height - 480

    h2 = @map.height * 32 - 480

    if h1 <= 0 or h2 <= 0

    return 0

    else

    return @parallax_y * h1 / h2 / 8

    end

    end

    end

     

    def setup_scroll

    @scroll_direction = 2

    @scroll_rest = 0

    @scroll_speed = 4

    @margin_x = (width - 20) * 256 / 2 # ? / 2

    @margin_y = (height - 15) * 256 / 2 # ? / 2

    end

     

    def scroll_down(distance)

    if loop_vertical?

    @display_y += distance

    @display_y %= @map.height * 256

    @parallax_y += distance

    else

    last_y = @display_y

    @display_y = [@display_y + distance, (height - 15) * 256].min

    @parallax_y += @display_y - last_y

    end

    end

     

    def scroll_right(distance)

    if loop_horizontal?

    @display_x += distance

    @display_x %= @map.width * 256

    @parallax_x += distance

    else

    last_x = @display_x

    @display_x = [@display_x + distance, (width - 20) * 256].min

    @parallax_x += @display_x - last_x

    end

    end

    end

     

    # ? Game_Player #

    class Game_Player < Game_Character

    CENTER_X = (640 / 2 - 16) * 8 # ? X ? * 8

    CENTER_Y = (480 / 2 - 16) * 8 # ? Y ? * 8

     

    def center(x, y)

    display_x = x * 256 - CENTER_X # ?

    unless $game_map.loop_horizontal? # ?

    max_x = ($game_map.width - 20) * 256 # ?

    display_x = [0, [display_x, max_x].min].max # ?

    end

    display_y = y * 256 - CENTER_Y # ?

    unless $game_map.loop_vertical? # ?

    max_y = ($game_map.height - 15) * 256 # ?

    display_y = [0, [display_y, max_y].min].max # ?

    end

    $game_map.set_display_pos(display_x, display_y) # ?

    end

    end

     

    #==============================================================================

    # ¦ Sprites

    #==============================================================================

     

    # ? Sprite_Base #

    class Sprite_Base < Sprite

    def start_animation(animation, mirror = false)

    dispose_animation

    @animation = animation

    return if @animation == nil

    @animation_mirror = mirror

    @animation_duration = @animation.frame_max * 4 + 1

    load_animation_bitmap

    @animation_sprites = []

    if @animation.position != 3 or not @@animations.include?(animation)

    if @use_sprite

    for i in 0..15

    sprite = ::Sprite.new(viewport)

    sprite.visible = false

    @animation_sprites.push(sprite)

    end

    unless @@animations.include?(animation)

    @@animations.push(animation)

    end

    end

    end

    if @animation.position == 3

    if viewport == nil

    @animation_ox = 640 / 2

    @animation_oy = 480 / 2

    else

    @animation_ox = viewport.rect.width / 2

    @animation_oy = viewport.rect.height / 2

    end

    else

    @animation_ox = x - ox + width / 2

    @animation_oy = y - oy + height / 2

    if @animation.position == 0

    @animation_oy -= height / 2

    elsif @animation.position == 2

    @animation_oy += height / 2

    end

    end

    end

    end

     

    # ? Sprite_Timer #

    class Sprite_Timer < Sprite

    def initialize(viewport)

    super(viewport)

    self.bitmap = Bitmap.new(88, 48)

    self.bitmap.font.name = "Arial"

    self.bitmap.font.size = 32

    self.x = 640 - self.bitmap.width

    self.y = 0

    self.z = 200

    update

    end

    end

     

    # ? Spriteset_Map #

    class Spriteset_Map

    def create_viewports

    @viewport1 = Viewport.new(0, 0, 640, 480)

    @viewport2 = Viewport.new(0, 0, 640, 480)

    @viewport3 = Viewport.new(0, 0, 640, 480)

    @viewport2.z = 50

    @viewport3.z = 100

    end

    end

     

    # ? Spriteset_Battle #

    class Spriteset_Battle

    def create_viewports

    @viewport1 = Viewport.new(0, 0, 640, 480)

    @viewport2 = Viewport.new(0, 0, 640, 480)

    @viewport3 = Viewport.new(0, 0, 640, 480)

    @viewport2.z = 50

    @viewport3.z = 100

    end

     

    def create_enemies

    @enemy_sprites = []

    for enemy in $game_troop.members.reverse

    enemy.screen_x += 48 # Recentrage des ennemis

    @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))

    end

    end

     

    def create_battleback

    source = $game_temp.background_bitmap

    bitmap = Bitmap.new(640+96, 480+64)

    bitmap.stretch_blt(bitmap.rect, source, source.rect)

    bitmap.radial_blur(90, 12)

    @battleback_sprite = Sprite.new(@viewport1)

    @battleback_sprite.bitmap = bitmap

    @battleback_sprite.ox = 320+48

    @battleback_sprite.oy = 240+32

    @battleback_sprite.x = 320 #272

    @battleback_sprite.y = 208 #176

    @battleback_sprite.wave_amp = 8

    @battleback_sprite.wave_length = 240

    @battleback_sprite.wave_speed = 120

    end

     

    def create_battlefloor

    @battlefloor_sprite = Sprite.new(@viewport1)

    battle_floor = Cache.system("BattleFloor")

    if AGRANDIR_IMAGES and battle_floor.width < 640

    rect_dest = Rect.new(0, 0, 640, battle_floor.height)

    new_bitmap = Bitmap.new(640, battle_floor.height)

    new_bitmap.stretch_blt(rect_dest, battle_floor, battle_floor.rect)

    @battlefloor_sprite.bitmap = new_bitmap

    else

    @battlefloor_sprite.bitmap = battle_floor

    end

    @battlefloor_sprite.x = 0

    @battlefloor_sprite.y = 192

    @battlefloor_sprite.z = 1

    @battlefloor_sprite.opacity = 128

    end

    end

     

    #==============================================================================

    # ¦ Windows

    #==============================================================================

     

    # ? Window_Help #

    class Window_Help < Window_Base

    def initialize

    super(0, 0, 640, WLH + 32)

    end

    end

     

    # ? Window_MenuStatus #

    class Window_MenuStatus < Window_Selectable

    def initialize(x, y)

    super(x, y, 480, 480)

    refresh

    self.active = false

    self.index = -1

    end

     

    def refresh

    self.contents.clear

    @item_max = $game_party.members.size

    for actor in $game_party.members

    draw_actor_face(actor, 2, actor.index * (96+21) + 2, 92)

    x = 104

    y = actor.index * (96+21) + WLH / 2

    draw_actor_name(actor, x, y)

    draw_actor_class(actor, x + 120, y)

    draw_actor_level(actor, x, y + WLH * 1)

    draw_actor_state(actor, x, y + WLH * 2)

    draw_actor_hp(actor, x + 120, y + WLH * 1, 216)

    draw_actor_mp(actor, x + 120, y + WLH * 2, 216)

    end

    end

     

    def update_cursor

    if @index < 0 # ?

    self.cursor_rect.empty

    elsif @index < @item_max # ?

    self.cursor_rect.set(0, @index * (96+21), contents.width, 96)

    elsif @index >= 100 # ?

    self.cursor_rect.set(0, (@index - 100) * 96, contents.width, 96)

    else # ?

    self.cursor_rect.set(0, 0, contents.width, @item_max * 96)

    end

    end

    end

     

    # ? Window_SkillStatus #

    class Window_SkillStatus < Window_Base

    def initialize(x, y, actor)

    super(x, y, 640, WLH + 32)

    @actor = actor

    refresh

    end

    end

     

    # ? Window_Equip #

    class Window_Equip < Window_Selectable

    def initialize(x, y, actor)

    super(x, y, 336+96, WLH * 5 + 32)

    @actor = actor

    refresh

    self.index = 0

    end

    end

     

    # ? Window_Status #

    class Window_Status < Window_Base

    def initialize(actor)

    super(0, 0, 640, 480)

    @actor = actor

    refresh

    end

    end

     

    # ? Window_SaveFile #

    class Window_SaveFile < Window_Base

    def initialize(file_index, filename)

    super(0, 56 + file_index % 4 * (90+21), 640, 90)

    @file_index = file_index

    @filename = filename

    load_gamedata

    refresh

    @selected = false

    end

    end

     

    # ? Window_NumberInput #

    class Window_NumberInput < Window_Base

    def initialize

    super(0, 0, 640, 64)

    @number = 0

    @digits_max = 6

    @index = 0

    self.opacity = 0

    self.active = false

    self.z += 9999

    refresh

    update_cursor

    end

    end

     

    # ? Window_ShopBuy #

    class Window_ShopBuy < Window_Selectable

    def initialize(x, y)

    super(x, y, 304+96, 304+64)

    @shop_goods = $game_temp.shop_goods

    refresh

    self.index = 0

    end

    end

     

    # ? Window_ShopStatus #

    class Window_ShopStatus < Window_Base

    def initialize(x, y)

    super(x, y, 240, 304+64)

    @item = nil

    refresh

    end

    end

     

    # ? Window_Message #

    class Window_Message < Window_Selectable

    def initialize

    super(0, 352, 640, 128)

    self.z = 200

    self.active = false

    self.index = -1

    self.openness = 0

    @opening = false # ?

    @closing = false # ?

    @text = nil # ?

    @contents_x = 0 # ? X ?

    @contents_y = 0 # ? Y ?

    @line_count = 0 # ?

    @wait_count = 0 # ?

    @background = 0 # ?

    @position = 2 # ?

    @show_fast = false # ?

    @line_show_fast = false # ?

    @pause_skip = false # ?

    create_gold_window

    create_number_input_window

    create_back_sprite

    end

     

    def reset_window

    @background = $game_message.background

    @position = $game_message.position

    if @background == 0 # ?

    self.opacity = 255

    else # ?

    self.opacity = 0

    end

    case @position

    when 0 # ?

    self.y = 0

    @gold_window.y = 360

    when 1 # ?

    self.y = 208

    @gold_window.y = 0

    when 2 # ?

    self.y = 352

    @gold_window.y = 0

    end

    end

    end

     

    #==============================================================================

    # ¦ Scenes

    #==============================================================================

     

    # ? Scene_Title #

    class Scene_Title

    def create_title_graphic

    @sprite = Sprite.new

    cache_bitmap = Cache.system("Title")

    if AGRANDIR_IMAGES

    dest_rect = Rect.new(0, 0, Graphics.width, Graphics.height)

    bitmap = Bitmap.new(Graphics.width, Graphics.height)

    bitmap.stretch_blt(dest_rect, cache_bitmap, cache_bitmap.rect)

    @sprite.bitmap = bitmap

    else

    @sprite.bitmap = cache_bitmap

    end

    end

     

    def create_command_window

    s1 = Vocab::new_game

    s2 = Vocab::continue

    s3 = Vocab::shutdown

    @command_window = Window_Command.new(172, [s1, s2, s3])

    @command_window.x = (640 - @command_window.width) / 2

    @command_window.y = 288

    if @continue_enabled # ?

    @command_window.index = 1 # ?

    else # ?

    @command_window.draw_item(1, false) # ?

    end

    @command_window.openness = 0

    @command_window.open

    end

    end

     

    # ? Scene_Menu #

    class Scene_Menu < Scene_Base

    def start

    super

    create_menu_background

    create_command_window

    @gold_window = Window_Gold.new(0, 424)

    @status_window = Window_MenuStatus.new(160, 0)

    end

    end

     

    # ? Scene_Item #

    class Scene_Item < Scene_Base

    def start

    super

    create_menu_background

    @viewport = Viewport.new(0, 0, 640, 480)

    @help_window = Window_Help.new

    @help_window.viewport = @viewport

    @item_window = Window_Item.new(0, 56, 640, 424)

    @item_window.viewport = @viewport

    @item_window.help_window = @help_window

    @item_window.active = false

    @target_window = Window_MenuStatus.new(0, 0)

    hide_target_window

    end

     

    def show_target_window(right)

    @item_window.active = false

    width_remain = 640 - @target_window.width

    @target_window.x = right ? width_remain : 0

    @target_window.visible = true

    @target_window.active = true

    if right

    @viewport.rect.set(0, 0, width_remain, 480)

    @viewport.ox = 0

    else

    @viewport.rect.set(@target_window.width, 0, width_remain, 480)

    @viewport.ox = @target_window.width

    end

    end

     

    def hide_target_window

    @item_window.active = true

    @target_window.visible = false

    @target_window.active = false

    @viewport.rect.set(0, 0, 640, 480)

    @viewport.ox = 0

    end

    end

     

    # ? Scene_Skill #

    class Scene_Skill < Scene_Base

    def start

    super

    create_menu_background

    @actor = $game_party.members[@actor_index]

    @viewport = Viewport.new(0, 0, 640, 480)

    @help_window = Window_Help.new

    @help_window.viewport = @viewport

    @status_window = Window_SkillStatus.new(0, 56, @actor)

    @status_window.viewport = @viewport

    @skill_window = Window_Skill.new(0, 112, 640, 368, @actor)

    @skill_window.viewport = @viewport

    @skill_window.help_window = @help_window

    @target_window = Window_MenuStatus.new(0, 0)

    hide_target_window

    end

     

    def show_target_window(right)

    @skill_window.active = false

    width_remain = 640 - @target_window.width

    @target_window.x = right ? width_remain : 0

    @target_window.visible = true

    @target_window.active = true

    if right

    @viewport.rect.set(0, 0, width_remain, 480)

    @viewport.ox = 0

    else

    @viewport.rect.set(@target_window.width, 0, width_remain, 480)

    @viewport.ox = @target_window.width

    end

    end

     

    def hide_target_window

    @skill_window.active = true

    @target_window.visible = false

    @target_window.active = false

    @viewport.rect.set(0, 0, 640, 480)

    @viewport.ox = 0

    end

    end

     

    # ? Scene_Equip #

    class Scene_Equip < Scene_Base

    def create_item_windows

    @item_windows = []

    for i in 0...EQUIP_TYPE_MAX

    @item_windows = Window_EquipItem.new(0, 208, 640, 272, @actor, i)

    @item_windows.help_window = @help_window

    @item_windows.visible = (@equip_index == i)

    @item_windows.active = false

    @item_windows.index = -1

    end

    end

    end

     

    # ? Scene_End #

    class Scene_End < Scene_Base

    def create_command_window

    s1 = Vocab::to_title

    s2 = Vocab::shutdown

    s3 = Vocab::cancel

    @command_window = Window_Command.new(172, [s1, s2, s3])

    @command_window.x = (640 - @command_window.width) / 2

    @command_window.y = (480 - @command_window.height) / 2

    @command_window.openness = 0

    end

    end

     

    # ? Scene_Shop #

    class Scene_Shop < Scene_Base

    def start

    super

    create_menu_background

    create_command_window

    @help_window = Window_Help.new

    @gold_window = Window_Gold.new(384+96, 56)

    @dummy_window = Window_Base.new(0, 112, 640, 368)

    @buy_window = Window_ShopBuy.new(0, 112)

    @buy_window.active = false

    @buy_window.visible = false

    @buy_window.help_window = @help_window

    @sell_window = Window_ShopSell.new(0, 112, 640, 368)

    @sell_window.active = false

    @sell_window.visible = false

    @sell_window.help_window = @help_window

    @number_window = Window_ShopNumber.new(0, 112)

    @number_window.active = false

    @number_window.visible = false

    @status_window = Window_ShopStatus.new(400, 112)

    @status_window.visible = false

    end

    end

     

    # ? Scene_Battle #

    class Scene_Battle < Scene_Base

    def create_info_viewport

    @info_viewport = Viewport.new(0, 288+64, 640, 128)

    @info_viewport.z = 100

    @status_window = Window_BattleStatus.new

    @party_command_window = Window_PartyCommand.new

    @actor_command_window = Window_ActorCommand.new

    @status_window.viewport = @info_viewport

    @party_command_window.viewport = @info_viewport

    @actor_command_window.viewport = @info_viewport

    @status_window.x = 128

    @actor_command_window.x = 544

    @info_viewport.visible = false

    end

     

    def start_skill_selection

    @help_window = Window_Help.new

    @skill_window = Window_Skill.new(0, 56, 640, 296, @active_battler)

    @skill_window.help_window = @help_window

    @actor_command_window.active = false

    end

     

    def start_item_selection

    @help_window = Window_Help.new

    @item_window = Window_Item.new(0, 56, 640, 296)

    @item_window.help_window = @help_window

    @actor_command_window.active = false

    end

    end

     

     

  3. Ciao a tutti

    mi servirebbe la conversione di questi due script per xp per renderli per VX

     

     

    #======================================================================

    ========

    # Equipment Creator

    #------------------------------------------------------------------------------

    # Autore: The Sleeping Leonhart

    # Versione: 1.2

    # Data di rilascio: 25/06/2008

    #------------------------------------------------------------------------------

    # Descrizione:

    # Questo script permette di modificare le armi/armature creandone di nuove.

    # Le armi/armature vengono modificate tramite l'uso di oggetti, per prima

    # cosa si sceglie l'arma/armatura da modificare, poi si scelgono gli oggetti

    # che ne modificheranno gli attributi.

    #------------------------------------------------------------------------------

    # Istruzioni:

    # Per richiamare la scena usare il seguente codice:

    # $scene = Scene_ItemCreator.new(n)

    # Se n = 1 modifica le armi, se n = 2 modifica le armature.

    # Per rimuovere l'ultimo ingrediente inserito premere Esc, per passare

    # alla finestra di conferma premere destra per tornare alla finestra

    # precedente premere sinistra.

    # Per personalizzare lo script andate nella sezione configurazione.

    #==============================================================================

     

    #==============================================================================

    # Configurazione

    #==============================================================================

    module Equip_Creator

    #--------------------------------------------------------------------------

    # Weapon_Ingredient: Imposta gli ingredienti ed il loro effetto per ciascuna arma

    # Se un arma possiede almeno un ingrediente è automaticamente

    # aggiunta alle armi elaborabili.

    #--------------------------------------------------------------------------

    # Sintassi:

    # Weapon_Ingredient = {Weapon_Id=>{Item_Id=>[atk ,pdef, mdef, str,

    # dex, agi, int, element,

    # plus_state, minus_state, [n_type, name,]

    # [d_type, desc], icon, a_animation],

    # ...},...}

    # Parametri:

    # atk: valore che aumenta l'attacco dell'arma

    # pdef: valore che aumenta la difesa fisica dell'arma

    # mdef: valore che aumenta la difesa magica dell'arma

    # str: valore che aumenta la forza dell'arma

    # dex: valore che aumenta la destrezza dell'arma

    # agi: valore che aumenta l'agilità dell'arma

    # int: valore che aumenta l'intelligenza dell'arma

    # element: array contenete gli id degli elementi che possiederà l'arma

    # plus_state: array contenete gli id degli status che infliggerà l'arma

    # minus_state: array contenete gli id degli status che rimuoverà l'arma

    # n_type: se 1 la stringa contenuta in name si aggiunge al nome dell'arma

    # se 2 la stringa contenuta in name si sostituisce al nome dell'arma

    # name: stringa che modifica il nome dell'arma

    # d_type: se 1 la stringa contenuta in desc si aggiunge alla descrizione dell'arma

    # se 2 la stringa contenuta in desc si aggiunge alla descrizione dell'arma

    # desc: stringa che modifica la descrizione dell'arma

    # icon: nome dell'icona per la nuova arma,se "" l'icona dell'arma resta invariata

    # a_animation: id dell'animazione per la nuova arma,se 0 l'animazione

    # dell'arma resta invariata

    #--------------------------------------------------------------------------

    Weapon_Ingredient = {1=>{

    33=>[15,0,0,25,10,-5,15,[1],[],[],[1," del fuoco"],[1, " |Fuoco|"],"",0],

    34=>[20,0,0,15,15,10,-5,[3],[],[],[2,"Spada Tuono"],[2, "Spada con un aura elettrica. |Tuono|"],"044-Skill01",33],

    35=>[15,5,5,10,10,10,0,[],[3],[],[1," avvelenata"],[1, " |+ Veleno|"],"",0],

    36=>[75,0,0,40,0,0,0,[],[],[],[1,""],[1, ""],"",0]

    },

    5=>{

    33=>[5,10,10,15,15,0,15,[1],[],[],[1," di fuoco"],[1, " |Fuoco|"],"",0],

    34=>[10,5,15,10,10,15,0,[3],[],[],[2,"Lancia ferro tonante"],[2, "Lancia di ferro con una forte aura elettrica. |Tuono|"],"044-Skill01",33],

    35=>[10,10,5,5,10,10,5,[],[3],[],[1," avvelenata"],[1, " |+ Veleno|"],"",0],

    36=>[95,0,0,35,0,0,0,[],[],[],[1,""],[1, ""],"",0]

    }

     

    }

    #--------------------------------------------------------------------------

    # Weapon_Slot: Imposta il numero di slot per gli ingredienti di ciascuna arma

    #--------------------------------------------------------------------------

    # Sintassi:

    # Weapon_Slot = {Weapon_Id => Slot,...}

    # Parametri:

    # Weapon_ID: Id dell'arma nel database

    # Slot: Numero di slot per gli ingredienti

    #--------------------------------------------------------------------------

    Weapon_Slot = {1=>3}

    #--------------------------------------------------------------------------

    # Weapon_Slot.default: Imposta il numero di slot per gli ingredienti per

    # le armi non definite in Weapon_Slot

    #--------------------------------------------------------------------------

    # Sintassi:

    # Weapon_Slot.default = Slot

    # Parametri:

    # Slot: Numero di slot per gli ingredienti

    #--------------------------------------------------------------------------

    Weapon_Slot.default = 2

    #--------------------------------------------------------------------------

    # Weapon_Ingredient: Imposta gli ingredienti ed il loro effetto per

    # ciascuna armatura

    # Se un armatura possiede almeno un ingrediente è

    # automaticamente aggiunta alle armture elaborabili.

    #--------------------------------------------------------------------------

    # Sintassi:

    # Armor_Ingredient = {Armor_Id=>{Item_Id=>[atk ,pdef, mdef, str,

    # dex, agi, int, element_guard,

    # state_guard, auto_state, [n_type, name,]

    # [d_type, desc], icon, a_animation],

    # ...},...}

    # Parametri:

    # Armor_ID: Id dell'armatura nel database

    # eva: valore che aumenta l'evasione dell'armatura

    # pdef: valore che aumenta la difesa fisica dell'armatura

    # mdef: valore che aumenta la difesa magica dell'armatura

    # str: valore che aumenta la forza dell'armatura

    # dex: valore che aumenta la destrezza dell'armatura

    # agi: valore che aumenta l'agilità dell'armatura

    # int: valore che aumenta l'intelligenza dell'armatura

    # element_guard: array contenete gli id degli elementi protetti dall'armatura

    # state_guard: array contenete gli id degli status protetti dall'armatura

    # auto_state: id dell'auto-status che infliggerà l'armatura, se 0 l'auto-status

    # resta invariato

    # n_type: se 1 la stringa contenuta in name si aggiunge al nome dell'armatura

    # se 2 la stringa contenuta in name si sostituisce al nome dell'armatura

    # name: stringa che modifica il nome dell'armatura

    # d_type: se 1 la stringa contenuta in desc si aggiunge alla descrizione

    # dell'armatura se 2 la stringa contenuta in desc si aggiunge

    # alla descrizione dell'armatura

    # desc: stringa che modifica la descrizione dell'armatura

    # icon: nome dell'icona per la nuova armatura,se "" l'icona dell'armatura

    # resta invariata

    #--------------------------------------------------------------------------

    Armor_Ingredient = {1=>{

    33=>[10,20,30,25,10,5,-15,[1],[],0,[1," del fuoco"],[1, " |Guardia Fuoco|"],""],

    34=>[0,0,0,15,15,10,-10,[3],[],0,[2,"Scudo Tuono"],[2, "Scudo con un aura anti-elettrica"],"044-Skill01"],

    35=>[0,20,40,1,5,15,10,[],[3],0,[1," anti-veleno"],[1, "|Guardia Veleno|"],""],

    36=>[0,10,10,50,5,5,0,[],[],0,[1,""],[1, ""],""]

    },

    13=>{

    33=>[10,20,30,25,10,5,-10,[1],[],0,[1," del fuoco"],[1, " |Guardia Fuoco|"],""],

    34=>[0,5,5,10,10,5,5,[3],[],0,[2,"Corazza Tuono"],[2, "Corazza con un aura anti-elettrica"],"044-Skill01"],

    35=>[0,20,20,0,10,10,10,[],[3],0,[1," anti-veleno"],[1, "|Guardia Veleno|"],""],

    36=>[0,5,5,60,10,0,0,[],[],0,[1,""],[1, ""],""]

    }

    }

    #--------------------------------------------------------------------------

    # Armor_Slot: Imposta il numero di slot per gli ingredienti di ciascuna armatura

    #--------------------------------------------------------------------------

    # Sintassi:

    # Armor_Slot = {Armor_Id => Slot,...}

    # Parametri:

    # Armor_ID: Id dell'armatura nel database

    # Slot: Numero di slot per gli ingredienti

    #--------------------------------------------------------------------------

    Armor_Slot = {1=>3}

    #--------------------------------------------------------------------------

    # Armor_Slot.default: Imposta il numero di slot per gli ingredienti per

    # le armature non definite in Armor_Slot

    #--------------------------------------------------------------------------

    # Sintassi:

    # Armor_Slot.default = Slot

    # Parametri:

    # Slot: Numero di slot per gli ingredienti

    #--------------------------------------------------------------------------

    Armor_Slot.default = 2

    end

     

    $tsl_script = [] if $tsl_script == nil

    $tsl_script.push("Equipment Creator")

     

    class Game_Party

    #--------------------------------------------------------------------------

    # * Public Instance Variables

    #--------------------------------------------------------------------------

    attr_accessor :created_weapons

    attr_accessor :created_armors

    attr_accessor :created_weapon_set

    attr_accessor :created_armor_set

    #--------------------------------------------------------------------------

    # * Object Initialization

    #--------------------------------------------------------------------------

    alias tslec_gameparty_initialize initialize

    def initialize

    @created_weapons = []

    @created_armors = []

    @created_weapon_set = {}

    @created_armor_set = {}

    @created_weapon_set.default = []

    @created_armor_set.default = []

    tslec_gameparty_initialize

    end

    end

     

    class Scene_Load < Scene_File

    #--------------------------------------------------------------------------

    # * Decision Processing

    #--------------------------------------------------------------------------

    alias tslec_sceneload_on_decision on_decision

    def on_decision(filename)

    tslec_sceneload_on_decision(filename)

    for i in $game_party.created_weapons

    $data_weapons.push(i)

    end

    for i in $game_party.created_armors

    $data_armors.push(i)

    end

    for i in 1...$data_classes.size

    for j in $game_party.created_weapon_set

    $data_classes.weapon_set.push(j)

    end

    for j in $game_party.created_armor_set

    $data_classes.armor_set.push(j)

    end

    end

    end

    end

     

    class Window_EC_EItem < Window_Selectable

    #--------------------------------------------------------------------------

    # * Object Initialization

    #--------------------------------------------------------------------------

    def initialize(type = 1)

    super(0, 64, 320, 232)

    @type = type

    @column_max = 1

    refresh

    self.index = 0

    end

    #--------------------------------------------------------------------------

    # * Get Item

    #--------------------------------------------------------------------------

    def item

    return @data[self.index]

    end

    #--------------------------------------------------------------------------

    # * Refresh

    #--------------------------------------------------------------------------

    def refresh

    if self.contents != nil

    self.contents.dispose

    self.contents = nil

    end

    @data = []

    case @type

    when 1

    for i in 1...$data_weapons.size

    if $game_party.weapon_number(i) > 0 and Equip_Creator::Weapon_Ingredient.keys.include?(i)

    @data.push($data_weapons)

    end

    end

    when 2

    for i in 1...$data_armors.size

    if $game_party.armor_number(i) > 0 and Equip_Creator::Armor_Ingredient.keys.include?(i)

    @data.push($data_armors)

    end

    end

    end

    @item_max = @data.size

    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

    #--------------------------------------------------------------------------

    # * Draw Item

    # index : item number

    #--------------------------------------------------------------------------

    def draw_item(index)

    item = @data[index]

    case item

    when RPG::Weapon

    number = $game_party.weapon_number(item.id)

    when RPG::Armor

    number = $game_party.armor_number(item.id)

    end

    self.contents.font.color = normal_color

    x = 4 + index % @column_max * (288 + 32)

    y = index / @column_max * 32

    rect = Rect.new(x, y, self.width / @column_max - 32, 32)

    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))

    bitmap = RPG::Cache.icon(item.icon_name)

    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))

    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)

    self.contents.draw_text(x + 240, y, 16, 32, ":", 1)

    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)

    end

    #--------------------------------------------------------------------------

    # * Help Text Update

    #--------------------------------------------------------------------------

    def update_help

    @help_window.set_text(self.item == nil ? "" : self.item.description)

    end

    end

     

    class Window_EC_IItem < Window_Selectable

    #--------------------------------------------------------------------------

    # * Object Initialization

    #--------------------------------------------------------------------------

    def initialize(item, type = 1)

    super(0, 64, 320, 232)

    @type = type

    @item = item

    @column_max = 1

    refresh

    self.index = 0

    end

    #--------------------------------------------------------------------------

    # * Get Item

    #--------------------------------------------------------------------------

    def item

    return @data[self.index]

    end

    #--------------------------------------------------------------------------

    # * Refresh

    #--------------------------------------------------------------------------

    def refresh

    if self.contents != nil

    self.contents.dispose

    self.contents = nil

    end

    @data = []

    case @type

    when 1

    a = Equip_Creator::Weapon_Ingredient[@item]

    when 2

    a = Equip_Creator::Armor_Ingredient[@item]

    end

    for i in 1...$data_items.size

    if $game_party.item_number(i) > 0 and a.include?(i)

    @data.push($data_items)

    end

    end

    @item_max = @data.size

    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

    #--------------------------------------------------------------------------

    # * Draw Item

    # index : item number

    #--------------------------------------------------------------------------

    def draw_item(index)

    item = @data[index]

    number = $game_party.item_number(item.id)

    self.contents.font.color = normal_color

    x = 4 + index % @column_max * (288 + 32)

    y = index / @column_max * 32

    rect = Rect.new(x, y, self.width / @column_max - 32, 32)

    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))

    bitmap = RPG::Cache.icon(item.icon_name)

    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))

    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)

    self.contents.draw_text(x + 240, y, 16, 32, ":", 1)

    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)

    end

    #--------------------------------------------------------------------------

    # * Help Text Update

    #--------------------------------------------------------------------------

    def update_help

    @help_window.set_text(self.item == nil ? "" : self.item.description)

    end

    end

     

    class Window_EC_IUsed < Window_Base

    #--------------------------------------------------------------------------

    # * Object Initialization

    #--------------------------------------------------------------------------

    def initialize(type, base = nil, ingredient = [])

    super(320, 64, 320, 232)

    self.contents = Bitmap.new(width - 32, height - 32)

    refresh(type, base, ingredient)

    end

    #--------------------------------------------------------------------------

    # * Refresh

    #--------------------------------------------------------------------------

    def refresh(type, base, ingredient)

    self.contents.clear

    self.contents.font.color = system_color

    case type

    when 1

    self.contents.draw_text(0, 0, 64, 32, "Arma")

    when 2

    self.contents.draw_text(0, 0, 64, 32, "Armatura")

    end

    self.contents.draw_text(0, 24, 96, 32, "Ingredienti")

    self.contents.font.color = normal_color

    if base != nil

    bitmap = RPG::Cache.icon(base.icon_name)

    self.contents.blt(100, 4, bitmap, Rect.new(0, 0, 24, 24))

    self.contents.draw_text(124, 0, 212, 32, base.name)

    end

    if ingredient != []

    for i in 0...ingredient.size

    bitmap = RPG::Cache.icon(ingredient.icon_name)

    self.contents.blt(100, 28+24*i, bitmap, Rect.new(0, 0, 24, 24))

    self.contents.draw_text(124, 24+24*i, 212, 32, ingredient.name)

    end

    end

    end

    end

     

    class Window_EC_IParameter < Window_Base

    def initialize(type, base,id = nil, ing_size = 0)

    super(0, 296, 640, 184)

    self.contents = Bitmap.new(width - 32, height - 32)

    case type

    when 1

    w_refresh(id, base, ing_size)

    when 2

    a_refresh(id, base, ing_size)

    end

    end

    #--------------------------------------------------------------------------

    # * Weapon Refresh

    #--------------------------------------------------------------------------

    def w_refresh(id, base, ing_size)

    self.contents.clear

    self.contents.font.color = system_color

    self.contents.draw_text(240, 0, 96,32, "Slot")

    self.contents.draw_text(0, 0 + 24, 96, 32, "Attacco")

    self.contents.draw_text(0, 24 + 24, 96, 32, "Dif. Fisica")

    self.contents.draw_text(0, 48 + 24, 96, 32, "Dif. Magica")

    self.contents.draw_text(0, 72 + 24, 96, 32, "Forza")

    self.contents.draw_text(0, 96 + 24, 96, 32, "Intelligenza")

    self.contents.draw_text(240, 0 + 24, 96, 32, "Destrezza")

    self.contents.draw_text(240, 24 + 24, 96, 32, "Agilità")

    self.contents.draw_text(240, 48 + 24, 96, 32, "Elemento")

    self.contents.draw_text(240, 72 + 24, 96, 32, "Status +")

    self.contents.draw_text(240, 96 + 24, 96, 32, "Status -")

    if id != nil

    i = $data_weapons[id]

    self.contents.font.color = normal_color

    bitmap = RPG::Cache.icon(i.icon_name)

    self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 24, 24))

    self.contents.draw_text(24, 0, 212, 32, i.name)

    self.contents.draw_text(360, 0, 96,32, ing_size.to_s+"/"+Equip_Creator::Weapon_Slot[base.id].to_s)

    self.contents.draw_text(120, 0 + 24, 96, 32, i.atk.to_s)

    self.contents.draw_text(120, 24 + 24, 96, 32, i.pdef.to_s)

    self.contents.draw_text(120, 48 + 24, 96, 32, i.mdef.to_s)

    self.contents.draw_text(120, 72 + 24, 96, 32, i.str_plus.to_s)

    self.contents.draw_text(120, 96 + 24, 96, 32, i.int_plus.to_s)

    self.contents.draw_text(360, 0 + 24, 96, 32, i.dex_plus.to_s)

    self.contents.draw_text(360, 24 + 24, 96, 32, i.agi_plus.to_s)

    s = ""

    for j in i.element_set

    s += ", " if s != ""

    s += $data_system.elements[j]

    end

    self.contents.draw_text(360, 48 + 24, 180, 32, s)

    s = ""

    for j in i.plus_state_set

    s += ", " if s != ""

    s += $data_states[j].name

    end

    self.contents.draw_text(360, 72 + 24, 180, 32, s)

    s = ""

    for j in i.minus_state_set

    s += ", " if s != ""

    s += $data_states[j].name

    end

    self.contents.draw_text(360, 96 + 24, 180, 32, s)

    end

    end

    #--------------------------------------------------------------------------

    # * Armor Refresh

    #--------------------------------------------------------------------------

    def a_refresh(id, base, ing_size)

    self.contents.clear

    self.contents.font.color = system_color

    self.contents.draw_text(240, 0, 96,32, "Slot")

    self.contents.draw_text(0, 0 + 24, 96, 32, "Evasione")

    self.contents.draw_text(0, 24 + 24, 96, 32, "Dif. Fisica")

    self.contents.draw_text(0, 48 + 24, 96, 32, "Dif. Magica")

    self.contents.draw_text(0, 72 + 24, 96, 32, "Forza")

    self.contents.draw_text(0, 96 + 24, 96, 32, "Intelligenza")

    self.contents.draw_text(240, 0 + 24, 96, 32, "Destrezza")

    self.contents.draw_text(240, 24 + 24, 96, 32, "Agilità")

    self.contents.draw_text(240, 48 + 24, 96, 32, "Difesa Elemento")

    self.contents.draw_text(240, 72 + 24, 96, 32, "Difesa Status")

    self.contents.draw_text(240, 96 + 24, 96, 32, "Auto-Status")

    if id != nil

    i = $data_armors[id]

    self.contents.font.color = normal_color

    bitmap = RPG::Cache.icon(i.icon_name)

    self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 24, 24))

    self.contents.draw_text(24, 0, 212, 32, i.name)

    self.contents.draw_text(360, 0, 96,32, ing_size.to_s+"/"+Equip_Creator::Armor_Slot[base.id].to_s)

    self.contents.draw_text(120, 0 + 24, 96, 32, i.eva.to_s)

    self.contents.draw_text(120, 24 + 24, 96, 32, i.pdef.to_s)

    self.contents.draw_text(120, 48 + 24, 96, 32, i.mdef.to_s)

    self.contents.draw_text(120, 72 + 24, 96, 32, i.str_plus.to_s)

    self.contents.draw_text(120, 96 + 24, 96, 32, i.int_plus.to_s)

    self.contents.draw_text(360, 0 + 24, 96, 32, i.dex_plus.to_s)

    self.contents.draw_text(360, 24 + 24, 96, 32, i.agi_plus.to_s)

    s = ""

    for j in i.guard_element_set

    s += ", " if s != ""

    s += $data_system.elements[j]

    end

    self.contents.draw_text(360, 48 + 24, 180, 32, s)

    s = ""

    for j in i.guard_state_set

    s += ", " if s != ""

    s += $data_states[j].name

    end

    self.contents.draw_text(360, 72 + 24, 180, 32, s)

    self.contents.draw_text(360, 96 + 24, 180, 32, $data_states[i.auto_state_id].name) if i.auto_state_id != 0

    end

    end

    end

     

    class Scene_ItemCreator

    #--------------------------------------------------------------------------

    # * Object Initialization

    # type : type

    #--------------------------------------------------------------------------

    def initialize(type = 1)

    @type = type

    @base = nil

    @ingredient = []

    end

    #--------------------------------------------------------------------------

    # * Main Processing

    #--------------------------------------------------------------------------

    def main

    @help_window = Window_Help.new

    case @type

    when 1

    s = "Arma"

    when 2

    s = "Armatura"

    end

    @help_window.set_text("Seleziona l'"+s+" di base!")

    @item_window = Window_EC_EItem.new(@type)

    @ingredient_window = Window_Base.new(0,0,0,0)

    @status_window = Window_EC_IParameter.new(@type, nil)

    @used_window = Window_EC_IUsed.new(@type, @base, @ingredient)

    @ingredient_window.visible = false

    @ingredient_window.active = false

    @choice_window = Window_Command.new(160,["Conferma", "Esci"])

    @choice_window.x = 480

    @choice_window.y = 296

    @choice_window.z += 1

    @choice_window.active = false

    Graphics.transition

    loop do

    Graphics.update

    Input.update

    update

    if $scene != self

    break

    end

    end

    Graphics.freeze

    @help_window.dispose

    @item_window.dispose

    @ingredient_window.dispose

    @status_window.dispose

    @used_window.dispose

    @choice_window.dispose

    end

    #--------------------------------------------------------------------------

    # * Frame Update

    #--------------------------------------------------------------------------

    def update

    @help_window.update

    @item_window.update

    @ingredient_window.update

    @status_window.update

    @used_window.update

    @choice_window.update

    if Input.trigger?(Input::RIGHT)

    $game_system.se_play($data_system.cursor_se)

    @choice_window.active = true

    if @item_window.visible

    @item_window.active = false

    elsif @ingredient_window.visible

    @ingredient_window.active = false

    end

    return

    end

    if @item_window.active

    update_item

    return

    end

    if @ingredient_window.active

    update_ingredient

    return

    end

    if @choice_window.active

    update_choice

    end

    end

    #--------------------------------------------------------------------------

    # * Update Item

    #--------------------------------------------------------------------------

    def update_item

    if Input.trigger?(Input::B)

    $game_system.se_play($data_system.cancel_se)

    $scene = Scene_Map.new

    return

    end

    if Input.trigger?(Input::C)

    if@item_window.item != nil

    $game_system.se_play($data_system.decision_se)

    @base = @item_window.item

    case @type

    when 1

    $game_party.created_weapons.push($data_weapons[@base.id].dup)

    $data_weapons.push($data_weapons[@base.id].dup)

    id = $data_weapons.size - 1

    $data_weapons[id].id = id

    when 2

    $game_party.created_armors.push($data_armors[@base.id].dup)

    $data_armors.push($data_armors[@base.id].dup)

    id = $data_armors.size - 1

    $data_armors[id].id = id

    end

    update_status(id)

    update_used

    @item_window.active = false

    @item_window.visible = false

    @ingredient_window.dispose

    @ingredient_window = Window_EC_IItem.new(@base.id, @type)

    @ingredient_window.active = true

    @ingredient_window.visible = true

    @help_window.set_text("Seleziona gli ingredienti!")

    else

    $game_system.se_play($data_system.buzzer_se)

    end

    return

    end

    end

    #--------------------------------------------------------------------------

    # * Update Ingredient

    #--------------------------------------------------------------------------

    def update_ingredient

    if Input.trigger?(Input::B)

    $game_system.se_play($data_system.cancel_se)

    if @ingredient.size > 0

    @ingredient.pop

    update_used

    case @type

    when 1

    witem_effect

    when 2

    aitem_effect

    end

    else

    @item_window.active = true

    @item_window.visible = true

    @ingredient_window.active = false

    @ingredient_window.visible = false

    case @type

    when 1

    s = "Arma"

    $data_weapons.pop

    when 2

    s = "Armatura"

    $data_armors.pop

    end

    @base = nil

    update_used

    @help_window.set_text("Seleziona l'"+s+" di base!")

    end

    return

    end

    if Input.trigger?(Input::C)

    item = @ingredient_window.item

    case @type

    when 1

    a = Equip_Creator::Weapon_Slot[@base.id]

    when 2

    a = Equip_Creator::Armor_Slot[@base.id]

    end

    if @ingredient.size < a and @ingredient_window.item != nil

    if @ingredient.include?(item) == false

    $game_system.se_play($data_system.decision_se)

    @ingredient.push(item)

    update_used

    case @type

    when 1

    witem_effect

    when 2

    aitem_effect

    end

    else

    $game_system.se_play($data_system.buzzer_se)

    end

    else

    $game_system.se_play($data_system.buzzer_se)

    end

    return

    end

    end

    #--------------------------------------------------------------------------

    # * Update Choice

    #--------------------------------------------------------------------------

    def update_choice

    if Input.trigger?(Input::B) or Input.trigger?(Input::LEFT)

    $game_system.se_play($data_system.cursor_se)

    @choice_window.active = false

    if @item_window.visible

    @item_window.active = true

    elsif @ingredient_window.visible

    @ingredient_window.active = true

    end

    return

    end

    if Input.trigger?(Input::C)

    case @choice_window.index

    when 0

    if @ingredient.size > 0

    $game_system.se_play($data_system.decision_se)

    save_result

    for i in @ingredient

    $game_party.lose_item(i.id, 1)

    end

    if @type == 1

    $game_party.lose_weapon(@base.id, 1)

    id = ($data_weapons.size - 1)

    $game_party.gain_weapon(id, 1)

    elsif @type == 2

    $game_party.lose_armor(@base.id, 1)

    id = ($data_armors.size - 1)

    $game_party.gain_armor(id, 1)

    end

    $scene = Scene_Map.new

    else

    $game_system.se_play($data_system.buzzer_se)

    end

    when 1

    $game_system.se_play($data_system.cancel_se)

    if @base != nil

    case @type

    when 1

    $data_weapons.pop

    when 2

    $data_armors.pop

    end

    end

    $scene = Scene_Map.new

    end

    return

    end

    end

    #--------------------------------------------------------------------------

    # * Update Used Window

    #--------------------------------------------------------------------------

    def update_used

    @used_window.dispose

    @used_window = Window_EC_IUsed.new(@type, @base, @ingredient)

    end

    #--------------------------------------------------------------------------

    # * Update Status Window

    #--------------------------------------------------------------------------

    def update_status(id)

    @status_window.dispose

    @status_window = Window_EC_IParameter.new(@type, @base, id, @ingredient.size)

    end

    #--------------------------------------------------------------------------

    # * Witem Effect

    #--------------------------------------------------------------------------

    def witem_effect

    id = ($data_weapons.size - 1)

    $data_weapons[id] = $data_weapons[@base.id].dup

    w = $data_weapons[id]

    w.element_set = $data_weapons[@base.id].element_set.dup

    w.plus_state_set = $data_weapons[@base.id].plus_state_set.dup

    w.minus_state_set = $data_weapons[@base.id].minus_state_set.dup

    for a in @ingredient

    i = Equip_Creator::Weapon_Ingredient[@base.id][a.id]

    w.id = id

    w.atk += i[0]

    w.pdef += i[1]

    w.mdef += i[2]

    w.str_plus += i[3]

    w.dex_plus += i[4]

    w.agi_plus += i[5]

    w.int_plus += i[6]

    for j in i[7]

    w.element_set.push(j) if w.element_set.include?(j) == false

    end

    for j in i[8]

    w.plus_state_set.push(j) if w.plus_state_set.include?(j) == false

    end

    for j in i[9]

    w.minus_state_set.push(j) if w.minus_state_set.include?(j) == false

    end

    if i[10][0] == 1

    w.name += i[10][1]

    else

    w.name = i[10][1]

    end

    if i[11][0] == 1

    w.description += i[11][1]

    else

    w.description = i[11][1]

    end

    w.icon_name = i[12] if i[12] != ""

    w.animation2_id = i[13] if i[13] != 0

    end

    update_status(id)

    $game_party.created_weapons[($game_party.created_weapons.size-1)] = w.dup

    end

    #--------------------------------------------------------------------------

    # * Aitem Effect

    #--------------------------------------------------------------------------

    def aitem_effect

    id = ($data_armors.size - 1)

    $data_armors[id] = $data_armors[@base.id].dup

    w = $data_armors[id]

    w.guard_element_set = $data_armors[@base.id].guard_element_set.dup

    w.guard_state_set = $data_armors[@base.id].guard_state_set.dup

    for a in @ingredient

    i = Equip_Creator::Armor_Ingredient[@base.id][a.id]

    w.id = id

    w.eva += i[0]

    w.pdef += i[1]

    w.mdef += i[2]

    w.str_plus += i[3]

    w.dex_plus += i[4]

    w.agi_plus += i[5]

    w.int_plus += i[6]

    for j in i[7]

    w.guard_element_set.push(j) if w.guard_element_set.include?(j) == false

    end

    for j in i[8]

    w.guard_state_set.push(j) if w.guard_state_set.include?(j) == false

    end

    w.auto_state_id = i[9] if i[9] != 0

    if i[10][0] == 1

    w.name += i[10][1]

    else

    w.name = i[10][1]

    end

    if i[11][0] == 1

    w.description += i[11][1]

    else

    w.description = i[11][1]

    end

    w.icon_name = i[12] if i[12] != ""

    end

    $game_party.created_armors[($game_party.created_armors.size-1)] = w.dup

    update_status(id)

    end

    #--------------------------------------------------------------------------

    # * Save Result

    #--------------------------------------------------------------------------

    def save_result

    case @type

    when 1

    for i in 1...$data_classes.size

    if $data_classes.weapon_set.include?(@base.id)

    $data_classes.weapon_set.push(($data_weapons.size-1))

    $game_party.created_weapon_set.push(($data_weapons.size-1))

    end

    end

    when 2

    for i in 1...$data_classes.size

    if $data_classes.armor_set.include?(@base.id)

    $data_classes.armor_set.push(($data_armors.size-1))

    $game_party.created_armor_set.push(($data_armors.size-1))

    end

    end

    end

    end

    end

     

    questo primo serve alla fusione di un oggetto e un'arma per creare una nuova arma

     

    e questo secondo script serve a comprare le magie e le puoi comprare solo con requisiti specifici (soldi, livello, attacco)

     

     

    #==============================================================================

    # ** Skill Shop

    #------------------------------------------------------------------------------

    # SephirothSpawn

    # Modificato e tradotto da Extreme Z

    # 2006-04-06

    # Version 1

    #------------------------------------------------------------------------------

    # * Istruzioni :

    # ~ Settare le magie che devono essere disponibili in negozio

    # - $game_temp.skill_shop_skills[actor_id] = [skill_id, ... ]

    # Oppure

    # - $game_temp.skill_shop_skills[actor_id] = nil

    # - $game_temp.skill_shop_skills[0] = [skill_id, ...]

    # (0 è usato come default. Ogni PG con ID userà la lista delle magie standard di default)

    #

    # ~ Chiamare il negozio

    # - $scene = Scene_SkillShop.new(actor_index)

    #

    # ~ Scorrere i personaggi nel negozio

    # - Press L or R

    #------------------------------------------------------------------------------

    # * Personalizza :

    #

    # ~ Tipo di apprendimento (Must Use 1, can Use 2)

    # - Spend_Gold = true (On) or false (Off) Così,si spendono soldi per apprendere magie

    # - Spend_Skill_Points = true (On) or false (Off) Così,si spendono SP per apprendere magie(DIFETTOSO)

    #

    # ~ Costo:

    # - Costo in denaro

    # Skill_Gold_Cost = { skill_id => cost, ... }

    # - Costo in Sp

    # Skill_Point_Cost = { skill_id => cost, ... }

    #

    # ~ Settare le magie disponibili singolarmente per ogni PG

    # - Actor_Requirements = { skill_id => [actor_id, ...], ... }

    #

    # ~ Settare un livello minimo per l'apprendimento di una magia (DIFETTOSO)

    # - Level_Requirements = { skill_id => req_level, ... }

    #

    # ~ Per richiedere un altra magia per apprenderne un altra

    # - Previous_Skill_Requirments = { skill_id => [req_skill, ...], ... }

    #==============================================================================

     

    #==============================================================================

    # ** Skill_Shop

    #==============================================================================

     

    module Skill_Shop

    #--------------------------------------------------------------------------

    # * Purchasing Types

    #--------------------------------------------------------------------------

    Spend_Gold = true

    Spend_Skill_Points = true

    #--------------------------------------------------------------------------

    # * Skill Cost

    # ~ Skill_Gold_Cost = { skill_id => cost, ... }

    # ~ Skill_Point_Cost = { skill_id => cost, ... }

    #--------------------------------------------------------------------------

    Default_Skill_Gold_Cost = 500

    Skill_Gold_Cost = {

    1 => 800, 2 => 1600, 3 => 3200, 4 => 600,

    5 => 1200, 6 => 2400, 7 => 750, 8 => 1500,

    9 => 3000, 10 => 750, 11 => 1500, 12 => 3000,

    13 => 750, 14 => 1500, 15 => 3000, 16 => 750,

    17 => 1500, 18 => 3000, 19 => 750, 20 => 1500,

    21 => 3000, 22 => 750, 23 => 1500, 24 => 3000,

    25 => 800, 26 => 1600, 27 => 3200, 28 => 800,

    29 => 1600, 30 => 3200, 31 => 2000, 32 => 4000,

    33 => 300, 34 => 600, 35 => 350, 36 => 700,

    37 => 400, 38 => 800, 39 => 450, 40 => 900,

    41 => 500, 42 => 1000, 43 => 550, 44 => 1100,

    45 => 300, 46 => 650, 47 => 300, 48 => 650,

    49 => 300, 50 => 650, 51 => 300, 52 => 650,

    53 => 1800, 54 => 1700, 55 => 1600, 56 => 1500,

    57 => 1000, 58 => 1500, 59 => 2000, 60 => 3000,

    61 => 1000, 62 => 1500, 63 => 2000, 64 => 3000,

    65 => 1000, 66 => 1500, 67 => 2000, 68 => 3000,

    69 => 1000, 70 => 1500, 71 => 2000, 72 => 3000,

    73 => 1000, 74 => 1500, 75 => 2000, 76 => 3000,

    77 => 1000, 78 => 1500, 79 => 2000, 80 => 3000

    }

     

    #--------------------------------------------------------------------------

    # * Actor Requirements

    # ~ Actor_Requirements = { skill_id => [actor_id, ...], ... }

    #--------------------------------------------------------------------------

    Actor_Requirements = {

    57 => [1], 58 => [1], 59 => [1], 60 => [1],

    61 => [2], 62 => [2], 63 => [2], 64 => [2],

    65 => [3], 66 => [3], 67 => [3], 68 => [3],

    69 => [4], 70 => [4], 71 => [4], 72 => [4],

    73 => [5], 74 => [5], 75 => [5], 76 => [5],

    77 => [6], 78 => [6], 79 => [6], 80 => [6],

    }

    #--------------------------------------------------------------------------

    # * Level Requirements

    # ~ Level_Requirements = { skill_id => req_level, ... }

    #--------------------------------------------------------------------------

    Level_Requirements = {}

    #--------------------------------------------------------------------------

    # * Previous Skill Requirements

    # ~ Previous_Skill_Requirments = { skill_id => [req_skill, ...], ... }

    #--------------------------------------------------------------------------

    Previous_Skill_Requirments = {

    2 => [1], 3 => [1, 2],

    5 => [4],

    8 => [7], 9 => [7, 8],

    11 => [10], 12 => [10, 11],

    14 => [13], 15 => [13, 14],

    17 => [16], 18 => [16, 17],

    20 => [19], 21 => [19, 20],

    23 => [22], 24 => [22, 23],

    26 => [25], 27 => [25, 26],

    29 => [28], 30 => [28, 29], 32 => [31],

    58 => [57], 59 => [57, 58], 60 => [57, 58, 59],

    62 => [61], 63 => [61, 62], 64 => [61, 62, 63],

    66 => [65], 67 => [65, 66], 68 => [65, 66, 67],

    70 => [69], 71 => [69, 70], 72 => [69, 70, 71],

    74 => [73], 75 => [73, 74], 76 => [73, 74, 75],

    78 => [77], 79 => [77, 78], 80 => [77, 78, 79]

    }

    end

     

    #==============================================================================

    # ** Game_Temp

    #==============================================================================

     

    class Game_Temp

    #--------------------------------------------------------------------------

    # * Public Instance Variables

    #--------------------------------------------------------------------------

    attr_accessor :skill_shop_skills

    #--------------------------------------------------------------------------

    # * Alias Listings

    #--------------------------------------------------------------------------

    alias seph_skillshop_gtemp_init initialize

    #--------------------------------------------------------------------------

    # * Object Initialization

    #--------------------------------------------------------------------------

    def initialize

    # Original Initialization

    seph_skillshop_gtemp_init

    # Sets Skills Shop Skills List

    @skill_shop_skills = {0 => (1...$data_skills.size).to_a}

    end

    end

     

    #==============================================================================

    # ** Game_Actor

    #==============================================================================

     

    class Game_Actor < Game_Battler

    #--------------------------------------------------------------------------

    # * Public Instance Variables

    #--------------------------------------------------------------------------

    attr_accessor :skill_shop_points

    #--------------------------------------------------------------------------

    # * Alias Listings

    #--------------------------------------------------------------------------

    alias seph_skillshop_gactor_setup setup

    alias seph_skillshop_gactor_skills skills

    #--------------------------------------------------------------------------

    # * Setup

    #--------------------------------------------------------------------------

    def setup(actor_id)

    # Sets Up Skill Shop Skills Array

    @skill_shop_skills = []

    # Sets Up Skill Points

    @skill_shop_points = 0

    # Original Setup Method

    seph_skillshop_gactor_setup(actor_id)

    end

    #--------------------------------------------------------------------------

    # * Skills

    #--------------------------------------------------------------------------

    def skills

    # Gets Original Skills

    s = seph_skillshop_gactor_skills.dup

    # Adds Skill Shop Skills

    s << @skill_shop_skills

    # Returns Skills

    return s.flatten.uniq.sort.dup

    end

    #--------------------------------------------------------------------------

    # * Learn Shop Skill

    #--------------------------------------------------------------------------

    def learn_shop_skill(skill_id)

    # Unless Skill Already Learned

    unless @skill_shop_skills.include?(skill_id)

    # Learn Shop Skill

    @skill_shop_skills << skill_id

    end

    end

    #--------------------------------------------------------------------------

    # * Can Learn Shop Skill Check

    #--------------------------------------------------------------------------

    def can_learn_shop_skill?(skill_id)

    # If Skill Learned

    if self.skills.include?(skill_id)

    return false

    end

    # If Gold Cost

    if Skill_Shop::Spend_Gold

    if Skill_Shop::Skill_Gold_Cost.has_key?(skill_id)

    if $game_party.gold < Skill_Shop::Skill_Gold_Cost[skill_id]

    return false

    end

    else

    if $game_party.gold < Skill_Shop::Default_Skill_Gold_Cost

    return false

    end

    end

    end

    # Actor Requirement

    if Skill_Shop::Actor_Requirements.has_key?(skill_id)

    unless Skill_Shop::Actor_Requirements[skill_id].include?(@actor_id)

    return false

    end

    end

    # Level Requirement

    if Skill_Shop::Level_Requirements.has_key?(skill_id)

    if @level < Skill_Shop::Level_Requirements[skill_id]

    return false

    end

    end

    # Previous Skill Requirement

    if Skill_Shop::Previous_Skill_Requirments.has_key?(skill_id)

    for s_id in Skill_Shop::Previous_Skill_Requirments[skill_id]

    unless self.skills.include?(s_id)

    return false

    end

    end

    end

    return true

    end

    end

     

    #==============================================================================

    # ** Window_SkillShop_SkillList

    #==============================================================================

     

    class Window_SkillShop_SkillList < Window_Selectable

    #--------------------------------------------------------------------------

    # * Object Initialization

    #--------------------------------------------------------------------------

    def initialize(actor_id)

    super(0, 64, 224, 320)

    @actor = $game_party.actors[actor_id]

    create_skills_list

    refresh

    self.index = 0

    end

    #--------------------------------------------------------------------------

    # * Create Skills List

    #--------------------------------------------------------------------------

    def create_skills_list

    # Check for Personalize Skills List

    if $game_temp.skill_shop_skills.has_key?(@actor.id)

    unless $game_temp.skill_shop_skills[@actor.id].nil?

    @skills = $game_temp.skill_shop_skills[@actor.id]

    end

    end

    # Default Skill List

    if @skills.nil?

    @skills = $game_temp.skill_shop_skills[0]

    end

    # Sets Item Max

    @item_max = @skills.size

    if @item_max > 0

    self.contents = Bitmap.new(192, @item_max * 32)

    end

    end

    #--------------------------------------------------------------------------

    # * Return Skill Id

    #--------------------------------------------------------------------------

    def skill_id

    return @skills[self.index]

    end

    #--------------------------------------------------------------------------

    # * Refresh

    #--------------------------------------------------------------------------

    def refresh

    self.contents.clear

    for i in 0...@item_max

    draw_item(i)

    end

    end

    #--------------------------------------------------------------------------

    # * Draw Item

    #--------------------------------------------------------------------------

    def draw_item(index)

    # Sets Skill

    skill = $data_skills[@skills[index]]

    # Can Learn Flag

    can_learn = @actor.can_learn_shop_skill?(skill.id)

    # Skill Icon

    bitmap = RPG::Cache.icon(skill.icon_name)

    # Draws Skill Icon

    self.contents.blt(4, index * 32 + 4, bitmap, Rect.new(0, 0, 24, 24), can_learn ? 255 : 160)

    # Font Color

    self.contents.font.color = can_learn ? normal_color : disabled_color

    # Draws Skill Name

    self.contents.draw_text(32, index * 32, 160, 32, skill.name)

    end

    end

     

    #==============================================================================

    # ** Window_SkillShop_Cost

    #==============================================================================

     

    class Window_SkillShop_Cost < Window_Base

    #--------------------------------------------------------------------------

    # * Object Initialization

    #--------------------------------------------------------------------------

    def initialize(actor_id, skill_id)

    super(0, 384, 224, 96)

    self.contents = Bitmap.new(192, 64)

    self.opacity = 0

    @actor = $game_party.actors[actor_id]

    refresh(skill_id)

    end

    #--------------------------------------------------------------------------

    # * Refresh

    #--------------------------------------------------------------------------

    def refresh(skill_id)

    self.contents.clear

    # Gold & SP Cost

    if Skill_Shop::Spend_Gold && Skill_Shop::Spend_Skill_Points

    self.contents.font.color = system_color

    self.contents.draw_text(4, 0, 192, 32, "#{$data_system.words.gold} Cost:")

    self.contents.draw_text(4, 32, 192, 32, '')

    gold = $game_party.gold - (Skill_Shop::Skill_Gold_Cost.has_key?(skill_id) ?

    Skill_Shop::Skill_Gold_Cost[skill_id] : Skill_Shop::Default_Skill_Gold_Cost)

    self.contents.font.color = gold >= 0 ? text_color(1) : text_color(2)

    self.contents.draw_text(- 4, 0, 192, 32, gold.to_s, 2)

     

    # Only Gold Cost

    elsif Skill_Shop::Spend_Gold

    self.contents.font.color = system_color

    self.contents.draw_text(4, 0, 192, 32, "#{$data_system.words.gold} Cost:")

    gold = $game_party.gold - (Skill_Shop::Skill_Gold_Cost.has_key?(skill_id) ?

    Skill_Shop::Skill_Gold_Cost[skill_id] : Skill_Shop::Default_Skill_Gold_Cost)

    self.contents.font.color = gold >= 0 ? text_color(1) : text_color(2)

    self.contents.draw_text(- 4, 32, 192, 32, gold.to_s, 2)

    elsif Skill_Shop::Spend_Skill_Points

    self.contents.font.color = system_color

    self.contents.draw_text(4, 0, 192, 32, '')

    self.contents.font.color = normal_color

    sp = @actor.skill_shop_points - Skill_Shop::Skill_Point_Cost.has_key?(skill_id) ?

    Skill_Shop::Skill_Point_Cost[skill_id] : Skill_Shop::Default_SP_Cost

    self.contents.font.color = sp >= 0 ? text_color(1) : text_color(2)

    self.contents.draw_text(- 4, 32, 192, 32, sp.to_s, 2)

    end

    end

    end

     

    #==============================================================================

    # ** Window_SkillShop_SkillData

    #==============================================================================

     

    class Window_SkillShop_SkillData < Window_Base

    #--------------------------------------------------------------------------

    # * Object Initialization

    #--------------------------------------------------------------------------

    def initialize(actor_index, skill_id)

    super(224, 64, 416, 416)

    self.contents = Bitmap.new(384, 384)

    @actor = $game_party.actors[actor_index]

    refresh(skill_id)

    end

    #--------------------------------------------------------------------------

    # * Disabled System Color

    #--------------------------------------------------------------------------

    def disabled_system_color

    color = system_color

    color.alpha = disabled_color.alpha

    return color

    end

    #--------------------------------------------------------------------------

    # * Refresh

    #--------------------------------------------------------------------------

    def refresh(skill_id)

    self.contents.clear

    # Gets Skills

    skill = $data_skills[skill_id]

    # Can Learn Flag

    can_learn = @actor.can_learn_shop_skill?(skill.id)

    # Gets Icon

    bitmap = RPG::Cache.icon(skill.icon_name)

    # Draws Skill Icon

    self.contents.blt(4, 4, bitmap, Rect.new(0, 0, 24, 24), can_learn ? 255 : 160)

    # Draws Skill Name

    self.contents.font.color = can_learn ? normal_color : disabled_color

    self.contents.draw_text(32, 0, 352, 32, skill.name)

    # Draws SP Cost

    self.contents.font.color = can_learn ? system_color : disabled_system_color

    self.contents.draw_text(272, 0, 112, 32, "#{$data_system.words.sp} :")

    self.contents.font.color = can_learn ? normal_color : disabled_color

    self.contents.draw_text(- 4, 0, 384, 32, skill.sp_cost.to_s, 2)

    # Draws Descritpion

    self.contents.font.color = can_learn ? system_color : disabled_system_color

    self.contents.draw_text(4, 32, 60, 32, 'Desc. :')

    self.contents.font.color = can_learn ? normal_color : disabled_color

    self.contents.draw_text(64, 32, 320, 32, skill.description)

    # Draws Scope

    case skill.scope

    when 0; scope = 'Nesuno'

    when 1; scope = 'Un nemico'

    when 2; scope = 'Tutti i nemici'

    when 3; scope = 'Un alleato'

    when 4; scope = 'Tutti gli alleati'

    when 5; scope = "Alleato in KO"

    when 6; scope = "Più alleati in KO"

    when 7; scope = 'Se stesso'

    end

    self.contents.font.color = can_learn ? system_color : disabled_system_color

    self.contents.draw_text(4, 64, 186, 32, 'Obiettivo :')

    self.contents.font.color = can_learn ? normal_color : disabled_color

    self.contents.draw_text(- 4, 64, 190, 32, scope, 2)

    # Draws Occassion

    case skill.occasion

    when 0; occ = 'Sempre'

    when 1; occ = 'In Battaglia'

    when 2; occ = 'In Menu'

    when 3; occ = 'Mai'

    end

    self.contents.font.color = can_learn ? system_color : disabled_system_color

    self.contents.draw_text(194, 64, 186, 32, 'Usabile :')

    self.contents.font.color = can_learn ? normal_color : disabled_color

    self.contents.draw_text(190, 64, 190, 32, occ, 2)

    # Draws Skill Power & Hit Probability

    self.contents.font.color = can_learn ? system_color : disabled_system_color

    self.contents.draw_text(4, 96, 186, 32, 'Potenza :')

    self.contents.draw_text(194, 96, 186, 32, 'Successo %')

    self.contents.font.color = can_learn ? normal_color : disabled_color

    self.contents.draw_text(- 4, 96, 190, 32, skill.power.to_s, 2)

    self.contents.draw_text(190, 96, 190, 32, skill.hit.to_s, 2)

    # Cash Cost

    if Skill_Shop::Spend_Gold

    cost = Skill_Shop::Skill_Gold_Cost.has_key?(skill_id) ?

    Skill_Shop::Skill_Gold_Cost[skill_id] : Skill_Shop::Default_Skill_Gold_Cost

    self.contents.font.color = can_learn ? system_color : disabled_system_color

    self.contents.draw_text(4, 128, 186, 32, "Costo in #{$data_system.words.gold}:")

    self.contents.font.color = can_learn ? normal_color : disabled_color

    self.contents.draw_text(- 4, 128, 190, 32, cost.to_s, 2)

    end

    # Draws Level Requried

    self.contents.font.color = can_learn ? system_color : disabled_system_color

    self.contents.draw_text(95, 160, 130, 32, 'Livello richiesto :')

    req_lvl = Skill_Shop::Level_Requirements.has_key?(skill_id) ?

    Skill_Shop::Level_Requirements[skill_id].to_s : 'Nessuno'

    self.contents.font.color = can_learn ? normal_color : disabled_color

    self.contents.draw_text(95, 160, 190, 32, req_lvl, 2)

    # Actor Requirment

    self.contents.font.color = can_learn ? system_color : disabled_system_color

    self.contents.draw_text(0, 192, 384, 32, 'Apprendibile da', 1)

    self.contents.font.color = can_learn ? normal_color : disabled_color

    if Skill_Shop::Actor_Requirements.has_key?(skill_id)

    actors = Skill_Shop::Actor_Requirements[skill_id].dup

    actors.collect! { |x| $data_actors[x].name}

    actors = actors.join(' - ')

    else

    actors = 'Tutti'

    end

    self.contents.draw_text(0, 224, 384, 32, actors, 1)

    # Draws Previous Skill Requirements

    self.contents.font.color = can_learn ? system_color : disabled_system_color

    self.contents.draw_text(0, 256, 384, 32, 'Magia richiesta', 1)

    self.contents.font.color = can_learn ? normal_color : disabled_color

    if Skill_Shop::Previous_Skill_Requirments.has_key?(skill_id)

    skills = Skill_Shop::Previous_Skill_Requirments[skill_id].dup

    skills.collect! {|x| $data_skills[x]}

    for i in 0...skills.size

    skill = skills

    x = 4 + i % 2 * 190

    y = i / 2 * 32 + 288

    bitmap = RPG::Cache.icon(skill.icon_name)

    self.contents.blt(x + 4, y + 4, bitmap, Rect.new(0, 0, 24, 24), can_learn ? 255 : 160)

    self.contents.draw_text(x + 32, y, 154, 32, skill.name)

    end

    else

    self.contents.draw_text(0, 288, 384, 32, 'Nessuna magia richiesta', 1)

    end

    end

    end

     

    #==============================================================================

    # ** Scene_SkillShop

    #==============================================================================

     

    class Scene_SkillShop

    #--------------------------------------------------------------------------

    # * Object Initialization

    #--------------------------------------------------------------------------

    def initialize(actor_index = 0)

    @actor_index = actor_index

    @actor = $game_party.actors[actor_index]

    end

    #--------------------------------------------------------------------------

    # * Main Processing

    #--------------------------------------------------------------------------

    def main

    # Creates Help Window

    @help_window = Window_Help.new

    @help_window.set_text("Benvenuto nel mio Negozio di magie #{@actor.name} - Scegli la magia che vuoi apprendere", 1)

    # Creates Skill List

    @skill_list_window = Window_SkillShop_SkillList.new(@actor_index)

    # Creates Skill Shop Cost Window

    @skill_cost_window = Window_SkillShop_Cost.new(@actor_index, @skill_list_window.skill_id)

    # Creates Skill Data Window

    @skill_data_window = Window_SkillShop_SkillData.new(@actor_index, @skill_list_window.skill_id)

    # Confirmation Window

    @confirmation_window = Window_Command.new(128, ['Si', 'No'])

    @confirmation_window.x, @confirmation_window.y = 256, 208

    @confirmation_window.z = 1000

    @confirmation_window.visible = @confirmation_window.active = false

    # Scene Objects

    @scene_objects = [@help_window, @skill_list_window, @skill_cost_window,

    @skill_data_window, @confirmation_window]

    # Execute transition

    Graphics.transition

    # Main loop

    loop do

    # Update game screen

    Graphics.update

    # Update input information

    Input.update

    # Updates Scene Objects

    @scene_objects.each { |x| x.update }

    # Frame update

    update

    # Abort loop if screen is changed

    break if $scene != self

    end

    # Prepare for transition

    Graphics.freeze

    # Dispose Scene Objects

    @scene_objects.each { |x| x.dispose }

    end

    #--------------------------------------------------------------------------

    # * Frame Update

    #--------------------------------------------------------------------------

    def update

    # If Skill List Window Active

    if @skill_list_window.active

    update_skill_select

    return

    # If Confirmation Window Active

    elsif @confirmation_window.active

    update_confirmation

    return

    end

    end

    #--------------------------------------------------------------------------

    # * Frame Update : Skill Select

    #--------------------------------------------------------------------------

    def update_skill_select

    # If Up or Down Is Pressed

    if Input.repeat?(Input::UP) || Input.repeat?(Input::DOWN)

    # Refresh Windows

    @skill_cost_window.refresh(@skill_list_window.skill_id)

    @skill_data_window.refresh(@skill_list_window.skill_id)

    end

    # If B Button Is Pressed

    if Input.trigger?(Input::B)

    # Play cancel SE

    $game_system.se_play($data_system.cancel_se)

    # Switch to map screen

    $scene = Scene_Zaino.new(3)

    return

    end

    # If C Button Is Pressed

    if Input.trigger?(Input::C)

    # Can learn Check

    unless @actor.can_learn_shop_skill?(@skill_list_window.skill_id)

    # Play Buzzer SE

    $game_system.se_play($data_system.buzzer_se)

    # Set Help Text

    @help_window.set_text('Non la puoi imparare', 1)

    return

    end

    # Play Decision SE

    $game_system.se_play($data_system.decision_se)

    # Turn Off Skill List Window

    @skill_list_window.active = false

    # Resets Index

    @confirmation_window.index = 0

    # Turns Window On

    @confirmation_window.visible = @confirmation_window.active = true

    # Gets Skill Name

    skill_name = $data_skills[@skill_list_window.skill_id].name

    # Updates Help Text

    @help_window.set_text("Vuoi imparare #{skill_name} #{@actor.name}?", 1)

    end

    # If L is Pressed

    if Input.trigger?(Input::LEFT)

    # Play Cursor SE

    $game_system.se_play($data_system.cursor_se)

    # Changes Actor Index

    @actor_index == 0 ? @actor_index = $game_party.actors.size - 1: @actor_index -= 1

    # Resets Scene

    $scene = Scene_SkillShop.new(@actor_index)

    end

    # If R is Pressed

    if Input.trigger?(Input::RIGHT)

    # Play Cursor SE

    $game_system.se_play($data_system.cursor_se)

    # Changes Actor Index

    @actor_index == $game_party.actors.size - 1 ? @actor_index = 0 : @actor_index += 1

    # Resets Scene

    $scene = Scene_SkillShop.new(@actor_index)

    end

    end

    #--------------------------------------------------------------------------

    # * Frame Update : Confirmation

    #--------------------------------------------------------------------------

    def update_confirmation

    # If B Button Pressed

    if Input.trigger?(Input::B)

    # Play cancel SE

    $game_system.se_play($data_system.cancel_se)

    # Turn On Skill List Window

    @skill_list_window.active = true

    # Turns Off Confirmation Window

    @confirmation_window.visible = @confirmation_window.active = false

    # Updates Help Text

    @help_window.set_text("Benvanuto #{@actor.name} - Scegli quale magia vuoi apprendere", 1)

    end

    # If C Button Pressed

    if Input.trigger?(Input::C)

    # Play Decision SE

    $game_system.se_play($data_system.decision_se)

    # Gets Skill ID

    skill_id = @skill_list_window.skill_id

    # Lose Gold

    if Skill_Shop::Spend_Gold

    cost = Skill_Shop::Skill_Gold_Cost.has_key?(skill_id) ?

    Skill_Shop::Skill_Gold_Cost[skill_id] : Skill_Shop::Default_Skill_Gold_Cost

    $game_party.lose_gold(cost)

    end

    # Learn Skill

    @actor.learn_shop_skill(skill_id)

    # Refresh Windows

    @skill_list_window.refresh

    @skill_cost_window.refresh(@skill_list_window.skill_id)

    @skill_data_window.refresh(@skill_list_window.skill_id)

    # Turn On Skill List Window

    @skill_list_window.active = true

    # Turns Off Confirmation Window

    @confirmation_window.visible = @confirmation_window.active = false

    # Gets Skill Name

    skill_name = $data_skills[@skill_list_window.skill_id].name

    # Updates Help Text

    @help_window.set_text("#{@actor.name} impara #{skill_name}!", 1)

    end

    end

    end

     

     

     

    Grazie mille

×
×
  • Create New...