Let's see if I can make it a bit more clear. The *gen stuff IS pretty confusing.
First, there's a couple of examples at the end of Itemgen.txt that may help. With reference to those...
For weapons, you'll want to set the name, short/long desc, flags, and a couple of the values: value8 is weapon type, value9 is the material the weapon's made of, and value9 is how good the quality is, which has to do with damage. There's tables for all three of those in Itemgen.txt, which should explain themselves decently.
Those will in turn deal with values 1-4 and the cost.
For armor, you'll want to set the name, the descs, and some different values: value3 is armor type, value4 is material type. That in turn sets extra flags, cost, and the other values.
Rent items should automatically figure themselves out if set to I believe -2, and I believe -2's the default. RentGeneration.txt has the goods on that.
The treasure generation code, of course, is simply an automated version of all of these used by the game itself. Builders have it slightly harder, but not much.