Exemple #1
0
        public void SaveRaid()
        {
            CalculationOptionsWarlock options = Character.CalculationOptions as CalculationOptionsWarlock;

            options.NumRaidWarlocks      = numWarlocks;
            options.NumRaidShadowPriests = numShadowPriests;

            for (int i = 0; i < 5; i++)
            {
                WarlockControl control = (WarlockControl)this.groupBoxWarlocks.Controls["suWarlock" + (i + 1)];
                SUWarlock      warlock = options.RaidWarlocks[i];

                warlock.HitPercent  = control.HitPercent;
                warlock.CritPercent = control.CritPercent;
                warlock.SbCastTime  = control.SbCastTime;
                warlock.SbCastRatio = control.SbCastRatio;
                warlock.ShadowDps   = control.ShadowDps;
            }

            for (int i = 0; i < 5; i++)
            {
                ShadowPriestControl control = (ShadowPriestControl)this.groupBoxShadowPriests.Controls["suShadowPriest" + (i + 1)];
                SUShadowPriest      sp      = options.RaidShadowPriests[i];

                sp.HitPercent  = control.HitPercent;
                sp.MbFrequency = control.MbFrequency;
                sp.ShadowDps   = control.ShadowDps;
            }
        }
Exemple #2
0
        public void LoadCalculationOptions()
        {
            CalculationOptionsWarlock calculationOptions = Character.CalculationOptions as CalculationOptionsWarlock;

            calculationSuspended = true;
            foreach (Control c in Controls)
            {
                if (c is GroupBox)
                {
                    foreach (Control cc in c.Controls)
                    {
                        if (cc is ComboBox)
                        {
                            ComboBox cb     = (ComboBox)cc;
                            string   talent = cb.Name.Substring(8);

                            string s = calculationOptions.GetTalentByName(talent).ToString();
                            cb.SelectedItem = calculationOptions.GetTalentByName(talent).ToString();
                        }
                    }
                }
            }
            calculationSuspended = false;
            ComputeTalentTotals();
        }
Exemple #3
0
        private void ComputeTalentTotals()
        {
            CalculationOptionsWarlock calculationOptions = Character.CalculationOptions as CalculationOptionsWarlock;
            List <string>             totals             = new List <string>();

            foreach (Control c in Controls)
            {
                if (c is GroupBox)
                {
                    int total = 0;
                    foreach (Control cc in c.Controls)
                    {
                        if (cc is ComboBox)
                        {
                            ComboBox cb     = (ComboBox)cc;
                            string   talent = cb.Name.Substring(8);
                            total += calculationOptions.GetTalentByName(talent);
                        }
                    }
                    totals.Add(total.ToString());
                }
            }
            totals.Reverse();
            Text = "Warlock Talents (" + string.Join("/", totals.ToArray()) + ")";
        }
Exemple #4
0
        public void LoadRaid()
        {
            CalculationOptionsWarlock options = Character.CalculationOptions as CalculationOptionsWarlock;

            numWarlocks      = options.NumRaidWarlocks;
            numShadowPriests = options.NumRaidShadowPriests;
            comboBoxNumWarlocks.SelectedIndex      = numWarlocks;
            comboBoxNumShadowPriests.SelectedIndex = numShadowPriests;

            for (int i = 0; i < 5; i++)
            {
                WarlockControl control = (WarlockControl)this.groupBoxWarlocks.Controls["suWarlock" + (i + 1)];
                SUWarlock      warlock = options.RaidWarlocks[i];

                control.HitPercent  = warlock.HitPercent;
                control.CritPercent = warlock.CritPercent;
                control.SbCastTime  = warlock.SbCastTime;
                control.SbCastRatio = warlock.SbCastRatio;
                control.ShadowDps   = warlock.ShadowDps;
            }

            for (int i = 0; i < 5; i++)
            {
                ShadowPriestControl control = (ShadowPriestControl)this.groupBoxShadowPriests.Controls["suShadowPriest" + (i + 1)];
                SUShadowPriest      sp      = options.RaidShadowPriests[i];

                control.HitPercent  = sp.HitPercent;
                control.MbFrequency = sp.MbFrequency;
                control.ShadowDps   = sp.ShadowDps;
            }
        }
        protected override void LoadCalculationOptions()
        {
            if (Character.CalculationOptions == null)
            {
                Character.CalculationOptions = CalculationOptionsWarlock.MakeDefaultOptions();
            }
            _options = (CalculationOptionsWarlock)Character.CalculationOptions;
            ++_ignoreCount;

            // options tab
            petCombo.SelectedItem    = _options.Pet;
            imbueCombo.SelectedItem  = _options.Imbue;
            targetLevelCombo.Text    = _options.TargetLevel.ToString();
            fightLengthSpinner.Value = (decimal)_options.Duration;
            latencySpinner.Value     = (decimal)_options.Latency * 1000;
            thirtyFiveSpinner.Value  = (decimal)_options.ThirtyFive * 100;
            twentyFiveSpinner.Value  = (decimal)_options.TwentyFive * 100;
            RefreshRotationPanel();

            // raid buff tab
            raidSPSpinner.Value       = (decimal)_options.PerSP;
            raidTotemCheckbox.Checked = _options.ConvertTotem;
            raidTotemSpinner.Value    = (decimal)_options.PerFlametongue;
            raidMagicSpinner.Value    = (decimal)_options.PerMagicBuff;
            raidCritSpinner.Value     = (decimal)_options.PerCritBuff;
            raidIntSpinner.Value      = (decimal)_options.PerInt;
            raidSpiSpinner.Value      = (decimal)_options.PerSpi;
            raidHealthSpinner.Value   = (decimal)_options.PerHealth;

            // debug tab
            procCheckbox.Checked = _options.NoProcs;

            --_ignoreCount;
        }
Exemple #6
0
        // Basic Calcuations
        public override ICalculationOptionBase DeserializeDataObject(string xml)
        {
            XmlSerializer             serializer = new XmlSerializer(typeof(CalculationOptionsWarlock));
            StringReader              reader     = new StringReader(xml);
            CalculationOptionsWarlock calcOpts   = serializer.Deserialize(reader) as CalculationOptionsWarlock;

            return(calcOpts);
        }
        private void checkBoxCastConflagrate_CheckedChanged(object sender, EventArgs e)
        {
            CalculationOptionsWarlock options = Character.CalculationOptions as CalculationOptionsWarlock;

            options.CastConflagrate = checkBoxCastConflagrate.Checked;
            if (!calculationSuspended)
            {
                Character.OnItemsChanged();
            }
        }
        private void checkBoxPetSacrificed_CheckedChanged(object sender, EventArgs e)
        {
            CalculationOptionsWarlock options = Character.CalculationOptions as CalculationOptionsWarlock;

            options.PetSacrificed = checkBoxPetSacrificed.Checked;
            if (!calculationSuspended)
            {
                Character.OnItemsChanged();
            }
        }
        private void checkBoxCastUnstableAffliction_CheckedChanged(object sender, EventArgs e)
        {
            CalculationOptionsWarlock options = Character.CalculationOptions as CalculationOptionsWarlock;

            options.CastUnstableAffliction = checkBoxCastUnstableAffliction.Checked;
            if (!calculationSuspended)
            {
                Character.OnItemsChanged();
            }
        }
        private void comboBoxFillerSpell_SelectedIndexChanged(object sender, EventArgs e)
        {
            CalculationOptionsWarlock options = Character.CalculationOptions as CalculationOptionsWarlock;

            options.FillerSpell = (FillerSpell)(comboBoxFillerSpell.SelectedIndex);
            if (!calculationSuspended)
            {
                Character.OnItemsChanged();
            }
        }
        private void comboBoxTargetLevel_SelectedIndexChanged(object sender, EventArgs e)
        {
            CalculationOptionsWarlock options = Character.CalculationOptions as CalculationOptionsWarlock;

            options.TargetLevel = int.Parse(comboBoxTargetLevel.SelectedItem.ToString());
            if (!calculationSuspended)
            {
                Character.OnItemsChanged();
            }
        }
        private void comboBoxPet_SelectedIndexChanged(object sender, EventArgs e)
        {
            CalculationOptionsWarlock options = Character.CalculationOptions as CalculationOptionsWarlock;

            options.Pet = (Pet)(comboBoxPet.SelectedIndex);
            if (!calculationSuspended)
            {
                Character.OnItemsChanged();
            }
        }
Exemple #13
0
        private void comboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            CalculationOptionsWarlock calculationOptions = Character.CalculationOptions as CalculationOptionsWarlock;
            ComboBox cb     = (ComboBox)sender;
            string   talent = cb.Name.Substring(8);

            calculationOptions.SetTalentByName(talent, int.Parse(cb.SelectedItem.ToString()));
            if (!calculationSuspended)
            {
                Character.OnItemsChanged();
                ComputeTalentTotals();
            }
        }
 public void LoadCalculationOptions()
 {
     _loadingCalculationOptions = true;
     if (Character.CalculationOptions == null)
     {
         Character.CalculationOptions = new CalculationOptionsWarlock();
     }
     calcOpts = Character.CalculationOptions as CalculationOptionsWarlock;
     // Model Specific Code
     RefreshRotationPanel();
     //
     _loadingCalculationOptions = false;
 }
        private void textBoxShadowPriestDps_Leave(object sender, EventArgs e)
        {
            CalculationOptionsWarlock options = Character.CalculationOptions as CalculationOptionsWarlock;
            float value;

            if (float.TryParse(textBoxShadowPriestDps.Text, out value))
            {
                options.ShadowPriestDps = value;
                if (!calculationSuspended)
                {
                    Character.OnItemsChanged();
                }
            }
        }
        private void textBoxAfflictionDebuffs_Leave(object sender, EventArgs e)
        {
            CalculationOptionsWarlock options = Character.CalculationOptions as CalculationOptionsWarlock;
            int value;

            if (int.TryParse(textBoxAfflictionDebuffs.Text, out value))
            {
                options.AfflictionDebuffs = value;
                if (!calculationSuspended)
                {
                    Character.OnItemsChanged();
                }
            }
        }
        private void textBoxIsbCustom_Leave(object sender, EventArgs e)
        {
            CalculationOptionsWarlock options = Character.CalculationOptions as CalculationOptionsWarlock;
            float value;

            if (float.TryParse(textBoxIsbCustom.Text, out value))
            {
                options.CustomIsbUptime = value;
                if (!calculationSuspended)
                {
                    Character.OnItemsChanged();
                }
            }
        }
Exemple #18
0
 public void LoadCalculationOptions()
 {
     m_loadingCalculationOptions = true;
     if (Character.CalculationOptions == null)
     {
         Character.CalculationOptions = new CalculationOptionsWarlock();
     }
     m_calcOpts = Character.CalculationOptions as CalculationOptionsWarlock;
     if (m_calcOpts.Rotations.Count == 0)
     {
         CalculationOptionsWarlock.AddDefaultRotations(m_calcOpts.Rotations);
     }
     RefreshRotationPanel();
     m_loadingCalculationOptions = false;
 }
        private void radioButtonIsbCustom_CheckedChanged(object sender, EventArgs e)
        {
            CalculationOptionsWarlock options = Character.CalculationOptions as CalculationOptionsWarlock;

            if (radioButtonIsbCustom.Checked)
            {
                options.IsbMethod        = IsbMethod.Custom;
                textBoxIsbCustom.Enabled = true;
            }
            else
            {
                textBoxIsbCustom.Enabled = false;
            }
            if (!calculationSuspended)
            {
                Character.OnItemsChanged();
            }
        }
        private void checkBoxCastImmolate_CheckedChanged(object sender, EventArgs e)
        {
            CalculationOptionsWarlock options = Character.CalculationOptions as CalculationOptionsWarlock;

            options.CastImmolate = checkBoxCastImmolate.Checked;
            if (!options.CastImmolate)
            {
                checkBoxCastConflagrate.Enabled = checkBoxCastConflagrate.Checked = false;
            }
            else if (options.Conflagrate == 1)
            {
                checkBoxCastConflagrate.Enabled = true;
            }
            if (!calculationSuspended)
            {
                Character.OnItemsChanged();
            }
        }
        public static CalculationOptionsWarlock MakeDefaultOptions()
        {
            CalculationOptionsWarlock options = new CalculationOptionsWarlock();

            options.Pet         = "None";
            options.TargetLevel = 83;
            options.Duration    = 300;
            options.Latency     = .1f;
            options.Rotations   = new List <Rotation>();

            options.Rotations.Add(
                new Rotation(
                    "Affliction",
                    "Shadow Bolt",
                    "Drain Soul",
                    "Haunt",
                    "Corruption",
                    "Unstable Affliction",
                    "Curse Of Agony"));
            options.Rotations.Add(
                new Rotation(
                    "Demonology",
                    "Shadow Bolt",
                    "Soul Fire",
                    "Immolation Aura",
                    "Corruption",
                    "Immolate",
                    "Incinerate (Under Molten Core)",
                    "Curse Of Agony"));
            options.Rotations.Add(
                new Rotation(
                    "Destruction",
                    "Incinerate",
                    null,
                    "Immolate",
                    "Conflagrate",
                    "Incinerate (Under Backdraft)",
                    "Chaos Bolt",
                    "Curse Of Doom"));

            return(options);
        }
Exemple #22
0
        public override Stats GetCharacterStats(Character character, Item additionalItem)
        {
            WarlockTalents            talents  = character.WarlockTalents;
            CalculationOptionsWarlock calcOpts = character.CalculationOptions as CalculationOptionsWarlock;
            BossOptions bossOpts = character.BossOptions;
            Stats       stats    = BaseStats.GetBaseStats(character);

            AccumulateItemStats(stats, character, additionalItem);
            AccumulateBuffsStats(stats, character.ActiveBuffs);
            AccumulateSetBonusStats(stats, character.SetBonusCount);
            ApplyPetsRaidBuff(stats, calcOpts.Pet, talents, character.ActiveBuffs, calcOpts);

            float[] demonicEmbraceValues = { 0f, .04f, .07f, .1f };
            Stats   statsTalents         = new Stats {
                BonusStaminaMultiplier = demonicEmbraceValues[talents.DemonicEmbrace] //Demonic Embrace
            };

            if (talents.Eradication > 0)
            {
                float[] eradicationValues = { 0f, .06f, .12f, .20f };
                statsTalents.AddSpecialEffect(
                    new SpecialEffect(
                        Trigger.CorruptionTick,
                        new Stats()
                {
                    SpellHaste = eradicationValues[talents.Eradication]
                },
                        10f,    //duration
                        0f,     //cooldown
                        .06f)); //chance
            }

            stats.Accumulate(statsTalents);
            stats.ManaRestoreFromMaxManaPerSecond
                = Math.Max(
                      stats.ManaRestoreFromMaxManaPerSecond,
                      .001f * Spell.CalcUprate(talents.SoulLeech > 0 ? 1f : 0f, 15f, bossOpts.BerserkTimer * 1.1f));
            return(stats);
        }
        public void UpdateTalentOptions()
        {
            CalculationOptionsWarlock options = Character.CalculationOptions as CalculationOptionsWarlock;

            calculationSuspended = true;

            checkBoxCastUnstableAffliction.Enabled = options.UnstableAffliction == 1;
            checkBoxCastUnstableAffliction.Checked = checkBoxCastUnstableAffliction.Enabled && options.CastUnstableAffliction;

            checkBoxCastSiphonLife.Enabled = options.SiphonLife == 1;
            checkBoxCastSiphonLife.Checked = checkBoxCastSiphonLife.Enabled && options.CastSiphonLife;

            checkBoxCastShadowburn.Enabled = options.Shadowburn == 1;
            checkBoxCastShadowburn.Checked = checkBoxCastShadowburn.Enabled && options.CastShadowburn;

            checkBoxCastConflagrate.Enabled = options.Conflagrate == 1 && checkBoxCastImmolate.Checked;
            checkBoxCastConflagrate.Checked = checkBoxCastConflagrate.Enabled && options.CastConflagrate;

            checkBoxCastCorruption.Checked    = options.CastCorruption;
            checkBoxCastImmolate.Checked      = options.CastImmolate;
            comboBoxFillerSpell.SelectedIndex = (int)options.FillerSpell;

            if (options.SummonFelguard == 1 && !comboBoxPet.Items.Contains("Felguard"))
            {
                comboBoxPet.Items.Add("Felguard");
            }
            else if (options.SummonFelguard != 1 && comboBoxPet.Items.Contains("Felguard"))
            {
                comboBoxPet.Items.Remove("Felguard");
            }
            comboBoxPet.SelectedIndex = (int)options.Pet;

            checkBoxPetSacrificed.Enabled = options.DemonicSacrifice == 1;
            checkBoxPetSacrificed.Checked = checkBoxPetSacrificed.Enabled && options.PetSacrificed;

            calculationSuspended = false;
            Character.OnItemsChanged();
        }
Exemple #24
0
        private Stats GetPetBuffStats(Character character)
        {
            List <Buff> buffs = new List <Buff>();

            foreach (Buff buff in character.ActiveBuffs)
            {
                string group = buff.Group;
                if (group != "Profession Buffs" &&
                    group != "Set Bonuses" &&
                    group != "Food" &&
                    group != "Potion" &&
                    group != "Elixirs and Flasks" &&
                    group != "Focus Magic, Spell Critical Strike Chance")
                {
                    buffs.Add(buff);
                }
            }
            Stats stats = GetBuffsStats(buffs);
            CalculationOptionsWarlock calcOpts = character.CalculationOptions as CalculationOptionsWarlock;

            ApplyPetsRaidBuff(stats, calcOpts.Pet, character.WarlockTalents, character.ActiveBuffs, calcOpts);
            return(stats);
        }
        /// <param name="stats">
        /// This should already have buffStats factored in.
        /// </param>
        public CharacterCalculationsWarlock(
            Character character, Stats stats, Stats petBuffs)
        {
            Character = character;
            Options   = (CalculationOptionsWarlock)character.CalculationOptions;
            if (Options == null)
            {
                Options = CalculationOptionsWarlock.MakeDefaultOptions();
            }
            Talents      = character.WarlockTalents;
            Stats        = stats;
            PreProcStats = Stats.Clone();
            PetBuffs     = petBuffs;
            BaseMana     = BaseStats.GetBaseStats(character).Mana;
            Spells       = new Dictionary <string, Spell>();
            CastSpells   = new Dictionary <string, Spell>();
            HitChance
                = Math.Min(
                      1f,
                      Options.GetBaseHitRate() / 100f + CalcSpellHit());

            if (!Options.Pet.Equals("None") &&
                (Talents.SummonFelguard > 0 ||
                 !Options.Pet.Equals("Felguard")))
            {
                Type type = Type.GetType("Rawr.Warlock." + Options.Pet);
                Pet = (Pet)Activator.CreateInstance(
                    type, new object[] { this });
            }

            float personalDps = CalcPersonalDps();
            float petDps      = CalcPetDps();
            float raidBuff    = CalcRaidBuff();

            SubPoints     = new float[] { personalDps, petDps, raidBuff };
            OverallPoints = personalDps + petDps + raidBuff;
        }
Exemple #26
0
        public static float CalcPetMP5Buff(string pet, WarlockTalents talents, List <Buff> activeBuffs, CalculationOptionsWarlock options)
        {
            if (!pet.Equals("Felhunter"))
            {
                return(0f);
            }

            //spell ID 54424, effect ID 47203
            float SCALE = 0.7360000014f;

            return(StatUtils.GetBuffEffect(activeBuffs, SCALE * buffBaseValues[options.PlayerLevel - 80], "Mana Regeneration", s => s.Mp5));
        }
Exemple #27
0
        public static float CalcPetHealthBuff(string pet, WarlockTalents talents, List <Buff> activeBuffs, CalculationOptionsWarlock options)
        {
            if (!pet.Equals("Imp"))
            {
                return(0f);
            }

            //spell ID 6307, effect ID 2190
            float SCALE = 1.3200000525f;

            return(StatUtils.GetBuffEffect(activeBuffs, SCALE * buffBaseValues[options.PlayerLevel - 80], "Health", s => s.Health));
        }
Exemple #28
0
 private void ApplyPetsRaidBuff(Stats stats, string pet, WarlockTalents talents, List <Buff> activeBuffs, CalculationOptionsWarlock options)
 {
     stats.Health += CalcPetHealthBuff(pet, talents, activeBuffs, options);
     stats.Mana   += CalcPetManaBuff(pet, talents, activeBuffs, options);
     stats.Mp5    += CalcPetMP5Buff(pet, talents, activeBuffs, options);
 }
        protected override void LoadCalculationOptions()
        {
            if (Character.CalculationOptions == null)
            {
                Character.CalculationOptions = new CalculationOptionsWarlock(Character);
            }
            CalculationOptionsWarlock options = Character.CalculationOptions as CalculationOptionsWarlock;

            calculationSuspended = true;

            checkBoxEnforceMetagemRequirements.Checked = Character.EnforceMetagemRequirements;
            textBoxLatency.Text = options.Latency.ToString();
            comboBoxTargetLevel.SelectedItem = options.TargetLevel.ToString();
            textBoxFightDuration.Text        = options.FightDuration.ToString();
            textBoxDotGap.Text                = options.DotGap.ToString();
            textBoxAfflictionDebuffs.Text     = options.AfflictionDebuffs.ToString();
            textBoxShadowPriestDps.Text       = options.ShadowPriestDps.ToString();
            comboBoxFillerSpell.SelectedIndex = (int)options.FillerSpell;
            comboBoxCastedCurse.SelectedIndex = (int)options.CastedCurse;
            checkBoxCastImmolate.Checked      = options.CastImmolate;
            checkBoxCastCorruption.Checked    = options.CastCorruption;
            if (options.IsbMethod == IsbMethod.Custom)
            {
                radioButtonIsbCustom.Checked = true;
                textBoxIsbCustom.Enabled     = true;
                buttonIsbRaid.Enabled        = false;
            }
            else
            {
                radioButtonIsbRaid.Checked = true;
                textBoxIsbCustom.Enabled   = false;
                buttonIsbRaid.Enabled      = true;
            }
            textBoxIsbCustom.Text = options.CustomIsbUptime.ToString();

            checkBoxCastUnstableAffliction.Enabled = options.UnstableAffliction == 1;
            checkBoxCastUnstableAffliction.Checked = checkBoxCastUnstableAffliction.Enabled && options.CastUnstableAffliction;
            checkBoxCastSiphonLife.Enabled         = options.SiphonLife == 1;
            checkBoxCastSiphonLife.Checked         = checkBoxCastSiphonLife.Enabled && options.CastSiphonLife;
            checkBoxCastShadowburn.Enabled         = options.Shadowburn == 1;
            checkBoxCastShadowburn.Checked         = checkBoxCastShadowburn.Enabled && options.CastShadowburn;
            checkBoxCastConflagrate.Enabled        = (options.Conflagrate == 1 && checkBoxCastImmolate.Checked);
            checkBoxCastConflagrate.Checked        = checkBoxCastConflagrate.Enabled && options.CastConflagrate;
            if (options.SummonFelguard == 1 && !comboBoxPet.Items.Contains("Felguard"))
            {
                comboBoxPet.Items.Add("Felguard");
            }
            else if (options.SummonFelguard != 1 && comboBoxPet.Items.Contains("Felguard"))
            {
                comboBoxPet.Items.Remove("Felguard");
            }
            comboBoxPet.SelectedIndex     = (int)options.Pet;
            checkBoxPetSacrificed.Enabled = options.DemonicSacrifice == 1;
            checkBoxPetSacrificed.Checked = checkBoxPetSacrificed.Enabled && options.PetSacrificed;

            if (talents != null)
            {
                talents.LoadCalculationOptions();
            }

            calculationSuspended = false;
        }
        public static float CalcPetMP5Buff(string pet, WarlockTalents talents, List<Buff> activeBuffs, CalculationOptionsWarlock options)
        {
            if (!pet.Equals("Felhunter"))
            {
                return 0f;
            }

            //spell ID 54424, effect ID 47203
            float SCALE = 0.7360000014f;
            return StatUtils.GetBuffEffect(activeBuffs, SCALE * buffBaseValues[options.PlayerLevel - 80], "Mana Regeneration", s => s.Mp5);
        }
        public static float CalcPetHealthBuff(string pet, WarlockTalents talents, List<Buff> activeBuffs, CalculationOptionsWarlock options)
        {
            if (!pet.Equals("Imp"))
            {
                return 0f;
            }

            //spell ID 6307, effect ID 2190
            float SCALE = 1.3200000525f;
            return StatUtils.GetBuffEffect(activeBuffs, SCALE * buffBaseValues[options.PlayerLevel - 80], "Health", s => s.Health);
        }
 private void ApplyPetsRaidBuff(Stats stats, string pet, WarlockTalents talents, List<Buff> activeBuffs, CalculationOptionsWarlock options)
 {
     stats.Health += CalcPetHealthBuff(pet, talents, activeBuffs, options);
     stats.Mana += CalcPetManaBuff(pet, talents, activeBuffs, options);
     stats.Mp5 += CalcPetMP5Buff(pet, talents, activeBuffs, options);
 }
        /// <summary>Gets the total Stats of the Character</summary>
        /// <param name="character">
        /// The Character to get the total Stats of
        /// </param>
        /// <param name="additionalItem">
        /// An additional item to grant the Character the stats of (as if it
        /// were worn)
        /// </param>
        /// <returns>The total stats for the Character</returns>
        public override Stats GetCharacterStats(
            Character character, Item additionalItem)
        {
            WarlockTalents            talents = character.WarlockTalents;
            CalculationOptionsWarlock options
                = character.CalculationOptions as CalculationOptionsWarlock;
            Stats stats = BaseStats.GetBaseStats(character);

            // Items
            AccumulateItemStats(stats, character, additionalItem);

            // Buffs
            AccumulateBuffsStats(stats, character.ActiveBuffs);
            if (options.Imbue.Equals("Grand Spellstone"))
            {
                stats.HasteRating += 60f * (1f + talents.MasterConjuror * 1.5f);
            }
            else
            {
                Debug.Assert(options.Imbue.Equals("Grand Firestone"));
                stats.CritRating += 49f * (1f + talents.MasterConjuror * 1.5f);
            }
            ApplyPetsRaidBuff(
                stats, options.Pet, talents, character.ActiveBuffs);
            float aegis = 1f + talents.DemonicAegis * 0.10f;

            stats.SpellPower += 180f * aegis;                     // fel armor
            stats.SpellDamageFromSpiritPercentage += .3f * aegis; // fel armor

            // Talents
            float[] talentValues = { 0f, .04f, .07f, .1f };
            Stats   statsTalents = new Stats {
                //Demonic Embrace: increases your stamina by 4/7/10%
                BonusStaminaMultiplier = talentValues[talents.DemonicEmbrace],

                //Fel Vitality: increases your maximum Health & Mana by 1/2/3%
                BonusHealthMultiplier = talents.FelVitality * 0.01f,
                BonusManaMultiplier   = talents.FelVitality * 0.01f,

                //Suppression: increases your chance to hit with spells by
                //1/2/3%
                SpellHit = (talents.Suppression * 0.01f),

                //Demonic Tactics: increases your spell crit chance by
                //2/4/6/8/10%
                //Backlash: increases your spell crit chance by 1/2/3%
                BonusCritChance
                    = talents.DemonicTactics * 0.02f + talents.Backlash * 0.01f
            };

            if (talents.Eradication > 0)
            {
                talentValues = new float[] { 0f, .06f, .12f, .20f };
                statsTalents.AddSpecialEffect(
                    new SpecialEffect(
                        Trigger.CorruptionTick,
                        new Stats()
                {
                    SpellHaste = talentValues[talents.Eradication]
                },
                        6f,
                        0f,
                        .06f));
            }
            stats.Accumulate(statsTalents);
            stats.ManaRestoreFromMaxManaPerSecond
                = Math.Max(
                      stats.ManaRestoreFromMaxManaPerSecond,
                      .002f
                      * Spell.CalcUprate(
                          talents.ImprovedSoulLeech * .5f,
                          15f,
                          options.Duration * 1.1f));

            return(stats);
        }