Looking good. I might blatantly copy the hits to kill something calculation to the other calculator too.
Regarding mathematics, the calculator pack ones should be the correct ones, source being cmp:
http://forum.c-rpg.net/index.php/topic,23344.msg341355.html#msg341355Reduction is actually pretty complicated:
var randomized_soak = (soakrandom * 0.55 + 0.45) * soak;
var randomized_damage = (damagerandom * 0.1 + 0.9) * basedamage;
var soaked_damage = Math.max(randomized_damage - randomized_soak, 0);
var randomized_reduction = Math.exp((soakrandom * 0.55 + 0.45) * reduction * 0.014);
var reduced_damage = (1 - 1 / randomized_reduction) * soaked_damage;
var damage_difference = Math.round(reduced_damage + randomized_soak);
return randomized_damage - damage_difference;
soakrandom, damagerandom are 0 to 1, 1 being best for damage for damagerandom and 0 being best for damage for soakrandom.
Math.exp is Euler's number or whatever, ie what calculators and stuff mark as e^(whatever), mentioning this since in Finnish that one is "neper's number" which made it a bit confusing for me at first.
Though I'm not 100% sure if wpf reduction from armor affects damage.