// This script grants the player a grace period of immortality. This is done // so that if there happen to be zombies at the trigger, they don't get killed // without having a chance to react. // Created by Zunath on August 13, 2007 // Modified by Zunath on July 28, 2011 // Replaced with damage reduction. Effects are now permanent until the the PC moves, which will then remove them.. void CheckForMovement(object oPC, location lLocation) { // PC isn't valid anymore - maybe they logged? // Kill the recursive call if(!GetIsObjectValid(oPC) || GetIsDead(oPC)) return; if(GetLocation(oPC) != lLocation) { effect eEffect = GetFirstEffect(oPC); while(GetIsEffectValid(eEffect)) { int iType = GetEffectType(eEffect); if(iType == EFFECT_TYPE_DAMAGE_REDUCTION || iType == EFFECT_TYPE_SANCTUARY) { RemoveEffect(oPC, eEffect); } eEffect = GetNextEffect(oPC); } return; } // Check again in one second. DelayCommand(1.0, CheckForMovement(oPC, lLocation)); } void main() { object oPC = GetEnteringObject(); if (!GetIsPC(oPC) || GetIsDM(oPC)) {return;} ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectSanctuary(99), oPC); ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectDamageReduction(50, DAMAGE_POWER_PLUS_TWENTY), oPC); // Fire recursive check to see if player has moved. If so, sanctuary and damage reduction drops. location lLocation = GetLocation(oPC); DelayCommand(3.5, CheckForMovement(oPC, lLocation)); }