also from broken function list in this section I saw:
ResistSpell
Causes GetSpellResistance result to reset to zero.
If it would be NWN1 I would start to try to fix it, but its not so while I could be able to script it I wouldn't be able to test it which is unfortunate.
So there are few my ideas how to workaround it or fix it:
First I would try if the ResistSpell does the same with EffectSpellResistanceIncrease. If not it would be simple, in OnSpawn script, get starting spellresistance and add it as supernatural permanent effect again.
If ResistSpell would reset it to zero even from effect then I would try to modify MyResistSpell function located in nw_i0_spells. From my understanding, the spell scripts an include scripts in NWN2 were carried from NWN1 so it should be the same and there shouldn't be any spell that would use ResistSpell function, all should call MyResistSpell instead.
And then in MyResistSpell I would do this:
This would need to recompile all spell scripts of course...int MyResistSpell(object oCaster, object oTarget, float fDelay = 0.0)
{
if(fDelay > 0.5)
{
fDelay -= 0.1;
}
int preSR = GetSpellResistance(oTarget);
int nResist = ResistSpell(oCaster,oTarget);
int postSR = GetSpellResistance(oTarget);
//spell resistance issue workaround
if(preSR > 0 && preSR != postSR)
{
ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(EffectSpellResistanceIncrease(preSR-postSR)), oTarget);
}
//usual code
if(nResist == 1) //Spell Resistance
{
effect eSR = EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE);
DelayCommand(fDelay,ApplyEffectToObject(DURATION_TYPE_INSTANT,eSR,oTarget));
}
else if(nResist == 2) //Globe
{
effect eGlobe = EffectVisualEffect(VFX_IMP_GLOBE_USE);
DelayCommand(fDelay,ApplyEffectToObject(DURATION_TYPE_INSTANT,eGlobe,oTarget));
}
else if(nResist == 3) //Spell Mantle
{
if(fDelay > 0.5)
{
fDelay -= 0.1;
}
effect eMantle = EffectVisualEffect(VFX_IMP_SPELL_MANTLE_USE);
DelayCommand(fDelay,ApplyEffectToObject(DURATION_TYPE_INSTANT,eMantle,oTarget));
}
return nResist;
}
Anyone willing to try it?
Modifié par ShaDoOoW, 31 mars 2011 - 04:59 .





Retour en haut







