player.sendPacket(SystemMsg.INCORRECT_ITEM_COUNT);
return false;
}
player.registerRecipe(rp, true);
player.sendPacket(new SystemMessage(SystemMessage.S1_HAS_BEEN_ADDED).addItemName(item.getItemId()));
player.sendPacket(new RecipeBookItemList(player, true));
return true;
}
player.sendPacket(Msg.YOU_ARE_NOT_AUTHORIZED_TO_REGISTER_A_RECIPE);
}
else if (player.getCommonRecipeLimit() > 0)
{
if (player.getCommonRecipeBook().size() >= player.getCommonRecipeLimit())
{
player.sendPacket(Msg.NO_FURTHER_RECIPES_MAY_BE_REGISTERED);
return false;
}
if (player.hasRecipe(rp))
{
player.sendPacket(Msg.THAT_RECIPE_IS_ALREADY_REGISTERED);
return false;
}
if (!player.getInventory().destroyItem(item, 1L))
{
player.sendPacket(SystemMsg.INCORRECT_ITEM_COUNT);
return false;
}
player.registerRecipe(rp, true);
player.sendPacket(new SystemMessage(SystemMessage.S1_HAS_BEEN_ADDED).addItemName(item.getItemId()));
player.sendPacket(new RecipeBookItemList(player, false));
return true;
}
else
{
player.sendPacket(Msg.YOU_ARE_NOT_AUTHORIZED_TO_REGISTER_A_RECIPE);