Check of required skill value and level in Item enchants, by azazel. Closes #512

* Added some cosmetic changes to the original patch

--HG--
branch : trunk
This commit is contained in:
spp
2009-12-13 09:17:12 +01:00
parent 839e5624c4
commit df76273dd0
5 changed files with 40 additions and 16 deletions
+6
View File
@@ -10666,6 +10666,12 @@ uint8 Player::CanUseItem( Item *pItem, bool not_loading ) const
if (getLevel() < pProto->RequiredLevel)
return EQUIP_ERR_CANT_EQUIP_LEVEL_I;
if (getLevel() < pItem->GetEnchantRequiredLevel())
return EQUIP_ERR_CANT_EQUIP_LEVEL_I;
if (!pItem->HasEnchantRequiredSkill(this))
return EQUIP_ERR_NO_REQUIRED_PROFICIENCY;
return EQUIP_ERR_OK;
}
}