37 lines
1.2 KiB
Plaintext
37 lines
1.2 KiB
Plaintext
|
int GetHasProtection(object oPC)
|
||
|
{
|
||
|
effect eEff = GetFirstEffect(oPC);
|
||
|
while (GetIsEffectValid(eEff)) {
|
||
|
if (GetEffectType(eEff) == EFFECT_TYPE_ABILITY_INCREASE)
|
||
|
return TRUE;
|
||
|
eEff = GetNextEffect(oPC);
|
||
|
}
|
||
|
return FALSE;
|
||
|
}
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
// Get the stored target
|
||
|
object oPC = GetLastUsedBy();
|
||
|
if (!GetIsObjectValid(oPC))
|
||
|
return;
|
||
|
|
||
|
// Don't reapply if we're already protected
|
||
|
if (GetHasProtection(oPC))
|
||
|
return;
|
||
|
|
||
|
// if the oracle effect is off, reapply it
|
||
|
effect eBless1 = EffectAbilityIncrease(ABILITY_STRENGTH,2);
|
||
|
effect eBless2 = EffectAbilityIncrease(ABILITY_CONSTITUTION,2);
|
||
|
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEUTRAL);
|
||
|
|
||
|
//Link the visual and the damage reduction effect
|
||
|
//delayed to ensure praying has finished
|
||
|
effect eLink = EffectLinkEffects(eBless1, eBless2);
|
||
|
eLink = EffectLinkEffects(eLink, eDur);
|
||
|
DelayCommand(15.0,ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oPC));
|
||
|
|
||
|
//Visual effect of the blessing being received
|
||
|
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_WAIL_O_BANSHEES),oPC);
|
||
|
}
|