I'd already mentioned Andy Bartlett's post on zero-level NPCs using magic as one of the the things that sparked this recent discussion of re-purposing the magic research rules for many other things, from adding new mundane skills to building shrines and libraries. But one of the other inspirations was a forum discussion about magic weapons and armor that are legendary rather than enchanted. They became powerful because they were used in great deeds, not because they were made by a wizard. In the forum thread, I outlined this idea:
Giving your sword or weapon a name is the first step towards making it legendary. A master smith must etch the weapon's name into the blade or shaft, perhaps adding a gold or silver inlay. The amount of money spent affects the odds of the weapon becoming legendary: 500 gp for a 1 in 20 chance, plus 500 gp for each additional 1 in 20. Double the cost for a +2 weapon, or quadruple it for a +3 weapon.
You don't roll during the crafting, but instead during combat. When you strike the deathblow on a monster that's a higher level than you, roll to see if the weapon becomes legendary. Or, combine this roll with the attack roll: it becomes legendary on a perfect 20 roll for the death blow, or a perfect 19+ if you paid the extra 500 gp, or a perfect 18+ if you paid 1,500 gp and so on.
Once it becomes legendary, the GM secretly rolls for intelligence and possibly ego, perhaps using only 1d6 to start. Each additional legendary deathblow gives a chance for the weapon's intelligence to increase, and thus have an increasing chance of communicating with the hero and/or developing powers. To add specific powers, take the legendary weapon back to the smith to inlay some runes on the weapon for another magic research roll, the cost based on the effective spell level of the desired effect (flaming swords might be 3rd level, a sword that summons storms would be 6th level.)
These costs do not have to be ornamentation by a blacksmith; that's just an example. It could instead involve performing rituals and using rare magical substances, or paying bards to spread rumors about the deeds of your mighty blade. Also, you can set maximums for the plusses on a weapon, or limit intelligence to magical swords as per the rules as written, or require a minimum character level before a weapon could become legendary.