Initial Commit

Initial Commit.
This commit is contained in:
Jaysyn904
2025-09-14 15:40:46 -04:00
parent 7083b33d71
commit 1eefc84201
19230 changed files with 11539227 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
/*
s_respawnself - Respawn self
*/
void RespawnObject(string sTag, int iType, location lLoc);
void main()
{
string sTag = GetTag(OBJECT_SELF);
int iType = GetObjectType(OBJECT_SELF);
/* use respawn location if defined otherwise respawn at death location */
location lLoc = GetLocalLocation(OBJECT_SELF, "RESPAWN_LOCATION");
if (!GetIsObjectValid(GetAreaFromLocation(lLoc)))
lLoc = GetLocation(OBJECT_SELF);
float fDelay = GetLocalFloat(OBJECT_SELF, "RESPAWN_DELAY");
if (fDelay <= 0.0)
fDelay = 60.0; /* 1 minute */
AssignCommand(GetArea(OBJECT_SELF), DelayCommand(fDelay, RespawnObject(sTag, iType, lLoc)));
}
void RespawnObject(string sTag, int iType, location lLoc) {
// ResRef must be derivable from Tag
string sResRef = GetStringLowerCase(GetStringLeft(sTag, 16));
CreateObject(iType, sResRef, lLoc);
}