Pokemon game

i really need help with my pokemon game because i need to make a random encounter engine so for example, after around 25 steps it goes to random frames between 5 and 8, my pokemon game is not tile based.