else if(itemToEnchant.isWeapon())
{
if(itemToEnchant.getAttributeElement() != Element.NONE && itemToEnchant.getAttributeElement() != element)
{
activeChar.sendPacket(SystemMsg.ANOTHER_ELEMENTAL_POWER_HAS_ALREADY_BEEN_ADDED_THIS_ELEMENTAL_POWER_CANNOT_BE_ADDED, ActionFail.STATIC);
return;
}
}
else
{
activeChar.sendPacket(SystemMsg.INAPPROPRIATE_ENCHANT_CONDITIONS, ActionFail.STATIC);
return;
}
if(item.isUnderwear() || item.isCloak() || item.isBracelet() || item.isBelt() || !item.isAttributable())
{
activeChar.sendPacket(SystemMsg.INAPPROPRIATE_ENCHANT_CONDITIONS, ActionFail.STATIC);
return;
}
int minValue = 0;
int maxValue = itemToEnchant.isWeapon() ? 150 : 60;
int maxValueCrystal = itemToEnchant.isWeapon() ? 300 : 120;
int maxValueJewel = itemToEnchant.isWeapon() ? 450 : 180;
int maxValueEnergy = itemToEnchant.isWeapon() ? 600 : 240;
if(!stone.getTemplate().isAttributeCrystal() && itemToEnchant.getAttributeElementValue(element, false) >= maxValue
|| stone.getTemplate().isAttributeCrystal() && (itemToEnchant.getAttributeElementValue(element, false) < maxValue
|| itemToEnchant.getAttributeElementValue(element, false) >= maxValueCrystal))
if(!stone.getTemplate().isAttributeJewel() && itemToEnchant.getAttributeElementValue(element, false) >= maxValueCrystal
|| stone.getTemplate().isAttributeJewel() && (itemToEnchant.getAttributeElementValue(element, false) < maxValueCrystal
|| itemToEnchant.getAttributeElementValue(element, false) >= maxValueJewel))
if(!stone.getTemplate().isAttributeEnergy() && itemToEnchant.getAttributeElementValue(element, false) >= maxValueJewel
|| stone.getTemplate().isAttributeEnergy() && (itemToEnchant.getAttributeElementValue(element, false) < maxValueJewel
|| itemToEnchant.getAttributeElementValue(element, false) >= maxValueEnergy))
{
activeChar.sendPacket(SystemMsg.ELEMENTAL_POWER_ENHANCER_USAGE_REQUIREMENT_IS_NOT_SUFFICIENT, ActionFail.STATIC);
return;
}