I'm making an RPG map with a 'random encounter' system, i.e., in certain predefined areas a player's hero will freeze at random and their screen will center over a small room that acts as a separate "battle area" (a la Pokemon) where their hero will be transported and and a monster will appear. The game will then detect combatants and the combat system will kick in. It will be based off of certain regions that will each have different possible monster tables (difficulty increasing as the map goes along).
My question is this: what would be the most efficient way to implement the random part of it? What I'd like to do is have a trigger that runs a check every 2 seconds with a 20% chance of initiating a battle- so the average rate of battles as long as a hero remains in the region is one every 10 seconds. How would you go about doing this? Is this possible without JASS?
My question is this: what would be the most efficient way to implement the random part of it? What I'd like to do is have a trigger that runs a check every 2 seconds with a 20% chance of initiating a battle- so the average rate of battles as long as a hero remains in the region is one every 10 seconds. How would you go about doing this? Is this possible without JASS?