Before I go through and do this, I want to see if people agree that I am correct in assuming the following:
itembonuses.ProcChance = The total of +Combat Effects from all equiped items
(So, 3 items each with 5 Combat effect on them would total 15, so that means this is getting 15 as the total, or is there some other math going on somewhere?)
spellbonuses.ProcChance = Supposed to be a percentage increase to base ProcChance that is added to the total.
(So, 100% spellbonus would effectively double your base ProcChance, which means a 10% proc chance is now 20% +other bonuses)
Base ProcChance = .05 + (Dex / 9000)
(So, 380 dex (cap at level 75 with all AAs) would be 0.092 base ProcChance)
AABonus = Number of points * 5
(So, 1 point is 5, 2 is 10, 3 is 15, 4 is 20 and 5 is 25 - Defined in the AA for WeaponAffinity)
If that is all correct, then the way I think it should work is to do"(
itembonuses.ProcChance + (
spellbonuses.ProcChance / 10) +
AABonus) / 100" to equal the total percentage increase.
So, if we have 25 from the AA (+25%), 35 from Combat Effects on items (+35%), and maybe 50 from spellbonuses (50%), our total is 110%. So, we would increase the base ProcChance by another 110%. To do that, we should only need to do
ProcChance * ProcBonus and then add that to
ProcChance.
The weird part is that sounds correct to me, but that is what I submitted here and it definitely wasn't right:
Code:
ProcBonus += float(itembonuses.ProcChance + (spellbonuses.ProcChance / 10) + AABonus) / 100.0f;
ProcChance = 0.05f + float(mydex) / 9000.0f;
ProcBonus += (ProcChance * ProcBonus);
ProcChance += ProcBonus;
mlog(COMBAT__PROCS, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
return ProcChance;
Using the examples I gave above, 380 Dex with 5 points in Weapon Affinity AA, 35 Combat effects from Items and a buff that adds 50% to Proc Chance, our base will be 0.092 and with the 110% (really more like 210%) increase, it would be 0.193. That is like going from procing 1 out of 10 swings (10% of the time) to 1 out of 5 swings (20% of the time).
I think that sounds close to right even though the base ProcChance calculation may be higher than it should be to work properly with this.
Now, I just need to go through the rest of the proc code for augs and items :P