Battledale_PRC8/_removed/nw_s0_proele.nss
Jaysyn904 7b9e44ebbb Initial upload
Initial upload.  PRC8 has been added.  Module compiles, PRC's default AI & treasure scripts have been integrated.  Started work on top hak for SLA / Ability / Scripting modifications.
2024-03-11 23:44:08 -04:00

78 lines
2.5 KiB
Plaintext

///::///////////////////////////////////////////////
//:: Protection from Elements
//:: NW_S0_ProEle
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Offers 30 points of elemental resistance. If 40
points of a single elemental type is done to the
protected creature the spell fades
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 22, 2001
//:://////////////////////////////////////////////
#include "nw_i0_spells"
#include "x2_inc_spellhook"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-23 by GeorgZ
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
int nDuration = 24;
int nAmount = 40;
int nResistance = 30;
int nMetaMagic = GetMetaMagicFeat();
effect eCold = EffectDamageResistance(DAMAGE_TYPE_COLD, nResistance, nAmount);
effect eFire = EffectDamageResistance(DAMAGE_TYPE_FIRE, nResistance, nAmount);
effect eAcid = EffectDamageResistance(DAMAGE_TYPE_ACID, nResistance, nAmount);
effect eSonic = EffectDamageResistance(DAMAGE_TYPE_SONIC, nResistance, nAmount);
effect eElec = EffectDamageResistance(DAMAGE_TYPE_ELECTRICAL, nResistance, nAmount);
effect eDur = EffectVisualEffect(VFX_DUR_PROTECTION_ELEMENTS);
effect eVis = EffectVisualEffect(VFX_IMP_ELEMENTAL_PROTECTION);
effect eDur2 = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_PROTECTION_FROM_ELEMENTS, FALSE));
//Link Effects
effect eLink = EffectLinkEffects(eCold, eFire);
eLink = EffectLinkEffects(eLink, eAcid);
eLink = EffectLinkEffects(eLink, eSonic);
eLink = EffectLinkEffects(eLink, eElec);
eLink = EffectLinkEffects(eLink, eDur);
eLink = EffectLinkEffects(eLink, eDur2);
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}
RemoveEffectsFromSpell(oTarget, GetSpellId());
//Apply the VFX impact and effects
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, HoursToSeconds(nDuration));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}