Implemented new bonus for official Sarah Card behavior. Fixes #6189 (#6281)

This commit is contained in:
Jittapan Pluemsumran 2022-03-29 15:35:15 +07:00 committed by GitHub
parent d2826827df
commit 695de6313a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 4 deletions

View File

@ -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

View File

@ -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
-------

View File

@ -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;
}

View File

@ -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 {

View File

@ -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;

View File

@ -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;

View File

@ -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);