Spróbuj tego:
#===================================================================
# Ograniczenie sprzedaży przedmiotów [VX]
# by Ayene
# 01.06.2014
# www.ultimateam.pl
#===================================================================
# Opis:
# Skrypt umożliwia wybranie przedmiotów, które można sprzedać w sklepie.
#
# Instrukcja:
# By skorzystać ze skryptu w oknie 'Note' przy danym przedmiocie / broni /
# pancerzu w Bazie Danych umieść tekst <can_sell>.
#
# Przykładowo:
# Jeśli chcesz, by drużyna mogła sprzedać Potion,
# to w oknie 'Note' tego przedmiotu należy wpisać:
# <can_sell>
#===================================================================
module AYE
module Custom_Shop_Sell
SELL = /<(?:CAN_SELL|can_sell)\s*>/i
end
end
#===================================================================
# RPG::BaseItem
#===================================================================
class RPG::BaseItem
attr_accessor :can_sell
def item_cansell_ini
@can_sell = false
self.note.split(/[\r\n]+/).each { |line|
case line
when AYE::Custom_Shop_Sell::SELL
@can_sell = true
end
}
end
end
class Window_ShopSell < Window_Item
#--------------------------------------------------------------------------
# * Whether or not to include in item list
# item : item
#--------------------------------------------------------------------------
def include?(item)
return (item != nil and item.can_sell)
end
end
#===================================================================
# Scene_Title
#===================================================================
class Scene_Title < Scene_Base
alias aye_selllimit_loaddata load_database
def load_database
aye_selllimit_loaddata
for group in [$data_items, $data_weapons, $data_armors]
for obj in group
next if obj.nil?
obj.item_cansell_ini
end
end
end
end
#===================================================================
# Scene_Equip
#===================================================================
class Scene_Shop < Scene_Base
#--------------------------------------------------------------------------
# * Update Buy Item Selection
#--------------------------------------------------------------------------
def update_sell_selection
if Input.trigger?(Input::B)
Sound.play_cancel
@command_window.active = true
@dummy_window.visible = true
@sell_window.active = false
@sell_window.visible = false
@status_window.item = nil
@help_window.set_text("")
elsif Input.trigger?(Input::C)
@item = @sell_window.item
@status_window.item = @item
if @item == nil or @item.price == 0 or !@item.can_sell
Sound.play_buzzer
else
Sound.play_decision
max = $game_party.item_number(@item)
@sell_window.active = false
@sell_window.visible = false
@number_window.set(@item, max, @item.price / 2)
@number_window.active = true
@number_window.visible = true
@status_window.visible = true
end
end
end
end