Beispiel #1
0
        internal static void UpdateDodgeChance(this Unit unit)
        {
            var chr = unit as Character;

            if (chr != null)
            {
                float dodgeChance = 0;
                if (chr.Asda2Agility == 0)
                {
                    return;                     // too early
                }

                dodgeChance += unit.IntMods[(int)StatModifierInt.DodgeChance] +
                               CharacterFormulas.CalcDodgeChanceBonus(unit.Level, unit.Class, unit.Asda2Agility);
                GetMultiMod(unit.FloatMods[(int)StatModifierFloat.Dodge], dodgeChance);
                chr.DodgeChance = dodgeChance;
            }
        }
Beispiel #2
0
        internal static void UpdateDodgeChance(this Unit unit)
        {
            Character character = unit as Character;

            if (character == null)
            {
                return;
            }
            float num1 = 0.0f;

            if (character.Asda2Agility == 0)
            {
                return;
            }
            float num2 = num1 + ((float)unit.IntMods[13] +
                                 CharacterFormulas.CalcDodgeChanceBonus(unit.Level, unit.Class, unit.Asda2Agility));
            double multiMod = (double)UnitUpdates.GetMultiMod(unit.FloatMods[30], num2);

            character.DodgeChance = num2;
        }