From 1c8359753b17b2eac9598ade096b2b8f67daaa0e Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Thu, 6 Aug 2026 13:07:15 +1000 Subject: [PATCH] Fix crash from equipping Quivers or Shield that grants a skill The logic added for Ghostly Artillery was too general and causing issues for granted skills that don't care about the item that grants it Now tags skills that come from the granted item --- spec/System/TestTriggers_spec.lua | 17 +++++++++++++++++ src/Data/Skills/other.lua | 2 ++ src/Export/Skills/other.txt | 4 ++-- src/Modules/CalcActiveSkill.lua | 4 ++-- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/spec/System/TestTriggers_spec.lua b/spec/System/TestTriggers_spec.lua index 12e9a3ec10a..a1b2268a67c 100644 --- a/spec/System/TestTriggers_spec.lua +++ b/spec/System/TestTriggers_spec.lua @@ -1504,6 +1504,23 @@ describe("TestTriggers", function() assert.is_falsy(build.calcsTab.mainEnv.player.mainSkill.skillFlags.weapon2Attack) end) + it("Use the equipped bow for Void Shot granted by Voidfletcher", function() + build.itemsTab:CreateDisplayItemFromRaw("Test Bow\nShort Bow") + build.itemsTab:AddDisplayItem() + runCallback("OnFrame") + + build.itemsTab:CreateDisplayItemFromRaw([[Voidfletcher + Ornate Quiver + Consumes a Void Charge to Trigger Level 20 Void Shot when you fire Arrows with a Non-Triggered Skill]]) + build.itemsTab:AddDisplayItem() + runCallback("OnFrame") + + local mainSkill = build.calcsTab.mainEnv.player.mainSkill + assert.are.equals("Void Shot", mainSkill.activeEffect.grantedEffect.name) + assert.is_true(mainSkill.skillFlags.weapon1Attack) + assert.is_falsy(mainSkill.skillFlags.weapon2Attack) + end) + it("Trigger Ghostly Artillery with a projectile attack", function() equipDreadCaptainsCutlass() build.skillsTab:PasteSocketGroup("Lancing Steel 20/0 1\n") diff --git a/src/Data/Skills/other.lua b/src/Data/Skills/other.lua index 2e4d7b41bc3..8db20faab7d 100644 --- a/src/Data/Skills/other.lua +++ b/src/Data/Skills/other.lua @@ -1925,6 +1925,7 @@ skills["FieryImpactHeistMaceImplicit"] = { attack = true, area = true, melee = true, + forceSourceWeapon = true, }, constantStats = { { "skill_physical_damage_%_to_convert_to_fire", 60 }, @@ -5953,6 +5954,7 @@ skills["GhostCannons"] = { attack = true, projectile = true, area = true, + forceSourceWeapon = true, }, constantStats = { { "skill_physical_damage_%_to_convert_to_fire", 50 }, diff --git a/src/Export/Skills/other.txt b/src/Export/Skills/other.txt index be8b414c1a9..eb4bf4c3c5c 100644 --- a/src/Export/Skills/other.txt +++ b/src/Export/Skills/other.txt @@ -533,7 +533,7 @@ local skills, mod, flag, skill = ... #mods #skill FieryImpactHeistMaceImplicit -#flags attack area melee +#flags attack area melee forceSourceWeapon fromItem = true, #mods @@ -1564,7 +1564,7 @@ local skills, mod, flag, skill = ... #mods #skill GhostCannons Ghostly Artillery -#flags attack projectile area +#flags attack projectile area forceSourceWeapon fromItem = true, #mods diff --git a/src/Modules/CalcActiveSkill.lua b/src/Modules/CalcActiveSkill.lua index 9b315a7b7b4..0d5219d02fe 100644 --- a/src/Modules/CalcActiveSkill.lua +++ b/src/Modules/CalcActiveSkill.lua @@ -278,8 +278,8 @@ function calcs.buildActiveSkillModList(env, activeSkill) activeSkill.weapon2Flags = 0 else -- Set weapon flags - if skillFlags.attack and activeSkill.socketGroup and activeSkill.socketGroup.sourceItem then - -- Item-granted attacks use the weapon that grants the skill + if skillFlags.forceSourceWeapon and activeSkill.socketGroup and activeSkill.socketGroup.sourceItem then + -- Some item-granted attacks must use the weapon that grants the skill local sourceSlot = activeSkill.socketGroup.slot or "" skillFlags.forceMainHand = sourceSlot:match("^Weapon 1") ~= nil skillFlags.forceOffHand = sourceSlot:match("^Weapon 2") ~= nil