Module commit
Module commit.
This commit is contained in:
42
_module/nss/shrine_farlan002.nss
Normal file
42
_module/nss/shrine_farlan002.nss
Normal file
@@ -0,0 +1,42 @@
|
||||
int GetHasProtection(object oPC)
|
||||
{
|
||||
effect eEff = GetFirstEffect(oPC);
|
||||
while (GetIsEffectValid(eEff)) {
|
||||
if (GetEffectType(eEff) == EFFECT_TYPE_IMMUNITY)
|
||||
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 = EffectImmunity(IMMUNITY_TYPE_MOVEMENT_SPEED_DECREASE);
|
||||
effect eBless2 = EffectImmunity(IMMUNITY_TYPE_SLOW);
|
||||
effect eBless3 = EffectImmunity(IMMUNITY_TYPE_PARALYSIS);
|
||||
effect eBless4 = EffectImmunity(IMMUNITY_TYPE_ENTANGLE);
|
||||
effect eBless5 = EffectImmunity(IMMUNITY_TYPE_KNOCKDOWN);
|
||||
effect eDur = EffectVisualEffect(VFX_DUR_FREEDOM_OF_MOVEMENT);
|
||||
|
||||
//Link the visual and the damage reduction effect
|
||||
//delayed to ensure praying has finished
|
||||
effect eLink = EffectLinkEffects(eBless1, eBless2);
|
||||
eLink = EffectLinkEffects(eLink, eBless3);
|
||||
eLink = EffectLinkEffects(eLink, eBless4);
|
||||
eLink = EffectLinkEffects(eLink, eBless5);
|
||||
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_SMOKE_PUFF),oPC);
|
||||
}
|
Reference in New Issue
Block a user