Example #1
0
 protected void Initialize(Character character, StatsHunter stats, CombatFactors cf, CalculationOptionsHunter co,
     Skills.Ability ability, bool useSpellHit, bool alwaysHit)
 {
     Char = character;
     StatS = stats;
     calcOpts = co;
     combatFactors = cf;
     Abil = ability;
     if (Abil == null)
     {
         isWhite = true;
     }
     else
     {
         Abil.combatFactors = combatFactors;
     }
     PetAbil = PetAttacks.None;
     this.useSpellHit = useSpellHit;
     /*// Defaults
     Miss 
     Dodge
     Parry
     Block
     Glance
     Critical
     Hit*/
     // Start a calc            
     if (alwaysHit) CalculateAlwaysHit();
     else Calculate();            
 }
Example #2
0
        //HunterRatings ratings;


        public ShotRotationCalculator(Character character, CharacterCalculationsHunter calculatedStats, CalculationOptionsHunter options, double totalStaticHaste, double effectiveRAPAgainstMob, double abilitiesCritDmgModifier, double yellowCritDmgModifier, double weaponDamageAverage, double ammoDamage, double talentModifiers)
        {
            //ratings = new HunterRatings();

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

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

            //reducedArmor *= (1f - character.HunterTalents.PiercingShots * 0.02f);
            
            //this.talentedArmorReduction = 1f - StatConversion.GetArmorDamageReduction(character.Level, targetArmor,
			//	calculatedStats.BasicStats.ArmorPenetration, character.HunterTalents.PiercingShots * 0.02f,
			//	calculatedStats.BasicStats.ArmorPenetrationRating);
			//this.talentedArmorReduction = 1.0 - (targetArmor / (467.5 * options.TargetLevel + targetArmor - 22167.5));
        }
Example #3
0
 public RotationTest(Character character, CharacterCalculationsHunter calculatedStats, CalculationOptionsHunter calcOpts, BossOptions bossOpts)
 {
     this.character = character;
     this.CalcOpts = calcOpts;
     this.BossOpts = bossOpts;
     this.calculatedStats = calculatedStats;
     // 091109 Drizz: Added
     //this.calculatedStats.sequence = "Time  :Shot          :CastTime:Done   :CD Until" + Environment.NewLine;
 }
Example #4
0
        public PetCalculations(Character character, CharacterCalculationsHunter calculatedStats, CalculationOptionsHunter calcopts, BossOptions bossOpts,
            StatsHunter hunterStats)
        {
            this.character = character;
            this.calculatedStats = calculatedStats;
            this.CalcOpts = calcopts;
            this.BossOpts = bossOpts;
            this.PetTalents = calcopts.PetTalents;
            this.Talents = character.HunterTalents;
            this.HunterStats = hunterStats;

            PetStats = new StatsHunter();
        }
Example #5
0
 public CombatFactors(Character character, StatsHunter stats, CalculationOptionsHunter calcOpts, BossOptions bossOpts)
 {
     Char = character;
     if (Char != null)
     {
         if (Char.Ranged != null)
             RW = Char.Ranged.Item;
         else
             RW = new Knuckles();
         if (Char.HunterTalents != null)
             Talents = Char.HunterTalents;
         else
             Talents = new HunterTalents();
     }
     CalcOpts = (calcOpts == null ? new CalculationOptionsHunter() : calcOpts);
     BossOpts = (bossOpts == null ? new BossOptions() : bossOpts);
     StatS = stats;
     InvalidateCache();
     // Optimizations
     
     //Set_c_values();
 }
        public StatsHunter GetBuffsStats(Character character, CalculationOptionsHunter calcOpts) {
            List<Buff> removedBuffs = new List<Buff>();
            List<Buff> addedBuffs = new List<Buff>();

            List<Buff> buffGroup = new List<Buff>();
            #region Maintenance Auto-Fixing
            /* Removes the Sunder Armor if you are maintaining it yourself
             * Also removes Acid Spit and Expose Armor
             * We are now calculating this internally for better accuracy and to provide value to relevant talents
             * if (calcOpts.Maintenance[(int)CalculationOptionsDPSWarr.Maintenances.SunderArmor_])
             * {
             *   buffGroup.Clear();
             *   buffGroup.Add(Buff.GetBuffByName("Sunder Armor"));
             *   buffGroup.Add(Buff.GetBuffByName("Acid Spit"));
             *   buffGroup.Add(Buff.GetBuffByName("Expose Armor"));
             *   MaintBuffHelper(buffGroup, character, removedBuffs);
             * }
             */
            #endregion

            #region Passive Ability Auto-Fixing
            // 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
            if (character.HunterTalents.TrueshotAura > 0) {
                buffGroup.Clear();
                buffGroup.Add(Buff.GetBuffByName("Trueshot Aura"));
                buffGroup.Add(Buff.GetBuffByName("Unleashed Rage"));
                buffGroup.Add(Buff.GetBuffByName("Abomination's Might"));
                MaintBuffHelper(buffGroup, character, removedBuffs);
            }

            // Removes the Ferocious Inspiration Buff and it's equivalents Sanctified Retribution and Arcane Tactics if you are
            // maintaining it yourself. We are now calculating this internally for better accuracy and to provide
            // value to relevant talents
            if (character.HunterTalents.FerociousInspiration > 0) {
                buffGroup.Clear();
                buffGroup.Add(Buff.GetBuffByName("Ferocious Inspiration"));
                buffGroup.Add(Buff.GetBuffByName("Sanctified Retribution"));
                buffGroup.Add(Buff.GetBuffByName("Arcane Tactics"));
                MaintBuffHelper(buffGroup, character, removedBuffs);
            }


            // Removes the Hunting Party Buff and it's equivalents Improved Icy Talons and Windfury Totem if you are
            // maintaining it yourself. We are now calculating this internally for better accuracy and to provide
            // value to relevant talents
            if (character.HunterTalents.HuntingParty > 0)
            {
                buffGroup.Clear();
                buffGroup.Add(Buff.GetBuffByName("Hunting Party"));
                buffGroup.Add(Buff.GetBuffByName("Improved Icy Talons"));
                buffGroup.Add(Buff.GetBuffByName("Windfury Totem"));
                MaintBuffHelper(buffGroup, character, removedBuffs);
            }

            // Removes the Hunter's Mark if you are
            // maintaining it yourself. We are now calculating this internally for better accuracy and to provide
            // value to relevant talents
            buffGroup.Clear();
            buffGroup.Add(Buff.GetBuffByName("Hunter's Mark"));
            MaintBuffHelper(buffGroup, character, removedBuffs);
            #endregion

            StatsHunter statsBuffs = new StatsHunter();
            statsBuffs.Accumulate(GetBuffsStats(character.ActiveBuffs));
            AccumulateSetBonusStats(statsBuffs, character.SetBonusCount);

            #region PvP Set Bonus
            int PvPcount;
            character.SetBonusCount.TryGetValue("Gladiator's Pursuit", out PvPcount);
            if (PvPcount >= 2)
            {
                statsBuffs.Resilience += 400f;
                statsBuffs.Agility += 70f;
            }
            if (PvPcount >= 4)
            {
                statsBuffs.BonusFocusRegenMultiplier = 0.05f;
                statsBuffs.Agility += 90f;
            }
            #endregion

            #region Tier 11 Set Bonus
            int T11count;
            character.SetBonusCount.TryGetValue("Lightning-Charged Battlegear", out T11count);
            if (T11count >= 2)
            {
                statsBuffs.BonusSerpentStingCritChance = 0.05f;
            }
            if (T11count >= 4)
            {
                statsBuffs.FourPieceTier11 = 0.2f;
            }
            #endregion

            #region Tier 12 Set Bonus
            int T12count;
            character.SetBonusCount.TryGetValue("Flamewaker's Battlegear", out T12count);
            if (T12count >= 2)
            {
                statsBuffs.AddSpecialEffect(_SE_2T12_cs);
                statsBuffs.AddSpecialEffect(_SE_2T12_ss);
            }
            if (T12count >= 4)
            {
                statsBuffs.AddSpecialEffect(_SE_4T12);
            }
            #endregion

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

            return statsBuffs;
        }
        //private static readonly SpecialEffect FuriousHowl = new SpecialEffect(Trigger.Use, new StatsHunter() { AttackPower = 320f, PetAttackPower = 320f, }, 20f, 40f);

        private static void CalculateTriggers(Character character, CharacterCalculationsHunter calculatedStats, StatsHunter statsTotal, CalculationOptionsHunter calcOpts, BossOptions bossOpts, 
            Dictionary<Trigger, float> triggerIntervals, Dictionary<Trigger, float> triggerChances)
        {
            const float GCD = 1f;
            const float GCDpSec = 1f / GCD;
            int levelDif = bossOpts.Level - character.Level;
            float critMOD = StatConversion.NPC_LEVEL_CRIT_MOD[levelDif];
            HunterTalents talents = character.HunterTalents;
            float rangedWeaponSpeed = 2.4f; 
            float rangedWeaponDamage = 1;
            float autoShotSpeed = rangedWeaponSpeed; // Should be the same as rangedWeaponSpeed hasted.
            float autoShotsPerSecond = 1 / autoShotSpeed;
            float specialShotsPerSecond = GCDpSec; // I know it doesn't start w/ a special every GCD, but something to start with more than 0.
            float totalShotsPerSecond = GCDpSec + autoShotsPerSecond; 
            float shotsPerSecondWithoutHawk = 0;
//            RotationTest rotationTest;
            //GenRotation(character, statsTotal, calculatedStats, calcOpts, bossOpts, talents,
            //    out rangedWeaponSpeed, out rangedWeaponDamage, out autoShotSpeed,
            //    out autoShotsPerSecond, out specialShotsPerSecond, out totalShotsPerSecond, out shotsPerSecondWithoutHawk,
            //    out rotationTest);
            float ChanceToMiss = Math.Max(0f, StatConversion.WHITE_MISS_CHANCE_CAP[levelDif] - statsTotal.PhysicalHit);
            float ChanceToSpellMiss = Math.Max(0f, StatConversion.GetSpellMiss(levelDif, false) - statsTotal.SpellHit);

            // TODO: Ensure that we don't have any div by 0 issues here.

            #region Generic
            // Use
            triggerIntervals[Trigger.Use] = 0f; // Should be Effect cooldown.
            triggerChances[Trigger.Use] = 1f;

            // Physical Hit
            triggerIntervals[Trigger.PhysicalAttack] =
            triggerIntervals[Trigger.RangedHit] =
            triggerIntervals[Trigger.PhysicalHit] = 
            triggerIntervals[Trigger.RangedCrit] =
            triggerIntervals[Trigger.PhysicalCrit] = 1f / totalShotsPerSecond; // Note with DOT crits, this may have to be adjusted.

            triggerChances[Trigger.PhysicalAttack] = 
            triggerChances[Trigger.RangedHit] =
            triggerChances[Trigger.PhysicalHit] = (1f - ChanceToMiss);
            triggerChances[Trigger.RangedCrit] =
            triggerChances[Trigger.PhysicalCrit] = Math.Min(1f + critMOD, Math.Max(0f, statsTotal.PhysicalCrit));

            // Dots & damage done.
            triggerIntervals[Trigger.DoTTick] = talents.PiercingShots > 0 ? 1f : 0f; // Also need to add other DOTs into this value. 
            triggerIntervals[Trigger.DamageDone] = Math.Max(0f, 1f / (totalShotsPerSecond + ((talents.PiercingShots > 0 ? 1f : 0f) > 0 ? 1f / (talents.PiercingShots > 0 ? 1f : 0f) : 0f)));
            triggerIntervals[Trigger.DamageOrHealingDone] = Math.Max(0f, 1f / (totalShotsPerSecond + ((talents.PiercingShots > 0 ? 1f : 0f) > 0 ? 1f / (talents.PiercingShots > 0 ? 1f : 0f) : 0f))); // Need to add Self/pet-Heals

            triggerChances[Trigger.DoTTick] = 1f; // This should be up-time on DoTs & PS. 
            triggerChances[Trigger.DamageDone] = 1f;
            triggerChances[Trigger.DamageOrHealingDone] = 1f;

            #endregion 

            #region Pets only
            //triggerIntervals[Trigger.MeleeHit]                              = 
            //triggerIntervals[Trigger.MeleeCrit]                             = Math.Max(0f, calculatedStats.PetCalc.PetCompInterval);
            //triggerIntervals[Trigger.PetClawBiteSmackCrit]                  = Math.Max(0f, calculatedStats.PetCalc.PetClawBiteSmackInterval);

            //triggerChances[Trigger.MeleeHit]                              = calculatedStats.PetCalc.WhAtkTable.AnyLand;
            //triggerChances[Trigger.MeleeCrit]                             = Math.Min(1f + critMOD, Math.Max(0f, calculatedStats.PetCalc.WhAtkTable.Crit));
            //triggerChances[Trigger.PetClawBiteSmackCrit]                  = Math.Min(1f + critMOD, Math.Max(0f, calculatedStats.PetCalc.WhAtkTable.Crit));
            #endregion

            #region Hunter Specific
            triggerIntervals[Trigger.HunterAutoShotHit] = 1f / autoShotsPerSecond;
            triggerIntervals[Trigger.SteadyShotHit] = 0; // calculatedStats.steadyShot.Cd;
            triggerIntervals[Trigger.CobraShotHit] = 0; // calculatedStats.cobraShot.Cd;
            triggerIntervals[Trigger.EnergyOrFocusDropsBelow20PercentOfMax] = 4f; // Approximating as 80% chance every 4 seconds. TODO: Put in some actual method of calculating this

            triggerChances[Trigger.HunterAutoShotHit] = (1f - ChanceToMiss);
            triggerChances[Trigger.SteadyShotHit] = (1f - ChanceToMiss);
            triggerChances[Trigger.CobraShotHit] = (1f - ChanceToMiss);
            triggerChances[Trigger.EnergyOrFocusDropsBelow20PercentOfMax] = 0.80f; // Approximating as 80% chance every 4 seconds. TODO: Put in some actual method of calculating this
            #endregion
        }
        private StatsHunter GetCharacterStats(Character character, Item additionalItem, bool bGetMaxStats)
        {
            StatsHunter statsTotal = new StatsHunter();
            try
            {
                #region NullChecks
                if (null == character)
                {
#if DEBUG
                    throw new NullReferenceException("Character is Null");
#else
                    return statsTotal;
#endif
                }
                CalculationOptionsHunter calcOpts = character.CalculationOptions as CalculationOptionsHunter;
                if (null == calcOpts) { calcOpts = new CalculationOptionsHunter(); }
                HunterTalents talents = character.HunterTalents;
                if (null == talents) { return statsTotal; }
                Specialization tree = GetSpecialization(talents);
                CharacterCalculationsHunter calculatedStats = new CharacterCalculationsHunter();
                if (null == calculatedStats)
                {
#if DEBUG
                    throw new NullReferenceException("Character Calculations is Null");
#else
                    return statsTotal;
#endif
                }
                BossOptions bossOpts = new BossOptions();
                bossOpts = character.BossOptions;
                if (null == bossOpts)
                {
#if DEBUG
                    throw new NullReferenceException("Boss Options is Null");
#else
                    return statsTotal;
#endif
                }
                #endregion

                statsTotal.Accumulate(BaseStats.GetBaseStats(character.Level, CharacterClass.Hunter, character.Race));
                statsTotal.Accumulate(GetItemStats(character, additionalItem));
                AccumulateBuffsStats(statsTotal, character.ActiveBuffs);
                // DO NOT MOVE GetRelevantStats any lower in this progression of functions.
                // It will erase stats specific to hunters.
                statsTotal = GetRelevantStats(statsTotal) as StatsHunter;
                statsTotal.Accumulate(GetTalentStats(character.HunterTalents));

                statsTotal.Stamina = (float)Math.Floor(statsTotal.Stamina * (1f + statsTotal.BonusStaminaMultiplier));
                statsTotal.Agility = (float)Math.Floor(statsTotal.Agility * (1f + statsTotal.BonusAgilityMultiplier));
                calculatedStats.critFromAgi = statsTotal.Agility;
                // Agi bonus to Survival doesn't affect crit?
                if (tree == Specialization.Survival) calculatedStats.critFromAgi /= 1.1f;
                statsTotal.AttackPower += (statsTotal.Agility * 2f); 
                statsTotal.AttackPower = statsTotal.RangedAttackPower = (float)Math.Floor(statsTotal.AttackPower * (1f + statsTotal.BonusAttackPowerMultiplier));
                statsTotal.Health += (float)Math.Floor((statsTotal.Stamina - 20f) * 14f + 20f);
                statsTotal.Health = (float)Math.Floor(statsTotal.Health * (1f + statsTotal.BonusHealthMultiplier));
                statsTotal.Armor = (float)Math.Floor(statsTotal.Armor * (1f + statsTotal.BonusArmorMultiplier)) + statsTotal.BonusArmor;

                statsTotal.NatureResistance += statsTotal.NatureResistanceBuff;
                statsTotal.FireResistance += statsTotal.FireResistanceBuff;
                statsTotal.FrostResistance += statsTotal.FrostResistanceBuff;
                statsTotal.ShadowResistance += statsTotal.ShadowResistanceBuff;
                statsTotal.ArcaneResistance += statsTotal.ArcaneResistanceBuff;

                int targetLevel = bossOpts.Level;
                float hasteBonus = StatConversion.GetPhysicalHasteFromRating(statsTotal.HasteRating, CharacterClass.Hunter);
                statsTotal.RangedHaste = (1f + hasteBonus) * (1f + statsTotal.BonusHasteMultiplier) * (1f + statsTotal.PhysicalHaste) - 1f;
                float hitBonus = StatConversion.GetPhysicalHitFromRating(statsTotal.HitRating) + statsTotal.PhysicalHit;
                float chanceMiss = Math.Max(0f, StatConversion.WHITE_MISS_CHANCE_CAP[targetLevel - character.Level] - hitBonus);
                float chanceAvoided = chanceMiss;

                float rawChanceCrit = StatConversion.GetPhysicalCritFromRating(statsTotal.CritRating)
                                    + StatConversion.GetCritFromAgility(calculatedStats.critFromAgi, CharacterClass.Hunter)
                                    + statsTotal.PhysicalCrit
                                    + StatConversion.NPC_LEVEL_CRIT_MOD[targetLevel - character.Level];
                calculatedStats.critRateOverall = rawChanceCrit * (1f - chanceAvoided);
                float chanceHit = 1f - chanceAvoided;

                if (bGetMaxStats)
                {
                    #region Special Effects
                    StatsHunter statsProcs = new StatsHunter();

                    Dictionary<Trigger, float> triggerIntervals = new Dictionary<Trigger, float>();
                    Dictionary<Trigger, float> triggerChances = new Dictionary<Trigger, float>();

                    CalculateTriggers(character, calculatedStats, statsTotal, calcOpts, bossOpts, triggerIntervals, triggerChances);

                    /*if (calcOpts.PetFamily == PETFAMILY.Wolf
                        && calculatedStats.pet.priorityRotation.getSkillFrequency(PetAttacks.FuriousHowl) > 0)
                    {
                        statsTotal.AddSpecialEffect(FuriousHowl);
                    }
                    */
                    foreach (SpecialEffect effect in statsTotal.SpecialEffects())
                    {
                        statsProcs.Accumulate(getSpecialEffects(effect, triggerIntervals, triggerChances, character));
                    }
                    #region Handle Results of Special Effects
                    // Base Stats
                    statsProcs.Stamina = (float)Math.Floor(statsProcs.Stamina * (1f + statsTotal.BonusStaminaMultiplier) * (1f + statsProcs.BonusStaminaMultiplier));
                    statsProcs.Agility = statsProcs.Agility * (1f + statsTotal.BonusAgilityMultiplier) * (1f + statsProcs.BonusAgilityMultiplier);
                    statsProcs.Agility += statsProcs.HighestStat * (1f + statsTotal.BonusAgilityMultiplier) * (1f + statsProcs.BonusAgilityMultiplier);
                    statsProcs.Agility += statsProcs.Paragon * (1f + statsTotal.BonusAgilityMultiplier) * (1f + statsProcs.BonusAgilityMultiplier);
                    statsProcs.HighestStat = statsProcs.Paragon = 0f; // we've added them into agi so kill it
                    statsProcs.Health += (float)Math.Floor(statsProcs.Stamina * 10f);

                    float HighestSecondaryStatValue = statsProcs.HighestSecondaryStat; // how much HighestSecondaryStat to add
                    statsProcs.HighestSecondaryStat = 0f; // remove HighestSecondaryStat stat, since it's not needed
                    if (statsTotal.CritRating > statsTotal.HasteRating && statsTotal.CritRating > statsTotal.MasteryRating)
                    {
                        statsTotal.CritRating += HighestSecondaryStatValue;
                    }
                    else if (statsTotal.HasteRating > statsTotal.CritRating && statsTotal.HasteRating > statsTotal.MasteryRating)
                    {
                        statsTotal.HasteRating += HighestSecondaryStatValue;
                    }
                    else /*if (statsTotal.MasteryRating > statsTotal.CritRating && statsTotal.MasteryRating > statsTotal.HasteRating)*/
                    {
                        statsTotal.MasteryRating += HighestSecondaryStatValue;
                    }


                    // Armor
                    statsProcs.Armor = statsProcs.Armor * (1f + statsTotal.BaseArmorMultiplier + statsProcs.BaseArmorMultiplier);
                    //statsProcs.BonusArmor += statsProcs.Agility * 2f;
                    statsProcs.BonusArmor = statsProcs.BonusArmor * (1f + statsTotal.BonusArmorMultiplier + statsProcs.BonusArmorMultiplier);
                    statsProcs.Armor += statsProcs.BonusArmor;
                    statsProcs.BonusArmor = 0; //it's been added to Armor so kill it

                    // Attack Power
                    statsProcs.BonusAttackPowerMultiplier *= (1f + statsProcs.BonusRangedAttackPowerMultiplier);
                    statsProcs.BonusRangedAttackPowerMultiplier = 0; // it's been added to Attack Power so kill it
                    float totalBAPMProcs = (1f + statsTotal.BonusAttackPowerMultiplier) * (1f + statsProcs.BonusAttackPowerMultiplier) - 1f;
                    float apFromAGIProcs = (1f + totalBAPMProcs) * (statsProcs.Agility) * 2f;
                    //float apFromSTRProcs    = (1f + totalBAPMProcs) * (statsProcs.Strength);
                    float apBonusOtherProcs = (1f + totalBAPMProcs) * (statsProcs.AttackPower + statsProcs.RangedAttackPower);
                    statsProcs.AttackPower = Math.Max(0f, apFromAGIProcs + /*apFromSTRProcs +*/ apBonusOtherProcs);
                    statsProcs.RangedAttackPower = statsProcs.AttackPower;
                    statsTotal.AttackPower *= (1f + statsProcs.BonusAttackPowerMultiplier); // Make sure the originals get your AP% procs

                    // Crit
                    statsProcs.PhysicalCrit += StatConversion.GetCritFromAgility(statsProcs.Agility, character.Class);
                    statsProcs.PhysicalCrit += StatConversion.GetCritFromRating(statsProcs.CritRating + statsProcs.RangedCritRating, character.Class);

                    // Haste
                    statsProcs.PhysicalHaste = (1f + statsProcs.PhysicalHaste)
                                             * (1f + statsProcs.RangedHaste)
                                             * (1f + StatConversion.GetPhysicalHasteFromRating(statsProcs.HasteRating, character.Class))
                                             - 1f;
                    #endregion
                    // Add it back into the fold
                    statsTotal.Accumulate(statsProcs);
                    #endregion
                }
                return statsTotal;
            }
            catch (Exception ex)
            {
                new Base.ErrorBox()
                {
                    Title = "Error in getting Character Stats",
                    Function = "GetCharacterStats()",
                    TheException = ex,
                }.Show();
            }
            return new StatsHunter();
        }
Example #9
0
 public PetSkillPriorityRotation(Character character, CalculationOptionsHunter options)
 {
     this.character = character;
     this.options = options;
 }
        public void LoadCalculationOptions()
        {
            string info = "";
            _loadingCalculationOptions = true;
            try {
                if (Character != null && Character.CalculationOptions == null) {
                    // If it's broke, make a new one with the defaults
                    Character.CalculationOptions = new CalculationOptionsHunter();
                    _loadingCalculationOptions = true;
                }
                else if (Character == null) { return; }
                CalcOpts = Character.CalculationOptions as CalculationOptionsHunter;
                ThePetTalentPicker.Character = character;
                //PetBuffs.Character = Character;
                PopulateArmoryPets();
                PopulatePetAbilities();
/*                CB_PriorityDefaults.SelectedIndex = ShotRotationIndexCheck();
                if (ShotRotationFunctions.ShotRotationIsntSet(CalcOpts)) {
                    _loadingCalculationOptions = false;
                    CB_PriorityDefaults.SelectedIndex = ShotRotationFunctions.ShotRotationGetRightSpec(Character);
                    _loadingCalculationOptions = true;
                }
 */ 
                // Bad Item Hiding
                CalculationsHunter.HidingBadStuff_Spl = CalcOpts.HideBadItems_Spl;
                CalculationsHunter.HidingBadStuff_PvP = CalcOpts.HideBadItems_PvP;
                ItemCache.OnItemsChanged();
            } catch (Exception ex) {
                new Base.ErrorBox()
                {
                    Title = "Error in loading the Hunter Options Pane",
                    Function = "LoadCalculationOptions()",
                    Info = info,
                    TheException = ex,
                }.Show();
            }
            _loadingCalculationOptions = false;
        }
 public static bool ShotRotationIsntSet(CalculationOptionsHunter CalcOpts)
 {
     return ((CalcOpts.PriorityIndex1 + CalcOpts.PriorityIndex2 +
              CalcOpts.PriorityIndex3 + CalcOpts.PriorityIndex4 +
              CalcOpts.PriorityIndex5 + CalcOpts.PriorityIndex6 +
              CalcOpts.PriorityIndex7 + CalcOpts.PriorityIndex8 +
              CalcOpts.PriorityIndex9 + CalcOpts.PriorityIndex10)
             == 0);
 }
Example #12
0
 public ShotPriority(CalculationOptionsHunter options) { this.CalcOpts = options; }
Example #13
0
 public PetAttackTable(Character character, StatsHunter stats, CalculationOptionsHunter co,
     float[] avoidChances, PetAttacks ability, bool useSpellHit, bool alwaysHit) {
     Initialize(character, stats, co, avoidChances, ability, useSpellHit, alwaysHit);
 }
Example #14
0
 protected void Initialize(Character character, StatsHunter stats, CalculationOptionsHunter co,
     float[] avoidChances, PetAttacks ability, bool useSpellHit, bool alwaysHit)
 {
     Char = character;
     StatS = stats;
     calcOpts = co;
     combatFactors = null;
     Abil = null;
     PetAbil = ability;
     isWhite = (PetAbil == PetAttacks.None);
     this.useSpellHit = useSpellHit;
     /*// Defaults
     Miss 
     Dodge
     Parry
     Block
     Glance
     Critical
     Hit*/
     // Start a calc            
     if (alwaysHit) CalculateAlwaysHit();
     else Calculate(avoidChances);
 }
Example #15
0
 public AttackTable(Character character, StatsHunter stats, CombatFactors cf, CalculationOptionsHunter co, Skills.Ability ability, bool useSpellHit, bool alwaysHit) {
     Initialize(character, stats, cf, co, ability, useSpellHit, alwaysHit);
 }
        public override Dictionary<string, string> GetCharacterDisplayCalculationValues() {
            Dictionary<string, string> dictValues = new Dictionary<string, string>();
            //string format = "";
            CalcOpts = character.CalculationOptions as CalculationOptionsHunter;

            //Basic Stats
            dictValues.Add("Health and Stamina", string.Format("{0:##,##0}*{1:##,##0} : Stamina",
                                Hunter.Health, Hunter.Stamina));
            dictValues.Add("Focus", string.Format("{0:000}", Hunter.Focus.ToString("F0")));
            dictValues.Add("Armor", Hunter.Armor.ToString("F0"));
            dictValues.Add("Agility", string.Format("{0}*{1} : After Special Effects", HunterUnBuffed.Agility, Hunter.Agility));
            dictValues.Add("Ranged Attack Power", string.Format("{0:00,000}*{1:00,000} : After Special Effects", //+
//                            "\r\n{1:00,000} : Base" +
//                            "\r\n{2:00,000} : Agility" +
//                            "\r\n{3:00,000} : Gear / Spec" +
//                            "\r\nProcs were averaged out and added",
                            HunterUnBuffed.RangedAttackPower, Hunter.RangedAttackPower));//, apFromBase, apFromAGI, apFromGear));
            dictValues.Add("Hit", string.Format("{0:00.00%} : {1}*" + 
                                "Ranged Cap: " + Hunter.HitNeededLabel,
                                HunterUnBuffed.HitRatingPercent,
                                HunterUnBuffed.HitRating,
                                HunterUnBuffed.HitRatingNeeded));
             
            dictValues.Add("Crit", string.Format("{0:00.00%} : {1}*Includes:" +
                                "\r\n{2:00.00%} : Agility" +
                                "\r\n{3:00.00%} : Rating" +
                                "\r\n{4:00.00%} : Buffs" + 
                                "\r\n{5:00.00%} : Target Modifier" +
                                "\r\n\r\nNote that individual Shots will handle their own crit caps",
                                HunterUnBuffed.ChancetoCrit,
                                HunterUnBuffed.CritRating,
                                HunterUnBuffed.CritfromAgility,
                                HunterUnBuffed.CritfromRating,
                                HunterUnBuffed.PhysicalCrit,
                                HunterUnBuffed.CritModifiedfromTarget));
            dictValues.Add("Haste", string.Format("{0:00.00%} : {1:0}",
//                                "*Includes:" +
//                                "\r\n{2:00.00%} : Base" +
//                                "\r\n{3:00.00%} : Rating" +
                                HunterUnBuffed.Haste,
                                HunterUnBuffed.HasteRating));
            dictValues.Add("Mastery", string.Format("{0:00.00%} : {1}* Includes:" +
                                "\r\n{2:00.0000} : Mastery From Rating" +
                                "\r\n{3:00.0000%} : Spec base %" +
                                "\r\n{4:00.0000%} : Incremental %" +
                                HunterUnBuffed.MasteryLabel,
                                HunterUnBuffed.MasteryRatePercent,
                                HunterUnBuffed.MasteryRating,
                                HunterUnBuffed.MasteryRateConversion,
                                HunterUnBuffed.BaseMastery,
                                HunterUnBuffed.IncrementalmasterywithConversion,
                                HunterUnBuffed.MasteryRatePercent));
            dictValues.Add("Attack Speed", BaseAttackSpeed.ToString("F2"));
            
            // Pet Stats
/*            dictValues.Add("Pet Health", string.Format("{0:000,000}*" +
                                        "{1:000,000} : Base" + 
                                        "\r\n{2:000,000} : Hunter" +
                                        "\r\n{3:000,000} : Bonus",
                                        pet.PetStats.Health, petBaseHealth, petHealthfromStamina, petBonusHealth));
            dictValues.Add("Pet Armor", pet.PetStats.Armor.ToString("F0"));
            dictValues.Add("Pet Focus", focus.ToString("F0"));
            dictValues.Add("Pet Attack Power", pet.PetStats.AttackPower.ToString("F0") +
                                                string.Format("*Full Pet Stats:\r\n"
//                                                              + "Strength: {0:0.0}\r\n"
//                                                              + "Agility: {1:0.0}\r\n"
                                                              + "Hit: {0:0.00%}\r\n"
                                                              + "PhysCrit: {1:0.00%}\r\n"
                                                              + "PhysHaste: {2:0.00%}\r\n",
//                                                            pet.PetStats.Strength,
//                                                            pet.PetStats.Agility,
                                                            pet.PetStats.PhysicalHit,
                                                            pet.PetStats.PhysicalCrit,
                                                            pet.PetStats.PhysicalHaste));
            dictValues.Add("Pet Hit %", petHitTotal.ToString("P2"));
            dictValues.Add("Pet Dodge %", petTargetDodge.ToString("P2"));
            dictValues.Add("Pet Melee Crit %", petCritTotalMelee.ToString("P2") + "*includes:\n" +
                            petCritFromBase.ToString("P2") + " from base\n" +
                            petCritFromAgility.ToString("P2") + " from agility\n" +
                            petCritFromSpidersBite.ToString("P2") + " from Spider's Bite\n" +
                            petCritFromFerocity.ToString("P2") + " from Ferocity\n" +
                            petCritFromGear.ToString("P2") + " from gear\n" +
                            petCritFromBuffs.ToString("P2") + " from buffs\n" +
                            petCritFromTargetDebuffs.ToString("P2") + " from target debuffs\n" +
                            petCritFromDepression.ToString("P2") + " from depression");
            dictValues.Add("Pet Specials Crit %", petCritTotalSpecials.ToString("P2") + "*includes:\n" +
                            petCritTotalMelee.ToString("P2") + " from melee crit\n" +
                            petCritFromCobraStrikes.ToString("P2") + " from Cobra Strikes");
            dictValues.Add("Pet White DPS", petWhiteDPS.ToString("F2"));
            dictValues.Add("Pet Kill Command DPS", petKillCommandDPS.ToString("F2"));
            dictValues.Add("Pet Specials DPS", petSpecialDPS.ToString("F2") /*+ 
                string.Format("Breakout:\r\n"
                            + "Furious Howl: Use {0} DPS {1:0.00}"
                            + "Bite: Use {2} DPS {3:0.00}",
                            pet.priorityRotation.getSkillFrequency(PetAttacks.FuriousHowl), 0f,
                            pet.priorityRotation.getSkillFrequency(PetAttacks.Bite), pet.priorityRotation.dps - petWhiteDPS));
*/
            // Shot Stats
//            dictValues.Add("Aimed Shot", Aimed.GenTooltip(CustomDPS));
            dictValues.Add("Aimed Shot", Aimed.DPS.ToString("F2"));
            dictValues.Add("MMM Aimed Shot", MMMAimed.DPS.ToString("F2"));
            dictValues.Add("CA Aimed Shot", CAAimed.DPS.ToString("F2"));
            //            dictValues.Add("Arcane Shot", Arcane.GenTooltip(CustomDPS));
            dictValues.Add("Arcane Shot", Arcane.DPS.ToString("F2"));
            //            dictValues.Add("Multi Shot", multiShot.GenTooltip());
//            dictValues.Add("Cobra Shot", cobraShot.GenTooltip());
//            dictValues.Add("Steady Shot", Steady.GenTooltip(CustomDPS));
            dictValues.Add("Steady Shot", Steady.DPS.ToString("F2"));
//            dictValues.Add("Kill Shot", Kill.GenTooltip(CustomDPS));
            dictValues.Add("Kill Shot", Kill.DPS.ToString("F2"));
//            dictValues.Add("Explosive Shot", explosiveShot.GenTooltip());
//            dictValues.Add("Black Arrow", blackArrow.GenTooltip());
//            dictValues.Add("Chimera Shot", Chimera.GenTooltip(CustomDPS));
            dictValues.Add("Chimera Shot", Chimera.DPS.ToString("F2"));
            
            //dictValues.Add("Rapid Fire", rapidFire.GenTooltip());
            //dictValues.Add("Readiness", readiness.GenTooltip());
            //dictValues.Add("Bestial Wrath", bestialWrath.GenTooltip());

            // Sting Stats
//            dictValues.Add("Serpent Sting", Serpent.GenTooltip(CustomDPS));
            dictValues.Add("Serpent Sting", Serpent.DPS.ToString("F2"));

            // Trap Stats
            //dictValues.Add("Immolation Trap", immolationTrap.GenTooltip());
            //dictValues.Add("Explosive Trap", explosiveTrap.GenTooltip());
            //dictValues.Add("Freezing Trap", freezingTrap.GenTooltip());
            //dictValues.Add("Frost Trap", frostTrap.GenTooltip());

            // Hunter DPS
            dictValues.Add("Autoshot DPS", Whites.GenTooltip(CustomDPS));
            dictValues.Add("Priority Rotation DPS", CustomDPS.ToString("F2"));
            dictValues.Add("Wild Quiver DPS", WildQuiverDPS.ToString("F2"));
//            dictValues.Add("Kill Shot low HP gain", killShotSub20FinalGain.ToString("F2")+"*"+
//                            "Kill Shot freq: "+killShot.Freq.ToString("F2")+" -> "+killShot.start_freq.ToString("F2")+"\n"+
//                            "Steady Shot freq: "+steadyShot.Freq.ToString("F2")+" -> "+killShotSub20NewSteadyFreq.ToString("F2")+"\n"+
//                            "Kill Shot DPS: "+killShot.DPS.ToString("F2")+" -> "+killShotSub20NewDPS.ToString("F2")+"\n"+
//                            "Steady Shot DPS: "+steadyShot.DPS.ToString("F2")+" -> "+killShotSub20NewSteadyDPS.ToString("F2")+"\n"+
//                            "DPS Gain when switched: " + killShotSub20Gain.ToString("F2")+"\n"+
//                            "Time spent sub-20%: " + killShotSub20TimeSpent.ToString("P2"));
            dictValues.Add("Aspect Loss", aspectBeastLostDPS.ToString("F2") + "*" +
                            "Hawk Uptime: " + aspectUptimeHawk.ToString("P2") + "\n" + 
                            "Fox Uptime: " + aspectUptimeBeast.ToString("P2"));
            dictValues.Add("Piercing Shots DPS", PiercingShotsDPS.ToString("F2") + "*" +
                            "Steady Shot: " + PiercingShotsDPSSteadyShot.ToString("F2") + "\n" +
                            "Aimed Shot: " + PiercingShotsDPSAimedShot.ToString("F2") + "\n" +
                            "Chimera Shot: " + PiercingShotsDPSChimeraShot.ToString("F2") + "\n");
            dictValues.Add("Special DMG Procs DPS", SpecProcDPS.ToString("F2"));

            // Combined DPS
            dictValues.Add("Hunter DPS", HunterDpsPoints.ToString("F2"));
            dictValues.Add("Pet DPS", PetDpsPoints.ToString("F2"));
            dictValues.Add("Total DPS", OverallPoints.ToString("F2"));

            return dictValues;
        }