This is something that I have thought about somewhat. What I would do is have an "equip #object#" command, the player is then using the equipped weapon (so he can carry several, but only fight with one). When a weapon is equipped, the bonus for the weapon is added to the attack.
For armour, for similicity I would have complete costumes, when the player puts on the suit of mithril chainmail, whatever he was previously wearing comes off (as with weapons); he can carry several costumes, but only wear one. When he is attacked, deduct the armour rating from the damage.
If you want to get clever, have different weapons good against different armour. Are you familar with tabletop RPG notation, like 2D6+4 (roll 2 six sided dice and add 4)? Have the armour rating deducted from each die roll, then a sword doing 2d8 is good against armoured foes, while a 4d4+2 is better for unarmoured foes.
I even got as far as a function to determine damage:
<function name="RollDamage" parameters="dice, ac" type="integer">
<!--
Given the classic DnD notation, dice are rolled and the result returned.
The input string must conform to a specific pattern; this is not tested for.
The string must be one of these, where x is one or more digits:
xdx
xdx+x
1d6 Roll a normal six-sided die
5d20+5 Roll five twenty sided dice and add 5 to the result.
NB The AC is deducted from every dice roll.
-->
<function parameters="dice,ac" type="integer"><![CDATA[
p1 = Instr(dice, "d")
p2 = Instr(dice, "+")
p3 = LengthOf(dice)
number = ToInt(Mid(dice, 1, p1 - 1))
if (p2 = 0) {
sides = ToInt(Mid(dice, p1 + 1, p3 - p1))
total = 0
}
else {
sides = ToInt(Mid(dice, p1 + 1, p2 - p1 - 1))
total = ToInt(Mid(dice, p2 + 1, p3 - p2))
}
for (i, 1, number) {
total = total + GetRandomInt(1, sides)
}
total = total - ac * number
if (total < 1) {
return 1
}
else {
return (total)
}
]]></function>
I have not got as far as putting this into quest, so there may well be brackets missing, etc. but it might help.
The other idea I had was to let the player and opponent choose to stab, slash or strike their foe, with a bonus or penalty depending on what the foe does (rock, scissors, paper style). Really clever foes will always guess right! But that may be more complicated than you want.