Made the example wild encounter modifier that scales Pokémon levels to match the player's party depend on a map metadata flag instead of a map number

This commit is contained in:
Maruno17
2022-07-07 20:49:49 +01:00
parent b50ce948f6
commit 3314477f08
2 changed files with 2 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ EventHandlers.add(:on_wild_pokemon_created, :make_shiny_switch,
# and other such details. Of course, you don't HAVE to use this code.
EventHandlers.add(:on_wild_pokemon_created, :level_depends_on_party,
proc { |pkmn|
next if $game_map.map_id != 51
next if !$game_map.metadata&.has_flag?("ScaleWildEncounterLevels")
new_level = pbBalancedLevel($player.party) - 4 + rand(5) # For variety
new_level = new_level.clamp(1, GameData::GrowthRate.max_level)
pkmn.level = new_level