 Rem File: Cmd120.bas
 Rem Sub: Steal.Object
 Rem $Include: 'dndbbs.inc'
 On Error Goto Main.Error
 If Chained<>-2 Then
    Color 15,0
    Print "DNDBBS Command 120 -- Steal.Object."
    Color 7,0
    End
 Endif
 Call Steal.Object
Main.Resume:
 Chain DND.Path+"DNDBBS.EXE"
 End
Main.Error:
 Resume Main.Resume

Sub Steal.Object
 On Local Error Goto ErrTrap21
 Gosub Get.Config
 VarA$=Parsed.Command1
 VarB$=Parsed.Command2
 Call ParseX
 ' steal item box user
 If Instr(Parsed.Command1," ") Then
    Var$=Parsed.Command2 ' item
    Parsed.Command2=Parsed.Command1
    Call ParseX
    ' parsed.command1=user
    ' parsed.command2=box
    Call Numeric
    ' online user
    Call Search.Mess(SFalse)
    If Temp!=Room And TempB!<>User.Index Then
       VarY=TempC ' node
       VarB!=TempB!
       Var3$=Lcase$(Rtrim$(MessWorkRecord1.UserName))
       Parsed.Command1=Parsed.Command2
       Call Numeric
       Call Search.User.Container2
       If ContainerRecord.InvisibleContainer Then
          VarZZ=-1
       Endif
       If TempA!<>SFalse Then
          If ContainerRecord.Damaged=True Then
             Strng="You can't, it's damaged."
             Call IO.O
             Exit Sub
          Endif
          If ContainerRecord.Locked=True Then
             Strng="You can't, it's locked."
             Call IO.O
             Exit Sub
          Endif
          If ContainerRecord.Locked=1 Then
             If ContainerRecord.Closed Then
                Strng="You can't, it's closed."
                Call IO.O
                Exit Sub
             Endif
          Endif
          VarQ2=ContainerRecord.TrapType
          VarQ3=ContainerRecord.TrapHits
          VarQ4!=ContainerRecord.TrapItem
          Var2$=ContainerRecord.ContainerShort
          Var2$=Rtrim$(Var2$)
          Var2$=Lcase$(Var2$)
          VarZ$=Var2$
          Parsed.Command1=Var$ ' item
          Call Numeric
          Temp2=Parse.Temp
          Call Find.In.Container
          If MessWorkRecord6.Plus Then
             VarZZ3=-1
          Endif
          If MessWorkRecord6.Charges<False Then
             VarZZ4=-1
          Endif
          Var1$=Lcase$(Out3)
          VarQ=False
          If Temp7! Then
             If Temp7!>0! Then
                VarQ=TreasureRecord.Coin
                If TreasureRecord.Container Then
                   Strng="You can't steal that!"
                   Call IO.O
                   Exit Sub
                Endif
             Endif

             If Normal.User Then
                If UserRecord2.ClassType>=Lady Then
                   Strng3=Rtrim$(Class.Name(UserRecord2.ClassType))
                   Call A.Or.An
                   Strng="You can't steal from "+Prefix1+Strng3+"."
                   Call IO.O
                   Exit Sub
                Endif
                If UserRecord.ClassType<AsstDM Then
                   If UserRecord.ClassType<>Thief Then
                      If option1 Then
                         Strng="Only thieves can steal from containers!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Else
                      If UserRecord.Level<option2 Then
                         Strng="Only level "+Form$(Cdbl(option2))+" thieves can steal from containers!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Endif
                   If Len(option3$) Then
                      Out2=option3$
                      Call Equate(Temp#)
                      If Temp# Then
                         Strng="Didn't work!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Else
                      If Int(Rnd*5+5)>UserRecord.Stats(4)/2 Then
                         Strng="Didn't work!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Endif
                Endif
             Endif

             If Temp7!>SFalse Then
                If VarQ=False Then
                   If UserRecord.Encumbrance>=False Then
                      Temp1#=Cdbl(Weight+TreasureRecord.Weight)
                      Temp2#=Cdbl(UserRecord.Stats(1))*Cdbl(UserRecord.Encumbrance)
                      If Temp1#>Temp2# Then
                         Strng="You can't carry any more!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Endif
                Endif
             Endif
             If VarQ=False Then
                Call Add.Inventory(Temp7!,Temp6)
             Endif
             Call Delete.List.Node5(Temp5!)
             Call Clear.List.Node
             Call Write.Record(CtnInvFile,Temp5!)
             Var3$=Lcase$(Var3$)
             Mid$(Var3$,1,1)=Ucase$(Mid$(Var3$,1,1))
             If VarZZ4 Then
                Var1$=Var1$+" [lit]"
             Endif
             If VarZZ3 Then
                Var1$=Var1$+" [inv]"
             Endif
             Strng="You steal "+Var1$+" from the "+Var2$+" of "+Var3$+"!"
             Call IO.O
             If Node>False Then
                Temp#=0#
                Out2=Var1$+" from the "+Var2$
                Call Send.Mess(16,VarB!,Room,Out2)
             Endif
             If VarQ Then
                Graphics.Off=False
                UserRecord.Gold=UserRecord.Gold+TreasureRecord.Gold
                Call Amount2(UserRecord.Gold,VarQ2$)
                Strng="You now have"+VarQ2$+" Gold!"
                Call IO.O
             Else
                Call ContainerTraps(VarQ2,VarQ3,VarQ4!,VarZ$)
             Endif
             Exit Sub
          Endif

          ' steal box box user
          Call Search.In.Container
          If ContainerRecord.InvisibleContainer Then
             VarZZ2=-1
          Endif
          If TempB! Then
             If Normal.User Then
                If UserRecord2.ClassType>=Lady Then
                   Strng3=Rtrim$(Class.Name(UserRecord2.ClassType))
                   Call A.Or.An
                   Strng="You can't steal from "+Prefix1+Strng3+"."
                   Call IO.O
                   Exit Sub
                Endif
                If UserRecord.ClassType<AsstDM Then
                   If UserRecord.ClassType<>Thief Then
                      If option22 Then
                         Strng="Only thieves can steal from containers!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Else
                      If UserRecord.Level<option23 Then
                         Strng="Only level "+Form$(Cdbl(option23))+" thieves can steal from containers!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Endif
                   If Len(option23$) Then
                      Out2=option23$
                      Call Equate(Temp#)
                      If Temp# Then
                         Strng="Didn't work!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Else
                      If Int(Rnd*5+5)>UserRecord.Stats(4)/2 Then
                         Strng="Didn't work!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Endif
                Endif
             Endif
             Call Take.Within.Container
             Var1$=Lcase$(Out3)
             If VarZZ2 Then
                Var1$=Var1$+" [inv]"
             Endif
             If VarZZ Then
                Var2$=Var2$+" [inv]"
             Endif
             Strng="You steal "+Var1$+" from the "+Var2$+" of "+Var3$+"!"
             Call IO.O
             Exit Sub
          Endif

          Strng="You can't steal that!"
          Call IO.O
          Exit Sub
       Endif
       Strng="You can't steal from that!"
       Call IO.O
       Exit Sub
    Endif
    Parsed.Command1=VarA$
    Parsed.Command2=VarB$
    Call ParseX
    Var$=Parsed.Command2 ' item
    Parsed.Command2=Parsed.Command1
    Call ParseX
    ' parsed.command1=user
    ' parsed.command2=box
    Call Numeric
    ' offline user
    Call Check.User
    If User.Temp Then
       Var3$=Lcase$(Out3)
       Mid$(Var3$,1,1)=Ucase$(Mid$(Var3$,1,1))
       Parsed.Command1=Parsed.Command2
       Call Numeric
       TempB!=MessWorkRecord4.Index
       Call Search.User.Container2
       If ContainerRecord.InvisibleContainer Then
          VarZZ=-1
       Endif
       If TempA!<>SFalse Then
          If ContainerRecord.Damaged=True Then
             Strng="You can't, it's damaged."
             Call IO.O
             Exit Sub
          Endif
          If ContainerRecord.Locked=True Then
             Strng="You can't, it's locked."
             Call IO.O
             Exit Sub
          Endif
          If ContainerRecord.Locked=1 Then
             If ContainerRecord.Closed Then
                Strng="You can't, it's closed."
                Call IO.O
                Exit Sub
             Endif
          Endif
          VarQ2=ContainerRecord.TrapType
          VarQ3=ContainerRecord.TrapHits
          VarQ4!=ContainerRecord.TrapItem
          Var2$=ContainerRecord.ContainerShort
          Var2$=Rtrim$(Var2$)
          Var2$=Lcase$(Var2$)
          VarZ$=Var2$
          Parsed.Command1=Var$ ' item
          Call Numeric
          Temp2=Parse.Temp
          Call Find.In.Container
          If MessWorkRecord6.Plus Then
             VarZZ3=-1
          Endif
          If MessWorkRecord6.Charges<False Then
             VarZZ4=-1
          Endif
          Var1$=Lcase$(Out3)
          VarQ=False
          If Temp7! Then
             If Temp7!>0! Then
                VarQ=TreasureRecord.Coin
                If TreasureRecord.Container Then
                   Strng="You can't steal that!"
                   Call IO.O
                   Exit Sub
                Endif
             Endif

             If Normal.User Then
                If UserRecord2.ClassType>=Lady Then
                   Strng3=Rtrim$(Class.Name(UserRecord2.ClassType))
                   Call A.Or.An
                   Strng="You can't steal from "+Prefix1+Strng3+"."
                   Call IO.O
                   Exit Sub
                Endif
                If UserRecord.ClassType<AsstDM Then
                   If UserRecord.ClassType<>Thief Then
                      If option4 Then
                         Strng="Only thieves can steal from containers!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Else
                      If UserRecord.Level<option5 Then
                         Strng="Only level "+Form$(Cdbl(option5))+" thieves can steal from containers!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Endif
                   If Len(option6$) Then
                      Out2=option6$
                      Call Equate(Temp#)
                      If Temp# Then
                         Strng="Didn't work!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Else
                      If Int(Rnd*5+5)>UserRecord.Stats(4)/2 Then
                         Strng="Didn't work!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Endif
                Endif
             Endif

             If Temp7!>SFalse Then
                If VarQ=False Then
                   If UserRecord.Encumbrance>=False Then
                      Temp1#=Cdbl(Weight+TreasureRecord.Weight)
                      Temp2#=Cdbl(UserRecord.Stats(1))*Cdbl(UserRecord.Encumbrance)
                      If Temp1#>Temp2# Then
                         Strng="You can't carry any more!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Endif
                Endif
             Endif
             If VarQ=False Then
                Call Add.Inventory(Temp7!,Temp6)
             Endif
             Call Delete.List.Node5(Temp5!)
             Call Clear.List.Node
             Call Write.Record(CtnInvFile,Temp5!)
             If VarZZ4 Then
                Var1$=Var1$+" [lit]"
             Endif
             If VarZZ3 Then
                Var1$=Var1$+" [inv]"
             Endif
             Strng="You steal "+Var1$+" from the "+Var2$+" of "+Var3$+"!"
             Call IO.O
             If VarQ Then
                Graphics.Off=False
                UserRecord.Gold=UserRecord.Gold+TreasureRecord.Gold
                Call Amount2(UserRecord.Gold,VarQ2$)
                Strng="You now have"+VarQ2$+" Gold!"
                Call IO.O
             Else
                Call ContainerTraps(VarQ2,VarQ3,VarQ4!,VarZ$)
             Endif
             Exit Sub
          Endif

          ' steal box box user
          Call Search.In.Container
          If ContainerRecord.InvisibleContainer Then
             VarZZ2=-1
          Endif
          If TempB! Then
             If Normal.User Then
                If UserRecord2.ClassType>=Lady Then
                   Strng3=Rtrim$(Class.Name(UserRecord2.ClassType))
                   Call A.Or.An
                   Strng="You can't steal from "+Prefix1+Strng3+"."
                   Call IO.O
                   Exit Sub
                Endif
                If UserRecord.ClassType<AsstDM Then
                   If UserRecord.ClassType<>Thief Then
                      If option24 Then
                         Strng="Only thieves can steal from containers!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Else
                      If UserRecord.Level<option25 Then
                         Strng="Only level "+Form$(Cdbl(option25))+" thieves can steal from containers!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Endif
                   If Len(option26$) Then
                      Out2=option26$
                      Call Equate(Temp#)
                      If Temp# Then
                         Strng="Didn't work!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Else
                      If Int(Rnd*5+5)>UserRecord.Stats(4)/2 Then
                         Strng="Didn't work!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Endif
                Endif
             Endif
             Call Take.Within.Container
             Var1$=Lcase$(Out3)
             If VarZZ2 Then
                Var1$=Var1$+" [inv]"
             Endif
             If VarZZ Then
                Var2$=Var2$+" [inv]"
             Endif
             Strng="You steal "+Var1$+" from the "+Var2$+" of "+Var3$+"!"
             Call IO.O
             Exit Sub
          Endif
          Strng="You can't steal that!"
          Call IO.O
          Exit Sub
       Endif
       Strng="You can't steal from that!"
       Call IO.O
       Exit Sub
    Endif
    Strng="You can't steal from that user!"
    Call IO.O
    Exit Sub
 Endif

 ' steal from monster
 Call Numeric
 Call Check.Monster
 If Monster.Temp Then
    Var2$=Lcase$(Rtrim$(MessWorkRecord3.Monster.MonsterName))
    Mid$(Var2$,1,1)=Ucase$(Mid$(Var2$,1,1))

    ' check magical/permanent/nonplayer
    If MessWorkRecord3.Monster.Magic<=True Then
       Call The.Or.An
       Strng="You can't steal from "+Prefix1+Var2$+"!"
       Call IO.O
       Exit Sub
    Endif
    If MessWorkRecord3.Monster.Permanent<=True Then
       Call The.Or.An
       Strng="You can't steal from "+Prefix1+Var2$+"!"
       Call IO.O
       Exit Sub
    Endif
    Parsed.Command1=Lcase$(Parsed.Command2)

    ' steal gold monster
    Var#=Int(Val(Parsed.Command1)+.5)
    If Var#>0# Then
       If Var#<=MessWorkRecord3.Monster.Gold Then
          If Var#<=option9x# Or option9x#=-1# Then
             If Normal.User Then
                If UserRecord.ClassType<AsstDM Then
                   If UserRecord.ClassType<>Thief Then
                      If option7x Then
                         Strng="Only thieves can steal!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Endif
                   If Len(option8x$) Then
                      Out2=option8x$
                      Call Equate(Temp#)
                      If Temp# Then
                         Strng="Didn't work!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Else
                      If Int(Rnd*5+5)>UserRecord.Stats(4)/2 Then
                         Strng="Didn't work!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Endif
                Endif
             Endif
             MessWorkRecord3.Monster.Gold=MessWorkRecord3.Monster.Gold-Var#
             Call Write.Record(MessWorkFile3,Temp5!)
             UserRecord.Gold=UserRecord.Gold+Var#
             Call Amount2(UserRecord.Gold,VarQ2$)
             Strng="You now have"+VarQ2$+" Gold!"
             Call IO.O
             Exit Sub
          Else
             Strng="You can't steal that much!"
             Call IO.O
             Exit Sub
          Endif
       Else
          Strng="The "+Var2$+" doesn't have that much!"
          Call IO.O
          Exit Sub
       Endif
    Endif

    ' steal item monster
    Call Numeric
    TempC=False
    TempQ!=MessWorkRecord3.Index
    For Temp5!=1! To Lof(MessWorkFile5)/MessWorkRecLen5
       Call Read.Record(MessWorkFile5,Temp5!)
       Temp2!=MessWorkRecord5.Index
       Temp9=MessWorkRecord5.Charges
       Temp3=False
       If Temp2!=TempQ! Then
          Temp3=True
       Endif
       If MessWorkRecord5.Room<>Room Then
          Temp3=False
       Endif
       If MessWorkRecord5.Monster<>Monster.Temp Then
          Temp3=False
       Endif
       If Temp3 Then
          Temp4!=MessWorkRecord5.Inv
          If Temp4!>SFalse And Temp4!<=Lof(TreasureFile)/TreasureRecLen Then
             Call Read.Record(TreasureFile,Temp4!)
             Var$=Lcase$(Rtrim$(TreasureRecord.ShortName))
             Var$=Left$(Var$,Len(Parsed.Command1))
             Var1$=Lcase$(Rtrim$(TreasureRecord.TreasureName))
          Endif
          If Temp4!<SFalse Then
             If Abs(Temp4!)<=Lof(ObjectFile)/ObjectRecLen Then
                Call Read.Record(ObjectFile,Abs(Temp4!))
                Var$=Lcase$(Rtrim$(ObjectRecord.ShortName))
                Var$=Left$(Var$,Len(Parsed.Command1))
                Var1$=Lcase$(Rtrim$(ObjectRecord.ObjectName))
             Endif
          Endif
          If Temp4! Then
             If Var$=Parsed.Command1 Then
                TempC=TempC+1
                If Parse.Temp=False Or TempC=Parse.Temp Then
                   If Normal.User Then
                      If UserRecord.ClassType<AsstDM Then
                         If UserRecord.ClassType<>Thief Then
                            If option7 Then
                               Strng="Only thieves can steal!"
                               Call IO.O
                               Exit Sub
                            Endif
                         Endif
                         If Len(option8$) Then
                            Out2=option8$
                            Call Equate(Temp#)
                            If Temp# Then
                               Strng="Didn't work!"
                               Call IO.O
                               Exit Sub
                            Endif
                         Else
                            If Int(Rnd*5+5)>UserRecord.Stats(4)/2 Then
                               Strng="Didn't work!"
                               Call IO.O
                               Exit Sub
                            Endif
                         Endif
                      Endif
                   Endif
                   Strng="You steal "+Var1$+" from the "+Var2$+"!"
                   Call IO.O
                   MessWorkRecord5.Index=SFalse
                   Call Write.Record(MessWorkFile5,Temp5!)
                   If Temp4!>SFalse Then
                      If TreasureRecord.Coin Then
                         UserRecord.Gold=UserRecord.Gold+TreasureRecord.Gold
                         Call Amount2(UserRecord.Gold,VarQ2$)
                         Strng="You now have"+VarQ2$+" Gold!"
                         Call IO.O
                      Else
                         If TreasureRecord.Container Then
                            Call Drop.Container.In.User(Temp4!)
                         Else
                            Call Add.Inventory(Temp4!,Temp9)
                         Endif
                      Endif
                   Else
                      Call Add.Inventory(Temp4!,Temp9)
                   Endif
                   Exit Sub
                Endif
             Endif
          Endif
       Endif
    Next
    Strng="You can't steal that!"
    Call IO.O
    Exit Sub
 Endif

 ' steal item user
 VarA$=Parsed.Command1
 VarB$=Parsed.Command2
 Call Num

 ' online user
 Call Search.Mess(SFalse)
 If Temp!=Room And TempB!<>User.Index Then
    Temp#=Int(Val(Parsed.Command1)+.5)
    If Temp#>DFalse Then
       If Temp#<=UserRecord2.Gold Then
          If Temp#<=Option12x# Or Option12x#=-1# Then
             Select Case Temp#
             Case 1 To 10
                Strng2=" "+Rtrim$(Numeral(Temp#))
             Case Else
                Call Amount2(Temp#,VarZ$)
                Strng2=VarZ$
             End Select
             Mid$(Strng,1,1)=Ucase$(Mid$(Strng,1,1))
             If Normal.User Then
                If UserRecord2.ClassType>=Lady Then
                   Strng3=Rtrim$(Class.Name(UserRecord2.ClassType))
                   Call A.Or.An
                   Strng="You can't steal from "+Prefix1+Strng3+"."
                   Call IO.O
                   Exit Sub
                Endif
                If UserRecord.ClassType<AsstDM Then
                   If UserRecord.ClassType<>Thief Then
                      If option29 Then
                         Strng="Only thieves can steal gold!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Else
                      If UserRecord.Level<option30 Then
                         Strng="Only level "+Form$(Cdbl(option2))+" thieves can steal gold!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Endif
                   If Len(option30$) Then
                      Out2=option30$
                      Call Equate(Temp#)
                      If Temp# Then
                         Strng="Didn't work!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Else
                      If Int(Rnd*5+5)>UserRecord.Stats(4)/2 Then
                         Strng="Didn't work!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Endif
                Endif
             Endif
             Strng="You steal"+Strng2+" gold from "+Strng+"!"
             Call IO.O
             Out2=Str$(Temp#)
             Call Send.Mess(16,TempB!,Room,Out2)
             UserRecord2.Gold=UserRecord2.Gold-Temp#
             Call Write.Record(UserFile2,TempB!)
             UserRecord.Gold=UserRecord.Gold+Temp#
             Exit Sub
          Else
             Strng="You can't steal that much gold!"
             Call IO.O
             Exit Sub
          Endif
       Else
          Strng="That user does not have that much gold!"
          Call IO.O
          Exit Sub
       Endif
    Endif

    VarY=TempC ' node
    Var2$=Lcase$(Rtrim$(MessWorkRecord1.UserName))
    Mid$(Var2$,1,1)=Ucase$(Mid$(Var2$,1,1))
    Parsed.Command1=Parsed.Command2
    Call Numeric
    Call Search.User.Inventory
    Var1$=Lcase$(Rtrim$(Out3))
    If Temp7!<SFalse Then ' object
       If Normal.User Then
          If MessWorkRecord1.ClassType>=Lady Then
             Strng3=Rtrim$(Class.Name(MessWorkRecord1.ClassType))
             Call A.Or.An
             Strng="You can't steal from "+Prefix1+Strng3+"."
             Call IO.O
             Exit Sub
          Endif
          If UserRecord.ClassType<AsstDM Then
             If UserRecord.ClassType<>Thief Then
                If option9 Then
                   Strng="Only thieves can steal!"
                   Call IO.O
                   Exit Sub
                Endif
             Endif
             If Len(option10$) Then
                Out2=option10$
                Call Equate(Temp#)
                If Temp# Then
                   Strng="Didn't work!"
                   Call IO.O
                   Exit Sub
                Endif
             Else
                If Int(Rnd*5+5)>UserRecord.Stats(4)/2 Then
                   Strng="Didn't work!"
                   Call IO.O
                   Exit Sub
                Endif
             Endif
          Endif
       Endif
       Strng="You steal "+Var1$+" from "+Var2$+"!"
       Call IO.O
       MessWorkRecord6.User=SFalse
       Call Write.Record(MessWorkFile6,Temp5!)
       Call Add.Inventory(Temp7!,Temp6)
       Exit Sub
    Endif
    If Temp7!>SFalse Then ' treasure
       If Normal.User Then
          If MessWorkRecord1.ClassType>=Lady Then
             Strng3=Rtrim$(Class.Name(MessWorkRecord1.ClassType))
             Call A.Or.An
             Strng="You can't steal from "+Prefix1+Strng3+"."
             Call IO.O
             Exit Sub
          Endif
          If UserRecord.ClassType<AsstDM Then
             If UserRecord.ClassType<>Thief Then
                If option11 Then
                   Strng="Only thieves can steal!"
                   Call IO.O
                   Exit Sub
                Endif
             Endif
             If Len(option12$) Then
                Out2=option12$
                Call Equate(Temp#)
                If Temp# Then
                   Strng="Didn't work!"
                   Call IO.O
                   Exit Sub
                Endif
             Else
                If Int(Rnd*5+5)>UserRecord.Stats(4)/2 Then
                   Strng="Didn't work!"
                   Call IO.O
                   Exit Sub
                Endif
             Endif
          Endif
       Endif
       Strng="You steal "+Var1$+" from "+Var2$+"!"
       Call IO.O
       MessWorkRecord6.User=SFalse
       Call Write.Record(MessWorkFile6,Temp5!)
       If TreasureRecord.Coin Then
          UserRecord.Gold=UserRecord.Gold+TreasureRecord.Gold
          Call Amount2(UserRecord.Gold,VarQ2$)
          Strng="You now have"+VarQ2$+" Gold!"
          Call IO.O
       Else
          Call Add.Inventory(Temp7!,Temp6)
       Endif
       If Node>False Then
          Temp#=0#
          Out2=Var1$
          Call Send.Mess(16,TempB!,Room,Out2)
       Endif
       Exit Sub
    Endif
    ' steal container user
    Call Num
    Call Search.User.Container2
    If ContainerRecord.InvisibleContainer Then
       VarZZ=-1
    Endif
    Var1$=Lcase$(Rtrim$(Out3))
    If TempA!<>SFalse Then
       If Normal.User Then
          If UserRecord2.ClassType>=Lady Then
             Strng3=Rtrim$(Class.Name(UserRecord2.ClassType))
             Call A.Or.An
             Strng="You can't steal from "+Prefix1+Strng3+"."
             Call IO.O
             Exit Sub
          Endif
          If UserRecord.ClassType<AsstDM Then
             If UserRecord.ClassType<>Thief Then
                If option13 Then
                   Strng="Only thieves can steal containers!"
                   Call IO.O
                   Exit Sub
                Endif
             Else
                If UserRecord.Level<option14 Then
                   Strng="Only level "+Form$(Cdbl(option14))+" thieves can steal containers!"
                   Call IO.O
                   Exit Sub
                Endif
             Endif
             If Len(option15$) Then
                Out2=option15$
                Call Equate(Temp#)
                If Temp# Then
                   Strng="Didn't work!"
                   Call IO.O
                   Exit Sub
                Endif
             Else
                If Int(Rnd*5+5)>UserRecord.Stats(4)/2 Then
                   Strng="Didn't work!"
                   Call IO.O
                   Exit Sub
                Endif
             Endif
          Endif
       Endif
       ' delete user container
       Call Delete.User.Container3(TempA!)
       Call Read.Message.Record(MessWorkFile7,VarY+1)
       MessWorkRecord7.First2=UserRecord2.First2
       MessWorkRecord7.Last2=UserRecord2.Last2
       MessWorkRecord7.Weight=ContainerRecord.Weight
       MessWorkRecord7.Flags4=MessWorkRecord7.Flags4 Or 2^8
       Call Write.Message.Record(MessWorkFile7,VarY+1)
       ' add user container
       Call Read.Record(ContainerFile,TempA!)
       ContainerRecord.UserNumber=User.Index
       ContainerRecord.RoomNumber=SFalse
       Call Add.User.Container(TempA!)
       Weight=Weight+ContainerRecord.Weight
       If VarZZ Then
          Var1$=Var1$+" [inv]"
       Endif
       Strng="You steal "+Var1$+" from "+Var2$+"!"
       Call IO.O
       If Node>False Then
          Temp#=0#
          Out2=Var1$
          Call Send.Mess(16,TempB!,Room,Out2)
       Endif
       Exit Sub
    Endif
 Endif

 ' steal item user
 Parsed.Command1=VarA$
 Parsed.Command2=VarB$
 Call Num

 ' offline user
 Call Check.User
 If User.Temp Then
    Var2$=Lcase$(Out3)
    Mid$(Var2$,1,1)=Ucase$(Mid$(Var2$,1,1))
    Parsed.Command1=Parsed.Command2

    Temp#=Int(Val(Parsed.Command1)+.5)
    If Temp#>DFalse Then
       If Temp#<=UserRecord2.Gold Then
          If Temp#<=Option10x# Or Option10x#=-1# Then
             If Normal.User Then
                If MessWorkRecord1.ClassType>=Lady Then
                   Strng3=Rtrim$(Class.Name(MessWorkRecord1.ClassType))
                   Call A.Or.An
                   Strng="You can't steal from "+Prefix1+Strng3+"."
                   Call IO.O
                   Exit Sub
                Endif
                If UserRecord.ClassType<AsstDM Then
                   If UserRecord.ClassType<>Thief Then
                      If option26 Then
                         Strng="Only thieves can steal!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Endif
                   If Len(option28$) Then
                      Out2=option28$
                      Call Equate(Temp#)
                      If Temp# Then
                         Strng="Didn't work!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Else
                      If Int(Rnd*5+5)>UserRecord.Stats(4)/2 Then
                         Strng="Didn't work!"
                         Call IO.O
                         Exit Sub
                      Endif
                   Endif
                Endif
             Endif
             UserRecord2.Gold=UserRecord2.Gold-Temp#
             Call Write.Record(UserFile2,MessWorkRecord4.Index)
             UserRecord.Gold=UserRecord.Gold+Temp#
             Strng="You steal "+Form$(Temp#)+" gold from "+Var2$+"!"
             Call IO.O
             Exit Sub
          Else
             Strng="You can't steal that much!"
             Call IO.O
             Exit Sub
          Endif
       Else
          Strng="User does not have that much gold!"
          Call IO.O
          Exit Sub
       Endif
    Endif

    Call Numeric
    TempB!=MessWorkRecord4.Index
    Call Search.User.Inventory2
    Var1$=Lcase$(Out3)
    If Temp7!<SFalse Then ' object
       If Normal.User Then
          If UserRecord2.ClassType>=Lady Then
             Strng3=Rtrim$(Class.Name(UserRecord2.ClassType))
             Call A.Or.An
             Strng="You can't steal from "+Prefix1+Strng3+"."
             Call IO.O
             Exit Sub
          Endif
          If UserRecord.ClassType<AsstDM Then
             If UserRecord.ClassType<>Thief Then
                If option16 Then
                   Strng="Only thieves can steal!"
                   Call IO.O
                   Exit Sub
                Endif
             Endif
             If Len(option17$) Then
                Out2=option17$
                Call Equate(Temp#)
                If Temp# Then
                   Strng="Didn't work!"
                   Call IO.O
                   Exit Sub
                Endif
             Else
                If Int(Rnd*5+5)>UserRecord.Stats(4)/2 Then
                   Strng="Didn't work!"
                   Call IO.O
                   Exit Sub
                Endif
             Endif
          Endif
       Endif
       Call Add.Inventory(Temp7!,Temp6)
       Call Delete.List.Node3(Temp4!)
       Call Clear.List.Node
       Call Write.Record(UserInvFile,Temp4!)
       Strng="You steal "+Var1$+" from "+Var2$+"!"
       Call IO.O
       Exit Sub
    Endif
    If Temp7!>SFalse Then ' treasure
       If Normal.User Then
          If UserRecord2.ClassType>=Lady Then
             Strng3=Rtrim$(Class.Name(UserRecord2.ClassType))
             Call A.Or.An
             Strng="You can't steal from "+Prefix1+Strng3+"."
             Call IO.O
             Exit Sub
          Endif
          If UserRecord.ClassType<AsstDM Then
             If UserRecord.ClassType<>Thief Then
                If option18 Then
                   Strng="Only thieves can steal!"
                   Call IO.O
                   Exit Sub
                Endif
             Endif
             If Len(option19$) Then
                Out2=option19$
                Call Equate(Temp#)
                If Temp# Then
                   Strng="Didn't work!"
                   Call IO.O
                   Exit Sub
                Endif
             Else
                If Int(Rnd*5+5)>UserRecord.Stats(4)/2 Then
                   Strng="Didn't work!"
                   Call IO.O
                   Exit Sub
                Endif
             Endif
          Endif
       Endif
       Strng="You steal "+Var1$+" from "+Var2$+"!"
       Call IO.O
       Call Delete.List.Node3(Temp4!)
       Call Clear.List.Node
       Call Write.Record(UserInvFile,Temp4!)
       If TreasureRecord.Coin Then
          UserRecord.Gold=UserRecord.Gold+TreasureRecord.Gold
          Call Amount2(UserRecord.Gold,VarQ2$)
          Strng="You now have"+VarQ2$+" Gold!"
          Call IO.O
       Else
          Call Add.Inventory(Temp7!,Temp6)
       Endif
       If Node>False Then
          Temp#=0#
          Out2=Var1$
          Call Send.Mess(16,TempB!,Room,Out2)
       Endif
       Exit Sub
    Endif
    ' steal container user
    Call Num
    Call Search.User.Container2
    If ContainerRecord.InvisibleContainer Then
       VarZZ=-1
    Endif
    Var1$=Lcase$(Out3)
    If TempA!<>SFalse Then
       If Normal.User Then
          If UserRecord2.ClassType>=Lady Then
             Strng3=Rtrim$(Class.Name(UserRecord2.ClassType))
             Call A.Or.An
             Strng="You can't steal from "+Prefix1+Strng3+"."
             Call IO.O
             Exit Sub
          Endif
          If UserRecord.ClassType<AsstDM Then
             If UserRecord.ClassType<>Thief Then
                If option20 Then
                   Strng="Only thieves can steal containers!"
                   Call IO.O
                   Exit Sub
                Endif
             Else
                If UserRecord.Level<option21 Then
                   Strng="Only level "+Form$(Cdbl(option21))+" thieves can steal containers!"
                   Call IO.O
                   Exit Sub
                Endif
             Endif
             If Len(option22$) Then
                Out2=option22$
                Call Equate(Temp#)
                If Temp# Then
                   Strng="Didn't work!"
                   Call IO.O
                   Exit Sub
                Endif
             Else
                If Int(Rnd*5+5)>UserRecord.Stats(4)/2 Then
                   Strng="Didn't work!"
                   Call IO.O
                   Exit Sub
                Endif
             Endif
          Endif
       Endif
       ' delete user container
       Call Delete.User.Container3(TempA!)
       ' add user container
       Call Read.Record(ContainerFile,TempA!)
       ContainerRecord.UserNumber=User.Index
       ContainerRecord.RoomNumber=SFalse
       Call Add.User.Container(TempA!)
       Weight=Weight+ContainerRecord.Weight
       If VarZZ Then
          Var1$=Var1$+" [inv]"
       Endif
       Strng="You steal "+Var1$+" from "+Var2$+"!"
       Call IO.O
       If Node>False Then
          Temp#=0#
          Out2=Var1$
          Call Send.Mess(16,TempB!,Room,Out2)
       Endif
       Exit Sub
    Endif
 Endif
 Strng="You can't steal that!"
 Call IO.O
 Exit Sub

Get.Config:
 Gosub Reset.Options
 VarX=0
 Do
    VarX=VarX+1
    If VarX>Options.Lines Then
       Goto Next.Read
       Exit Do
    Endif
    Var$=Ltrim$(Rtrim$(Options.Array(VarX)))
    If Ucase$(Var$)="[CMD120]" Then
       Do
          VarX=VarX+1
          If VarX>Options.Lines Then
             Goto Next.Read
             Return
          Endif
          Var$=Ltrim$(Rtrim$(Options.Array(VarX)))
          If Ucase$(Var$)="[END]" Then
             Goto Next.Read
             Return
          Endif
          Var=Instr(Var$,"=")
          If Var Then
             Var2$=Ltrim$(Rtrim$(Left$(Var$,Var-1)))
             Var3$=Ltrim$(Rtrim$(Mid$(Var$,Var+1)))
             Gosub Parse.Options
          Endif
       Loop
    Endif
 Loop
Next.Read:
 Close #TempFile1
 Filename$=DND.Path+"CMD120.CFG"
 If Dir$(Filename$)="" Then
    Return
 Endif
 Open Filename$ For Input As #TempFile1
 Do
    If Eof(TempFile1) Then
       Exit Do
    Endif
    Line Input #TempFile1, Var$
    Var$=Ltrim$(Rtrim$(Var$))
    If Left$(Var$,1)<>";" Then
       VarX$=UserRecord.CodeName
       VarX$=Rtrim$(VarX$)
       VarX$=Ucase$(VarX$)
       If Ucase$(Var$)="["+VarX$+"]" Then
          VarZ=0
          Gosub Reset.Options
          Do
             If Eof(TempFile1) Then
                Exit Do
             Endif
             Line Input #TempFile1, Var$
             If Ucase$(Var$)="[END]" Then
                Return
             Endif
             Var=Instr(Var$,"=")
             If Var Then
                Var2$=Ltrim$(Rtrim$(Left$(Var$,Var-1)))
                Var3$=Ltrim$(Rtrim$(Mid$(Var$,Var+1)))
                Gosub Parse.Options
             Endif
          Loop
       Endif
   Endif
 Loop
 Return
Reset.Options:
 option1=-1
 option2=10
 option4=-1
 option5=10
 option7=-1
 option7x=-1
 option9=-1
 option9x#=1d100
 option11=-1
 option13=-1
 option14=10
 option16=-1
 option18=-1
 option20=-1
 option21=10
 option22=-1
 option23=10
 option24=-1
 option25=10
 option26=-1
 option27=10
 option10x#=1d100
 option29=-1
 option30=10
 option12x#=1d100
 Return
Parse.Options:
 Select Case Lcase$(Var2$)
 Case "only.thieves.can.steal.item.from.online.user.container"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option1=0
    End Select
 Case "steal.container.level.item.online.user.container"
    option2=Int(Val(Var3$)+.5)
 Case "thief.steal.failure.item.online.user.container"
    If Left$(Var3$,1)=Chr$(34) Then
       If Right$(Var3$,1)=Chr$(34) Then
          option3$=Mid$(Var3$,2)
          option3$=Left$(option3$,Len(option3$)-1)
       Endif
    Endif
 Case "only.thieves.can.steal.container.from.online.user.container"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option22=0
    End Select
 Case "steal.container.level.container.online.user.container"
    option23=Int(Val(Var3$)+.5)
 Case "thief.steal.failure.container.online.user.container"
    If Left$(Var3$,1)=Chr$(34) Then
       If Right$(Var3$,1)=Chr$(34) Then
          option23$=Mid$(Var3$,2)
          option23$=Left$(option23$,Len(option23$)-1)
       Endif
    Endif
 Case "only.thieves.can.steal.item.from.offline.user.container"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option4=0
    End Select
 Case "steal.container.level.item.offline.user.container"
    option5=Int(Val(Var3$)+.5)
 Case "thief.steal.failure.item.offline.user.container"
    If Left$(Var3$,1)=Chr$(34) Then
       If Right$(Var3$,1)=Chr$(34) Then
          option6$=Mid$(Var3$,2)
          option6$=Left$(option6$,Len(option6$)-1)
       Endif
    Endif
 Case "only.thieves.can.steal.container.from.offline.user.container"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option24=0
    End Select
 Case "steal.container.level.container.offline.user.container"
    option25=Int(Val(Var3$)+.5)
 Case "thief.steal.failure.container.offline.user.container"
    If Left$(Var3$,1)=Chr$(34) Then
       If Right$(Var3$,1)=Chr$(34) Then
          option26$=Mid$(Var3$,2)
          option26$=Left$(option26$,Len(option26$)-1)
       Endif
    Endif
 Case "only.thieves.can.steal.from.monster"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option7=0
    End Select
 Case "thief.steal.failure.monster"
    If Left$(Var3$,1)=Chr$(34) Then
       If Right$(Var3$,1)=Chr$(34) Then
          option8$=Mid$(Var3$,2)
          option8$=Left$(option8$,Len(option8$)-1)
       Endif
    Endif
 Case "only.thieves.can.steal.gold.from.monster"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option7x=0
    End Select
 Case "thief.steal.failure.gold.monster"
    If Left$(Var3$,1)=Chr$(34) Then
       If Right$(Var3$,1)=Chr$(34) Then
          option8x$=Mid$(Var3$,2)
          option8x$=Left$(option8x$,Len(option8x$)-1)
       Endif
    Endif
 Case "maximum.gold.steal.from.monster"
    Option9x#=Int(Val(Var3$)+.5)
 Case "only.thieves.can.steal.object.from.online.user"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option9=0
    End Select
 Case "thief.steal.failure.object.online.user"
    If Left$(Var3$,1)=Chr$(34) Then
       If Right$(Var3$,1)=Chr$(34) Then
          option10$=Mid$(Var3$,2)
          option10$=Left$(option10$,Len(option10$)-1)
       Endif
    Endif
 Case "only.thieves.can.steal.treasure.from.online.user"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option11=0
    End Select
 Case "thief.steal.failure.treasure.online.user"
    If Left$(Var3$,1)=Chr$(34) Then
       If Right$(Var3$,1)=Chr$(34) Then
          option12$=Mid$(Var3$,2)
          option12$=Left$(option12$,Len(option12$)-1)
       Endif
    Endif
 Case "only.thieves.can.steal.container.from.online.user"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option13=0
    End Select
 Case "steal.container.level.item.online.user"
    option14=Int(Val(Var3$)+.5)
 Case "thief.steal.failure.container.online.user"
    If Left$(Var3$,1)=Chr$(34) Then
       If Right$(Var3$,1)=Chr$(34) Then
          option15$=Mid$(Var3$,2)
          option15$=Left$(option15$,Len(option15$)-1)
       Endif
    Endif
 Case "only.thieves.can.steal.object.from.offline.user"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option16=0
    End Select
 Case "thief.steal.failure.object.offline.user"
    If Left$(Var3$,1)=Chr$(34) Then
       If Right$(Var3$,1)=Chr$(34) Then
          option17$=Mid$(Var3$,2)
          option17$=Left$(option17$,Len(option17$)-1)
       Endif
    Endif
 Case "only.thieves.can.steal.treasure.from.offline.user"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option18=0
    End Select
 Case "thief.steal.failure.treasure.offline.user"
    If Left$(Var3$,1)=Chr$(34) Then
       If Right$(Var3$,1)=Chr$(34) Then
          option19$=Mid$(Var3$,2)
          option19$=Left$(option19$,Len(option19$)-1)
       Endif
    Endif
 Case "only.thieves.can.steal.container.from.offline.user"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option20=0
    End Select
 Case "steal.container.level.item.offline.user"
    option21=Int(Val(Var3$)+.5)
 Case "thief.steal.failure.container.offline.user"
    If Left$(Var3$,1)=Chr$(34) Then
       If Right$(Var3$,1)=Chr$(34) Then
          option22$=Mid$(Var3$,2)
          option22$=Left$(option22$,Len(option22$)-1)
       Endif
    Endif
 Case "only.thieves.can.steal.gold.from.offline.user"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option26=0
    End Select
 Case "steal.container.level.gold.offline.user"
    option27=Int(Val(Var3$)+.5)
 Case "thief.steal.failure.gold.offline.user"
    If Left$(Var3$,1)=Chr$(34) Then
       If Right$(Var3$,1)=Chr$(34) Then
          option28$=Mid$(Var3$,2)
          option28$=Left$(option28$,Len(option28$)-1)
       Endif
    Endif
 Case "maximum.gold.steal.from.offline.user"
    Option10x#=Int(Val(Var3$)+.5)
 Case "only.thieves.can.steal.gold.from.online.user"
    Select Case Lcase$(Var3$)
    Case "0", "false", "off"
       option29=0
    End Select
 Case "steal.container.level.gold.online.user"
    option30=Int(Val(Var3$)+.5)
 Case "thief.steal.failure.gold.online.user"
    If Left$(Var3$,1)=Chr$(34) Then
       If Right$(Var3$,1)=Chr$(34) Then
          option30$=Mid$(Var3$,2)
          option30$=Left$(option30$,Len(option30$)-1)
       Endif
    Endif
 Case "maximum.gold.steal.from.online.user"
    option12x#=Int(Val(Var3$)+.5)
 End Select
 Return
ErrResume21:
 Exit Sub
ErrTrap21:
 Resume ErrResume21
End Sub

Sub Amount2(Var#,Var$)
 VarX$=Ltrim$(Str$(Var#)) ' 1.111D308
 V=Instr(VarX$,"D")
 If V Then
    If Mid$(VarX$,2,1)="." Then
       VarX$=Left$(VarX$,1)+Mid$(VarX$,V)
    Endif
    Var$=" "+VarX$
 Else
    Var$=" "+Form$(Var#)
 Endif
End Sub
