Well, you can do this under the common events tab in the data base.
Use the conditional branch for when a weapon is equipped. Than set a conditional branch(called: ___ AP) and set it so that when the hero's AP is equal to a certain amount, he will learn a certain ability.
Than in the monster battles(im not sure if it works in common event), set it so that you gain AP depending on what attack you do(you can even set it to randomize between 2 numbers) and make it add to "___ AP"
It can than be reset for a new ability via con branch after an ability is set or if you switch weapons.
---
I hope this is what you mean. If it is, I will do a little demo with coding for you.
something of the sort. I'll test it later or probably after you do it XD but as for the AP giving on monsters, they give a set amount as they do with EXP.
Hmm, AP gains would be difficult to implement, mainly because the only way to tell if someone actually beat the monsters or not is through an event that actually starts the battle in the first place. Random battles can't tell if you ran away or won the fight. Any event that attempts to add EXP based on the battle ending would probably be defeated if you ran from battle, giving you AP anyway...
Hmm, AP gains would be difficult to implement, mainly because the only way to tell if someone actually beat the monsters or not is through an event that actually starts the battle in the first place. Random battles can't tell if you ran away or won the fight. Any event that attempts to add EXP based on the battle ending would probably be defeated if you ran from battle, giving you AP anyway...
Trust me, I know how to avoid this. I will make a variable 'potential AP' which is what is accumulated in battle and than set it to detect if the monsters die, if they do than the AP will be added, if not, the "potential AP" is set to zero again.