Exemplo n.º 1
0
        public AttackModel(Character character, Base.StatsPaladin stats, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
        {
            Character   = character;
            CalcOpts    = calcOpts;
            BossOpts    = bossOpts;
            Stats       = stats;
            DefendTable = new DefendTable(character, stats, calcOpts, bossOpts);
            ParryModel  = new ParryModel(character, stats, calcOpts, bossOpts);

            Abilities.Add(Ability.AvengersShield, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.CensureTick, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.Consecration, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.CrusaderStrike, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.HammerOfTheRighteous, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.HammerOfTheRighteousProc, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.HammerOfWrath, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.HolyWrath, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.JudgementOfRighteousness, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.JudgementOfTruth, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.MeleeSwing, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.RetributionAura, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.SealOfRighteousness, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.SealOfTruth, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.ShieldOfTheRighteous, character, stats, calcOpts, bossOpts);

            Calculate();
        }
Exemplo n.º 2
0
        private void calculationOptionControl_Changed(object sender, EventArgs e)
        {
            if (!_loadingCalculationOptions)
            {
                CalculationOptionsProtPaladin calcOpts = Character.CalculationOptions as CalculationOptionsProtPaladin;
                // Attacker Stats
                labelTargetArmorDescription.Text = trackBarTargetArmor.Value.ToString() + (armorBosses.ContainsKey(trackBarTargetArmor.Value) ? ": " + armorBosses[trackBarTargetArmor.Value] : "");
                trackBarBossAttackValue.Value    = 500 * (trackBarBossAttackValue.Value / 500);
                labelBossAttackValue.Text        = trackBarBossAttackValue.Value.ToString();
                labelBossAttackSpeed.Text        = String.Format("{0:0.00}s", ((float)(trackBarBossAttackSpeed.Value) * 0.25f));
                labelBossMagicalDamage.Text      = trackBarBossAttackValueMagic.Value.ToString();;
                labelBossMagicSpeed.Text         = String.Format("{0:0.00}s", ((float)(trackBarBossAttackSpeedMagic.Value) * 0.25f));
                // Ranking System
                labelThreatScale.Text     = String.Format("{0:0.00}", ((float)(trackBarThreatScale.Value) * 0.01f));
                labelMitigationScale.Text = String.Format("{0:0.00}", ((float)(trackBarMitigationScale.Value) * 0.01f));

                //c alcOpts.TargetLevel = int.Parse(comboBoxTargetLevel.SelectedItem.ToString());
                calcOpts.TargetLevel     = (int)numericUpDownTargetLevel.Value;
                calcOpts.TargetArmor     = trackBarTargetArmor.Value;
                calcOpts.BossAttackValue = trackBarBossAttackValue.Value;
                calcOpts.BossAttackSpeed = ((float)(trackBarBossAttackSpeed.Value) * 0.25f);
                calcOpts.ThreatScale     = ((float)(trackBarThreatScale.Value / 10.0f));
                calcOpts.MitigationScale = ((float)(trackBarMitigationScale.Value) * 170.0f);
                calcOpts.SurvivalSoftCap = (int)numericUpDownSurvivalSoftCap.Value;

                Character.OnCalculationsInvalidated();
            }
        }
Exemplo n.º 3
0
        public AbilityModel(Character character, Stats stats, Ability ability, CalculationOptionsProtPaladin calcOpts)
        {
#endif
            Character = character;
            Stats     = stats;
            Ability   = ability;
            CalcOpts  = calcOpts;
#if (RAWR3)
            BossOpts = bossOpts;
#endif

            Talents = Character.PaladinTalents;
#if (RAWR3)
            AttackTable = new AttackTable(character, stats, ability, CalcOpts, BossOpts);
#else
            AttackTable = new AttackTable(character, stats, ability, CalcOpts);
#endif

            if (!Lookup.IsSpell(Ability))
#if (RAWR3)
            { ArmorReduction = Lookup.EffectiveTargetArmorReduction(Character, Stats, BossOpts.Armor, BossOpts.Level); }
#else
            { ArmorReduction = Lookup.EffectiveTargetArmorReduction(Character, Stats, CalcOpts.TargetArmor, CalcOpts.TargetLevel); }
#endif

            Name              = Lookup.Name(Ability);
            DamageMultiplier  = Lookup.StanceDamageMultipler(Character, Stats);
            DamageMultiplier *= Lookup.CreatureTypeDamageMultiplier(Character, CalcOpts.TargetType);

            CalculateDamage();
            CalculateThreat();
        }
Exemplo n.º 4
0
 protected void Initialize(Character character, Stats stats, Ability ability, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
 {
     Character = character;
     CalcOpts  = calcOpts;
     BossOpts  = bossOpts;
     Stats     = stats;
     Ability   = ability;
     Calculate();
 }
Exemplo n.º 5
0
 public ParryModel(Character character, Stats stats, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts) {
     Character   = character;
     Stats       = stats;
     CalcOpts    = calcOpts;
     BossOpts    = bossOpts;
     AttackTable = new AttackTable(character, stats, calcOpts, bossOpts);
     DefendTable = new DefendTable(character, stats, calcOpts, bossOpts);
     Calculate();
 }
Exemplo n.º 6
0
 private void checkBoxUseHolyShield_CheckedChanged(object sender, EventArgs e)
 {
     if (!_loadingCalculationOptions)
     {
         CalculationOptionsProtPaladin calcOpts = Character.CalculationOptions as CalculationOptionsProtPaladin;
         calcOpts.UseHolyShield = checkBoxUseHolyShield.Checked;
         Character.OnCalculationsInvalidated();
     }
 }
Exemplo n.º 7
0
        public void Add(Ability ability, Character character, Stats stats, CalculationOptionsProtPaladin calcOpts)
#endif
        {
#if (RAWR3)
            this.Add(ability, new AbilityModel(character, stats, ability, calcOpts, bossOpts));
#else
            this.Add(ability, new AbilityModel(character, stats, ability, calcOpts));
#endif
        }
Exemplo n.º 8
0
        public AttackTable(Character character, Stats stats, Ability ability, CalculationOptionsProtPaladin calcOpts)
#endif
        {
#if (RAWR3)
            Initialize(character, stats, ability, calcOpts, bossOpts);
#else
            Initialize(character, stats, ability, calcOpts);
#endif
        }
Exemplo n.º 9
0
 private void CK_PTRMode_CheckedChanged(object sender, EventArgs e)
 {
     if (!_loadingCalculationOptions)
     {
         CalculationOptionsProtPaladin calcOpts = Character.CalculationOptions as CalculationOptionsProtPaladin;
         calcOpts.PTRMode = CK_PTRMode.Checked;
         Character.OnCalculationsInvalidated();
     }
 }
Exemplo n.º 10
0
 protected void Initialize(Character character, Stats stats, Ability ability, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
 {
     Character   = character;
     CalcOpts    = calcOpts;
     BossOpts    = bossOpts;
     Stats       = stats;
     Ability     = ability;
     Calculate();
 }
Exemplo n.º 11
0
 private void ComboBoxTrinketOnUseHandling_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!_loadingCalculationOptions)
     {
         CalculationOptionsProtPaladin calcOpts = Character.CalculationOptions as CalculationOptionsProtPaladin;
         calcOpts.TrinketOnUseHandling = comboBoxTrinketOnUseHandling.SelectedItem.ToString();
         Character.OnCalculationsInvalidated();
     }
 }
Exemplo n.º 12
0
 private void comboBoxMagicDamageType_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (!_loadingCalculationOptions)
     {
         CalculationOptionsProtPaladin calcOpts = Character.CalculationOptions as CalculationOptionsProtPaladin;
         calcOpts.MagicDamageType = comboBoxMagicDamageType.SelectedItem.ToString();
         Character.OnCalculationsInvalidated();
     }
 }
 public void LoadCalculationOptions()
 {
     _loadingCalculationOptions = true;
     if (Character.CalculationOptions == null) Character.CalculationOptions = new CalculationOptionsProtPaladin();
     calcOpts = Character.CalculationOptions as CalculationOptionsProtPaladin;
     // Model Specific Code
     //
     _loadingCalculationOptions = false;
 }
Exemplo n.º 14
0
 private void numericUpDownTargetLevel_ValueChanged(object sender, EventArgs e)
 {
     if (!_loadingCalculationOptions)
     {
         CalculationOptionsProtPaladin calcOpts = Character.CalculationOptions as CalculationOptionsProtPaladin;
         calcOpts.TargetLevel      = (int)numericUpDownTargetLevel.Value;
         trackBarTargetArmor.Value = (int)StatConversion.NPC_ARMOR[calcOpts.TargetLevel - 80];
         Character.OnCalculationsInvalidated();
     }
 }
Exemplo n.º 15
0
 public ParryModel(Character character, Stats stats, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
 {
     Character   = character;
     Stats       = stats;
     CalcOpts    = calcOpts;
     BossOpts    = bossOpts;
     AttackTable = new AttackTable(character, stats, calcOpts, bossOpts);
     DefendTable = new DefendTable(character, stats, calcOpts, bossOpts);
     Calculate();
 }
Exemplo n.º 16
0
        public DefendTable(Character character, Stats stats, CalculationOptionsProtPaladin calcOpts, bool useHolyShield)
#endif
        {
            UseHolyShield = useHolyShield;
#if (RAWR3)
            Initialize(character, stats, Ability.None, calcOpts, bossOpts);
#else
            Initialize(character, stats, Ability.None, calcOpts);
#endif
        }
Exemplo n.º 17
0
        public AttackModel(Character character, Stats stats, AttackModelMode attackModelMode, CalculationOptionsProtPaladin calcOpts)
#endif
        {
            Character = character;
            CalcOpts  = calcOpts;
#if (RAWR3)
            BossOpts = bossOpts;
#endif
            Stats = stats;
#if (RAWR3)
            DefendTable = new DefendTable(character, stats, calcOpts, bossOpts, true);
            ParryModel  = new ParryModel(character, stats, calcOpts, bossOpts);
#else
            DefendTable = new DefendTable(character, stats, calcOpts, true);
            ParryModel  = new ParryModel(character, stats, calcOpts);
#endif
            _attackModelMode = attackModelMode;

#if (RAWR3)
            Abilities.Add(Ability.None, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.ShieldOfRighteousness, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.HammerOfTheRighteous, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.SealOfVengeance, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.HolyVengeance, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.JudgementOfVengeance, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.SealOfRighteousness, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.JudgementOfRighteousness, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.Exorcism, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.HammerOfWrath, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.AvengersShield, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.HolyShield, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.RetributionAura, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.HolyWrath, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.Consecration, character, stats, calcOpts, bossOpts);
#else
            Abilities.Add(Ability.None, character, stats, calcOpts);
            Abilities.Add(Ability.ShieldOfRighteousness, character, stats, calcOpts);
            Abilities.Add(Ability.HammerOfTheRighteous, character, stats, calcOpts);
            Abilities.Add(Ability.SealOfVengeance, character, stats, calcOpts);
            Abilities.Add(Ability.HolyVengeance, character, stats, calcOpts);
            Abilities.Add(Ability.JudgementOfVengeance, character, stats, calcOpts);
            Abilities.Add(Ability.SealOfRighteousness, character, stats, calcOpts);
            Abilities.Add(Ability.JudgementOfRighteousness, character, stats, calcOpts);
            Abilities.Add(Ability.Exorcism, character, stats, calcOpts);
            Abilities.Add(Ability.HammerOfWrath, character, stats, calcOpts);
            Abilities.Add(Ability.AvengersShield, character, stats, calcOpts);
            Abilities.Add(Ability.HolyShield, character, stats, calcOpts);
            Abilities.Add(Ability.RetributionAura, character, stats, calcOpts);
            Abilities.Add(Ability.HolyWrath, character, stats, calcOpts);
            Abilities.Add(Ability.Consecration, character, stats, calcOpts);
#endif

            Calculate();
        }
Exemplo n.º 18
0
        public DefendModel(Character character, Base.StatsPaladin stats, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
        {
            Character   = character;
            Stats       = stats;
            CalcOpts    = calcOpts;
            BossOpts    = bossOpts;

            ParryModel = new ParryModel(character, stats, calcOpts, bossOpts);
            DefendTable = new DefendTable(character, stats, calcOpts, bossOpts);
            Calculate();
        }
Exemplo n.º 19
0
        public DefendModel(Character character, Base.StatsPaladin stats, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
        {
            Character = character;
            Stats     = stats;
            CalcOpts  = calcOpts;
            BossOpts  = bossOpts;

            ParryModel  = new ParryModel(character, stats, calcOpts, bossOpts);
            DefendTable = new DefendTable(character, stats, calcOpts, bossOpts);
            Calculate();
        }
Exemplo n.º 20
0
 public void LoadCalculationOptions()
 {
     _loadingCalculationOptions = true;
     if (Character.CalculationOptions == null)
     {
         Character.CalculationOptions = new CalculationOptionsProtPaladin();
     }
     calcOpts = Character.CalculationOptions as CalculationOptionsProtPaladin;
     // Model Specific Code
     //
     _loadingCalculationOptions = false;
 }
Exemplo n.º 21
0
        protected void Initialize(Character character, Stats stats, Ability ability, CalculationOptionsProtPaladin calcOpts)
#endif
        {
            Character = character;
            CalcOpts  = calcOpts;
#if (RAWR3)
            BossOpts = bossOpts;
#endif
            Stats   = stats;
            Ability = ability;
            Calculate();
        }
Exemplo n.º 22
0
        public ParryModel(Character character, Stats stats, CalculationOptionsProtPaladin calcOpts)
        {
#endif
            Character = character;
            Stats     = stats;
            CalcOpts  = calcOpts;
#if (RAWR3)
            AttackTable = new AttackTable(character, stats, calcOpts, bossOpts);
            DefendTable = new DefendTable(character, stats, calcOpts, bossOpts, true);
#else
            AttackTable = new AttackTable(character, stats, calcOpts);
            DefendTable = new DefendTable(character, stats, calcOpts, true);
#endif
            Calculate();
        }
Exemplo n.º 23
0
 private void radioButtonSealChoice_CheckedChanged(object sender, EventArgs e)
 {
     if (!_loadingCalculationOptions)
     {
         CalculationOptionsProtPaladin calcOpts = Character.CalculationOptions as CalculationOptionsProtPaladin;
         if (radioButtonSoR.Checked)
         {
             calcOpts.SealChoice = "Seal of Righteousness";
         }
         else
         {
             calcOpts.SealChoice = "Seal of Vengeance";
         }
         Character.OnCalculationsInvalidated();
     }
 }
Exemplo n.º 24
0
        public DefendModel(Character character, Stats stats, CalculationOptionsProtPaladin calcOpts, bool useHolyShield)
#endif
        {
            Character = character;
            Stats     = stats;
            CalcOpts  = calcOpts;
#if (RAWR3)
            BossOpts = bossOpts;
#endif

#if (RAWR3)
            ParryModel  = new ParryModel(character, stats, calcOpts, bossOpts);
            DefendTable = new DefendTable(character, stats, calcOpts, bossOpts, useHolyShield);
#else
            ParryModel  = new ParryModel(character, stats, calcOpts);
            DefendTable = new DefendTable(character, stats, calcOpts, useHolyShield);
#endif
            Calculate();
        }
Exemplo n.º 25
0
        private void radioButton_CheckedChanged(object sender, EventArgs e)
        {
            if (!_loadingCalculationOptions)
            {
                CalculationOptionsProtPaladin calcOpts = Character.CalculationOptions as CalculationOptionsProtPaladin;
                if (radioButtonTankPoints.Checked)
                {
                    calcOpts.RankingMode      = 2;
                    trackBarThreatScale.Value = 100;
                }
                else if (radioButtonBurstTime.Checked)
                {
                    calcOpts.RankingMode      = 3;
                    trackBarThreatScale.Value = 0;
                }
                else if (radioButtonDamageOutput.Checked)
                {
                    calcOpts.RankingMode      = 4;
                    trackBarThreatScale.Value = 100;
                }
                else if (radioButtonProtWarrMode.Checked)
                {
                    calcOpts.RankingMode      = 5;
                    trackBarThreatScale.Value = 100;
                }
                else if (radioButtonDamageTakenMode.Checked)
                {
                    calcOpts.RankingMode      = 6;
                    trackBarThreatScale.Value = 100;
                }
                else
                {
                    calcOpts.RankingMode      = 1;
                    trackBarThreatScale.Value = 100;
                }
                trackBarThreatScale.Enabled     = labelThreatScale.Enabled = (calcOpts.RankingMode != 4);
                trackBarMitigationScale.Enabled = labelMitigationScale.Enabled = (calcOpts.RankingMode == 1) || (calcOpts.RankingMode == 5) || (calcOpts.RankingMode == 6);

                Character.OnCalculationsInvalidated();
            }
        }
Exemplo n.º 26
0
        public AbilityModel(Character character, Base.StatsPaladin stats, Ability ability, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
        {
            Character = character;
            Stats     = stats;
            Ability   = ability;
            CalcOpts  = calcOpts;
            BossOpts  = bossOpts;

            Talents     = Character.PaladinTalents;
            AttackTable = new AttackTable(character, stats, ability, CalcOpts, BossOpts);

            if (!Lookup.IsSpell(Ability))
            {
                ArmorReduction = Lookup.EffectiveTargetArmorReduction(Stats.ArmorPenetration, BossOpts.Armor, BossOpts.Level);
            }

            Name = Lookup.Name(Ability);

            CalculateDamage();
            CalculateThreat();
        }
Exemplo n.º 27
0
        public override Stats GetCharacterStats(Character character, Item additionalItem)
        {
            CalculationOptionsProtPaladin calcOpts = character.CalculationOptions as CalculationOptionsProtPaladin;
            if (calcOpts == null) calcOpts = new CalculationOptionsProtPaladin();

            BossOptions bossOpts = character.BossOptions;
            if (bossOpts == null) bossOpts = new BossOptions();

            // Make sure there is at least one attack in the list.
            // If there's not, add a Default Melee Attack for processing
            if (bossOpts.Attacks.Count < 1)
            {
                character.IsLoading = true;
                bossOpts.DamagingTargs = true;
                bossOpts.Attacks.Add(BossHandler.ADefaultMeleeAttack);
                character.IsLoading = false;
            }
            // Make sure there is a default melee attack
            // If the above processed, there will be one so this won't have to process
            // If the above didn't process and there isn't one, add one now
            if (bossOpts.DefaultMeleeAttack == null)
            {
                character.IsLoading = true;
                bossOpts.DamagingTargs = true;
                bossOpts.Attacks.Add(BossHandler.ADefaultMeleeAttack);
                character.IsLoading = false;
            }

            return GetCharacterStats(character, additionalItem, calcOpts, bossOpts);
        }
Exemplo n.º 28
0
        public StatsPaladin GetCharacterStats(Character character, Item additionalItem, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
        {
            PaladinTalents talents = character.PaladinTalents;

            Stats statsBase = BaseStats.GetBaseStats(character.Level, CharacterClass.Paladin, character.Race);
            statsBase.Expertise += BaseStats.GetRacialExpertise(character, ItemSlot.MainHand);


            Stats statsBuffs = GetBuffsStats(character, calcOpts);
            Stats statsItems = GetItemStats(character, additionalItem, calcOpts);
            Stats statsTalents = new Stats()
            {
                BaseArmorMultiplier = talents.Toughness * 0.1f / 3f,
                BonusStaminaMultiplier = 0.15f // Touched by the Light
            };
            Stats statsGearEnchantsBuffs = new Stats();
            statsGearEnchantsBuffs.Accumulate(statsItems);
            statsGearEnchantsBuffs.Accumulate(statsBuffs);
            StatsPaladin statsTotal = new StatsPaladin();
            statsTotal.Accumulate(statsBase);
            statsTotal.Accumulate(statsItems);
            statsTotal.Accumulate(statsBuffs);
            statsTotal.Accumulate(statsTalents);

            int T11count;
            character.SetBonusCount.TryGetValue("Reinforced Sapphirium Battlearmor", out T11count);
            if (T11count >= 2) { statsTotal.BonusDamageMultiplierCrusaderStrike = 0.05f; }
            if (T11count >= 4) { statsTotal.BonusDurationMultiplierGuardianOfAncientKings = 0.50f; }
            int T12count;
            character.SetBonusCount.TryGetValue("Battlearmor of Immolation", out T12count);
            if (T12count >= 2) { statsTotal.BonusDamageShieldofRighteous = 0.20f; }
            if (T12count >= 4) {
                statsBuffs.AddSpecialEffect(new SpecialEffect(Trigger.DivineProtection,
                    new Stats() { Parry = 0.12f, },
                    10f, 60f));
            }

            statsTotal.Intellect = (float)Math.Floor(statsBase.Intellect * (1.0f + statsTalents.BonusIntellectMultiplier));
            statsTotal.Intellect += (float)Math.Floor((statsItems.Intellect + statsBuffs.Intellect) * (1.0f + statsTalents.BonusIntellectMultiplier));

            statsTotal.BaseAgility = statsBase.Agility + statsTalents.Agility;

            statsTotal.Stamina = (float)Math.Floor(statsBase.Stamina
                                    + statsItems.Stamina
                                    + statsBuffs.Stamina);
            statsTotal.Stamina = (float)Math.Floor(statsTotal.Stamina
                                    * (1.0f + statsTotal.BonusStaminaMultiplier)
                                    * (Character.ValidateArmorSpecialization(character, ItemType.Plate) ? 1.05f : 1f)); // Plate specialization

            statsTotal.Strength = (float)Math.Floor((statsBase.Strength + statsTalents.Strength) * (1.0f + statsTotal.BonusStrengthMultiplier));
            statsTotal.Strength += (float)Math.Floor((statsItems.Strength + statsBuffs.Strength) * (1.0f + statsTotal.BonusStrengthMultiplier));

            statsTotal.ParryRating += (float)Math.Floor((statsTotal.Strength - statsBase.Strength) * 0.27f);

            statsTotal.SpellPower = statsTotal.Strength * 0.60f; // Touched by the Light
            statsTotal.SpellPower += statsTotal.Intellect - 10f;

            if (talents.GlyphOfSealOfTruth && calcOpts.SealChoice == "Seal of Truth")
            {
                statsTotal.Expertise += 10.0f;
            }
            statsTotal.Agility = (float)Math.Floor((statsBase.Agility + statsTalents.Agility) * (1.0f + statsTotal.BonusAgilityMultiplier));
            statsTotal.Agility += (float)Math.Floor((statsItems.Agility + statsBuffs.Agility) * (1.0f + statsTotal.BonusAgilityMultiplier));
            statsTotal.Health += StatConversion.GetHealthFromStamina(statsTotal.Stamina, CharacterClass.Paladin);

            statsTotal.Health *= 1f + statsTotal.BonusHealthMultiplier;
            statsTotal.Mana += StatConversion.GetManaFromIntellect(statsTotal.Intellect, CharacterClass.Paladin) * (1f + statsTotal.BonusManaMultiplier);

            // Armor
            statsTotal.Armor  = (float)Math.Floor(statsTotal.Armor * (1f + statsTotal.BaseArmorMultiplier));
            statsTotal.Armor += (float)Math.Floor(statsTotal.BonusArmor * (1f + statsTotal.BonusArmorMultiplier));

            statsTotal.AttackPower += ((statsTotal.Strength - 10f) * 2f);
            statsTotal.AttackPower = (float)Math.Floor(statsTotal.AttackPower * (1f + statsTotal.BonusAttackPowerMultiplier));
            statsTotal.NatureResistance += statsTotal.NatureResistanceBuff;
            statsTotal.FireResistance += statsTotal.FireResistanceBuff;
            statsTotal.FrostResistance += statsTotal.FrostResistanceBuff;
            statsTotal.ShadowResistance += statsTotal.ShadowResistanceBuff;
            statsTotal.ArcaneResistance += statsTotal.ArcaneResistanceBuff;
            //statsTotal.BonusCritDamageMultiplier = statsBase.BonusCritDamageMultiplier + statsGearEnchantsBuffs.BonusCritDamageMultiplier;
            statsTotal.CritRating = statsBase.CritRating + statsGearEnchantsBuffs.CritRating;
            statsTotal.ExpertiseRating = statsBase.ExpertiseRating + statsGearEnchantsBuffs.ExpertiseRating;
            statsTotal.HasteRating = statsBase.HasteRating + statsGearEnchantsBuffs.HasteRating;
            statsTotal.HitRating = statsBase.HitRating + statsGearEnchantsBuffs.HitRating;
            statsTotal.MasteryRating = statsBase.MasteryRating + statsGearEnchantsBuffs.MasteryRating;
            statsTotal.BlockRating = statsBase.BlockRating + statsGearEnchantsBuffs.BlockRating;
            statsTotal.WeaponDamage += Lookup.WeaponDamage(character, statsTotal.AttackPower, false);
            //statsTotal.ExposeWeakness = statsBase.ExposeWeakness + statsGearEnchantsBuffs.ExposeWeakness; // Nerfed in 3.1

            // Calculate Procs and Special Effects
            statsTotal.Accumulate(GetSpecialEffectStats(character, statsTotal, calcOpts, bossOpts));

            return statsTotal;
        }
Exemplo n.º 29
0
        // Original code from CalculationsBear, thanks Astrylian!
        private float CapSurvival(float survivalScore, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
        {
            double survivalCap = (double)(bossOpts.DefaultMeleeAttack.DamagePerHit * calcOpts.HitsToSurvive) / 1000d;
            double survivalRaw = (double)survivalScore / 1000d;

            //Implement Survival Soft Cap
            if (survivalRaw <= survivalCap) {
                return survivalScore;
            } else {
                double x = survivalRaw;
                double cap = survivalCap;
                double fourToTheNegativeFourThirds = Math.Pow(4d, -4d / 3d);
                double topLeft = Math.Pow(((x - cap) / cap) + fourToTheNegativeFourThirds, 1d / 4d);
                double topRight = Math.Pow(fourToTheNegativeFourThirds, 1d / 4d);
                double fracTop = topLeft - topRight;
                double fraction = fracTop / 2d;
                double y = (cap * fraction + cap);
                return 1000f * (float)y;
            }
        }
Exemplo n.º 30
0
 public Stats GetItemStats(Character character, Item additionalItem, CalculationOptionsProtPaladin options)
 {
     Stats statsItems = base.GetItemStats(character, additionalItem);
     return statsItems;
 }
Exemplo n.º 31
0
 public DefendTable(Character character, Stats stats, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
 {
     Initialize(character, stats, Ability.MeleeSwing, calcOpts, bossOpts);
 }
Exemplo n.º 32
0
        public Stats GetBuffsStats(Character character, CalculationOptionsProtPaladin calcOpts) {
            List<Buff> removedBuffs = new List<Buff>();
            List<Buff> addedBuffs = new List<Buff>();

            //float hasRelevantBuff;

            #region Passive Ability Auto-Fixing
            // NOTE: THIS CODE IS FROM DPSWARR, PROTPALADIN MAY MAKE USE OF IT EVENTUALLY TO HANDLE CONFLICTS LIKE CONCENTRATION AURA
            // Removes the Trueshot Aura Buff and it's equivalents Unleashed Rage and Abomination's Might if you are
            // maintaining it yourself. We are now calculating this internally for better accuracy and to provide
            // value to relevant talents
            /*{
                hasRelevantBuff = character.HunterTalents.TrueshotAura;
                Buff a = Buff.GetBuffByName("Trueshot Aura");
                Buff b = Buff.GetBuffByName("Unleashed Rage");
                Buff c = Buff.GetBuffByName("Abomination's Might");
                if (hasRelevantBuff > 0)
                {
                    if (character.ActiveBuffs.Contains(a)) { character.ActiveBuffs.Remove(a); removedBuffs.Add(a); }
                    if (character.ActiveBuffs.Contains(b)) { character.ActiveBuffs.Remove(b); removedBuffs.Add(b); }
                    if (character.ActiveBuffs.Contains(c)) { character.ActiveBuffs.Remove(c); removedBuffs.Add(c); }
                }
            }
            // Removes the Hunter's Mark Buff and it's Children 'Glyphed', 'Improved' and 'Both' if you are
            // maintaining it yourself. We are now calculating this internally for better accuracy and to provide
            // value to relevant talents
            {
                hasRelevantBuff = character.HunterTalents.ImprovedHuntersMark
                                + (character.HunterTalents.GlyphOfHuntersMark ? 1 : 0);
                Buff a = Buff.GetBuffByName("Hunter's Mark");
                Buff b = Buff.GetBuffByName("Glyphed Hunter's Mark");
                Buff c = Buff.GetBuffByName("Improved Hunter's Mark");
                Buff d = Buff.GetBuffByName("Improved and Glyphed Hunter's Mark");
                // Since we are doing base Hunter's mark ourselves, we still don't want to double-dip
                if (character.ActiveBuffs.Contains(a)) { character.ActiveBuffs.Remove(a); /*removedBuffs.Add(a);*//* }
                // If we have an enhanced Hunter's Mark, kill the Buff
                if (hasRelevantBuff > 0)
                {
                    if (character.ActiveBuffs.Contains(b)) { character.ActiveBuffs.Remove(b); /*removedBuffs.Add(b);*//* }
                    if (character.ActiveBuffs.Contains(c)) { character.ActiveBuffs.Remove(c); /*removedBuffs.Add(c);*//* }
                    if (character.ActiveBuffs.Contains(d)) { character.ActiveBuffs.Remove(d); /*removedBuffs.Add(c);*//* }
                }
            }*/
            #endregion

            Stats statsBuffs = base.GetBuffsStats(character.ActiveBuffs, character.SetBonusCount);

            foreach (Buff b in removedBuffs) {
                character.ActiveBuffsAdd(b);
            }
            foreach (Buff b in addedBuffs)
            {
                character.ActiveBuffs.Remove(b);
            }

            return statsBuffs;
        }
Exemplo n.º 33
0
        private void GetSpecialEffectsStats_Child(Dictionary<Trigger, float> triggerIntervals, Dictionary<Trigger, float> triggerChances,
            float weaponSpeed, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts, StatsPaladin stats, ref StatsPaladin statsSpecialEffects)
        {
            StatsPaladin effectsToAdd = new StatsPaladin();
            float uptime = 0f;
            foreach (SpecialEffect effect in stats.SpecialEffects()) {
                switch (effect.Trigger) {
                    case Trigger.Use: {
                        if (calcOpts.TrinketOnUseHandling != "Ignore") {
                            if (calcOpts.TrinketOnUseHandling == "Active") {
                                statsSpecialEffects.Accumulate(effect.Stats);
                            } else {
                                effectsToAdd.Clear();
                                effectsToAdd.Accumulate(effect.GetAverageStats(0f, 1f, weaponSpeed, bossOpts.BerserkTimer));
                                // Health on Use Effects are never averaged.
                                effectsToAdd.BattlemasterHealthProc = 0.0f;
                                effectsToAdd.Health = 0.0f;
                                statsSpecialEffects.Accumulate(effectsToAdd);
                            }

                            // Recursive Effects
                            foreach (SpecialEffect childEffect in effect.Stats.SpecialEffects()) {
                                effectsToAdd.Clear();
                                GetSpecialEffectsStats_Child(triggerIntervals, triggerChances, weaponSpeed, calcOpts, bossOpts, stats, ref effectsToAdd);
                                statsSpecialEffects.Accumulate(effectsToAdd, effect.GetAverageUptime(0.0f, 1.0f));
                            }
                        }
                        break;
                    }
                    case Trigger.MeleeAttack:
                    case Trigger.PhysicalAttack:
                    case Trigger.MeleeHit:
                    case Trigger.PhysicalHit:
                    case Trigger.MeleeCrit:
                    case Trigger.PhysicalCrit:
                    case Trigger.DamageSpellCrit:
                    case Trigger.DamageSpellHit:
                    case Trigger.DoTTick:
                    case Trigger.DamageOrHealingDone: // Need to add Self-Heals
                    case Trigger.DamageDone:
                    case Trigger.JudgementHit:
                    case Trigger.SpellCast:
                    case Trigger.DamageSpellCast:
                    case Trigger.DamageTaken:
                    case Trigger.DamageTakenPhysical:
                    case Trigger.DamageTakenPutsMeBelow35PercHealth:
                    case Trigger.DivineProtection:
                        if (effect.MaxStack != 1) {
                            uptime = effect.GetAverageStackSize(triggerIntervals[effect.Trigger], triggerChances[effect.Trigger], weaponSpeed, bossOpts.BerserkTimer);
                        } else {
                            uptime = effect.GetAverageUptime(triggerIntervals[effect.Trigger], triggerChances[effect.Trigger], weaponSpeed, bossOpts.BerserkTimer);
                        }
                        statsSpecialEffects.Accumulate(effect.Stats, uptime);
                        break;
                }
            }
        }
Exemplo n.º 34
0
 public void Add(Ability ability, Character character, Stats stats, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
Exemplo n.º 35
0
 public AttackTable(Character character, Stats stats, Ability ability, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
 {
     Initialize(character, stats, ability, calcOpts, bossOpts);
 }
Exemplo n.º 36
0
        private void CreateTriggers(AttackModel am, Character character, Stats stats, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts, out Dictionary<Trigger, float> triggerIntervals, out Dictionary<Trigger, float> triggerChances)
        {
            triggerIntervals = new Dictionary<Trigger, float>();
            triggerChances = new Dictionary<Trigger, float>();

            float intervalRotation = 9.0f;

            triggerIntervals[Trigger.MeleeAttack] =
            triggerIntervals[Trigger.PhysicalAttack] =
            triggerIntervals[Trigger.MeleeHit] = 
            triggerIntervals[Trigger.PhysicalHit]                        = 
            triggerIntervals[Trigger.MeleeCrit]                          = 
            triggerIntervals[Trigger.PhysicalCrit]                       = Lookup.WeaponSpeed(character, stats); // + calcOptsTargetsHotR / intervalHotR;
            // 939 has 1 direct damage spell cast in 9 seconds.
            triggerIntervals[Trigger.DamageSpellCast]                    =
            triggerIntervals[Trigger.DamageSpellHit]                     =
            triggerIntervals[Trigger.DamageSpellCrit]                    = 1f / intervalRotation;
            triggerIntervals[Trigger.DoTTick]                            = 1f;
            triggerIntervals[Trigger.SpellCast]                          = 1.5f;
            // 939 assumes casting a spell every gcd. Changing auras, and casting a blessing is disregarded.
            triggerIntervals[Trigger.DamageOrHealingDone]                =
            triggerIntervals[Trigger.DamageDone]                         = 1f / (1f / triggerIntervals[Trigger.MeleeHit] + 1f / triggerIntervals[Trigger.SpellCast]);
            triggerIntervals[Trigger.JudgementHit]                       = 9.0f;
            triggerIntervals[Trigger.DamageTakenPhysical]                =
            triggerIntervals[Trigger.DamageTakenPutsMeBelow35PercHealth] = 
            triggerIntervals[Trigger.DamageTaken]                        = (1.0f / am.AttackerHitsPerSecond);
            triggerIntervals[Trigger.DivineProtection] = 60f;

            // temporary combat table, used for the implementation of special effects.
            float hitBonusPhysical = StatConversion.GetPhysicalHitFromRating(stats.HitRating, CharacterClass.Paladin) + stats.PhysicalHit;
            float hitBonusSpell = StatConversion.GetSpellHitFromRating(stats.HitRating, CharacterClass.Paladin) + stats.SpellHit;
            float expertiseBonus = StatConversion.GetDodgeParryReducFromExpertise(StatConversion.GetExpertiseFromRating(stats.ExpertiseRating, CharacterClass.Paladin) + stats.Expertise, CharacterClass.Paladin);
            float chanceMissSpell = Math.Max(0f, StatConversion.GetSpellMiss(character.Level - bossOpts.Level, false) - hitBonusSpell);
            float chanceMissPhysical = Math.Max(0f, StatConversion.WHITE_MISS_CHANCE_CAP[bossOpts.Level - character.Level] - hitBonusPhysical);
            float chanceMissDodge = Math.Max(0f, StatConversion.WHITE_DODGE_CHANCE_CAP[bossOpts.Level - character.Level] - expertiseBonus);
            float chanceMissParry = Math.Max(0f, StatConversion.WHITE_PARRY_CHANCE_CAP[bossOpts.Level - character.Level] - expertiseBonus);
            float chanceMissPhysicalAny = chanceMissPhysical + chanceMissDodge + chanceMissParry;

            triggerChances[Trigger.MeleeAttack] =
            triggerChances[Trigger.PhysicalAttack] = 1.0f;
            triggerChances[Trigger.MeleeHit] = 
            triggerChances[Trigger.PhysicalHit] = 1.0f - chanceMissPhysicalAny;
            triggerChances[Trigger.MeleeCrit] = 
            triggerChances[Trigger.PhysicalCrit] = Math.Min(1f, Math.Max(0, StatConversion.GetPhysicalCritFromRating(stats.CritRating, CharacterClass.Paladin)
                                                 + StatConversion.GetPhysicalCritFromAgility(stats.Agility, CharacterClass.Paladin)
                                                 + stats.PhysicalCrit
                                                 + StatConversion.NPC_LEVEL_CRIT_MOD[bossOpts.Level - character.Level]));
            triggerChances[Trigger.DamageSpellCrit] = StatConversion.GetSpellCritFromRating(stats.CritRating, CharacterClass.Paladin)
                                       + StatConversion.GetSpellCritFromIntellect(stats.Intellect, CharacterClass.Paladin)
                                       + stats.SpellCrit + stats.SpellCritOnTarget
                                       - (0.006f * (bossOpts.Level - character.Level) + (bossOpts.Level == 88 ? 0.03f : 0.0f));
            triggerChances[Trigger.DamageSpellHit] = 1.0f - chanceMissSpell;
            triggerChances[Trigger.DoTTick] = triggerChances[Trigger.DamageSpellHit] * (character.PaladinTalents.GlyphOfConsecration ? 1.0f : 16.0f / 18.0f); // 16 ticks in 18 seconds of 9696 rotation. cba with cons. glyph atm.
            triggerChances[Trigger.DamageOrHealingDone] =
            triggerChances[Trigger.DamageDone] = (triggerIntervals[Trigger.MeleeHit] * triggerChances[Trigger.PhysicalHit] + triggerIntervals[Trigger.SpellCast] * triggerChances[Trigger.DamageSpellHit])
                                               / (triggerIntervals[Trigger.MeleeHit] + triggerIntervals[Trigger.SpellCast]);
            triggerChances[Trigger.JudgementHit] =
            triggerChances[Trigger.SpellCast] =
            triggerChances[Trigger.DamageSpellCast] = 
            triggerChances[Trigger.DamageTaken] =
            triggerChances[Trigger.DamageTakenPhysical] = 1f;
            triggerChances[Trigger.DamageTakenPutsMeBelow35PercHealth] = 0.35f;
            triggerChances[Trigger.DivineProtection] = 1f;
        }
Exemplo n.º 37
0
 public DefendTable(Character character, Stats stats, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
 {
     Initialize(character, stats, Ability.MeleeSwing, calcOpts, bossOpts);
 }
Exemplo n.º 38
0
 protected void Initialize(Character character, Stats stats, Ability ability, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
Exemplo n.º 39
0
 public DefendModel(Character character, Stats stats, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts, bool useHolyShield)
Exemplo n.º 40
0
 public ParryModel(Character character, Stats stats, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
 {
Exemplo n.º 41
0
 public AbilityModel(Character character, Stats stats, Ability ability, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
 {
Exemplo n.º 42
0
        private Stats GetSpecialEffectStats(Character character, StatsPaladin stats, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
        {
            StatsPaladin statsSpecialEffects = new StatsPaladin();

            float weaponSpeed = 1.0f;
            if (character.MainHand != null)
                weaponSpeed = character.MainHand.Speed;

            AttackModel am = new AttackModel(character, stats, calcOpts, bossOpts);

            Dictionary<Trigger, float> triggerIntervals;
            Dictionary<Trigger, float> triggerChances;
            CreateTriggers(am, character, stats, calcOpts, bossOpts, out triggerIntervals, out triggerChances);

            GetSpecialEffectsStats_Child(triggerIntervals, triggerChances, weaponSpeed, calcOpts, bossOpts, stats, ref statsSpecialEffects);

            // Darkmoon card greatness & Paragon procs
            // These should always increase strength, which is going to be the Paladin's top stat outside of stamina
            statsSpecialEffects.Strength += statsSpecialEffects.HighestStat + statsSpecialEffects.Paragon;
            statsSpecialEffects.HighestStat = 0;
            statsSpecialEffects.Paragon = 0;
            if (statsSpecialEffects.HighestSecondaryStat > 0) {
                float paragon = statsSpecialEffects.HighestSecondaryStat;
                statsSpecialEffects.HighestSecondaryStat = 0;
                if ((statsSpecialEffects.CritRating > statsSpecialEffects.HasteRating) && (statsSpecialEffects.CritRating > statsSpecialEffects.MasteryRating))
                    statsSpecialEffects.CritRating += paragon;
                else if ((statsSpecialEffects.HasteRating > statsSpecialEffects.CritRating) && (statsSpecialEffects.HasteRating > statsSpecialEffects.MasteryRating))
                    statsSpecialEffects.HasteRating += paragon;
                else
                    statsSpecialEffects.MasteryRating += paragon;
            }

            // Base Stats
            statsSpecialEffects.Stamina = (float)Math.Floor(statsSpecialEffects.Stamina * (1.0f + stats.BonusStaminaMultiplier));
            statsSpecialEffects.Strength = (float)Math.Floor(statsSpecialEffects.Strength * (1.0f + stats.BonusStrengthMultiplier));
            statsSpecialEffects.Agility = (float)Math.Floor(statsSpecialEffects.Agility * (1.0f + stats.BonusAgilityMultiplier));
            statsSpecialEffects.Health += (float)Math.Floor(statsSpecialEffects.Stamina * 10.0f) + (float)Math.Floor(statsSpecialEffects.BattlemasterHealthProc);

            // Defensive Stats
            statsSpecialEffects.Armor = (float)Math.Floor(statsSpecialEffects.Armor * (1f + stats.BaseArmorMultiplier + statsSpecialEffects.BaseArmorMultiplier));
            statsSpecialEffects.BonusArmor = (float)Math.Floor(statsSpecialEffects.BonusArmor * (1.0f + stats.BonusArmorMultiplier + statsSpecialEffects.BonusArmorMultiplier));
            statsSpecialEffects.Armor += statsSpecialEffects.BonusArmor;
 
            // Offensive Stats
            statsSpecialEffects.AttackPower += statsSpecialEffects.Strength * 2.0f;
            statsSpecialEffects.AttackPower = (float)Math.Floor(statsSpecialEffects.AttackPower * (1.0f + stats.BonusAttackPowerMultiplier + statsSpecialEffects.BonusAttackPowerMultiplier));

            return statsSpecialEffects;
        }
Exemplo n.º 43
0
 public AttackTable(Character character, Stats stats, Ability ability, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
 {
     Initialize(character, stats, ability, calcOpts, bossOpts);
 }
Exemplo n.º 44
0
 public AttackTable(Character character, Stats stats, Ability ability, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
Exemplo n.º 45
0
        public AttackModel(Character character, Base.StatsPaladin stats, CalculationOptionsProtPaladin calcOpts, BossOptions bossOpts)
        {
            Character        = character;
            CalcOpts         = calcOpts;
            BossOpts         = bossOpts;
            Stats            = stats;
            DefendTable      = new DefendTable(character, stats, calcOpts, bossOpts);
            ParryModel       = new ParryModel(character, stats, calcOpts, bossOpts);
            
            Abilities.Add(Ability.AvengersShield, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.CensureTick, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.Consecration, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.CrusaderStrike, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.HammerOfTheRighteous, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.HammerOfTheRighteousProc, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.HammerOfWrath, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.HolyWrath, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.JudgementOfRighteousness, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.JudgementOfTruth, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.MeleeSwing, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.RetributionAura, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.SealOfRighteousness, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.SealOfTruth, character, stats, calcOpts, bossOpts);
            Abilities.Add(Ability.ShieldOfTheRighteous, character, stats, calcOpts, bossOpts);

            Calculate();
        }