I am working on a magic effect script which involves resurrecting an NPC and making it so that they can no longer talk. Right now, I am using SetDestroyed, but that makes it so any quest items in their inventory become inaccessible, a potentially very annoying if not game breaking problem. I could make it so that all of their possessions are moved to the player or a container, but this would be inconvenient, as it would over encumber the player with items they don't want or force them to go somewhere else to get the things. What I need is a way to either move only their quest items to the player, or set them so that there is no talk option but they can still be pickpocketed and their corpse can be looted later. It would also be nice to have some way of changing their name in a way which references their normal name like the way the reanimate effect changes "RandomNPC" to "PlayerName's RandomNPC," and removing them from all factions they are currently a member of. This is not intended for an individual NPC. It needs to be compatible with any NPC in the vanilla game or in a mod, so I cannot just add a line to remove every existing NPC faction. Any ideas?
This is the first time I have posted here. If I am violating any rule about format or content, feel free to mention it.