Skip to content

Commit

Permalink
Merge pull request #65 from wowsims/classic-shaman
Browse files Browse the repository at this point in the history
Classic Shaman. Launching just Ele for now
  • Loading branch information
kayla-glick authored Jan 13, 2025
2 parents cd62300 + 61bdddb commit 1b51b69
Show file tree
Hide file tree
Showing 62 changed files with 2,583 additions and 2,560 deletions.
Binary file modified assets/database/db.bin
Binary file not shown.
64 changes: 32 additions & 32 deletions assets/database/db.json

Large diffs are not rendered by default.

Binary file modified assets/database/leftover_db.bin
Binary file not shown.
68 changes: 34 additions & 34 deletions assets/database/leftover_db.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion proto/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import "shaman.proto";
import "warlock.proto";
import "warrior.proto";

// NextIndex: 47
// NextIndex: 49
message Player {
// Label used for logging.
string name = 1;
Expand Down Expand Up @@ -54,6 +54,10 @@ message Player {
int32 isb_warlocks = 43;
int32 isb_spriests = 44;

// Stormstrike Info
double stormstrike_frequency = 47;
double stormstrike_nature_attacker_frequency = 48;

// Items/enchants/etc to include in the database.
SimDatabase database = 18;
HealingModel healing_model = 19;
Expand Down
1 change: 1 addition & 0 deletions sim/common/includes.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ package common

// Just import other directories, so importing common from elsewhere is enough.
import (
_ "github.com/wowsims/classic/sim/common/item_effects"
_ "github.com/wowsims/classic/sim/common/item_sets"
)
17 changes: 0 additions & 17 deletions sim/common/item_effects.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ const (
ZandalariHeroBadge = 19948
ZandalariHeroMedallion = 19949
ZandalariHeroCharm = 19950
MarkOfTheChampionPhys = 23206
MarkOfTheChampionSpell = 23207
Ragehammer = 10626
SulfurasHandOfRagnaros = 17182
SulfuronHammer = 17193
Expand Down Expand Up @@ -2349,21 +2347,6 @@ func init() {
})
})

/* core.NewItemEffect(MarkOfTheChampionPhys, func(agent core.Agent) {
character := agent.GetCharacter()
if character.CurrentTarget.MobType == proto.MobType_MobTypeUndead || character.CurrentTarget.MobType == proto.MobType_MobTypeDemon {
character.PseudoStats.MobTypeAttackPower += 150
}
})
core.NewItemEffect(MarkOfTheChampionSpell, func(agent core.Agent) {
character := agent.GetCharacter()
if character.CurrentTarget.MobType == proto.MobType_MobTypeUndead || character.CurrentTarget.MobType == proto.MobType_MobTypeDemon {
character.PseudoStats.MobTypeSpellPower += 85
}
}) */

// https://www.wowhead.com/classic/item=17774/mark-of-the-chosen
core.NewItemEffect(MarkOfTheChosen, func(agent core.Agent) {
character := agent.GetCharacter()
Expand Down
44 changes: 44 additions & 0 deletions sim/common/item_effects/phase_6.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package item_effects

import (
"time"

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

const (
TheRestrainedEssenceOfSapphiron = 23046
MarkOfTheChampionPhys = 23206
MarkOfTheChampionSpell = 23207
)

func init() {
core.AddEffectsToTest = false

// https://wowhead.com/classic/item=23206?level=60&rand=0
// Equip: +150 Attack Power when fighting Undead and Demons.
core.NewItemEffect(MarkOfTheChampionPhys, func(agent core.Agent) {
character := agent.GetCharacter()
if character.CurrentTarget.MobType == proto.MobType_MobTypeUndead || character.CurrentTarget.MobType == proto.MobType_MobTypeDemon {
character.PseudoStats.MobTypeAttackPower += 150
}
})

// https://www.wowhead.com/classic/item=23207/mark-of-the-champion
// Equip: Increases damage done to Undead and Demons by magical spells and effects by up to 85.
core.NewItemEffect(MarkOfTheChampionSpell, func(agent core.Agent) {
character := agent.GetCharacter()

if character.CurrentTarget.MobType == proto.MobType_MobTypeUndead || character.CurrentTarget.MobType == proto.MobType_MobTypeDemon {
character.PseudoStats.MobTypeSpellPower += 85
}
})

// https://www.wowhead.com/classic/item=23046/the-restrained-essence-of-sapphiron
// Use: Increases damage and healing done by magical spells and effects by up to 130 for 20 sec. (2 Min Cooldown)
core.NewSimpleStatOffensiveTrinketEffect(TheRestrainedEssenceOfSapphiron, stats.Stats{stats.SpellPower: 130}, time.Second*20, time.Minute*2)

core.AddEffectsToTest = true
}
3 changes: 3 additions & 0 deletions sim/core/character.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ type Character struct {

// ISB External configuration
IsbConfig IsbConfig
// Stormstrike External Configuration
StormstrikeConfig StormstrikeConfig

// Base stats for this Character.
baseStats stats.Stats
Expand Down Expand Up @@ -146,6 +148,7 @@ func NewCharacter(party *Party, partyIndex int, player *proto.Player) Character
}

character.createIsbConfig(player)
character.createStormstrikeConfig(player)

character.baseStats = getBaseStatsCombo(character.Race, character.Class)

Expand Down
97 changes: 84 additions & 13 deletions sim/core/debuffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ func applyDebuffEffects(target *Unit, targetIdx int, debuffs *proto.Debuffs, rai
}, raid)
}

if debuffs.Stormstrike {
MakePermanent(StormstrikeAura(target))
if debuffs.Stormstrike && targetIdx == 0 {
ExternalStormstrikeCaster(debuffs, target)
}

if debuffs.GiftOfArthas {
Expand Down Expand Up @@ -179,21 +179,92 @@ func applyDebuffEffects(target *Unit, targetIdx int, debuffs *proto.Debuffs, rai
}
}

type StormstrikeConfig struct {
stormstrikeFrequency float64
natureAttackersFrequency float64
}

func (character *Character) createStormstrikeConfig(player *proto.Player) {
character.StormstrikeConfig = StormstrikeConfig{
stormstrikeFrequency: player.StormstrikeFrequency,
natureAttackersFrequency: player.StormstrikeNatureAttackerFrequency,
}
// Defaults if not configured
if character.StormstrikeConfig.stormstrikeFrequency == 0.0 {
character.StormstrikeConfig.stormstrikeFrequency = 20.0
}
}

const (
StormstrikeCooldown = time.Second * 20
)

func ExternalStormstrikeCaster(_ *proto.Debuffs, target *Unit) {
stormstrikeConfig := target.Env.Raid.Parties[0].Players[0].GetCharacter().StormstrikeConfig
stormstrikeAura := StormstrikeAura(target)
var pa *PendingAction
MakePermanent(target.GetOrRegisterAura(Aura{
Label: "Stormstrike External Proc Aura",
OnGain: func(aura *Aura, sim *Simulation) {
pa = NewPeriodicAction(sim, PeriodicActionOptions{
Period: DurationFromSeconds(stormstrikeConfig.stormstrikeFrequency),
TickImmediately: true,
OnAction: func(s *Simulation) {
stormstrikeAura.Activate(sim)
stormstrikeAura.SetStacks(sim, stormstrikeAura.MaxStacks)
},
})
sim.AddPendingAction(pa)
},
OnExpire: func(aura *Aura, sim *Simulation) {
pa.Cancel(sim)
},
}))
}

func StormstrikeAura(unit *Unit) *Aura {
stormstrikeConfig := unit.Env.Raid.Parties[0].Players[0].GetCharacter().StormstrikeConfig

aura := unit.GetOrRegisterAura(Aura{
Label: "Stormstrike",
ActionID: ActionID{SpellID: 17364},
Duration: time.Second * 12,
Label: "Stormstrike",
ActionID: ActionID{SpellID: 17364},
Duration: time.Second * 12,
MaxStacks: 2,
OnGain: func(aura *Aura, sim *Simulation) {
aura.Unit.PseudoStats.SchoolDamageTakenMultiplier[stats.SchoolIndexNature] *= 1.20
},
OnExpire: func(aura *Aura, sim *Simulation) {
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 {
aura.RemoveStack(sim)
}
},
})

//Needs updating to classic version
// External attacks using nature strike
if stormstrikeConfig.natureAttackersFrequency > 0 {
aura.OnReset = func(aura *Aura, sim *Simulation) {
sim.AddPendingAction(
NewPeriodicAction(sim, PeriodicActionOptions{
Period: DurationFromSeconds(stormstrikeConfig.natureAttackersFrequency),
OnAction: func(s *Simulation) {
if aura.IsActive() {
aura.RemoveStack(sim)
}
},
}),
)
}
}

return aura
}

func ExternalIsbCaster(_ *proto.Debuffs, target *Unit) {
isbConfig := target.Env.Raid.Parties[0].Players[0].GetCharacter().IsbConfig
baseStacks := int32(ISBNumStacksBase)
isbAura := ImprovedShadowBoltAura(target, 5, baseStacks)
isbAura := ImprovedShadowBoltAura(target, 5)
isbCrit := isbConfig.casterCrit / 100.0
var pa *PendingAction
MakePermanent(target.GetOrRegisterAura(Aura{
Expand All @@ -205,7 +276,7 @@ func ExternalIsbCaster(_ *proto.Debuffs, target *Unit) {
for i := 0; i < int(isbConfig.isbWarlocks); i++ {
if sim.Proc(isbCrit, "External Isb Crit") {
isbAura.Activate(sim)
isbAura.SetStacks(sim, baseStacks)
isbAura.SetStacks(sim, isbAura.MaxStacks)
} else if isbAura.IsActive() {
isbAura.RemoveStack(sim)
}
Expand Down Expand Up @@ -250,7 +321,7 @@ const (
ISBNumStacksBase = 4
)

func ImprovedShadowBoltAura(unit *Unit, rank int32, stackCount int32) *Aura {
func ImprovedShadowBoltAura(unit *Unit, rank int32) *Aura {
isbLabel := "Improved Shadow Bolt"
if unit.GetAura(isbLabel) != nil {
return unit.GetAura(isbLabel)
Expand All @@ -268,7 +339,7 @@ func ImprovedShadowBoltAura(unit *Unit, rank int32, stackCount int32) *Aura {
Label: isbLabel,
ActionID: ActionID{SpellID: 17800},
Duration: 12 * time.Second,
MaxStacks: stackCount,
MaxStacks: ISBNumStacksBase,
OnReset: func(aura *Aura, sim *Simulation) {
// External shadow priests simulation
if externalShadowPriests > 0 {
Expand Down Expand Up @@ -751,10 +822,10 @@ func ExposeWeaknessAura(target *Unit) *Aura {
ActionID: ActionID{SpellID: 23577},
Label: "Expose Weakness",
Duration: time.Second * 7,
OnGain: func(aura *Aura, sim *Simulation) {
OnGain: func(aura *Aura, sim *Simulation) {
target.PseudoStats.BonusRangedAttackPowerTaken += bonus
},
OnExpire: func(aura *Aura, sim *Simulation) {
OnExpire: func(aura *Aura, sim *Simulation) {
target.PseudoStats.BonusRangedAttackPowerTaken -= bonus
},
})
Expand Down
40 changes: 20 additions & 20 deletions sim/druid/balance/TestP1Balance.results
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ stat_weights_results: {
weights: 0
weights: 0
weights: 0
weights: 0.02507
weights: 0.02529
weights: 0
weights: 0.44857
weights: 0.46351
weights: 0
weights: 0
weights: 0
weights: 0
weights: 0
weights: 0
weights: 0
weights: 2.16443
weights: 1.70064
weights: 2.16569
weights: 1.7517
weights: 0
weights: 0
weights: 0
Expand Down Expand Up @@ -99,29 +99,29 @@ stat_weights_results: {
dps_results: {
key: "TestP1Balance-Phase1-Average-Default"
value: {
dps: 155.39007
tps: 168.86746
dps: 160.65508
tps: 174.13247
}
}
dps_results: {
key: "TestP1Balance-Phase1-Settings-NightElf-p0.bis-Default-p1-FullBuffs-P1-Consumes-LongMultiTarget"
value: {
dps: 154.27378
tps: 402.57966
dps: 157.76801
tps: 406.0739
}
}
dps_results: {
key: "TestP1Balance-Phase1-Settings-NightElf-p0.bis-Default-p1-FullBuffs-P1-Consumes-LongSingleTarget"
value: {
dps: 154.27378
tps: 166.68907
dps: 157.76801
tps: 170.1833
}
}
dps_results: {
key: "TestP1Balance-Phase1-Settings-NightElf-p0.bis-Default-p1-FullBuffs-P1-Consumes-ShortSingleTarget"
value: {
dps: 148.49645
tps: 157.09674
dps: 152.61124
tps: 161.21153
}
}
dps_results: {
Expand All @@ -148,22 +148,22 @@ dps_results: {
dps_results: {
key: "TestP1Balance-Phase1-Settings-Tauren-p0.bis-Default-p1-FullBuffs-P1-Consumes-LongMultiTarget"
value: {
dps: 153.21715
tps: 420.2473
dps: 156.60707
tps: 423.63721
}
}
dps_results: {
key: "TestP1Balance-Phase1-Settings-Tauren-p0.bis-Default-p1-FullBuffs-P1-Consumes-LongSingleTarget"
value: {
dps: 153.21715
tps: 166.56866
dps: 156.60707
tps: 169.95858
}
}
dps_results: {
key: "TestP1Balance-Phase1-Settings-Tauren-p0.bis-Default-p1-FullBuffs-P1-Consumes-ShortSingleTarget"
value: {
dps: 147.42161
tps: 156.0408
dps: 151.53758
tps: 160.15677
}
}
dps_results: {
Expand All @@ -190,7 +190,7 @@ dps_results: {
dps_results: {
key: "TestP1Balance-Phase1-SwitchInFrontOfTarget-Default"
value: {
dps: 153.88456
tps: 167.30175
dps: 158.97674
tps: 172.39393
}
}
Loading

0 comments on commit 1b51b69

Please sign in to comment.