Inventory: Breaking Limits
Version: 1.20
Author: Ahnez67
Date: 02.3.2011
Version History
- <Version 1.2> 02.05.2011 - Shop bug Fixed
- <Version 1.0> 02.03.2011 - Original Release
Planned Future Versions
Description
This Script can change the default limit for Gold (default: 9999999). Itens, Weapons and Armour (Default: 99 each)
Features
- Virtually infinite limit for Gold and Itens
- Limit in Shops
Screenshots Instructions
Paste it above Main, but below the Default Scripts. Change the limits at lines 18,19, 20 and 21.
Line 22: That one changes the limit in Shops. If it's 99, then, you can only buy itens/armour/weaponry in shops up to 99.
And Done, it's ready to use.
You can change the limits with Script Calls:
AHNEZ67::BREAK::GOLDMAXB = new gold limit
AHNEZ67::BREAK::ITEMMAXB = new item limit
AHNEZ67::BREAK::WEAPONMAXB = new weapon limit
AHNEZ67::BREAK::ARMORMAXB = new armour limit
AHNEZ67::BREAK::SHOPMAXB = new shop limit
Script
#-----------------------------------------------------------------------
#---------------------AHNEZ67 INVENTORY BREAKING LIMITS----------------
#----------------------------------------------------------------------
#Place the Script above Main, but below the default Scripts#
#This Script can change the limit of Gold, Items, Weapons and Armour in the
#inventory-
#It's very easy to use, change the parameters (numbers in red) at lines 18 (Gold
#limit, 19 (Item Limit), 20 (Weapon Limit) and 21 (Armour Limit).
#The parameter in line 22, is the limit to buy in shops. if SHOPMAXB (line 22)
#is 99, means that you can only buy things in shops up to 99
##############################################################################
##############################################################################
#EDITABLE REGION#
module AHNEZ67
module BREAK
GOLDMAXB = 100000000 #Gold limit
ITEMMAXB = 9999 #Item Limit
WEAPONMAXB = 9999 #Weapon Limit
ARMORMAXB = 9999 #Armour Limit
SHOPMAXB = 9999 #Limit in Shops
end
end
#EDITABLE REGION END#
class Game_Party < Game_Unit
def gain_gold(n)
@gold = [[@gold + n, 0].max, AHNEZ67::BREAK::GOLDMAXB].min
end
def gain_item(item, n, include_equip = false)
number = item_number(item)
case item
when RPG::Item
@items[item.id] = [[number + n, 0].max, AHNEZ67::BREAK::ITEMMAXB].min
when RPG::Weapon
@weapons[item.id] = [[number + n, 0].max, AHNEZ67::BREAK::WEAPONMAXB].min
when RPG::Armor
@armors[item.id] = [[number + n, 0].max, AHNEZ67::BREAK::ARMORMAXB].min
end
n += number
if include_equip and n < 0
for actor in members
while n < 0 and actor.equips.include?(item)
actor.discard_equip(item)
n += 1
end
end
end
end
end
class Window_ShopBuy < Window_Selectable
def initialize(x, y)
super(x, y, 304, 304)
@shop_goods = $game_temp.shop_goods
refresh
self.index = 0
end
def item
return @data[self.index]
end
def refresh
@data = []
for goods_item in @shop_goods
case goods_item[0]
when 0
item = $data_items[goods_item[1]]
when 1
item = $data_weapons[goods_item[1]]
when 2
item = $data_armors[goods_item[1]]
end
if item != nil
@data.push(item)
end
end
@item_max = @data.size
create_contents
for i in 0...@item_max
draw_item(i)
end
end
def draw_item(index)
item = @data[index]
number = $game_party.item_number(item)
enabled = (item.price <= $game_party.gold and number < AHNEZ67::BREAK::SHOPMAXB)
rect = item_rect(index)
self.contents.clear_rect(rect)
draw_item_name(item, rect.x, rect.y, enabled)
rect.width -= 4
self.contents.draw_text(rect, item.price, 2)
end
def update_help
@help_window.set_text(item == nil ? "" : item.description)
end
end
class Scene_Shop < Scene_Base
def update_buy_selection
@status_window.item = @buy_window.item
if Input.trigger?(Input::B)
Sound.play_cancel
@command_window.active = true
@dummy_window.visible = true
@buy_window.active = false
@buy_window.visible = false
@status_window.visible = false
@status_window.item = nil
@help_window.set_text("")
return
end
if Input.trigger?(Input::C)
@item = @buy_window.item
number = $game_party.item_number(@item)
if @item == nil or @item.price > $game_party.gold or number == AHNEZ67::BREAK::SHOPMAXB
Sound.play_buzzer
else
Sound.play_decision
max = @item.price == 0 ? AHNEZ67::BREAK::SHOPMAXB : $game_party.gold / @item.price
max = [max, AHNEZ67::BREAK::SHOPMAXB - number].min
@buy_window.active = false
@buy_window.visible = false
@number_window.set(@item, max, @item.price)
@number_window.active = true
@number_window.visible = true
end
end
end
end
Credit
Support
Post here if you encounter any problem with this script
Known Compatibility Issues
None know
Demo
There's no Demo version of this Script. It's not really necessary for such simple Script.
---------------------------------------------------------------------------------------
No credits needed. But it was made by me.
Commercial and non-Commercial games are all the same for me. You are free to use and edit it as you wish