Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classic Shaman. Launching just Ele for now #65

Merged
merged 8 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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
Loading
Loading