public float GetSpecialSpeed() { return(SpecialCooldown + SpecialCastTime / StatUtils.CalcSpellHaste(Stats)); }
public float GetSpecialSpeed() { return(SpecialCooldown + SpecialCastTime / StatUtils.CalcSpellHaste(Stats, Mommy.CalcOpts.PlayerLevel)); }
private void CalcHasteAndManaProcs() { float nonProcHaste = StatUtils.CalcSpellHaste(PreProcStats); if (Options.NoProcs) { WeightedStat staticHaste = new WeightedStat(); staticHaste.Chance = 1f; staticHaste.Value = nonProcHaste; Haste = new List <WeightedStat> { staticHaste }; AvgHaste = nonProcHaste; return; } // the trigger rates are all guestimates at this point, since the // real values depend on haste (which obviously has not been // finalized yet) Dictionary <int, float> periods = new Dictionary <int, float>(); Dictionary <int, float> chances = new Dictionary <int, float>(); float corruptionPeriod = 0f; if (Options.GetActiveRotation().Contains("Corruption")) { corruptionPeriod = 3.1f; if (Talents.GlyphQuickDecay) { corruptionPeriod /= nonProcHaste; } } PopulateTriggers( periods, chances, CalculationsWarlock.AVG_UNHASTED_CAST_TIME / nonProcHaste + Options.Latency, 1 / 1.5f, corruptionPeriod, 1f); // calculate the haste procs Haste = new List <WeightedStat>(); WeightedStat[] percentages = GetUptimes( Stats, periods, chances, s => s.SpellHaste, (a, b, c, d, e, f, g, h) => SpecialEffect .GetAverageCombinedUptimeCombinationsMultiplicative( a, b, c, d, e, f, g, h)); WeightedStat[] ratings = GetUptimes( Stats, periods, chances, s => s.HasteRating, (a, b, c, d, e, f, g, h) => SpecialEffect.GetAverageCombinedUptimeCombinations( a, b, c, d, e, f, g, h)); for (int p = percentages.Length, f = 0; --p >= 0;) { if (percentages[p].Chance == 0) { continue; } for (int r = ratings.Length; --r >= 0; ++f) { if (ratings[r].Chance == 0) { continue; } WeightedStat s = new WeightedStat(); s.Chance = percentages[p].Chance * ratings[r].Chance; s.Value = (1 + percentages[p].Value) * (1 + StatConversion.GetSpellHasteFromRating( ratings[r].Value + Stats.HasteRating)) * (1 + Stats.SpellHaste); Haste.Add(s); AvgHaste += s.Chance * s.Value; } } // calculate mana procs Stats procStats = new Stats(); foreach (SpecialEffect effect in Stats.SpecialEffects()) { if (!periods.ContainsKey((int)effect.Trigger)) { continue; } Stats proc = effect.GetAverageStats( periods[(int)effect.Trigger], chances[(int)effect.Trigger], CalculationsWarlock.AVG_UNHASTED_CAST_TIME, Options.Duration); if (proc.ManaRestore > 0) { proc.ManaRestore *= Options.Duration; } procStats.Accumulate(proc); } Stats.Mana += procStats.Mana; Stats.ManaRestore += procStats.ManaRestore; Stats.ManaRestoreFromBaseManaPPM += procStats.ManaRestoreFromBaseManaPPM; Stats.ManaRestoreFromMaxManaPerSecond += procStats.ManaRestoreFromMaxManaPerSecond; Stats.Mp5 += procStats.Mp5; }
GetCharacterDisplayCalculationValues() { Dictionary <string, string> dictValues = new Dictionary <string, string>(); dictValues.Add("Personal DPS", string.Format("{0:0}", PersonalDps)); dictValues.Add("Pet DPS", string.Format("{0:0}", PetDps)); dictValues.Add("Total DPS", string.Format("{0:0}", OverallPoints)); dictValues.Add( "Health", string.Format( "{0:0.0}*{1:0.0} stamina", CalcHealth(), CalcStamina())); dictValues.Add( "Mana", string.Format( "{0:0.0}*{1:0.0} intellect", CalcMana(), CalcIntellect())); dictValues.Add( "Spirit", string.Format("{0:0.0}", CalcSpirit())); dictValues.Add( "Bonus Damage", string.Format( "{0:0.0}*{1:0.0}\tBefore Procs", CalcSpellPower(), StatUtils.CalcSpellPower(PreProcStats))); #region Hit Rating float onePercentOfHitRating = (1 / StatConversion.GetSpellHitFromRating(1)); float hitFromRating = StatConversion.GetSpellHitFromRating(Stats.HitRating); float hitFromTalents = Talents.Suppression * 0.01f; float hitFromBuffs = (CalcSpellHit() - hitFromRating - hitFromTalents); float targetHit = Options.GetBaseHitRate() / 100f; float totalHit = targetHit + CalcSpellHit(); float missChance = totalHit > 1 ? 0 : (1 - totalHit); dictValues.Add( "Hit Rating", string.Format( "{0}*{1:0.00%} Hit Chance (max 100%) | {2:0.00%} Miss Chance \r\n\r\n" + "{3:0.00%}\t Base Hit Chance on a Level {4:0} target\r\n" + "{5:0.00%}\t from {6:0} Hit Rating [gear, food and/or flasks]\r\n" + "{7:0.00%}\t from Talent: Suppression\r\n" + "{8:0.00%}\t from Buffs: Racial and/or Spell Hit Chance Taken\r\n\r\n" + "You are {9} hit rating {10} the 446 hard cap [no hit from gear, talents or buffs]\r\n\r\n" + "Hit Rating soft caps:\r\n" + "420 - Heroic Presence\r\n" + "368 - Suppression\r\n" + "342 - Suppression and Heroic Presence\r\n" + "289 - Suppression, Improved Faerie Fire / Misery\r\n" + "263 - Suppression, Improved Faerie Fire / Misery and Heroic Presence", Stats.HitRating, totalHit, missChance, targetHit, Options.TargetLevel, hitFromRating, Stats.HitRating, hitFromTalents, hitFromBuffs, Math.Ceiling( Math.Abs((totalHit - 1) * onePercentOfHitRating)), (totalHit > 1) ? "above" : "below")); #endregion dictValues.Add( "Crit Chance", string.Format( "{0:0.00%}*{1:0.00%}\tBefore Procs", CalcSpellCrit(), StatUtils.CalcSpellCrit(PreProcStats))); dictValues.Add( "Average Haste", string.Format( "{0:0.00}%*" + "{1:0.00}%\tfrom {2:0.0} Haste rating\r\n" + "{3:0.00}%\tfrom Buffs\r\n" + "{4:0.0}ish%\tfrom Procs\r\n" + "\r\n" + "{5:0.00}s\tGlobal Cooldown\r\n", (AvgHaste - 1f) * 100f, StatConversion.GetSpellHasteFromRating(Stats.HasteRating) * 100f, Stats.HasteRating, Stats.SpellHaste * 100f, (AvgHaste - StatUtils.CalcSpellHaste(PreProcStats)) * 100f, Math.Max(1.0f, 1.5f / AvgHaste))); // Pet Stats if (Pet == null) { dictValues.Add("Pet Stamina", "-"); dictValues.Add("Pet Intellect", "-"); dictValues.Add("Pet Health", "-"); } else { dictValues.Add( "Pet Stamina", string.Format("{0:0.0}", Pet.CalcStamina())); dictValues.Add( "Pet Intellect", string.Format("{0:0.0}", Pet.CalcIntellect())); dictValues.Add( "Pet Health", string.Format("{0:0.0}", Pet.CalcHealth())); } // Spell Stats foreach (string spellName in Spell.ALL_SPELLS) { if (CastSpells.ContainsKey(spellName)) { dictValues.Add( spellName, CastSpells[spellName].GetToolTip()); } else { dictValues.Add(spellName, "-"); } } return(dictValues); }
public float CalcSpellHaste() { return(StatUtils.CalcSpellHaste(Stats)); }
/// <summary> /// Builds a dictionary containing the values to display for each of the /// calculations defined in CharacterDisplayCalculationLabels. The key /// should be the Label of each display calculation, and the value /// should be the value to display, optionally appended with '*' /// followed by any string you'd like displayed as a tooltip on the /// value. /// </summary> /// <returns> /// A Dictionary<string, string> containing the values to display for /// each of the calculations defined in /// CharacterDisplayCalculationLabels. /// </returns> public override Dictionary <string, string> GetCharacterDisplayCalculationValues() { Dictionary <string, string> dictValues = new Dictionary <string, string>(); dictValues.Add("Personal DPS", string.Format("{0:0}", PersonalDps)); dictValues.Add("Pet DPS", string.Format("{0:0}", PetDps)); dictValues.Add("Total DPS", string.Format("{0:0}", OverallPoints)); dictValues.Add("Health", string.Format("{0:0}*{1:0} stamina", CalcHealth(), CalcStamina())); dictValues.Add("Mana", string.Format("{0:0}*{1:0} intellect", CalcMana(), CalcIntellect())); dictValues.Add("Spell Power", string.Format("{0:0.0}*{1:0.0}\tBefore Procs", CalcSpellPower(), StatUtils.CalcSpellPower(PreProcStats, BaseIntellect, CalcOpts.PlayerLevel))); #region Hit Rating float onePercentOfHitRating = (1 / StatUtils.GetSpellHitFromRating(1, CalcOpts.PlayerLevel)); float hitFromRating = StatUtils.GetSpellHitFromRating(Stats.HitRating, CalcOpts.PlayerLevel); float hitFromBuffs = (CalcSpellHit() - hitFromRating); float targetHit = CalcOpts.GetBaseHitRate() / 100f; float totalHit = targetHit + CalcSpellHit(); float missChance = totalHit > 1 ? 0 : (1 - totalHit); dictValues.Add( "Hit Rating", string.Format( "{0}*{1:0.00%} Hit Chance (max 100%) | {2:0.00%} Miss Chance \r\n\r\n" + "{3:0.00%}\t Base Hit Chance on a Level {4:0} target\r\n" + "{5:0.00%}\t from {6:0} Hit Rating [gear, food and/or flasks]\r\n" + "{7:0.00%}\t from Buffs: Racial and/or Spell Hit Chance Taken\r\n\r\n" + "You are {8} hit rating {9} the hard cap [no hit from gear, talents or buffs]\r\n\r\n", Stats.HitRating, totalHit, missChance, targetHit, CalcOpts.TargetLevel, hitFromRating, Stats.HitRating, hitFromBuffs, Math.Ceiling(Math.Abs((totalHit - 1) * onePercentOfHitRating)), (totalHit > 1) ? "above" : "below")); #endregion dictValues.Add("Crit Chance", string.Format("{0:0.00%}*{1:0.00%}\tBefore Procs", CalcSpellCrit(), StatUtils.CalcSpellCrit(PreProcStats, BaseIntellect, CalcOpts.PlayerLevel))); dictValues.Add("Average Haste", string.Format( "{0:0.00}%*" + "{1:0.00}%\tfrom {2:0.0} Haste rating\r\n" + "{3:0.00}%\tfrom Buffs\r\n" + "{4:0.0}ish%\tfrom Procs\r\n" + "\r\n" + "{5:0.00}s\tGlobal Cooldown\r\n", (AvgHaste - 1f) * 100f, StatUtils.GetSpellHasteFromRating(Stats.HasteRating, CalcOpts.PlayerLevel) * 100f, Stats.HasteRating, Stats.SpellHaste * 100f, (AvgHaste - StatUtils.CalcSpellHaste(PreProcStats, CalcOpts.PlayerLevel)) * 100f, Math.Max(1.0f, 1.5f / AvgHaste))); dictValues.Add("Mastery", string.Format("{0:0.0}*from {1:0.0} Mastery Rating", CalcMastery(), Stats.MasteryRating)); if (Pet == null) { dictValues.Add("Pet Mana", "-"); dictValues.Add("Basic Melee Damage", "-"); dictValues.Add("Basic Melee DPS", "-"); dictValues.Add("Attack Power", "-"); dictValues.Add("Basic Melee Speed", "-"); dictValues.Add("Spell Damage", "-"); } else { dictValues.Add("Pet Mana", string.Format("{0:0.0}", Pet.CalcMana())); dictValues.Add("Basic Melee Damage", string.Format("{0:0.0}", Pet.CalcMeleeDamage())); dictValues.Add("Basic Melee DPS", string.Format("{0:0.0}", Pet.CalcMeleeDps())); dictValues.Add("Attack Power", string.Format("{0:0.0}", Pet.CalcAttackPower())); dictValues.Add("Basic Melee Speed", string.Format("{0:0.0}", Pet.CalcMeleeSpeed())); dictValues.Add("Spell Damage", string.Format("{0:0.0}", Pet.CalcSpellPower())); } if (Pet is Felhunter) { dictValues.Add("Shadow Bite (Fel Hunter)", string.Format("{0:0.0}", Pet.GetSpecialDamage())); } else { dictValues.Add("Shadow Bite (Fel Hunter)", "-"); } if (Pet is Imp) { dictValues.Add("Fire Bolt (Imp)", string.Format("{0:0.0}", Pet.GetSpecialDamage())); } else { dictValues.Add("Fire Bolt (Imp)", "-"); } if (Pet is Succubus) { dictValues.Add("Lash of Pain (Succubus)", string.Format("{0:0.0}", Pet.GetSpecialDamage())); } else { dictValues.Add("Lash of Pain (Succubus)", "-"); } if (Pet is Felguard) { dictValues.Add("Legion Strike (Felguard)", string.Format("{0:0.0}", Pet.GetSpecialDamage())); } else { dictValues.Add("Legion Strike (Felguard)", "-"); } // Spell Stats foreach (string spellName in Spell.ALL_SPELLS) { if (CastSpells.ContainsKey(spellName)) { dictValues.Add(spellName, CastSpells[spellName].GetToolTip()); } else { dictValues.Add(spellName, "-"); } } return(dictValues); }
public float CalcSpellHaste() { return(StatUtils.CalcSpellHaste(Stats, CalcOpts.PlayerLevel)); }