Modified OnPlayerRespawn script

Use
Teleports the PC to a different respawn location based on their alignment. Notes: 3 Areas are needed for this. Hell, Purgatory, and Heaven. Also, 3 waypoints where the players will respawn in each area: "WP_HEAVEN," "WP_HELL," and "WP_PURG".

Script, Part 1
Set this script to OnPlayerRespawn under Module Properties.

void main { object oTargetHeaven = GetWaypointByTag("WP_HEAVEN"); location lTargetHeaven = GetLocation(oTargetHeaven); object oTargetHell = GetWaypointByTag("WP_HELL"); location lTargetHell = GetLocation(oTargetHell); object oTargetPurg = GetWaypointByTag("WP_PURG"); location lTargetPurg = GetLocation(oTargetPurg); effect eRespawnHell = EffectVisualEffect(VFX_FNF_SUMMON_GATE); effect eRespawnPurg = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3); effect eRespawnHeaven = EffectVisualEffect(VFX_FNF_SUMMON_CELESTIAL); object oRespawner = GetLastRespawnButtonPresser; if (GetGoodEvilValue(oRespawner) <= 29) { ApplyEffectToObject(DURATION_TYPE_INSTANT, eRespawnHell, oRespawner); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection,oRespawner); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner); AssignCommand(oRespawner, JumpToLocation(lTargetHell)); } else if ((GetGoodEvilValue(oRespawner) >= 30) && (GetGoodEvilValue(oRespawner) <= 70)) { ApplyEffectToObject(DURATION_TYPE_INSTANT, eRespawnPurg, oRespawner); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection,oRespawner); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner); AssignCommand(oRespawner, JumpToLocation(lTargetPurg)); } else if (GetGoodEvilValue(oRespawner) >= 71) { ApplyEffectToObject(DURATION_TYPE_INSTANT, eRespawnHeaven, oRespawner); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection,oRespawner); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner); AssignCommand(oRespawner, JumpToLocation(lTargetHeaven)); } }

Script, Part 2
Hell Special Case - Polymorph the dead PC into a zombie. I have a Balor at the end agree to remove the effect from the PC, it's not completely necessary though, so if you want that script aswell, just leave me a message. This can either be set to OnEnter for the area, or for a trigger that surrounds the waypoint the player enters on.

void main { object oPC = GetEnteringObject; effect eZombie = EffectPolymorph(POLYMORPH_TYPE_ZOMBIE); if (GetIsPC(oPC) == TRUE) { ApplyEffectToObject(DURATION_TYPE_PERMANENT, eZombie, oPC); } }

Script, Part 3
Heaven Special Case - Polymorph the dead player into an elder air elemental. Same application as the Hell special case, if you want the script for removing this effect aswell, again... just leave me a message.

void main { object oPC = GetEnteringObject; effect eAir = EffectPolymorph(POLYMORPH_TYPE_ELDER_AIR_ELEMENTAL); if (GetIsPC(oPC) == TRUE) { ApplyEffectToObject(DURATION_TYPE_PERMANENT, eAir, oPC); } }