Skip to content

Commit

Permalink
Merge pull request #3981 from raethkcj/eleT10
Browse files Browse the repository at this point in the history
Update Elemental T10 4pc
  • Loading branch information
lologarithm committed Oct 30, 2023
2 parents b95d5a7 + 89729ff commit 9e62d02
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 20 deletions.
13 changes: 13 additions & 0 deletions sim/core/dot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions sim/shaman/elemental/TestElemental.results
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
28 changes: 11 additions & 17 deletions sim/shaman/items_wotlk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
},
})
Expand Down
4 changes: 3 additions & 1 deletion sim/shaman/shocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,

Expand Down

0 comments on commit 9e62d02

Please sign in to comment.