PWE_PRC8/_module/nss/respawn_gen8.nss
Jaysyn904 ee1dc35889 Initial Commit
Initial Commit
2025-04-03 10:29:41 -04:00

19 lines
783 B
Plaintext

void RespawnObject(string sResRef, int iType, location lLoc) {
CreateObject(iType, sResRef, lLoc);
}
void main()
{
object oDoor=GetObjectByTag("door_pc140204x");
AssignCommand(oDoor,ActionUnlockObject(OBJECT_SELF));
AssignCommand(oDoor,DelayCommand(1200.0,ActionLockObject(OBJECT_SELF)));
string sResRef = GetResRef(OBJECT_SELF);
int iType = GetObjectType(OBJECT_SELF);
// For creatures, save the location at spawn-time as a local location and
// use it instead. Otherwise, the creature will respawn where it died.
// No changes are required for placeables as they do not move (usually ;-)
location lLoc =GetLocation(OBJECT_SELF);
float fDelay = 1200.0; // 20 minute delay; adjust as desired
AssignCommand(GetModule(), DelayCommand(fDelay, RespawnObject(sResRef, iType, lLoc)));
}