From 863873d90a327eda48cc0f9b4842678038df437b Mon Sep 17 00:00:00 2001 From: Connor Bratten Date: Tue, 1 Jul 2025 21:16:01 -0400 Subject: [PATCH 1/2] Add Badge of the Swarmguard --- sim/common/item_effects.go | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/sim/common/item_effects.go b/sim/common/item_effects.go index 5747983f8..a7f68c1d5 100644 --- a/sim/common/item_effects.go +++ b/sim/common/item_effects.go @@ -146,6 +146,7 @@ const ( WrathOfCenarius = 21190 EyeOfMoam = 21473 ScarabBrooch = 21625 + BadgeOfTheSwarmguard = 21670 KalimdorsRevenge = 21679 DraconicInfusedEmblem = 22268 HeartOfWyrmthalak = 22321 @@ -3507,6 +3508,69 @@ func init() { }) }) + // https://www.wowhead.com/classic/item=21670/badge-of-the-swarmguard + // Use: Chance on melee or ranged attack to grant 200 armor pen stacks up to 6 times. Lasts 30 sec. (3 Min Cooldown) + core.NewItemEffect(BadgeOfTheSwarmguard, func(agent core.Agent) { + character := agent.GetCharacter() + + procAura := character.RegisterAura(core.Aura{ + Label: "Insight of the Qiraji", + ActionID: core.ActionID{SpellID: 26481}, + Duration: core.NeverExpires, + MaxStacks: 6, + OnStacksChange: func(aura *core.Aura, sim *core.Simulation, oldStacks int32, newStacks int32) { + character.AddStatDynamic(sim, stats.ArmorPenetration, 200*float64(newStacks-oldStacks)) + }, + }) + + ppmm := character.AutoAttacks.NewPPMManager(10.0, core.ProcMaskMeleeOrRanged) + + auraLabel := "Badge of the Swarmguard" + actionID := core.ActionID{SpellID: 26480} + trinketAura := character.RegisterAura(core.Aura{ + Label: auraLabel, + ActionID: actionID, + Duration: time.Second * 30, + OnExpire: func(aura *core.Aura, sim *core.Simulation) { + procAura.Deactivate(sim) + }, + OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) { + if !result.Landed() { + return + } + if !spell.ProcMask.Matches(core.ProcMaskMeleeOrRanged) { + return + } + if !ppmm.ProcWithWeaponSpecials(sim, spell.ProcMask, auraLabel) { + return + } + + procAura.Activate(sim) + procAura.AddStack(sim) + }, + }) + + spell := character.RegisterSpell(core.SpellConfig{ + ActionID: actionID, + Flags: core.SpellFlagNoOnCastComplete, + + Cast: core.CastConfig{ + CD: core.Cooldown{ + Timer: character.NewTimer(), + Duration: time.Minute * 3, + }, + }, + ApplyEffects: func(sim *core.Simulation, _ *core.Unit, spell *core.Spell) { + trinketAura.Activate(sim) + }, + }) + + character.AddMajorCooldown(core.MajorCooldown{ + Spell: spell, + Type: core.CooldownTypeDPS, + }) + }) + core.AddEffectsToTest = true } From a4c8b892dcf02197eb2e5562c3c3d2c0a9038c43 Mon Sep 17 00:00:00 2001 From: Connor Bratten Date: Mon, 7 Jul 2025 15:41:01 -0400 Subject: [PATCH 2/2] Update badge to use MakeProcTriggerAura helper --- sim/common/item_effects.go | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/sim/common/item_effects.go b/sim/common/item_effects.go index a7f68c1d5..34b3bd27a 100644 --- a/sim/common/item_effects.go +++ b/sim/common/item_effects.go @@ -3523,28 +3523,18 @@ func init() { }, }) - ppmm := character.AutoAttacks.NewPPMManager(10.0, core.ProcMaskMeleeOrRanged) - auraLabel := "Badge of the Swarmguard" actionID := core.ActionID{SpellID: 26480} - trinketAura := character.RegisterAura(core.Aura{ - Label: auraLabel, + trinketAura := core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{ + Name: auraLabel, ActionID: actionID, Duration: time.Second * 30, - OnExpire: func(aura *core.Aura, sim *core.Simulation) { - procAura.Deactivate(sim) - }, - OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) { - if !result.Landed() { - return - } - if !spell.ProcMask.Matches(core.ProcMaskMeleeOrRanged) { - return - } - if !ppmm.ProcWithWeaponSpecials(sim, spell.ProcMask, auraLabel) { - return - } - + Callback: core.CallbackOnSpellHitDealt, + Outcome: core.OutcomeLanded, + ProcMask: core.ProcMaskMeleeOrRanged, + SpellFlagsExclude: core.SpellFlagSuppressEquipProcs, + PPM: 10.0, + Handler: func(sim *core.Simulation, _ *core.Spell, _ *core.SpellResult) { procAura.Activate(sim) procAura.AddStack(sim) }, @@ -3552,7 +3542,7 @@ func init() { spell := character.RegisterSpell(core.SpellConfig{ ActionID: actionID, - Flags: core.SpellFlagNoOnCastComplete, + Flags: core.SpellFlagNoOnCastComplete | core.SpellFlagOffensiveEquipment, Cast: core.CastConfig{ CD: core.Cooldown{