Ejemplo n.º 1
0
        public override void Calculate(CharacterCalculationsWarlock calculations)
        {
            float chanceToHit = CalculationsWarlock.ChanceToHit(calculations.CalculationOptions.TargetLevel, HitPercent);

            DirectShadowHitsPerSecond = (1 / MbFrequency + 1f / 12f) * chanceToHit;
            EffectiveCritRate         = 0;
        }
Ejemplo n.º 2
0
        public float CalculateISBUptime(CharacterCalculationsWarlock calculations)
        {
            float chanceToHit = CalculationsWarlock.ChanceToHit(calculations.CalculationOptions.TargetLevel, calculations.HitPercent);
            float myDirectShadowHitsPerSecond = calculations.SpellRotation.ShadowBoltCastRatio / calculations.SpellRotation.ShadowBoltCastTime * chanceToHit;
            float myEffectiveCritRate         = myDirectShadowHitsPerSecond * calculations.CritPercent;

            float raidDirectShadowHitsPerSecond = 0, raidEffectiveCritRate = 0, raidShadowDps = 0;
            //for (int i = 0; i <= lastEnabledWarlock; i++)
            //{
            //    WarlockControl currentWarlock = (WarlockControl)this.groupBoxWarlocks.Controls["suWarlock" + (i + 1)];
            //    currentWarlock.Calculate(calculations);
            //    raidDirectShadowHitsPerSecond += currentWarlock.DirectShadowHitsPerSecond;
            //    raidEffectiveCritRate += currentWarlock.EffectiveCritRate;
            //    raidShadowDps += currentWarlock.ShadowDps;
            //}
            //for (int i = 0; i <= lastEnabledShadowPriest; i++)
            //{
            //    ShadowPriestControl currentSp = (ShadowPriestControl)this.groupBoxShadowPriests.Controls["suShadowPriest" + (i + 1)];
            //    currentSp.Calculate(calculations);
            //    raidDirectShadowHitsPerSecond += currentSp.DirectShadowHitsPerSecond;
            //    raidShadowDps += currentSp.ShadowDps;
            //}

            float raidIsbUptime = 1 - (float)Math.Pow(raidEffectiveCritRate, 4);
            float totalIsbUptime = 1 - (float)Math.Pow(raidEffectiveCritRate + myEffectiveCritRate, 4);

            calculations.RaidDpsFromIsb = raidShadowDps * 1.2f * (totalIsbUptime - raidIsbUptime);

            return(totalIsbUptime);
        }
Ejemplo n.º 3
0
        private float CalcRaidBuff()
        {
            float raidBuff = 0f;
            float perSP    = CalcOpts.PerSP;

            if (perSP > 0 && Pet != null)
            {
                if (CalcOpts.ConvertTotem)
                {
                    float curTotem = StatUtils.GetActiveBuff(Character.ActiveBuffs, "Spell Power", s => s.SpellPower);
                    if (curTotem == 144f || curTotem == 165f)
                    {
                        raidBuff += CalcOpts.PerFlametongue;
                    }
                }
            }

            if (CastSpells.ContainsKey("Curse Of The Elements"))
            {
                raidBuff += CalcOpts.PerMagicBuff;
            }

            raidBuff += CalcOpts.PerCritBuff * (CalcAddedCritBuff() / .05f);
            raidBuff += CalcOpts.PerHealth * CalculationsWarlock.CalcPetHealthBuff(CalcOpts.Pet, Talents, Character.ActiveBuffs, CalcOpts);

            return(raidBuff);
        }
Ejemplo n.º 4
0
 public override void Calculate(CharacterCalculationsWarlock calculations)
 {
     if (HitPercent != 0 && CritPercent != 0 && SbCastTime != 0 && SbCastRatio != 0)
     {
         float chanceToHit = CalculationsWarlock.ChanceToHit(calculations.CalculationOptions.TargetLevel, HitPercent);
         DirectShadowHitsPerSecond = SbCastRatio / SbCastTime * chanceToHit;
         EffectiveCritRate         = CritPercent * DirectShadowHitsPerSecond;
     }
 }
Ejemplo n.º 5
0
        //public float HealthPerSecond { get; set; }

        public void CalculateDerivedStats(CharacterCalculationsWarlock calculations)
        {
            //hit rate
            ChanceToHit = CalculationsWarlock.ChanceToHit(calculations.CalculationOptions.TargetLevel, calculations.HitPercent);
            if (SpellTree == SpellTree.Affliction)
            {
                ChanceToHit = Math.Min(0.99f, ChanceToHit + 2 * calculations.CalculationOptions.Suppression);
            }

            //cast time
            CastTime = BaseCastTime / (1 + 0.01f * calculations.HastePercent);
            if (calculations.BasicStats.Bloodlust > 0)
            {
                CastTime /= (1 + 0.3f * 40 / 600);
            }
            CastTime += calculations.CalculationOptions.Latency;
            if (CastTime < calculations.GlobalCooldown + calculations.CalculationOptions.Latency)
            {
                CastTime = calculations.GlobalCooldown + calculations.CalculationOptions.Latency;
            }
            //for DoTs, factor in the chance to miss (because you have to re-apply)
            if (BaseDotDuration != 0)
            {
                CastTime /= ChanceToHit;
            }
            if (CastTime < calculations.GlobalCooldown + calculations.CalculationOptions.Latency)
            {
                CastTime = calculations.GlobalCooldown + calculations.CalculationOptions.Latency;
            }

            //frequency
            if (BaseDotDuration == 0)
            {
                Frequency = CastTime;
            }
            else
            {
                Frequency = BaseDotDuration + CastTime + calculations.CalculationOptions.DotGap - (BaseCastTime + calculations.CalculationOptions.Latency);
            }

            //mana cost
            ManaCost = BaseManaCost;
            if (SpellTree == SpellTree.Destruction)
            {
                ManaCost *= (1 - 0.01f * calculations.CalculationOptions.Cataclysm);
            }
            if (BaseDotDuration != 0)
            {
                ManaCost /= ChanceToHit;
            }
            ManaCost      = (float)Math.Round(ManaCost);
            ManaPerSecond = ManaCost / Frequency;

            //cast ratio
            CastRatio = CastTime / Frequency;
        }
Ejemplo n.º 6
0
        private void buttonImportBlizzardCode_Click(object sender, EventArgs e)
        {
            string talentCode = textBoxBlizzardCode.Text;
            int    index      = talentCode.IndexOf('=');

            if (index >= 0)
            {
                talentCode = talentCode.Substring(index + 1);
            }

            CalculationsWarlock.LoadTalentCode(Character, talentCode);
            LoadCalculationOptions();
            Character.OnItemsChanged();
        }
        private void TimerButton_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Stopwatch clock
                = new System.Diagnostics.Stopwatch();
            CalculationsWarlock calculations
                = (CalculationsWarlock)Calculations.Instance;
            Character character = Character;

            clock.Start();
            for (int i = 0; i < 4000; i++)
            {
                calculations.GetCharacterCalculations(character);
            }
            clock.Stop();
            MessageBox.Show(clock.Elapsed.TotalSeconds + " seconds.");
        }
Ejemplo n.º 8
0
        public static void CalculateRaidIsbUptime(CharacterCalculationsWarlock calculations)
        {
            if (calculations.CalculationOptions.IsbMethod == IsbMethod.Raid)
            {
                float chanceToHit = CalculationsWarlock.ChanceToHit(calculations.CalculationOptions.TargetLevel, calculations.HitPercent);
                float myDirectShadowHitsPerSecond = calculations.SpellRotation.ShadowBoltCastRatio / calculations.SpellRotation.ShadowBoltCastTime * chanceToHit;
                float myEffectiveCritRate         = myDirectShadowHitsPerSecond * calculations.CritPercent;

                float raidDirectShadowHitsPerSecond = 0, raidEffectiveCritRate = 0, raidShadowDps = 0;
                for (int i = 0; i < calculations.CalculationOptions.NumRaidWarlocks; i++)
                {
                    SUWarlock currentWarlock = calculations.CalculationOptions.RaidWarlocks[i];
                    currentWarlock.Calculate(calculations);
                    raidDirectShadowHitsPerSecond += currentWarlock.DirectShadowHitsPerSecond;
                    raidEffectiveCritRate         += currentWarlock.EffectiveCritRate;
                    raidShadowDps += currentWarlock.ShadowDps;
                }
                for (int i = 0; i < calculations.CalculationOptions.NumRaidShadowPriests; i++)
                {
                    SUShadowPriest currentSp = calculations.CalculationOptions.RaidShadowPriests[i];
                    currentSp.Calculate(calculations);
                    raidDirectShadowHitsPerSecond += currentSp.DirectShadowHitsPerSecond;
                    raidShadowDps += currentSp.ShadowDps;
                }

                myEffectiveCritRate   /= 100;
                raidEffectiveCritRate /= 100;
                float raidIsbUptime = 1 - (float)Math.Pow(1 - (raidEffectiveCritRate / raidDirectShadowHitsPerSecond), 4);
                float totalIsbUptime = 1 - (float)Math.Pow(1 - ((raidEffectiveCritRate + myEffectiveCritRate) / (raidDirectShadowHitsPerSecond + myDirectShadowHitsPerSecond)), 4);

                calculations.RaidDpsFromIsb = raidShadowDps * 0.2f * (totalIsbUptime - raidIsbUptime);
                calculations.IsbUptime      = totalIsbUptime;
            }
            else
            {
                calculations.RaidDpsFromIsb = 0;
                calculations.IsbUptime      = calculations.CalculationOptions.CustomIsbUptime;
            }
        }
Ejemplo n.º 9
0
        public override Dictionary <string, string> GetCharacterDisplayCalculationValues()
        {
            CalculationsWarlock cw = new CalculationsWarlock();

            Dictionary <string, string> vals = new Dictionary <string, string>();

            vals.Add("Health", BasicStats.Health.ToString());
            vals.Add("Mana", BasicStats.Mana.ToString());
            vals.Add("Stamina", BasicStats.Stamina.ToString());
            vals.Add("Intellect", BasicStats.Intellect.ToString());
            vals.Add("Total Crit %", CritPercent.ToString("0.00"));
            vals.Add("Hit %", HitPercent.ToString("0.00"));
            vals.Add("Haste %", HastePercent.ToString("0.00"));
            vals.Add("Shadow Damage", ShadowDamage.ToString("0"));
            vals.Add("Fire Damage", FireDamage.ToString("0"));
            vals.Add("ISB Uptime", IsbUptime.ToString("0.00"));
            vals.Add("RDPS from ISB", Math.Round(RaidDpsFromIsb).ToString());
            vals.Add("Total Damage", TotalDamage.ToString());
            vals.Add("DPS", Math.Round(DpsRating).ToString());

            //vals.Add("Casting Speed", (1f / (TotalStats.SpellHasteRating / 1570f + 1f)).ToString());
            //vals.Add("Shadow Damage", (TotalStats.SpellShadowDamageRating + TotalStats.SpellDamageRating).ToString());
            //vals.Add("Fire Damage", (TotalStats.SpellFireDamageRating + TotalStats.SpellDamageRating).ToString());
            //vals.Add("DPS", DPS.ToString());
            //if (Spells.Exists(delegate(Spell s) { return s.Name.ToUpper() == "SHADOWBOLT"; }))
            //{
            //    ShadowBolt sb = new ShadowBolt(character, TotalStats);
            //    vals.Add("SB Min Hit", sb.MinDamage.ToString());
            //    vals.Add("SB Max Hit", sb.MaxDamage.ToString());
            //    vals.Add("SB Min Crit", (sb.MinDamage * sb.CritModifier).ToString());
            //    vals.Add("SB Max Crit", (sb.MaxDamage * sb.CritModifier).ToString());
            //    vals.Add("SB Average Hit", sb.AverageDamage.ToString());
            //    vals.Add("SB Crit Rate", sb.CritPercent.ToString());
            //    vals.Add("ISB Uptime", (sb.ISBuptime * 100f).ToString());
            //    vals.Add("#SB Casts", NumCasts[sb].ToString());

            //}
            //else
            //{
            //    vals.Add("SB Min Hit", "");
            //    vals.Add("SB Max Hit", "");
            //    vals.Add("SB Min Crit", "");
            //    vals.Add("SB Max Crit", "");
            //    vals.Add("SB Average Hit", "");
            //    vals.Add("SB Crit Rate", "");
            //    vals.Add("ISB Uptime", "");
            //    vals.Add("#SB Casts", "0");

            //}
            //if (Spells.Exists(delegate(Spell s) { return s.Name.ToUpper() == "INCINERATE"; }))
            //{
            //    Incinerate sb = new Incinerate(character, TotalStats);
            //    vals.Add("Incinerate Min Hit", sb.MinDamage.ToString());
            //    vals.Add("Incinerate Max Hit", sb.MaxDamage.ToString());
            //    vals.Add("Incinerate Min Crit", (sb.MinDamage * sb.CritModifier).ToString());
            //    vals.Add("Incinerate Max Crit", (sb.MaxDamage * sb.CritModifier).ToString());
            //    vals.Add("Incinerate Average Hit", sb.AverageDamage.ToString());
            //    vals.Add("Incinerate Crit Rate", sb.CritPercent.ToString());
            //    vals.Add("#Incinerate Casts", NumCasts[sb].ToString());
            //}
            //else
            //{
            //    vals.Add("Incinerate Min Hit","");
            //    vals.Add("Incinerate Max Hit","");
            //    vals.Add("Incinerate Min Crit","");
            //    vals.Add("Incinerate Max Crit","");
            //    vals.Add("Incinerate Average Hit", "");
            //    vals.Add("Incinerate Crit Rate","");
            //    vals.Add("#Incinerate Casts","0");
            //}
            //if (Spells.Exists(delegate(Spell s) { return s.Name.ToUpper() == "IMMOLATE"; }))
            //{
            //    Immolate sb = new Immolate(character, TotalStats);
            //    vals.Add("ImmolateMin Hit", sb.MinDamage.ToString());
            //    vals.Add("ImmolateMax Hit", sb.MaxDamage.ToString());
            //    vals.Add("ImmolateMin Crit", (sb.MinDamage * sb.CritModifier).ToString());
            //    vals.Add("ImmolateMax Crit", (sb.MaxDamage * sb.CritModifier).ToString());
            //    vals.Add("ImmolateAverage Hit", sb.AverageDamage.ToString());
            //    vals.Add("ImmolateCrit Rate", sb.CritPercent.ToString());
            //    vals.Add("#Immolate Casts", NumCasts[sb].ToString());
            //}
            //else
            //{
            //    vals.Add("ImmolateMin Hit","");
            //    vals.Add("ImmolateMax Hit","");
            //    vals.Add("ImmolateMin Crit","");
            //    vals.Add("ImmolateMax Crit","");
            //    vals.Add("ImmolateAverage Hit","");
            //    vals.Add("ImmolateCrit Rate","");
            //    vals.Add("#Immolate Casts","0");
            //}
            //if (Spells.Exists(delegate(Spell s) { return s.Name.ToUpper() == "CURSEOFAGONY"; }))
            //{
            //    CurseOfAgony sb = new CurseOfAgony(character, TotalStats);
            //    vals.Add("CoA Tick", (sb.AverageDamage / (sb.PeriodicDuration / sb.PeriodicTickInterval)).ToString());
            //    vals.Add("CoA Total Damage", sb.AverageDamage.ToString());
            //    vals.Add("#CoA Casts", NumCasts[sb].ToString());
            //}
            //else
            //{
            //    vals.Add("CoA Tick","");
            //    vals.Add("CoA Total Damage","");
            //    vals.Add("#CoA Casts","0");
            //}
            //if (Spells.Exists(delegate(Spell s) { return s.Name.ToUpper() == "CURSEOFDOOM"; }))
            //{
            //    CurseOfDoom sb = new CurseOfDoom(character, TotalStats);
            //    vals.Add("CoD Total Damage", sb.AverageDamage.ToString());
            //    vals.Add("#CoD Casts", NumCasts[sb].ToString());
            //}
            //else
            //{
            //    vals.Add("CoD Total Damage","");
            //    vals.Add("#CoD Casts","");
            //}
            //if (Spells.Exists(delegate(Spell s) { return s.Name.ToUpper() == "CORRUPTION"; }))
            //{
            //    Corruption sb = new Corruption(character, TotalStats);
            //    vals.Add("Corr Tick", (sb.AverageDamage / (sb.PeriodicDuration / sb.PeriodicTickInterval)).ToString());
            //    vals.Add("Corr Total Damage", sb.AverageDamage.ToString());
            //    vals.Add("#Corr Casts", NumCasts[sb].ToString());
            //}
            //else
            //{
            //    vals.Add("Corr Tick", "");
            //    vals.Add("Corr Total Damage","");
            //    vals.Add("#Corr Casts","");
            //}
            //if (Spells.Exists(delegate(Spell s) { return s.Name.ToUpper() == "UNSTABLEAFFLICTION"; }))
            //{
            //    UnstableAffliction sb = new UnstableAffliction(character, TotalStats);
            //    vals.Add("UA Tick", (sb.AverageDamage / (sb.PeriodicDuration / sb.PeriodicTickInterval)).ToString());
            //    vals.Add("UA Total Damage", sb.AverageDamage.ToString());
            //    vals.Add("#UA Casts", NumCasts[sb].ToString());
            //}
            //else
            //{
            //    vals.Add("UA Tick", "");
            //    vals.Add("UA Total Damage","");
            //    vals.Add("#UA Casts", "0");
            //}
            //if (Spells.Exists(delegate(Spell s) { return s.Name.ToUpper() == "SIPHONLIFE"; }))
            //{
            //    SiphonLife sb = new SiphonLife(character, TotalStats);
            //    vals.Add("SL Tick", (sb.AverageDamage / (sb.PeriodicDuration / sb.PeriodicTickInterval)).ToString());
            //    vals.Add("SL Total Damage", sb.AverageDamage.ToString());
            //    vals.Add("#SL Casts", NumCasts[sb].ToString());
            //}
            //else
            //{
            //    vals.Add("SL Tick","");
            //    vals.Add("SL Total Damage","");
            //    vals.Add("#SL Casts","0");
            //}
            //vals.Add("#Lifetaps", NumLifetaps.ToString());
            //vals.Add("Mana Per LT", LifetapManaReturn.ToString());

            return(vals);
        }
Ejemplo n.º 10
0
 private void buttonImportTalentPreset_Click(object sender, EventArgs e)
 {
     CalculationsWarlock.LoadTalentSpec(Character, (string)comboBoxTalentPreset.SelectedItem);
     LoadCalculationOptions();
     Character.OnItemsChanged();
 }