Module commit
Module commit.
This commit is contained in:
40
_module/nss/shrine_erythn002.nss
Normal file
40
_module/nss/shrine_erythn002.nss
Normal file
@@ -0,0 +1,40 @@
|
||||
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 eStr = EffectAbilityIncrease(ABILITY_CONSTITUTION, 4);
|
||||
effect eCon = EffectAbilityIncrease(ABILITY_STRENGTH, 4);
|
||||
effect eSave = EffectSavingThrowIncrease(SAVING_THROW_WILL, 4);
|
||||
effect eAC = EffectACDecrease(2, AC_DODGE_BONUS);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
||||
|
||||
//Link the visual and the damage reduction effect
|
||||
//delayed to ensure praying has finished
|
||||
effect eLink = EffectLinkEffects(eCon, eStr);
|
||||
eLink = EffectLinkEffects(eLink, eSave);
|
||||
eLink = EffectLinkEffects(eLink, eAC);
|
||||
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_HORRID_WILTING),oPC);
|
||||
}
|
Reference in New Issue
Block a user