From 30f93cf7aecb8b5d7ca3990624e44957f6b28e41 Mon Sep 17 00:00:00 2001 From: Critical <48370698+CriticalXI@users.noreply.github.com> Date: Sat, 24 Jan 2026 16:52:10 -0700 Subject: [PATCH] [c++] Add server settings for weapon haste cap --- settings/default/main.lua | 33 ++++++++++++++++--------------- src/map/entities/battleentity.cpp | 3 ++- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/settings/default/main.lua b/settings/default/main.lua index 62341c6ac53..152b03246a9 100644 --- a/settings/default/main.lua +++ b/settings/default/main.lua @@ -122,24 +122,25 @@ xi.settings.main = ALL_MAPS = 0, -- Set to 1 to give starting characters all the maps. UNLOCK_OUTPOST_WARPS = 0, -- Set to 1 to give starting characters all outpost warps. 2 to add Tu'Lia and Tavnazia. - SHOP_PRICE = 1.000, -- Multiplies prices in NPC shops. - GIL_RATE = 1.000, -- Multiplies gil earned from quests. Won't always display in game. - BAYLD_RATE = 1.000, -- Multiples bayld earned from quests. + SHOP_PRICE = 1.000, -- Multiplies prices in NPC shops. + GIL_RATE = 1.000, -- Multiplies gil earned from quests. Won't always display in game. + BAYLD_RATE = 1.000, -- Multiples bayld earned from quests. -- Note: EXP rates are also influenced by conf setting - EXP_RATE = 1.000, -- Multiplies exp from script (except FoV/GoV). - CAPACITY_RATE = 1.000, -- Multiplies capacy points gained. - BOOK_EXP_RATE = 1.000, -- Multiplies exp from FoV/GoV book pages. - TABS_RATE = 1.000, -- Multiplies tabs earned from fov. - ROE_EXP_RATE = 1.000, -- Multiplies exp earned from records of eminence. - SPARKS_RATE = 1.000, -- Multiplies sparks earned from records of eminence. - CURE_POWER = 1.000, -- Multiplies amount healed from Healing Magic, including the relevant Blue Magic. - ELEMENTAL_POWER = 1.000, -- Multiplies damage dealt by Elemental and non-drain Dark Magic. - DIVINE_POWER = 1.000, -- Multiplies damage dealt by Divine Magic. - NINJUTSU_POWER = 1.000, -- Multiplies damage dealt by Ninjutsu Magic. - BLUE_POWER = 1.000, -- Multiplies damage dealt by Blue Magic. - DARK_POWER = 1.000, -- Multiplies amount drained by Dark Magic. - ITEM_POWER = 1.000, -- Multiplies the effect of items such as Potions and Ethers. + EXP_RATE = 1.000, -- Multiplies exp from script (except FoV/GoV). + CAPACITY_RATE = 1.000, -- Multiplies capacity points gained. + BOOK_EXP_RATE = 1.000, -- Multiplies exp from FoV/GoV book pages. + TABS_RATE = 1.000, -- Multiplies tabs earned from fov. + ROE_EXP_RATE = 1.000, -- Multiplies exp earned from records of eminence. + SPARKS_RATE = 1.000, -- Multiplies sparks earned from records of eminence. + CURE_POWER = 1.000, -- Multiplies amount healed from Healing Magic, including the relevant Blue Magic. + ELEMENTAL_POWER = 1.000, -- Multiplies damage dealt by Elemental and non-drain Dark Magic. + DIVINE_POWER = 1.000, -- Multiplies damage dealt by Divine Magic. + NINJUTSU_POWER = 1.000, -- Multiplies damage dealt by Ninjutsu Magic. + BLUE_POWER = 1.000, -- Multiplies damage dealt by Blue Magic. + DARK_POWER = 1.000, -- Multiplies amount drained by Dark Magic. + ITEM_POWER = 1.000, -- Multiplies the effect of items such as Potions and Ethers. WEAPON_SKILL_POWER = 1.000, -- Multiplies damage dealt by Weapon Skills. + DELAY_REDUCTION_CAP = 0.80, -- Set the cap for melee swing haste effect. (0.80 = 80% retail delay reduction max, 0.93 = 93% ToAU delay reduction max) -- STR:ATT/RATT ratios. For players only. Mobs are hardcoded to 0.5 TWO_HANDED_STR_ATTACK_MULTIPLIER = 1.0, -- 1.0: 1 STR = 1 Attack. This has been 0.5 and 0.75 in previous eras diff --git a/src/map/entities/battleentity.cpp b/src/map/entities/battleentity.cpp index 8054a67fb25..fa6ee587936 100644 --- a/src/map/entities/battleentity.cpp +++ b/src/map/entities/battleentity.cpp @@ -517,7 +517,8 @@ uint32 CBattleEntity::GetWeaponDelay(bool tp) hasteAbility = std::clamp(hasteAbility, -0.25f, 0.25f); hasteGear = std::clamp(hasteGear, -0.25f, 0.25f); - hasteMultiplier = std::clamp(1.0f - hasteMagic - hasteAbility - hasteGear, 0.2f, 2.0f); + float hasteCap = 1.0f - settings::get("main.DELAY_REDUCTION_CAP"); + hasteMultiplier = std::clamp(1.0f - hasteMagic - hasteAbility - hasteGear, hasteCap, 2.0f); } }