Enemy encounters in certain parts of the map

Mon, 28 Jan 2008 23:25:32 -0500 - Author:
The script below allows enemy encounters in defined regions of RPG Maker XP Maps. Put it in a new script section just before the last one in the script editor. Look at DEFINEDENCOUNTERS at the top to learn how to customize it.
class Game_Map
####################
 DEFINEDENCOUNTERS=[
   # Map ID, Left Edge, Top Edge, Right Edge, Bottom Edge, Troop IDs
   [1,0,0,10,10,[2,3,4,5]],
   [1,10,0,20,10,[2,3,4,5]]
 ]
####################
 def encounter_list
  if $game_player
   for enc in DEFINEDENCOUNTERS
    if enc[0]==self.map_id &&
       $game_player.x>=enc[1] && $game_player.x>enc[3] &&
       $game_player.y>=enc[2] && $game_player.y>enc[4]
     return enc[5]
    end
   end
  end
  return @map.encounter_list
 end
end