Kain Nobel
Member
Party : Max Item Quantities
Version: 2.0
By: Kain Nobel
Introduction
This script basically allows you to adjust the maximum ammount of certain items that can be gained, ie you can only gain 3 of [this] or 10 of [that].
Features
Script
Instructions
This script doesn't require SDK, but if SDK is present it logs the overwritten methods. Please place this script below 'SDK' (if using) and above 'main'.
Compatibility
This script overwrites the following...
Game_Party.gain_item
Game_Party.gain_armor
Game_Party.gain_weapon
...please place it *ABOVE* scripts which alias these methods.
Terms and Conditions
Free to use in commercial and non-commercial games, please credit yours truely!
Version: 2.0
By: Kain Nobel
Introduction
This script basically allows you to adjust the maximum ammount of certain items that can be gained, ie you can only gain 3 of [this] or 10 of [that].
Features
- Adjust the maximum ammount of certain items that can be carried
- Maximums can exceed the default 99 limit (might require edits to Window_Item)
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
 #-----------------------------------------------------------------------------
 # * 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)
  unless $data_items[id].nil?
   @items[id] = [[item_number(id) + n, 0].max, Max_Items[id]].min
  end
 end
 #-----------------------------------------------------------------------------
 # * Gain Armor
 #-----------------------------------------------------------------------------
 def gain_armor(id, n)
  unless $data_armors[id].nil?
   @armors[id] = [[armor_number(id) + n, 0].max, Max_Armors[id]].min
  end
 end
 #-----------------------------------------------------------------------------
 # * Gain Weapon
 #-----------------------------------------------------------------------------
 def gain_weapon(id, n)
  unless $data_weapons[id].nil?
   @weapons[id] = [[weapon_number(id) + n, 0].max, Max_Weapons[id]].min
  end
 end
end
Instructions
This script doesn't require SDK, but if SDK is present it logs the overwritten methods. Please place this script below 'SDK' (if using) and above 'main'.
Compatibility
This script overwrites the following...
Game_Party.gain_item
Game_Party.gain_armor
Game_Party.gain_weapon
...please place it *ABOVE* scripts which alias these methods.
Terms and Conditions
Free to use in commercial and non-commercial games, please credit yours truely!