From a1a539fc07fe276fc0a75f15b7d75e4cd815fa33 Mon Sep 17 00:00:00 2001 From: 9001-Sols <9001.sols@gmail.com> Date: Fri, 27 Mar 2026 13:40:59 -0400 Subject: [PATCH] Fix Ranged Weapon Rank --- src/map/entities/battleentity.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/map/entities/battleentity.cpp b/src/map/entities/battleentity.cpp index 50f150bb7e2..a35da6197d3 100644 --- a/src/map/entities/battleentity.cpp +++ b/src/map/entities/battleentity.cpp @@ -794,14 +794,29 @@ uint16 CBattleEntity::GetSubWeaponRank() uint16 CBattleEntity::GetRangedWeaponRank() { - uint16 wDamage = GetRangedWeaponDmg(); - // Check ranged slot first, otherwise use ammo if it's null + // Weapon rank uses only the ranged weapon's damage (or ammo for throwing), + // not the combined ranged + ammo total that GetRangedWeaponDmg() returns. + uint16 wDamage = 0; + + // Check ranged slot first, otherwise use ammo if it's null (throwing weapons) CItemEquipment* item = m_Weapons[SLOT_RANGED] ? m_Weapons[SLOT_RANGED] : m_Weapons[SLOT_AMMO]; if (auto* weapon = dynamic_cast(item)) { + if ((weapon->getReqLvl() > GetMLevel()) && objtype == TYPE_PC) + { + uint16 scaleddmg = weapon->getDamage(); + scaleddmg *= GetMLevel() * 3; + scaleddmg /= 4; + scaleddmg /= weapon->getReqLvl(); + wDamage = scaleddmg; + } + else + { + wDamage = weapon->getDamage(); + } + wDamage += weapon->getModifier(Mod::RANGED_DMG_RANK); - wDamage -= weapon->getModifier(Mod::DMG_RATING); // Company sword, Maneater, etc don't boost weapon rank } return wDamage / 9;