This could be done by either implementing the whole dopple system, but could also be done with an NPC that checks your level and stars a fight with a dopple in your level bracket (0-20, 20-40, 40-60 etc.). To save time, instead of figuring out how a doploon store should be added, you could also just restrict the class spells to their respective class and make them all drop from the dopple.