UW2_PRC8/_module/nss/summon_balor.nss
Jaysyn904 5197ad9a4d Initial upload
Initial upload
2023-09-25 20:24:01 -04:00

56 lines
922 B
Plaintext

void RespawnObject(string sTag, int iType, location lLoc) {
// ResRef must be derivable from Tag
string sResRef = GetStringLowerCase(GetStringLeft(sTag, 16));
CreateObject(iType, sResRef, lLoc);
}
void main()
{
float fDelay2 = 0.0;
DestroyObject(OBJECT_SELF, fDelay2);
string sTag = GetTag(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.
location lLoc = GetLocation(OBJECT_SELF);
float fDelay = 60.0; // 1000 second delay
location lLoc2 = GetLocation(OBJECT_SELF);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, EffectVisualEffect(VFX_FNF_SUMMON_GATE), lLoc2, 5.0);
CreateObject(OBJECT_TYPE_CREATURE,"nw_balorboss", lLoc2, TRUE);
AssignCommand(GetArea(OBJECT_SELF), DelayCommand(fDelay, RespawnObject(sTag, iType, lLoc)));
}