From f8351f4f9f98fc995c22ca4185218a8ded7b74e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=82ngelo=20Tadeucci?= Date: Fri, 6 Mar 2026 15:47:34 -0300 Subject: [PATCH] fix: bonus attack coefficient broken for two-handed weapon classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two bugs in the bonus attack calculation caused 7/11 classes to deal drastically reduced damage: 1. StatsManager.BonusAttackCoefficient had EquipSlot reads swapped — rightHandRarity read from EquipSlot.LH and leftHandRarity read from EquipSlot.RH. Two-handed weapons store in EquipSlot.RH as their primary slot, so the swapped reads made rightHandRarity=0, causing BonusAttack.Coefficient to return 0. 2. BonusAttack.Coefficient early-returned the raw RarityMultiplier when leftHandRarity was 0, skipping the 4.96 * JobBonusMultiplier scaling. Two-handed classes got ~5.7x less bonus attack. Affected classes: Berserker, Wizard, Archer, Heavy Gunner, Rune Blader, Striker, Soul Binder. Co-Authored-By: Claude Opus 4.6 --- Maple2.Server.Core/Formulas/BonusAttack.cs | 5 ++--- Maple2.Server.Game/Manager/StatsManager.cs | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Maple2.Server.Core/Formulas/BonusAttack.cs b/Maple2.Server.Core/Formulas/BonusAttack.cs index d8e433776..0f287425e 100644 --- a/Maple2.Server.Core/Formulas/BonusAttack.cs +++ b/Maple2.Server.Core/Formulas/BonusAttack.cs @@ -9,11 +9,10 @@ public static double Coefficient(int rightHandRarity, int leftHandRarity, JobCod } double weaponBonusAttackCoefficient = RarityMultiplier(rightHandRarity); - if (leftHandRarity == 0) { - return weaponBonusAttackCoefficient; + if (leftHandRarity > 0) { + weaponBonusAttackCoefficient = 0.5 * (weaponBonusAttackCoefficient + RarityMultiplier(leftHandRarity)); } - weaponBonusAttackCoefficient = 0.5 * (weaponBonusAttackCoefficient + RarityMultiplier(leftHandRarity)); return 4.96 * weaponBonusAttackCoefficient * JobBonusMultiplier(jobCode); } diff --git a/Maple2.Server.Game/Manager/StatsManager.cs b/Maple2.Server.Game/Manager/StatsManager.cs index 61c3122d8..1d701391e 100644 --- a/Maple2.Server.Game/Manager/StatsManager.cs +++ b/Maple2.Server.Game/Manager/StatsManager.cs @@ -73,8 +73,8 @@ public StatsManager(IActor actor) { return (1, 1); double BonusAttackCoefficient(FieldPlayer player) { - int leftHandRarity = player.Session.Item.Equips.Get(EquipSlot.RH)?.Rarity ?? 0; - int rightHandRarity = player.Session.Item.Equips.Get(EquipSlot.LH)?.Rarity ?? 0; + int rightHandRarity = player.Session.Item.Equips.Get(EquipSlot.RH)?.Rarity ?? 0; + int leftHandRarity = player.Session.Item.Equips.Get(EquipSlot.LH)?.Rarity ?? 0; return BonusAttack.Coefficient(rightHandRarity, leftHandRarity, player.Value.Character.Job.Code()); } }