 Rem File: Cmd087.bas ' patched 03/22/2020
 Rem Sub: Mix.Potion
 Rem $Include: 'dndbbs.inc'
 On Error Goto Main.Error
 If Chained<>-2 Then
    Color 15,0
    Print "DNDBBS Command 087 -- Mix.Potion."
    Color 7,0
    End
 Endif
 Call Mix.Potion
Main.Resume:
 Chain DND.Path+"DNDBBS.EXE"
 End
Main.Error:
 Resume Main.Resume

Sub Mix.Potion
 On Local Error Goto Error.Trap35
 Call Parse
 If Parser Then
    Call Numeric
 Endif
 Temp4=False
 Call Check.Room.Items
 If Temp7!<SFalse Then
    Strng="You can't mix that!"
    Call IO.O
    Exit Sub
 Endif
 If Temp7!=SFalse Then
    Call Num
    Temp4=1
    Call Check.User.Items
 Endif
 If Temp7!<=SFalse Then
    Strng="You can't mix that!"
    Call IO.O
    Exit Sub
 Endif
 If TreasureRecord.Potion=False Then
    Strng="You can't mix that!"
    Call IO.O
    Exit Sub
 Endif
 If MessWorkRecord6.Charges<=False Then
    Strng="You can't! It's empty!"
    Call IO.O
    Exit Sub
 Endif
 Graphics.Off=True
 Var$=Lcase$(Rtrim$(TreasureRecord.TreasureName))
 Var2$=Rtrim$(TreasureRecord.Prefix1)
 Strng="You mix "+Var2$+Var$
 Call Convert.ANSI(True,VarQ,VarR)
 Carriage.Return=-1
 Graphics.On=True
 Call IO.O
 Graphics.On=False
 Graphics.Off=True
 Strng="!"
 Call IO.O
 Graphics.Off=False
 VarA!=Temp5!
 VarB=Temp6
 TempA!=TreasureRecord.MixPotion
 If TempA!=SFalse Then
    Strng="Nothing happens!"
    Call IO.O
    Exit Sub
 Endif
 TempA!=TreasureRecord.NewPotion
 Call Read.Record(TreasureFile,TempA!)
 If TreasureRecord.Potion=False Then
    Strng="Nothing happens!"
    Call IO.O
    Exit Sub
 Endif
 Select Case Temp4
 Case 1
    Call Read.Record(MessWorkFile6,VarA!)
    MessWorkRecord6.Index=TempA!
    MessWorkRecord6.Charges=VarB
    Call Write.Record(MessWorkFile6,VarA!)
 Case 0
    Call Read.Record(RoomInvFile,VarA!)
    MessWorkRecord6.Room=Room
    MessWorkRecord6.Index=TempA!
    MessWorkRecord6.Charges=VarB
    Call Write.Record(RoomInvFile,VarA!)
 End Select
 Graphics.Off=True
 Var$=Lcase$(Rtrim$(TreasureRecord.TreasureName))
 Var2$=Rtrim$(TreasureRecord.Prefix1)
 Strng="You create "+Var2$+Var$
 Call Convert.ANSI(True,VarQ,VarR)
 Carriage.Return=-1
 Graphics.On=True
 Call IO.O
 Graphics.On=False
 Graphics.Off=True
 Strng="!"
 Call IO.O
 Graphics.Off=False
Error.Resume35:
 Exit Sub
Error.Trap35:
 Resume Error.Resume35
End Sub
