The enchantment code on this mud is completely customized from the original source, so only Dulrik can attest to the difficulty of such a change; however, in the original source it is less than 30 lines of code, each operating with relative independence.
It should be an incredibly easy adjustment to overload enchant armor to take an optional argument for the type of enchantment one is shooting for, and should also be quite straightforward to alter that code to provide a strongly diminished chance of achieving that enchantment, with a higher fail and critical fail rate. Something like
Code:
function enchant_armor(inventory_slot, armor, enchantment_type)
{
if (roll(0,20) == 20) //critical success, double enchantment
armor[enchantment_type] += 2;
else if (roll(0,20) > 14 + current_enchant_count / 2) //success; allow the enchantment to take place
armor[enchantment_type]++;
else if (roll(0,20) < 2 + current_enchant_count / 2) //critical fail; bye-bye armor!
inventory[inventory_slot] = null;
else if (roll(0,20) < 6 + current_enchant_count / 2) //fail; armor is faded
{
armor[protection] = 0;
armor[resistance] = 0;
armor[willpower] = 0;
armor[fortitude] = 0;
armor[reflex] = 0;
}
}
Code:
syntax: cast 'enchant armor' <armor piece> [protection|fortitude|willpower|reflex|resistance]
When a caster attempts to target a particular type of enchantment toward a piece of armor,
he does so at a greater peril to losing its existing blessings.
In other words, leave the existing codebase exactly as it is, and provide an additional method stub to allow for specialized enchantments for those who would rather trade the frustration of randomness for the frustration of failure.