From 16e3d856006249e9ec602ae8c82c2d3c734b775d Mon Sep 17 00:00:00 2001 From: Adam Chodaba Date: Thu, 21 Nov 2024 05:33:05 -0500 Subject: [PATCH 1/4] p6 pally librams --- sim/core/buffs.go | 28 +++++++++++++++-- sim/paladin/items.go | 71 +++++++++++++++++++++++++++++++++++++++++- sim/paladin/paladin.go | 2 ++ 3 files changed, 98 insertions(+), 3 deletions(-) diff --git a/sim/core/buffs.go b/sim/core/buffs.go index 4e5398f479..dc384fcc4a 100644 --- a/sim/core/buffs.go +++ b/sim/core/buffs.go @@ -898,10 +898,18 @@ func SanctityAuraAura(character *Character) *Aura { aura.Activate(sim) }, OnGain: func(aura *Aura, sim *Simulation) { - character.PseudoStats.SchoolDamageDealtMultiplier[stats.SchoolIndexHoly] *= 1.1 + sanctityLibramAura := aura.Unit.GetAuraByID(ActionID{SpellID: 1214298}) + + if sanctityLibramAura == nil || !sanctityLibramAura.IsActive() { + character.PseudoStats.SchoolDamageDealtMultiplier[stats.SchoolIndexHoly] *= 1.1 + } }, OnExpire: func(aura *Aura, sim *Simulation) { - character.PseudoStats.SchoolDamageDealtMultiplier[stats.SchoolIndexHoly] /= 1.1 + sanctityLibramAura := aura.Unit.GetAuraByID(ActionID{SpellID: 1214298}) + + if sanctityLibramAura == nil || !sanctityLibramAura.IsActive() { + character.PseudoStats.SchoolDamageDealtMultiplier[stats.SchoolIndexHoly] /= 1.1 + } }, }) } @@ -1913,6 +1921,22 @@ func spellPowerBonusEffect(aura *Aura, spellPowerBonus float64) *ExclusiveEffect }) } +func holyDamageDealtMultiplierEffect(aura *Aura, holyMultiplier float64) *ExclusiveEffect { + return aura.NewExclusiveEffect("HolyDamageDealt", false, ExclusiveEffect{ + Priority: holyMultiplier, + OnGain: func(ee *ExclusiveEffect, sim *Simulation) { + ee.Aura.Unit.AddStatsDynamic(sim, stats.Stats{ + stats.SpellPower: ee.Priority, + }) + }, + OnExpire: func(ee *ExclusiveEffect, sim *Simulation) { + ee.Aura.Unit.AddStatsDynamic(sim, stats.Stats{ + stats.SpellPower: -ee.Priority, + }) + }, + }) +} + func StrengthOfEarthTotemAura(unit *Unit, level int32, multiplier float64) *Aura { rank := LevelToBuffRank[StrengthOfEarth][level] spellID := []int32{0, 8075, 8160, 8161, 10442, 25361}[rank] diff --git a/sim/paladin/items.go b/sim/paladin/items.go index a908da961e..dc0ba8b5eb 100644 --- a/sim/paladin/items.go +++ b/sim/paladin/items.go @@ -28,6 +28,9 @@ const ( ZandalarFreethinkersBreastplate = 231329 ZandalarFreethinkersBelt = 231330 LibramOfWrath = 232420 + LibramOfTheExorcist = 234475 + LibramOfSanctity = 234476 + LibramOfRighteousness = 234477 ) func init() { @@ -257,6 +260,45 @@ func init() { }, })) }) + + core.NewItemEffect(LibramOfTheExorcist, func(agent core.Agent) { + paladin := agent.(PaladinAgent).GetPaladin() + paladin.OnSpellRegistered(func(spell *core.Spell) { + if spell.SpellCode == SpellCode_PaladinCrusaderStrike || spell.SpellCode == SpellCode_PaladinExorcism { + // Increases the damage of Exorcism and Crusader Strike by 3%. + spell.DamageMultiplier += 0.03 + } + }) + }) + + core.NewItemEffect(LibramOfSanctity, func(agent core.Agent) { + paladin := agent.(PaladinAgent).GetPaladin() + sanctityLibramAura := ApplyLibramOfSanctityAura(&paladin.Unit) + + paladin.OnSpellRegistered(func(spell *core.Spell) { + if spell.SpellCode == SpellCode_PaladinHolyShock { + // Increases the damage of Holy Shock by 3%, and your Shock and Awe buff now also grants 10% increased Holy Damage. (This effect does not stack with Sanctity Aura). + spell.DamageMultiplier += 0.03 + originalApplyEffects := spell.ApplyEffects + + spell.ApplyEffects = func(sim *core.Simulation, target *core.Unit, spell *core.Spell) { + originalApplyEffects(sim, target, spell) + sanctityLibramAura.Activate(sim) + } + } + }) + }) + + core.NewItemEffect(LibramOfRighteousness, func(agent core.Agent) { + paladin := agent.(PaladinAgent).GetPaladin() + paladin.OnSpellRegistered(func(spell *core.Spell) { + if spell.SpellCode == SpellCode_PaladinHammerOfTheRighteous || spell.SpellCode == SpellCode_PaladinShieldOfRighteousness { + // Increases the damage of Hammer of the Righteous and Shield of Righteousness by 3%. + spell.DamageMultiplier += 0.03 + } + }) + }) + } // https://www.wowhead.com/classic/spell=465414/crusaders-zeal @@ -290,9 +332,36 @@ func crusadersZealAura465414(character *core.Character) *core.Aura { Outcome: core.OutcomeLanded, ProcMask: core.ProcMaskMelee, SpellFlagsExclude: core.SpellFlagSuppressWeaponProcs, - PPM: 2.0, // TBD + PPM: 2.0, Handler: func(sim *core.Simulation, spell *core.Spell, result *core.SpellResult) { procAura.Activate(sim) }, }) } + +func ApplyLibramOfSanctityAura(unit *core.Unit) *core.Aura { + + sanctityLibramAura := unit.GetOrRegisterAura(core.Aura{ + ActionID: core.ActionID{SpellID: 1214298}, + Label: "Libram of Sanctity", + Duration: time.Minute * 1, + + OnGain: func(aura *core.Aura, sim *core.Simulation) { + sanctityAura := aura.Unit.GetAuraByID(core.ActionID{SpellID: 20218}) + + if sanctityAura == nil || !sanctityAura.IsActive() { + aura.Unit.PseudoStats.SchoolDamageDealtMultiplier[stats.SchoolIndexHoly] *= 1.1 + } + }, + OnExpire: func(aura *core.Aura, sim *core.Simulation) { + sanctityAura := aura.Unit.GetAuraByID(core.ActionID{SpellID: 20218}) + + if sanctityAura == nil || !sanctityAura.IsActive() { + aura.Unit.PseudoStats.SchoolDamageDealtMultiplier[stats.SchoolIndexHoly] /= 1.1 + } + }, + }) + + return sanctityLibramAura + +} diff --git a/sim/paladin/paladin.go b/sim/paladin/paladin.go index 882c4db5e6..ba598b3e35 100644 --- a/sim/paladin/paladin.go +++ b/sim/paladin/paladin.go @@ -30,6 +30,8 @@ const ( SpellCode_PaladinLayOnHands SpellCode_PaladinHammerOfWrath SpellCode_PaladinCrusaderStrike + SpellCode_PaladinHammerOfTheRighteous + SpellCode_PaladinShieldOfRighteousness ) type SealJudgeCode uint8 From 6542accf2a4718f9fd27707dea27515b042dc817 Mon Sep 17 00:00:00 2001 From: Adam Chodaba Date: Sat, 23 Nov 2024 00:56:32 -0500 Subject: [PATCH 2/4] fix additive multiplier --- sim/paladin/holy_shock.go | 9 +++++---- sim/paladin/item_sets_pve.go | 10 +++++----- sim/paladin/items.go | 10 +++++----- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/sim/paladin/holy_shock.go b/sim/paladin/holy_shock.go index 67befa4e19..4d0a1fcdbb 100644 --- a/sim/paladin/holy_shock.go +++ b/sim/paladin/holy_shock.go @@ -39,7 +39,7 @@ func (paladin *Paladin) registerHolyShock() { {level: 56, spellID: 20930, manaCost: 325, minDamage: 365, maxDamage: 395}, } - damageMultiplier := core.TernaryFloat64(hasInfusionOfLight, 1.5, 1.0) + damageMultiplierAdditive := core.TernaryFloat64(hasInfusionOfLight, 1.5, 1.0) //hasArtOfWar := paladin.hasRune(proto.PaladinRune_RuneFeetTheArtOfWar) manaCostMultiplier := int32(100) //core.TernaryFloat64(hasArtOfWar, 0.2, 1.0) @@ -78,9 +78,10 @@ func (paladin *Paladin) registerHolyShock() { CD: *paladin.holyShockCooldown, }, - DamageMultiplier: damageMultiplier, - ThreatMultiplier: 1, - BonusCoefficient: 0.429, + DamageMultiplier: 1, + DamageMultiplierAdditive: damageMultiplierAdditive, + ThreatMultiplier: 1, + BonusCoefficient: 0.429, ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) { baseDamage := sim.Roll(rank.minDamage, rank.maxDamage) diff --git a/sim/paladin/item_sets_pve.go b/sim/paladin/item_sets_pve.go index 9099fae536..20afc4ba95 100644 --- a/sim/paladin/item_sets_pve.go +++ b/sim/paladin/item_sets_pve.go @@ -233,7 +233,7 @@ var ItemSetFreethinkersArmor = core.NewItemSet(core.ItemSet{ paladin.OnSpellRegistered(func(spell *core.Spell) { if spell.SpellCode == SpellCode_PaladinHolyShock { //Damage multiplier is Additive with Infusion of Light rather than multiplicitive - spell.DamageMultiplier += 0.5 + spell.DamageMultiplierAdditive += 0.5 } }) }, @@ -245,7 +245,7 @@ var ItemSetFreethinkersArmor = core.NewItemSet(core.ItemSet{ OnInit: func(aura *core.Aura, sim *core.Simulation) { for _, spell := range paladin.exorcism { spell.CD.Duration -= time.Second * 3 - spell.DamageMultiplier *= 1.50 + spell.DamageMultiplierAdditive += 0.5 } }, }) @@ -270,7 +270,7 @@ var ItemSetMercifulJudgement = core.NewItemSet(core.ItemSet{ paladin := agent.GetCharacter() paladin.OnSpellRegistered(func(spell *core.Spell) { if spell.SpellCode == SpellCode_PaladinConsecration { - spell.AOEDot().DamageMultiplier *= 1.5 + spell.AOEDot().DamageMultiplier += 0.5 } }) }, @@ -293,7 +293,7 @@ var ItemSetRadiantJudgement = core.NewItemSet(core.ItemSet{ OnInit: func(aura *core.Aura, sim *core.Simulation) { for _, judgeSpells := range paladin.allJudgeSpells { for _, judgeRankSpell := range judgeSpells { - judgeRankSpell.DamageMultiplier *= 1.2 + judgeRankSpell.DamageMultiplierAdditive += 0.2 } } @@ -450,7 +450,7 @@ var ItemSetAvengersRadiance = core.NewItemSet(core.ItemSet{ //"S03 - Item - TAQ - Paladin - Retribution 2P Bonus", if spell.SpellCode == SpellCode_PaladinCrusaderStrike { // 2 Set: Increases Crusader Strike Damage by 50% - spell.DamageMultiplier *= 1.5 + spell.DamageMultiplier += 0.5 } }) }, diff --git a/sim/paladin/items.go b/sim/paladin/items.go index dc0ba8b5eb..3c3ed369a2 100644 --- a/sim/paladin/items.go +++ b/sim/paladin/items.go @@ -213,11 +213,11 @@ func init() { core.Each(holyWrathSpells, func(spell *core.Spell) { spell.CastTimeMultiplier += (0.2 * float64(oldStacks)) spell.Cost.Multiplier += int32(100.0 * (0.2 * float64(oldStacks))) - spell.DamageMultiplier -= (0.2 * float64(oldStacks)) + spell.DamageMultiplierAdditive -= (0.2 * float64(oldStacks)) spell.CastTimeMultiplier -= (0.2 * float64(newStacks)) spell.Cost.Multiplier -= int32(100.0 * (0.2 * float64(newStacks))) - spell.DamageMultiplier += (0.2 * float64(newStacks)) + spell.DamageMultiplierAdditive += (0.2 * float64(newStacks)) }) }, @@ -266,7 +266,7 @@ func init() { paladin.OnSpellRegistered(func(spell *core.Spell) { if spell.SpellCode == SpellCode_PaladinCrusaderStrike || spell.SpellCode == SpellCode_PaladinExorcism { // Increases the damage of Exorcism and Crusader Strike by 3%. - spell.DamageMultiplier += 0.03 + spell.DamageMultiplierAdditive += 0.03 } }) }) @@ -278,7 +278,7 @@ func init() { paladin.OnSpellRegistered(func(spell *core.Spell) { if spell.SpellCode == SpellCode_PaladinHolyShock { // Increases the damage of Holy Shock by 3%, and your Shock and Awe buff now also grants 10% increased Holy Damage. (This effect does not stack with Sanctity Aura). - spell.DamageMultiplier += 0.03 + spell.DamageMultiplierAdditive += 0.03 originalApplyEffects := spell.ApplyEffects spell.ApplyEffects = func(sim *core.Simulation, target *core.Unit, spell *core.Spell) { @@ -294,7 +294,7 @@ func init() { paladin.OnSpellRegistered(func(spell *core.Spell) { if spell.SpellCode == SpellCode_PaladinHammerOfTheRighteous || spell.SpellCode == SpellCode_PaladinShieldOfRighteousness { // Increases the damage of Hammer of the Righteous and Shield of Righteousness by 3%. - spell.DamageMultiplier += 0.03 + spell.DamageMultiplierAdditive += 0.03 } }) }) From 4831341c0f0a2e828bd9ce196b7878576ac2145d Mon Sep 17 00:00:00 2001 From: Kayla Glick Date: Sat, 23 Nov 2024 14:48:29 -0500 Subject: [PATCH 3/4] update libram of sanctity code --- sim/core/buffs.go | 46 ++++++++++++++------------------------------ sim/paladin/items.go | 12 +++++++++--- 2 files changed, 23 insertions(+), 35 deletions(-) diff --git a/sim/core/buffs.go b/sim/core/buffs.go index dc384fcc4a..dbe269f79b 100644 --- a/sim/core/buffs.go +++ b/sim/core/buffs.go @@ -890,26 +890,24 @@ func applyPetBuffEffects(petAgent PetAgent, playerFaction proto.Faction, raidBuf } func SanctityAuraAura(character *Character) *Aura { - return character.GetOrRegisterAura(Aura{ + aura := MakePermanent(character.GetOrRegisterAura(Aura{ Label: "Sanctity Aura", ActionID: ActionID{SpellID: 20218}, - Duration: NeverExpires, - OnReset: func(aura *Aura, sim *Simulation) { - aura.Activate(sim) - }, - OnGain: func(aura *Aura, sim *Simulation) { - sanctityLibramAura := aura.Unit.GetAuraByID(ActionID{SpellID: 1214298}) + })) - if sanctityLibramAura == nil || !sanctityLibramAura.IsActive() { - character.PseudoStats.SchoolDamageDealtMultiplier[stats.SchoolIndexHoly] *= 1.1 - } - }, - OnExpire: func(aura *Aura, sim *Simulation) { - sanctityLibramAura := aura.Unit.GetAuraByID(ActionID{SpellID: 1214298}) + ExclusiveHolyDamageDealtAura(aura, 1.1) - if sanctityLibramAura == nil || !sanctityLibramAura.IsActive() { - character.PseudoStats.SchoolDamageDealtMultiplier[stats.SchoolIndexHoly] /= 1.1 - } + return aura +} + +func ExclusiveHolyDamageDealtAura(aura *Aura, multiplier float64) { + aura.NewExclusiveEffect("HolyDamageDealt", false, ExclusiveEffect{ + Priority: multiplier, + OnGain: func(ee *ExclusiveEffect, sim *Simulation) { + aura.Unit.PseudoStats.SchoolDamageDealtMultiplier[stats.SchoolIndexHoly] *= multiplier + }, + OnExpire: func(ee *ExclusiveEffect, sim *Simulation) { + aura.Unit.PseudoStats.SchoolDamageDealtMultiplier[stats.SchoolIndexHoly] /= multiplier }, }) } @@ -1921,22 +1919,6 @@ func spellPowerBonusEffect(aura *Aura, spellPowerBonus float64) *ExclusiveEffect }) } -func holyDamageDealtMultiplierEffect(aura *Aura, holyMultiplier float64) *ExclusiveEffect { - return aura.NewExclusiveEffect("HolyDamageDealt", false, ExclusiveEffect{ - Priority: holyMultiplier, - OnGain: func(ee *ExclusiveEffect, sim *Simulation) { - ee.Aura.Unit.AddStatsDynamic(sim, stats.Stats{ - stats.SpellPower: ee.Priority, - }) - }, - OnExpire: func(ee *ExclusiveEffect, sim *Simulation) { - ee.Aura.Unit.AddStatsDynamic(sim, stats.Stats{ - stats.SpellPower: -ee.Priority, - }) - }, - }) -} - func StrengthOfEarthTotemAura(unit *Unit, level int32, multiplier float64) *Aura { rank := LevelToBuffRank[StrengthOfEarth][level] spellID := []int32{0, 8075, 8160, 8161, 10442, 25361}[rank] diff --git a/sim/paladin/items.go b/sim/paladin/items.go index 3c3ed369a2..0179a78eb6 100644 --- a/sim/paladin/items.go +++ b/sim/paladin/items.go @@ -273,17 +273,23 @@ func init() { core.NewItemEffect(LibramOfSanctity, func(agent core.Agent) { paladin := agent.(PaladinAgent).GetPaladin() - sanctityLibramAura := ApplyLibramOfSanctityAura(&paladin.Unit) + + buffAura := core.MakePermanent(paladin.RegisterAura(core.Aura{ + ActionID: core.ActionID{SpellID: 1214298}, + Label: "Libram of Sanctity", + Duration: time.Minute, + })) + core.ExclusiveHolyDamageDealtAura(buffAura, 1.1) paladin.OnSpellRegistered(func(spell *core.Spell) { if spell.SpellCode == SpellCode_PaladinHolyShock { // Increases the damage of Holy Shock by 3%, and your Shock and Awe buff now also grants 10% increased Holy Damage. (This effect does not stack with Sanctity Aura). spell.DamageMultiplierAdditive += 0.03 - originalApplyEffects := spell.ApplyEffects + originalApplyEffects := spell.ApplyEffects spell.ApplyEffects = func(sim *core.Simulation, target *core.Unit, spell *core.Spell) { originalApplyEffects(sim, target, spell) - sanctityLibramAura.Activate(sim) + buffAura.Activate(sim) } } }) From 92ade29318ac6cf7b8b9cbb34df32b674562ee5f Mon Sep 17 00:00:00 2001 From: Adam Chodaba Date: Sat, 23 Nov 2024 22:36:49 -0500 Subject: [PATCH 4/4] remove extra code --- sim/paladin/items.go | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/sim/paladin/items.go b/sim/paladin/items.go index 0179a78eb6..968fe228d3 100644 --- a/sim/paladin/items.go +++ b/sim/paladin/items.go @@ -344,30 +344,3 @@ func crusadersZealAura465414(character *core.Character) *core.Aura { }, }) } - -func ApplyLibramOfSanctityAura(unit *core.Unit) *core.Aura { - - sanctityLibramAura := unit.GetOrRegisterAura(core.Aura{ - ActionID: core.ActionID{SpellID: 1214298}, - Label: "Libram of Sanctity", - Duration: time.Minute * 1, - - OnGain: func(aura *core.Aura, sim *core.Simulation) { - sanctityAura := aura.Unit.GetAuraByID(core.ActionID{SpellID: 20218}) - - if sanctityAura == nil || !sanctityAura.IsActive() { - aura.Unit.PseudoStats.SchoolDamageDealtMultiplier[stats.SchoolIndexHoly] *= 1.1 - } - }, - OnExpire: func(aura *core.Aura, sim *core.Simulation) { - sanctityAura := aura.Unit.GetAuraByID(core.ActionID{SpellID: 20218}) - - if sanctityAura == nil || !sanctityAura.IsActive() { - aura.Unit.PseudoStats.SchoolDamageDealtMultiplier[stats.SchoolIndexHoly] /= 1.1 - } - }, - }) - - return sanctityLibramAura - -}