From a67f5c5d6a732db511d0484e55189fc742fcde14 Mon Sep 17 00:00:00 2001 From: Aleos Date: Sun, 5 Apr 2020 15:22:36 -0400 Subject: [PATCH] Fixes heal item recovery effects (#4750) * Fixes #4748. * Recovery item effects should be multiplicatively stacked. Thanks to @Singe-Horizontal! --- src/map/pc.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 7c36b206bf..a79072b2f9 100755 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -8946,28 +8946,27 @@ int pc_itemheal(struct map_session_data *sd, int itemid, int hp, int sp) bonus = 100 + (sd->battle_status.vit << 1) + pc_checkskill(sd, SM_RECOVERY) * 10 + pc_checkskill(sd, AM_LEARNINGPOTION) * 5; // A potion produced by an Alchemist in the Fame Top 10 gets +50% effect [DracoRPG] if (potion_flag == 2) { - bonus += 50; + bonus += bonus * 50 / 100; if (sd->sc.data[SC_SPIRIT] && sd->sc.data[SC_SPIRIT]->val2 == SL_ROGUE) - bonus += 100; // Receive an additional +100% effect from ranked potions to HP only + bonus += bonus; // Receive an additional +100% effect from ranked potions to HP only } //All item bonuses. bonus += sd->bonus.itemhealrate2; //Item Group bonuses - bonus += pc_get_itemgroup_bonus(sd, itemid); + bonus += bonus * pc_get_itemgroup_bonus(sd, itemid) / 100; //Individual item bonuses. for(const auto &it : sd->itemhealrate) { if (it.id == itemid) { - bonus += it.val; + bonus += bonus * it.val / 100; break; } } - // Recovery Potion if (sd->sc.data[SC_INCHEALRATE]) - bonus += sd->sc.data[SC_INCHEALRATE]->val1; + bonus += bonus * sd->sc.data[SC_INCHEALRATE]->val1 / 100; // 2014 Halloween Event : Pumpkin Bonus if (sd->sc.data[SC_MTF_PUMPKIN] && itemid == ITEMID_PUMPKIN) - bonus += sd->sc.data[SC_MTF_PUMPKIN]->val1; + bonus += bonus * sd->sc.data[SC_MTF_PUMPKIN]->val1 / 100; tmp = hp * bonus / 100; // Overflow check if (bonus != 100 && tmp > hp) @@ -8977,7 +8976,7 @@ int pc_itemheal(struct map_session_data *sd, int itemid, int hp, int sp) bonus = 100 + (sd->battle_status.int_ << 1) + pc_checkskill(sd, MG_SRECOVERY) * 10 + pc_checkskill(sd, AM_LEARNINGPOTION) * 5; // A potion produced by an Alchemist in the Fame Top 10 gets +50% effect [DracoRPG] if (potion_flag == 2) - bonus += 50; + bonus += bonus * 50 / 100; tmp = sp * bonus / 100; // Overflow check if (bonus != 100 && tmp > sp)