Implemented XP generation algorithm to Legend

Needs tweaking.