private static int StatToId(AdditiveStat stat) { switch (stat) { case AdditiveStat.Spirit: return(0); case AdditiveStat.DodgeRating: return(1); case AdditiveStat.ParryRating: return(2); case AdditiveStat.HitRating: return(3); case AdditiveStat.CritRating: return(4); case AdditiveStat.HasteRating: return(5); case AdditiveStat.ExpertiseRating: return(6); case AdditiveStat.MasteryRating: return(7); default: return(-1); } }
public void ApplyReforging(Item baseItem, int randomSuffixId, AdditiveStat reforgeFrom, AdditiveStat reforgeTo) { this.reforgeFrom = reforgeFrom; this.reforgeTo = reforgeTo; id = StatsToId(reforgeFrom, reforgeTo); ApplyReforging(baseItem, randomSuffixId); }
public static int StatsToId(AdditiveStat reforgeFrom, AdditiveStat reforgeTo) { int from = StatToId(reforgeFrom); int to = StatToId(reforgeTo); if (from == -1 || to == -1 || to == from) { return(0); } if (to > from) { to--; } return(57 + 7 * from + to); }
public static void IdToStats(int id, out AdditiveStat reforgeFrom, out AdditiveStat reforgeTo) { while (id > 56) { id -= 56; } id--; int from = id / 7; reforgeFrom = IdToStat(from); id %= 7; if (from <= id) { id++; } reforgeTo = IdToStat(id); }
public static float CurrentStatValue(Item baseItem, int randomSuffixId, AdditiveStat stat) { if (randomSuffixId == 0) { if ((int)stat >= 0 && (int)stat < baseItem.Stats._rawAdditiveData.Length) { return(baseItem.Stats._rawAdditiveData[(int)stat]); } else { #if DEBUG throw new IndexOutOfRangeException(string.Format("Invalid Stat index")); #else return(0f); #endif } } else { return(RandomSuffix.GetStatValue(baseItem, randomSuffixId, stat)); } }
/// <summary> /// Gets the ammount of random stat for a given stat. /// </summary> public static float GetStatValue(Item item, int id, AdditiveStat stat) { if (item.ItemLevel < 277) return 0; for (int i = 0; i < 5; i++) { int statId = RandomSuffixData[id].Stat[i]; if (statId == 0) { return 0; } if (stat == StatFromEnchantmentId(statId)) { int baseValue = RandomPropData[item.ItemLevel - 277, QualityIndex(item.Quality), SlotIndex(item.Slot)]; int multiplier = RandomSuffixData[id].Multiplier[i]; return (int)(multiplier / 10000.0 * baseValue); } } return 0; }
/// <summary> /// Computes the average uptime of specific effects being active/inactive. /// </summary> /// <param name="triggerInterval">Average time interval between triggers in seconds for each effect.</param> /// <param name="triggerChance">Chance that trigger of correct type is produced for each effect.</param> /// <param name="active">Determines if specific effects are being active/inactive for the uptime calculation.</param> /// <param name="offset">Initial cooldown for each effect.</param> /// <param name="attackSpeed">Average unhasted attack speed, used in PPM calculations.</param> /// <param name="fightDuration">Duration of fight in seconds.</param> /// <param name="scale">Chance that the effect will give the desired proc.</param> /// <param name="effects">The effects for which the combined uptime is to be computed.</param> /// <param name="stat">The stat for which we're computing the combinations.</param> public static WeightedStat[] GetAverageCombinedUptimeCombinations(SpecialEffect[] effects, float[] triggerInterval, float[] triggerChance, float[] offset, float[] scale, float attackSpeed, float fightDuration, AdditiveStat stat) { float[] value = new float[effects.Length]; for (int j = 0; j < effects.Length; j++) { value[j] = effects[j].Stats._rawAdditiveData[(int)stat]; } return GetAverageCombinedUptimeCombinations(effects, triggerInterval, triggerChance, offset, scale, attackSpeed, fightDuration, value); }
/// <summary> /// Computes the average uptime of specific effects being active/inactive. /// </summary> /// <param name="triggerInterval">Average time interval between triggers in seconds for each effect.</param> /// <param name="triggerChance">Chance that trigger of correct type is produced for each effect.</param> /// <param name="active">Determines if specific effects are being active/inactive for the uptime calculation.</param> /// <param name="offset">Initial cooldown for each effect.</param> /// <param name="attackSpeed">Average unhasted attack speed, used in PPM calculations.</param> /// <param name="fightDuration">Duration of fight in seconds.</param> public static WeightedStat[] GetAverageCombinedUptimeCombinations(SpecialEffect[] effects, float[] triggerInterval, float[] triggerChance, float[] offset, float attackSpeed, float fightDuration, AdditiveStat stat) { return GetAverageCombinedUptimeCombinations(effects, triggerInterval, triggerChance, offset, null, attackSpeed, fightDuration, stat); }
public Reforging(Item baseItem, int randomSuffixId, AdditiveStat reforgeFrom, AdditiveStat reforgeTo) { ApplyReforging(baseItem, randomSuffixId, reforgeFrom, reforgeTo); }
/// <summary> /// Computes the average uptime of specific effects being active/inactive. /// </summary> /// <param name="triggerInterval">Average time interval between triggers in seconds for each effect.</param> /// <param name="triggerChance">Chance that trigger of correct type is produced for each effect.</param> /// <param name="active">Determines if specific effects are being active/inactive for the uptime calculation.</param> /// <param name="offset">Initial cooldown for each effect.</param> /// <param name="attackSpeed">Average unhasted attack speed, used in PPM calculations.</param> /// <param name="fightDuration">Duration of fight in seconds.</param> /// <param name="scale">Chance that the effect will give the desired proc.</param> /// <param name="effects">The effects for which the combined uptime is to be computed.</param> /// <param name="stat">The stat for which we're computing the combinations.</param> public static WeightedStat[] GetAverageCombinedUptimeCombinations(SpecialEffect[] effects, float[] triggerInterval, float[] triggerChance, float[] offset, float[] scale, float attackSpeed, float fightDuration, AdditiveStat stat) { float[] value = new float[effects.Length]; for (int j = 0; j < effects.Length; j++) { value[j] = effects[j].Stats._rawAdditiveData[(int)stat]; } return(GetAverageCombinedUptimeCombinations(effects, triggerInterval, triggerChance, offset, scale, attackSpeed, fightDuration, value)); }
/// <summary> /// Computes the average uptime of specific effects being active/inactive. /// </summary> /// <param name="triggerInterval">Average time interval between triggers in seconds for each effect.</param> /// <param name="triggerChance">Chance that trigger of correct type is produced for each effect.</param> /// <param name="active">Determines if specific effects are being active/inactive for the uptime calculation.</param> /// <param name="offset">Initial cooldown for each effect.</param> /// <param name="attackSpeed">Average unhasted attack speed, used in PPM calculations.</param> /// <param name="fightDuration">Duration of fight in seconds.</param> public static WeightedStat[] GetAverageCombinedUptimeCombinations(SpecialEffect[] effects, float[] triggerInterval, float[] triggerChance, float[] offset, float attackSpeed, float fightDuration, AdditiveStat stat) { return(GetAverageCombinedUptimeCombinations(effects, triggerInterval, triggerChance, offset, null, attackSpeed, fightDuration, stat)); }