Aller au contenu

Photo

Idea: SpellResist issue workaround


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
Shadooow

Shadooow
  • Members
  • 4 470 messages
I heard there is an issue with spell resistance from items. (IDEA on vault link)

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:

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;
}

This would need to recompile all spell scripts of course...
Anyone willing to try it?:wizard:

Modifié par ShaDoOoW, 31 mars 2011 - 04:59 .


#2
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
I've already done it.

It's not as simple as all that, just having that resistspell function involved will mess things up. I just do the check via rolling the dice myself, and cache the values from skins/hides/items/spells. Basically i don't rely on the engine and do a lot of things entirely in script. At this point it runs very well, better than the original since i redid the AI as well.

Its in my community script library

#3
Dann-J

Dann-J
  • Members
  • 3 161 messages
As far as creatures are concerned, couldn't you just give them one of the spell resistence feats (drow or yuan-ti)? I believe it's only equipped items that grant spell resistence (including creature hides) that don't work.

It wouldn't help where SR equipment for the player is concerned - but at least dragons would be a challenge again.

#4
Nik Reaper

Nik Reaper
  • Members
  • 15 messages
Hi, I posted a hide override, edited so that creatures with SR now have epic improved spell resistance and other feats to gain the original amount of SR, but it should be tested and balanced as only assay works to help overcome it, http://nwvault.ign.c...r.Detail&id=280 .
I wounder if some of those SR feats could be duplicated and made invisible to the player, like weapon effect (frost, fire evil) , so that they could be placed on items with a normal SR ,the normal there just so one could see how much SR the item gives, and well.... override blueprints of all items that give SR ... it's a straight path x) , or a script that adds those invisible feats to items or the player on equip and removes them on remove?