The problem is that Mail heirloom armor is supposed to downgrade to Leather for Hunter/Shaman and Plate Mail downgrades to Mail for Paladins and Warriors.
My code below accomplishes just that. My mangos version is 8407, but nothing has changed in this area recently as far as I can tell.
Now, I have no idea how hacky or efficient this code is and would appreciate any help in improving it. Especially the part where I check to see if it's a heirloom item. Is there a better way to check? (I just copied the part from another section.)
in player.cpp
@@ -10128,20 +10128,31 @@ uint8 Player::CanUseItem( Item *pItem, bool not_loading ) const
return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM;
if (pItem->GetSkill() != 0)
{
if (GetSkillValue( pItem->GetSkill() ) == 0)
- return EQUIP_ERR_NO_REQUIRED_PROFICIENCY;
+ {
+ ScalingStatDistributionEntry const *ssd = pProto->ScalingStatDistribution ? sScalingStatDistributionStore.LookupEntry(pProto->ScalingStatDistribution) : 0;
+ if (ssd) //This line and above checks to see if it's an heirloom item in a weird way
+ {
+ //Heirlooms: Mail downgrades to leather and Plate Mail to Mail for certain classes only.
+ if (pItem->GetSkill() == SKILL_MAIL && (getClass() == CLASS_HUNTER || getClass() == CLASS_SHAMAN))
+ return EQUIP_ERR_OK;
+ if (pItem->GetSkill() == SKILL_PLATE_MAIL && (getClass() == CLASS_PALADIN || getClass() == CLASS_WARRIOR))
+ return EQUIP_ERR_OK;
+ }
+ return EQUIP_ERR_NO_REQUIRED_PROFICIENCY;
+ }
}
if (pProto->RequiredSkill != 0)
{
if (GetSkillValue( pProto->RequiredSkill ) == 0)