i'm sure that as long as you're not making a profit off the book anything is fine, like if you're making it as an art project
if however you'll be selling the books or making profit of any sort from it i think it might be in violation since lore and the world in general is riot's intellectual property, even if you just change the names
its just like if you were to take the harry potter books and changed harry to brad or something the book is obviously going to be the same just because you've changed the names or a few minor things its still someone else's concept
on that note i think a lore book would be a cool non-profit project but if you intend on profiting off it you might think about conceptualizing your own world using riot's as inspiration but not as reference per-say
fantasy novels are the shit B)