Final Fantasy style Rpg

I am fairly new to Action scripting, all though i have made a few games. I wondering if anyone could help me with making a random battle system. The type of enemy would also be random, like Final fantasy. Again, i’m new, so if you could please tell me where each code goes, that would be great.