Skip to content

Commit

Permalink
add conqueror protector and dominator
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamrch committed Nov 16, 2024
1 parent b33b68e commit 1acf414
Show file tree
Hide file tree
Showing 12 changed files with 12,544 additions and 12,406 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.

3 changes: 2 additions & 1 deletion 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: 44
// NextIndex: 45
enum Stat {
StatStrength = 0;
StatAgility = 1;
Expand Down Expand Up @@ -119,6 +119,7 @@ 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 Down
122 changes: 122 additions & 0 deletions sim/common/sod/item_effects/phase_6.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
package item_effects

import (
"time"

"github.com/wowsims/sod/sim/core"
"github.com/wowsims/sod/sim/core/stats"
)

const (
SignetRingDominatorR5 = 234034
SignetRingDominatorR4 = 234030
SignetRingDominatorR3 = 234026
SignetRingDominatorR2 = 234021
SignetRingDominatorR1 = 234017
SignetRingInvokerR5 = 234032
SignetRingInvokerR4 = 234028
SignetRingInvokerR3 = 234024
SignetRingInvokerR2 = 234020
SignetRingInvokerR1 = 234016
SignetRingFlamekeeperR5 = 234964
SignetRingFlamekeeperR4 = 234965
SignetRingFlamekeeperR3 = 234966
SignetRingFlamekeeperR2 = 234967
SignetRingFlamekeeperR1 = 234968
SignetRingPreserverR5 = 234033
SignetRingPreserverR4 = 234029
SignetRingPreserverR3 = 234025
SignetRingPreserverR2 = 234023
SignetRingPreserverR1 = 234019
SignetRingProtectorR5 = 234035
SignetRingProtectorR4 = 234031
SignetRingProtectorR3 = 234027
SignetRingProtectorR2 = 234022
SignetRingProtectorR1 = 234018
SignetRingSubjugatorR5 = 234436
SignetRingSubjugatorR4 = 234437
SignetRingSubjugatorR3 = 234438
SignetRingSubjugatorR2 = 234439
SignetRingSubjugatorR1 = 234440
SignetRingConquerorR5 = 234202
SignetRingConquerorR4 = 234201
SignetRingConquerorR3 = 234200
SignetRingConquerorR2 = 234199
SignetRingConquerorR1 = 234198
)

func init() {
core.AddEffectsToTest = false

///////////////////////////////////////////////////////////////////////////
// Rings
///////////////////////////////////////////////////////////////////////////

core.NewItemEffect(SignetRingDominatorR5, func(agent core.Agent) { TimeswornStrikeAura(agent.GetCharacter()) })
core.NewItemEffect(SignetRingDominatorR4, func(agent core.Agent) { TimeswornStrikeAura(agent.GetCharacter()) })
core.NewItemEffect(SignetRingDominatorR3, func(agent core.Agent) { TimeswornStrikeAura(agent.GetCharacter()) })
core.NewItemEffect(SignetRingDominatorR2, func(agent core.Agent) { TimeswornStrikeAura(agent.GetCharacter()) })
core.NewItemEffect(SignetRingDominatorR1, func(agent core.Agent) { TimeswornStrikeAura(agent.GetCharacter()) })
core.NewItemEffect(SignetRingConquerorR5, func(agent core.Agent) { TimeswornStrikeAura(agent.GetCharacter()) })
core.NewItemEffect(SignetRingConquerorR4, func(agent core.Agent) { TimeswornStrikeAura(agent.GetCharacter()) })
core.NewItemEffect(SignetRingConquerorR3, func(agent core.Agent) { TimeswornStrikeAura(agent.GetCharacter()) })
core.NewItemEffect(SignetRingConquerorR2, func(agent core.Agent) { TimeswornStrikeAura(agent.GetCharacter()) })
core.NewItemEffect(SignetRingConquerorR1, func(agent core.Agent) { TimeswornStrikeAura(agent.GetCharacter()) })

core.NewItemEffect(SignetRingProtectorR5, func(agent core.Agent) { TimeswornExpertiseAura(agent.GetCharacter()) })
core.NewItemEffect(SignetRingProtectorR4, func(agent core.Agent) { TimeswornExpertiseAura(agent.GetCharacter()) })
core.NewItemEffect(SignetRingProtectorR3, func(agent core.Agent) { TimeswornExpertiseAura(agent.GetCharacter()) })
core.NewItemEffect(SignetRingProtectorR2, func(agent core.Agent) { TimeswornExpertiseAura(agent.GetCharacter()) })
core.NewItemEffect(SignetRingProtectorR1, func(agent core.Agent) { TimeswornExpertiseAura(agent.GetCharacter()) })

}
func TimeswornExpertiseAura(character *core.Character) {
core.MakePermanent(character.GetOrRegisterAura(core.Aura{
ActionID: core.ActionID{SpellID: 1214218},
Label: "Timeworn Expertise Aura",
Duration: core.NeverExpires,
BuildPhase: core.CharacterBuildPhaseBuffs,
OnReset: func(aura *core.Aura, sim *core.Simulation) {
aura.Activate(sim)
character.AddStatDynamic(sim, stats.Expertise, aura.Unit.GetStat(stats.Timeworn)*core.CritRatingPerCritChance)
},
}))
}

func TimeswornStrikeAura(character *core.Character) {

chance := character.Unit.GetStat(stats.Timeworn) * 0.01

timeStrikeSpell := character.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 1213381},
SpellSchool: core.SpellSchoolPhysical,
DefenseType: core.DefenseTypeMelee,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagNoOnCastComplete,

DamageMultiplier: 1,
ThreatMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
baseDamage := spell.Unit.MHNormalizedWeaponDamage(sim, spell.MeleeAttackPower())
spell.CalcAndDealDamage(sim, target, baseDamage, spell.OutcomeMeleeSpecialHitAndCrit)
},
})

core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{
Name: "Timeworn Strike Aura",
ActionID: core.ActionID{SpellID: 468782},
Callback: core.CallbackOnSpellHitDealt,
Outcome: core.OutcomeLanded,
ProcMask: core.ProcMaskWhiteHit,
ICD: time.Millisecond * 100,
Handler: func(sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
roll := sim.RandomFloat("Timeworn Strike Aura")

if roll < chance {
character.Unit.GetStat(stats.Timeworn)
timeStrikeSpell.Cast(sim, result.Target)
}
},
})
}
4 changes: 2 additions & 2 deletions sim/common/vanilla/item_effects.go
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ func init() {
ThreatMultiplier: 1,
BonusCoefficient: 1.0, /// TBD - Best guess based on similarity to shadowstrike
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
result := spell.CalcAndDealDamage(sim, target, sim.Roll(180, 220), spell.OutcomeMagicHit)
result := spell.CalcAndDealDamage(sim, target, sim.Roll(171, 193), spell.OutcomeMagicHit)
character.GainHealth(sim, result.Damage, healthMetrics)
},
})
Expand All @@ -1246,7 +1246,7 @@ func init() {
ThreatMultiplier: 1,
BonusCoefficient: 1.0, // TBD - Best guess based on similarity to shadowstrike
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
result := spell.CalcAndDealDamage(sim, target, sim.Roll(180, 220), spell.OutcomeMagicHit)
result := spell.CalcAndDealDamage(sim, target, sim.Roll(171, 193), spell.OutcomeMagicHit)
character.GainHealth(sim, result.Damage, healthMetrics)
},
})
Expand Down
3 changes: 3 additions & 0 deletions sim/core/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const (
HealingPower
SpellDamage
FeralAttackPower
Timeworn

// DO NOT add new stats here without discussing it first; new stats come with
// a performance penalty.
Expand Down Expand Up @@ -269,6 +270,8 @@ func (s Stat) StatName() string {
return "ArcaneResistance"
case FeralAttackPower:
return "FeralAttackPower"
case Timeworn:
return "Timeworn"
}

return "none"
Expand Down
6 changes: 6 additions & 0 deletions tools/database/wowhead_tooltips.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ var armorPenetrationRegex = regexp.MustCompile(`Increases armor penetration rati
var armorPenetrationRegex2 = regexp.MustCompile(`Increases your armor penetration by <!--rtg44-->([0-9]+)\.`)

var expertiseRegex = regexp.MustCompile(`Reduces the chance for your attacks to be dodged or parried by ([0-9]+)%\.`)
var timewornRegex = regexp.MustCompile(`<span style=\"color: #CD7F32\">Timeworn<\/span>`)
var weaponDamageRegex = regexp.MustCompile(`<!--dmg-->([0-9]+) - ([0-9]+)`)
var weaponDamageRegex2 = regexp.MustCompile(`<!--dmg-->([0-9]+) Damage`)
var weaponDamageBonusSchoolRegex = regexp.MustCompile(`\+ ([0-9]+) - ([0-9]+) [a-zA-Z]+ Damage`)
Expand Down Expand Up @@ -255,6 +256,10 @@ func (item WowheadItemResponse) GetStats() Stats {
sp := float64(item.GetIntValue(spellPowerRegex)) + float64(item.GetIntValue(spellPowerRegex2)) + float64(item.GetIntValue(spellPowerRegex3))
baseAP := float64(item.GetIntValue(attackPowerRegex)) + float64(item.GetIntValue(attackPowerRegex2))
armor, bonusArmor := item.GetArmorValues()
timeworn := 0
if item.GetTooltipRegexString(timewornRegex, 0) != "" {
timeworn = 1
}
return Stats{
proto.Stat_StatArmor: float64(armor),
proto.Stat_StatBonusArmor: float64(bonusArmor),
Expand Down Expand Up @@ -282,6 +287,7 @@ func (item WowheadItemResponse) GetStats() Stats {
proto.Stat_StatRangedAttackPower: baseAP + float64(item.GetIntValue(rangedAttackPowerRegex)) + float64(item.GetIntValue(rangedAttackPowerRegex2)) + float64(item.GetIntValue(rangedAttackPowerRegex3)),
proto.Stat_StatArmorPenetration: float64(item.GetIntValue(armorPenetrationRegex) + item.GetIntValue(armorPenetrationRegex2)),
proto.Stat_StatExpertise: float64(item.GetIntValue(expertiseRegex)),
proto.Stat_StatTimeworn: float64(timeworn),
proto.Stat_StatDefense: float64(item.GetIntValue(defenseRegex)),
proto.Stat_StatBlock: float64(item.GetIntValue(blockRegex)),
proto.Stat_StatBlockValue: float64(item.GetIntValue(blockValueRegex) + item.GetIntValue(blockValueRegex2)),
Expand Down
2 changes: 2 additions & 0 deletions ui/core/components/exporters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ export class Individual60UEPExporter<SpecType extends Spec> extends Exporter {
[Stat.StatBonusArmor]: 'armorBonus',
[Stat.StatHealingPower]: 'Healing',
[Stat.StatFeralAttackPower]: 'feralAttackPower',
[Stat.StatTimeworn]: 'timeworn',
};
static pseudoStatNames: Partial<Record<PseudoStat, string>> = {
[PseudoStat.PseudoStatMainHandDps]: 'dps',
Expand Down Expand Up @@ -491,6 +492,7 @@ export class IndividualPawnEPExporter<SpecType extends Spec> extends Exporter {
[Stat.StatBonusArmor]: 'Armor2',
[Stat.StatHealingPower]: 'Healing',
[Stat.StatFeralAttackPower]: 'FeralAttackPower',
[Stat.StatTimeworn]: 'timeworn',
};
static pseudoStatNames: Partial<Record<PseudoStat, string>> = {
[PseudoStat.PseudoStatMainHandDps]: 'MeleeDps',
Expand Down
2 changes: 2 additions & 0 deletions ui/core/proto_utils/names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export const statOrder: Array<Stat> = [
Stat.StatMeleeHaste,
Stat.StatArmorPenetration,
Stat.StatExpertise,
Stat.StatTimeworn,
Stat.StatEnergy,
Stat.StatRage,
Stat.StatDefense,
Expand Down Expand Up @@ -176,6 +177,7 @@ export const statNames: Map<Stat, string> = new Map([
[Stat.StatMeleeHaste, 'Melee Speed'],
[Stat.StatArmorPenetration, 'Armor Pen'],
[Stat.StatExpertise, 'Expertise'],
[Stat.StatTimeworn, 'Timeworn'],
[Stat.StatMana, 'Mana'],
[Stat.StatEnergy, 'Energy'],
[Stat.StatRage, 'Rage'],
Expand Down
2 changes: 2 additions & 0 deletions ui/retribution_paladin/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecRetributionPaladin, {
Stat.StatMeleeHit,
Stat.StatMeleeCrit,
Stat.StatExpertise,
Stat.StatTimeworn,
Stat.StatSpellPower,
Stat.StatHolyPower,
Stat.StatSpellCrit,
Expand All @@ -65,6 +66,7 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecRetributionPaladin, {
Stat.StatMeleeCrit,
Stat.StatMeleeHaste,
Stat.StatExpertise,
Stat.StatTimeworn,
Stat.StatSpellHaste,
Stat.StatSpellPower,
Stat.StatHolyPower,
Expand Down

0 comments on commit 1acf414

Please sign in to comment.