Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

more then 99 items

k, so im used xp, and i was wondering is it possilbe to make it so i can have more then 99 of each item, in fact it is quite critical that i can, so is there any chance anyone can help me?
 
Change Game_Party gain_item, gain_weapon and gain_armor methods. Try this:
Code:
class Game_Party
  MAX_ITEMS = 99   # Just change this number

  def gain_item(item_id, n)
    if item_id > 0
      @items[item_id] = [[item_number(item_id) + n, 0].max, MAX_ITEMS].min
    end
  end

  def gain_weapon(weapon_id, n)
    if weapon_id > 0
      @weapons[weapon_id] = [[weapon_number(weapon_id) + n, 0].max, MAX_ITEMS].min
    end
  end

  def gain_armor(armor_id, n)
    if armor_id > 0
      @armors[armor_id] = [[armor_number(armor_id) + n, 0].max, MAX_ITEMS].min
    end
  end
end
 
Here I already got something like that laying around, place it above anything that aliases the overwritten methods.

Code:
#===============================================================================
# ** Party Maximum Item Quantities
#-------------------------------------------------------------------------------
#   This script allows you to set maximum quantites you can gain of individual
# (or all) items, weapons and armors.
#===============================================================================
#-------------------------------------------------------------------------------
# * SDK Log
#-------------------------------------------------------------------------------
if Object.const_defined?(:SDK)
  SDK.log('Party.MaxItemQuantities', 'Kain Nobel', 2.0, '04.20.2008')
  SDK.log_overwrite(:Game_Party, :gain_item)
  SDK.log_overwrite(:Game_Party, :gain_weapon)
  SDK.log_overwrite(:Game_Party, :gain_armor)
end
#===============================================================================
# ** Game_Party
#-------------------------------------------------------------------------------
#   This class has been enhanced to customize item gain maximums.
#===============================================================================
class Game_Party
  #-----------------------------------------------------------------------------
  # * Cant Gain Items
  #-----------------------------------------------------------------------------
  Cant_Gain_Items   = []
  #-----------------------------------------------------------------------------
  # * Cant Gain Weapons
  #-----------------------------------------------------------------------------
  Cant_Gain_Weapons = []
  #-----------------------------------------------------------------------------
  # * Cant Gain Armors
  #-----------------------------------------------------------------------------
  Cant_Gain_Armors  = []
  #-----------------------------------------------------------------------------
  # * Maximum Items   = {item_id => max_quantity}
  #-----------------------------------------------------------------------------
  Max_Items = {
    1 => 100
  }
  Max_Items.default = 999
  #-----------------------------------------------------------------------------
  # * Maximum Weapons = {item_id => max_quantity}
  #-----------------------------------------------------------------------------
  Max_Weapons = {
    1 => 9999999
  }
  Max_Weapons.default = 999
  #-----------------------------------------------------------------------------
  # * Maximum Armors  = {item_id => max_quantity
  #-----------------------------------------------------------------------------
  Max_Armors = {}
  Max_Armors.default = 999
  #-----------------------------------------------------------------------------
  # * Gain Item
  #-----------------------------------------------------------------------------
  def gain_item(id, n)
    if id > 0
      @items[id] = [[item_number(id) + n, 0].max, Max_Items[id]].min
    end
    @items[id] = 0 if Cant_Gain_Items.include?(id)
  end
  #-----------------------------------------------------------------------------
  # * Gain Armor
  #-----------------------------------------------------------------------------
  def gain_armor(id, n)
    if id > 0
      @armors[id] = [[armor_number(id) + n, 0].max, Max_Armors[id]].min
    end
    @armors[id] = 0 if Cant_Gain_Armors.include?(id)
  end
  #-----------------------------------------------------------------------------
  # * Gain Weapon
  #-----------------------------------------------------------------------------
  def gain_weapon(id, n)
    if id > 0
      @weapons[id] = [[weapon_number(id) + n, 0].max, Max_Weapons[id]].min
    end
    @weapons[id] = 0 if Cant_Gain_Weapons.include?(id)
  end
end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top