diff --git a/src/boe.combat.cpp b/src/boe.combat.cpp index abc7d0677..3099dab93 100644 --- a/src/boe.combat.cpp +++ b/src/boe.combat.cpp @@ -543,14 +543,13 @@ void pc_attack(short who_att,iLiving* target) { dam_adj += 10; } - // TODO: These should check abil_data[0], not item_level if((skill_item = attacker.has_abil_equip(eItemAbil::SKILL)) < 24) { - hit_adj += 5 * (attacker.items[skill_item].item_level / 2 + 1); - dam_adj += attacker.items[skill_item].item_level / 2; + hit_adj += 5 * (attacker.items[skill_item].abil_data[0] / 2 + 1); + dam_adj += attacker.items[skill_item].abil_data[0] / 2; } if((skill_item = attacker.has_abil_equip(eItemAbil::GIANT_STRENGTH)) < 24) { - dam_adj += attacker.items[skill_item].item_level; - hit_adj += attacker.items[skill_item].item_level * 2; + dam_adj += attacker.items[skill_item].abil_data[0]; + hit_adj += attacker.items[skill_item].abil_data[0] * 2; } attacker.void_sanctuary(); diff --git a/src/boe.infodlg.cpp b/src/boe.infodlg.cpp index 4480e8fea..e8a910e9b 100644 --- a/src/boe.infodlg.cpp +++ b/src/boe.infodlg.cpp @@ -540,16 +540,15 @@ static void display_pc_info(cDialog& me, const short pc) { if(!univ.party[pc].traits[eTrait::AMBIDEXTROUS] && weap2 < 24) hit_adj -= 25; - // TODO: These should check abil_data[0] instead of item_level // TODO: Perhaps dam_adj and hit_adj calculation should be moved into a function somewhere? dam_adj = univ.party[pc].stat_adj(eSkill::STRENGTH) + minmax(-8,8,univ.party[pc].status[eStatus::BLESS_CURSE]); if((skill_item = univ.party[pc].has_abil_equip(eItemAbil::SKILL)) < 24) { - hit_adj += 5 * (univ.party[pc].items[skill_item].item_level / 2 + 1); - dam_adj += univ.party[pc].items[skill_item].item_level / 2; + hit_adj += 5 * (univ.party[pc].items[skill_item].abil_data[0] / 2 + 1); + dam_adj += univ.party[pc].items[skill_item].abil_data[0] / 2; } if((skill_item = univ.party[pc].has_abil_equip(eItemAbil::GIANT_STRENGTH)) < 24) { - dam_adj += univ.party[pc].items[skill_item].item_level; - hit_adj += univ.party[pc].items[skill_item].item_level * 2; + dam_adj += univ.party[pc].items[skill_item].abil_data[0]; + hit_adj += univ.party[pc].items[skill_item].abil_data[0] * 2; } me["weap1a"].setText("No weapon."); diff --git a/src/classes/item.cpp b/src/classes/item.cpp index 869a45dda..c3c2cf345 100644 --- a/src/classes/item.cpp +++ b/src/classes/item.cpp @@ -549,6 +549,8 @@ void cItem::append(legacy::item_record_type& old){ break; case 37: ability = eItemAbil::SKILL; + abil_data[1] = abil_data[0]; // archive original ability strength (SKILL doesn't use abil_data[1] for anything) + abil_data[0] = item_level; // Put level into ability strength to preserve legacy behaviour break; case 38: // Strength ability = eItemAbil::BOOST_STAT; @@ -573,6 +575,8 @@ void cItem::append(legacy::item_record_type& old){ break; case 43: ability = eItemAbil::GIANT_STRENGTH; + abil_data[1] = abil_data[0]; // archive original ability strength (GIANT_STRENGTH doesn't use abil_data[1] for anything) + abil_data[0] = item_level; // Put level into ability strength to preserve legacy behaviour break; case 44: ability = eItemAbil::LIGHTER_OBJECT;