//:://///////////////////////////////////////////// //:: Undeath's Eternal Foe //:: x0_s0_udetfoe.nss //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* Grants many protections against undead to allies in a small area of effect (everyone gets negative energy protection) immunity to poison and disease too +4 AC bonus to all creatures */ //::////////////////////////////////////////////// //:: Created By: Brent //:: Created On: July 31, 2002 //::////////////////////////////////////////////// //:: VFX Pass By: //:: altered by mr_bumpkin Dec 4, 2003 for prc stuff #include "prc_inc_spells" #include "prc_alterations" #include "prc_add_spell_dc" void GrantProtection(object oTarget, int CasterLvl) { effect eVis = EffectVisualEffect(VFX_IMP_HOLY_AID); effect eNeg = EffectDamageImmunityIncrease(DAMAGE_TYPE_NEGATIVE, 100); effect eLevel = EffectImmunity(IMMUNITY_TYPE_NEGATIVE_LEVEL); effect eAbil = EffectImmunity(IMMUNITY_TYPE_ABILITY_DECREASE); effect ePoison = EffectImmunity(IMMUNITY_TYPE_POISON); effect eDisease = EffectImmunity(IMMUNITY_TYPE_DISEASE); effect eAC = EffectACIncrease(4,AC_DEFLECTION_BONUS); int nDuration = PRCGetCasterLevel(OBJECT_SELF); int nMetaMagic = PRCGetMetaMagicFeat(); //Enter Metamagic conditions if (CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND)) { nDuration = nDuration *2; //Duration is +100% } //Link Effects effect eLink = EffectLinkEffects(eNeg, eLevel); eLink = EffectLinkEffects(eLink, eAbil); eLink = EffectLinkEffects(eLink, eAC); eLink = EffectLinkEffects(eLink, ePoison); eLink = EffectLinkEffects(eLink, eDisease); //Apply the VFX impact and effects SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration),TRUE,-1,CasterLvl); } void main() { DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ABJURATION); /* Spellcast Hook Code Added 2003-06-20 by Georg 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; effect eVis = EffectVisualEffect(VFX_IMP_HEAD_HOLY); effect eImpact = EffectVisualEffect(VFX_FNF_LOS_HOLY_30); float fDelay; //Metamagic duration check //Apply Impact ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, PRCGetSpellTargetLocation()); int CasterLvl = PRCGetCasterLevel(OBJECT_SELF); //Get the first target in the radius around the caster oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, PRCGetSpellTargetLocation()); while(GetIsObjectValid(oTarget)) { if(GetIsReactionTypeFriendly(oTarget) || GetFactionEqual(oTarget)) { fDelay = PRCGetRandomDelay(0.4, 1.1); //Fire spell cast at event for target SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, 444, FALSE)); GrantProtection(oTarget,CasterLvl); } //Get the next target in the specified area around the caster oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_MEDIUM, PRCGetSpellTargetLocation()); } DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR"); // Erasing the variable used to store the spell's spell school }