Hi everyone,
I’m back trying to create a new spell. I am using “Natures Balance” (Druid lv 9 spell) as my base.
I want to make the spell do the following and I almost have it stripping out some stuff from this druid spell:
Reduce Spell Resistance of ONE target.
Reduce it 50% of its resistance (so if someone has spell resistance of 70% it reduces it to 35%)
No saving throw (because the enemy already has spell resistance - why this spell is to affect that).
Duration: 1 round per 3 caster levels.
Any further suggestions?
I used Nature’s Balance as my base because it sort of does that.
Here is what I have so far (I took out the Metamagic stuff because it was too difficult for me to do)
This does not compile but it is getting closer to what I want.
//:: Hagger's Magic Quencher
//::Lv 6 Wiz/Sor, Cleric
//::
//:: Hagger the mage created this spell to quench
//:: enemy mage spell resistance.
//::
//::
//:://////////////////////////////////////////////
/*
Reduces the SR of all enemies by 1d4 per 5 caster
levels for 1 round per 3 caster levels
(BUT I want to change this to just a 50% not 1d4).
*/
//:://////////////////////////////////////////////
#include "prc_alterations"
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
void main()
{
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_TRANSMUTATION);
/*
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
effect eVis = EffectVisualEffect(VFX_IMP_HEALING_L);
effect eSR;
effect eVis2 = EffectVisualEffect(VFX_IMP_BREACH);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
int nRand;
int nCasterLevel = (GetCasterLevel(OBJECT_SELF) + GetChangesToCasterLevel(OBJECT_SELF));
//Determine spell duration as an integer for later conversion to Rounds, Turns or Hours.
int nDuration = nCasterLevel/3;
float fDelay;
//Set off fire and forget visual
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eNature, GetLocation(OBJECT_SELF));
//Declare the spell shape, size and the location. Capture the first target object in the shape.
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF), FALSE);
//Cycle through the targets within the spell shape until an invalid object is captured.
while(GetIsObjectValid(oTarget))
{
}
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
{
} //Check for saving throw
if (!MySavingThrow(SAVING_THROW_WILL, oTarget, (GetSpellSaveDC()+ GetChangesToSaveDC(OBJECT_SELF))))
{
}
nCasterLevel /= 5;
if(nCasterLevel == 0)
{
nCasterLevel = 1;
}
nRand = d4(nCasterLevel);
eSR = EffectSpellResistanceDecrease(nRand);
effect eLink = EffectLinkEffects(eSR, eDur);
//Apply reduce SR effects
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration)));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis2, oTarget));
}
//Select the next target within the spell shape.
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_LARGE, GetLocation(OBJECT_SELF), FALSE);
}
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
// Getting rid of the integer used to hold the spells spell school
}
I will use different visual effects too and then release this and three other spells I’m working on to the vault. Just need some help.