here you go:
Made by Sandgolem at gamebaker.com
This script allows you to prevent shops from buying types of items, or only buying certain items of a type. Can be mixed, you can make one shop that will only buy armors #1-10 and no items/weapons for example. Each shop can have their own settings, with no script editing required.
#==========================================================================
# ** SG Limited Shop Selling
#==========================================================================
# sandgolem
# Version 3
# 26.04.06
#==========================================================================
# Instruct: http://www.gamebaker.com/rmxp/scripts/limited-shop-selling.htm
#==========================================================================
#
# To check for updates or find more scripts, visit:
# http://www.gamebaker.com/rmxp/scripts/
#
# To use this script, copy it and insert it in a new section above "Main",
# but under the default scripts and the SDK if you're using it.
#
# Have problems? Official topic:
# http://forums.gamebaker.com/showthread.php?t=146
#
#==========================================================================
begin
SDK.log('SG Limited Shop Selling', 'sandgolem', 3, '26.04.06')
if SDK.state('SG Limited Shop Selling') != true
@sg_limshopsell_disabled = true
end
rescue
end
if !@sg_limshopsell_disabled
#--------------------------------------------------------------------------
class Game_Party
def sg_limited_shop_start
if $sg_doesntbuy_weapon or $sg_onlybuys_weapon
@sg_limsell_weapons = @weapons.clone
@weapons = {}
if $sg_onlybuys_weapon
for i in 0...$sg_onlybuys_weapon.size
if @sg_limsell_weapons[$sg_onlybuys_weapon[i]] != nil
@weapons[$sg_onlybuys_weapon[i]] =
@sg_limsell_weapons[$sg_onlybuys_weapon[i]]
end
end
end
end
if $sg_doesntbuy_armor or $sg_onlybuys_armor
@sg_limsell_armors = @armors.clone
@armors = {}
if $sg_onlybuys_armor
for i in 0...$sg_onlybuys_armor.size
if @sg_limsell_armors[$sg_onlybuys_armor[i]] != nil
@armors[$sg_onlybuys_armor[i]] =
@sg_limsell_armors[$sg_onlybuys_armor[i]]
end
end
end
end
if $sg_doesntbuy_item or $sg_onlybuys_item
@sg_limsell_items = @items.clone
@items = {}
if $sg_onlybuys_item
for i in 0...$sg_onlybuys_item.size
if @sg_limsell_items[$sg_onlybuys_item[i]] != nil
@items[$sg_onlybuys_item[i]] =
@sg_limsell_items[$sg_onlybuys_item[i]]
end
end
end
end
end
def sg_limited_shop_end
if @sg_limsell_weapons
@weapons = @sg_limsell_weapons.clone
@sg_limsell_weapons = nil
end
if @sg_limsell_armors
@armors = @sg_limsell_armors.clone
@sg_limsell_armors = nil
end
if @sg_limsell_items
@items = @sg_limsell_items.clone
@sg_limsell_items = nil
end
end
end
class Window_ShopSell
alias sandgolem_limshopsell_shopsell_refr refresh
def refresh
$game_party.sg_limited_shop_start
sandgolem_limshopsell_shopsell_refr
$game_party.sg_limited_shop_end
end
end
class Scene_Shop
alias sandgolem_limshopsell_shop_main main
def main
sandgolem_limshopsell_shop_main
$sg_onlybuys_armor = nil
$sg_doesntbuy_armor = nil
$sg_onlybuys_item = nil
$sg_doesntbuy_item = nil
$sg_onlybuys_weapon = nil
$sg_doesntbuy_weapon = nil
end
end
#--------------------------------------------------------------------------
end
Simply put it in your game, no assembly required.
To keep a shop from buying certain types of items, use these in a call script right before the shop processing:
$sg_doesntbuy_item = true
$sg_doesntbuy_armor = true
$sg_doesntbuy_weapon = true
To have a shop buy only certain items from that set, use these (not the one for that type above):
$sg_onlybuys_item = [#,#]
$sg_onlybuys_armor = [#,#]
$sg_onlybuys_weapon = [#,#]
Those are arrays, use [#,#,#] and [#,#,#,#,#] to add more items to the list. Replace the #s with the item #'s from the database. Make sure you disable the other types of items from being sold if you want the shop to only buy those items.
You can mix and match them however you want. All of these settings are automatically removed after the shop has been called.