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

Problema com incompatibilidade de script's

Iniciado por Cheshire, 18/11/2013 às 12:33

É meu primeiro post aqui, que lindo  :*-*:
Enfim
Estou usando o script de batalha lateral Tankentai ATB e o sistema de ItemPopUp
Ate ai tudo bem
O problema apareceu quando eu criei uma nova habilidade chamada 'Furtar', que faz com que o personagem roube dinheiro dos monstros,  é que quando ele rouba o dinheiro no meio da batalha o script de item PopUp sempre da erro
Na linha 24 para ser mais exato
Eis o script \/
Spoiler
==============================================================================
# Chest Item Pop-Up
#------------------------------------------------------------------------------
# Original Author  : OriginalWij
# Version          : 1.0
#==============================================================================
# Game_Interpreter
#==============================================================================
class Game_Event < Game_Character
alias chest_update update
def update
chest_update
$event = @event
end
end

class Game_Interpreter
  #--------------------------------------------------------------------------
  # Get X
  #--------------------------------------------------------------------------
  def get_x
    events = $game_map.events
    x_coord = events[@event_id]
    return x_coord.screen_x
  end
  #--------------------------------------------------------------------------
  # Get Y
  #--------------------------------------------------------------------------
  def get_y
    events = $game_map.events
    y_coord = events[@event_id]
    return y_coord.screen_y
  end
  #--------------------------------------------------------------------------
  # Change Gold
  #--------------------------------------------------------------------------
  def command_125
    value = operate_value(@params[0], @params[1], @params[2])
    $game_party.gain_gold(value)
    x_value = get_x
    y_value = get_y
    for i in 0...@list.size
    $scene = Chest_Popup.new(x_value, y_value, 0, value, 1) if @list.code == 108 and @list.parameters == [CHEST_WORD]
    end
    return true
  end
  #--------------------------------------------------------------------------
  # Change Items
  #--------------------------------------------------------------------------
  def command_126
    value = operate_value(@params[1], @params[2], @params[3])
    $game_party.gain_item($data_items[@params[0]], value)
    $game_map.need_refresh = true
    x_value = get_x
    y_value = get_y
    for i in 0...@list.size
    $scene = Chest_Popup.new(x_value, y_value, 1, value, @params[0]) if @list.code == 108 and @list.parameters == [CHEST_WORD]
    end
    return true
  end
  #--------------------------------------------------------------------------
  # Change Weapons
  #--------------------------------------------------------------------------
  def command_127
    value = operate_value(@params[1], @params[2], @params[3])
    $game_party.gain_item($data_weapons[@params[0]], value, @params[4])
    x_value = get_x
    y_value = get_y
    for i in 0...@list.size
    $scene = Chest_Popup.new(x_value, y_value, 2, value, @params[0]) if @list.code == 108 and @list.parameters == [CHEST_WORD]
    end
    return true
  end
  #--------------------------------------------------------------------------
  # Change Armor
  #--------------------------------------------------------------------------
  def command_128
    value = operate_value(@params[1], @params[2], @params[3])
    $game_party.gain_item($data_armors[@params[0]], value, @params[4])
    x_value = get_x
    y_value = get_y
    for i in 0...@list.size
    $scene = Chest_Popup.new(x_value, y_value, 3, value, @params[0]) if @list.code == 108 and @list.parameters == [CHEST_WORD]
    end
    return true
  end
  #--------------------------------------------------------------------------
  # Empty Chest
  #--------------------------------------------------------------------------
  alias empty_chest_execute_command execute_command
  def execute_command
    for i in 0...@list.size
    chest(-1,0,0,false) if @list.code == 108 and @list.parameters == [EMPTY_CHEST_WORD]
    end
    empty_chest_execute_command
  end

end
#==============================================================================
# Item Popup Window
#==============================================================================

class Item_Popup_Window < Window_Base
  #--------------------------------------------------------------------------
  # Initialize
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(0, 0, 544, 416)
    self.opacity = 0
    @x = x - 26
    @y = y - 56
  end
  #--------------------------------------------------------------------------
  # Pop-Up
  #--------------------------------------------------------------------------
  def pop_up(icon_index, x, y)
    self.contents.clear
    draw_icon(icon_index, x, y, true)
  end
end

#==============================================================================
# Chest_Popup
#==============================================================================

class Chest_Popup < Scene_Base
  #--------------------------------------------------------------------------
  # Initialize
  #--------------------------------------------------------------------------
  def initialize(x, y, type, amount, index)
    @x = x
    @y = y
    @amount = amount
    $iftype=type;$ifamount=amount;$ifindex=index
    case type
    when 0 # gold
      @amount = 1
      @icon_index = GOLD_ICON
    when 1 # items
      @icon_index = $data_items[index].icon_index
    when 2 # weapons
      @icon_index = $data_weapons[index].icon_index
    when 3 # armors
      @icon_index = $data_armors[index].icon_index
    end
  end
  #--------------------------------------------------------------------------
  # Start
  #--------------------------------------------------------------------------
  def start
    create_background
    @popup_window = Item_Popup_Window.new(@x, @y)
  end
  #--------------------------------------------------------------------------
  # Terminate
  #--------------------------------------------------------------------------
  def terminate
    @popup_window.dispose
    @menuback_sprite.dispose
  end
  #--------------------------------------------------------------------------
  # Return Scene
  #--------------------------------------------------------------------------
  def return_scene(type,index,amount,popup)
    $scene = Scene_Map.new
    if USE_ITEM_FOUND;chest(type,index,amount,popup);end
  end
  #--------------------------------------------------------------------------
  # Update
  #--------------------------------------------------------------------------
  def update
    super
    @popup_window.update
    @menuback_sprite.update
    if USE_ITEM_POPUP;do_popup;else;return_scene($iftype,$ifindex,$ifamount,false);end
  end
  #--------------------------------------------------------------------------
  # Update Basic
  #--------------------------------------------------------------------------
  def update_basic
    Graphics.update             
    Input.update                 
    $game_map.update             
  end
  #--------------------------------------------------------------------------
  # Wait
  #--------------------------------------------------------------------------
  def wait(duration)
    for i in 0...duration
      update_basic
    end
  end
  #--------------------------------------------------------------------------
  # Create Background
  #--------------------------------------------------------------------------
  def create_background
    @menuback_sprite = Sprite.new
    @menuback_sprite.bitmap = $game_temp.background_bitmap
    @menuback_sprite.update
  end
  #--------------------------------------------------------------------------
  # Do Pop-Up
  #--------------------------------------------------------------------------
  def do_popup
    Audio.se_play("Audio/SE/#{POPUP_SOUND}", POPUP_SOUND_VOLUME, POPUP_SOUND_PITCH) if PLAY_POP_UP_SOUND
    if MULTIPLE_ITEMS
    for i in 1..@amount
      for i in 0..4
        @popup_window.pop_up(@icon_index, @x - 26, @y - (i * 4) - 48)
        @popup_window.update
        wait(2)
      end
      wait(5) if i != @amount
    end
    else
      for i in 0..4
        @popup_window.pop_up(@icon_index, @x - 26, @y - (i * 4) - 48)
        @popup_window.update
        wait(2)
      end
      wait(5) if i != @amount
    end
    return_scene($iftype,$ifindex,$ifamount,false)
  end
end
#==============================================================================
#------------------------------------------------------------------------------
#==============================================================================
# Item_Found
#------------------------------------------------------------------------------
# Original Author  : Khai(http://ktbanh.wordpress.com/)
# Version          : 1.3
#==============================================================================
class Chest_Window_Base < Window_Base
  def initialize
    super(0, 0, CHEST_DATA[0], WLH + 32)
    self.windowskin = Cache.system(MSG_WINDOWSKIN)
  end
#------------------------------------------------------------------------------
  def set_text(text, align = 1)
    if text != @text
      @text = text
      self.contents.clear
      self.contents.font.color = text_color(MSG_COLOR)
      self.contents.draw_text(0, 0, self.width - 32, WLH, text, align)
    end
  end
end
#------------------------------------------------------------------------------
class Chest_Window_Addon < Window_Base
  def initialize(index,type)
    super(0, 0, CHEST_DATA[1], WLH + 32)
    self.windowskin = Cache.system(MSG_WINDOWSKIN)
    if USE_GOLD_ICON and type==3;type=4;end
    self.draw_icon($data_items[index].icon_index, 0, 0, true)if type == 0
    self.draw_icon($data_armors[index].icon_index, 0, 0, true)if type == 1
    self.draw_icon($data_weapons[index].icon_index, 0, 0, true)if type == 2
    self.draw_icon(GOLD_ICON, 0, 0, true) if type == 4
    self.contents.font.color = text_color(MSG_COLOR)
    self.contents.draw_text(6, 0, CHEST_DATA[1], WLH, $data_system.terms.gold) if type == 3
  end
end
#------------------------------------------------------------------------------
def chest(type,index,value,mapcall)
case type;when 0;type=3;when 1;type=0;when 2;type=2;when 3;type=1;end
if mapcall==true;case type;when 0;$game_party.gain_item($data_items[index],value)
when 1;$game_party.gain_item($data_armors[index],value)
when 2;$game_party.gain_item($data_weapons[index],value)
when 3;$game_party.gain_gold(value);end;end
$scene = Scene_Chest.new(type,index,value)
end
#------------------------------------------------------------------------------
class Scene_Chest < Scene_Base
  def initialize(type,index,num)
    @index = index;@setting = type;@num = num;@spriteset = Spriteset_Map.new
    CHEST_DATA[1] = 56
    if USE_GOLD_ICON;if type == 3; CHEST_DATA[1] = 56;end
    else;if type == 3; CHEST_DATA[1] = width_set($data_system.terms.gold);end;end
    @khai_icon_window = Chest_Window_Addon.new(index, type)
    case type;when 0;@type=$data_items[@index].name
    when 1;@type=$data_armors[@index].name
    when 2;@type=$data_weapons[@index].name
    when 3;@type=Vocab::gold;else;@text=MSG_EMPTY;@khai_icon_window.width=0;end
    #Add Type(0-2) item/armors/weapons
    @text = "#{num} #{@type}s #{MSG_ADD}" if type<3&&type>-1&&num>=0
    #Add Type(3) gold
    @text = "#{num} #{@type} #{MSG_ADD}" if type==3&&num>=0
    #Remove Type(0-2) item/armors/weapons
    @text = "#{num*-1} #{@type}s #{MSG_REMOVE}" if type<3&&type>-1&&num<0&&num!=-1
    #Remove Type(3) Gold
    @text = "#{num*-1} #{@type} #{MSG_REMOVE}" if type==3&&num<0
    #Remove Single
    @text = "#{@type} #{MSG_REMOVE}" if type<3&&type>-1&&num==-1
    #Add Single
    @text = "#{@type} #{MSG_ADD}" if type<3&&type>-1&&num==1
    CHEST_DATA[0] = width_set(@text)
    #Window Properties
    @khai_icon_window.width=0 if NO_ICON_WINDOW
    @khai_info_window=Chest_Window_Base.new
    @khai_info_window.width=width_set(@text)
    @khai_info_window.set_text(@text)
    @khai_info_window.x=(544-(@khai_info_window.width-@khai_icon_window.width))/2
    @khai_icon_window.x=(544-(@khai_info_window.width+@khai_icon_window.width))/2
    @khai_icon_window.y=(416-@khai_icon_window.height)/2
    @khai_info_window.y=(416-@khai_info_window.height)/2
    play_se
  end
#------------------------------------------------------------------------------
  def width_set(n)
    self.width_set_bitmap.text_size(n).width + 42
  end
#------------------------------------------------------------------------------
   def width_set_bitmap
     Bitmap.new(32,32)
   end
#------------------------------------------------------------------------------
  def play_se
    #Item Gain SE
    Audio.se_play("Audio/SE/#{ITEM_GAIN}", FOUND_SOUND_VOLUME, FOUND_SOUND_PITCH)if@setting<3&&@setting>-1&&@num>0&&ITEM_GAIN != "" if PLAY_FOUND_WINDOW_SOUND
    #Gold Gain SE
    Audio.se_play("Audio/SE/#{GOLD_GAIN}", FOUND_SOUND_VOLUME, FOUND_SOUND_PITCH)if@setting==3&&@num>=0&&GOLD_GAIN != "" if PLAY_FOUND_WINDOW_SOUND
    #Item Remove SE
    Audio.se_play("Audio/SE/#{ITEM_REMOVE}", FOUND_SOUND_VOLUME, FOUND_SOUND_PITCH)if@setting<3&&@setting>-1&&@num<0&&ITEM_REMOVE != "" if PLAY_FOUND_WINDOW_SOUND
    #Gold Remove SE
    Audio.se_play("Audio/SE/#{GOLD_REMOVE}", FOUND_SOUND_VOLUME, FOUND_SOUND_PITCH)if@setting==3&&@num<0&&GOLD_REMOVE != "" if PLAY_FOUND_WINDOW_SOUND
  end
#------------------------------------------------------------------------------
  def terminate
    @spriteset.dispose
    @khai_icon_window.dispose
    @khai_info_window.dispose
  end
#------------------------------------------------------------------------------ 
  def update
    @khai_info_window.update
    @khai_icon_window.update
    @spriteset.update # enables sprite update (weather)
    $game_map.update # enables event update (event movement)
    $scene = Scene_Map.new if Input.trigger?(Input::B) or Input.trigger?(Input::C)
  end
#------------------------------------------------------------------------------
end
#==============================================================================
[close]

Eu sou meio leigo quando se trata de script
Mas se algum puder me ajudar ficaria muito grato >-<

Eu também não entendo muito de script, mas poderia mostrar como está configurada a página da habilidade?
O amanhã não é garantido a ninguém.