Let's do some corrections...
define procedure <fight>
if ( %health% < 54 ) then {
set numeric <a; $rand(1; 10)$>
if ( %a% = 1 ) then {
set numeric <a; $rand(0; 1)$>
if ( %a% = 0 ) then msg <You narrowily avoid #monster#'s attack.> else {
dec <health; %a%>
msg <#monster# hits you for %a% damage.>
}
}
}
else {
dec <health; %a%>
msg <#monster# hits you for %a% damage.>
}
if got <stick> then set numeric <y; $rand(1; 3)$>
if got <dagger> then set numeric <y; $rand(2; 6)$>
dec <mh1; %y%>
msg <You hit #monster# for %y% damage.>
end define
That's the correction for that procedure...
define selection <weapon shop>
info <Hello #propername# what would you like?>
choice <Buy> if flag <have weapon> then {
say <You can only have one weapon at a time.>
speak <You can only have one weapon at a time.>
}
else choose <Buy>
choice <Sell> if flag <have weapon> then {
if got <dagger> then {
if ask <Are you sure you want to sell your dagger for 100 gold?> then {
hide <dagger>
inc <money; 100>
show <stick>
}
}
if got <short sword> then {
if ask <Are you sure you want to sell your short sword for 200 gold?> then {
hide <short sword>
inc <money; 200>
show <dagger>
}
}
}
choice <Nothing>
end define
Right...
Well, there we go. You can improve that code numerous ways (adding a loop to start off those variables, having them as an array of normal variables.... and you'll find loads of problems down the road using your current battle system - but that's all I can say.