O TEMA DO FÓRUM ESTÁ EM MANUTENÇÃO. FEEDBACKS AQUI: ACESSAR

Dúvida sobre script XS(Ace)

Iniciado por denisbts, 25/01/2013 às 17:22

25/01/2013 às 17:22 Última edição: 25/01/2013 às 17:47 por Raizen
Ai galera mi deem um ajuda plz ?.... é qui peguei um codigo da internet i ele não ta funcionando direito ta dando bug no menu atributio... i como vocês sabem eu ainda não tenho conheçimento suficiente sobre isso :p.. bom o erro dele é na linha 235 si eu não me engano

Aqui vai o code
#==============================================================================
#   XaiL System - Attribute System
#   Author: Nicke
#   Created: 01/08/2012
#   Edited: 28/12/2012
#   Version: 1.1b
#==============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ? Materials but above ? Main. Remember to save.
#==============================================================================
# Requires: XS - Core Script.
# Numeric Class by IceDragon.
#==============================================================================
# Attribute system. This script will allow you to gain attribute points each
# time an actor gains a level. Those points can then be spend as the user wish.
# For example, increase the health of the character or the magic resistance.
#
# To call this scene in the menu or any time during the game, use the following
# script call:
# SceneManager.call(Scene_Attribute)
#
# Use the following script calls to reward/remove points.
# $game_party.attribute(actor_id, value, type = :gain)
# $game_party.attribute(1, 5)
# $game_party.attribute(2, 5, :lose)
# This will return nil if the specified actor isn't in the party.
#
# Do this to check how many attribute points an actor have:
# $game_party.attribute?(actor_id)
# $game_party.attribute?(1)
# This will return nil if the specified actor isn't in the party.
#
# You can change the actor points, icons, cost, max stats etc in the settings.
# This script also support own background for the attribute windows.
#
# Note: At the scene you can change actor using Q or W like in the status scene.
#
# *** Only for RPG Maker VX Ace. ***
#==============================================================================
($imported ||= {})["XAIL-ATTRIBUTE-SYSTEM"] = true

module XAIL
  module ATTRIBUTE_SYSTEM
  #--------------------------------------------------------------------------#
  # * Settings
  #--------------------------------------------------------------------------#
    # FONT = name
    FONT = ["Anklada™", "Verdana"]
    
    # ATTRIBUTE LIST:
    # LIST[id] = [symbol, stats_increase, cost, enabled]
    LIST = [] # Don't remove!
    LIST[0]   = [:hp,       25,    1, true]
    LIST[1]   = [:mp,       25,    1, true]
    LIST[2]   = [:atk,      10,    1, true]
    LIST[3]   = [:def,      5,     2, true]
    LIST[4]   = [:magic,    10,    3, true]
    LIST[5]   = [:res,       3,    2, true]
    LIST[6]   = [:agl,      10,    1, true]
    LIST[7]   = [:luk,       2,    5, true]
    LIST[8]   = [:hit,    0.01,   15, true]
    LIST[9]   = [:eva,    0.01,   15, true]
    LIST[10]  = [:cri,    0.01,   15, true]
    LIST[11]  = [:cev,    0.01,   15, true]
    LIST[12]  = [:mev,    0.01,   15, true]
    LIST[13]  = [:mrf,    0.01,   15, true]

    # ACTOR_POINTS:
    # Distribute how many starting points each actor should have when the game
    # starts.
    # ACTOR_POINTS[id] => number
    ACTOR_POINTS = {
    1  => 5,
    2  => 5, 
    3  => 5,
    4  => 5,
    5  => 5,
    6  => 5,
    7  => 5,
    8  => 5,
    9  => 5,
    10 => 5
    } # Don't remove this line!
    
    # attr_points = formula
    # Attribute points formula.
    # Set how many attribute points an actor should gain per level.
    # Default: Based on actor's luck divided by 2.
    def self.attr_points(actor)
      case $game_actors[actor.id].id
      when 1 ; $game_actors[actor.id].luk / 2
      when 2 ; $game_actors[actor.id].luk / 2
      # // Add more actor_id's here.
      else ; 0 # // Prevent error if nil as in actor id isn't in party.
      end
    end
    
    # attr_max = formula
    # Set the max attribute points an actor can gain.
    # Default: Based on actor's luck times magic attack power.
    def self.attr_max(actor)
      case $game_actors[actor.id].id
      when 1 ; $game_actors[actor.id].luk * $game_actors[actor.id].mat
      when 2 ; $game_actors[actor.id].luk * $game_actors[actor.id].mat
      # // Add more actor_id's here.
      else   ; 0 # // Prevent error if nil as in actor id isn't in party.
      end
    end
    
    # LIST_ICONS[id] = icon_id
    # Set the list icon_id. (optional)
    LIST_ICONS = []
    LIST_ICONS[0] = 32 # HP
    LIST_ICONS[1] = 33 # MP
    LIST_ICONS[2] = 34 # ATK
    LIST_ICONS[3] = 35 # DEF
    LIST_ICONS[4] = 36 # MAGIC
    LIST_ICONS[5] = 37 # RES
    LIST_ICONS[6] = 38 # AGL
    LIST_ICONS[7] = 39 # LUK
    LIST_ICONS[8] = 4141 # HIT
    LIST_ICONS[9] = 4157 # EVA
    LIST_ICONS[10] = 4164 # CRI
    LIST_ICONS[11] = 4170 # CEV
    LIST_ICONS[12] = 4172 # MEV
    LIST_ICONS[13] = 4152 # MRF
    
    # PARAM_ICONS[id] = icon_id
    # Set the param icon_id. (optional)
    PARAM_ICONS = []
    PARAM_ICONS[0] = 4149 # HP
    PARAM_ICONS[1] = 4132 # MP
    PARAM_ICONS[2] = 4145 # ATK
    PARAM_ICONS[3] = 4150 # DEF
    PARAM_ICONS[4] = 4147 # MAGIC
    PARAM_ICONS[5] = 4148 # RES
    PARAM_ICONS[6] = 4140 # AGL
    PARAM_ICONS[7] = 4131 # LUK
    PARAM_ICONS[8] = 4138 # EXP
    
    # XPARAM_ICONS[id] = icon_id
    # Set the xparam icon_id. (optional)
    XPARAM_ICONS = []
    XPARAM_ICONS[0] = 4141 # HIT RATE
    XPARAM_ICONS[1] = 4157 # EVASION RATE
    XPARAM_ICONS[2] = 4164 # CRITICAL RATE
    XPARAM_ICONS[3] = 4170 # CRITICAL EVASION
    XPARAM_ICONS[4] = 4172 # MAGIC EVASION
    XPARAM_ICONS[5] = 4152 # MAGIC REFLECTION
    
    # PARAM_BAR_COLOR = rgba(255,255,255,255)
    # Set the color of the health, mana and parameter bars.
    PARAM_BAR_COLOR = [Color.new(60,60,120,150), Color.new(200,200,200,180)]
    PARAM_BAR_HP = [Color.new(225,50,50,64), Color.new(235,75,75,175)]
    PARAM_BAR_MP = [Color.new(50,50,225,64), Color.new(75,75,235,175)]
    
    # PARAM_TXT_COLOR = rgba(255,255,255,255)
    # Set the color of the parameter text.
    PARAM_TXT_COLOR = [Color.new(255,255,255), Color.new(235,215,0)]
    
    # PARAM_LINE_COLOR = rgba(255,255,255,255)
    # Set the color of the horizontal line.
    PARAM_LINE_COLOR = [Color.new(255,255,255,200), Color.new(0,0,0,128)]
    
    # STAT_GROWTH = true/false
    # Enable/disable the stat growth an actor normally have. i.e when levelling
    # up you gain attributes to each parameter automatically.
    # Note: Bare in mind that you cannot change this settings during the game
    # so make sure you decide if you want this option enabled or not.
    STAT_GROWTH = true
    
    # INITIAL_LEVEL = number
    # Set the initial starting level if stat growth is disabled.
    INITIAL_LEVEL = 1
    
    # ATTR_SWITCH = number
    # Switch to manually disable gaining attributes points on levelling up.
    ATTR_SWITCH = 10
    
    # MENU_CMD = true/false
    # Enable this to create a attribute command to the default menu. (optional)
    MENU_CMD = true
    
    # MENU_NAME = string
    # Set this to the name you want on the command for the default menu. (optional)
    MENU_NAME = "Attribute"
    
    # Transition, nil to use default.
    # TRANSITION [ SPEED, TRANSITION, OPACITY ]
    # TRANSITION = [40, "Graphics/Transitions/1", 50]
    TRANSITION = nil
    
    # Background image (System folder)
    # Note: You might want to decrease the opacity as well as arrange 
    # the windows so that you can properly see the background.
    # Set to nil to use default.
    BACK = nil
    
  end
end
# *** Don't edit below unless you know what you are doing. ***
#==============================================================================#
# ** Error Handler
#==============================================================================#
class XS_Error
  unless $imported["XAIL-XS-CORE"]
    # // Error handler when XS - Core is not installed.
    msg = "The script %s requires the latest version of XS - Core in order to function properly."
    name = "XS - Attribute System"
    msgbox(sprintf(msg, name))
    exit
  end
end
#==============================================================================#
# ** Game_BattlerBase
#==============================================================================#
class Game_BattlerBase
  
  alias xail_att_sys_gm_battlerbase_init initialize 
  def initialize(*args, &block)
    # // Method to initialize.
    clear_xparam_plus
    xail_att_sys_gm_battlerbase_init(*args, &block)
  end
  
  def xparam(xparam_id)
    # // Method to get xparam.
    (features_sum(FEATURE_XPARAM, xparam_id) + xparam_plus(xparam_id)).clamp(0,100).round_to(2)
  end
  
  def xparam_plus(xparam_id)
    # // Method to get xparam plus.
    @xparam_plus[xparam_id]
  end
  
  def clear_xparam_plus
    # // Method to clear xparam plus.
    @xparam_plus = [0] * 10
  end
  
  def add_xparam(xparam_id, value)
    # // Method to add xparam.
    @xparam_plus[xparam_id] += value
    refresh
  end
  
end
#==============================================================================#
# ** Game_Actor
#==============================================================================#
class Game_Actor < Game_Battler
  
  attr_accessor :attribute_spent
  
  # // Method to initialize the window.
  alias xail_att_sys_gm_actor_init initialize
  def initialize(actor_id)
    xail_att_sys_gm_actor_init(actor_id)
    @attribute_spent = 0
  end
  
  alias xail_att_sys_gm_actor_setup setup
  def setup(actor_id)
    # // Method to setup.
    xail_att_sys_gm_actor_setup(actor_id)
    clear_xparam_plus
  end
  
  alias xail_att_sys_gm_actor_lvl_up level_up
  def level_up(*args, &block)
    # // Method when a actor level up.
    xail_att_sys_gm_actor_lvl_up(*args, &block)
    gain_attribute(actor.id, XAIL::ATTRIBUTE_SYSTEM.attr_points(actor)) unless $game_switches[XAIL::ATTRIBUTE_SYSTEM::ATTR_SWITCH]
  end
  
  def param_base(param_id)
    # // Method override to set param base.
    if XAIL::ATTRIBUTE_SYSTEM::STAT_GROWTH
      self.class.params[param_id, @level]
    else
      self.class.params[param_id, XAIL::ATTRIBUTE_SYSTEM::INITIAL_LEVEL]
    end
  end
  
  def gain_attribute(actor_id, value, type = :gain)
    # // Method to gain attribute.
    points = XAIL::ATTRIBUTE_SYSTEM::ACTOR_POINTS
    case type
    when :gain
      points[actor_id] = (points[actor_id] + value).clamp(0, XAIL::ATTRIBUTE_SYSTEM.attr_max(actor))
    when :lose
      points[actor_id] = (points[actor_id] - value).clamp(0, XAIL::ATTRIBUTE_SYSTEM.attr_max(actor))
    end
  end
  
  def attribute?(actor_id)
    # // Method to check actor's attribute.
    XAIL::ATTRIBUTE_SYSTEM::ACTOR_POINTS[actor_id]
  end

end
#==============================================================================#
# ** Game_Party
#==============================================================================#
class Game_Party < Game_Unit
  
  def attribute(actor_id, value, type = :gain)
    # // Method to gain/lose attributes.
    # Will return nil if actor is not in the party.
    return unless members.include?($game_actors[actor_id])
    return $game_actors[actor_id].gain_attribute(actor_id, value, type)
  end
  
  def attribute?(actor_id)
    # // Method to check actor's attribute.
    # Will return nil if actor is not in the party.
    return unless members.include?($game_actors[actor_id])
    return $game_actors[actor_id].attribute?(actor_id)
  end
  
end
#==============================================================================#
# ** Window_Base
#==============================================================================#
class Window_Base < Window
  
  def draw_current_and_max_values_ex(x, y, width, current, max, color1, color2)
    # // New method to draw current and max values.
    change_color(color1)
    xr = x + width
    if width < 96
      draw_text(xr - 40, y, 42, line_height, current, 0)
    else
      draw_text(32, y, 42, line_height, current, 0)
      change_color(color2)
      draw_text(xr - 36, y, 42, line_height, max, 2)
    end
  end
  
  def draw_actor_stats(actor, stat, x, y, color1, color2, width = 339)
    # // New method to draw actor hp & mp.
    case stat
    when :hp
      rate = actor.hp_rate
      vocab = Vocab::hp_a
      values = [actor.hp, actor.mhp]
    when :mp
      rate = actor.mp_rate
      vocab = Vocab::mp_a
      values = [actor.mp, actor.mmp]
    end
    contents.font.name = XAIL::ATTRIBUTE_SYSTEM::FONT
    contents.font.size = 16 # // Override font size.
    contents.font.bold = true
    contents.font.shadow = false
    draw_gauge_ex(x, y - 14, width, 20, rate, color1, color2)
    contents.font.color = XAIL::ATTRIBUTE_SYSTEM::PARAM_TXT_COLOR[0]
    draw_text(x, y, contents.width, line_height, vocab, 1)
    draw_current_and_max_values_ex(x - 8, y, width, values[0], values[1],
    XAIL::ATTRIBUTE_SYSTEM::PARAM_TXT_COLOR[1], XAIL::ATTRIBUTE_SYSTEM::PARAM_TXT_COLOR[1])
    reset_font_settings
  end
  
end
#==============================================================================#
# ** Window_Attribute_List
#==============================================================================#
class Window_Attribute_List < Window_Command
  
  def standard_padding
    # // Method to set padding.
    return 8
  end
  
  def window_width
    # // Method to set the window width.
    return 160
  end
  
  def window_height
    # // Method to set the window height.
    return Graphics.height - 104
  end
  
  def menu_color(color, enabled = true)
    # // Method to set the color and alpha if not enabled.
    contents.font.color.set(color)
    contents.font.color.alpha = 100 unless enabled
  end
  
  def draw_item(index)
    # // Method to draw the command item.
    contents.font.name = XAIL::ATTRIBUTE_SYSTEM::FONT
    contents.font.size = 18 # // Override font size.
    menu_color(XAIL::ATTRIBUTE_SYSTEM::PARAM_TXT_COLOR[0], menu_enabled?(index))
    contents.font.bold = true
    draw_icons(XAIL::ATTRIBUTE_SYSTEM::LIST_ICONS, :vertical)
    draw_text(item_rect_for_icons(index), command_name(index), alignment)
    reset_font_settings
  end

  def item_rect_for_icons(index)
     # // Method to draw the text with icons.
    rect = item_rect(index)
    rect.x += 26
    rect.width -= 8
    rect
  end
  
  def menu_enabled?(index)
    # // Method to check if item is enabled.
    return XAIL::ATTRIBUTE_SYSTEM::LIST[index][3]
  end
  
  alias xail_att_sys_winatt_mk_cmd_list make_command_list
  def make_command_list(*args, &block)
    # // Method to add the commands.
    xail_att_sys_winatt_mk_cmd_list(*args, &block)
    id = 0
    for i in XAIL::ATTRIBUTE_SYSTEM::LIST
      case i[0]
      when :hit ; add_command(Vocab::xparam(0), i[0], i[3])
      when :eva ; add_command(Vocab::xparam(1), i[0], i[3])
      when :cri ; add_command(Vocab::xparam(2), i[0], i[3])
      when :cev ; add_command(Vocab::xparam(3), i[0], i[3])
      when :mev ; add_command(Vocab::xparam(4), i[0], i[3])
      when :mrf ; add_command(Vocab::xparam(5), i[0], i[3])
      else
        add_command(Vocab::param(id), i[0], i[3])
      end
      id += 1
    end
  end

end
#==============================================================================#
# ** Window_Attribute_Info
#==============================================================================#
class Window_Attribute_Info < Window_Base
  
  def initialize(x, y, width, height)
    # // Method to initialize the window.
    super(x, y, width, height)
    refresh
  end
  
  def standard_padding
    # // Method to set padding.
    return 16
  end
  
  def set_text(text, color = nil, alignment = 0)
    # // Method to set a text to the window.
    if text != @text
      @text = text
      @color = color
      @alignment = alignment
      refresh
    end
  end
  
  def refresh
    # // Method to refresh the window.
    contents.clear
    contents.font.name = XAIL::ATTRIBUTE_SYSTEM::FONT
    contents.font.size = 17 # // Override font size.
    contents.font.color = @color.nil? ? Color.new(255,255,255) : @color
    draw_text(0, 0, contents.width, line_height, @text, @alignment)
    reset_font_settings
  end
  
end
#==============================================================================#
# ** Window_Attribute_Points
#==============================================================================#
class Window_Attribute_Points < Window_Base
  
  def initialize(actor, x, y, width, height)
    # // Method to initialize the window.
    super(x, y, width, height)
    @actor = actor
    refresh
  end
  
  def standard_padding
    # // Method to set padding.
    return 16
  end
  
  def actor=(actor)
    # // Method to refresh and set actor.
    return if @actor == actor
    @actor = actor
    refresh
  end
  
  def refresh
    # // Method to refresh the window.
    contents.clear
    current = XAIL::ATTRIBUTE_SYSTEM::ACTOR_POINTS[@actor.id].to_s
    max = XAIL::ATTRIBUTE_SYSTEM.attr_max($game_actors[@actor.id]).to_s
    text = "Points: " + current + " / " + max
    contents.font.name = XAIL::ATTRIBUTE_SYSTEM::FONT
    contents.font.size = 20 # // Override font size.
    contents.font.color = Color.new(255,255,255)
    draw_text(0, 0, contents.width, line_height, text)
    reset_font_settings
  end
  
end
#==============================================================================#
# ** Window_Status
#==============================================================================#
class Window_Attribute_Status < Window_Selectable
  
  def initialize(actor)
    # // Method to initialize window.
    super(160, 52, Graphics.width - 160, Graphics.height - 52)
    @actor = actor
    refresh
    activate
  end

  def actor=(actor)
    # // Method to refresh and set actor.
    return if @actor == actor
    @actor = actor
    refresh
  end

  def refresh
    # // Method to refresh.
    contents.clear
    # Draw icons.
    draw_icons(XAIL::ATTRIBUTE_SYSTEM::PARAM_ICONS, :vertical, 0, line_height * 2, [4138])
    draw_icons(XAIL::ATTRIBUTE_SYSTEM::XPARAM_ICONS, :vertical, 179, line_height * 4)
    # Draw actor details.
    draw_font_text(@actor.name, 0, line_height * 0, 112, 0, XAIL::ATTRIBUTE_SYSTEM::FONT, 22, XAIL::ATTRIBUTE_SYSTEM::PARAM_TXT_COLOR[0])
    draw_font_text(@actor.class.name, 0, line_height * 0, contents_width, 1, XAIL::ATTRIBUTE_SYSTEM::FONT, 22, XAIL::ATTRIBUTE_SYSTEM::PARAM_TXT_COLOR[0])
    draw_font_text(@actor.nickname, 246, line_height * 0, 112, 2, XAIL::ATTRIBUTE_SYSTEM::FONT, 22, XAIL::ATTRIBUTE_SYSTEM::PARAM_TXT_COLOR[0])
    # Draw line.
    draw_line_ex(-48, line_height * 1, XAIL::ATTRIBUTE_SYSTEM::PARAM_LINE_COLOR[0], XAIL::ATTRIBUTE_SYSTEM::PARAM_LINE_COLOR[1])
    # Draw actor stats.
    draw_actor_stats(@actor, :hp, 20, line_height * 2, XAIL::ATTRIBUTE_SYSTEM::PARAM_BAR_HP[0], XAIL::ATTRIBUTE_SYSTEM::PARAM_BAR_HP[1])
    draw_actor_stats(@actor, :mp, 20, line_height * 3, XAIL::ATTRIBUTE_SYSTEM::PARAM_BAR_MP[0], XAIL::ATTRIBUTE_SYSTEM::PARAM_BAR_MP[1])
    # Draw actor parameters and xparameters.
    draw_parameters(20, line_height * 4)
    draw_xparameters(199, line_height * 4)
    # Draw line.
    draw_line_ex(48, line_height * 10, XAIL::ATTRIBUTE_SYSTEM::PARAM_LINE_COLOR[0], XAIL::ATTRIBUTE_SYSTEM::PARAM_LINE_COLOR[1])
    # Draw experience info.
    draw_exp_info(20, line_height * 10)
    # Draw line.
    draw_line_ex(-48, line_height * 12, XAIL::ATTRIBUTE_SYSTEM::PARAM_LINE_COLOR[0], XAIL::ATTRIBUTE_SYSTEM::PARAM_LINE_COLOR[1])
    # Draw points spent and actor level.
    draw_font_text("Points spent: " + @actor.attribute_spent.to_s, 0, line_height * 13, 140, 0, XAIL::ATTRIBUTE_SYSTEM::FONT, 22, XAIL::ATTRIBUTE_SYSTEM::PARAM_TXT_COLOR[0])
    if $imported["XAIL-LVL-TITLE"]
      lvl = "#{Vocab::level_a}: #{draw_title_level(@actor)}"
    else
      lvl = "#{Vocab::level_a}: #{@actor.level}  /  #{@actor.max_level}"
    end
    draw_font_text(lvl, 0, line_height * 13, contents_width, 2, XAIL::ATTRIBUTE_SYSTEM::FONT, 22, XAIL::ATTRIBUTE_SYSTEM::PARAM_TXT_COLOR[0])
  end

  def draw_parameters(x, y)
    # // Method to draw parameters.
    font = XAIL::ATTRIBUTE_SYSTEM::FONT
    size = 16 # // Override font size.
    c1 = XAIL::ATTRIBUTE_SYSTEM::PARAM_BAR_COLOR[0]
    c2 = XAIL::ATTRIBUTE_SYSTEM::PARAM_BAR_COLOR[1]
    c3 = XAIL::ATTRIBUTE_SYSTEM::PARAM_TXT_COLOR[0]
    c4 = XAIL::ATTRIBUTE_SYSTEM::PARAM_TXT_COLOR[1]
    6.times {|i| draw_actor_param_gauge(@actor, x, y + line_height * i, 160, i + 2, font, size, c1, c2, c3, c4) }
  end
  
  def draw_xparameters(x, y)
    # // Method to draw xparameters.
    font = XAIL::ATTRIBUTE_SYSTEM::FONT
    size = 16 # // Override font size.
    c1 = XAIL::ATTRIBUTE_SYSTEM::PARAM_BAR_COLOR[0]
    c2 = XAIL::ATTRIBUTE_SYSTEM::PARAM_BAR_COLOR[1]
    c3 = XAIL::ATTRIBUTE_SYSTEM::PARAM_TXT_COLOR[0]
    c4 = XAIL::ATTRIBUTE_SYSTEM::PARAM_TXT_COLOR[1]
    6.times {|i| draw_actor_xparam_gauge(@actor, x, y + line_height * i, 160, i, font, size, c1, c2, c3, c4) }
  end

  def draw_exp_info(x, y)
    # // Method to draw exp details.
    s1 = @actor.max_level? ? "?" : @actor.exp
    s2 = @actor.max_level? ? "?" : @actor.next_level_exp - @actor.exp
    param_rate = @actor.exp / @actor.next_level_exp.to_f
    contents.font.name = XAIL::ATTRIBUTE_SYSTEM::FONT
    contents.font.size = 16 # // Override font size.
    contents.font.color = XAIL::ATTRIBUTE_SYSTEM::PARAM_TXT_COLOR[1]
    contents.font.bold = true
    contents.font.shadow = false
    draw_gauge_ex(x, y + 9, 339, 20, param_rate, XAIL::ATTRIBUTE_SYSTEM::PARAM_BAR_COLOR[0], XAIL::ATTRIBUTE_SYSTEM::PARAM_BAR_COLOR[1])
    draw_text(x + 10, y + line_height, 339, line_height, s1, 0)
    draw_text(x + 339 / 2, y + line_height, 339, line_height, "EXP", 0)
    draw_text(x - 2, y + line_height, 339, line_height, s2, 2)    
  end
  
end
#==============================================================================#
# ** Scene_AttributeBase
#==============================================================================#
class Scene_AttributeBase < Scene_Base
  
  alias xail_att_sys_scenebase_start start
  def start(*args, &block)
    # // Method to start the scene
    xail_att_sys_scenebase_start(*args, &block)
    create_background
  end
  
  def create_background
    # // Method to create the background.
    @background_sprite = Sprite.new
    if XAIL::ATTRIBUTE_SYSTEM::BACK.nil?
      @background_sprite.bitmap = SceneManager.background_bitmap
      @background_sprite.color.set(16, 16, 16, 128)
    else
      @background_sprite.bitmap = Cache.system(XAIL::ATTRIBUTE_SYSTEM::BACK)
    end
  end
  
  alias xail_att_sys_scenebase_perf_trans perform_transition
  def perform_transition(*args, &block)
    # // Method to create the transition.´
    XAIL::ATTRIBUTE_SYSTEM::TRANSITION.nil? ? Graphics.transition(15) : Graphics.transition(XAIL::ATTRIBUTE_SYSTEM::TRANSITION[0],XAIL::ATTRIBUTE_SYSTEM::TRANSITION[1],XAIL::ATTRIBUTE_SYSTEM::TRANSITION[2])
    xail_att_sys_scenebase_perf_trans(*args, &block)
  end
  
  def next_actor
    # // Method to go to next actor.
    @actor = $game_party.menu_actor_next
    on_actor_change
  end
  
  def prev_actor
    # // Method to go to previous actor.
    @actor = $game_party.menu_actor_prev
    on_actor_change
  end
  
end 
#==============================================================================#
# ** Scene_Attribute
#==============================================================================#
class Scene_Attribute < Scene_AttributeBase
  
  def start
    # // Method to start scene teleport.
    super
    @actor = $game_party.menu_actor
    create_attribute_list
    create_attribute_info
    create_attribute_points
    create_attribute_param
    create_attribute_status
    on_index_change(0)
  end
  
  def create_attribute_list
    # // Method to create attribute window list.
    @attribute_list = Window_Attribute_List.new(0, 0)
    for i in XAIL::ATTRIBUTE_SYSTEM::LIST
      @attribute_list.set_handler(i[0], method(:command_attribute))
    end
    @attribute_list.set_handler(:pagedown, method(:next_actor))
    @attribute_list.set_handler(:pageup,   method(:prev_actor))
    @attribute_list.set_handler(:cancel, method(:return_scene))
  end
  
  def on_actor_change
    # // Method to change actor.
    @attribute_status.actor = @actor
    @attribute_points.actor = @actor
    @attribute_list.activate
    refresh_windows
  end
  
  def refresh_windows
    # // Method to refresh windows.
    @attribute_param.refresh
    @attribute_status.refresh
    @attribute_points.refresh
  end
  
  def create_attribute_info
    # // Method to create attribute info window.
    w = Graphics.width - @attribute_list.width
    x = @attribute_list.width
    @attribute_info = Window_Attribute_Info.new(x, 0, w, 52)
  end
  
  def create_attribute_points
    # // Method to create attribute points window.
    y = @attribute_list.height
    w = @attribute_list.width
    @attribute_points = Window_Attribute_Points.new(@actor, 0, y, w, 52)
  end
  
  def create_attribute_param
    # // Method to create attribute parameter window.
    y = @attribute_list.height + @attribute_points.height
    w = @attribute_list.width
    @attribute_param = Window_Attribute_Info.new(0, y, w, 52)
  end
  
  def create_attribute_status
    # // Method to create attribute status window.
    @attribute_status = Window_Attribute_Status.new(@actor)
  end
  
  alias xail_att_sys_scene_update update
  def update(*args, &block)
    # // Method for updating the scene.
    old_index = @attribute_list.index
    xail_att_sys_scene_update(*args, &block)
    on_index_change(@attribute_list.index) if old_index != @attribute_list.index
  end
  
  def on_index_change(index)
    # // Method when index changes.
    title = Vocab::param(index)
    case index
    when 8  ; title = Vocab::xparam(0)
    when 9  ; title = Vocab::xparam(1)
    when 10 ; title = Vocab::xparam(2)
    when 11 ; title = Vocab::xparam(3)
    when 12 ; title = Vocab::xparam(4)
    when 13 ; title = Vocab::xparam(5)
    end
    stats = XAIL::ATTRIBUTE_SYSTEM::LIST[index][1].to_s
    cost = XAIL::ATTRIBUTE_SYSTEM::LIST[index][2].to_s
    @attribute_param.set_text(title.to_s + " +" + stats, Color.new(150,205,150,225))
    @attribute_info.set_text("Distribute " + title + ". Cost » " + cost + " points", XAIL::ATTRIBUTE_SYSTEM::PARAM_TXT_COLOR[1])
    refresh_windows
  end
  
  def command_attribute
    # // Method to add attribute.
    case @attribute_list.current_symbol
    when :hp    ; change_param(0, :param)
    when :mp    ; change_param(1, :param)
    when :atk   ; change_param(2, :param)
    when :def   ; change_param(3, :param)
    when :magic ; change_param(4, :param)
    when :res   ; change_param(5, :param)
    when :agl   ; change_param(6, :param)
    when :luk   ; change_param(7, :param)
    when :hit   ; change_param(0, :xparam)
    when :eva   ; change_param(1, :xparam)
    when :cri   ; change_param(2, :xparam)
    when :cev   ; change_param(3, :xparam)
    when :mev   ; change_param(4, :xparam)
    when :mrf   ; change_param(5, :xparam)
    end
    @attribute_list.activate
    refresh_windows
  end
  
  def change_param(param_id, type)
    # // Method to change param.
    case type
    when :param
      id = XAIL::ATTRIBUTE_SYSTEM::LIST[param_id]
    when :xparam
      id = XAIL::ATTRIBUTE_SYSTEM::LIST[param_id + 8]
    end
    unless $game_party.attribute?(@actor.id) == 0
      return Sound.play_buzzer if $game_party.attribute?(@actor.id) < id[2]
      $game_party.attribute(@actor.id, id[2], :lose)
      @actor.attribute_spent += id[2]
      @actor.add_param(param_id, id[1]) if type == :param
      @actor.add_xparam(param_id, id[1]) if type == :xparam
    else
      Sound.play_buzzer
    end
  end
  
end
#==============================================================================#
# ** Window_MenuCommand
#==============================================================================#
class Window_MenuCommand < Window_Command
 
  alias xail_att_sys_win_menucmd_add_main_commands add_main_commands
  def add_main_commands(*args, &block)
    xail_att_sys_win_menucmd_add_main_commands(*args, &block)
    add_command(XAIL::ATTRIBUTE_SYSTEM::MENU_NAME, :attribute, true) if XAIL::ATTRIBUTE_SYSTEM::MENU_CMD
  end
    
end
#==============================================================================#
# ** Scene_Menu
#==============================================================================#
class Scene_Menu < Scene_MenuBase

  alias xail_att_sys_scenemenu_create_cmd_window create_command_window
  def create_command_window(*args, &block)
    # // Method to create command window.
    xail_att_sys_scenemenu_create_cmd_window(*args, &block)
    @command_window.set_handler(:attribute, method(:command_attribute)) if XAIL::ATTRIBUTE_SYSTEM::MENU_CMD
  end
  
  def command_attribute
    # // Method to call attribute scene.
    SceneManager.call(Scene_Attribute)
  end
  
end # END OF FILE

#=*==========================================================================*=#
# ** END OF FILE
#=*==========================================================================*=#


Para ele funcionar precisa desse :
#==============================================================================
#   XaiL System - Core
#   Author: Nicke
#   Created: 07/01/2012
#   Edited: 12/01/2013
#   Version: 2.1d
#==============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ? Materials but above ? Main. Remember to save.
#
# Core script for XaiL System.
# Caution! This needs to be located before any other XS scripts.
#
# *** Only for RPG Maker VX Ace. ***
#==============================================================================
($imported ||= {})["XAIL-XS-CORE"] = true

module Colors
  #--------------------------------------------------------------------------#
  # * Colors
  #--------------------------------------------------------------------------#
  White = Color.new(255,255,255)
  LightRed = Color.new(255,150,150)
  LightGreen = Color.new(150,255,150)
  LightBlue = Color.new(150,150,255)
  DarkYellow = Color.new(225,225,20)
  Alpha = Color.new(0,0,0,128)
  AlphaMenu = 100
end
module XAIL
  module CORE
  #--------------------------------------------------------------------------#
  # * Settings
  #--------------------------------------------------------------------------#
  # Graphics.resize_screen(width, height ) 
  Graphics.resize_screen(544, 416) 
  
  # FONT DEFAULTS:
  Font.default_name = ["VL Gothic"]
  Font.default_size = 20
  Font.default_bold = false
  Font.default_italic = false
  Font.default_shadow = true
  Font.default_outline = true
  Font.default_color = Colors::White
  Font.default_out_color = Colors::Alpha
  
  # USE_TONE = true/false:
  # Window tone for all windows ingame. Default: true.
  USE_TONE = false
  
  # SAVE
  SAVE_MAX = 20       # Default 16.
  SAVE_FILE_VIS = 4   # Default 4.
  
  # JAPANESE = true/false
  JAPANESE = false
  
  end
end
# *** Don't edit below unless you know what you are doing. ***
#==============================================================================#
# ** Game_System
#==============================================================================#
class Game_System
  
  # // Method to determine japanese game.
  def japanese? ; return XAIL::CORE::JAPANESE ; end
  
end
#==============================================================================#
# ** String
#==============================================================================#
class String
  
  def to_class(parent = Kernel)
    # // Method to convert string to class.
    chain = self.split "::"
    klass = parent.const_get chain.shift
    return chain.size < 1 ? (klass.is_a?(Class) ? klass : nil) : chain.join("::").to_class(klass)
    rescue
    nil
  end
  
  def cap_words
    # // Method to capitalize every word.
    self.split(' ').map {|w| w.capitalize }.join(' ')
  end
  
  def slice_char(char)
    # // Method to slice char.
    self.split(char).map {|w| w.sub(char, " ") }.join(" ")
  end

end
#==============================================================================#
# ** Vocab
#==============================================================================#
class << Vocab
  
  def xparam(id)
    # // Method to return xparam name.
    case id
    when 0 ; "Hit Chance"
    when 1 ; "Evasion"
    when 2 ; "Critical Chance"
    when 3 ; "Critical Evasion"
    when 4 ; "Magic Evasion"
    when 5 ; "Magic Reflection"
    when 6 ; "Counter Attack"
    when 7 ; "HP Regeneration"
    when 8 ; "MP Regeneration"
    when 9 ; "TP Regeneration"
    end
  end
  
end
#==============================================================================
# ** Sound
#==============================================================================
class << Sound
  
  def play(name, volume, pitch, type = :se)
    # // Method to play a sound. If specified name isn't valid throw an error.
    case type
    when :se   ; RPG::SE.new(name, volume, pitch).play rescue valid?(name)
    when :me   ; RPG::ME.new(name, volume, pitch).play rescue valid?(name)
    when :bgm  ; RPG::BGM.new(name, volume, pitch).play rescue valid?(name)
    when :bgs  ; RPG::BGS.new(name, volume, pitch).play rescue valid?(name)
    end
  end
  
  def valid?(name)
    # // Method to raise error if specified sound name is invalid.
    msgbox("Error. Unable to find sound file: " + name)
    exit 
  end
  
end
#==============================================================================
# ** DataManager
#==============================================================================
class << DataManager

  def savefile_max
    # // Method override, save file max.
    return XAIL::CORE::SAVE_MAX
  end
  
end
#==============================================================================
# ** DataManager
#==============================================================================
class << SceneManager
  
  def call_ext(scene_class, args = nil)
    # // Method to call a scene with arguments.
    @stack.push(@scene)
    @scene = scene_class.new(args)
  end
  
end
#==============================================================================
# ** Scene_File
#==============================================================================
class Scene_File < Scene_MenuBase
  
  def visible_max
    # // Method override, visible_max for save files.
    return XAIL::CORE::SAVE_FILE_VIS
  end
  
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# Importing font fix that will remove weird characters.
# Adding new methods such as new gauge, actor param, font text, icon drawing,
# big icon drawing and a line with a shadow.
#==============================================================================
class Window_Base < Window
  
  # // Importing Custom font fix. (Credit Lone Wolf).
  alias :process_normal_character_vxa :process_normal_character
  def process_normal_character(c, pos)
    return unless c >= ' '
    process_normal_character_vxa(c, pos)
  end unless method_defined? :process_normal_character
  
  def draw_text_ex_no_reset(x, y, text)
    # // Method to draw ex text without resetting the font.
    text = convert_escape_characters(text)
    pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
    process_character(text.slice!(0, 1), text, pos) until text.empty?
  end 
  
  alias xail_core_winbase_upt_tone update_tone
  def update_tone(*args, &block)
    # // Method to change tone of the window.
    return unless XAIL::CORE::USE_TONE
    xail_core_winbase_upt_tone(*args, &block)
  end
  
  def draw_gauge_ex(x, y, width, height, rate, color1, color2)
    # // Method to draw a gauge.
    fill_w = (width * rate).to_i
    gauge_y = y + line_height - 8
    contents.fill_rect(x, gauge_y, width + 1, height + 1, Color.new(255,255,255,64))
    contents.fill_rect(x, gauge_y, width, height, Color.new(0,0,0,100))
    contents.gradient_fill_rect(x, gauge_y, fill_w, height, color1, color2)
  end
  
  def draw_actor_param_gauge(actor, x, y, width, param_id, font, size, bar_color1, bar_color2, txt_color1, txt_color2)
    # // Method to draw actor parameters with a gauge.
    case param_id
    when 2 ; param_rate = actor.param(2) / actor.param_max(2).to_f
    when 3 ; param_rate = actor.param(3) / actor.param_max(3).to_f
    when 4 ; param_rate = actor.param(4) / actor.param_max(4).to_f
    when 5 ; param_rate = actor.param(5) / actor.param_max(5).to_f
    when 6 ; param_rate = actor.param(6) / actor.param_max(6).to_f
    when 7 ; param_rate = actor.param(7) / actor.param_max(7).to_f
    end
    contents.font.name = font
    contents.font.size = size
    contents.font.bold = true
    contents.font.shadow = false
    draw_gauge_ex(x, y - 14, width, 20, param_rate, bar_color1, bar_color2)
    contents.font.color = txt_color1
    draw_text(x + 10, y, 120, line_height, Vocab::param(param_id))
    contents.font.color = txt_color2
    draw_text(x + width - 38, y, 36, line_height, actor.param(param_id), 2)
    reset_font_settings
  end
  
  def draw_actor_xparam_gauge(actor, x, y, width, xparam_id, font, size, bar_color1, bar_color2, txt_color1, txt_color2)
    # // Method to draw actor xparameters with a gauge.
    case xparam_id
    when 0
      xparam_rate = actor.xparam(0) / 100.to_f
      xparam_name = Vocab.xparam(0)
    when 1
      xparam_rate = actor.xparam(1) / 100.to_f
      xparam_name = Vocab.xparam(1)
    when 2
      xparam_rate = actor.xparam(2) / 100.to_f
      xparam_name = Vocab.xparam(2)
    when 3
      xparam_rate = actor.xparam(3) / 100.to_f
      xparam_name = Vocab.xparam(3)
    when 4
      xparam_rate = actor.xparam(4) / 100.to_f
      xparam_name = Vocab.xparam(4)
    when 5
      xparam_rate = actor.xparam(5) / 100.to_f
      xparam_name = Vocab.xparam(5)
    when 6
      xparam_rate = actor.xparam(6) / 100.to_f
      xparam_name = Vocab.xparam(6)
    when 7
      xparam_rate = actor.xparam(7) / 100.to_f
      xparam_name = Vocab.xparam(7)
    when 8
      xparam_rate = actor.xparam(8) / 100.to_f
      xparam_name = Vocab.xparam(8)
    when 9
      xparam_rate = actor.xparam(9) / 100.to_f
      xparam_name = Vocab.xparam(9)
    end
    contents.font.name = font
    contents.font.size = size
    contents.font.bold = true
    contents.font.shadow = false
    draw_gauge_ex(x, y - 14, width, 20, xparam_rate, bar_color1, bar_color2)
    contents.font.color = txt_color1
    draw_text(x + 10, y, 120, line_height, xparam_name)
    contents.font.color = txt_color2
    draw_text(x + width - 38, y, 36, line_height, "#{actor.xparam(xparam_id)}%", 2)
    reset_font_settings 
  end
  
  def draw_line_ex(x, y, color, shadow)
    # // Method to draw a line with a shadow.
    line_y = y + line_height / 2 - 1
    contents.fill_rect(x, line_y, contents_width, 2, color)
    line_y += 1
    contents.fill_rect(x, line_y, contents_width, 2, shadow)
  end
  
  def draw_icons(icons, alignment, x = 0, y = 0, offset_icon = [])
    # // Method to draw icons in a horizonal or vertical alignment.
    for i in icons
      # // If included in offset do extra line_height.
      for o in offset_icon
        if i == o
          y += line_height * 1 if alignment == :vertical
          x += line_height * 1 if alignment == :horizontal
        end
      end
      draw_icon(i.nil? ? nil : i, x.nil? ? 0 : x, y.nil? ? 0 : y) rescue nil
      y += line_height if alignment == :vertical
      x += line_height if alignment == :horizontal
      next if i.nil?
    end
  end
  
  def draw_big_icon(icon, x, y, width, height, opacity = 255)
    # // Method to draw a big icon.
    bitmap = Cache.system("Iconset")
    rect = Rect.new(icon % 16 * 24, icon / 16 * 24, 24, 24)
    rect2 = Rect.new(x, y, width, height)
    contents.stretch_blt(rect2, bitmap, rect, opacity)
  end
  
  def draw_font_text(text, x, y, width, alignment, font, size, color, bold = true, shadow = true)
    # // Method to draw font text.
    contents.font.name = font
    contents.font.size = size
    contents.font.color = color
    contents.font.bold = bold
    contents.font.shadow = shadow
    contents.font.out_color = Color.new(0,0,0,255)
    draw_text(x, y, width, calc_line_height(text), text, alignment)
    reset_font_settings
  end
  
  def draw_font_text_ex(text, x, y, font, size, color, bold = true, shadow = true)
    # // Method todraw font text. (Special)
    contents.font.name = font
    contents.font.size = size
    contents.font.color = color
    contents.font.bold = bold
    contents.font.shadow = shadow
    contents.font.out_color = Color.new(0,0,0,255)
    text = convert_escape_characters(text)
    pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
    process_character(text.slice!(0, 1), text, pos) until text.empty?
    reset_font_settings
  end
  
end
#==============================================================================#
# ** Window_Selectable
#------------------------------------------------------------------------------
#  Adding support for pageleft and pageright for window selectable.
#==============================================================================#
class Window_Selectable < Window_Base
  
  def cursor_pageright ; end
  def cursor_pageleft ; end

  alias xail_core_winselect_process_cursor_move process_cursor_move
  def process_cursor_move(*args, &block)
    # // Method to process cursor movement.
    xail_core_winselect_process_cursor_move(*args, &block)
    cursor_pageright if !handle?(:pageright) && Input.trigger?(:RIGHT)
    cursor_pageright if !handle?(:pageleft) && Input.trigger?(:LEFT)
  end
  
  alias xail_core_winselect_process_handling process_handling
  def process_handling(*args, &block)
    # // Method to process handling.
    xail_core_winselect_process_handling(*args, &block)
    return process_pageright if handle?(:pageright) && Input.trigger?(:RIGHT)
    return process_pageleft if handle?(:pageleft) && Input.trigger?(:LEFT)
  end
    
  def process_pageright
    # // Method to process page right.
    Sound.play_cursor
    Input.update
    deactivate
    call_handler(:pageright)
  end
  
  def process_pageleft
    # // Method to process page left.
    Sound.play_cursor
    Input.update
    deactivate
    call_handler(:pageleft)
  end
  
end
#==============================================================================#
# ** Window_Icon
#------------------------------------------------------------------------------
#  New Window :: Window_Icon - A window for drawing icon(s).
#==============================================================================#
class Window_Icon < Window_Base
  
  attr_accessor :enabled
  attr_accessor :alignment
  
  def initialize(x, y, window_width, hsize)
    # // Method to initialize the icon window.
    super(0, 0, window_width, window_height(hsize))
    @icons = []
    @index = 0
    @enabled = true
    @alignment = 0
    refresh
  end
  
  def window_height(hsize)
    # // Method to return the height.
    fitting_height(hsize)
  end
  
  def refresh
    # // Method to refresh the icon window.
    contents.clear
  end
  
  def draw_cmd_icons(icons, index)
    # // Draw all of the icons.
    return if !@enabled
    count = 0
    for i in icons
      align = 0
      x = 110
      next if i[index].nil?
      case @alignment
      when 1, 2 ; align = -110
      end
      draw_icon(i[index], x + align, 24 * count)
      count += 1
      break if (24 * count > height - 24)
    end
  end
  
end
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# Adding check item method to return a item based on the type.
#==============================================================================
class Game_Party < Game_Unit
  
  def check_item?(item, type)
    # // Method to return a item based on the type.
    case type
    when :items    ; $data_items[item]
    when :weapons  ; $data_weapons[item]
    when :armors   ; $data_armors[item]
    when :gold     ; item
    when :exp      ; item
    end
  end

end 
#==============================================================================
# ** Game_Event
#------------------------------------------------------------------------------
# Adding methods to check for comments on events.
#==============================================================================
class Game_Event < Game_Character
  
  def comment?(comment)
    # // Method to check if comment is included in event.
    unless empty? or @list.nil?
      for evt in @list
        if evt.code == 108 or evt.code == 408
          if evt.parameters[0].include?(comment)
            return true
          end
        end
      end
    end
    return false
  end
  
  def comment_int?(comment)
    # // Method to check variable integer in event.
    unless empty? or @list.nil?
      for evt in @list
        if evt.code == 108 or evt.code == 408
          if evt.parameters[0] =~ /<#{comment}:[ ]?(\d*)>?/
            return ($1.to_i > 0 ? $1.to_i : 0)
          end
        end
      end
    end
  end

end # END OF FILE

#=*==========================================================================*=#
# ** END OF FILE
#=*==========================================================================*=#

Dúvidas´sobre outros scripts que não são seus, são colocadas aqui, suporte para RGSS, aquele tópico é para dúvidas em relação ao que você está programando :).

Sobre o script, falta coisa nele, coloque o "Core" que é necessário para rodar ele. E sempre diga a engine que está trabalhando x.x

25/01/2013 às 18:13 #2 Última edição: 25/01/2013 às 18:16 por denisbts
Sim eu coloquei só que ta dando erro do mesmo modo, olha vou postar aqui o link de onde consegui o script
http://forums.rpgmakerweb.com/index.php?/topic/3759-xs-attribute-system/   ........ se isso ajudar fico feliz pois o sistema é bacana i quem sabe eu poderia usar no meu projeto :x.. e a  engine é o ACE