Aschbourne_PRC8/_module/nss/shrine_eg_death.nss

21 lines
761 B
Plaintext
Raw Permalink Normal View History

2024-06-14 10:48:20 -04:00
void RespawnObject(string sResRef, int iType, location lLoc) {
CreateObject(iType, sResRef, lLoc);
}
void main()
{
// create a fragment of the destroyed shrine
// comment out the next two lines if you do not wish this to happen
location lLoc=GetLocation(OBJECT_SELF);
CreateObject(OBJECT_TYPE_ITEM,"shrine_pholtus",lLoc);
// after 60 seconds the shrine reforms (mainly for persistent worlds)
// comment out the next line if you wish a permanent death
// or alter the fDelay time to set a different number
// of seconds to respawn
string sResRef = GetResRef(OBJECT_SELF);
int iType = GetObjectType(OBJECT_SELF);
float fDelay = 60.0; // 1 minute delay; adjust as desired
AssignCommand(GetModule(), DelayCommand(fDelay, RespawnObject(sResRef, iType, lLoc)));
}