[@main]
#IF
#SAY
Choose which type of object you want to turn in and write his name.\
{FCOLOR/2}Object name must be written without (Old), (Rust) or (Antiq){FCOLOR/12}\
<Turn in (Old) items/@@turn(Old,300)>\
<Turn in (Rust) items/@@turn(Rust,600)>\
<Turn in (Antiq) items/@@turn(Antiq,900)>\
<Exit/@exit>\
[@@turn()]
#ACT
Mov A1 %INPUTSTR
Mov A2 %ARG(1)
Mov D1 %ARG(2)
Addstr A1 "("
Addstr A1 %A2
Addstr A1 ")"
#SAY
You want turn in: <$OUTPUT(A1)>\
<Type amount/@@Amount>\
<Exit/@exit>\
[@@Amount]
#ACT
Mov D2 %INPUTNUM
goto @checkamount
[@checkamount]
#IF
Equal D2 ""
#SAY
You can not leave the field empty, please enter the amount.\
<Type amount/@@Amount1>\
<Exit/@exit>\
#ELSESAY
You want turn in: <$OUTPUT(A1)>\
Amount: <$OUTPUT(D2)>\
<Yes/@yes>\
<Exit/@exit>\
[@yes]
#IF
checkitem %A1 %D2
#ACT
Mov P2 %D2
Mov P3 %D1
Mul P2 P3
Mov D3 %P9
take %A1 %D1
goto @givefp
#ELSESAY
You've indicated the following:
You want turn in: <$OUTPUT(A1)>\
Amount: <$OUTPUT(D2)>\
But you do not have the object or the amount. Now you can:\
<Re-write amount/@@Amount>\
<Go back to choose Object and re-write his name/@main>\
<Exit/@exit>\
[@givefp]
#IF
Checkfame
#ACT
Mov D4 %P9
Inc D4 %D3
Setfame %D4
Sysmsg "You get <$OUTPUT(D3)> FP"
close