Updated to PRC8. Further function integration. Fixed NPC onDeath script. Full compile. Updated release archive.
61 lines
1.9 KiB
Plaintext
61 lines
1.9 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Elemental Shield
|
|
//:: NW_S0_FireShld.nss
|
|
//:: Copyright (c) 2001 Bioware Corp.
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Caster gains 50% cold and fire immunity. Also anyone
|
|
who strikes the caster with melee attacks takes
|
|
1d6 + 1 per caster level in damage.
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Preston Watamaniuk
|
|
//:: Created On: Jan 7, 2002
|
|
//:://////////////////////////////////////////////
|
|
|
|
/*
|
|
bugfix by Grant Beaty 2002.08.31
|
|
- could stack
|
|
*/
|
|
|
|
#include "NW_I0_SPELLS"
|
|
#include "prc_inc_spells"
|
|
|
|
void main()
|
|
{
|
|
//Declare major variables
|
|
effect eVis = EffectVisualEffect(VFX_DUR_ELEMENTAL_SHIELD);
|
|
int nDuration = PRCGetCasterLevel(OBJECT_SELF);
|
|
int nMetaMagic = PRCGetMetaMagicFeat();
|
|
object oTarget = OBJECT_SELF;
|
|
effect eShield = EffectRegenerate(3, 6.0);
|
|
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
|
effect eCold = EffectDamageImmunityIncrease(DAMAGE_TYPE_COLD, 50);
|
|
effect eFire = EffectDamageImmunityIncrease(DAMAGE_TYPE_FIRE, 50);
|
|
|
|
//Link effects
|
|
effect eLink = EffectLinkEffects(eShield, eCold);
|
|
|
|
eLink = EffectLinkEffects(eLink, eFire);
|
|
eLink = EffectLinkEffects(eLink, eDur);
|
|
eLink = EffectLinkEffects(eLink, eVis);
|
|
|
|
//Fire cast spell at event for the specified target
|
|
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ELEMENTAL_SHIELD, FALSE));
|
|
|
|
//Enter Metamagic conditions
|
|
if (nMetaMagic == METAMAGIC_EXTEND)
|
|
{
|
|
nDuration = nDuration *2; //Duration is +100%
|
|
}
|
|
|
|
//If there is already a fire shield in effect, remove it.
|
|
if(GetHasSpellEffect(PRCGetSpellId(), oTarget))
|
|
RemoveSpellEffects(PRCGetSpellId(), oTarget, oTarget);
|
|
|
|
//Apply the VFX impact and effects
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
|
|
}
|
|
|
|
|