From a46b54a8934dbe2c5144f1c2502a766d7ee29d84 Mon Sep 17 00:00:00 2001 From: Aleos Date: Thu, 17 Mar 2022 14:04:36 -0400 Subject: [PATCH] Adjusts bonus3 item bonuses to support ALL types (#6706) * Fixes #6691. * Adjusts bonus3 bAddEle, bonus3 bSubEle, bonus3 bSubRace item bonuses to support ELE_ALL/RC_ALL flags. Thanks to @eppc0330! --- src/map/battle.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/map/battle.cpp b/src/map/battle.cpp index cb3ca03dca..7ead034bf8 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -712,7 +712,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li int ele_fix = tsd->indexed_bonus.subele[rh_ele] + tsd->indexed_bonus.subele[ELE_ALL] + tsd->indexed_bonus.subele_script[rh_ele] + tsd->indexed_bonus.subele_script[ELE_ALL]; for (const auto &it : tsd->subele2) { - if (it.ele != rh_ele) + if (it.ele != ELE_ALL && it.ele != rh_ele) continue; if (!(((it.flag)&flag)&BF_WEAPONMASK && ((it.flag)&flag)&BF_RANGEMASK && @@ -734,7 +734,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li cardfix = cardfix * (100 - race_fix) / 100; race_fix = tsd->indexed_bonus.subrace[sstatus->race] + tsd->indexed_bonus.subrace[RC_ALL]; for (const auto &it : tsd->subrace3) { - if (it.race != sstatus->race) + if (it.race != RC_ALL && it.race != sstatus->race) continue; if (!(((it.flag)&flag)&BF_WEAPONMASK && ((it.flag)&flag)&BF_RANGEMASK && @@ -779,7 +779,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li sd->right_weapon.addele[ELE_ALL] + sd->indexed_bonus.arrow_addele[ELE_ALL]; for (const auto &it : sd->right_weapon.addele2) { - if (it.ele != tstatus->def_ele) + if (it.ele != ELE_ALL && it.ele != tstatus->def_ele) continue; if (!(((it.flag)&flag)&BF_WEAPONMASK && ((it.flag)&flag)&BF_RANGEMASK && @@ -810,7 +810,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li int ele_fix = sd->right_weapon.addele[tstatus->def_ele] + sd->right_weapon.addele[ELE_ALL]; for (const auto &it : sd->right_weapon.addele2) { - if (it.ele != tstatus->def_ele) + if (it.ele != ELE_ALL && it.ele != tstatus->def_ele) continue; if (!(((it.flag)&flag)&BF_WEAPONMASK && ((it.flag)&flag)&BF_RANGEMASK && @@ -831,7 +831,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li int ele_fix_lh = sd->left_weapon.addele[tstatus->def_ele] + sd->left_weapon.addele[ELE_ALL]; for (const auto &it : sd->left_weapon.addele2) { - if (it.ele != tstatus->def_ele) + if (it.ele != ELE_ALL && it.ele != tstatus->def_ele) continue; if (!(((it.flag)&flag)&BF_WEAPONMASK && ((it.flag)&flag)&BF_RANGEMASK && @@ -855,7 +855,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li + sd->right_weapon.addele[ELE_ALL] + sd->left_weapon.addele[ELE_ALL]; for (const auto &it : sd->right_weapon.addele2) { - if (it.ele != tstatus->def_ele) + if (it.ele != ELE_ALL && it.ele != tstatus->def_ele) continue; if (!(((it.flag)&flag)&BF_WEAPONMASK && ((it.flag)&flag)&BF_RANGEMASK && @@ -864,7 +864,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li ele_fix += it.rate; } for (const auto &it : sd->left_weapon.addele2) { - if (it.ele != tstatus->def_ele) + if (it.ele != ELE_ALL && it.ele != tstatus->def_ele) continue; if (!(((it.flag)&flag)&BF_WEAPONMASK && ((it.flag)&flag)&BF_RANGEMASK && @@ -920,7 +920,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li int ele_fix = tsd->indexed_bonus.subele[rh_ele] + tsd->indexed_bonus.subele[ELE_ALL] + tsd->indexed_bonus.subele_script[rh_ele] + tsd->indexed_bonus.subele_script[ELE_ALL]; for (const auto &it : tsd->subele2) { - if (it.ele != rh_ele) + if (it.ele != ELE_ALL && it.ele != rh_ele) continue; if (!(((it.flag)&flag)&BF_WEAPONMASK && ((it.flag)&flag)&BF_RANGEMASK && @@ -934,7 +934,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li int ele_fix_lh = tsd->indexed_bonus.subele[lh_ele] + tsd->indexed_bonus.subele[ELE_ALL] + tsd->indexed_bonus.subele_script[lh_ele] + tsd->indexed_bonus.subele_script[ELE_ALL]; for (const auto &it : tsd->subele2) { - if (it.ele != lh_ele) + if (it.ele != ELE_ALL && it.ele != lh_ele) continue; if (!(((it.flag)&flag)&BF_WEAPONMASK && ((it.flag)&flag)&BF_RANGEMASK && @@ -957,7 +957,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li cardfix = cardfix * (100 - race_fix) / 100; race_fix = tsd->indexed_bonus.subrace[sstatus->race] + tsd->indexed_bonus.subrace[RC_ALL]; for (const auto &it : tsd->subrace3) { - if (it.race != sstatus->race) + if (it.race != RC_ALL && it.race != sstatus->race) continue; if (!(((it.flag)&flag)&BF_WEAPONMASK && ((it.flag)&flag)&BF_RANGEMASK && @@ -1004,7 +1004,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li } int race_fix = tsd->indexed_bonus.subrace[sstatus->race] + tsd->indexed_bonus.subrace[RC_ALL]; for (const auto &it : tsd->subrace3) { - if (it.race != sstatus->race) + if (it.race != RC_ALL && it.race != sstatus->race) continue; if (!(((it.flag)&flag)&BF_WEAPONMASK && ((it.flag)&flag)&BF_RANGEMASK &&