I read this as an eBook in the last two years, so I'll see if I can find it in my book history, but the setting is somewhere in the nearish future where full-body virtual reality (VR) is possible, and people participate in elaborate MMOs (Massive Multiplayer Online). It has been discovered that if you stay logged in too long, you can no longer return to your body, and you remain in the virtual reality world forever. This is happening all over the world, and at an accelerating rate. The main character is, I think, suffering from a terminal disease, so he purposefully gimmicks his machine to override the safety interlocks. The VR world is more or less run by a combination of AI (artificial intelligence) and guilds, many of those guilds run by people who've permanently transitioned into the game.
The protagonist accepts a quest from a hermit that puts him on the path to be an adherent to a "dark god" in the world, whose temples have all been destroyed, and one of his classes lets him reanimate dead bodies. Early on, he lucks into a very rare beast (a red bear?) and its correspondingly rare loot drop, and he teams up with first a young girl (who I think is playing an elf) and then with a particular guild in town that is largely comprised of ex-military (many of them horribly mangled from combat injuries and escaping their physical handicap by entering the virtual world. I also want to say a lot of them were Russian). I remember he participated in a tournament that they were holding (and got pretty far in the single combat due to the combination of his powerful pet monster and him using unexpected tactics. I remember him getting the help of a powerful magic item from a guild-mate to confer... fire immunity?). There was also something going on where people could grant ribbons to those they liked, and his pet wound up with a ton of them, although not enough to win first place.
Some time later, I think after he's been farming a particular dungeon instance that yields an important artifact for rebuilding his god's temple, he's finding himself obsessed with smoking a cigarette, something which doesn't exist in-universe due to how the game was programmed (presumably the gaming company wanting to avoid public censure for "encouraging smoking in children"). Through some clever sidestepping of the rules, he manages to develop a crafting recipe which creates something very much like cigarettes. Realizing that this puts a huge target on his back, he arranges to sell the recipe to the guild, but only after he secures a large stock of the key components. Some time after that, and near the end of the book, he's kidnapped by another group, who has a way of keeping him from teleporting away, who torture him (and I think a thief character he met near the beginning), keeping him just at the edge of where he would be able to die and respawn elsewhere, trying to get him to turn over the cigarette recipe. Something unexpected happens where the dark god shows up and talks to him, I think indicating that it is one of the artificial intelligences and that it's smarter than people think. It does something (kills him?) to allow him to return home. I think the torturing group gets their comeuppance thanks to several guilds allying against them and that's where the book ended, to be continued in the sequel.
If I recall correctly, the elf maiden he befriended is a young girl on the outside, whose sister was assaulted by someone rich and powerful who got away with it. The maiden's goal is to secure a gun, shoot that rich and powerful guy, and then... well, she expects to die. I think the protagonist instead convinces her to (after getting her vengeance) log into the virtual world and be "trapped" by staying too long.
The game world is more or less your standard LitRPG setup where multiple stats and skills increase through leveling up and using the skills. I don't recall any NPCs outside of the monsters. The RPG system was pretty standard MMO with people choosing classes and accepting quests from quest-givers, as well as guilds organizing raids, high-level characters with epic gear who could pretty much do whatever they wanted, and an economic system based on real-world auction houses for virtual items.