When looking at the AC formula for the EMU I've noticed one major flaw that is incorporated when compared to EQLive. EQLive AC does not actually lower the maximum hit of the NPC, but EQEMU code does.
What AC seems to do though, is lower the
average damage taken - basically making it so while you sometimes
can take a max hit, you will often take lower damage overall the higher your AC is.
So what I propose is an added factor into the mitigation equation, sort of a mod which determines "will this hit do max damage? or will it be mitigated slightly?" Obviously we'll need to include other factors which I believe haven't been coded yet, like monster attack values, level vs player level, etc. All of those should have an impact on the effectiveness of mitigation as well - much like they seem to do on EQLive.
I'm going to be testing this out on my server over the next few days - so far all I've done is added a random factor of sorts called "acFac" that creates a random value to decrease the hit by - starting at 0 and going up to the value that previously decreased the hit every time.
Old code looks like this:
Code:
if (damage > 1 && spell_id == 0xFFFF){
double acMod = GetAC()/100;
double acDam = (damage/100)*acMod;
damage = (sint32)((float)damage-acDam);
if(damage <= 0)
damage = 1;
}
And with acFac added:
Code:
if (damage > 1 && spell_id == 0xFFFF){
double acMod = GetAC()/100;
float acFac = MakeRandomFloat(0, acMod);
double acDam = (damage/100)*acFac;
damage = (sint32)((float)damage-acDam);
if(damage <= 0)
damage = 1;
}
Now currently it uses MakeRandomFloat(), but I'd like to hear opinions. Should it use this or MakeRandomInt()? I'm not sure myself, MakeRandomFloat() gives a wider array of possible damage values, but so far in the minor testing I've done, I've yet to be hit for max damage.
But the good news is, even with insane AC, the hit values are much more inline with what you'd expect from EQLive. I'll be parsing the averages as well during testing to see if there's any positive effect of higher AC in that regard.
Basically to give an example:
With the old code above, an even con NPC with a max hit of 500 with the character having over 6k AC(yes this is VERY extreme, but I wanted to confirm what I expected) would hit for around 108 at most - this was over a 10 minute period of being hit constantly, never once was I hit for more than that.
Now, with acFac added in, the max hit was at about 496. I'll update with tests of various AC values to see if decreases in average damage occur like I hope they will.