class RPG::Item
#-----------------------------------------------------------------------------
# * Alias Listings
#-----------------------------------------------------------------------------
alias_method :changeprices_rpgitm_priceget, :price
#-----------------------------------------------------------------------------
# * Price
#-----------------------------------------------------------------------------
def price
# If game system defined and item assigned a price key
if $game_system.is_a?(Game_System) && $game_system.item_price.has_key?(id)
# Return custom item price
return $game_system.item_price[id]
end
# The usual
changeprices_rpgitm_priceget
end
#-----------------------------------------------------------------------------
# * Price = (value)
#-----------------------------------------------------------------------------
def price=(value)
# Set custom price
$game_system.item_price[id] = [value, 0].max
end
end
class RPG::Armor
#-----------------------------------------------------------------------------
# * Alias Listings
#-----------------------------------------------------------------------------
alias_method :changeprices_rpgarm_priceget, :price
#-----------------------------------------------------------------------------
# * Price
#-----------------------------------------------------------------------------
def price
# If game system defined and armor assigned a price key
if $game_system.is_a?(Game_System) && $game_system.armor_price.has_key?(id)
# Return custom armor price
return $game_system.armor_price[id]
end
# The usual
changeprices_rpgarm_priceget
end
#-----------------------------------------------------------------------------
# * Price = (value)
#-----------------------------------------------------------------------------
def price=(value)
# Set custom price
$game_system.armor_price[id] = [value, 0].max
end
end
class RPG::Weapon
#-----------------------------------------------------------------------------
# * Alias Listings
#-----------------------------------------------------------------------------
alias_method :changeprices_rpgwpn_price, :price
#-----------------------------------------------------------------------------
# * Price
#-----------------------------------------------------------------------------
def price
# If game system defined and weapon assigned a price key
if $game_system.is_a?(Game_System) && $game_system.weapon_price.has_key?(id)
# Return custom weapon price
return $game_system.weapon_price[id]
end
# The usual
changeprices_rpgwpn_price
end
#-----------------------------------------------------------------------------
# * Price = (value)
#-----------------------------------------------------------------------------
def price=(value)
# Set custom price
$game_system.weapon_price[id] = [value, 0].max
end
end
class Scene_Shop
#-----------------------------------------------------------------------------
# * Alias Listings
#-----------------------------------------------------------------------------
alias_method :changeprices_scnshop_main, :main
#-----------------------------------------------------------------------------
# * Main
#-----------------------------------------------------------------------------
def main
# The usual
changeprices_scnshop_main
# Reset prices
$game_system.reset_prices
end
end
Instructions
Place below Main and anything that modifies Shops in any major way.
Compatibility
This script was written for RMXP.
This script overwrites the following...
RPG::Item#price=
RPG::Armor#price=
RPG::Weapon#price=
I do suppose these could be aliased. I forget if I had a good reason for an overwrite, this was written eons ago...
(NOTE: This script does call SDK.log_ovewrite if the SDK is in your project. It does not matter if you're using SDK or not, those lines shouldn't interfere with anything.)
Author's Notes
It may sound dangerous, but before you call your shop, you can simply do...