Skip to content

Commit dc41f92

Browse files
fix: bonus attack coefficient broken for two-handed weapon classes (#666)
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 <noreply@anthropic.com>
1 parent 289770c commit dc41f92

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

Maple2.Server.Core/Formulas/BonusAttack.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ public static double Coefficient(int rightHandRarity, int leftHandRarity, JobCod
99
}
1010

1111
double weaponBonusAttackCoefficient = RarityMultiplier(rightHandRarity);
12-
if (leftHandRarity == 0) {
13-
return weaponBonusAttackCoefficient;
12+
if (leftHandRarity > 0) {
13+
weaponBonusAttackCoefficient = 0.5 * (weaponBonusAttackCoefficient + RarityMultiplier(leftHandRarity));
1414
}
1515

16-
weaponBonusAttackCoefficient = 0.5 * (weaponBonusAttackCoefficient + RarityMultiplier(leftHandRarity));
1716
return 4.96 * weaponBonusAttackCoefficient * JobBonusMultiplier(jobCode);
1817
}
1918

Maple2.Server.Game/Manager/StatsManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public StatsManager(IActor actor) {
7373
return (1, 1);
7474

7575
double BonusAttackCoefficient(FieldPlayer player) {
76-
int leftHandRarity = player.Session.Item.Equips.Get(EquipSlot.RH)?.Rarity ?? 0;
77-
int rightHandRarity = player.Session.Item.Equips.Get(EquipSlot.LH)?.Rarity ?? 0;
76+
int rightHandRarity = player.Session.Item.Equips.Get(EquipSlot.RH)?.Rarity ?? 0;
77+
int leftHandRarity = player.Session.Item.Equips.Get(EquipSlot.LH)?.Rarity ?? 0;
7878
return BonusAttack.Coefficient(rightHandRarity, leftHandRarity, player.Value.Character.Job.Code());
7979
}
8080
}

0 commit comments

Comments
 (0)