Skip to content

Commit

Permalink
Merge pull request #4 from wowsims/kg/timeworn-pseudo
Browse files Browse the repository at this point in the history
Convert Timeworn to Pseudostat, Reorganize Character Stats
  • Loading branch information
Adamrch authored Nov 17, 2024
2 parents d6d965d + b678bc2 commit a382d3c
Show file tree
Hide file tree
Showing 42 changed files with 12,956 additions and 12,783 deletions.
Binary file modified assets/database/db.bin
Binary file not shown.
21,522 changes: 10,761 additions & 10,761 deletions assets/database/db.json

Large diffs are not rendered by default.

Binary file modified assets/database/leftover_db.bin
Binary file not shown.
3,284 changes: 1,642 additions & 1,642 deletions assets/database/leftover_db.json

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ enum Profession {
}

// Keep in sync with sim/core/stats/stats.go.
// NextIndex: 45
// NextIndex: 44
enum Stat {
StatStrength = 0;
StatAgility = 1;
Expand Down Expand Up @@ -119,7 +119,6 @@ enum Stat {
StatHealingPower = 41;
StatSpellDamage = 42;
StatFeralAttackPower = 43;
StatTimeworn = 44;
// DO NOT add new stats here without discussing it first; new stats come with
// a performance penalty.
}
Expand All @@ -128,6 +127,7 @@ enum Stat {
// between the UI and backend.
//
// It's also OK to include things here which aren't in the PseudoStats struct.
// NextIndex: 31
enum PseudoStat {
PseudoStatMainHandDps = 0;
PseudoStatOffHandDps = 1;
Expand Down Expand Up @@ -167,6 +167,9 @@ enum PseudoStat {
PseudoStatMeleeSpeedMultiplier = 27;
PseudoStatRangedSpeedMultiplier = 28;
PseudoStatBlockValuePerStrength = 29;

// Special Pseudostats
TimewornBonus = 30;
}

message UnitStats {
Expand Down Expand Up @@ -929,7 +932,7 @@ message SimDatabase {
}

// Contains only the Item info needed by the sim.
// NextIndex: 19
// NextIndex: 20
message SimItem {
int32 id = 1;
int32 requires_level = 16;
Expand All @@ -951,6 +954,8 @@ message SimItem {
string set_name = 14;
int32 set_id = 18;
repeated double weapon_skills = 15;

bool timeworn = 19;
}

// Extra enum for describing which items are eligible for an enchant, when
Expand Down
3 changes: 2 additions & 1 deletion proto/ui.proto
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ message UIFaction {
// Contains all information about an Item needed by the UI.
// Generally this will include everything needed by the sim, plus some
// additional data for displaying / filtering.
// NextIndex: 30
// NextIndex: 31
message UIItem {
int32 id = 1;
string name = 2;
Expand All @@ -71,6 +71,7 @@ message UIItem {
ItemQuality quality = 18;
bool unique = 19;
bool heroic = 20;
bool timeworn = 30;

// Classes that are allowed to use the item. Empty indicates no special class restrictions.
repeated Class class_allowlist = 21;
Expand Down
81 changes: 69 additions & 12 deletions sim/common/sod/item_effects/phase_4.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@ import (
)

const (
CraftOfTheShadows = 227280
DukesDomain = 227915
AccursedChalice = 228078
GerminatingPoisonseed = 228081
GloamingTreeheart = 228083
WoodcarvedMoonstalker = 228089
TheMoltenCore = 228122
FistOfTheFiresworn = 228139
BroodmothersBrooch = 228163
TreantsBane = 228486
FistOfTheFireswornMolten = 229374
StuddedTimbermawBrawlers = 227809
CraftOfTheShadows = 227280
SkyridersMasterworkStormhammer = 227886
DukesDomain = 227915
AccursedChalice = 228078
GerminatingPoisonseed = 228081
GloamingTreeheart = 228083
WoodcarvedMoonstalker = 228089
TheMoltenCore = 228122
FistOfTheFiresworn = 228139
BroodmothersBrooch = 228163
TreantsBane = 228486
FistOfTheFireswornMolten = 229374
StuddedTimbermawBrawlers = 227809
)

func init() {
Expand All @@ -37,6 +38,62 @@ func init() {
itemhelpers.CreateWeaponCoHProcDamage(FistOfTheFiresworn, "Fist of the Firesworn", 1.0, 461896, core.SpellSchoolFire, 70, 0, 0.15, core.DefenseTypeMagic)
itemhelpers.CreateWeaponCoHProcDamage(FistOfTheFireswornMolten, "Fist of the Firesworn", 1.0, 461896, core.SpellSchoolFire, 70, 0, 0.15, core.DefenseTypeMagic)

// https://www.wowhead.com/classic/item=227886/skyriders-masterwork-stormhammer
// Chance on hit: Blasts up to 3 targets for 105 to 145 Nature damage.
// Estimated based on data from WoW Armaments Discord
core.NewItemEffect(SkyridersMasterworkStormhammer, func(agent core.Agent) {
character := agent.GetCharacter()

maxHits := int(min(3, character.Env.GetNumTargets()))
procSpell := character.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 463946},
SpellSchool: core.SpellSchoolNature,
DefenseType: core.DefenseTypeMagic,
ProcMask: core.ProcMaskEmpty,
Flags: core.SpellFlagNoOnCastComplete | core.SpellFlagPassiveSpell,
BonusCoefficient: 0.1,
DamageMultiplier: 1,
ThreatMultiplier: 1,
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
for numHits := 0; numHits < maxHits; numHits++ {
spell.CalcAndDealDamage(sim, target, sim.Roll(105, 145), spell.OutcomeMagicHitAndCrit)
target = character.Env.NextTargetUnit(target)
}
},
})

core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{
Name: "Chain Lightning (Skyrider's Masterwork Stormhammer Melee)",
Callback: core.CallbackOnSpellHitDealt,
Outcome: core.OutcomeLanded,
ProcMask: core.ProcMaskMelee,
SpellFlagsExclude: core.SpellFlagSuppressWeaponProcs,
PPM: 4, // Someone in the armemnts Discord tested it out to 4 PPM
Handler: func(sim *core.Simulation, _ *core.Spell, result *core.SpellResult) {
procSpell.Cast(sim, result.Target)
},
})

icd := core.Cooldown{
Timer: character.NewTimer(),
Duration: time.Millisecond * 100,
}
core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{
Name: "Chain Lightning (Skyrider's Masterwork Stormhammer Spell)",
Callback: core.CallbackOnSpellHitDealt,
Outcome: core.OutcomeLanded,
ProcMask: core.ProcMaskSpellDamage,
ProcChance: .1,
Handler: func(sim *core.Simulation, _ *core.Spell, result *core.SpellResult) {
if !icd.IsReady(sim) {
return
}
procSpell.Cast(sim, result.Target)
icd.Use(sim)
},
})
})

// https://www.wowhead.com/classic/item=228486/treants-bane
// Equip: +75 Attack Power when fighting Elementals.
core.NewItemEffect(TreantsBane, func(agent core.Agent) {
Expand Down
100 changes: 0 additions & 100 deletions sim/common/sod/item_effects/phase_5.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package item_effects
import (
"time"

"github.com/wowsims/sod/sim/common/itemhelpers"
"github.com/wowsims/sod/sim/common/vanilla"
"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/proto"
Expand All @@ -12,34 +11,18 @@ import (

const (
Heartstriker = 230253
DrakeTalonCleaver = 230271 // 19353
ClawOfChromaggus = 230794
JekliksCrusher = 230911
ZulianSlicer = 230930
WillOfArlokk = 230939
HaldberdOfSmiting = 230991
NatPaglesFishTerminator = 231016
TigulesHarpoon = 231272
GrileksCarver = 231273
GrileksGrinder = 231274
BlazefuryRetributer = 231275
PitchforkOfMadness = 231277
Stormwrath = 231387
WrathOfWray = 231779
LightningsCell = 231784
Windstriker = 231817
GrileksCarverBloodied = 231846
GrileksGrinderBloodied = 231847
NatPaglesFishTerminatorBloodied = 231848
TigulesHarpoonBloodied = 231849
WillOfArlokkBloodied = 231850
JekliksCrusherBloodied = 231861
BlazefuryRetributerBloodied = 231862
PitchforkOfMadnessBloodied = 231864
HaldberdOfSmitingBloodied = 231870
ZulianSlicerBloodied = 231876
ClawOfChromaggusShadowflame = 232557
DrakeTalonCleaverShadowflame = 232562
)

func init() {
Expand Down Expand Up @@ -69,75 +52,12 @@ func init() {
ClawOfChromaggusEffect(agent.GetCharacter())
})

// https://www.wowhead.com/classic/item=230271/drake-talon-cleaver
// Chance on hit: Delivers a fatal wound for 300 damage.
// Original proc rate 1.0 increased to approximately 1.60 in SoD phase 5
itemhelpers.CreateWeaponCoHProcDamage(DrakeTalonCleaver, "Drake Talon Cleaver", 1.0, 467167, core.SpellSchoolPhysical, 300, 0, 0.0, core.DefenseTypeMelee) // TBD confirm 1 ppm in SoD
// https://www.wowhead.com/classic/item=232562/drake-talon-cleaver
itemhelpers.CreateWeaponCoHProcDamage(DrakeTalonCleaverShadowflame, "Drake Talon Cleaver", 1.0, 467167, core.SpellSchoolPhysical, 300, 0, 0.0, core.DefenseTypeMelee) // TBD confirm 1 ppm in SoD

// https://www.wowhead.com/classic/item=231273/grileks-carver
// +141 Attack Power when fighting Dragonkin.
core.NewItemEffect(GrileksCarver, func(agent core.Agent) {
character := agent.GetCharacter()
if character.CurrentTarget.MobType == proto.MobType_MobTypeDragonkin {
character.PseudoStats.MobTypeAttackPower += 141
}
})
core.NewItemEffect(GrileksCarverBloodied, func(agent core.Agent) {
character := agent.GetCharacter()
if character.CurrentTarget.MobType == proto.MobType_MobTypeDragonkin {
character.PseudoStats.MobTypeAttackPower += 141
}
})

// https://www.wowhead.com/classic/item=231274/grileks-grinder
// +60 Attack Power when fighting Dragonkin.
core.NewItemEffect(GrileksGrinder, func(agent core.Agent) {
character := agent.GetCharacter()
if character.CurrentTarget.MobType == proto.MobType_MobTypeDragonkin {
character.PseudoStats.MobTypeAttackPower += 60
}
})
core.NewItemEffect(GrileksGrinderBloodied, func(agent core.Agent) {
character := agent.GetCharacter()
if character.CurrentTarget.MobType == proto.MobType_MobTypeDragonkin {
character.PseudoStats.MobTypeAttackPower += 60
}
})

// https://www.wowhead.com/classic/item=230991/halberd-of-smiting
// Equip: Chance to decapitate the target on a melee swing, causing 452 to 676 damage.
itemhelpers.CreateWeaponEquipProcDamage(HaldberdOfSmiting, "Halberd of Smiting", 2.1, 467819, core.SpellSchoolPhysical, 452, 224, 0.0, core.DefenseTypeMelee) // Works as phantom strike
itemhelpers.CreateWeaponEquipProcDamage(HaldberdOfSmitingBloodied, "Halberd of Smiting", 2.1, 467819, core.SpellSchoolPhysical, 452, 224, 0.0, core.DefenseTypeMelee) // Works as phantom strike

// https://www.wowhead.com/classic/item=230911/jekliks-crusher
// Chance on hit: Wounds the target for 200 to 220 damage.
// Original proc rate 4.0 lowered to 1.5 in SoD phase 5
itemhelpers.CreateWeaponCoHProcDamage(JekliksCrusher, "Jeklik's Crusher", 1.5, 467642, core.SpellSchoolPhysical, 200, 20, 0.0, core.DefenseTypeMelee)
itemhelpers.CreateWeaponCoHProcDamage(JekliksCrusherBloodied, "Jeklik's Crusher", 1.5, 467642, core.SpellSchoolPhysical, 200, 20, 0.0, core.DefenseTypeMelee)

// https://www.wowhead.com/classic/item=231016/nat-pagles-fish-terminator
// Chance on hit: Zap nearby enemies dealing 175 to 225 damage to them. Will affect up to 4 targets.
core.NewItemEffect(NatPaglesFishTerminator, fishTerminatorEffect)
// https://www.wowhead.com/classic/item=231848/nat-pagles-fish-terminator
core.NewItemEffect(NatPaglesFishTerminatorBloodied, fishTerminatorEffect)

// https://www.wowhead.com/classic/item=231277/pitchfork-of-madness
// +141 Attack Power when fighting Demons.
core.NewItemEffect(PitchforkOfMadness, func(agent core.Agent) {
character := agent.GetCharacter()
if character.CurrentTarget.MobType == proto.MobType_MobTypeDemon {
character.PseudoStats.MobTypeAttackPower += 141
}
})
core.NewItemEffect(PitchforkOfMadnessBloodied, func(agent core.Agent) {
character := agent.GetCharacter()
if character.CurrentTarget.MobType == proto.MobType_MobTypeDemon {
character.PseudoStats.MobTypeAttackPower += 141
}
})

// https://www.wowhead.com/classic/item=231387/stormwrath-sanctified-shortblade-of-the-galefinder
// Equip: Damaging non-periodic spells have a chance to blast up to 3 targets for 181 to 229.
// (Proc chance: 10%, 100ms cooldown)
Expand Down Expand Up @@ -181,21 +101,6 @@ func init() {
})
})

// https://www.wowhead.com/classic/item=231272/tigules-harpoon
// +99 Attack Power when fighting Beasts.
core.NewItemEffect(TigulesHarpoon, func(agent core.Agent) {
character := agent.GetCharacter()
if character.CurrentTarget.MobType == proto.MobType_MobTypeBeast {
character.PseudoStats.MobTypeAttackPower += 99
}
})
core.NewItemEffect(TigulesHarpoonBloodied, func(agent core.Agent) {
character := agent.GetCharacter()
if character.CurrentTarget.MobType == proto.MobType_MobTypeBeast {
character.PseudoStats.MobTypeAttackPower += 99
}
})

// https://www.wowhead.com/classic/item=230939/will-of-arlokk
// Use: Calls forth a charmed snake to worship you, increasing your Spirit by 200 for 20 sec. (2 Min Cooldown)
core.NewItemEffect(WillOfArlokk, func(agent core.Agent) {
Expand Down Expand Up @@ -227,11 +132,6 @@ func init() {
})
})

// https://www.wowhead.com/classic/item=230930/zulian-slicer
// Chance on hit: Slices the enemy for 72 to 96 Nature damage.
itemhelpers.CreateWeaponCoHProcDamage(ZulianSlicer, "Zulian Slicer", 1.2, 467738, core.SpellSchoolNature, 72, 24, 0.35, core.DefenseTypeMelee)
itemhelpers.CreateWeaponCoHProcDamage(ZulianSlicerBloodied, "Zulian Slicer", 1.2, 467738, core.SpellSchoolNature, 72, 24, 0.35, core.DefenseTypeMelee)

///////////////////////////////////////////////////////////////////////////
// Trinkets
///////////////////////////////////////////////////////////////////////////
Expand Down
12 changes: 6 additions & 6 deletions sim/common/sod/item_effects/phase_6.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func init() {
// Increases the damage dealt by all of your damage over time spells by 2% per piece of Timeworn armor equipped.
func TimewornDecayAura(agent core.Agent) {
character := agent.GetCharacter()
multiplier := 1 + 0.02*character.GetStat(stats.Timeworn)
multiplier := 1 + 0.02*float64(character.PseudoStats.TimewornBonus)

character.OnSpellRegistered(func(spell *core.Spell) {
if spell.SpellCode != 0 && len(spell.Dots()) > 0 {
Expand All @@ -122,7 +122,7 @@ func TimewornDecayAura(agent core.Agent) {
// Reduces the chance for your attacks to be dodged or parried by 1% per piece of Timeworn armor equipped.
func TimeswornExpertiseAura(agent core.Agent) {
character := agent.GetCharacter()
stats := stats.Stats{stats.Expertise: character.GetStat(stats.Timeworn) * core.ExpertiseRatingPerExpertiseChance}
stats := stats.Stats{stats.Expertise: float64(character.PseudoStats.TimewornBonus) * core.ExpertiseRatingPerExpertiseChance}

core.MakePermanent(character.GetOrRegisterAura(core.Aura{
ActionID: core.ActionID{SpellID: 1214218},
Expand All @@ -149,7 +149,7 @@ func TimeswornExpertiseAura(agent core.Agent) {
// Increases the effectiveness of your healing and shielding spells by 2% per piece of Timeworn armor equipped.
func TimewornHealing(agent core.Agent) {
character := agent.GetCharacter()
healShieldMultiplier := 1 + 0.02*character.GetStat(stats.Timeworn)
healShieldMultiplier := 1 + 0.02*float64(character.PseudoStats.TimewornBonus)

core.MakePermanent(character.GetOrRegisterAura(core.Aura{
ActionID: core.ActionID{SpellID: 1213405},
Expand All @@ -169,7 +169,7 @@ func TimewornHealing(agent core.Agent) {
// Increases the effectiveness of your Fire damage spells by 3% per piece of Timeworn armor equipped.
func TimeswornPyromancyAura(agent core.Agent) {
character := agent.GetCharacter()
fireMultiplier := 1 + 0.03*character.GetStat(stats.Timeworn)
fireMultiplier := 1 + 0.03*float64(character.PseudoStats.TimewornBonus)

core.MakePermanent(character.GetOrRegisterAura(core.Aura{
ActionID: core.ActionID{SpellID: 1215404},
Expand All @@ -187,7 +187,7 @@ func TimeswornPyromancyAura(agent core.Agent) {
// Increases the casting speed of your spells by 2% per piece of Timeworn armor equipped.
func TimeswornSpellAura(agent core.Agent) {
character := agent.GetCharacter()
castSpeedMultiplier := 1 / (1 - 0.02*character.GetStat(stats.Timeworn))
castSpeedMultiplier := 1 / (1 - 0.02*float64(character.PseudoStats.TimewornBonus))

core.MakePermanent(character.GetOrRegisterAura(core.Aura{
ActionID: core.ActionID{SpellID: 1213398},
Expand All @@ -206,7 +206,7 @@ func TimeswornSpellAura(agent core.Agent) {
// (100ms cooldown)
func TimeswornStrikeAura(agent core.Agent) {
character := agent.GetCharacter()
procChance := character.Unit.GetStat(stats.Timeworn) * 0.01
procChance := float64(character.PseudoStats.TimewornBonus) * 0.01

timeStrikeSpell := character.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 1213381},
Expand Down
Loading

0 comments on commit a382d3c

Please sign in to comment.