It would be nice to have a table of modifiers to determine if someone turns undead, like did they die young? Were they murdered? Were they killed with magic? Was it a Death spell? All of those add to the chance. But if they died in their sleep, received a proper burial, were mourned sincerely by loved ones, received Hell money, or died heroically, then the chance goes down.
That wouldn't be too hard.
Undead Test: Roll 3d6. On an 18+, they turn undead.
Modifiers
-1 Proper Burial
-1 Good Aligned
-1 Died Without Suffering
-1 Died Obtaining their Goals
-1 Originally, corpse or ground was Hallowed (see note below)
+1 Evil Aligned, level 6 or less
+2 Evil aligned, level 7 or greater
+1 Corpse completely neglected
+2 Died violently
+1 Died with prolonged suffering
+1 Died vainly with an important task left undone
+2 Other undead already present or ground is desecrated
+1 Per level of necromantic taint (up to 6)
A proper burial must involve an individual rite specific to this corpse, and must include at least one mourner legitimately sorry for the person's death. If the mourner is not a close associate of the dead with at least a friendly relationship, a DC 16 charisma check is required as an empathy test with a +4 bonus applying if the mourner is good aligned and a -4 penalty applying if the dead was completely unknown to the mourner or if the person had ill-will toward the dead. For this reason, generally more than one professional mourner is hired to attend a burial rite in the event their is concern insufficient empathy will be present, although in some cultures professional mourners are hired to demonstrate the wealth or importance of the dead as well. Likewise, professional mourners are often hired even when family members are present, out of concern that they might secretly harbor ill-will toward the dead. The empathy check is not mandatory and the mourner must want at some level to feel empathy toward the dead. If the person is actually glad that they are dead because of some injustice the dead performed toward them, or if they feel they stand to gain considerably more than the lose through the person's death, no empathy check should be made or at minimum the ill-will penalty should be applied. On the other hand, close associates with genuine good will toward the dead should automatically pass such a check and always count as valid mourners.
A proper burial which includes performance of a 'Lay to Rest' rite, or which is in 'Hallowed' ground eliminates need for roll. However, if corpse or ground is desecrated later, a roll is then needed at that time but a -1 modifier is applied.
A mass burial is never proper, but it does not necessarily count as total neglect either provided some degree of respect is paid to the dead, such as care in internment, the raising of markers on the site, and other signs of respect toward the dead.
Undead type check: Roll 3d6, applying the same modifiers from above
3-15 : Rage Zombie
16-17: Ghoul
18-20: Ghost (Consult ghost table)
21 : Wight
22 : Wraith
23 : Specter
24 : Revenant
Notes On Table Use
Rage Zombie: As zombie but with +4 bonus to Str and Dex, and losses the extraordinary ability 'Single Action Only'. Rage zombies are unintelligent, but have a single minded purpose appropriate to the circumstances of their death. If corpse was cremated or otherwise not largely intact, consult Ghost table. If corpse was reduced to bones by time of animation (either because of Sky burial rite or time transpired before reanimation), becomes mere Skeleton instead.
Ghoul: If corpse was cremated or otherwise not largely intact, consult ghost table. If corpse was properly buried or good aligned, use Cadavar instead. If corpse properly buried or good aligned, but exposed to elements while or after burial, use Coffer Corpse instead. If corpse was reduced to bones by time of animation (either because of Sky burial rite or time transpired before reanimation), becomes mere Skeleton instead.
Wight: If cremated, not largely intact, or reduced to bones by time of roll, becomes Wraith instead.
Wraith: If corpse was embalmed, becomes Mummy instead.
Alternatively, any undead with similar CR may be substituted if in the DM's opinion it is particularly suited to the circumstances.
Undead generally arise or first appear 2d6 days after death, and the check should be performed at that time according to the circumstances which then pertain. However, if the corpse of the deceased is continually cared for during the period following death and some means used to prevent rot from setting in, the check may be postponed until 2d6 days after burial.
Ghost Table
Roll 3d6, applying modifiers as above
3-9: Ghost appears on material plane only on anniversary of death, for a period of about 1 hour.
11-13: Ghost appears on material plane only on nights with the same moon as day of death, for a period of about 1 hour.
14-15: Ghost appears on material plane nightly for a period of about 1 hour.
16-17: Ghost appears on material plane during all hours of darkness.
18+: Ghost always present on material plane.
If deceased was not evil aligned and died vainly with an important task left undone, there is an 90% chance they will become a haunt instead. If the deceased was eligible to become a haunt, but did not or if the deceased was innocent (such as most children) or good-aligned, there is a 90% chance they will become a poltergeist rather than a ghost. If the deceased was evil aligned and of less than 6th level, but the total modifier was +5 or higher, there is an 50% chance they will become an apparition rather than a ghost.
Regardless of the results of the undead table, if the death was violent there is a 50% chance that a Phantasm results from the death. Consult the Ghost table for frequency of appearance.
Note that ghosts may always appear on the material plane during certain propitious circumstances. For example, ghosts which may otherwise confine themselves to the border ethereal and remain beyond the veil, may still always appear during the hours between midnight and daybreak on the night of the Autumnal Equinox, or between the first and second hour after midnight on the night of the Winter solstice, or if present during the profane rites of certain deities of death and suffering on particular unholy occasions. This exact circumstances may very according to the campaign and culture, but will generally be well known to the culture and living residents will take note of such occasions and protect themselves as appropriate whether by rite or simply forgoing being abroad at that time.