Exemple #1
0
        public void UpdateCalcs()
        {
            float fightLength = _calcOpts.FightLength * 60f;

            float bloodlustUptime = ((float)Math.Floor(fightLength / 600f) * 40f + (float)Math.Min(fightLength % 600f, 40f)) / fightLength;
            float bloodlustHaste  = 1f + (CalcOpts.Bloodlust ? (bloodlustUptime * .3f) : 0f);

            float awUptime = (float)Math.Ceiling((fightLength - 20f) / (180f - _talents.SanctifiedWrath * 30f)) * 20f / fightLength;

            AvengingWrathMulti = 1f + awUptime * .2f;

            float targetArmor = StatConversion.NPC_ARMOR[CalcOpts.TargetLevel - 80];

            float dr     = StatConversion.GetArmorDamageReduction(Character.Level, targetArmor, Stats.ArmorPenetration, 0f, Stats.ArmorPenetrationRating);
            float drAW   = dr * ((1 - awUptime) + (1 - .25f * _talents.SanctifiedWrath) * awUptime);
            float drNoAW = dr;

            ArmorReduction = 1f - drAW;

            BaseWeaponSpeed = (_character.MainHand == null || _character.MainHand.Speed == 0.0f) ? 3.5f : _character.MainHand.Speed; // NOTE by Kavan: added a check against speed == 0, it can happen when item data is still being downloaded
            float baseWeaponDamage = _character.MainHand == null ? 371.5f : (_character.MainHand.MinDamage + _character.MainHand.MaxDamage) / 2f;

            AttackSpeed        = BaseWeaponSpeed / ((1f + _stats.PhysicalHaste) * bloodlustHaste);
            WeaponDamage       = baseWeaponDamage + _stats.AttackPower * BaseWeaponSpeed / 14f;
            NormalWeaponDamage = baseWeaponDamage + _stats.AttackPower * 3.3f / 14f;
        }
        public void GetDRAvoidanceChanceTest_Warr_TestTableDef10000()
        {
            const float testValue = 10000f;

            ItemInstance[] IIArray = new ItemInstance[1];
            Character      toon    = new Character("TestWarrior", "Malygos", CharacterRegion.US, CharacterRace.Human, new BossOptions(), IIArray, new System.Collections.Generic.List <Buff>(), "ProtWarr"); // TODO: Initialize to an appropriate value

            Assert.IsNotNull(toon);
            //toon.Level = 80;  //Asumption here.
            toon.Class = CharacterClass.Warrior;

            Stats stats = new Stats();

            stats              += BaseStats.GetBaseStats(toon);
            stats.Defense       = 400;
            stats.DefenseRating = testValue;
            uint TargetLevel = 80;

            //float levelDiff = 0.006f;
            float[] expected = new float[HitResultCount];
            expected[(int)HitResult.Miss]  = 0.16f;
            expected[(int)HitResult.Dodge] = 0.7650f;
            expected[(int)HitResult.Parry] = 0.4700f;
            // Miss test
            float actual = (float)System.Math.Round((double)StatConversion.GetDRAvoidanceChance(toon, stats, HitResult.Miss, TargetLevel), 4);

            Assert.AreEqual(expected[(int)HitResult.Miss], actual, HitResult.Miss.ToString());
            // Dodge Test
            actual = (float)System.Math.Round((double)StatConversion.GetDRAvoidanceChance(toon, stats, HitResult.Dodge, TargetLevel), 4);
            Assert.AreEqual(expected[(int)HitResult.Dodge], actual, HitResult.Dodge.ToString());
            // Parry Test
            actual = (float)System.Math.Round((double)StatConversion.GetDRAvoidanceChance(toon, stats, HitResult.Parry, TargetLevel), 4);
            Assert.AreEqual(expected[(int)HitResult.Parry], actual, HitResult.Parry.ToString());
        }
Exemple #3
0
        virtual public void AccumulateStats()
        {
            if (m_Stats == null)
            {
                m_Stats = new StatsDK();
            }

            m_Stats.Strength              = m_DKStats.Strength;
            m_Stats.Stamina               = m_DKStats.Stamina;
            m_Stats.PhysicalHaste         = m_DKStats.PhysicalHaste;
            m_Stats.CritRating            = m_DKStats.CritRating;
            m_Stats.PhysicalHit           = m_DKStats.PhysicalHit;
            m_Stats.BonusDamageMultiplier = m_DKStats.BonusDamageMultiplier;
            m_Stats.Expertise             = StatConversion.GetExpertiseFromDodgeParryReduc(m_DKStats.PhysicalHit);

            if (m_Talents.GlyphofRaiseDead)
            {
                m_Stats.Strength += (m_DKStats.Strength * .4f);
                m_Stats.Stamina  += (m_DKStats.Stamina * .4f);
            }
            m_Stats.DamageTakenReductionMultiplier = 1f - (1f - m_Stats.DamageTakenReductionMultiplier) * (1f - .90f); // 90% passive AOE damage reduction.

            // Apply ratings and such.
            m_Stats.AttackPower  = (float)Math.Floor(m_Stats.Strength * 2);
            m_Stats.PhysicalCrit = StatConversion.GetCritFromRating(m_Stats.CritRating);
            m_Stats.SpellCrit    = StatConversion.GetCritFromRating(m_Stats.CritRating);
        }
Exemple #4
0
        public static float EffectiveTargetArmorReduction(Character character, Stats stats, int targetArmor, int targetLevel)
        {
            float effectiveTargetArmor = GetEffectiveTargetArmor(character.Level, targetArmor, 0.0f, stats.ArmorPenetration, stats.ArmorPenetrationRating);
            float damageReduction      = StatConversion.GetArmorDamageReduction(targetLevel, effectiveTargetArmor, 0f, 0f, 0f);

            return(damageReduction);
        }
Exemple #5
0
        public static float TargetArmorReduction(Character character, Stats stats, int targetArmor)
        {
            float damageReduction = StatConversion.GetArmorDamageReduction(character.Level, targetArmor,
                                                                           stats.ArmorPenetration, 0f, stats.ArmorPenetrationRating);

            return(damageReduction);
        }
Exemple #6
0
 public static float CritChance(Character character, Stats stats, int targetLevel)
 {
     return(Math.Max(0f, Math.Min(1f, StatConversion.GetCritFromRating(stats.CritRating, CharacterClass.Paladin)
                                  + StatConversion.GetCritFromAgility(stats.Agility, CharacterClass.Paladin)
                                  + StatConversion.NPC_LEVEL_CRIT_MOD[targetLevel - 80]
                                  + stats.PhysicalCrit)));
 }
Exemple #7
0
        public virtual void Initialize(ISpellArgs args)
        {
            float Speed = (1f + args.Stats.SpellHaste) * (1f + StatConversion.GetSpellHasteFromRating(args.Stats.HasteRating));

            gcd              = (float)Math.Round(gcd / Speed, 4);
            castTime         = (float)Math.Round(castTime / Speed, 4);
            latencyGcd       = args.LatencyGCD;
            latencyCast      = args.LatencyCast;
            critModifier    += .2f * args.Talents.ElementalFury;
            critModifier    *= (float)Math.Round(1.5f * (1f + args.Stats.BonusSpellCritMultiplier) - 1f, 6);
            dotCritModifier += .2f * args.Talents.ElementalFury;
            dotCritModifier *= (float)Math.Round(1.5f * (1f + args.Stats.BonusSpellCritMultiplier) - 1f, 6);
            //critModifier += 1f;
            spellPower += args.Stats.SpellPower;
            crit       += args.Stats.SpellCrit;
            missChance -= args.Stats.SpellHit;
            totalCoef  *= 1 + args.Stats.BonusDamageMultiplier; //ret + bm buff
            if (missChance < 0)
            {
                missChance = 0;
            }
            manaCost = (float)Math.Floor(manaCost);
            //base resistance by level
            totalCoef *= 1f - StatConversion.GetAverageResistance(80, 83, 0, 0);
        }
Exemple #8
0
 public static float BonusCritPercentage(Character character, Stats stats, int targetLevel)
 {
     return(Math.Max(0.0f, Math.Min(1.0f,
                                    StatConversion.GetPhysicalCritFromRating(stats.CritRating, CharacterClass.Warrior) +
                                    StatConversion.GetPhysicalCritFromAgility(stats.Agility, CharacterClass.Warrior) +
                                    stats.PhysicalCrit)));
 }
Exemple #9
0
        private double computeHastedCastTimeRaw(double timeMS)
        {
            double hastedTimeMS = 0;

            int n       = HasteProcUptimes.Length;
            int maxmask = 1 << n;

            for (int i = 0; i < maxmask; ++i)
            {
                int    hasteRating = 0;
                double hasteFactor = (1 + Haste);
                double fraction    = 1.0;
                for (int j = 0; j < n; ++j)
                {
                    if ((i & (1 << j)) != 0)
                    {
                        hasteRating += HasteProcRatings[j];
                        hasteFactor *= HasteProcMultipliers[j];
                        fraction    *= HasteProcUptimes[j];
                    }
                    else
                    {
                        fraction *= 1 - HasteProcUptimes[j];
                    }
                }

                double hasteRatingMult = 1.0f + StatConversion.GetSpellHasteFromRating((float)(HasteRating + hasteRating));
                hasteFactor *= hasteRatingMult;

                hastedTimeMS += fraction * Math.Max(timeMS / hasteFactor, 1000);
            }
            return(hastedTimeMS / 1000.0);
        }
Exemple #10
0
 public static float CalcMana(Stats stats)
 {
     return((1 + stats.BonusManaMultiplier)
            * (stats.Mana
               + StatConversion.GetManaFromIntellect(
                   CalcIntellect(stats))));
 }
Exemple #11
0
 public static float CalcSpellHaste(Stats stats)
 {
     return((1f + stats.SpellHaste)
            * (1f
               + StatConversion.GetSpellHasteFromRating(
                   stats.HasteRating)));
 }
Exemple #12
0
        public float ManaPool(CharacterCalculationsHealadin calc)
        {
            DivinePleas = (float)Math.Ceiling((FightLength - 120f) / (120f * CalcOpts.DivinePlea));

            calc.ManaBase          = Stats.Mana;
            calc.ManaLayOnHands    = Stats.Mana * ((Talents.GlyphOfDivinity ? 0.1f : 0) * loh.Casts());
            calc.ManaArcaneTorrent = (Character.Race == CharacterRace.BloodElf ? Stats.Mana * .06f * (float)Math.Ceiling(FightLength / 120f - .25f) : 0);
            calc.ManaDivinePlea    = Stats.Mana * (Talents.GlyphOfDivinePlea ? 0.18f : 0.12f) * DivinePleas;
            calc.ManaMp5           = FightLength * Stats.Mp5 / 5f;
            // this Stats.ManaRestoreFromMaxManaPerSecond is 0 is is messing up the replenishment calculation!
            //calc.ManaReplenishment = Stats.ManaRestoreFromMaxManaPerSecond * Stats.Mana * FightLength * CalcOpts.Replenishment;
            calc.ManaReplenishment = 0.001f * Stats.Mana * FightLength * CalcOpts.Replenishment;
            calc.ManaOther        += Stats.ManaRestore;
            // add calc.ManaJudgements
            calc.ManaJudgements = HealadinConstants.basemana * 0.15f * jotp.Casts();
            if (Stats.HighestStat > 0)
            {
                float greatnessMana = Stats.HighestStat * StatConversion.RATING_PER_MANA;
                calc.ManaReplenishment += Stats.ManaRestoreFromMaxManaPerSecond * FightLength * greatnessMana * CalcOpts.Replenishment; // Replenishment
                calc.ManaDivinePlea    += DivinePleas * greatnessMana * .1f;                                                            // Divine Plea
            }

            // check if this is correct regen per 5 seconds..
            // combat regen = 50% of spirit regen (from Meditation), plus MP5 from gear, plus 5% base mana per 5 secs.  Base mana = 23422 at 85
            float effective_spirit = Stats.Spirit + Stats.BonusCritChanceFrostStrike * 540 * 6 / CalcOpts.HolyShock; // add in bonus spirit from 4T11 procs
            float spirit_regen     = StatConversion.GetSpiritRegenSec(effective_spirit, Stats.Intellect) * 5f;

            calc.CombatRegenRate  = spirit_regen * 0.5f + Stats.Mp5 + HealadinConstants.basemana * 0.05f;
            calc.ManaRegenRate    = spirit_regen + Stats.Mp5 + HealadinConstants.basemana * 0.05f;
            calc.CombatRegenTotal = calc.CombatRegenRate * FightLength / 5f;

            return(calc.ManaBase + calc.ManaDivinePlea + calc.CombatRegenTotal + calc.ManaOther +
                   calc.ManaReplenishment + calc.ManaLayOnHands + calc.ManaJudgements);
        }
        public TreeStats(Character character, Stats stats, KeyValuePair <double, SpecialEffect>[] hasteProcs, double treeOfLifeUptime)
        {
            CalculationOptionsTree opts = character.CalculationOptions as CalculationOptionsTree;

            bool Restoration = (opts != null) ? opts.Restoration : true;

            Haste = new HasteStats(stats, hasteProcs);

            SpellCrit = StatConversion.GetSpellCritFromIntellect(stats.Intellect) + StatConversion.GetSpellCritFromRating(stats.CritRating) + stats.SpellCrit;

            SpellPower = (float)(stats.SpellPower + Math.Max(0f, stats.Intellect - 10));
            // TODO: does nurturing instinct actually work like this?
            SpellPower += character.DruidTalents.NurturingInstinct * 0.5 * stats.Agility;
            SpellPower *= (1 + stats.BonusSpellPowerMultiplier);

            TreeOfLifeUptime = treeOfLifeUptime;
            double mastery = 8.0f + StatConversion.GetMasteryFromRating(stats.MasteryRating);

            if (Restoration)
            {
                Harmony = mastery * 0.0125f;
            }

            SpellsManaCostReduction = stats.SpellsManaCostReduction + stats.NatureSpellsManaCostReduction;
            BonusCritHealMultiplier = stats.BonusCritHealMultiplier;

            PassiveDirectHealBonus   = (Restoration ? 1.25f : 1.0f) + Harmony;
            PassivePeriodicHealBonus = (Restoration ? 1.25f : 1.0f) + opts.HarmonyPeriodicRate * Harmony + 0.02f * character.DruidTalents.Genesis;
            DirectHealMultiplier     = (1 + stats.BonusHealingDoneMultiplier) * (1.0f + character.DruidTalents.MasterShapeshifter * 0.04f) * (1 + TreeOfLifeUptime * 0.15f);
            PeriodicHealMultiplier   = DirectHealMultiplier * (1 + stats.BonusPeriodicHealingMultiplier);
            SpellsManaCostMultiplier = 1 - stats.ManaCostReductionMultiplier;

            Healed = stats.Healed + stats.HealedPerSP * SpellPower;
        }
Exemple #14
0
        public static float ArmorReduction(Character character, Stats stats)
        {
            CalculationOptionsProtWarr calcOpts = character.CalculationOptions as CalculationOptionsProtWarr;

            return(StatConversion.GetArmorDamageReduction(calcOpts.TargetLevel, stats.Armor, 0.0f, 0.0f, 0.0f));
            // return Math.Max(0.0f, Math.Min(0.75f, stats.Armor / (stats.Armor + (467.5f * calcOpts.TargetLevel - 22167.5f))));
        }
Exemple #15
0
        /**
         * Calculate approximate berserk extention due to 4T12.
         * Based on code from Toskk's Cat Calculator
         */

        private float getEnergyRegenRate()
        {
            float BaseTimeToEnergyCap = 10f;
            float energy = 100 / ((BaseTimeToEnergyCap) / StatConversion.GetHasteFromRating(Abilities.Stats.HasteRating, CharacterClass.Druid));

            return(10 * energy);
        }
        private void comboBoxBoss_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!_loadingCalculationOptions)
            {
                _loadingCalculationOptions = true;
                CalculationsEnhance calcs = new CalculationsEnhance();
                BossHandler         boss  = bosslist.GetBossFromBetterName(comboBoxBoss.Text);
                _calcOpts.SetBoss(boss);
                CB_TargLvl.Text           = _calcOpts.TargetLevel.ToString();
                CB_TargArmor.Text         = _calcOpts.TargetArmor.ToString();
                cmbLength.Value           = (int)_calcOpts.FightLength;
                CK_InBack.Checked         = _calcOpts.InBack;
                CB_InBackPerc.Value       = _calcOpts.InBackPerc;
                CK_MultiTargs.Checked     = _calcOpts.MultipleTargets;
                CB_MultiTargsMax.Enabled  = CK_MultiTargs.Checked;
                CB_MultiTargsPerc.Enabled = CK_MultiTargs.Checked;
                CB_MultiTargsMax.Value    = _calcOpts.AdditionalTargets;
                CB_MultiTargsPerc.Value   = (int)(_calcOpts.AdditionalTargetPercent * 100 + .001f);

                Stats stats = calcs.GetCharacterStats(Character, null);
                TB_BossInfo.Text = boss.GenInfoString(
                    0,                                                                                             // The Boss' Damage bonuses against you (meaning YOU are debuffed)
                    StatConversion.GetArmorDamageReduction(_calcOpts.TargetLevel, stats.Armor, 0, 0, 0),           // Your Armor's resulting Damage Reduction
                    StatConversion.GetDRAvoidanceChance(Character, stats, HitResult.Miss, _calcOpts.TargetLevel),  // Your chance for Boss to Miss you
                    StatConversion.GetDRAvoidanceChance(Character, stats, HitResult.Dodge, _calcOpts.TargetLevel), // Your chance Dodge
                    StatConversion.GetDRAvoidanceChance(Character, stats, HitResult.Parry, _calcOpts.TargetLevel), // Your chance Parry
                    0,                                                                                             // Your Chance to Block
                    0);                                                                                            // How much you Block when you Block
                // Save the new names

                _loadingCalculationOptions = false;
                Character.OnCalculationsInvalidated();
            }
        }
Exemple #17
0
 public static float BonusExpertisePercentage(Character character, Stats stats)
 {
     return(StatConversion.GetDodgeParryReducFromExpertise(stats.Expertise +
                                                           StatConversion.GetExpertiseFromRating(stats.ExpertiseRating), CharacterClass.Warrior));
     //return (((stats.ExpertiseRating * ProtWarr.ExpertiseRatingToExpertise) + stats.Expertise)
     //        * ProtWarr.ExpertiseToDodgeParryReduction) / 100.0f;
 }
Exemple #18
0
        private static float CalcDodgeChance(float weaponExpertise)
        {
            float mhDodgeChance = Math.Max(0f, StatConversion.WHITE_DODGE_CHANCE_CAP[83 /*_calcOpts.TargetLevel*/ - 80]
                                           - StatConversion.GetDodgeParryReducFromExpertise(weaponExpertise));

            return(mhDodgeChance);
        }
Exemple #19
0
        public override float GetOptimizableCalculationValue(string calculation)
        {
            switch (calculation)
            {
            case "Health": return(BasicStats.Health);

            case "Avoided Attacks %": return(AvoidedAttacks);

            case "Hit Rating": return(BasicStats.HitRating);

            case "Hit Rating %": return(StatConversion.GetPhysicalHitFromRating(BasicStats.HitRating) * 100);

            case "Expertise Rating": return(BasicStats.ExpertiseRating);

            case "Expertise": return(StatConversion.GetExpertiseFromRating(BasicStats.ExpertiseRating));

            case "Expertise Rating %": return(StatConversion.GetExpertiseFromRating(BasicStats.ExpertiseRating) * 0.25f);

            case "Nature Resist": return(BasicStats.NatureResistance);

            case "Fire Resist": return(BasicStats.FireResistance);

            case "Frost Resist": return(BasicStats.FrostResistance);

            case "Shadow Resist": return(BasicStats.ShadowResistance);

            case "Arcane Resist": return(BasicStats.ArcaneResistance);
                //case "Custom Rotation DPS": return CustomRotation.DPS;
            }
            return(0f);
        }
        private float CalcDamageProc(
            SpecialEffect effect,
            float damagePerProc,
            Dictionary <int, float> periods,
            Dictionary <int, float> chances,
            SpellModifiers modifiers)
        {
            damagePerProc *=
                modifiers.GetFinalDirectMultiplier()
                * (1
                   + (modifiers.GetFinalCritMultiplier() - 1)
                   * modifiers.CritChance)
                * (1
                   - StatConversion.GetAverageResistance(
                       80, Options.TargetLevel, 0f, 0f));
            float numProcs
                = Options.Duration
                  * effect.GetAverageProcsPerSecond(
                      periods[(int)effect.Trigger],
                      chances[(int)effect.Trigger],
                      CalculationsWarlock.AVG_UNHASTED_CAST_TIME,
                      Options.Duration);

            return(numProcs * damagePerProc);
        }
Exemple #21
0
        public void GetDodgeFromAgilityTest()
        {
            float Agility  = 1000F;
            float expected = 0F;
            float actual   = 0f;

            for (int c = 1; c <= EnumHelper.GetCount(typeof(CharacterClass)); c++)
            {
                if (c != 10)
                {
                    actual = StatConversion.GetDodgeFromAgility(Agility, (CharacterClass)c);
                    if ((CharacterClass)c == CharacterClass.DeathKnight ||
                        (CharacterClass)c == CharacterClass.Paladin ||
                        (CharacterClass)c == CharacterClass.Warrior)
                    {
                        Assert.AreEqual(expected, actual);
                    }
                    else
                    {
                        // TODO: Update this to be more accurate for the non-plate classes.
                        Assert.AreNotEqual(expected, actual);
                    }
                }
            }
        }
Exemple #22
0
        /// <summary>
        /// Instant, 1 min cd, Self (Any)
        /// Generates 10 rage at the cost of health and then generates an additional 10 rage over 10 sec.
        /// </summary>
        /// <TalentsAffecting>Improved Bloodrge [+(25*Pts)% Rage Generated], Intensify Rage [-(1/9*Pts]% Cooldown]</TalentsAffecting>
        /// <GlyphsAffecting>Glyph of Bloodrage [-100% Health Cost]</GlyphsAffecting>
        public Bloodrage(Character c, Stats s, CombatFactors cf, WhiteAttacks wa, CalculationOptionsDPSWarr co, BossOptions bo)
        {
            Char = c; StatS = s; combatFactors = cf; Whiteattacks = wa; CalcOpts = co; BossOpts = bo;
            //
            Name         = "Bloodrage";
            Description  = "Generates 10 rage at the cost of health and then generates an additional 10 rage over 10 sec.";
            AbilIterater = (int)Rawr.DPSWarr.CalculationOptionsDPSWarr.Maintenances.Bloodrage_;
            Cd           = 60f * (1f - 1f / 9f * Talents.IntensifyRage); // In Seconds
            Duration     = 10f;                                          // In Seconds
            // Rage is actually reversed in the rotation
            RageCost = -(20f                                             // Base
                         + 10f)                                          // Over Time
                       * (1f + Talents.ImprovedBloodrage * 0.25f);       // Talent Bonus
            StanceOkArms = StanceOkDef = StanceOkFury = true;
            Stats Base       = BaseStats.GetBaseStats(Char.Level, CharacterClass.Warrior, Char.Race);
            float baseHealth = Base.Health + StatConversion.GetHealthFromStamina(Base.Stamina, CharacterClass.Warrior);

            HealingBase  = -1f * (float)Math.Floor(baseHealth) * 0.16f;
            HealingBonus = (Talents.GlyphOfBloodrage ? 0f : 1f);
            UseHitTable  = false;
            UsesGCD      = false;
            UseReact     = true;
            //
            Initialize();
        }
Exemple #23
0
 public static float BonusCritPercentage(Player player)
 {
     return(Math.Max(0.0f, Math.Min(1.0f,
                                    StatConversion.GetPhysicalCritFromRating(player.Stats.CritRating, CharacterClass.Warrior) +
                                    StatConversion.GetPhysicalCritFromAgility(player.Stats.Agility, CharacterClass.Warrior) +
                                    player.Stats.PhysicalCrit)));
 }
Exemple #24
0
        public ShotRotationCalculator(Character character, CharacterCalculationsHunter calculatedStats, CalculationOptionsHunter options, double totalStaticHaste, double effectiveRAPAgainstMob, double abilitiesCritDmgModifier, double yellowCritDmgModifier, double weaponDamageAverage, double ammoDamage, double talentModifiers)
        {
            ratings = new HunterRatings();

            this.character                = character;
            this.calculatedStats          = calculatedStats;
            this.options                  = options;
            this.hawkRAPBonus             = ratings.HAWK_BONUS_AP * (1.0 + 0.5 * character.HunterTalents.AspectMastery);
            this.totalStaticHaste         = totalStaticHaste;
            this.effectiveRAPAgainstMob   = effectiveRAPAgainstMob;
            this.abilitiesCritDmgModifier = abilitiesCritDmgModifier;
            this.yellowCritDmgModifier    = yellowCritDmgModifier;
            this.weaponDamageAverage      = weaponDamageAverage;
            this.ammoDamage               = ammoDamage;
            this.talentModifiers          = talentModifiers;

            int targetArmor = options.TargetArmor;

            this.armorReduction = 1f - StatConversion.GetArmorDamageReduction(character.Level, targetArmor,
                                                                              calculatedStats.BasicStats.ArmorPenetration, 0f, calculatedStats.BasicStats.ArmorPenetrationRating);
            //double targetArmor = (options.TargetArmor - calculatedStats.BasicStats.ArmorPenetration) * (1.0 - calculatedStats.BasicStats.ArmorPenetrationRating / (ratings.ARP_RATING_PER_PERCENT * 100.0));
            //this.armorReduction = 1.0 - (targetArmor / (467.5 * options.TargetLevel + targetArmor - 22167.5));

            //reducedArmor *= (1f - character.HunterTalents.PiercingShots * 0.02f);

            this.talentedArmorReduction = 1f - StatConversion.GetArmorDamageReduction(character.Level, targetArmor,
                                                                                      calculatedStats.BasicStats.ArmorPenetration, character.HunterTalents.PiercingShots * 0.02f,
                                                                                      calculatedStats.BasicStats.ArmorPenetrationRating);
            //this.talentedArmorReduction = 1.0 - (targetArmor / (467.5 * options.TargetLevel + targetArmor - 22167.5));
        }
Exemple #25
0
        protected float CalcMeleeDamage(bool canGlance, float bonusDamage)
        {
            int level      = Mommy.Options.TargetLevel;
            int levelDelta = level - 80;

            float characterSheetDamage
                = BaseMeleeDamage
                  + DamagePerAttackPower * CalcAttackPower()
                  + bonusDamage;
            float combatTableModifier
                = CalcMeleeHitChance()
                  + CalcMeleeCrit()
                  - StatConversion.WHITE_DODGE_CHANCE_CAP[levelDelta];

            if (canGlance)
            {
                combatTableModifier
                    -= .3f * StatConversion.WHITE_GLANCE_CHANCE_CAP[levelDelta];
            }
            float armorModifier
                = 1
                  - StatConversion.GetArmorDamageReduction(
                      level,
                      StatConversion.NPC_ARMOR[levelDelta],
                      Stats.ArmorPenetration, // arpen debuffs
                      0f,                     // arpen buffs
                      0f);                    // arpen rating

            return(characterSheetDamage
                   * combatTableModifier
                   * armorModifier
                   * MeleeModifiers.GetFinalDirectMultiplier());
        }
Exemple #26
0
 public virtual void applyStats(Stats stats)
 {
     speed        = (1 + StatConversion.GetSpellHasteFromRating(stats.HasteRating)) * (1 + stats.SpellHaste);
     critModifier = 1.5f * (1f + stats.BonusCritHealMultiplier);
     healModifier = (1f + stats.BonusHealingDoneMultiplier);
     extraHealing = stats.BonusHealingReceived;
     applyHaste();
 }
Exemple #27
0
 public static float CalcSpellCrit(Stats stats)
 {
     return(stats.SpellCrit
            + StatConversion.GetSpellCritFromIntellect(CalcIntellect(stats))
            + StatConversion.GetSpellCritFromRating(stats.CritRating)
            + stats.BonusCritChance
            + stats.SpellCritOnTarget);
 }
Exemple #28
0
        public override Stats GetCharacterStats(Character character, Item additionalItem)
        {
            CalculationOptionsHealPriest calcOpts = character.CalculationOptions as CalculationOptionsHealPriest;

            StatsPriest statsTotal = new StatsPriest()
            {
                SpellHaste = PriestInformation.GetDarkness(character.PriestTalents.Darkness),
                InnerFire  = true,
                BonusIntellectMultiplier = 0.05f,   // Cloth bonus.
                PriestSpec = PriestSpec.GetPriestSpec(character.PriestTalents),
            };

            if (statsTotal.PriestSpec == ePriestSpec.Spec_Disc)
            {
                statsTotal.SpellCombatManaRegeneration = 0.5f;
                statsTotal.BonusIntellectMultiplier    = 0.15f;
            }
            else if (statsTotal.PriestSpec == ePriestSpec.Spec_Holy)
            {
                statsTotal.SpellCombatManaRegeneration = 0.5f + PriestInformation.GetHolyConcentration(character.PriestTalents.HolyConcentration);
                statsTotal.BonusHealingDoneMultiplier  = 0.15f;
            }
            else if (statsTotal.PriestSpec == ePriestSpec.Spec_ERROR)
            {
                throw new Exception("Unpossible Talent Spec!");
            }

            statsTotal.Accumulate(BaseStats.GetBaseStats(character));
            statsTotal.Accumulate(GetItemStats(character, additionalItem));
            statsTotal.Accumulate(GetBuffsStats(character, calcOpts));


            statsTotal.Stamina     = (float)Math.Floor((statsTotal.Stamina) * (1 + statsTotal.BonusStaminaMultiplier));
            statsTotal.Intellect   = (float)Math.Floor((statsTotal.Intellect) * (1 + statsTotal.BonusIntellectMultiplier));
            statsTotal.Spirit      = (float)Math.Floor((statsTotal.Spirit) * (1 + statsTotal.BonusSpiritMultiplier));
            statsTotal.SpellPower += (statsTotal.InnerFire ? PriestInformation.GetInnerFireSpellPowerBonus(character) : 0) + (statsTotal.Intellect - 10);
            statsTotal.SpellPower *= (1f + statsTotal.BonusSpellPowerMultiplier);
            statsTotal.Mana       += StatConversion.GetManaFromIntellect(statsTotal.Intellect);
            statsTotal.Mana       *= (1f + statsTotal.BonusManaMultiplier);
            statsTotal.Health     += StatConversion.GetHealthFromStamina(statsTotal.Stamina);
            statsTotal.Health      = (float)Math.Floor(statsTotal.Health * (1f + statsTotal.BonusHealthMultiplier));
            statsTotal.SpellCrit  += StatConversion.GetSpellCritFromIntellect(statsTotal.Intellect)
                                     + StatConversion.GetSpellCritFromRating(statsTotal.CritRating);
            statsTotal.SpellHaste = (1f + statsTotal.SpellHaste) * (1f + StatConversion.GetSpellHasteFromRating(statsTotal.HasteRating)) - 1f;
            statsTotal.Armor     *= (1 + (statsTotal.InnerFire ? PriestInformation.GetInnerFireArmorBonus(character) : 0));

            if (statsTotal.PriestSpec == ePriestSpec.Spec_Disc)
            {
                statsTotal.ShieldDiscipline = (PriestInformation.DisciplineMasteryBase + StatConversion.GetMasteryFromRating(statsTotal.MasteryRating)) * PriestInformation.DisciplineMasteryEffect;
            }
            else if (statsTotal.PriestSpec == ePriestSpec.Spec_Holy)
            {
                statsTotal.EchoofLight = (PriestInformation.HolyMasteryBase + StatConversion.GetMasteryFromRating(statsTotal.MasteryRating)) * PriestInformation.HolyMasteryEffect;
            }

            return(statsTotal);
        }
Exemple #29
0
        public void SetManaRegen()
        {
            baseMana = BaseStats.GetBaseStats(_character).Mana;
            float spiRegen       = StatConversion.GetSpiritRegenSec(_stats.Spirit, _stats.Intellect);
            float replenishRegen = _stats.Mana * _stats.ManaRestoreFromMaxManaPerSecond;
            float judgementRegen = _stats.ManaRestoreFromBaseManaPPM / 60f * baseMana;

            manaRegen = _stats.Mp5 / 5 + spiRegen + replenishRegen + judgementRegen;
        }
Exemple #30
0
        public virtual float GetSpecialDamage()
        {
            float resist     = StatConversion.GetAverageResistance(Mommy.CalcOpts.PlayerLevel, Mommy.CalcOpts.TargetLevel, 0f, 0f);
            float nonCrit    = (SpecialBaseDamage + SpecialDamagePerSpellPower * CalcSpellPower()) * SpecialModifiers.GetFinalDirectMultiplier() * (1 - resist);
            float crit       = nonCrit * SpecialModifiers.GetFinalCritMultiplier();
            float critChance = CalcSpellCrit();

            return(Mommy.HitChance * Utilities.GetWeightedSum(crit, critChance, nonCrit, 1 - critChance));
        }