What if the enemies could respawn? What if encounters could be repeated, and massacres of entire cities undone with time?

This thread aims to do just that.

Right now I just have a very basic Story script in place to respawn all characters after some amount of time has passed-

Code
IF
CharacterDied(_Character)
AND
Time(_,_,_TH)
THEN
DB_DeadCharacters(_Character, _TH);

IF
CharacterEnteredCombat(_Character,_)
AND
_Character.isPlayer()
THEN
ProcResurrectCharacters();

PROC
ProcResurrectCharacters()
AND
Time(_,_,_TH)
AND
DB_DeadCharacters(_Character, _deadTime)
AND
IntegerSubtract(_TH, _deadTime, _delta)
AND
_delta >= 1
THEN
CharacterResurrect(_Character);
NOT DB_DeadCharacters(_Character, _deadTime);
ProcResurrectCharacters();



It kind of works, respawning (or more accurately, resurrecting) them after at least 1-2 min. has passed since their death when the players enter a new combat, but there are some issues.

#1 issue: The resurrected enemies do not give exp when defeated again (they probably don't drop more items either, but I haven't tested that much).

I have only tested it a little bit to see that it could possibly work. I'm considering having the enemies spawn a copy of themselves at their location instead of being resurrected after the time has passed.