Files
EN4_PRC8/_module/nss/en3_respawn2.nss
Jaysyn904 7b3c31175e 2025/09/05 Update
Fixed random hang at log on for single player.
Fixed class title function in Markshire Nomenclature script.
Fixed faction melee that ensued if player was killed by defender faction in town.
Updated most humanoids to use new class title function.
Full compile.
2025-09-05 21:48:32 -04:00

60 lines
1.3 KiB
Plaintext

void main()
{
object oPC;
object oSpawnPoint;
string sDestTag;
oPC = GetEnteringObject();
//SendMessageToPC(oPC,"en3_respawn2 >> entering.");
if (GetIsPC(oPC))
{
//SendMessageToPC(oPC,"en3_respawn2 >> PC found.");
sDestTag = GetLocalString(oPC,"Respawn");
if (sDestTag == "")
{
//SendMessageToPC(oPC,"en3_respawn2 >> Destination variable was unset, setting.");
SetLocalString(oPC, "Respawn", "EN4_Respawn");
}
//SendMessageToPC(oPC,"en3_respawn2 >> Destination tag is: "+sDestTag+".");
oSpawnPoint = GetWaypointByTag(sDestTag);
if (GetIsObjectValid(oSpawnPoint))
{
//SendMessageToPC(oPC,"en3_respawn2 >> Destination is valid, jumping.");
// Teleport the PC.
AssignCommand(oPC, ClearAllActions());
DelayCommand(0.3f,AssignCommand(oPC,JumpToObject(oSpawnPoint)));
}
else
{
// optional debug
FloatingTextStringOnCreature("Invalid spawn point: " + sDestTag, oPC);
}
}
}
/* void main()
{
object oPC;
object oSpawnPoint;
string sDestTag = "en3_respawning";
oPC = GetEnteringObject();
if (GetIsPC(oPC))
{
sDestTag = GetLocalString(oPC,"Respawn");
oSpawnPoint = GetObjectByTag(sDestTag);
AssignCommand(oPC,JumpToLocation(GetLocation(oSpawnPoint)));
}
}
*/