Skip to content

Commit

Permalink
add enhancement, warden, add correct phases to some items
Browse files Browse the repository at this point in the history
  • Loading branch information
kayla-glick committed Jan 13, 2025
1 parent 61bdddb commit c26c450
Show file tree
Hide file tree
Showing 36 changed files with 596 additions and 587 deletions.
Binary file modified assets/database/db.bin
Binary file not shown.
16 changes: 8 additions & 8 deletions assets/database/db.json

Large diffs are not rendered by default.

Binary file modified assets/database/leftover_db.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions assets/database/leftover_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1435,8 +1435,8 @@
{"effectId":63,"spellId":13538,"name":"Enchant Chest - Lesser Absorption","type":5,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1},
{"effectId":66,"spellId":7457,"name":"Enchant Bracer - Minor Stamina","type":6,"stats":[0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1},
{"effectId":66,"spellId":7863,"name":"Enchant Boots - Minor Stamina","type":10,"stats":[0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1},
{"effectId":241,"spellId":7745,"name":"Enchant 2H Weapon - Minor Impact","type":13,"enchantType":1,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1},
{"effectId":241,"spellId":13503,"name":"Enchant Weapon - Lesser Striking","type":13,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1},
{"effectId":241,"spellId":7745,"name":"Enchant 2H Weapon - Minor Impact","type":13,"enchantType":1,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1},
{"effectId":242,"spellId":7748,"name":"Enchant Chest - Lesser Health","type":5,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,0,0,0,0,0],"quality":1},
{"effectId":243,"spellId":7766,"name":"Enchant Bracer - Minor Spirit","type":6,"stats":[0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":2},
{"effectId":246,"spellId":7776,"name":"Enchant Chest - Lesser Mana","type":5,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":2},
Expand Down Expand Up @@ -1538,8 +1538,8 @@
{"effectId":1893,"spellId":20028,"name":"Enchant Chest - Major Mana","type":5,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":2},
{"effectId":1894,"spellId":20029,"name":"Enchant Weapon - Icy Chill","type":13,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":2},
{"effectId":1896,"spellId":20030,"name":"Enchant 2H Weapon - Superior Impact","type":13,"enchantType":1,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":2},
{"effectId":1897,"spellId":13695,"name":"Enchant 2H Weapon - Impact","type":13,"enchantType":1,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1},
{"effectId":1897,"spellId":20031,"name":"Enchant Weapon - Superior Striking","type":13,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":2},
{"effectId":1897,"spellId":13695,"name":"Enchant 2H Weapon - Impact","type":13,"enchantType":1,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":1},
{"effectId":1898,"spellId":20032,"name":"Enchant Weapon - Lifestealing","type":13,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":3},
{"effectId":1899,"spellId":20033,"name":"Enchant Weapon - Unholy Weapon","type":13,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":2},
{"effectId":1900,"spellId":20034,"name":"Enchant Weapon - Crusader","type":13,"stats":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"quality":2},
Expand Down
10 changes: 5 additions & 5 deletions sim/core/buffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1402,20 +1402,20 @@ func BattleShoutAura(unit *Unit, impBattleShout int32, boomingVoicePts int32, ha
rank := TernaryInt32(IncludeAQ, 7, 6)
spellId := BattleShoutSpellId[rank]
baseAP := BattleShoutBaseAP[rank]

return unit.GetOrRegisterAura(Aura{
Label: "Battle Shout",
ActionID: ActionID{SpellID: spellId},
Duration: time.Duration(float64(time.Minute*2) * (1 + 0.1*float64(boomingVoicePts))),
BuildPhase: CharacterBuildPhaseBuffs,
OnGain: func(aura *Aura, sim *Simulation) {
aura.Unit.AddStatsDynamic(sim, stats.Stats{
stats.AttackPower: math.Floor(baseAP * (1 + 0.05*float64(impBattleShout)) + TernaryFloat64(has3pcWrath, 30, 0)),
stats.AttackPower: math.Floor(baseAP*(1+0.05*float64(impBattleShout)) + TernaryFloat64(has3pcWrath, 30, 0)),
})
},
OnExpire: func(aura *Aura, sim *Simulation) {
aura.Unit.AddStatsDynamic(sim, stats.Stats{
stats.AttackPower: -1 * math.Floor(baseAP*(1+0.05*float64(impBattleShout)) + TernaryFloat64(has3pcWrath, 30, 0)),
stats.AttackPower: -1 * math.Floor(baseAP*(1+0.05*float64(impBattleShout))+TernaryFloat64(has3pcWrath, 30, 0)),
})
},
})
Expand All @@ -1433,8 +1433,8 @@ func TrueshotAura(unit *Unit) *Aura {
makeExclusiveBuff(aura, BuffConfig{
Category: "TrueshotAura",
Stats: []StatConfig{
{stats.AttackPower, rangedAP, false},
{stats.RangedAttackPower, meleeAP, false},
{stats.AttackPower, meleeAP, false},
{stats.RangedAttackPower, rangedAP, false},
},
})

Expand Down
4 changes: 2 additions & 2 deletions sim/core/debuffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func StormstrikeAura(unit *Unit) *Aura {
aura.Unit.PseudoStats.SchoolDamageTakenMultiplier[stats.SchoolIndexNature] /= 1.20
},
OnSpellHitTaken: func(aura *Aura, sim *Simulation, spell *Spell, result *SpellResult) {
if aura.IsActive() && spell.SpellSchool.Matches(SpellSchoolNature) && result.Landed() && result.Damage > 0 {
if aura.GetStacks() > 0 && spell.SpellSchool.Matches(SpellSchoolNature) && result.Landed() && result.Damage > 0 {
aura.RemoveStack(sim)
}
},
Expand All @@ -250,7 +250,7 @@ func StormstrikeAura(unit *Unit) *Aura {
NewPeriodicAction(sim, PeriodicActionOptions{
Period: DurationFromSeconds(stormstrikeConfig.natureAttackersFrequency),
OnAction: func(s *Simulation) {
if aura.IsActive() {
if aura.GetStacks() > 0 {
aura.RemoveStack(sim)
}
},
Expand Down
53 changes: 41 additions & 12 deletions sim/shaman/air_totems.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
package shaman

import (
"fmt"
"time"

"github.com/wowsims/classic/sim/core"
)

func (shaman *Shaman) setActiveAirTotem(sim *core.Simulation, spell *core.Spell, aura *core.Aura) {
shaman.TotemExpirations[AirTotem] = sim.CurrentTime + aura.Duration
shaman.ActiveTotems[AirTotem] = spell

if shaman.ActiveTotemBuffs[AirTotem] != nil {
shaman.ActiveTotemBuffs[AirTotem].Deactivate(sim)
}

shaman.ActiveTotemBuffs[AirTotem] = aura
aura.Activate(sim)
}

const WindfuryTotemRanks = 3

var WindfuryTotemSpellId = [WindfuryTotemRanks + 1]int32{0, 8512, 10613, 10614}
var WindfuryBuffAuraId = [WindfuryTotemRanks + 1]int32{0, 8514, 10607, 10611}
var WindfuryTotemBonusDamage = [WindfuryTotemRanks + 1]float64{0, 122, 229, 315}
var WindfuryTotemManaCost = [WindfuryTotemRanks + 1]float64{0, 115, 175, 250}
var WindfuryTotemLevel = [WindfuryTotemRanks + 1]int{0, 32, 42, 52}

func (shaman *Shaman) registerWindfuryTotemSpell() {
shaman.WindfuryTotem = make([]*core.Spell, WindfuryTotemRanks+1)
shaman.WindfuryTotemPeriodicActions = make([]*core.PendingAction, WindfuryTotemRanks+1)

for rank := 1; rank <= WindfuryTotemRanks; rank++ {
config := shaman.newWindfuryTotemSpellConfig(rank)
Expand All @@ -37,14 +52,35 @@ func (shaman *Shaman) newWindfuryTotemSpellConfig(rank int) core.SpellConfig {
manaCost := WindfuryTotemManaCost[rank]
level := WindfuryTotemLevel[rank]

duration := time.Second * 120
// Create a trackable aura for totem weaving
buffAura := shaman.RegisterAura(core.Aura{
ActionID: core.ActionID{SpellID: WindfuryBuffAuraId[rank]},
Label: fmt.Sprintf("Windfury (Rank %d)", rank),
Duration: time.Second * 10,
})

periodicTriggerAura := shaman.RegisterAura(core.Aura{
Label: fmt.Sprintf("Windfury Trigger Dummy (Rank %d)", rank),
Duration: time.Minute * 2,
OnGain: func(_ *core.Aura, sim *core.Simulation) {
shaman.ActiveWindfuryTotemPeriodicAction = core.StartPeriodicAction(sim, core.PeriodicActionOptions{
Period: time.Second * 5, // Totem refreshes every 5 seconds
TickImmediately: true,
OnAction: func(_ *core.Simulation) {
buffAura.Activate(sim)
},
})
},
OnExpire: func(_ *core.Aura, sim *core.Simulation) {
shaman.ActiveWindfuryTotemPeriodicAction.Cancel(sim)
},
})

spell := shaman.newTotemSpellConfig(manaCost, spellId)
spell.RequiredLevel = level
spell.Rank = rank
spell.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, spell *core.Spell) {
shaman.TotemExpirations[EarthTotem] = sim.CurrentTime + duration
shaman.ActiveTotems[EarthTotem] = spell
shaman.setActiveAirTotem(sim, spell, periodicTriggerAura)
}
return spell
}
Expand Down Expand Up @@ -77,7 +113,6 @@ func (shaman *Shaman) newGraceOfAirTotemSpellConfig(rank int) core.SpellConfig {
manaCost := GraceOfAirTotemManaCost[rank]
level := GraceOfAirTotemLevel[rank]

duration := time.Second * 120
multiplier := []float64{1, 1.08, 1.15}[shaman.Talents.EnhancingTotems]

buffAura := core.GraceOfAirTotemAura(&shaman.Unit, multiplier)
Expand All @@ -86,10 +121,7 @@ func (shaman *Shaman) newGraceOfAirTotemSpellConfig(rank int) core.SpellConfig {
spell.RequiredLevel = level
spell.Rank = rank
spell.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, spell *core.Spell) {
shaman.TotemExpirations[AirTotem] = sim.CurrentTime + duration
shaman.ActiveTotems[AirTotem] = spell

buffAura.Activate(sim)
shaman.setActiveAirTotem(sim, spell, buffAura)
}
return spell
}
Expand Down Expand Up @@ -122,14 +154,11 @@ func (shaman *Shaman) newWindwallTotemSpellConfig(rank int) core.SpellConfig {
manaCost := WindwallTotemManaCost[rank]
level := WindwallTotemLevel[rank]

duration := time.Second * 120

spell := shaman.newTotemSpellConfig(manaCost, spellId)
spell.RequiredLevel = level
spell.Rank = rank
spell.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, spell *core.Spell) {
shaman.TotemExpirations[AirTotem] = sim.CurrentTime + duration
shaman.ActiveTotems[AirTotem] = spell
shaman.setActiveAirTotem(sim, spell, nil)
}
return spell
}
Loading

0 comments on commit c26c450

Please sign in to comment.