Here's where it's calculated w/ the bonuses (zone/bonuses.cpp):
around line 857
Code:
case SE_ProcChance:
{
//multiplier is to be compatible with item effects
//watching for overflow too
effect_value = effect_value<3000? effect_value * 10 : 30000;
if(newbon->ProcChance < effect_value)
newbon->ProcChance = effect_value;
break;
}
Now, as far as ProcBonus, it ends up being calculated in the attack code also:
zone/attack.cpp, around line 3664 (in Mob::GetProcChances)
Code:
ProcBonus += float(itembonuses.ProcChance + spellbonuses.ProcChance) / 1000.0f;
ProcChance = 0.05f + float(mydex) / 9000.0f; //Base chance, based on dex + static chance to proc
ProcBonus += (ProcChance * AABonus) / 100; //AA modifier in addition to normal ProcBonus from items & spells, percentage of base chance?
ProcChance += ProcBonus; //Add the bonuses to the base chance
mlog(COMBAT__PROCS, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
return ProcChance;
So, if we use
Jonthan's Mightful Caretaker as our example, the effect_value is 102, which ends up being 1020. In GetProcChances, we start with 0, then the spell value gets divided to 1.02. When we try the proc in Mob::TryWeaponProc (both with & without augs), also in zone/attack.cpp (around line 3674), we generate a random float between 0 & 1. Since 1.02 is always > anything between 0 & 1, we will proc 100% of the time.
I assume this is supposed to be a multiplier (200% = 2x as likely vs base, etc) instead of a direct mod on the proc chance. We should be able to do something like this:
Code:
ProcBonus += float(itembonuses.ProcChance + spellbonuses.ProcChance) / 1000.0f;
ProcChance = 0.05f + float(mydex) / 9000.0f;
ProcBonus += (ProcChance * AABonus) / 100;
ProcChance *= ProcBonus; //Multiplier instead of flat bonus
mlog(COMBAT__PROCS, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus);
return ProcChance;
If someone wants to try this and/or commit to SVN, feel free (I'm having some issues w/ Visual Studio after the change to zone.vcproj).
EDITED By Trevius: Removed stuff related to another thread