From 80e1b5f7f4fb90b2c12a75c4797da011e91a5408 Mon Sep 17 00:00:00 2001 From: Pedro Henrique Alves Cruz Date: Sun, 17 Nov 2024 20:22:25 -0300 Subject: [PATCH] fix: wands and rods chain damage --- src/items/weapons/weapons.cpp | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/src/items/weapons/weapons.cpp b/src/items/weapons/weapons.cpp index 4eb84d246c6..2ec09945f36 100644 --- a/src/items/weapons/weapons.cpp +++ b/src/items/weapons/weapons.cpp @@ -942,35 +942,7 @@ void WeaponWand::configureWeapon(const ItemType &it) { } int32_t WeaponWand::getWeaponDamage(const std::shared_ptr &player, const std::shared_ptr &, const std::shared_ptr &, bool maxDamage /* = false*/) const { - if (!g_configManager().getBoolean(TOGGLE_CHAIN_SYSTEM)) { - // Returns maximum damage or a random value between minChange and maxChange - return maxDamage ? -maxChange : -normal_random(minChange, maxChange); - } - - // If chain system is enabled, calculates magic-based damage - int32_t attackSkill = 0; - int32_t attackValue = 0; - float attackFactor = 0.0; - [[maybe_unused]] int16_t elementAttack = 0; - [[maybe_unused]] CombatDamage combatDamage; - calculateSkillFormula(player, attackSkill, attackValue, attackFactor, elementAttack, combatDamage); - - const auto magLevel = player->getMagicLevel(); - const auto level = player->getLevel(); - - // Check if level is greater than zero before performing division - const auto levelDivision = level > 0 ? level / 5.0 : 0.0; - - const auto totalAttackValue = magLevel + attackValue; - - // Check if magLevel is greater than zero before performing division - const auto magicLevelDivision = totalAttackValue > 0 ? totalAttackValue / 3.0 : 0.0; - - const double min = levelDivision + magicLevelDivision; - const double max = levelDivision + totalAttackValue; - - // Returns the calculated maximum damage or a random value between the calculated minimum and maximum - return maxDamage ? -max : -normal_random(min, max); + return maxDamage ? -maxChange : -normal_random(minChange, maxChange); } int16_t WeaponWand::getElementDamageValue() const {