so Hi guys I commissioned shaz for a script in the past. She's done a really great job, but my game got transfert to MV...and I don't want to bother her with the conversion so I tried by myself...but I just can't suceed to convert it xD...so guys I ask your help please ;A;
here the script :
here the script :
Code:
module DataManager
class << self
alias shaz_equip_restrict_load_database load_database
end
def self.load_database
shaz_equip_restrict_load_database
build_equipment_restrictions
end
def self.build_equipment_restrictions
$data_weapons.compact.each { |w| w.build_equipment_restrictions }
$data_armors.compact.each { |a| a.build_equipment_restrictions }
end
end
class RPG::EquipItem < RPG::BaseItem
def build_equipment_restrictions
@restrict_users = []
@restrict_minus = 0
note.split(/[\r\n]+/).each do |line|
case line
when /<user /i
@restrict_users = /<user (.*)>/i.match(line)[1].scan(/\d+/).collect { |i| i.to_i}
when /<minus (\d+)>/i
@restrict_minus = (100 - $1.to_i)/100.0
end
end
end
def user_params(actor_id, param_id)
if @restrict_users.empty? || @restrict_users.include?(actor_id)
value = params[param_id]
else
value = (params[param_id] * @restrict_minus).to_i
end
value
end
attr_accessor :restrict_users
attr_accessor :restrict_minus
end
class Game_Actor < Game_Battler
def param_plus(param_id)
equips.compact.inject(super) {|r, item| r += item.user_params(@actor_id, param_id) }
end
end