Initial upload

Initial upload
This commit is contained in:
Jaysyn904
2023-09-25 18:13:22 -04:00
parent 684ef76c20
commit 499aba4eb3
5734 changed files with 4843758 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
//
// Res_Heartbeat script
//
// Scan the immediate area for any creature in the same faction. If one exists and is dead, then
// resurrect it.
//
// Use a semaphore (res_semaphore) to prevent multiple calls.
//
void main()
{
float fMaxDistance = 15.0; // I won't resurrect anything further away than this.
float fResDelay = 2.0; // How long before I do something after resurrection starts.
location lSelf = GetLocation(OBJECT_SELF);
object oTarget;
//
// Don't bother if semaphore is already set or if I can't cast resurrection
//
if ((GetLocalInt(oTarget, "Res_Semaphore") != TRUE) && GetHasSpell(SPELL_RESURRECTION)) {
oTarget = GetFirstObjectInShape(SHAPE_SPHERE, fMaxDistance, lSelf, TRUE, OBJECT_TYPE_CREATURE);
while (GetIsObjectValid(oTarget)) {
if ((GetIsDead(oTarget)) && GetIsFriend(oTarget)) {
ClearAllActions();
ActionDoCommand(SetCommandable(FALSE));
ActionCastSpellAtObject(SPELL_RESURRECTION, oTarget);
SetLocalInt(oTarget, "Res_Semaphore", TRUE);
DelayCommand(fResDelay, SetCommandable(TRUE));
DelayCommand(fResDelay, DeleteLocalInt(oTarget, "Res_Semaphore"));
return;
}
oTarget = GetNextObjectInShape(SHAPE_SPHERE, fMaxDistance, lSelf, TRUE, OBJECT_TYPE_CREATURE);
}
}
}