Just made this for you. :D
class Game_System::MapCostEffects
Starting_Item_Effects = {}
Starting_Weapon_Effects = {}
Starting_Armor_Effects = {}
attr_accessor :items
attr_accessor :weapons
attr_accessor :armors
attr_reader :map_item_effects
attr_reader :map_weapon_effects
attr_reader :map_armor_effects
def initialize
@items = 1.0
@weapons = 1.0
@armors = 1.0
@map_item_effects = Starting_Item_Effects
@map_weapon_effects = Starting_Weapon_Effects
@map_armor_effects = Starting_Armor_Effects
end
def setup(map_id)
if @map_item_effects.has_key?(map_id)
@items = @map_item_effects[map_id]
end
if @map_weapon_effects.has_key?(map_id)
@weapons = @map_weapon_effects[map_id]
end
if @map_armor_effects.has_key?(map_id)
@armors = @map_armor_effects[map_id]
end
end
def set_item_effect(map_id, effect)
if effect.nil?
@map_item_effects.delete(map_id)
return
end
@map_item_effects[map_id] = effect
end
def set_weapon_effect(map_id, effect)
if effect.nil?
@map_weapon_effects.delete(map_id)
return
end
@map_weapon_effects[map_id] = effect
end
def set_armor_effect(map_id, effect)
if effect.nil?
@map_armor_effects.delete(map_id)
return
end
@map_armor_effects[map_id] = effect
end
end
class Game_System
attr_reader :map_cost_effects
alias_method :seph_mapcosteffects_gmsys_init, :initialize
def initialize
seph_mapcosteffects_gmsys_init
@map_cost_effects = MapCostEffects.new
end
end
class Game_Map
alias_method :seph_macpcosteffects_gmmap_setup, :setup
def setup(map_id)
$game_system.map_cost_effects.setup(map_id)
seph_macpcosteffects_gmmap_setup(map_id)
end
end
class RPG::Item
alias_method :seph_mapcosteffects_rpgitem_price, :price
def price
n = seph_mapcosteffects_rpgitem_price
n = Integer(n * $game_system.map_cost_effects.items)
return n
end
end
class RPG::Weapon
alias_method :seph_mapcosteffects_rpgwpn_price, :price
def price
n = seph_mapcosteffects_rpgwpn_price
n = Integer(n * $game_system.map_cost_effects.weapons)
return n
end
end
class RPG::Armor
alias_method :seph_mapcosteffects_rpgarm_price, :price
def price
n = seph_mapcosteffects_rpgarm_price
n = Integer(n * $game_system.map_cost_effects.armors)
return n
end
end
Ok. This does several things:
~ Lets you set item, weapons and armors price differently by a percent by map defaults
~ Lets you change your map defaults
~ Lets you change the item, weapons and armors price percents without the map switch (however, switching to a map with a price defined, the price will revert to the map default).
Ok, so lets start with setting you map defaults.
Starting_Item_Effects = {}
Starting_Weapon_Effects = {}
Starting_Armor_Effects = {}
Lets say you want to add the following defaults:
~ Map 1 - Items Price x 1.4, Weapons x 0.8, Armors x 1.3
~ Map 3 - Items Price x 0.5
~ Map 4 - Weapons Price x 1.1, Armors x 1.2
Below the lines I gave you above, you would add this:
# Map 1 - Items Price x 1.4, Weapons x 0.8, Armors x 1.3
Starting_Item_Effects[1] = 1.4
Starting_Weapon_Effects[1] = 0.8
Starting_Armor_Effects[1] = 1.3
# Map 3 - Items Price x 0.5
Starting_Item_Effects[3] = 0.5
# Map 4 - Weapons Price x 1.1, Armors x 1.2
Starting_Weapon_Effects[4] = 1.1
Starting_Armor_Effects[4] = 1.2
Just like that. :thumb:
Changing the defaults mid-game, just use:
$game_system.map_cost_effects.set_item_effect(map_id, effect)
$game_system.map_cost_effects.set_weapon_effect(map_id, effect)
$game_system.map_cost_effects.set_armor_effect(map_id, effect)
Just use nil to erase a map effect. For instance, if later in the game, map 4's weapons would cost 0.8, you would use the set_weapon_effect line, with 4 as the map_id and 0.8 as the effect. Likewise, you didn't want map 3 to have an item effect, use the set_item_effect line with nil as the effect.
Finally, you can change the price manually:
$game_system.map_cost_effects.items = x.x
$game_system.map_cost_effects.weapons = x.x
$game_system.map_cost_effects.armors = x.x
Enjoy!