diff --git a/sim/core/dot.go b/sim/core/dot.go index c17f2d5027..f66c3c7897 100644 --- a/sim/core/dot.go +++ b/sim/core/dot.go @@ -111,6 +111,19 @@ func (dot *Dot) Rollover(sim *Simulation) { sim.AddPendingAction(dot.tickAction) } +func (dot *Dot) RescheduleNextTick(sim *Simulation) { + dot.RecomputeAuraDuration() + + dot.tickAction.Cancel(sim) // remove old PA ticker + + // recreate with new period, resetting the next tick. + periodicOptions := dot.basePeriodicOptions() + periodicOptions.Period = dot.tickPeriod + dot.tickAction = NewPeriodicAction(sim, periodicOptions) + dot.tickAction.NextActionAt = dot.lastTickTime + dot.tickPeriod + sim.AddPendingAction(dot.tickAction) +} + func (dot *Dot) Apply(sim *Simulation) { dot.TakeSnapshot(sim, false) diff --git a/sim/shaman/elemental/TestElemental.results b/sim/shaman/elemental/TestElemental.results index fd46b4b652..55e522bc22 100644 --- a/sim/shaman/elemental/TestElemental.results +++ b/sim/shaman/elemental/TestElemental.results @@ -434,8 +434,8 @@ dps_results: { dps_results: { key: "TestElemental-AllItems-FrostWitch'sRegalia" value: { - dps: 8209.20382 - tps: 4559.89103 + dps: 8215.41125 + tps: 4564.44786 } } dps_results: { diff --git a/sim/shaman/items_wotlk.go b/sim/shaman/items_wotlk.go index fce23136b7..4b5736f288 100644 --- a/sim/shaman/items_wotlk.go +++ b/sim/shaman/items_wotlk.go @@ -58,28 +58,22 @@ var ItemSetFrostWitchRegalia = core.NewItemSet(core.ItemSet{ OnReset: func(aura *core.Aura, sim *core.Simulation) { aura.Activate(sim) }, - OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) { - fsDot := shaman.FlameShock.Dot(result.Target) + OnCastComplete: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell) { + fsDot := shaman.FlameShock.Dot(shaman.CurrentTarget) if spell == shaman.LavaBurst && fsDot.IsActive() { // Doesn't have to hit from tooltip + // 4p t10 immediately updates the tickPeriod based on current haste + fsDot.RescheduleNextTick(sim) + // Find the number of ticks whose duration is closest to 6s. // "our testing confirms that the 4pc t10 setbonus adds to FS the closest number of ticks to 6 seconds always" // https://web.archive.org/web/20100808192139/http://elitistjerks.com/f79/t76510-elemental_patch_3_3_now_more_fire_nova/p25/ - numTicks := 2 - period := fsDot.TickPeriod() - sixSeconds := time.Second * 6 - - for i := 3; i <= 10; i++ { - finishesAtCur := time.Duration(numTicks) * period - finishesAtNew := time.Duration(i) * period + tickPeriod := fsDot.TickPeriod() + numTicks := int32(math.Round(float64(time.Second) * 6 / float64(tickPeriod))) + fsDot.NumberOfTicks += numTicks - if math.Abs(float64(sixSeconds-finishesAtNew)) <= math.Abs(float64(sixSeconds-finishesAtCur)) { - numTicks = i - } else { - break - } - } - fsDot.Duration = fsDot.RemainingDuration(sim) + time.Duration(numTicks)*period - fsDot.Refresh(sim) + // Set duration to remaining ticks, minus the elapsed time since last tick + fsDot.Aura.Duration = time.Duration(fsDot.MaxTicksRemaining())*tickPeriod - (tickPeriod - (fsDot.NextTickAt() - sim.CurrentTime)) + fsDot.Aura.Refresh(sim) // update aura's duration } }, }) diff --git a/sim/shaman/shocks.go b/sim/shaman/shocks.go index b3d5420b06..e8be1baed3 100644 --- a/sim/shaman/shocks.go +++ b/sim/shaman/shocks.go @@ -65,10 +65,12 @@ func (shaman *Shaman) registerFlameShockSpell(shockTimer *core.Timer) { config.CritMultiplier = shaman.ElementalCritMultiplier(core.TernaryFloat64(shaman.HasMajorGlyph(proto.ShamanMajorGlyph_GlyphOfFlameShock), 0.6, 0)) config.DamageMultiplier += 0.1 * float64(shaman.Talents.BoomingEchoes) + flameShockBaseNumberOfTicks := 6 + core.TernaryInt32(shaman.HasSetBonus(ItemSetThrallsRegalia, 2), 3, 0) config.ApplyEffects = func(sim *core.Simulation, target *core.Unit, spell *core.Spell) { baseDamage := 500 + 0.214*spell.SpellPower() result := spell.CalcDamage(sim, target, baseDamage, spell.OutcomeMagicHitAndCrit) if result.Landed() { + spell.Dot(target).NumberOfTicks = flameShockBaseNumberOfTicks spell.Dot(target).Apply(sim) } spell.DealDamage(sim, result) @@ -89,7 +91,7 @@ func (shaman *Shaman) registerFlameShockSpell(shockTimer *core.Timer) { shaman.LavaBurst.BonusCritRating -= 100 * core.CritRatingPerCritChance }, }, - NumberOfTicks: 6 + core.TernaryInt32(shaman.HasSetBonus(ItemSetThrallsRegalia, 2), 3, 0), + NumberOfTicks: flameShockBaseNumberOfTicks, TickLength: time.Second * 3, AffectedByCastSpeed: true,