Well, these forums have certainly changed since I wandered off... Anyhow, to business.
In my spare time I have been working on the invocation pack and have finally come up with a way to get around the item property spell immunities that are mostly on golems. Don't know why I didn't think of this before, but hey, live and learn then blow up the planes.
The basic gist is to use feats as replacements. The only thing ResistSpell is still used for us mantles, fired twice to properly deplete spell levels. This should also remove the bug about SR on items only work once, but I haven't looked at that.
I still have a ways to go remaking spells as I like to do. Below is the code for anyone interested.
//Checks caster level at full level for SR and bypasses globes when needed
int SVResistSpell(object oCaster, object oTarget, float fDelay=0.0f, int nSpellLvl = 0)
{
if (fDelay > 0.5)
{
fDelay = fDelay - 0.1;
}
if (nSpellLvl < 1)
{
nSpellLvl = 2;
}
//Get caster level of oCaster
int nCasterLvl = GetCasterLevel(oCaster);
//Get the target spell resistance
int nTargetSR = GetSpellResistance(oTarget);
int nResist = 0;
int nRet = FALSE;
//Declare variables for SR check
int nSRMods = 0;
int nRoll;
int nMySRCheck;
effect eSR = EffectVisualEffect( VFX_DUR_SPELL_SPELL_RESISTANCE ); // uses NWN2 VFX
effect eGlobe = EffectVisualEffect( VFX_DUR_SPELL_GLOBE_INV_LESS ); // uses NWN2 VFX
effect eMantle = EffectVisualEffect( VFX_DUR_SPELL_SPELL_MANTLE );
if(nTargetSR > 0)
{
//Check if oCaster has feats to overcome spell resistance
if(GetHasFeat(FEAT_EPIC_SPELL_PENETRATION, oCaster))
{ nSRMods = 6; }
else
if(GetHasFeat(FEAT_GREATER_SPELL_PENETRATION, oCaster))
{ nSRMods = 4; }
else
if(GetHasFeat(FEAT_SPELL_PENETRATION, oCaster))
{ nSRMods = 2; }
string sFeedback = "<c=cyan>" + GetName(oTarget) + " is attempting to resist your invocation: ";
nRoll = d20();
nMySRCheck = nRoll + nCasterLvl + nSRMods;
if((nMySRCheck <= nTargetSR || nRoll == 1) && nRoll != 20 )
{
nResist = 1;
sFeedback += "Success (" + " " + IntToString(nMySRCheck) + " vs " + IntToString(nTargetSR) + " SR ).</c>";
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eSR, oTarget));
}
else
{
sFeedback += "Failure (" + " " + IntToString(nMySRCheck) + " vs " + IntToString(nTargetSR) + " SR ).</c>";
nResist = 0;
}
//Display feedback
SendMessageToPC(oCaster, sFeedback);
}
//Globe
if (GetHasSpellEffect(SPELL_GLOBE_OF_INVULNERABILITY, oTarget) && nSpellLvl <=4)
{nResist = 2;}
if (GetHasSpellEffect(SPELL_GREATER_SHADOW_CONJURATION_MINOR_GLOBE, oTarget) && nSpellLvl <=3)
{nResist = 2;}
if (GetHasSpellEffect(SPELL_LESSER_GLOBE_OF_INVULNERABILITY, oTarget) && nSpellLvl <=3)
{nResist = 2;}
//Spell Immunity
if(GetHasFeat(8209, oTarget))
{nResist = 2;}
else
if(GetHasFeat(8208, oTarget) && nSpellLvl <= 8)
{nResist = 2;}
else
if(GetHasFeat(8207, oTarget) && nSpellLvl <= 7)
{nResist = 2;}
else
if(GetHasFeat(8206, oTarget) && nSpellLvl <= 6)
{nResist = 2;}
else
if(GetHasFeat(8205, oTarget) && nSpellLvl <= 5)
{nResist = 2;}
else
if(GetHasFeat(8204, oTarget) && nSpellLvl <= 4)
{nResist = 2;}
else
if(GetHasFeat(8203, oTarget) && nSpellLvl <= 3)
{nResist = 2;}
else
if(GetHasFeat(8202, oTarget) && nSpellLvl <= 2)
{nResist = 2;}
else
if(GetHasFeat(8201, oTarget) && nSpellLvl <= 1)
{nResist = 2;}
if(nResist == 2) //Globe
{
nRet = TRUE;
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGlobe, oTarget));
}
//Spell Mantle
if (GetHasSpellEffect(SPELL_LEAST_SPELL_MANTLE, oTarget)
|| GetHasSpellEffect(SPELL_LESSER_SPELL_MANTLE, oTarget)
|| GetHasSpellEffect(SPELL_SPELL_MANTLE, oTarget)
|| GetHasSpellEffect(SPELL_GREATER_SPELL_MANTLE, oTarget) )
{ nResist = 3; }
if(nResist == 3) //Spell Mantle
{
ResistSpell(oCaster, oTarget); //Fire the resist off twice so that the mantle is correctly depleted.
ResistSpell(oCaster, oTarget);
nRet = TRUE;
if (fDelay > 0.5)
{
fDelay = fDelay - 0.1;
}
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eMantle, oTarget));
}
return nRet;
}





Retour en haut







