protected override void Calculate() { // Hack to not count holy shield when we are trying to calculate crit chance without it if (!UseHolyShield && CalcOpts.UseHolyShield) { Stats.Accumulate(new Stats() { Block = -0.3f }); } float tableSize = 0.0f; #if (RAWR3) int targetLevel = BossOpts.Level; #else int targetLevel = CalcOpts.TargetLevel; #endif // Miss Miss = Math.Min(1.0f - tableSize, Lookup.AvoidanceChance(Character, Stats, HitResult.Miss, targetLevel)); tableSize += Miss; // Dodge Dodge = Math.Min(1.0f - tableSize, Lookup.AvoidanceChance(Character, Stats, HitResult.Dodge, targetLevel)); tableSize += Dodge; // Parry Parry = Math.Min(1.0f - tableSize, Lookup.AvoidanceChance(Character, Stats, HitResult.Parry, targetLevel)); tableSize += Parry; // Block if (Character.OffHand != null && Character.OffHand.Type == ItemType.Shield) { Block = Math.Min(1.0f - tableSize, Lookup.AvoidanceChance(Character, Stats, HitResult.Block, targetLevel)); tableSize += Block; } // Critical Hit Critical = Math.Min(1.0f - tableSize, Lookup.TargetCritChance(Character, Stats, targetLevel)); tableSize += Critical; // Normal Hit Hit = Math.Max(0.0f, 1.0f - tableSize); // Partial Resists don't belong in the combat table Resist = 1.0f - StatConversion.GetResistanceTable(targetLevel, Character.Level, Stats.FrostResistance, 0.0f)[0]; // Hack to put back holy shield when we are trying to calculate crit chance without it if (!UseHolyShield && CalcOpts.UseHolyShield) { Stats.Accumulate(new Stats() { Block = 0.3f }); } }
protected override void Calculate() { float tableSize = 0.0f; int targetLevel = BossOpts.Level; // Miss Miss = Math.Min(1.0f - tableSize, Lookup.AvoidanceChance(Character, Stats, HitResult.Miss, targetLevel)); tableSize += Miss; // Dodge Dodge = Math.Min(1.0f - tableSize, Lookup.AvoidanceChance(Character, Stats, HitResult.Dodge, targetLevel)); tableSize += Dodge; // Parry Parry = Math.Min(1.0f - tableSize, Lookup.AvoidanceChance(Character, Stats, HitResult.Parry, targetLevel)); tableSize += Parry; // Block if (Character.OffHand != null && Character.OffHand.Type == ItemType.Shield) { //Block = Math.Min(1.0f - tableSize, Lookup.AvoidanceChance(Character, Stats, HitResult.Block, targetLevel)); Block = Lookup.AvoidanceChance(Character, Stats, HitResult.Block, targetLevel); if (Block > (1.0f - tableSize)) { BlockOverCap = Block - 1.0f + tableSize; } else { BlockOverCap = 0.0f; } tableSize += Block; } // Critical Hit Critical = Math.Min(1.0f - tableSize, Lookup.TargetCritChance(Character, Stats, targetLevel)); tableSize += Critical; // Normal Hit Hit = Math.Max(0.0f, 1.0f - tableSize); // Partial Resists don't belong in the combat table Resist = 1.0f - StatConversion.GetResistanceTable(targetLevel, Character.Level, Stats.FrostResistance, 0.0f)[0]; }