protected static void CalculateTriggers(Rotation rot, Dictionary <Trigger, float> triggerIntervals, Dictionary <Trigger, float> triggerChances) { float CastInterval = 1f / rot.getCastsPerSecond(); float WeightedCritChance = rot.getWeightedCritchance(); float WeightedHitChance = rot.getWeightedHitchance(); triggerIntervals[Trigger.Use] = 0f; triggerChances[Trigger.Use] = 1f; triggerIntervals[Trigger.DamageDone] = 1f / (rot.getCastsPerSecond() + 1f / rot.FS.PeriodicTickTime); // flameshock ticks are not taken into account. the chance would be slightly higher. triggerChances[Trigger.DamageDone] = WeightedHitChance; triggerIntervals[Trigger.DamageOrHealingDone] = 1f / (rot.getCastsPerSecond() + 1f / rot.FS.PeriodicTickTime); // flameshock ticks are not taken into account. the chance would be slightly higher. // Need to add Self-Heals triggerChances[Trigger.DamageOrHealingDone] = WeightedHitChance; triggerIntervals[Trigger.SpellMiss] = CastInterval; triggerChances[Trigger.SpellMiss] = 1f - WeightedHitChance; triggerIntervals[Trigger.SpellHit] = CastInterval; triggerChances[Trigger.SpellHit] = WeightedHitChance; triggerIntervals[Trigger.DamageSpellHit] = CastInterval; triggerChances[Trigger.DamageSpellHit] = WeightedHitChance; triggerIntervals[Trigger.DoTTick] = 1f / rot.FS.PeriodicTickTime; triggerChances[Trigger.DoTTick] = 1f; triggerIntervals[Trigger.SpellCast] = CastInterval; triggerChances[Trigger.SpellCast] = 1f; triggerIntervals[Trigger.DamageSpellCast] = CastInterval; triggerChances[Trigger.DamageSpellCast] = 1f; triggerIntervals[Trigger.SpellCrit] = CastInterval; triggerChances[Trigger.SpellCrit] = WeightedCritChance; triggerIntervals[Trigger.DamageSpellCrit] = CastInterval; triggerChances[Trigger.DamageSpellCrit] = WeightedCritChance; triggerIntervals[Trigger.ShamanLightningBolt] = 1f / rot.getCastsPerSecond(typeof(LightningBolt)); triggerChances[Trigger.ShamanLightningBolt] = 1f; triggerIntervals[Trigger.ShamanShock] = 1f / rot.getCastsPerSecond(typeof(Shock)); triggerChances[Trigger.ShamanShock] = 1f; triggerIntervals[Trigger.ShamanFlameShockDoTTick] = 1f / rot.getTicksPerSecond(typeof(FlameShock)); triggerChances[Trigger.ShamanFlameShockDoTTick] = 1f; }
private static Stats getTrinketStats(Character character, Stats stats, float FightDuration, Rotation rot) { Stats statsAverage = new Stats(); foreach (SpecialEffect effect in stats.SpecialEffects()) { float trigger = 0f; // 1 / frequency in Hz float procChance = 1f; if (effect.Trigger == Trigger.DamageDone) { trigger = 1f / ( rot.getCastsPerSecond() + 1f/rot.FS.PeriodicTickTime ); procChance = rot.getWeightedHitchance(); //flameshock ticks are not taken into account. the chance would be slightly higher. } else if (effect.Trigger == Trigger.DamageOrHealingDone) { // Need to Add Self-Heals trigger = 1f / (rot.getCastsPerSecond() + 1f / rot.FS.PeriodicTickTime); procChance = rot.getWeightedHitchance(); //flameshock ticks are not taken into account. the chance would be slightly higher. } else if (effect.Trigger == Trigger.SpellMiss) { trigger = 1f / rot.getCastsPerSecond(); procChance = 1f - rot.getWeightedHitchance(); } else if (effect.Trigger == Trigger.SpellHit || effect.Trigger == Trigger.DamageSpellHit) { trigger = 1f / rot.getCastsPerSecond(); procChance = rot.getWeightedHitchance(); } else if (effect.Trigger == Trigger.DoTTick) { trigger = 1f / rot.FS.PeriodicTickTime; } else if (effect.Trigger == Trigger.SpellCast || effect.Trigger == Trigger.DamageSpellCast) { trigger = 1f / rot.getCastsPerSecond(); } else if (effect.Trigger == Trigger.SpellCrit || effect.Trigger == Trigger.DamageSpellCrit) { trigger = 1f / rot.getCastsPerSecond(); procChance = rot.getWeightedCritchance(); } else if (effect.Trigger == Trigger.ShamanLightningBolt) { trigger = 1f / rot.getCastsPerSecond(typeof(LightningBolt)); } else if (effect.Trigger == Trigger.ShamanShock) { trigger = 1f / rot.getCastsPerSecond(typeof(Shock)); } else if (effect.Trigger == Trigger.ShamanFlameShockDoTTick) { trigger = 1f / rot.getTicksPerSecond(typeof(FlameShock)); } else if (effect.Trigger == Trigger.Use) { trigger = 1f; } else continue; effect.AccumulateAverageStats(statsAverage, trigger, procChance, 3f, FightDuration); } return statsAverage; }
protected static void CalculateTriggers(Rotation rot, Dictionary<Trigger, float> triggerIntervals, Dictionary<Trigger, float> triggerChances) { float CastInterval = 1f / rot.getCastsPerSecond(); float WeightedCritChance = rot.getWeightedCritchance(); float WeightedHitChance = rot.getWeightedHitchance(); triggerIntervals[Trigger.Use] = 0f; triggerChances[Trigger.Use] = 1f; triggerIntervals[Trigger.DamageDone] = 1f / (rot.getCastsPerSecond() + 1f / rot.FS.PeriodicTickTime); // flameshock ticks are not taken into account. the chance would be slightly higher. triggerChances[Trigger.DamageDone] = WeightedHitChance; triggerIntervals[Trigger.DamageOrHealingDone] = 1f / (rot.getCastsPerSecond() + 1f / rot.FS.PeriodicTickTime); // flameshock ticks are not taken into account. the chance would be slightly higher. // Need to add Self-Heals triggerChances[Trigger.DamageOrHealingDone] = WeightedHitChance; triggerIntervals[Trigger.SpellMiss] = CastInterval; triggerChances[Trigger.SpellMiss] = 1f - WeightedHitChance; triggerIntervals[Trigger.SpellHit] = CastInterval; triggerChances[Trigger.SpellHit] = WeightedHitChance; triggerIntervals[Trigger.DamageSpellHit] = CastInterval; triggerChances[Trigger.DamageSpellHit] = WeightedHitChance; triggerIntervals[Trigger.DoTTick] = 1f / rot.FS.PeriodicTickTime; triggerChances[Trigger.DoTTick] = 1f; triggerIntervals[Trigger.SpellCast] = CastInterval; triggerChances[Trigger.SpellCast] = 1f; triggerIntervals[Trigger.DamageSpellCast] = CastInterval; triggerChances[Trigger.DamageSpellCast] = 1f; triggerIntervals[Trigger.SpellCrit] = CastInterval; triggerChances[Trigger.SpellCrit] = WeightedCritChance; triggerIntervals[Trigger.DamageSpellCrit] = CastInterval; triggerChances[Trigger.DamageSpellCrit] = WeightedCritChance; triggerIntervals[Trigger.ShamanLightningBolt] = 1f / rot.getCastsPerSecond(typeof(LightningBolt)); triggerChances[Trigger.ShamanLightningBolt] = 1f; triggerIntervals[Trigger.ShamanShock] = 1f / rot.getCastsPerSecond(typeof(Shock)); triggerChances[Trigger.ShamanShock] = 1f; triggerIntervals[Trigger.ShamanFlameShockDoTTick] = 1f / rot.getTicksPerSecond(typeof(FlameShock)); triggerChances[Trigger.ShamanFlameShockDoTTick] = 1f; }
private static Stats getTrinketStats(Character character, Stats stats, float FightDuration, Rotation rot) { Stats statsAverage = new Stats(); foreach (SpecialEffect effect in stats.SpecialEffects()) { float trigger = 0f; // 1 / frequency in Hz float procChance = 1f; if (effect.Trigger == Trigger.DamageDone) { trigger = 1f / (rot.getCastsPerSecond() + 1f / rot.FS.PeriodicTickTime); procChance = rot.getWeightedHitchance(); //flameshock ticks are not taken into account. the chance would be slightly higher. } else if (effect.Trigger == Trigger.DamageOrHealingDone) { // Need to Add Self-Heals trigger = 1f / (rot.getCastsPerSecond() + 1f / rot.FS.PeriodicTickTime); procChance = rot.getWeightedHitchance(); //flameshock ticks are not taken into account. the chance would be slightly higher. } else if (effect.Trigger == Trigger.SpellMiss) { trigger = 1f / rot.getCastsPerSecond(); procChance = 1f - rot.getWeightedHitchance(); } else if (effect.Trigger == Trigger.SpellHit || effect.Trigger == Trigger.DamageSpellHit) { trigger = 1f / rot.getCastsPerSecond(); procChance = rot.getWeightedHitchance(); } else if (effect.Trigger == Trigger.DoTTick) { trigger = 1f / rot.FS.PeriodicTickTime; } else if (effect.Trigger == Trigger.SpellCast || effect.Trigger == Trigger.DamageSpellCast) { trigger = 1f / rot.getCastsPerSecond(); } else if (effect.Trigger == Trigger.SpellCrit || effect.Trigger == Trigger.DamageSpellCrit) { trigger = 1f / rot.getCastsPerSecond(); procChance = rot.getWeightedCritchance(); } else if (effect.Trigger == Trigger.ShamanLightningBolt) { trigger = 1f / rot.getCastsPerSecond(typeof(LightningBolt)); } else if (effect.Trigger == Trigger.ShamanShock) { trigger = 1f / rot.getCastsPerSecond(typeof(Shock)); } else if (effect.Trigger == Trigger.ShamanFlameShockDoTTick) { trigger = 1f / rot.getTicksPerSecond(typeof(FlameShock)); } else if (effect.Trigger == Trigger.Use) { trigger = 1f; } else { continue; } effect.AccumulateAverageStats(statsAverage, trigger, procChance, 3f, FightDuration); } return(statsAverage); }