Kain Nobel
Member
Party Max Item QuantitiesVersion: 2.5
By: Kain Nobel
Introduction
This is a simple script allows you to set a limit to how many Items, Armors and/or Weapons the player can gain.
Features
Script
Instructions
Paste below 'Scene_Debug' (and 'SDK', if using), so long as it is above 'main'
Setting a max limit to an item/armor/weapon is as easy as...
{1 => 5} # (Meaning that Item ID 1 has a max limit of 5 can be gained)
FAQ
Q.) I set it so that the player can gain 100 Potions but it doesn't display correctly in my Items menu.
A.) Its up to you to edit your menus to display more than 99 items :P
Compatibility
This script overwrites the following methods of Game_Party
So place above anything that aliases these methods
Terms and Conditions
Free to use in any commercial or non-commercial game, please put my name in your credits if you use.
By: Kain Nobel
Introduction
This is a simple script allows you to set a limit to how many Items, Armors and/or Weapons the player can gain.
Features
- Ability to limit any item individually
- Can break the 99 max of gaining items
- Easy to setup
Script
Code:
#===============================================================================
# ** Party : Maximum Item Quantities
#===============================================================================
Â
#-------------------------------------------------------------------------------
# * SDK Log
#-------------------------------------------------------------------------------
if Object.const_defined?(:SDK)
 SDK.log('Party.MaxItemQuants', 'Kain Nobel ©', 2.5, '12.10.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
#===============================================================================
Â
class Game_Party
 #-----------------------------------------------------------------------------
 # * Cant Gain Items  (Used for Dummy Items)
 #-----------------------------------------------------------------------------
 Cant_Gain_Items  = []
 #-----------------------------------------------------------------------------
 # * Cant Gain Weapons (Used for Dummy Weapons)
 #-----------------------------------------------------------------------------
 Cant_Gain_Weapons = []
 #-----------------------------------------------------------------------------
 # * Cant Gain Armors  (Used for Dummy Armors)
 #-----------------------------------------------------------------------------
 Cant_Gain_Armors  = []
 #-----------------------------------------------------------------------------
 # * Maximum Items  = {item_id => max_quantity}
 #-----------------------------------------------------------------------------
 Max_Items = {}
 Max_Items.default = 99
 #-----------------------------------------------------------------------------
 # * Maximum Weapons = {item_id => max_quantity}
 #-----------------------------------------------------------------------------
 Max_Weapons = {}
 Max_Weapons.default = 99
 #-----------------------------------------------------------------------------
 # * Maximum Armors  = {item_id => max_quantity
 #-----------------------------------------------------------------------------
 Max_Armors = {}
 Max_Armors.default = 99
 #-----------------------------------------------------------------------------
 # * 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
Instructions
Paste below 'Scene_Debug' (and 'SDK', if using), so long as it is above 'main'
Setting a max limit to an item/armor/weapon is as easy as...
{1 => 5} # (Meaning that Item ID 1 has a max limit of 5 can be gained)
FAQ
Q.) I set it so that the player can gain 100 Potions but it doesn't display correctly in my Items menu.
A.) Its up to you to edit your menus to display more than 99 items :P
Compatibility
This script overwrites the following methods of Game_Party
- gain_item
- gain_weapon
- gain_armor
So place above anything that aliases these methods
Terms and Conditions
Free to use in any commercial or non-commercial game, please put my name in your credits if you use.