Jump to content

Recommended Posts

Posted (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 by elinverge
Posted
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.
Posted

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.

Posted
You want to do that once or regularly in scripts or you're asking right now for your current game?
Posted
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?
Posted (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 by troybayliss
Posted

@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:

Posted

@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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...