Respawn/Death System
The following is a basic description of the respawn mechanic in my game world. I’m looking for the closest approximation in terms of existing scripting to modify this for my purposes, plus any advice on how to implement missing elements.
The first opportunity that players have to survive an unfortunate event is the bleeding system. Characters can never be killed outright by a single blow, rather they stop losing health at zero HPs, fall unconscious and start to bleed at a rate of 1 HP/round. Death happens at negative CON. Every round there is a small chance that you will stabilise anyway, in which case you will start to recover HPs at the rate of one per five (game) minutes.
While unconscious anyone can stop the bleeding with certain magic while still in combat, or bandage you with a single application of a heal kit once out of combat. The AI will usually ignore unconscious enemies if there are still others to fight so when a PC goes down you have a choice… either subdue the remaining enemies quickly or try and lead them away so one party member not in combat can bandage the incapacitated character.
If the party is completely wiped out monsters and beasts will invariably just finish them off, whereas intelligent enemies may elect to take them captive.
At the point of death the soul is temporarily housed in the PC’s medicine bundle wherever that may be. This is a tactical choice. Players may elect to take the bundle with them, to hide it nearby (persistently stored in a buried location) or even leave it back at the medicine lodge. In any case if the bundle is destroyed the spirit will return to the medicine lodge. If stolen, nothing can be done until the medicine bundle is recovered and enemies may choose to do other unpleasant things with your spirit.
To be raised, the player needs a healthy host body. To minimise penalties this should ideally be their original repaired body. If the body has been destroyed then this is obviously not an option. If it has not been mutilated at all then it simply needs to be healed back up to 1HP or more. If mutilated (and there is a whole system for this in Middlewater... I'm using an expansion of THIS) the dismembered parts need to be gathered and a spell used to make them whole again (the ‘scalp’ is not required but its absence will be a matter of great shame and ongoing anxiety).
The body must be in the vicinity of the spirit – whether it be in the bundle or the lodge – when the medicine man casts the resurrection magic. When raised in this fashion the PC loses all but one point of the experience in their current level and a single point of STR, CON or DEX. There are items in the game that can permanently raise stats so the decline is not necessarily irreversible, although obviously if you die often it will quickly become so.
If the original body is destroyed, the spirit may try and possess the body of a captive taken to the Medicine Lodge. If successful one gains the physical characteristics of the new living host (STR, DEX & CON) while retaining the intellectual stats (INT, WIS & CHR) and most of the skills and experience of the original character. Some experience is lost (enough to put you midway through the preceding level) whereas a point of WIS, INT or CHR is permanently lost.
The dynamic of this should be obvious. A warrior or scout who is dependent on physical stats will probably wish to switch bodies after a number of deaths since the loss of intellectual stats is less of a concern. Conversely a medicine man or sorcerer will wish to retain their original form as long as possible – and so have to put up with a weakened body – to avoid loss of intellectual stats.