Is there a way to make a focus effect max level an actual max level and not begin effectiveness reduction?
Code:
case SE_LimitMaxLevel:{
int lvldiff = (spell.classes[(GetClass()%16) - 1]) - focus_spell.base[i];
if(lvldiff > 0){ //every level over cap reduces the effect by spell.base2[i] percent
lvlModifier -= spell.base2[i]*lvldiff;
if(lvlModifier < 1)
return 0;
}
break;
}
This code checks to see if the spell level is > maxlevel for the focus effect, then reduces the effectiveness by the lvldiff, which should be specified in the spell table.
The focus effect in question (Pet Focus) has 0 for base2[i], which should be a percentage to reduce per level. With a 0 for per lvl reduction, spell.base2[i]*lvldiff; will = 0, which means lvl modifier will stay at 100. Unless I'm wrong, this means the focus effect will stay at 100% effectiveness for every level, no matter the maxlevel.
Would there be any issue with changing
Code:
if(lvlModifier < 1)
return 0;
to
Code:
if((lvlModifier < 1) || (spell.base2[i] == 0))
return 0;
This would make any focus effect which has a per level over maxlevel reduction percentage of 0 stop working completely if the spell level is above the focus effects maxlevel.
If I get this worked out, then I will have finished a relatively scalable pet focus solution, but I want to make sure it will not adversely affect any other spells or code, as I'm not that familiar with spells.