I've just recently decided to update from 1.70 to 1.71, but I've encountered some compilation problems due to this.
First of all, when I tried to modify Epic Warding script, a compilation error popped out in nw_i0_spells.nss on line 552 (variable type error):
int clOverride = spell.Level;
The whole section of the script is as follows:
//1.70: caster level override workaround, since ResistSpell function uses its own values
//and its hardcoded I apply a spell resistance decrease in the appropriate ammount in order to cheat
//this hardcoded function. This works pretty well for non-monks. Unfortunately 12+ lvl monks are immune to this solution.
int clOverride = spell.Level;
int clDefault = GetCasterLevel(oCaster);
if(GetLastSpellCastClass() == CLASS_TYPE_INVALID && GetSpellCastItem() == OBJECT_INVALID)//fix for bug in SR check formula
{//internal SR calculates with CL = innate level*2-1, and yes -1 for cantrips
int clSR = StringToInt(Get2DAString("spells","Innate",GetEffectSpellId(EffectDazed())))*2-1;
if(clDefault != clSR)//if default CL accidentaly matches CL for SR then its fine
{
if(!clOverride) clOverride = clDefault;
clDefault = clSR;
}
}
int SR = GetSpellResistance(oTarget);
effect eWorkaround;
if(bAOE)//AOE workaround to fix various exploits
{
int nResisted = 0;
if(SR > 0)
{
if(d20()+(clOverride > 0 ? clOverride : clDefault) < SR)//resisted
{
nResisted = 1;
DelayCommand(fDelay,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_IMP_MAGIC_RESISTANCE_USE),oTarget));
}
string sFeedback = GetStringByStrRef(8342);
sFeedback = GetStringLeft(sFeedback,GetStringLength(sFeedback)-10);
sFeedback = GetStringRight(sFeedback,GetStringLength(sFeedback)-10);
sFeedback = "<c›ţţ>"+GetName(oTarget)+"</c> <cÃÅ£>"+sFeedback+" "+GetStringByStrRef(nResisted == 1 ? 8343 : 5353)+"</c>";
SendMessageToPC(oTarget,sFeedback);
SendMessageToPC(oCaster,sFeedback);
}
return nResisted;
}
else if(clOverride > 0 && SR > 0)//spell penetration correction
{
//if overriden above default caster level we must alter spell resistance of our target...
if(clOverride > clDefault && clOverride+20 >= SR)
{ //do nothing if there is no chance to penetrate SR anyway
eWorkaround = EffectSpellResistanceDecrease(clOverride-clDefault);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eWorkaround,oTarget,0.01);//temporary workaround to force game use correct values
SR = -255;
}
else if(clOverride < clDefault && clDefault+20 >= SR)
{ //do nothing if the default CL has no chance to penetrate SR anyway
eWorkaround = EffectSpellResistanceIncrease(SR+clDefault-clOverride);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eWorkaround,oTarget,0.01);//temporary workaround to force game use correct values
SR = -255;
}
}//end of caster level workaround
I tried to build my module and check for any other compilation errors I might find and more of them popped out.
zep_o0_death.nss returned a compilation error in nw_i0_generic.nss, line 857 (lack of right bracket error):
if (GetLocalInt(OBJECT_SELF,"70_ALLOW_SHAPECHANGE") && TalentShapechange(oIntruder)) return 99;
As far as I've found out, these two scripts are the culprits, but there might be more. I only got compilation errors on scripts I modified, after all, and if there are any unmodified ones, like some other spell scripts, then they might not compile without letting me know.
Any idea what I should do?
Edit: I've also tried opening my modified missile storm scripts. And I couldn't, a message appeared saying that 70_inc_spellfunc content could not be found. Which makes me wonder, is 1.71 compatible with modules made with 1.70? Especially if some of scripts have been modified?
I've tried creating a whole new module and checking things there. When it comes to compilation, it's all the same problems, when I try to compile a spell or something else that caused problems in my module, I get an error in one of these two scripts. The only difference is that it lets me open missile storm scripts (no message about 70_inc_spellfunc content missing), but I still can't compile them.