diff --git a/db/re/item_db_etc.yml b/db/re/item_db_etc.yml index df2ba90462..ae7e925d91 100644 --- a/db/re/item_db_etc.yml +++ b/db/re/item_db_etc.yml @@ -11470,7 +11470,7 @@ Body: BuyingStore: true DropEffect: CLIENT Script: | - bonus bAbsorbDmgMaxHP,100; + bonus bAbsorbDmgMaxHP2,40; - Id: 4625 AegisName: Timeholder_Card Name: Time Holder Card diff --git a/doc/item_bonus.txt b/doc/item_bonus.txt index 04c159cee2..9839bb4dbf 100644 --- a/doc/item_bonus.txt +++ b/doc/item_bonus.txt @@ -292,7 +292,8 @@ bonus2 bMagicAddRace2,mr,x; +x% magic damage against monster race mr bonus2 bSubSkill,sk,n; Reduces n% damage received from skill sk -bonus bAbsorbDmgMaxHP,n; If the damage received is more than n% of Max HP, the damage received is [TotalDamage] - [n% of MaxHP] (Doesn't stack, will use the highest value) +bonus bAbsorbDmgMaxHP,n; If the damage received is more than n% of Max HP, the damage received is [TotalDamage] - [n% of MaxHP] (Doesn't stack, will use the highest value) (Legacy rAthena behavior) +bonus bAbsorbDmgMaxHP2,n; If the damage received is more than n% of Max HP, the damage received is reduced to n% of MaxHP (Doesn't stack, will use the highest value) (Official behavior) Atk/Def ------- diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 682f5fcb95..18c1ae30c1 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -1054,12 +1054,18 @@ static void battle_absorb_damage(struct block_list *bl, struct Damage *d) { struct map_session_data *sd = BL_CAST(BL_PC, bl); if (!sd) return; + dmg_ori = dmg_new = d->damage + d->damage2; if (sd->bonus.absorb_dmg_maxhp) { int hp = sd->bonus.absorb_dmg_maxhp * status_get_max_hp(bl) / 100; - dmg_ori = dmg_new = d->damage + d->damage2; if (dmg_ori > hp) dmg_new = dmg_ori - hp; } + if (sd->bonus.absorb_dmg_maxhp2) { + int hp = sd->bonus.absorb_dmg_maxhp2 * status_get_max_hp(bl) / 100; + if (dmg_ori > hp) { + dmg_new = hp; + } + } } break; } diff --git a/src/map/map.hpp b/src/map/map.hpp index c9697a715d..47ea754136 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -550,7 +550,7 @@ enum _sp { SP_IGNORE_DEF_CLASS_RATE, SP_REGEN_PERCENT_HP, SP_REGEN_PERCENT_SP, SP_SKILL_DELAY, SP_NO_WALK_DELAY, //2088-2092 SP_LONG_SP_GAIN_VALUE, SP_LONG_HP_GAIN_VALUE, SP_SHORT_ATK_RATE, SP_MAGIC_SUBSIZE, SP_CRIT_DEF_RATE, // 2093-2097 SP_MAGIC_SUBDEF_ELE, SP_REDUCE_DAMAGE_RETURN, SP_ADD_ITEM_SPHEAL_RATE, SP_ADD_ITEMGROUP_SPHEAL_RATE, // 2098-2101 - SP_WEAPON_SUBSIZE // 2102 + SP_WEAPON_SUBSIZE, SP_ABSORB_DMG_MAXHP2 // 2102-2103 }; enum _look { diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 435d68625f..7fb83267b0 100755 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -3908,6 +3908,9 @@ void pc_bonus(struct map_session_data *sd,int type,int val) case SP_ABSORB_DMG_MAXHP: // bonus bAbsorbDmgMaxHP,n; sd->bonus.absorb_dmg_maxhp = max(sd->bonus.absorb_dmg_maxhp, val); break; + case SP_ABSORB_DMG_MAXHP2: + sd->bonus.absorb_dmg_maxhp2 = max(sd->bonus.absorb_dmg_maxhp2, val); + break; case SP_CRITICAL_RANGEATK: // bonus bCriticalLong,n; if (sd->state.lr_flag != 2) sd->bonus.critical_rangeatk += val*10; diff --git a/src/map/pc.hpp b/src/map/pc.hpp index 8db3d84647..4950a3277f 100644 --- a/src/map/pc.hpp +++ b/src/map/pc.hpp @@ -602,6 +602,7 @@ struct map_session_data { int ematk; // matk bonus from equipment int eatk; // atk bonus from equipment uint8 absorb_dmg_maxhp; // [Cydh] + uint8 absorb_dmg_maxhp2; short critical_rangeatk; short weapon_atk_rate, weapon_matk_rate; } bonus; diff --git a/src/map/script_constants.hpp b/src/map/script_constants.hpp index 2ec29e492a..6559c5b678 100644 --- a/src/map/script_constants.hpp +++ b/src/map/script_constants.hpp @@ -843,6 +843,7 @@ export_constant2("bCritDefRate",SP_CRIT_DEF_RATE); export_constant2("bMagicSubDefEle", SP_MAGIC_SUBDEF_ELE); export_constant2("bReduceDamageReturn",SP_REDUCE_DAMAGE_RETURN); + export_constant2("bAbsorbDmgMaxHP2", SP_ABSORB_DMG_MAXHP2); export_constant2("bAddItemSPHealRate", SP_ADD_ITEM_SPHEAL_RATE); export_constant2("bAddItemGroupSPHealRate", SP_ADD_ITEMGROUP_SPHEAL_RATE); export_constant2("bWeaponSubSize", SP_WEAPON_SUBSIZE);