From 5eb0a2ea3230eb2c211ef63e68e91043b8a0535f Mon Sep 17 00:00:00 2001 From: Playtester Date: Fri, 1 Apr 2022 22:40:21 +0200 Subject: [PATCH] Fixed small rounding issue with Divine Protection (#6781) * Fixes #6779 * The reduction will now be calculated as float and then rounded --- src/map/battle.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 4ff4211571..27955dd8e6 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -5679,9 +5679,9 @@ static void battle_calc_defense_reduction(struct Damage* wd, struct block_list * #else vit_def = def2; #endif - if( src->type == BL_MOB && (battle_check_undead(sstatus->race,sstatus->def_ele) || sstatus->race==RC_DEMON) && //This bonus already doesn't work vs players - (skill=pc_checkskill(tsd,AL_DP)) > 0 ) - vit_def += skill*(int)(3 +(tsd->status.base_level+1)*0.04); // submitted by orn + if (src->type == BL_MOB && (battle_check_undead(sstatus->race, sstatus->def_ele) || sstatus->race == RC_DEMON) && //This bonus already doesn't work vs players + (skill = pc_checkskill(tsd, AL_DP)) > 0) + vit_def += (int)(((float)tsd->status.base_level / 25.0 + 3.0) * skill + 0.5); if( src->type == BL_MOB && (skill=pc_checkskill(tsd,RA_RANGERMAIN))>0 && (sstatus->race == RC_BRUTE || sstatus->race == RC_PLAYER_DORAM || sstatus->race == RC_FISH || sstatus->race == RC_PLANT) ) vit_def += skill*5;