elinverge Posted June 15, 2011 Posted June 15, 2011 (edited) Hi, I want to have a npc completely renew himeself (remove disease, restore damaged attributes, all armor/weapon health/enchantments restored etc.), in short, restore to original status. Is "resurrect" good enough? Thank you. Edited June 15, 2011 by elinverge
Kendo 2 Posted June 15, 2011 Posted June 15, 2011 Open the console, click on him and type KILL. Hit enter and exit the console. You can now remove any gear you want from his corpse. Now back in the console click him again and then type resurrect as you intended. That will reset him but be warned, if he is tied to any quests it may screw them up.
Vagrant0 Posted June 15, 2011 Posted June 15, 2011 Open the console, click on him and type KILL. Hit enter and exit the console. You can now remove any gear you want from his corpse. Now back in the console click him again and then type resurrect as you intended. That will reset him but be warned, if he is tied to any quests it may screw them up.If he is under the effects of any added abilities (usually from mods), these also won't be cleared when being resurrected, so you should probably double check and remove them manually if possible.
Grumpf_be Posted June 15, 2011 Posted June 15, 2011 You want to do that once or regularly in scripts or you're asking right now for your current game?
elinverge Posted June 15, 2011 Author Posted June 15, 2011 You want to do that once or regularly in scripts or you're asking right now for your current game? Reregularly in scripts.
Grumpf_be Posted June 15, 2011 Posted June 15, 2011 Mmm then we have to investigate as I don't know what is cleared after resurrection. If you don't mind me asking, can you elaborate on your goal?
Kendo 2 Posted June 15, 2011 Posted June 15, 2011 I have a script that does that. I'm at work right now. I'll post it when I get home.
troybayliss Posted June 15, 2011 Posted June 15, 2011 (edited) Resurrect will reset all the reference-specific values (damaged attributes, disposition, etc) and restore the NPC to the original base object as it is in the CS (health, equipment, etc).Problem is that some functions modify the base object, so if you add a spell, disease, ability to a NPC, put it in a new faction, use setav or setlevel on it, those changes will remain even after it's been resurrected. So Resurrect is good if you don't modify the base object, otherwise you will have to manually revert back what was modified. Edited June 20, 2011 by troybayliss
Kendo 2 Posted June 16, 2011 Posted June 16, 2011 @elinverge Make this an Object Script and assign it to the NPC. scn XXXResetScript Begin GameMode If XXXNPC.isincombat == 0 Cast AltarNine XXXNPC endif end This will get all of the toon's stats back to orginal levels and cure all poisons and diseases. Of course, you'll have to insert DoOnce and set the value to keep him from constantly casting it on himself if he isn't fighting. :tongue: You could also add GetActorValue Health and the numerical value you like to the same line as 'isincombat'. That way if his health was less than or equal say, 50 he would cast the spell on himself. As for restoring his equipment and gear to orginal condition you'd have to script disable him, script kill him, script resurrect him, script enable him and script movetoplayer. Or at least that's how I'd do it. Someone else might have a better way and they probably do. :thumbsup:
troybayliss Posted June 16, 2011 Posted June 16, 2011 @Kendo 2 If you plan to use "Resurrect" on a NPC, then casting a healing spell on it it's not really necessary. As for diseases, NPCs don't catch them like the player and "cure disease" spells won't work on them (you can't cure NPC vampires or rats from diseases that way): the only way to add or remove a disease to a NPC is using add/removespell functions.
Recommended Posts