I'm not too sure what would make fan fiction illegal as long as A.) You're not taking credit for the author's properties and B.) You're not making any money off of it (I.E. like those bootleg Harry...