home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / DNDOOR46.ZIP / DNDS7.BAS < prev    next >
BASIC Source File  |  2001-07-11  |  166KB  |  2,936 lines

  1.  Rem * Filename: dnds7.bas  Version: v4.6 r1.0
  2.  Rem * This subprogram contains all the main editor routines.
  3.  
  4.  Rem $Include: 'dnddoor.inc'
  5.  
  6.  Rem * main routine to enter the editor and process edit selections.
  7.  
  8. Sub Editor
  9.  On Local Error Resume Next ' local error resume
  10.  Call Put.User.Record ' store current user settings
  11.  Graphics.Off=False ' reset ansi color
  12.  Outpt="Edit utility v"+Version$ ' editor intro prompt
  13.  Call IO.O ' send output
  14.  Do ' loop through edit selections
  15.     Graphics.Off=True ' reset color
  16.     Outpt="[A]ction" ' edit selection
  17.     Call IO.O ' send output
  18.     Outpt="[E]mail" ' edit selection
  19.     Call IO.O ' send output
  20.     Outpt="[H]elp" ' edit selection
  21.     Call IO.O ' send output
  22.     Outpt="[L]inks" ' edit selection
  23.     Call IO.O ' send output
  24.     Outpt="[M]onster" ' edit selection
  25.     Call IO.O ' send output
  26.     Outpt="[N]onplayer" ' edit selection
  27.     Call IO.O ' send output
  28.     Outpt="[O]bject" ' edit selection
  29.     Call IO.O ' send output
  30.     Outpt="[R]oom" ' edit selection
  31.     Call IO.O ' send output
  32.     Outpt="[S]pell" ' edit selection
  33.     Call IO.O ' send output
  34.     Outpt="[T]reasure" ' edit selection
  35.     Call IO.O ' send output
  36.     Outpt="[U]ser" ' edit selection
  37.     Call IO.O ' send output
  38.     Graphics.Off=False ' reset ansi color
  39.     Outpt="Edit option(q to quit)? " ' display edit prompt
  40.     No.Input.Out="Q" ' default entry
  41.     Call IO.I ' get input
  42.     Select Case Ucase$(Inpt) ' selection of input choice
  43.     Case "A" ' action selection
  44.        Call Edit.Action ' action editor
  45.     Case "E" ' email selection
  46.        Call Edit.Mail ' email editor
  47.     Case "H" ' help selection
  48.        Call Edit.Help ' !edit help
  49.     Case "L" ' option to edit room links
  50.        Call Link.Room ' room link edit
  51.     Case "M" ' monster selection
  52.        Call Edit.Monster ' monster editr
  53.     Case "N" ' nonplayer selection
  54.        Call Edit.Nonplayer ' nonplayer editor
  55.     Case "O" ' object selection
  56.        Call Edit.Object ' object editor
  57.     Case "R" ' rooms selection
  58.        Call Edit.Room ' room editor
  59.     Case "S" ' spell selection
  60.        Call Edit.Spell ' spell editor
  61.     Case "T" ' treasure selection
  62.        Call Edit.Treasure ' treasure editor
  63.     Case "U" ' user selection
  64.        Call Edit.User ' user editor
  65.     Case "Q" ' quit selection
  66.        Exit Do ' exit editor
  67.     End Select ' end choice selection
  68.  Loop ' end edit loop
  69.  Call Get.User.Record ' restore user stats
  70.  Call Read.Monclass ' reread monster class arrays
  71. End Sub ' end main routine to select edit option
  72.  
  73.  Rem * routine to edit actions.
  74.  
  75. Sub Edit.Action
  76.  On Local Error Resume Next ' local error resume
  77.  Do ' loop through action edit menu
  78.     Graphics.Off=False ' reset color
  79.     Outpt="Action edit:" ' make display message
  80.     Call IO.O ' send message
  81.     Graphics.Off=True ' reset color
  82.     Outpt="[A]dd" ' make display message
  83.     Call IO.O ' send message
  84.     Outpt="[C]hange" ' make display message
  85.     Call IO.O ' send message
  86.     Outpt="[L]ist" ' make display message
  87.     Call IO.O ' send message
  88.     Graphics.Off=False ' reset color
  89.     Outpt="Action edit option(q to quit)? " ' option input prompt
  90.     No.Input.Out="Q" ' default input
  91.     Call IO.I ' get user input
  92.     Select Case Ucase$(Inpt) ' selection of option input
  93.     Case "A" ' add action option
  94.        New.Record=Lof(ActionFile)/Len(ActionRecord)+1
  95.        ActionRecord.SpellTrigger=False
  96.        ActionRecord.MonsterTrigger=False
  97.        ActionRecord.HealthRate=False
  98.        ActionRecord.EncounterRate=False
  99.        ActionRecord.HitPoints=False
  100.        ActionRecord.Inventory=False
  101.        ActionRecord.MonsterTalk=False
  102.        ActionRecord.Fumble=False
  103.        ActionRecord.Teleport=False
  104.        ActionRecord.Level=False
  105.        ActionRecord.Restrictions=False
  106.        ActionRecord.RustRate=False
  107.        ActionRecord.StealRate=False
  108.        ActionRecord.Attribute1=False
  109.        ActionRecord.Attribute2=False
  110.        Call Share.Record(ActionFile,New.Record)
  111.        Outpt="Action"+Str$(New.Record)+" added." ' make message
  112.        Call IO.O ' send message
  113.     Case "L" ' option to list actions
  114.        Max.Actions=Lof(ActionFile)/Len(ActionRecord) ' store action records
  115.        ' routine to get range values
  116.        Call Get.Range(Max.Actions,Action.List1,Action.List2)
  117.        ' loop through range values
  118.        Allow.Break=True ' set allow break flag
  119.        Break=False ' reset control-k flag
  120.        Continue=False ' set continuous flag
  121.        For Action.Count=Action.List1 To Action.List2
  122.           Call Read.Record(ActionFile,Action.Count) ' read action record
  123.           Call Display.Action(Action.Count) ' routine to display actions
  124.           If Break Then ' check control-k flag
  125.              Exit For ' exit display loop
  126.           Endif ' end check control-k
  127.           If Continue=False Then ' check continuous flag
  128.              Call More.Prompt ' routine to pause
  129.              If No Then ' check pause input
  130.                 Exit For ' exit action list loop
  131.              Endif ' end check input
  132.           Endif ' end check continuous flag
  133.        Next ' end loop through actions
  134.        Allow.Break=False ' reset allow break flag
  135.        If Break Then ' check control-k flag
  136.           Break=False ' reset control-k flag
  137.           Outpt=Nul ' set output to null
  138.           Call IO.O ' send empty return
  139.        Endif ' end check control-k flag
  140.     Case "C"
  141.        Outpt="Enter action number" ' make range prompt
  142.        Max.Actions=Lof(ActionFile)/Len(ActionRecord) ' store action records
  143.        ' routine to get range of numbers
  144.        Call Get.Range2(1,Max.Actions,Action.Number)
  145.        Call Read.Record(ActionFile,Action.Number) ' get action record
  146.        Do ' loop through action edit menu
  147.           Call Display.Action(Action.Number)
  148.           Graphics.Off=False ' reset color
  149.           Outpt="Action edit option(q to quit)? " ' make input prompt
  150.           No.Input.Out="Q" ' default input
  151.           Call IO.I ' get user input
  152.           Select Case Ucase$(Inpt) ' selection of action edit option
  153.           Case "A" ' option for monster encounter trigger
  154.              ' routine to get monster number
  155.              Call Find.Monster(Monster.Number)
  156.              ' store monster number trigger
  157.              ActionRecord.MonsterTrigger=Monster.Number
  158.           Case "B" ' option for spell trigger
  159.              ' routine to get spell number
  160.              Call Find.Spell(Spell.Number)
  161.              ' store spell number trigger
  162.              ActionRecord.SpellTrigger=Spell.Number
  163.           Case "C" ' option monster talk number
  164.              ' routine to get monster number
  165.              Call Find.Monster(Monster.Number)
  166.              ' store monster talk number trigger
  167.              ActionRecord.MonsterTalk=Monster.Number
  168.           Case "D" ' option for player level entry trigger
  169.              Graphics.Off=True ' reset color
  170.              ' make message
  171.              Outpt="[H]ighest level (at least) for entry to room"
  172.              Call IO.O ' send level trigger display message
  173.              ' make message
  174.              Outpt="[L]owest level (at most) for entry to room"
  175.              Call IO.O ' send level trigger display message
  176.              Graphics.Off=False ' reset color
  177.              ' make input prompt
  178.              Outpt="Action level entry option(q to quit)? "
  179.              No.Input.Out="Q" ' default prompt
  180.              Call IO.I ' get user input
  181.              Select Case Ucase$(Inpt) ' selection of level entry option
  182.              Case "H" ' high level entry option
  183.                 Outpt="Highest level player must be (at least) to enter room? "
  184.                 No.Input.Out="1" ' default input
  185.                 Call IO.I ' get user input
  186.                 ActionRecord.Level=Int(Val(Inpt)) ' store level entry trigger
  187.              Case "L" ' low level entry option
  188.                 Outpt="Lowest level player must be (at most) to enter room? "
  189.                 No.Input.Out="1" ' default input
  190.                 Call IO.I ' get user input
  191.                 ActionRecord.Level=-Int(Val(Inpt)) ' store level entry trigger
  192.              End Select
  193.              Do
  194.                 Graphics.Off=False
  195.                 Outpt="Direction options:"
  196.                 Call IO.O
  197.                 Graphics.Off=True ' reset color
  198.                 Outpt="[N]orth" ' make direction display message
  199.                 Call IO.O ' send direction display message
  200.                 Outpt="[E]ast" ' make direction display message
  201.                 Call IO.O ' send direction display message
  202.                 Outpt="[S]outh" ' make direction display message
  203.                 Call IO.O ' send direction display message
  204.                 Outpt="[W]est" ' make direction display message
  205.                 Call IO.O ' send direction display message
  206.                 Outpt="[NE]northeast" ' make direction display message
  207.                 Call IO.O ' send direction display message
  208.                 Outpt="[SE]southeast" ' make direction display message
  209.                 Call IO.O ' send direction display message
  210.                 Outpt="[SW]southwest" ' make direction display message
  211.                 Call IO.O ' send direction display message
  212.                 Outpt="[NW]northwest" ' make direction display message
  213.                 Call IO.O ' send direction display message
  214.                 Outpt="[U]p" ' make direction display message
  215.                 Call IO.O ' send direction display message
  216.                 Outpt="[D]own" ' make direction display message
  217.                 Call IO.O ' send direction display message
  218.                 Outpt="[I]n" ' make direction display message
  219.                 Call IO.O ' send direction display message
  220.                 Outpt="[O]ut" ' make direction display message
  221.                 Call IO.O ' send direction display message
  222.                 Outpt="[G]o to portal" ' make direction display message
  223.                 Call IO.O ' send direction display message
  224.                 Outpt="[X]clear directions" ' make direction display message
  225.                 Call IO.O ' send direction message
  226.                 Graphics.Off=False ' reset color
  227.                 ' input prompt
  228.                 Outpt="Action entry direction option(q to quit)? "
  229.                 No.Input.Out="Q" ' default prompt
  230.                 Call IO.I ' get user input
  231.                 If Ucase$(Inpt)="Q" Then ' compare input to quit option
  232.                    Exit Do ' exit direction restriction edit loop
  233.                 Endif ' end compare input option
  234.                 If Ucase$(Inpt)="X" Then ' compare clear directions
  235.                    ActionRecord.Restrictions=False ' clear directions
  236.                 Else ' compare to direction
  237.                    ' routine to get direction number
  238.                    Call Find.Link(Inpt,Direction.Number,False)
  239.                    If Direction.Number>False Then ' compare direction number
  240.                       ' set the direction bit in the action record trigger flag
  241.                       ActionRecord.Restrictions=ActionRecord.Restrictions Or _
  242.                       2^Direction.Number
  243.                    Endif ' end compare clear direction
  244.                 Endif ' end compare direction number
  245.              Loop ' loop through level entry trigger edit loop
  246.           Case "E" ' option for health hits result
  247.              Graphics.Off=True ' reset color
  248.              Outpt="[F]atigue" ' make health message
  249.              Call IO.O ' send health message
  250.              Outpt="[V]itality" ' make health message
  251.              Call IO.O ' send health message
  252.              Graphics.Off=False ' reset color
  253.              ' make input prompt
  254.              Outpt="Action health rate option(q to quit)? "
  255.              No.Input.Out="Q" ' default input
  256.              Call IO.I ' get user input
  257.              Select Case Ucase$(Inpt) ' selection of health option
  258.              Case "F" ' option for action to hit for fatigue
  259.                 ' make input prompt
  260.                 Outpt="Number of hits of fatigue(1-32767)? "
  261.                 No.Input.Out="10" ' default input
  262.                 Call IO.I ' get user input
  263.                 ' store health hit result
  264.                 ActionRecord.HitPoints=Int(Val(Inpt))
  265.              Case "V" ' option for action to hit for vitality
  266.                 ' make input prompt
  267.                 Outpt="Number of hits of vitality(1-32767)? "
  268.                 No.Input.Out="10" ' default input
  269.                 Call IO.I ' get user input
  270.                 ' store health hit result
  271.                 ActionRecord.HitPoints=-Int(Val(Inpt))
  272.              End Select ' end selection health edit option
  273.           Case "F" ' option to edit action rates
  274.              Graphics.Off=True ' reset color
  275.              Outpt="[E]ncounter" ' make rate display message
  276.              Call IO.O ' send rate display message
  277.              Outpt="[H]ealth" ' make rate display message
  278.              Call IO.O ' send rate display message
  279.              Graphics.Off=False ' reset color
  280.              Outpt="Action rate option(q to quit)? " ' make input prompt
  281.              No.Input.Out="Q" ' default input
  282.              Call IO.I ' get user input
  283.              Select Case Ucase$(Inpt) ' selection of rate option
  284.              Case "E" ' option to change action monster encounter rate
  285.                 Outpt="Encounter rate(1-32767)? " ' make input prompt
  286.                 No.Input.Out="6" ' default input
  287.                 Call IO.I ' get user input
  288.                 ' store encounter rate
  289.                 ActionRecord.EncounterRate=Int(Val(Inpt))
  290.              Case "H" ' option to change action health update rate
  291.                 Outpt="Health rate(1-32767)? " ' make input prompt
  292.                 No.Input.Out="6" ' default input
  293.                 Call IO.I ' get user input
  294.                 ' store health update rate
  295.                 ActionRecord.HealthRate=Int(Val(Inpt))
  296.              End Select ' end selection of rate option
  297.           Case "G" ' option to edit inventory result options
  298.              Graphics.Off=True ' reset color
  299.              Outpt="[W]eapons" ' make inventory display message
  300.              Call IO.O ' send inventory display message
  301.              Outpt="[S]hields" ' make inventory display message
  302.              Call IO.O ' send inventory display messagec
  303.              Outpt="[A]rmor" ' make inventory display message
  304.              Call IO.O ' send inventory display message
  305.              Outpt="[M]agic items" ' make inventory display message
  306.              Call IO.O ' send inventory display message
  307.              Graphics.Off=False ' reset color
  308.              Outpt="Action inventory option(q to quit)? " ' make input prompt
  309.              No.Input.Out="Q" ' default input
  310.              Call IO.I ' get user input
  311.              Select Case Ucase$(Inpt) ' selection of inventory option
  312.              Case "W" ' option for inventory result
  313.                 ActionRecord.Inventory=1 ' store inventory option number
  314.              Case "S" ' option for inventory result
  315.                 ActionRecord.Inventory=2 ' store inventory option number
  316.              Case "A" ' option for inventory result
  317.                 ActionRecord.Inventory=3 ' store inventory option number
  318.              Case "M" ' option for inventory result
  319.                 ActionRecord.Inventory=4 ' store inventory option number
  320.              End Select ' end selection of inventory option
  321.           Case "H" ' option for fumble result
  322.              ActionRecord.Fumble=Not ActionRecord.Fumble ' set fumble flag
  323.           Case "I" ' option for teleport result
  324.              Outpt="Room number" ' make range prompt
  325.              Max.Rooms!=Lof(RoomFile)/Len(RoomRecord) ' store room file record
  326.              ' routine to get range of numbers
  327.              Call Get.Room.Range2(0!,Max.Rooms!,Room.Number!)
  328.              ' store room teleport result number
  329.              ActionRecord.Teleport=Room.Number!
  330.           Case "J" ' option to change rust rate
  331.              ' input prompt
  332.              Outpt="Rate for weapons to rust(# of action prompts)? "
  333.              No.Input.Out="6" ' default input
  334.              Call IO.I ' get user input
  335.              RustRate=Int(Val(Inpt)) ' convert input to integer
  336.              ActionRecord.RustRate=RustRate ' store rust rate
  337.           Case "K" ' option to change steal rate
  338.              Outpt="Rate for monsters to steal treasure(# of action prompts)? "
  339.              No.Input.Out="6" ' default input
  340.              Call IO.I ' get user input
  341.              StealRate=Int(Val(Inpt)) ' convert input to integer
  342.              ActionRecord.StealRate=StealRate ' store steal rate
  343.           Case "L"
  344.              Do ' loop through attribute editing
  345.                 Graphics.Off=True ' reset color
  346.                 Outpt="[A]ir" ' make option message
  347.                 Call IO.O ' send message
  348.                 Outpt="[L]and" ' make option message
  349.                 Call IO.O ' send message
  350.                 Outpt="[W]ater" ' make option message
  351.                 Call IO.O ' send message
  352.                 Outpt="[U]nlit" ' make option message
  353.                 Call IO.O ' send message
  354.                 Outpt="[X]Clear" ' make option message
  355.                 Call IO.O ' send message
  356.                 Graphics.Off=False ' reset color
  357.                 ' make input prompt
  358.                 Outpt="Action attribute option(q to quit)? "
  359.                 No.Input.Out="Q" ' default input
  360.                 Call IO.I ' get user input
  361.                 Select Case Ucase$(Inpt) ' selection of attribute option
  362.                 Case "A" ' option for room attribute
  363.                    ActionRecord.Attribute2=Air ' set flag
  364.                 Case "L" ' option for room attribute
  365.                    ActionRecord.Attribute2=Land ' set flag
  366.                 Case "W" ' option for room attribute
  367.                    ActionRecord.Attribute2=Water ' set flag
  368.                 Case "U" ' option for room attribute
  369.                    ActionRecord.Attribute1=UnlitRoom ' reset flag
  370.                 Case "X" ' option to clear room attributes
  371.                    ActionRecord.Attribute1=False ' reset room attribute
  372.                    ActionRecord.Attribute2=False ' reset room attribute
  373.                 Case "Q" ' option to exit room attribute editing
  374.                    Exit Do ' exit room attribute editing
  375.                 End Select ' end selection of room attribute editing
  376.              Loop ' end loop through room attribute editing menu options
  377.           Case "X" ' option to clear triggers and results
  378.              ActionRecord.SpellTrigger=False
  379.              ActionRecord.MonsterTrigger=False
  380.              ActionRecord.HealthRate=False
  381.              ActionRecord.EncounterRate=False
  382.              ActionRecord.HitPoints=False
  383.              ActionRecord.Inventory=False
  384.              ActionRecord.MonsterTalk=False
  385.              ActionRecord.Fumble=False
  386.              ActionRecord.Teleport=False
  387.              ActionRecord.Level=False
  388.              ActionRecord.Restrictions=False
  389.              ActionRecord.RustRate=False
  390.              ActionRecord.StealRate=False
  391.              ActionRecord.Attribute1=False
  392.              ActionRecord.Attribute2=False
  393.              Outpt="Action cleared." ' make clear message
  394.              Call IO.O ' send clear message
  395.           Case "Q" ' option to exit room action edit menu
  396.              Call Share.Record(ActionFile,Action.Number) ' write action file
  397.              Outpt="Action"+Str$(Action.Number)+" changed."
  398.              Call IO.O ' send display message
  399.              Exit Do ' exit room action edit menu
  400.           End Select ' end selection of action edit options
  401.        Loop ' end loop through action edit menu
  402.     Case "Q" ' selection to quit action editing
  403.        Exit Do ' exit action editing
  404.     End Select ' end action editing selection
  405.  Loop ' end loop through room action menu
  406. End Sub ' end routine to edit room actions
  407.  
  408.  Rem * routine to edit monsters file.
  409.  
  410. Sub Edit.Monster
  411.  On Local Error Resume Next ' local error resume
  412.  Do ' loop through monster editing menu
  413.     Graphics.Off=False ' reset color
  414.     Outpt="Monster edit:" ' make display message
  415.     Call IO.O ' send message
  416.     Graphics.Off=True ' reset color
  417.     Outpt="[A]dd" ' make monster edit display message
  418.     Call IO.O ' send monster edit display message
  419.     Outpt="[C]hange" ' make monster edit display message
  420.     Call IO.O ' send monster edit display message
  421.     Outpt="[L]ist" ' make monster edit display message
  422.     Call IO.O ' send monster edit display message
  423.     Outpt="[M]onster class" ' make monster edit display message
  424.     Call IO.O ' send monster edit display message
  425.     Outpt="[T]alk responses" ' make monster edit display message
  426.     Call IO.O ' send monster edit display message
  427.     Graphics.Off=False ' reset color
  428.     Outpt="Monster edit option(q to quit)? " ' make input prompt
  429.     No.Input.Out="Q" ' default input
  430.     Call IO.I ' get user input
  431.     Select Case Ucase$(Inpt) ' selection of monster edit option
  432.     Case "A" ' option to add an empty monster record
  433.        ' store the last monster record number
  434.        New.Monster=Lof(MonsterFile)/Len(MonsterRecord)+1
  435.        MonsterRecord.MonsterName=Nul ' reset monster record variable
  436.        MonsterRecord.PluralName=Nul ' reset monster record variable
  437.        For Array.Index=1 To 5 ' loop through monster treasure inventory
  438.           ' reset monster record variable
  439.           MonsterRecord.Treasure(Array.Index)=False
  440.        Next ' end loop through monster treasure inventory
  441.        MonsterRecord.Experience=False ' reset monster record variable
  442.        MonsterRecord.NumberAppearing=False ' reset monster record variable
  443.        MonsterRecord.Level=False ' reset monster record variable
  444.        MonsterRecord.Hits=False ' reset monster record variable
  445.        MonsterRecord.Poison=False ' reset monster record variable
  446.        MonsterRecord.LevelDrain=False ' reset monster record variable
  447.        MonsterRecord.Spell=False ' reset monster record variable
  448.        MonsterRecord.Block=False ' reset monster record variable
  449.        MonsterRecord.Prevent=False ' reset monster record variable
  450.        MonsterRecord.Follow=False ' reset monster record variable
  451.        MonsterRecord.Magic=False ' reset monster record variable
  452.        MonsterRecord.Jail=False ' reset monster record variable
  453.        MonsterRecord.Teleport=False ' reset monster record variable
  454.        MonsterRecord.FollowPercent=False ' reset monster record variable
  455.        MonsterRecord.BlockPercent=False ' reset monster record variable
  456.        MonsterRecord.PreventPercent=False ' reset monster record variable
  457.        MonsterRecord.SpellPercent=False ' reset monster record variable
  458.        MonsterRecord.PoisonPercent=False ' reset monster record variable
  459.        MonsterRecord.DrainPercent=False ' reset monster record variable
  460.        MonsterRecord.Rate=False ' reset monster record variable
  461.        MonsterRecord.RatePercent=False ' reset monster record variable
  462.        MonsterRecord.Permanent=False ' reset monster record variable
  463.        MonsterRecord.Gold=False ' reset monster record variable
  464.        For Array.Index=1 To 5 ' loop through monster talk responses
  465.           ' reset monster record variable
  466.           MonsterRecord.Talk(Array.Index)=False
  467.        Next ' end loop through monster talk responses
  468.        MonsterRecord.Psionic=False ' reset monster record variable
  469.        MonsterRecord.PsionicSpell=False ' reset monster record variable
  470.        Call Share.Record(MonsterFile,New.Monster) ' routine to write a monster record
  471.     Case "C" ' option to change monster values
  472.        Call Find.Monster(Mon.Number) ' get monster number to edit
  473.        If Mon.Number>False Then ' compare monster number
  474.           Do ' loop through monster change menu
  475.              Call Display.Monster(Mon.Number) ' routine to display monster
  476.              Graphics.Off=False ' reset color
  477.              Outpt="Monster change option(q to quit)? " ' make input prompt
  478.              No.Input.Out="Q" ' default input
  479.              Call IO.I ' get user input
  480.              Select Case Ucase$(Inpt) ' selection of monster change option
  481.              Case "A" ' option to change monster name
  482.                 Outpt="Monster name(30 characters)? " ' input prompt
  483.                 Call IO.I ' get user input
  484.                 MonsterRecord.MonsterName=Lcase$(Inpt) ' store new name
  485.              Case "B" ' option to change plural of monster name
  486.                 Outpt="Plural of name(30 characters)? " ' input prompt
  487.                 Call IO.I ' get user input
  488.                 ' store new monster plural
  489.                 MonsterRecord.PluralName=Lcase$(Inpt)
  490.              Case "C" ' option to change monster level
  491.                 Outpt="Monster level(1-32767)? " ' input prompt
  492.                 No.Input.Out="1" ' default input
  493.                 Call IO.I ' get user input
  494.                 MonsterRecord.Level=Int(Val(Inpt)) ' store new monster level
  495.              Case "D" ' option to change monster magical type
  496.                 Outpt="Magical monster(y/n)? " ' input prompt
  497.                 No.Input.Out="Y" ' default input
  498.                 Call IO.I ' get user input
  499.                 MonsterRecord.Magic=Yes ' store monster type
  500.              Case "E" ' option to change monster hit points
  501.                 Outpt="Hit points? " ' make input prompt
  502.                 No.Input.Out="1" ' default input
  503.                 Call IO.I ' get user input
  504.                 MonsterRecord.Hits=Cdbl(Int(Val(Inpt))) ' store monster hits
  505.              Case "F" ' option to change monster experience
  506.                 Outpt="Experience points? " ' input prompt
  507.                 No.Input.Out="100" ' default input
  508.                 Call IO.I ' get user input
  509.                 MonsterRecord.Experience=Cdbl(Int(Val(Inpt))) ' store exp
  510.              Case "G" ' option to change monster gold hoard
  511.                 Outpt="Gold points? " ' make input prompt
  512.                 No.Input.Out="100" ' default prompt
  513.                 Call IO.I ' get user input
  514.                 MonsterRecord.Gold=Cdbl(Int(Val(Inpt))) ' store monster gold
  515.              Case "H" ' option to change number encountered
  516.                 Outpt="Number appearing(1-32767)? " ' input prompt
  517.                 No.Input.Out="1" ' default input
  518.                 Call IO.I ' get user input
  519.                 MonsterRecord.NumberAppearing=Int(Val(Inpt)) ' store number
  520.              Case "I" ' option to change monster poison type
  521.                 Outpt="Poisonous monster(y/n)? " ' make input prompt
  522.                 No.Input.Out="Y" ' default prompt
  523.                 Call IO.I ' get user input
  524.                 MonsterRecord.Poison=False ' clear monster poison
  525.                 MonsterRecord.PoisonPercent=False ' clear monster percent
  526.                 If Yes Then ' check yes repsonse
  527.                    Outpt="Percent chance monster " ' make percent display
  528.                    Outpt=Outpt+"will poison(1-100)? " ' input message
  529.                    No.Input.Out="50" ' default input
  530.                    Call IO.I ' get user input
  531.                    Percent=Int(Val(Inpt)) ' convert input to integer
  532.                    If Percent>=False And Percent<=100 Then ' check percent
  533.                       MonsterRecord.Poison=True ' make monster poisonous
  534.                       MonsterRecord.PoisonPercent=Percent ' store percent
  535.                    Endif ' end check percent
  536.                 Endif ' end check response
  537.              Case "J" ' option to change monster level drain type
  538.                 Outpt="Level draining monster(y/n)? " ' input prompt
  539.                 No.Input.Out="Y" ' default input
  540.                 Call IO.I ' get user input
  541.                 MonsterRecord.LevelDrain=False ' clear monster level drain
  542.                 MonsterRecord.DrainPercent=False ' clear monster percent
  543.                 If Yes Then ' check yes response
  544.                    Outpt="Percent chance monster " ' make percent display
  545.                    Outpt=Outpt+"will level drain(1-100)? " ' input message
  546.                    No.Input.Out="50" ' default input
  547.                    Call IO.I ' get user input
  548.                    Percent=Int(Val(Inpt)) ' convert input to integer
  549.                    If Percent>=False And Percent<=100 Then ' check percent
  550.                       ' make monster level drainer
  551.                       MonsterRecord.LevelDrain=True
  552.                       MonsterRecord.DrainPercent=Percent ' store percent
  553.                    Endif ' end check percent
  554.                 Endif ' end check response
  555.              Case "K" ' option to change monster blocks exits type
  556.                 Outpt="Monster blocks exits(y/n)? " ' make input prompt
  557.                 No.Input.Out="Y" ' default input
  558.                 Call IO.I ' get user input
  559.                 MonsterRecord.Block=False ' clear monster block type
  560.                 MonsterRecord.BlockPercent=False ' clear monster percent
  561.                 If Yes Then ' check yes response
  562.                    Outpt="Percent chance monster " ' make percent display
  563.                    Outpt=Outpt+"will block exits(1-100)? " ' input prompt
  564.                    No.Input.Out="50" ' default input
  565.                    Call IO.I ' get user input
  566.                    Percent=Int(Val(Inpt)) ' convert input to integer
  567.                    If Percent>=False And Percent<=100 Then ' check percent
  568.                       MonsterRecord.Block=True ' make monster blocker
  569.                       MonsterRecord.BlockPercent=Percent ' store percent
  570.                    Endif ' end check percent
  571.                 Endif ' end check response
  572.              Case "L" ' option to change monster preventing type
  573.                 Outpt="Monster prevents player from taking treasure(y/n)? "
  574.                 No.Input.Out="Y" ' default input
  575.                 Call IO.I ' get user input
  576.                 MonsterRecord.Prevent=False ' clear monster prevent type
  577.                 MonsterRecord.PreventPercent=False ' clear monster percent
  578.                 If Yes Then ' check yes response
  579.                    Outpt="Percent chance monster " ' make input prompt
  580.                    Outpt=Outpt+"prevents player from taking treasure(1-100)? "
  581.                    No.Input.Out="50" ' default input
  582.                    Call IO.I ' get user input
  583.                    Percent=Int(Val(Inpt)) ' convert input to integer
  584.                    If Percent>=False And Percent<=100 Then ' check percent
  585.                       MonsterRecord.Prevent=True ' make monster preventer
  586.                       MonsterRecord.PreventPercent=Percent ' store percent
  587.                    Endif ' end check percent
  588.                 Endif ' end check response
  589.              Case "M" ' option to change monster following type
  590.                 Outpt="Monster follows player(y/n)? " ' make input prompt
  591.                 No.Input.Out="Y" ' default prompt
  592.                 Call IO.I ' get user input
  593.                 MonsterRecord.Follow=False ' clear monster follow type
  594.                 MonsterRecord.FollowPercent=False ' clear percent
  595.                 MonsterRecord.Teleport=False ' clear percent
  596.                 If Yes Then ' check yes response
  597.                    MonsterRecord.Follow=True ' make monster follows
  598.                    Outpt="Percent chance monster " ' make percent
  599.                    Outpt=Outpt+"will follow player(1-100)? " ' input prompt
  600.                    No.Input.Out="50" ' default input
  601.                    Call IO.I ' get user input
  602.                    Percent=Int(Val(Inpt)) ' convert input to integer
  603.                    If Percent>=False And Percent<=100 Then ' check percent
  604.                       MonsterRecord.FollowPercent=Percent ' store percent
  605.                    Endif ' end check percent
  606.                    Outpt="Percent chance monster " ' make percent
  607.                    Outpt=Outpt+"will teleport with player(1-100)? " ' prompt
  608.                    No.Input.Out="50" ' default prompt
  609.                    Call IO.I ' get user input
  610.                    Percent=Int(Val(Inpt)) ' convert input to integer
  611.                    If Percent>=False And Percent<=100 Then ' check percent
  612.                       MonsterRecord.Teleport=Percent ' store percent
  613.                    Endif ' end check percent
  614.                 Endif ' end check response
  615.              Case "N" ' option to change monster spell casting
  616.                 Outpt="Monster casts spells(y/n)? " ' input prompt
  617.                 No.Input.Out="Y" ' default input
  618.                 Call IO.I ' get user input
  619.                 MonsterRecord.Spell=False ' clear monster spell flag
  620.                 MonsterRecord.SpellPercent=False ' clear monster spell number
  621.                 If Yes Then ' check yes response
  622.                    Call Find.Spell(Spell.Number) ' routine to get spell number
  623.                    If Spell.Number>False Then ' check spell number
  624.                       Outpt="Percent chance monster " ' percent display
  625.                       Outpt=Outpt+"casts spell(1-100)? " ' input prompt
  626.                       No.Input.Out="50" ' default input
  627.                       Call IO.I ' get user input
  628.                       Percent=Int(Val(Inpt)) ' convert input to integer
  629.                       If Percent>=False And Percent<=100 Then ' check percent
  630.                          ' store monster spell number
  631.                          MonsterRecord.Spell=Spell.Number
  632.                          MonsterRecord.SpellPercent=Percent ' store percent
  633.                       Endif ' end check percent
  634.                    Endif ' end check spell number range
  635.                 Endif ' end check response
  636.              Case "O" ' option to change monster jail type
  637.                 Outpt="Monster jails attacker(y/n)? " ' input prompt
  638.                 No.Input.Out="Y" ' default input
  639.                 Call IO.I ' get user input
  640.                 MonsterRecord.Jail=Yes ' store yes response
  641.              Case "P" ' option to change monster rates
  642.                 Outpt="Monster encounter rate(# of action prompts)? " ' prompt
  643.                 No.Input.Out="6" ' default input
  644.                 Call IO.I ' get user input
  645.                 MonsterRecord.Rate=Int(Val(Inpt)) ' store encounter rate
  646.                 Outpt="Monster encounter percent(1-100)? " ' input prompt
  647.                 No.Input.Out="50" ' default input
  648.                 Call IO.I ' get user input
  649.                 Percent=Int(Val(Inpt)) ' convert input to integer
  650.                 If Percent>=False And Percent<=100 Then ' check percent
  651.                    MonsterRecord.RatePercent=Percent ' store percent
  652.                 Endif ' end check percent
  653.              Case "R" ' option to change monster permanent type
  654.                 Outpt="Monster is a permanent monster(y/n)? " ' input prompt
  655.                 No.Input.Out="N" ' default input
  656.                 Call IO.I ' get user input
  657.                 MonsterRecord.Permanent=Yes ' store yes response
  658.              Case "S" ' option to change monster psionic spell casting
  659.                 Outpt="Monster uses psionics(y/n)? " ' input prompt
  660.                 No.Input.Out="Y" ' default input
  661.                 Call IO.I ' get user input
  662.                 MonsterRecord.Psionic=False ' clear monster psionics
  663.                 MonsterRecord.PsionicSpell=False ' clear monster psionics
  664.                 If Yes Then ' check yes response
  665.                    Outpt="Enter psionic spell:" ' find spell prompt
  666.                    Call Find.Spell(Spell.Number) ' routine to get spell number
  667.                    If Spell.Number>False Then ' check spell number
  668.                       If SpellRecord.Psionic=False Then ' check psionic type
  669.                          Outpt="That spell is not a psionic spell!" ' message
  670.                          Call IO.O ' send error message
  671.                       Else ' check psionic spell type
  672.                          MonsterRecord.Psionic=True ' make monster psionic
  673.                          ' store psi spell
  674.                          MonsterRecord.PsionicSpell=Spell.Number
  675.                       Endif ' end check psionic spell
  676.                    Endif ' end check spell number
  677.                 Endif ' end response
  678.              Case "T" ' option changes monster treasure inventory
  679.                 Graphics.Off=True ' reset color
  680.                 For Array.Number=1 To 5 ' loop through monster treasure
  681.                    ' get monster treasure number
  682.                    Treasure.Number=MonsterRecord.Treasure(Array.Number)
  683.                    ' check file bounds
  684.                    If Treasure.Number>False And _
  685.                    Treasure.Number<=Lof(TreasureFile)/Len(TreasureRecord) Then
  686.                       ' get treasure record
  687.                       Call Read.Record(TreasureFile,Treasure.Number)
  688.                       Outpt="["+Mid$(Str$(Array.Number),2)+"]"+ _
  689.                       TreasureRecord.TreasureName ' store treasure name
  690.                       Call IO.O ' send output message
  691.                    Endif ' end check file bounds
  692.                 Next ' end loop through monster treasure
  693.                 Graphics.Off=False ' reset color
  694.                 Outpt="Enter five treasure names:" ' make display message
  695.                 Call IO.O ' send display message
  696.                 Outpt="Press <enter> for none." ' make display message
  697.                 Call IO.O ' send display message
  698.                 Graphics.Off=True ' reset color
  699.                 For Array.Index=1 To 5 ' loop through monster inventory
  700.                    ' routine to get treasure number
  701.                    Call Find.Treasure(Treasure.Number)
  702.                    ' store monster treasure
  703.                    MonsterRecord.Treasure(Array.Index)=Treasure.Number
  704.                 Next ' end loop through monster inventory
  705.              Case "Q" ' option to exit monster change menu
  706.                 Exit Do ' exit monster change menu
  707.              End Select ' end selection of monster change option
  708.           Loop ' end loop through monster change menu
  709.           Call Share.Record(MonsterFile,Mon.Number) ' write monster record
  710.           Outpt="Monster '"+Rtrim$(MonsterRecord.MonsterName)+"' changed."
  711.           Call IO.O ' send monster changed message
  712.        Endif ' end compare monster number
  713.     Case "L" ' option to list range of monsters
  714.        Max.Monsters=Lof(MonsterFile)/Len(MonsterRecord) ' store number records
  715.        ' routine to get range of numbers
  716.        Call Get.Range(Max.Monsters,Monster.List1,Monster.List2)
  717.        ' loop through range of numbers
  718.        Allow.Break=False ' set allow break flag
  719.        Break=False ' reset control-k flag
  720.        Continue=False ' set continuous flag
  721.        For Monster.Count=Monster.List1 To Monster.List2
  722.           Call Read.Record(MonsterFile,Monster.Count) ' read monster record
  723.           Call Display.Monster(Monster.Count) ' routine to display monster
  724.           If Break Then ' check control-k flag
  725.              Exit For ' exit display loop
  726.           Endif ' end check control-k
  727.           If Continue=False Then ' check continuous flag
  728.              Call More.Prompt ' routine to pause
  729.              If No Then ' check pause response
  730.                 Exit For ' exit list loop
  731.              Endif ' end check response
  732.           Endif ' end check continuous flag
  733.        Next ' end loop through range
  734.        Allow.Break=False ' reset allow break flag
  735.        If Break Then ' check control-k flag
  736.           Break=False ' reset control-k flag
  737.           Outpt=Nul ' set output to null
  738.           Call IO.O ' send empty return
  739.        Endif ' end check control-k flag
  740.     Case "M" ' option to edit monster class
  741.        Do ' loop through monster class edit menu
  742.           Graphics.Off=True ' reset color
  743.           Outpt="[A]dd class" ' make monster class display message
  744.           Call IO.O ' send monster class display message
  745.           Outpt="[C]hange class" ' make monster class display message
  746.           Call IO.O ' send monster class display message
  747.           Outpt="[L]ist class" ' make monster class display message
  748.           Call IO.O ' send monster class display message
  749.           Graphics.Off=False ' reset color
  750.           Outpt="Monster class edit option(q to quit)? " ' make input prompt
  751.           No.Input.Out="Q" ' default input
  752.           Call IO.I ' get user input
  753.           Select Case Ucase$(Inpt) ' selection of monster class edit option
  754.           Case "A" ' option to add empty monster class
  755.              New.Monster=Lof(MonClassFile)/Len(MonclassRecord)+1 ' last record
  756.              For Array.Index=1 To 10 ' loop through monster class record
  757.                 ' clear monster class
  758.                 MonclassRecord.Monsters(Array.Index)=False
  759.              Next ' end loop through record
  760.              Call Share.Record(MonClassFile,New.Monster) ' write new monster class record
  761.           Case "C" ' option to change a monster class
  762.              Outpt="Monster class" ' make range prompt
  763.              ' get number of records in file
  764.              Max.Monclasses=Lof(MonClassFile)/Len(MonclassRecord)
  765.              ' routine to get range of numbers
  766.              Call Get.Range2(0,Max.Monclasses,Monclass.Number)
  767.              Outpt="Enter ten monster names:" ' make display message
  768.              Call IO.O ' send display message
  769.              Outpt="Press <enter> for none." ' make display message
  770.              Call IO.O ' send display message
  771.              Graphics.Off=True ' reset color
  772.              For Monster.Count=1 To 10 ' loop through monster class array
  773.                 ' routine to get monster number
  774.                 Call Find.Monster(Monster.Number)
  775.                 ' store monster number
  776.                 MonclassRecord.Monsters(Monster.Count)=Monster.Number
  777.              Next ' end loop through monster class array
  778.              Call Share.Record(MonClassFile,Monclass.Number) ' write monster class record
  779.              ' make message
  780.              Outpt="Monclass number"+Str$(Monclass.Number)+" changed."
  781.              Call IO.O ' send display message
  782.           Case "L" ' option to list range of monster classes
  783.              Max.Monclasses=Lof(MonClassFile)/Len(MonclassRecord) ' get records
  784.              ' routine to get range of numbers
  785.              Call Get.Range(Max.Monclasses,Monclass.List1,Monclass.List2)
  786.              ' loop through range of monster classes
  787.              Allow.Break=True ' set allow break flag
  788.              Break=False ' reset control-k flag
  789.              Continue=False ' set continuous flag
  790.              For Monclass.Number=Monclass.List1 To Monclass.List2
  791.                 ' get monster class record
  792.                 Call Read.Record(MonClassFile,Monclass.Number)
  793.                 ' routine to display monclass
  794.                 Call Display.Monster.Class(Monclass.Number)
  795.                 If Break Then ' check control-k flag
  796.                    Exit For ' exit display loop
  797.                 Endif ' end check control-k
  798.                 If Continue=False Then ' check continuous flag
  799.                    Call More.Prompt ' routine to pause
  800.                    If No Then ' check pause response
  801.                       Exit For ' exit monster class list loop
  802.                    Endif ' end check response
  803.                 Endif ' end check continuous flag
  804.              Next ' end loop through range
  805.              Allow.Break=False ' reset allow break flag
  806.              If Break Then ' check control-k flag
  807.                 Break=False ' reset control-k flag
  808.                 Outpt=Nul ' set output to null
  809.                 Call IO.O ' send empty return
  810.              Endif ' end check control-k flag
  811.           Case "Q" ' option to exit monster class edit menu
  812.              Exit Do ' exit monster class edit menu
  813.           End Select ' end selection of monster class option
  814.        Loop ' end loop through monster class menu
  815.     Case "T" ' option to edit monster talk responses
  816.        Do ' loop through monster talk response edit menu
  817.           Graphics.Off=True ' reset color
  818.           Outpt="[A]dd response" ' make monster talk response display message
  819.           Call IO.O ' send monster talk response display message
  820.           Outpt="[C]hange response" ' make monster talk response message
  821.           Call IO.O ' send monster talk response display message
  822.           Outpt="[L]ist response" ' make monster talk response display message
  823.           Call IO.O ' send monster talk response display message
  824.           Outpt="[M]onster response" ' make monster talk response message
  825.           Call IO.O ' send monster talk response display message
  826.           Graphics.Off=False ' reset color
  827.           Outpt="Monster talk edit option(q to quit)? " ' make input prompt
  828.           No.Input.Out="Q" ' default input
  829.           Call IO.I ' get user input
  830.           Select Case Ucase$(Inpt) ' selection of monster talk response option
  831.           Case "A" ' option to add talk response string
  832.              Outpt="Enter response(80 characters):" ' make display message
  833.              Call IO.O ' send display message
  834.              Outpt="Press <enter> for none." ' make display message
  835.              Call IO.O ' send display message
  836.              Outpt="? " ' make input prompt
  837.              Call IO.I ' get user input
  838.              ' get last response record
  839.              New.Talk=Lof(MonTalkFile)/Len(MonsterTalkRecord)+1
  840.              MonsterTalkRecord.TalkMessage=Inpt ' store talk response
  841.              Call Share.Record(MonTalkFile,New.Talk) ' write talk response record
  842.           Case "C" ' option to change a talk response
  843.              Outpt="Response number to change" ' make range prompt
  844.              ' get number of records in file
  845.              Max.Responses=Lof(MonTalkFile)/Len(MonsterTalkRecord)
  846.              ' routine to get range of numbers
  847.              Call Get.Range2(1,Max.Responses,Response.Number)
  848.              ' make message
  849.              Outpt="Enter response number"+Str$(Response.Number)+":"
  850.              Call IO.O ' send message
  851.              Outpt="? " ' make input prompt
  852.              Call IO.I ' get user input
  853.              MonsterTalkRecord.TalkMessage=Inpt ' store talk response string
  854.              Call Share.Record(MonTalkFile,Response.Number) ' write talk response record
  855.              ' message
  856.              Outpt="Response number"+Str$(Response.Number)+" changed."
  857.              Call IO.O ' send message
  858.           Case "L" ' option to list monster talk responses
  859.              Allow.Break=True ' set allow break flag
  860.              Break=False ' reset control-k flag
  861.              Continue=False ' reset continuous flag
  862.              Page.Length=False ' clear paginate counter
  863.              ' loop through file
  864.              For Montalk.Number=1 To Lof(MonTalkFile)/Len(MonsterTalkRecord)
  865.                 ' read monster talk record
  866.                 Call Read.Record(MonTalkFile,Montalk.Number)
  867.                 Graphics.Off=False ' reset color
  868.                 ' make message
  869.                 Outpt="Response number"+Str$(Montalk.Number)+":"
  870.                 Call IO.O ' send message
  871.                 Graphics.Off=True ' reset color
  872.                 Outpt=Rtrim$(MonsterTalkRecord.TalkMessage) ' store response
  873.                 If Outpt=Nul Then ' compare length of talk response
  874.                    Outpt="<none>" ' reset to none
  875.                 Endif ' end check length
  876.                 Call IO.O ' send response string
  877.                 If Break Then ' check control-k flag
  878.                    Exit For ' exit display loop
  879.                 Endif ' end check control-k
  880.                 Page.Length=Page.Length+2 ' increment page counter
  881.                 If Page.Length>=User.Pagelength Then ' check page counter
  882.                    Page.Length=False ' reset counter
  883.                    If Continue=False Then ' check continuous flag
  884.                       Call More.Prompt ' routine to pause
  885.                       If No Then ' check pause response
  886.                          Exit For ' exit file loop
  887.                       Endif ' end check yes
  888.                    Endif ' end check continuous flag
  889.                 Endif ' end check page
  890.              Next ' end loop through file
  891.              Allow.Break=False ' reset allow break flag
  892.              If Break Then ' check control-k flag
  893.                 Break=False ' reset control-k flag
  894.                 Outpt=Nul ' set output to null
  895.                 Call IO.O ' send empty return
  896.              Endif ' end check control-k flag
  897.              If Page.Length Then ' recheck page counter
  898.                 Call More.Prompt ' routine to pause
  899.              Endif ' end recheck counter
  900.           Case "M" ' option to add talk response numbers to a monster
  901.              Call Find.Monster(Monster.Number) ' get monster number to change
  902.              If Monster.Number>False Then ' check monster number
  903.                 Call Read.Record(MonsterFile,Monster.Number) ' get monster
  904.                 Outpt="Enter five response numbers:" ' make display message
  905.                 Call IO.O ' send display message
  906.                 Outpt="Press <enter> for none." ' make display message
  907.                 Call IO.O ' send display message
  908.                 For Talk.Count=1 To 5 ' loop through five responses
  909.                    Outpt="Enter response number" ' make range prompt
  910.                    Max.Talk=Lof(MonTalkFile)/Len(MonsterTalkRecord)
  911.                    ' routine to get range of numbers
  912.                    Call Get.Range2(0,Max.Talk,Talk.Number)
  913.                    ' add talk response number
  914.                    MonsterRecord.Talk(Talk.Count)=Talk.Number
  915.                    ' message
  916.                    Outpt="Response number"+Str$(Talk.Count)+" added."
  917.                    Call IO.O ' send display message
  918.                 Next ' end loop through five responses
  919.                 Call Share.Record(MonsterFile,Monster.Number) ' write monster record
  920.              Endif ' end check monster number
  921.           Case "Q" ' option to exit monster talk response edit menu
  922.              Exit Do ' exit monster talk response edit menu
  923.           End Select ' end selection of monster talk response option
  924.        Loop ' end loop through monster talk response edit menu
  925.     Case "Q" ' option to exit monster edit menu
  926.        Exit Do ' exit monster edit menu
  927.     End Select ' end selection of monster edit options
  928.  Loop ' end loop through monster edit menu
  929. End Sub ' end routine to edit monsters
  930.  
  931.  Rem * routine to edit nonplayers file.
  932.  
  933. Sub Edit.Nonplayer
  934.  On Local Error Resume Next ' local error resume
  935.  Do ' loop through nonplayer edit menu
  936.     Graphics.Off=False ' reset color
  937.     Outpt="Nonplayer edit:" ' make display message
  938.     Call IO.O ' send message
  939.     Graphics.Off=True ' reset color
  940.     Outpt="[A]dd" ' make display message
  941.     Call IO.O ' send message
  942.     Outpt="[C]hange" ' make display message
  943.     Call IO.O ' send message
  944.     Outpt="[L]ist" ' make display message
  945.     Call IO.O ' send message
  946.     Graphics.Off=False ' reset color
  947.     Outpt="Nonplayer edit option(q to quit)? " ' option input prompt
  948.     No.Input.Out="Q" ' default input
  949.     Call IO.I ' get user input
  950.     Select Case Ucase$(Inpt) ' selection of option input
  951.     Case "A" ' add nonplayer option
  952.        ' store last nonplayer record number
  953.        New.Nonplayer=Lof(NonPlayerFile)/Len(MonsterRecord)+1
  954.        MonsterRecord.MonsterName=Nul ' set nonplayer record items to zero
  955.        MonsterRecord.PluralName=Nul ' reset nonplayer record item
  956.        For Array.Number=1 To 5 ' loop through nonplayer treasure
  957.           ' set treasure items to zero
  958.           MonsterRecord.Treasure(Array.Number)=False
  959.        Next ' end loop through nonplayer treasure
  960.        MonsterRecord.Experience=False ' set nonplayer record items to zero
  961.        MonsterRecord.NumberAppearing=1 ' reset nonplayer record items
  962.        MonsterRecord.Level=False ' reset nonplayer record items
  963.        MonsterRecord.Hits=False ' reset nonplayer record items
  964.        MonsterRecord.Gold=False ' reset nonplayer record item
  965.        MonsterRecord.Poison=False ' reset nonplayer record items
  966.        MonsterRecord.LevelDrain=False ' reset nonplayer record items
  967.        MonsterRecord.Spell=False ' reset nonplayer record items
  968.        MonsterRecord.Block=False ' reset nonplayer record items
  969.        MonsterRecord.Prevent=False ' reset nonplayer record items
  970.        MonsterRecord.Follow=False ' reset nonplayer record items
  971.        MonsterRecord.Magic=True ' reset nonplayer record items
  972.        MonsterRecord.Jail=False ' reset nonplayer record items
  973.        MonsterRecord.Teleport=False ' reset nonplayer items
  974.        MonsterRecord.FollowPercent=False ' reset nonplayer items
  975.        MonsterRecord.BlockPercent=False ' reset nonplayer record items
  976.        MonsterRecord.PreventPercent=False ' reset nonplayer record items
  977.        MonsterRecord.SpellPercent=False ' reset nonplayer record items
  978.        MonsterRecord.PoisonPercent=False ' reset nonplayer record items
  979.        MonsterRecord.DrainPercent=False ' reset nonplayer record items
  980.        MonsterRecord.Rate=False ' reset nonplayer record items
  981.        MonsterRecord.RatePercent=False ' reset nonplayer record items
  982.        MonsterRecord.Permanent=-2 ' reset nonplayer record items
  983.        For Array.Number=1 To 5 ' loop through monster talk responses
  984.           MonsterRecord.Talk(Array.Number)=False ' reset nonplayer responses
  985.        Next ' end loop through monster talk responses
  986.        MonsterRecord.Psionic=False ' reset nonplayer record items
  987.        MonsterRecord.PsionicSpell=False ' reset nonplayer record items
  988.        ' routine to write next nonplayer record
  989.        Call Share.Record(NonPlayerFile,New.Nonplayer)
  990.     Case "C" ' option to change nonplayer file record
  991.        ' routine to find nonplayer to edit
  992.        Call Find.Nonplayer(Nonplayer.Number)
  993.        If Nonplayer.Number>False Then ' check nonplayer number
  994.           Do ' loop through nonplayer number edit option menu
  995.              ' routine to display nonplayer
  996.              Call Display.Nonplayer(Nonplayer.Number)
  997.              Graphics.Off=False ' reset color
  998.              Outpt="Nonplayer change option(q to quit)? " ' input prompt
  999.              No.Input.Out="Q" ' default prompt
  1000.              Call IO.I ' get user input
  1001.              Select Case Ucase$(Inpt) ' selection of nonplayer change option
  1002.              Case "A" ' option to change nonplayer name
  1003.                 Outpt="Nonplayer name(30 characters)? " ' make input prompt
  1004.                 Call IO.I ' get user input
  1005.                 MonsterRecord.MonsterName=Lcase$(Inpt) ' store name
  1006.              Case "B" ' option to change nonplayer rooms
  1007.                 Outpt="Rooms(separated by commas)? " ' make input prompt
  1008.                 Call IO.I ' get user input
  1009.                 MonsterRecord.PluralName=Inpt ' store rooms
  1010.              Case "C" ' option to change nonplayer level
  1011.                 Outpt="Nonplayer level(1-32767)? " ' make input prompt
  1012.                 No.Input.Out="1" ' default input
  1013.                 Call IO.I ' get user input
  1014.                 MonsterRecord.Level=Int(Val(Inpt)) ' store nonplayer level
  1015.              Case "D" ' option to change nonplayer hit points
  1016.                 Outpt="Hit points? " ' make input prompt
  1017.                 No.Input.Out="1" ' default input
  1018.                 Call IO.I ' get user input
  1019.                 MonsterRecord.Hits=Cdbl(Int(Val(Inpt))) ' store nonplayer hits
  1020.              Case "E" ' option to change nonplayer experience points
  1021.                 Outpt="Experience points? " ' make input prompt
  1022.                 No.Input.Out="1" ' default input
  1023.                 Call IO.I ' get user input
  1024.                 MonsterRecord.Experience=Cdbl(Int(Val(Inpt))) ' store exp
  1025.              Case "F" ' option to change nonplayer gold points
  1026.                 Outpt="Gold points? " ' make input prompt
  1027.                 No.Input.Out="1" ' default input
  1028.                 Call IO.I ' get user input
  1029.                 MonsterRecord.Gold=Cdbl(Int(Val(Inpt))) ' store experience
  1030.              Case "G" ' option to change poisonous nonplayer
  1031.                 Outpt="Poisonous nonplayer(y/n)? " ' make input prompt
  1032.                 No.Input.Out="Y" ' default input
  1033.                 Call IO.I ' get user input
  1034.                 MonsterRecord.Poison=False ' reset poisonous nonplayer
  1035.                 MonsterRecord.PoisonPercent=False ' reset posionous percent
  1036.                 If Yes Then ' check user input response
  1037.                    MonsterRecord.Poison=True ' set poisonous nonplayer
  1038.                    Outpt="Percent chance nonplayer " ' make input prompt
  1039.                    Outpt=Outpt+"will poison(1-100)? " ' input prompt
  1040.                    No.Input.Out="50" ' default input
  1041.                    Call IO.I ' get user input
  1042.                    MonsterRecord.PoisonPercent=Int(Val(Inpt)) ' store percent
  1043.                 Endif ' end check user input
  1044.              Case "H" ' option to change level draining nonplayer
  1045.                 Outpt="Level draining nonplayer(y/n)? " ' make input prompt
  1046.                 No.Input.Out="Y" ' default input
  1047.                 Call IO.I ' get user input
  1048.                 MonsterRecord.LevelDrain=False ' reset level drain nonplayer
  1049.                 MonsterRecord.DrainPercent=False ' reset level drain nonplayer
  1050.                 If Yes Then ' check user input response
  1051.                    ' set level draining nonplayer
  1052.                    MonsterRecord.LevelDrain=True
  1053.                    Outpt="Percent chance nonplayer " ' make input prompt
  1054.                    Outpt=Outpt+"will level drain(1-100)? " ' input prompt
  1055.                    No.Input.Out="50" ' default input
  1056.                    Call IO.I ' get user input
  1057.                    MonsterRecord.DrainPercent=Int(Val(Inpt)) ' store percent
  1058.                 Endif ' end check user input
  1059.              Case "I" ' option to change exit blocking nonplayer
  1060.                 Outpt="Nonplayer blocks exits(y/n)? " ' make input prompt
  1061.                 No.Input.Out="Y" ' default input
  1062.                 Call IO.I ' get user input
  1063.                 MonsterRecord.Block=False ' reset blocking nonplayer
  1064.                 MonsterRecord.BlockPercent=False ' reset blocking nonplayer
  1065.                 If Yes Then ' check user input response
  1066.                    MonsterRecord.Block=True ' set blocking nonplayer
  1067.                    Outpt="Percent chance nonplayer " ' make input prompt
  1068.                    Outpt=Outpt+"will block exits(1-100)? " ' input prompt
  1069.                    No.Input.Out="50" ' default input
  1070.                    Call IO.I ' get user input
  1071.                    MonsterRecord.BlockPercent=Int(Val(Inpt)) ' store percent
  1072.                 Endif ' end check user input
  1073.              Case "J" ' option to change preventing nonplayer
  1074.                 ' input prompt
  1075.                 Outpt="Nonplayer prevents taking treasure(y/n)? "
  1076.                 No.Input.Out="Y" ' default input
  1077.                 Call IO.I ' get user input
  1078.                 MonsterRecord.Prevent=False ' reset preventing nonplayer
  1079.                 ' reset preventing nonplayer
  1080.                 MonsterRecord.PreventPercent=False
  1081.                 If Yes Then ' check user input response
  1082.                    MonsterRecord.Prevent=True ' set preventing nonplayer
  1083.                    Outpt="Percent chance nonplayer " ' make input prompt
  1084.                    Outpt=Outpt+"prevents player from taking treasure(1-100)? "
  1085.                    No.Input.Out="50" ' default input
  1086.                    Call IO.I ' get user input
  1087.                    MonsterRecord.PreventPercent=Int(Val(Inpt)) ' store percent
  1088.                 Endif ' end check user input
  1089.              Case "K" ' option to change following nonplayer
  1090.                 Outpt="Nonplayer follows player(y/n)? " ' make input prompt
  1091.                 No.Input.Out="Y" ' default input
  1092.                 Call IO.I ' get user input
  1093.                 MonsterRecord.Follow=False ' reset following nonplayer
  1094.                 MonsterRecord.FollowPercent=False ' reset following nonplayer
  1095.                 MonsterRecord.Teleport=False ' reset following nonplayer
  1096.                 If Yes Then ' check user input response
  1097.                    MonsterRecord.Follow=True ' set following nonplayer
  1098.                    Outpt="Percent chance nonplayer " ' make input prompt
  1099.                    Outpt=Outpt+"will follow player(1-100)? " ' input prompt
  1100.                    No.Input.Out="50" ' default input
  1101.                    Call IO.I ' get user input
  1102.                    MonsterRecord.FollowPercent=Int(Val(Inpt)) ' store percent
  1103.                    Outpt="Percent chance nonplayer " ' make input prompt
  1104.                    Outpt=Outpt+"will teleport with player(1-100)? " ' prompt
  1105.                    No.Input.Out="50" ' default input
  1106.                    Call IO.I ' get user input
  1107.                    MonsterRecord.Teleport=Int(Val(Inpt)) ' store percent
  1108.                 Endif ' end check user input
  1109.              Case "L" ' option to change spell casting nonplayer
  1110.                 Outpt="Nonplayer casts spells(y/n)? " ' make input prompt
  1111.                 No.Input.Out="Y" ' default input
  1112.                 Call IO.I ' get user input
  1113.                 MonsterRecord.Spell=False ' reset spell casting nonplayer
  1114.                 MonsterRecord.SpellPercent=False ' reset casting nonplayer
  1115.                 If Yes Then ' check user input prompt
  1116.                    ' routine to find spell number
  1117.                    Call Find.Spell(Spell.Number)
  1118.                    If Spell.Number>False Then ' check spell number range
  1119.                       MonsterRecord.Spell=Spell.Number ' store spell number
  1120.                       Outpt="Percent chance nonplayer " ' make input prompt
  1121.                       Outpt=Outpt+"casts spell(1-100)? " ' input prompt
  1122.                       No.Input.Out="50" ' default input
  1123.                       Call IO.I ' get user input
  1124.                       ' store percent
  1125.                       MonsterRecord.SpellPercent=Int(Val(Inpt))
  1126.                    Endif ' end check spell number
  1127.                 Endif ' end check user input
  1128.              Case "M" ' option to change jailing nonplayer
  1129.                 Outpt="Nonplayer jails attacker(y/n)? " ' make input prompt
  1130.                 No.Input.Out="Y" ' default input
  1131.                 Call IO.I ' get user input
  1132.                 MonsterRecord.Jail=Yes ' set jailing nonplayer
  1133.              Case "N" ' option to change nonplayer encounter rate
  1134.                 ' prompt
  1135.                 Outpt="Nonplayer encounter rate(# of action prompts)? "
  1136.                 No.Input.Out="6" ' default input
  1137.                 Call IO.I ' get user input
  1138.                 MonsterRecord.Rate=Int(Val(Inpt)) ' store encounter rate
  1139.                 ' make input prompt
  1140.                 Outpt="Nonplayer encounter percent(1-100)? "
  1141.                 No.Input.Out="50" ' default input
  1142.                 Call IO.I ' get user input
  1143.                 MonsterRecord.RatePercent=Int(Val(Inpt)) ' store percent
  1144.              Case "O" ' option to change nonplayer psionics spell
  1145.                 Outpt="Nonplayer uses psionics(y/n)? " ' make input prompt
  1146.                 No.Input.Out="Y" ' default input
  1147.                 Call IO.I ' get user input
  1148.                 MonsterRecord.Psionic=False ' reset nonplayer psionics spell
  1149.                 MonsterRecord.PsionicSpell=False ' reset nonplayer psionics
  1150.                 If Yes Then ' check user input
  1151.                    Outpt="Psionic spell?" ' make input prompt
  1152.                    ' routine to find spell number
  1153.                    Call Find.Spell(Spell.Number)
  1154.                    If Spell.Number>False Then ' check spell number range
  1155.                       If SpellRecord.Psionic=False Then ' check psi spell
  1156.                          Outpt="That spell is not a psionic spell!" ' message
  1157.                          Call IO.O ' send error message
  1158.                          ' reset nonplayer psionics
  1159.                          MonsterRecord.Psionic=False
  1160.                          MonsterRecord.PsionicSpell=False ' reset psionics
  1161.                       Else ' check psionic spell type
  1162.                          MonsterRecord.Psionic=True ' set nonplayer psionics
  1163.                          ' store psi number
  1164.                          MonsterRecord.PsionicSpell=Spell.Number
  1165.                       Endif ' end check psionic spell type
  1166.                    Endif ' end check spell number
  1167.                 Endif ' end check user input
  1168.              Case "P" ' option to change nonplayer treasure
  1169.                 Outpt="Enter five treasure names:" ' make display message
  1170.                 Call IO.O ' send message
  1171.                 Outpt="Press <enter> for none." ' make display message
  1172.                 Call IO.O ' send message
  1173.                 Graphics.Off=True ' reset color
  1174.                 For Treasure.Count=1 To 5 ' loop through nonplayer treasures
  1175.                    ' routine to get treasure number
  1176.                    Call Find.Treasure(Treasure.Number)
  1177.                    ' store nonplayer treasure
  1178.                    MonsterRecord.Treasure(Treasure.Count)=Treasure.Number
  1179.                 Next ' end loop through nonplayer treasures
  1180.              Case "Q" ' option to exit nonplayer change menu
  1181.                 Exit Do ' exit nonplayer change menu
  1182.              End Select ' end selections of nonplayer change options
  1183.           Loop ' end loop through nonplayer change option menu
  1184.           Call Share.Record(NonPlayerFile,Nonplayer.Number) ' write nonplayer file
  1185.           Outpt="Nonplayer '"+Rtrim$(MonsterRecord.MonsterName)+"' changed."
  1186.           Call IO.O ' send display message
  1187.        Endif ' end check nonplayer edit number
  1188.     Case "L" ' option to list range of nonplayers
  1189.        ' store length of nonplayer file
  1190.        Max.Nonplayers=Lof(NonPlayerFile)/Len(MonsterRecord)
  1191.        ' routine to get range of numbers
  1192.        Call Get.Range(Max.Nonplayers,Nonplayer.List1,Nonplayer.List2)
  1193.        ' loop through range of nonplayers
  1194.        Allow.Break=True ' set allow break flag
  1195.        Break=False ' reset control-k flag
  1196.        Continue=False ' set continuous flag
  1197.        For Nonplayers.Count=Nonplayer.List1 To Nonplayer.List2
  1198.           Call Read.Record(NonPlayerFile,Nonplayers.Count) ' read nonplayer
  1199.           ' routine to display nonplayer
  1200.           Call Display.Nonplayer(Nonplayers.Count)
  1201.           If Break Then ' check control-k flag
  1202.              Exit For ' exit display loop
  1203.           Endif ' end check control-k
  1204.           Graphics.Off=False ' reset color
  1205.           If Continue=False Then ' check continuous flag
  1206.              Call More.Prompt ' routine to pause
  1207.              If No Then ' check pause response
  1208.                 Exit For ' exit nonplayer list
  1209.              Endif ' end check response
  1210.           Endif ' end check continuous flag
  1211.        Next ' end loop through range of nonplayers
  1212.        Allow.Break=False ' reset allow break flag
  1213.        If Break Then ' check control-k flag
  1214.           Break=False ' reset control-k flag
  1215.           Outpt=Nul ' set output to null
  1216.           Call IO.O ' send empty return
  1217.        Endif ' end check control-k flag
  1218.     Case "Q" ' option to exit nonplayer edit options menu
  1219.        Exit Do ' exit nonplayer edit options menu
  1220.     End Select ' end selection of nonplayers edit menu
  1221.  Loop ' end loop through nonplater edit menu
  1222. End Sub ' end routine to edit nonplayers
  1223.  
  1224.  Rem * routine to edit objects file.
  1225.  
  1226. Sub Edit.Object
  1227.  On Local Error Resume Next ' local error resume
  1228.  Do ' loop through objects edit menu
  1229.     Graphics.Off=False ' reset color
  1230.     Outpt="Object edit:" ' make display message
  1231.     Call IO.O ' send message
  1232.     Graphics.Off=True ' reset color
  1233.     Outpt="[A]dd" ' make display message
  1234.     Call IO.O ' send message
  1235.     Outpt="[C]hange" ' make display message
  1236.     Call IO.O ' send message
  1237.     Outpt="[L]ist" ' make display message
  1238.     Call IO.O ' send message
  1239.     Graphics.Off=False ' reset color
  1240.     Outpt="Object edit option(q to quit)? " ' make input prompt
  1241.     No.Input.Out="Q" ' default input
  1242.     Call IO.I ' get user input
  1243.     Select Case Ucase$(Inpt) ' selection of object edit option
  1244.     Case "A" ' option to add an object record
  1245.        New.Object=Lof(ObjectFile)/Len(ObjectRecord)+1 'store last object record
  1246.        ObjectRecord.ObjectName=Nul ' reset object record item
  1247.        ObjectRecord.ShortName=Nul ' reset object record item
  1248.        ObjectRecord.LongDesc=Nul ' reset object record item
  1249.        ObjectRecord.ShortDesc=Nul ' reset object record item
  1250.        ObjectRecord.RoomLink=False ' reset object record item
  1251.        ObjectRecord.Invisible=False ' reset object record item
  1252.        ObjectRecord.JailTrap=False ' reset object record item
  1253.        ObjectRecord.DoorLock=False ' reset object record item
  1254.        ObjectRecord.Relocks=False ' reset object record item
  1255.        ObjectRecord.Hidden=False ' reset object record item
  1256.        ObjectRecord.Closed=False ' reset object record item
  1257.        ObjectRecord.Keyed=False ' reset object record item
  1258.        ObjectRecord.Trap=False ' reset object record item
  1259.        ObjectRecord.Teleport=False ' reset object record item
  1260.        ObjectRecord.LightRoom=False ' reset object record item
  1261.        ObjectRecord.LightTime=False ' reset object record item
  1262.        ObjectRecord.FromHour=False ' reset object record item
  1263.        ObjectRecord.FromMin=False ' reset object record item
  1264.        ObjectRecord.ToHour=False ' reset object record item
  1265.        ObjectRecord.ToMin=False ' reset object record item
  1266.        ObjectRecord.Permanent=True ' reset object record item
  1267.        Call Share.Record(ObjectFile,New.Object) ' routine to write object record
  1268.     Case "C" ' option to change an object
  1269.        Call Find.Objects(Object.Number) ' routine to get object number
  1270.        If Object.Number>False Then ' check object number range
  1271.           Do ' loop through object change menu
  1272.              Call Display.Object(Object.Number) ' routine to display object
  1273.              Graphics.Off=False ' reset color
  1274.              Outpt="Object change option(q to quit)? " ' make input prompt
  1275.              No.Input.Out="Q" ' default input
  1276.              Call IO.I ' get user input
  1277.              Select Case Ucase$(Inpt) ' selection of object change option
  1278.              Case "A" ' option to change object name
  1279.                 Outpt="Object name(30 characters)? " ' make input prompt
  1280.                 Call IO.I ' get user input
  1281.                 ObjectRecord.ObjectName=Lcase$(Inpt) ' store object name
  1282.              Case "B" ' option to change object mnemonic name
  1283.                 Outpt="Object identifier(30 characters)? " ' make input prompt
  1284.                 Call IO.I ' get user input
  1285.                 ObjectRecord.ShortName=Ucase$(Inpt) ' store object mnemonic
  1286.              Case "C" ' option to change object room number link
  1287.                 Outpt="Room number link? " ' make input prompt
  1288.                 Call IO.I ' get user input
  1289.                 ObjectRecord.RoomLink=Int(Val(Inpt)) ' store object room link
  1290.              Case "D" ' option to change object trap
  1291.                 Outpt="Trapped portal(y/n)? " ' make input prompt
  1292.                 No.Input.Out="Y" ' default input
  1293.                 Call IO.I ' get user input
  1294.                 ObjectRecord.Teleport=False ' reset object trap
  1295.                 ObjectRecord.Trap=False ' reset object trap
  1296.                 If Yes Then ' check user input response
  1297.                    Graphics.Off=True ' reset color
  1298.                    Outpt="[P]oison needles" ' make display message
  1299.                    Call IO.O ' send message
  1300.                    Outpt="[T]eleport to room number" ' make display message
  1301.                    Call IO.O ' send message
  1302.                    Outpt="[H]its for fatigue or vitality" ' make message
  1303.                    Call IO.O ' send message
  1304.                    Graphics.Off=False ' reset color
  1305.                    Outpt="Object trap option? " ' make input prompt
  1306.                    No.Input.Out="Q" ' default input
  1307.                    Call IO.I ' get user input
  1308.                    Select Case Ucase$(Inpt) ' selection of object trap type
  1309.                    Case "P" ' poison object trap type
  1310.                       ObjectRecord.Trap=1 ' set object poison trap type
  1311.                    Case "T" ' teleport object trap type
  1312.                       ObjectRecord.Trap=2 ' set object teleport trap type
  1313.                       Outpt="Room number? " ' make input prompt
  1314.                       No.Input.Out="1" ' default input
  1315.                       Call IO.I ' get user input
  1316.                       ' store telepot room
  1317.                       ObjectRecord.Teleport=Int(Val(Inpt))
  1318.                    Case "H" ' objects hits trap type
  1319.                       Hits.Sign=False ' reset hits sign multiplier
  1320.                       Graphics.Off=True ' reset color
  1321.                       Outpt="[F]atigue" ' make display message
  1322.                       Call IO.O ' send message
  1323.                       Outpt="[V]itality" ' make display message
  1324.                       Call IO.O ' send message
  1325.                       Outpt="[N]one" ' make display message
  1326.                       Call IO.O ' send message
  1327.                       Graphics.Off=False ' reset color
  1328.                       Outpt="Object trap hits option? " ' make input prompt
  1329.                       No.Input.Out="Q" ' default input
  1330.                       Call IO.I ' get user input
  1331.                       Select Case Ucase$(Inpt) ' selection of hits option
  1332.                       Case "F" ' fatigue option
  1333.                          Hits.Sign=1 ' set hits sign multiplier
  1334.                       Case "V" ' vitality option
  1335.                          Hits.Sign=True ' set hits sign multiplier
  1336.                       Case "N" ' option for none
  1337.                          Hits.Sign=False ' reset sign multiplier
  1338.                       End Select ' end hits option selection
  1339.                       Hits.Amount=False ' reset hits number
  1340.                       If Hits.Sign Then ' check hits type
  1341.                          ObjectRecord.Trap=3 ' set object trap type
  1342.                          Outpt="Number of hits(1-32767)? " ' make input prompt
  1343.                          No.Input.Out="10" ' default input
  1344.                          Call IO.I ' get user input
  1345.                          Hits.Amount=Int(Val(Inpt)) ' store number of hits
  1346.                       Endif ' end check hits type
  1347.                       ' calculate hits
  1348.                       ObjectRecord.Teleport=Hits.Sign*Hits.Amount
  1349.                    End Select ' end selection of object trap option
  1350.                 Endif ' end check user input
  1351.              Case "E" ' option to change object description
  1352.                 ' make display message
  1353.                 Outpt="Long description(80 characters):"
  1354.                 Call IO.O ' send message
  1355.                 Outpt="? " ' make input prompt
  1356.                 Call IO.I ' get user input
  1357.                 ObjectRecord.LongDesc=Inpt ' store object description
  1358.              Case "F" ' option to change object entry description
  1359.                 Outpt="Entry description(80 characters):" ' make message
  1360.                 Call IO.O ' send message
  1361.                 Outpt="? " ' make input prompt
  1362.                 Call IO.I ' get user input
  1363.                 ObjectRecord.ShortDesc=Inpt ' store object entry description
  1364.              Case "G" ' option to change hidden object
  1365.                 Outpt="Hidden object(y/n)? " ' make input prompt
  1366.                 No.Input.Out="Y" ' default input
  1367.                 Call IO.I ' get user input
  1368.                 ObjectRecord.Hidden=Yes ' store hidden object type
  1369.              Case "H" ' option to change invisible object
  1370.                 Outpt="Invisible object(y/n)? " ' make input prompt
  1371.                 No.Input.Out="Y" ' default input
  1372.                 Call IO.I ' get user input
  1373.                 ObjectRecord.Invisible=Yes ' store invisible object type
  1374.              Case "I" ' option to change object jail type
  1375.                 Outpt="Jail attacker trap(y/n)? " ' make input prompt
  1376.                 No.Input.Out="Y" ' default input
  1377.                 Call IO.I ' get user input
  1378.                 ObjectRecord.JailTrap=Yes ' store object jail type
  1379.              Case "J" ' option to change object locked type
  1380.                 Outpt="Locked portal(y/n)? " ' make input prompt
  1381.                 No.Input.Out="Y" ' default input
  1382.                 Call IO.I ' get user input
  1383.                 ObjectRecord.DoorLock=False ' reset object lock type
  1384.                 ObjectRecord.Closed=False ' reset object lock type
  1385.                 If Yes Then ' check user input response
  1386.                    ObjectRecord.DoorLock=2 ' set object lock
  1387.                    ObjectRecord.Closed=True ' set object lock
  1388.                 Endif ' end check user input
  1389.              Case "K" ' option to change object portal type
  1390.                 Outpt="Relocking portal(y/n)? " ' make input prompt
  1391.                 No.Input.Out="Y" ' default input
  1392.                 Call IO.I ' get user input
  1393.                 ObjectRecord.Relocks=Yes ' set object portal type
  1394.              Case "L" ' option to change object key number
  1395.                 Outpt="Key number(1-32767)? " ' make input prompt
  1396.                 No.Input.Out="1" ' default input
  1397.                 Call IO.I ' get user input
  1398.                 ObjectRecord.Keyed=Int(Val(Inpt)) ' set object key number
  1399.              Case "M" ' option to change permanent object
  1400.                 Outpt="Permanent Object(y/n)? " ' make input prompt
  1401.                 No.Input.Out="Y" ' default input
  1402.                 Call IO.I ' get user input
  1403.                 ObjectRecord.Permanent=Yes ' set permanent object
  1404.              Case "N" ' option to change object light type
  1405.                 Outpt="Object is a light(y/n)? " ' make input prompt
  1406.                 No.Input.Out="Y" ' default input
  1407.                 Call IO.I ' get user input
  1408.                 ObjectRecord.LightRoom=False ' reset object light type
  1409.                 ObjectRecord.LightTime=False ' reset object light type
  1410.                 If Yes Then ' check user input response
  1411.                    ObjectRecord.LightRoom=True ' set object light type
  1412.                    Outpt="Object lights at a time(y/n)? " ' make input prompt
  1413.                    No.Input.Out="Y" ' default input
  1414.                    Call IO.I ' get user input
  1415.                    If Yes Then ' check user input response
  1416.                       ObjectRecord.LightTime=True ' set object light time type
  1417.                       Outpt="From hour(HH)? " ' make input prompt
  1418.                       Call IO.I ' get user input
  1419.                       ' store object hour light time
  1420.                       Time.Amount=Int(Val(Inpt))
  1421.                       ' check hour time range
  1422.                       If Time.Amount>=0 And Time.Amount<=23 Then
  1423.                          ' store hour light time
  1424.                          ObjectRecord.FromHour=Time.Amount
  1425.                       Endif ' end check hour time range
  1426.                       Outpt="From minute(MM)? " ' make input prompt
  1427.                       Call IO.I ' get user input
  1428.                       ' store object minute light time
  1429.                       Time.Amount=Int(Val(Inpt))
  1430.                       ' check minute time range
  1431.                       If Time.Amount>=0 And Time.Amount<=59 Then
  1432.                          ' store minute light time
  1433.                          ObjectRecord.FromMin=Time.Amount
  1434.                       Endif ' end check minute time range
  1435.                       Outpt="To hour(HH)? " ' make input prompt
  1436.                       Call IO.I ' get user input
  1437.                       ' store object hour light time
  1438.                       Time.Amount=Int(Val(Inpt))
  1439.                       ' check hour time range
  1440.                       If Time.Amount>=0 And Time.Amount<=23 Then
  1441.                          ' store hour light time
  1442.                          ObjectRecord.ToHour=Time.Amount
  1443.                       Endif ' end check hour time range
  1444.                       Outpt="To minute(MM)? " ' make input prompt
  1445.                       Call IO.I ' get user input
  1446.                       ' store object minute light time
  1447.                       Time.Amount=Int(Val(Inpt))
  1448.                       ' check minute time range
  1449.                       If Time.Amount>=0 And Time.Amount<=59 Then
  1450.                          ' store minute light time
  1451.                          ObjectRecord.ToMin=Time.Amount
  1452.                       Endif ' end check minute time range
  1453.                    Endif ' end check user input
  1454.                 Endif ' end check user input
  1455.              Case "Q" ' option to exit object change menu
  1456.                 Exit Do ' exit object change menu
  1457.              End Select ' end selection of object change menu options
  1458.           Loop ' end loop through object change options
  1459.           Call Share.Record(ObjectFile,Object.Number) ' write object file
  1460.           Outpt="Object '"+Rtrim$(ObjectRecord.ObjectName)+"' changed."
  1461.           Call IO.O ' send display message
  1462.        Endif ' end check object number range
  1463.     Case "L" ' option to list range of objects
  1464.        Max.Objects=Lof(ObjectFile)/Len(ObjectRecord) ' store length of object
  1465.        ' routine to get range of objects
  1466.        Call Get.Range(Max.Objects,Objects.List1,Objects.List2)
  1467.        ' loop through range of object numbers
  1468.        Allow.Break=True ' set allow break flag
  1469.        Break=False ' reset control-k flag
  1470.        Continue=False ' set continuous flag
  1471.        For Object.Count=Objects.List1 To Objects.List2
  1472.           Call Read.Record(ObjectFile,Object.Count) ' read object file
  1473.           Call Display.Object(Object.Count) ' routine to display object
  1474.           If Break Then ' check control-k flag
  1475.              Exit For ' exit display flag
  1476.           Endif ' end check control-k
  1477.           Graphics.Off=False ' reset color
  1478.           If Continue=False Then ' check continuous flag
  1479.              Call More.Prompt ' routine to pause
  1480.              If No Then ' check user input
  1481.                 Exit For ' exit list loop
  1482.              Endif ' end check input
  1483.           Endif ' end check continuous flag
  1484.        Next ' end loop through object list
  1485.        Allow.Break=False ' reset allow break flag
  1486.        If Break Then ' check control-k flag
  1487.           Break=False ' reset control-k flag
  1488.           Outpt=Nul ' set output to null
  1489.           Call IO.O ' send empty return
  1490.        Endif ' end check control-k flag
  1491.     Case "Q" ' option to exit object edit menu
  1492.        Exit Do ' exit object edit menu
  1493.     End Select ' end selection of object edit menu option
  1494.  Loop ' end loop through object edit options
  1495. End Sub ' end routine to edit objects
  1496.  
  1497.  Rem * routine to edit spells file.
  1498.  
  1499. Sub Edit.Spell
  1500.  On Local Error Resume Next ' local error resume
  1501.  Do ' loop through spell edit menu
  1502.     Graphics.Off=False ' reset color
  1503.     Outpt="Spell edit:" ' make display message
  1504.     Call IO.O ' send message
  1505.     Graphics.Off=True ' reset color
  1506.     Outpt="[A]dd" ' make display message
  1507.     Call IO.O ' send message
  1508.     Outpt="[C]hange" ' make display message
  1509.     Call IO.O ' send message
  1510.     Outpt="[L]ist" ' make display message
  1511.     Call IO.O ' make message
  1512.     Graphics.Off=False ' reset color
  1513.     Outpt="Spell edit option(q to quit)? " ' make input prompt
  1514.     No.Input.Out="Q" ' default input
  1515.     Call IO.I ' get user input
  1516.     Select Case Ucase$(Inpt) ' selection of spell edit option
  1517.     Case "A" ' option to add a spell
  1518.        New.Spell=Lof(SpellFile)/Len(SpellRecord)+1 ' store last spell record
  1519.        SpellRecord.SpellName=Nul ' reset spell record item
  1520.        SpellRecord.Chant=Nul ' reset spell record item
  1521.        SpellRecord.Desc=Nul ' reset spell record item
  1522.        SpellRecord.Level=False ' reset spell record item
  1523.        SpellRecord.SpellType=False ' reset spell record item
  1524.        SpellRecord.Teleport=False ' reset spell record item
  1525.        SpellRecord.ClassType=False ' reset spell record item
  1526.        SpellRecord.Psionic=False ' reset spell record item
  1527.        SpellRecord.PsionicMode=False ' reset spell record item
  1528.        For Array.Index=1 To 5 ' loop through spell ingredients
  1529.           SpellRecord.Ingred(Array.Index)=False ' reset spell record item
  1530.        Next ' end loop through spell ingredients
  1531.        SpellRecord.SpellFlag=False ' reset spell record item
  1532.        Call Share.Record(SpellFile,New.Spell) ' write next spell record
  1533.     Case "C" ' option to edit a spell
  1534.        Call Find.Spell(Spell.Number) ' routine to get spell number
  1535.        If Spell.Number>False Then ' check spell number
  1536.           Do ' loop through spell edit options menu
  1537.              Call Display.Spell(Spell.Number) ' routine to display spell
  1538.              Graphics.Off=False ' reset color
  1539.              Outpt="Spell change option(q to quit)? " ' make input prompt
  1540.              No.Input.Out="Q" ' default input
  1541.              Call IO.I ' get user input
  1542.              Select Case Ucase$(Inpt) ' selection of spell edit option
  1543.              Case "A" ' option to change spell name
  1544.                 Outpt="Spell name(30 characters)? " ' make input prompt
  1545.                 Call IO.I ' get user input
  1546.                 SpellRecord.SpellName=Lcase$(Inpt) ' store spell name
  1547.              Case "B" ' option to change spell chant
  1548.                 Outpt="Spell chant(80 characters):" ' make display message
  1549.                 Call IO.O ' send message
  1550.                 Outpt="? " ' make input prompt
  1551.                 Call IO.I ' get user input
  1552.                 SpellRecord.Chant=Ucase$(Inpt) ' store spell chant
  1553.              Case "C" ' option to change spell description
  1554.                 Outpt="Spell cast description(80 characters):" ' make message
  1555.                 Call IO.O ' send message
  1556.                 Outpt="? " ' make input prompt
  1557.                 Call IO.I ' get user input
  1558.                 SpellRecord.Desc=Inpt ' store spell description
  1559.              Case "D" ' option to change spell level
  1560.                 Outpt="Spell level(1-32767)? " ' make input prompt
  1561.                 No.Input.Out="1" ' default input
  1562.                 Call IO.I ' get user input
  1563.                 SpellRecord.Level=Int(Val(Inpt)) ' store spell level
  1564.              Case "E" ' option to change spell type
  1565.                 Call Spell.Types ' routine displays spell types
  1566.                 Graphics.Off=False ' reset color
  1567.                 Outpt="Spell type option(q to quit)? " ' make input prompt
  1568.                 No.Input.Out="Q" ' default input
  1569.                 Call IO.I ' get user input
  1570.                 Inpt=Ucase$(Inpt) ' uppercase input
  1571.                 ' compare input
  1572.                 Spell.Type=Instr("ABCDEFGHIJKLMNOPRSTUVWXYZ123",Inpt)
  1573.                 ' check input value
  1574.                 If Spell.Type>False And Spell.Type<=28 Then
  1575.                    SpellRecord.SpellType=Spell.Type ' store spell type
  1576.                    If Spell.Type=10 Then ' check teleport spell
  1577.                       Outpt="Room it teleports to(1-"+ _
  1578.                       Mid$(Str$(Lof(RoomFile)/Len(RoomRecord)),2)+")? " 'prompt
  1579.                       No.Input.Out="1" ' default input
  1580.                       Call IO.I ' get user input
  1581.                       SpellRecord.Teleport=Int(Val(Inpt)) ' store spell room
  1582.                    Endif ' end check teleport spell
  1583.                 Endif ' end check input value
  1584.              Case "F" ' option to change psionic spell
  1585.                 Outpt="Spell is psionic spell(y/n)? " ' make input prompt
  1586.                 No.Input.Out="Y" ' default input
  1587.                 Call IO.I ' get user input
  1588.                 SpellRecord.Psionic=False ' reset psionic spell
  1589.                 SpellRecord.PsionicMode=False ' reset psionic spell
  1590.                 If Yes Then ' check user input response
  1591.                    SpellRecord.Psionic=True ' set psionic spell
  1592.                    Graphics.Off=True ' reset color
  1593.                    Outpt="[A]ttack mode" ' make display message
  1594.                    Call IO.O ' send message
  1595.                    Outpt="[D]efense mode" ' make display message
  1596.                    Call IO.O ' send message
  1597.                    Graphics.Off=False ' reset color
  1598.                    Outpt="Spell psionic option? " ' make input prompt
  1599.                    No.Input.Out="Q" ' default input
  1600.                    Call IO.I ' get user input
  1601.                    SpellRecord.PsionicMode=False ' reset spell psionic type
  1602.                    Select Case Ucase$(Inpt) ' selection of psionic type
  1603.                    Case "A" ' attack psionic type
  1604.                       SpellRecord.PsionicMode=1 ' store psionic type
  1605.                    Case "D" ' defense psionic type
  1606.                       SpellRecord.PsionicMode=2 ' store psionic type
  1607.                    End Select ' end selection of psionic type
  1608.                 Endif ' end check user input
  1609.              Case "G" ' option to change spell class restrictions
  1610.                 Do ' loop through spell cast options menu
  1611.                    Graphics.Off=True ' reset color
  1612.                    For Class.Number=1 To 8 ' loop through class names
  1613.                       Outpt="["+Chr$(64+Class.Number)+"]"+ _
  1614.                       Rtrim$(Class.Name(Class.Number))
  1615.                       Call IO.O ' send class name message
  1616.                    Next ' end loop through class names
  1617.                    Outpt="[N]one" ' make message
  1618.                    Call IO.O ' send message
  1619.                    Outpt="[X]All" ' make message
  1620.                    Call IO.O ' send message
  1621.                    Graphics.Off=False ' reset color
  1622.                    Outpt="Spell class option(q to quit)? " ' make input prompt
  1623.                    No.Input.Out="Q" ' default input
  1624.                    Call IO.I ' get user input
  1625.                    Select Case Ucase$(Inpt) ' selection of class name
  1626.                    Case "A" To "H" ' range of class names
  1627.                       ' store number of class
  1628.                       Class.Number=Instr("ABCDEFGH",Inpt)
  1629.                       ' set spell cast restriction flag
  1630.                       SpellRecord.ClassType=SpellRecord.ClassType Or _
  1631.                       2^Class.Number
  1632.                    Case "N" ' option for no class restrictions
  1633.                       ' reset class restriction flag
  1634.                       SpellRecord.ClassType=False
  1635.                    Case "X" ' option to set all class restrictions
  1636.                       For Class.Number=1 To 8 ' loop through class types
  1637.                          ' set spell cast restriction flag
  1638.                          SpellRecord.ClassType=SpellRecord.ClassType Or _
  1639.                          2^Class.Number
  1640.                       Next ' end loop through class types
  1641.                    Case "Q" ' option to exit spell cast restriction menu
  1642.                       Exit Do ' exit spell cast restriction menu
  1643.                    End Select ' end selection of spell cast option
  1644.                 Loop ' end loop through spell cast restriction option menu
  1645.              Case "H" ' option to change spell ingredients
  1646.                 Outpt="Enter five treasure items for spell ingredients:"
  1647.                 Call IO.O ' send display message
  1648.                 Outpt="Press <enter> for none." ' make display message
  1649.                 Call IO.O ' send message
  1650.                 Graphics.Off=True ' reset color
  1651.                 For Array.Count=1 To 5 ' loop through spell ingredients
  1652.                    ' routine to get treasure number
  1653.                    Call Find.Treasure(Treasure.Number)
  1654.                    ' store spell ingredient
  1655.                    SpellRecord.Ingred(Array.Count)=Treasure.Number
  1656.                 Next ' end loop through spell ingredients
  1657.                 Graphics.Off=False ' reset color
  1658.              Case "I" ' option to change spell ingredient cast type
  1659.                 Do ' loop through spell cast type option menu
  1660.                    Graphics.Off=True ' reset color
  1661.                    Outpt="[A]Use command" ' make display message
  1662.                    Call IO.O ' send message
  1663.                    Outpt="[B]Read scroll" ' make display message
  1664.                    Call IO.O ' send message
  1665.                    Outpt="[C]Cast spell" ' make display message
  1666.                    Call IO.O ' send message
  1667.                    Outpt="[N]one" ' make display message
  1668.                    Call IO.O ' send message
  1669.                    Outpt="[X]All" ' make display message
  1670.                    Call IO.O ' send message
  1671.                    Graphics.Off=False ' reset color
  1672.                    Outpt="Spell ingredient option(q to quit)? " ' make prompt
  1673.                    No.Input.Out="Q" ' default input
  1674.                    Call IO.I ' get user input
  1675.                    Select Case Ucase$(Inpt) ' selection of spell cast type
  1676.                    Case "A" ' option to change spell cast type
  1677.                       ' store spell cast type flag
  1678.                       SpellRecord.SpellFlag= _
  1679.                       SpellRecord.SpellFlag Or Use.Spell.Type
  1680.                    Case "B" ' option to change spell cast type
  1681.                       ' store spell cast type flag
  1682.                       SpellRecord.SpellFlag= _
  1683.                       SpellRecord.SpellFlag Or Scroll.Spell.Type
  1684.                    Case "C" ' option to change spell cast type
  1685.                       ' store spell cast type flag
  1686.                       SpellRecord.SpellFlag= _
  1687.                       SpellRecord.SpellFlag Or Cast.Spell.Type
  1688.                    Case "N" ' option to clear spell cast types
  1689.                       ' clear spell cast type flag
  1690.                       SpellRecord.SpellFlag=False
  1691.                    Case "X" ' option to add all spell cast type
  1692.                       ' store all spell cast type flag
  1693.                       SpellRecord.SpellFlag= _
  1694.                       SpellRecord.SpellFlag Or Use.Spell.Type
  1695.                       SpellRecord.SpellFlag= _
  1696.                       SpellRecord.SpellFlag Or Scroll.Spell.Type
  1697.                       SpellRecord.SpellFlag= _
  1698.                       SpellRecord.SpellFlag Or Cast.Spell.Type
  1699.                    Case "Q" ' option to exit spell ingredient cast types menu
  1700.                       Exit Do ' exit spell ingredient cast types menu
  1701.                    End Select ' end selection of spell cast type
  1702.                 Loop ' end loop through spell cast types options menu
  1703.              Case "Q" ' option to exit spell edit menu
  1704.                 Exit Do ' exit spell edit menu
  1705.              End Select ' end selection of spell edit menu
  1706.           Loop ' end loop through spell editing
  1707.           Call Share.Record(SpellFile,Spell.Number) ' write spell record
  1708.           Outpt="Spell '"+Rtrim$(SpellRecord.SpellName)+"' changed." ' message
  1709.           Call IO.O ' send display message
  1710.        Endif ' end check spell number
  1711.     Case "L" ' option to list range of spells
  1712.        Max.Spells=Lof(SpellFile)/Len(SpellRecord) ' store length of spell file
  1713.        ' routine to get range of numbers
  1714.        Call Get.Range(Max.Spells,Spell.List1,Spell.List2)
  1715.        ' loop through range of spell numbers
  1716.        Allow.Break=True ' set allow break flag
  1717.        Break=False ' reset control-k flag
  1718.        Continue=False ' set continuous flag
  1719.        For Spell.Count=Spell.List1 To Spell.List2
  1720.           Call Read.Record(SpellFile,Spell.Count) ' read spell record
  1721.           Call Display.Spell(Spell.Count) ' routine to display spell
  1722.           If Break Then ' check control-k flag
  1723.              Exit For ' exit display loop
  1724.           Endif ' end check control-k
  1725.           Graphics.Off=False ' reset color
  1726.           If Continue=False Then ' check continuous flag
  1727.              Call More.Prompt ' routine to pause
  1728.              If No Then ' check pause response
  1729.                 Exit For ' exit spell list loop
  1730.              Endif ' end check input
  1731.          Endif ' end check continuous flag
  1732.        Next ' end loop through spell list
  1733.        Allow.Break=False ' reset allow break flag
  1734.        If Break Then ' check control-k flag
  1735.           Break=False ' reset control-k flag
  1736.           Outpt=Nul ' set output to null
  1737.           Call IO.O ' send empty return
  1738.        Endif ' end check control-k flag
  1739.     Case "Q" ' option to exit spell menu
  1740.        Exit Do ' exit spell options menu
  1741.     End Select ' end selection of spell options
  1742.  Loop ' end loop through spell options menu
  1743. End Sub ' end routine to edit spell
  1744.  
  1745.  Rem * routine to edit treasure file.
  1746.  
  1747. Sub Edit.Treasure
  1748.  On Local Error Resume Next ' local error resume
  1749.  Do ' loop through treasure edit menu
  1750.     Graphics.Off=False ' reset color
  1751.     Outpt="Treasure edit:" ' make display message
  1752.     Call IO.O ' send message
  1753.     Graphics.Off=True ' reset color
  1754.     Outpt="[A]dd" ' make display message
  1755.     Call IO.O ' send message
  1756.     Outpt="[C]hange" ' make display message
  1757.     Call IO.O ' send message
  1758.     Outpt="[L]ist" ' make display message
  1759.     Call IO.O ' send message
  1760.     Graphics.Off=False ' reset color
  1761.     Outpt="Treasure edit option(q to quit)? " ' make input prompt
  1762.     No.Input.Out="Q" ' default input
  1763.     Call IO.I ' get user input
  1764.     Select Case Ucase$(Inpt) ' selection of treasure edit option
  1765.     Case "A" ' option to add treasure
  1766.        New.Treasure=Lof(TreasureFile)/Len(TreasureRecord)+1 ' store treasure
  1767.        TreasureRecord.Keyed=False ' reset treasure record item
  1768.        TreasureRecord.Weight=False ' reset treasure record item
  1769.        TreasureRecord.Gold=False ' reset treasure record item
  1770.        TreasureRecord.Plus=False ' reset treasure record item
  1771.        TreasureRecord.Charges=False ' reset treasure record item
  1772.        TreasureRecord.Type=False ' reset treasure record item
  1773.        TreasureRecord.Loadable=False ' reset treasure record item
  1774.        TreasureRecord.Ammunition=False ' reset treasure record item
  1775.        TreasureRecord.AmmoLoads=False ' reset treasure record item
  1776.        TreasureRecord.Container=False ' reset treasure record item
  1777.        TreasureRecord.Potion=False ' reset treasure record item
  1778.        TreasureRecord.Locked=False ' reset treasure record item
  1779.        TreasureRecord.Closed=False ' reset treasure record item
  1780.        TreasureRecord.Invisible=False ' reset treasure record item
  1781.        TreasureRecord.Proficiency=False ' reset treasure record item
  1782.        TreasureRecord.TreasureName=Nul ' reset treasure record item
  1783.        TreasureRecord.ShortName=Nul ' reset treasure record item
  1784.        TreasureRecord.Spell=False ' reset treasure record item
  1785.        TreasureRecord.Scroll=False ' reset treasure record item
  1786.        TreasureRecord.RingType=False ' reset treasure record item
  1787.        TreasureRecord.RingSpell=False ' reset treasure record item
  1788.        TreasureRecord.Edible=False ' reset treasure record item
  1789.        TreasureRecord.Rustable=False ' reset treasure record item
  1790.        TreasureRecord.RustPercent=False ' reset treasure record item
  1791.        TreasureRecord.Stealable=False ' reset treasure record item
  1792.        TreasureRecord.StealPercent=False ' reset treasure record item
  1793.        TreasureRecord.Launchable=False ' reset treasure record item
  1794.        TreasureRecord.LaunchLoads=False ' reset treasure record item
  1795.        TreasureRecord.LaunchAmmo=False ' reset treasure record item
  1796.        TreasureRecord.Movable=False ' reset treasure record item
  1797.        TreasureRecord.Vehicle=False ' reset treasure record item
  1798.        TreasureRecord.VehicleHits=False ' reset treasure record item
  1799.        TreasureRecord.VehicleType=False ' reset treasure record item
  1800.        TreasureRecord.LightType=False ' reset treasure record item
  1801.        TreasureRecord.LightCharges=False ' reset treasure record item
  1802.        TreasureRecord.FuelType=False ' reset treasure record item
  1803.        TreasureRecord.FuelCharges=False ' reset treasure record item
  1804.        TreasureRecord.Permanent=False ' reset treasure record item
  1805.        TreasureRecord.Invisible=False ' reset treasure record item
  1806.        Call Share.Record(TreasureFile,New.Treasure) ' write next treasure record
  1807.     Case "C" ' option to change treasure
  1808.        Call Find.Treasure(Treasure.Number) ' routine to get treasure number
  1809.        If Treasure.Number>False Then ' check treasure number
  1810.           Do ' loop through treasure edit options
  1811.              ' routine to display treasure
  1812.              Call Display.Treasure(Treasure.Number)
  1813.              Graphics.Off=False ' reset color
  1814.              Outpt="Treasure change option(q to quit)? " ' make input prompt
  1815.              No.Input.Out="Q" ' default input
  1816.              Call IO.I ' get user input
  1817.              Select Case Ucase$(Inpt) ' selection of treasure option
  1818.              Case "A" ' option to change treasure name
  1819.                 Outpt="Treasure name(30 characters)? " ' make input prompt
  1820.                 Call IO.I ' get user input
  1821.                 TreasureRecord.TreasureName=Lcase$(Inpt) ' store treasure name
  1822.              Case "B" ' option to change treasure mnemonic
  1823.                 ' make input prompt
  1824.                 Outpt="Treasure identifier(30 characters)? "
  1825.                 Call IO.I ' get user input
  1826.                 ' store treasure mnemonic
  1827.                 TreasureRecord.ShortName=Ucase$(Inpt)
  1828.              Case "C" ' option to change treasure weight
  1829.                 Outpt="Weight(1-32767)? " ' make input prompt
  1830.                 No.Input.Out="1" ' default input
  1831.                 Call IO.I ' get user input
  1832.                 TreasureRecord.Weight=Int(Val(Inpt)) ' store treasure weight
  1833.              Case "D" ' option to change treasure gold value
  1834.                 Outpt="Gold value? " ' make input prompt
  1835.                 No.Input.Out="10" ' default input
  1836.                 Call IO.I ' get user input
  1837.                 TreasureRecord.Gold=Int(Val(Inpt)) ' store treasure gold value
  1838.              Case "E" ' option to change treasure type
  1839.                 Graphics.Off=True ' reset color
  1840.                 Outpt="[W]eapon" ' make display message
  1841.                 Call IO.O ' send message
  1842.                 Outpt="[S]hield" ' make display message
  1843.                 Call IO.O ' send message
  1844.                 Outpt="[A]rmor" ' make display message
  1845.                 Call IO.O ' send message
  1846.                 Outpt="[T]reasure" ' make display message
  1847.                 Call IO.O ' send message
  1848.                 Graphics.Off=False ' reset color
  1849.                 Outpt="Treasure type option? " ' make input prompt
  1850.                 No.Input.Out="Q" ' default input
  1851.                 Call IO.I
  1852.                 Select Case Ucase$(Inpt) ' selecction of treasure type
  1853.                 Case "W" ' option for weapon type
  1854.                    TreasureRecord.Type=False ' set treasure type
  1855.                    TreasureRecord.Permanent=False ' set treasure type
  1856.                    Outpt="Hit plus(1-32767)? " ' make input prompt
  1857.                    No.Input.Out="10" ' default input
  1858.                    Call IO.I ' get user input
  1859.                    TreasureRecord.Plus=Int(Val(Inpt)) ' store treasure plus
  1860.                 Case "S" ' option for shield type
  1861.                    TreasureRecord.Type=True ' set treasure type
  1862.                    TreasureRecord.Permanent=False ' set treasure type
  1863.                 Case "A" ' option for armor type
  1864.                    TreasureRecord.Type=1 ' set treasure type
  1865.                    TreasureRecord.Permanent=False ' set treasure type
  1866.                 Case "T" ' option for treasure type
  1867.                    TreasureRecord.Plus=False ' set treasure type
  1868.                    TreasureRecord.Charges=False ' set treasure type
  1869.                    TreasureRecord.Type=False ' set treasure type
  1870.                    TreasureRecord.Permanent=False ' set treasure type
  1871.                 End Select ' end selection of treasure type
  1872.              Case "F" ' option to change treasure hits plus
  1873.                 Outpt="Hit plus(1-32767)? " ' make input prompt
  1874.                 No.Input.Out="1" ' default input
  1875.                 Call IO.I ' get user input
  1876.                 TreasureRecord.Plus=Int(Val(Inpt)) ' store treasure hits plus
  1877.              Case "G" ' option to change treasure charges
  1878.                 Outpt="Charges(1-32767)? " ' make input prompt
  1879.                 No.Input.Out="1" ' default input
  1880.                 Call IO.I ' get user input
  1881.                 TreasureRecord.Charges=Int(Val(Inpt)) ' store treasure charges
  1882.              Case "H" ' option to change treasure weapon type
  1883.                 Graphics.Off=True ' reset color
  1884.                 Outpt="[B]lunt" ' make display message
  1885.                 Call IO.O ' send message
  1886.                 Outpt="[P]ole" ' make display message
  1887.                 Call IO.O ' send message
  1888.                 Outpt="[S]harp" ' make display message
  1889.                 Call IO.O ' send message
  1890.                 Outpt="[T]hrusting" ' make display message
  1891.                 Call IO.O ' send message
  1892.                 Graphics.Off=False ' reset color
  1893.                 Outpt="Treasure weapon class option? " ' make input prompt
  1894.                 No.Input.Out="Q" ' default input
  1895.                 Call IO.I ' get user input
  1896.                 Select Case Ucase$(Inpt) ' selection of treasure weapon type
  1897.                 Case "B" ' blunt weapon type
  1898.                    TreasureRecord.Proficiency=1 ' set weapon type
  1899.                 Case "P" ' pole weapon type
  1900.                    TreasureRecord.Proficiency=2 ' set weapon type
  1901.                 Case "S" ' sharp weapon type
  1902.                    TreasureRecord.Proficiency=3 ' set weapon type
  1903.                 Case "T" ' thrusting weapon type
  1904.                    TreasureRecord.Proficiency=4 ' set weapon type
  1905.                 End Select ' end selection of treasure weapon type
  1906.              Case "I" ' option to change permanent treasure
  1907.                 Outpt="Treasure is permanent(y/n)? " ' make input prompt
  1908.                 No.Input.Out="Y" ' default input
  1909.                 Call IO.I ' get user input
  1910.                 TreasureRecord.Permanent=Yes ' store permanent type
  1911.              Case "J" ' option to change edible treasure
  1912.                 Outpt="Treasure is edible(y/n)? " ' make input prompt
  1913.                 No.Input.Out="Y" ' default input
  1914.                 Call IO.I ' get user input
  1915.                 TreasureRecord.Edible=Yes ' store edible type
  1916.              Case "K" ' option to change treasure spell number
  1917.                 Outpt="Treasure is magical(y/n)? " ' make input prompt
  1918.                 No.Input.Out="Y" ' default input
  1919.                 Call IO.I ' get user input
  1920.                 TreasureRecord.Spell=False ' reset treasure spell number
  1921.                 If Yes Then ' check user input response
  1922.                    Call Find.Spell(Spell.Number) ' routine to get spell number
  1923.                    If Spell.Number>False Then ' check spell number range
  1924.                       ' store treasure spell number
  1925.                       TreasureRecord.Spell=Spell.Number
  1926.                    Endif ' end check spell range
  1927.                 Endif ' end check input
  1928.              Case "L" ' option to change ring treasure
  1929.                 Outpt="Treasure is ring(y/n)? " ' make input prompt
  1930.                 No.Input.Out="Y" ' default input
  1931.                 Call IO.I ' get user input
  1932.                 TreasureRecord.RingType=False ' reset treasure ring
  1933.                 TreasureRecord.RingSpell=False ' reset treasure ring
  1934.                 If Yes Then ' check user input response
  1935.                    Graphics.Off=True ' reset color
  1936.                    Outpt="[P]oison" ' make display message
  1937.                    Call IO.O ' send message
  1938.                    Outpt="[L]evel Drain" ' make display message
  1939.                    Call IO.O ' send message
  1940.                    Outpt="[S]pell" ' make display message
  1941.                    Call IO.O ' send message
  1942.                    Outpt="[G]eneric spell" ' make display message
  1943.                    Call IO.O ' send message
  1944.                    Graphics.Off=False ' reset color
  1945.                    Outpt="Treasure ring option? " ' make input prompt
  1946.                    No.Input.Out="Q" ' default input
  1947.                    Call IO.I ' get user input
  1948.                    Select Case Ucase$(Inpt) ' selection of ring type
  1949.                    Case "P" ' option for anti-poison ring
  1950.                       TreasureRecord.RingSpell=False ' store ring spell type
  1951.                       TreasureRecord.RingType=1 ' store ring type
  1952.                    Case "L" ' option for anti-leveldrain ring
  1953.                       TreasureRecord.RingSpell=False ' store ring spell type
  1954.                       TreasureRecord.RingType=2 ' store ring type
  1955.                    Case "S" ' option for number of anti-spell ring
  1956.                       ' routine to get spell number
  1957.                       Call Find.Spell(Spell.Number)
  1958.                       If Spell.Number>False Then ' check spell number
  1959.                          ' store ring spell number
  1960.                          TreasureRecord.RingSpell=Spell.Number
  1961.                          TreasureRecord.RingType=3 ' store ring type
  1962.                       Endif ' end check spell number
  1963.                    Case "G" ' option for generic anti-spell ring
  1964.                       TreasureRecord.RingSpell=True ' store ring spell type
  1965.                       TreasureRecord.RingType=3 ' store ring type
  1966.                    End Select ' end selection of ring type
  1967.                 Endif ' end check user input
  1968.              Case "M" ' option to change treasure light
  1969.                 Outpt="Treasure is a light(y/n)? " ' make input prompt
  1970.                 No.Input.Out="Y" ' default input
  1971.                 Call IO.I ' get user input
  1972.                 TreasureRecord.LightType=False ' reset treasure light type
  1973.                 TreasureRecord.LightCharges=False ' reset treasure light type
  1974.                 If Yes Then ' check user input response
  1975.                    Outpt="Light charges(1-32767)? " ' make input prompt
  1976.                    Call IO.I ' get user input
  1977.                    Light.Charges=Int(Val(Inpt)) ' convert input to integer
  1978.                    TreasureRecord.LightType=True ' set treasure light type
  1979.                    ' store treasure charges
  1980.                    TreasureRecord.LightCharges=Light.Charges
  1981.                 Endif ' end check user input
  1982.              Case "N" ' option to change treasure vehicle
  1983.                 Outpt="Treasure is a vehicle(y/n)? " ' make input prompt
  1984.                 No.Input.Out="Y" ' default input
  1985.                 Call IO.I ' get user input
  1986.                 TreasureRecord.Vehicle=False ' reset treasure vehicle
  1987.                 TreasureRecord.VehicleHits=False ' reset treasure vehicle
  1988.                 TreasureRecord.VehicleType=False ' reset treasure vehicle
  1989.                 If Yes Then ' check user input response
  1990.                    Outpt="Vehicle hits(1-32768)? " ' make input prompt
  1991.                    Call IO.I ' get user input
  1992.                    Vehicle.Hits=Int(Val(Inpt)) ' convert input to integer
  1993.                    If Vehicle.Hits>False Then ' check input range
  1994.                       TreasureRecord.Vehicle=True ' set treasure vehicle
  1995.                       ' store vehicle hits
  1996.                       TreasureRecord.VehicleHits=Vehicle.Hits
  1997.                       Graphics.Off=True ' reset color
  1998.                       Outpt="[A]ir" ' make display message
  1999.                       Call IO.O ' send message
  2000.                       Outpt="[L]and" ' make display message
  2001.                       Call IO.O ' send message
  2002.                       Outpt="[W]ater" ' make display message
  2003.                       Call IO.O ' send message
  2004.                       Outpt="[X]All terrain" ' make display message
  2005.                       Call IO.O ' send message
  2006.                       Graphics.Off=False ' reset color
  2007.                       Outpt="Vehicle type edit option? " ' make input prompt
  2008.                       No.Input.Out="Q" ' default input
  2009.                       Call IO.I ' get user input
  2010.                       Select Case Ucase$(Inpt) ' selection of vehicle type
  2011.                       Case "A" ' air vehicle type
  2012.                          TreasureRecord.VehicleType=Air ' set vehicle type
  2013.                       Case "L" ' land vehicle type
  2014.                          TreasureRecord.VehicleType=Land ' set vehicle type
  2015.                       Case "W" ' underwaater vehicle type
  2016.                          TreasureRecord.VehicleType=Water ' set vehicle type
  2017.                       Case "X" ' all terrain vehicle type
  2018.                          TreasureRecord.VehicleType=AllTerrain ' vehicle type
  2019.                       End Select ' end selection of vehicle type
  2020.                    Endif ' end check input range
  2021.                 Endif ' end check user input
  2022.              Case "O" ' option to change treasure ammunition type
  2023.                 Outpt="Treasure loads from devices(y/n)? " ' make input prompt
  2024.                 No.Input.Out="Y" ' default input
  2025.                 Call IO.I ' get user input
  2026.                 TreasureRecord.Ammunition=Yes ' set treasure ammunition type
  2027.              Case "P" ' option to change treasure loadable type
  2028.                 Outpt="Treasure is loadable device(y/n)? " ' make input prompt
  2029.                 No.Input.Out="Y" ' default input
  2030.                 Call IO.I ' get user input
  2031.                 ' reset treasure loadable type
  2032.                 TreasureRecord.Loadable=False
  2033.                 TreasureRecord.AmmoLoads=False ' reset treasure loadable type
  2034.                 If Yes Then ' check user input response
  2035.                    ' write current treasure record
  2036.                    Call Share.Record(TreasureFile,Treasure.Number)
  2037.                    Outpt="Treasure which loads this device:" ' make message
  2038.                    Call IO.O ' send message
  2039.                    ' routine to get treasure number
  2040.                    Call Find.Treasure(Treasure.Device)
  2041.                    If Treasure.Device=False Then ' check number range
  2042.                       ' read current treasure record
  2043.                       Call Read.Record(TreasureFile,Treasure.Number)
  2044.                       TreasureRecord.Loadable=False ' reset loadable type
  2045.                       TreasureRecord.AmmoLoads=False ' reset loadable type
  2046.                    Else ' check input range
  2047.                       ' read loadable treasure record
  2048.                       Call Read.Record(TreasureFile,Treasure.Device)
  2049.                       If TreasureRecord.Ammunition=False Then ' check type
  2050.                          ' read current record
  2051.                          Call Read.Record(TreasureFile,Treasure.Number)
  2052.                          Outpt="That treasure is not ammunition." ' message
  2053.                          Call IO.O ' send message
  2054.                          TreasureRecord.Loadable=False ' reset loadable type
  2055.                          TreasureRecord.AmmoLoads=False ' reset loadable type
  2056.                       Else ' check ammunition type
  2057.                          ' read current record
  2058.                          Call Read.Record(TreasureFile,Treasure.Number)
  2059.                          ' set ammunition loadable
  2060.                          TreasureRecord.Loadable=True
  2061.                          ' store ammunition number
  2062.                          TreasureRecord.AmmoLoads=Treasure.Device
  2063.                       Endif ' end check ammunition type
  2064.                    Endif ' end check user input range
  2065.                    ' write current record number
  2066.                    Call Share.Record(TreasureFile,Treasure.Number)
  2067.                 Endif ' end check user input
  2068.              Case "R" ' option to change treasure launchs
  2069.                 ' make input prompt
  2070.                 Outpt="Treasure launchs from devices(y/n)? "
  2071.                 No.Input.Out="Y" ' default input
  2072.                 Call IO.I ' get user input
  2073.                 TreasureRecord.LaunchAmmo=Yes ' store launchs type
  2074.              Case "S" ' option to change treasure launchable type
  2075.                 Outpt="Treasure is launchable device(y/n)? " ' make input
  2076.                 No.Input.Out="Y" ' default input
  2077.                 Call IO.I ' get user input
  2078.                 TreasureRecord.Launchable=False ' reset launchable type
  2079.                 TreasureRecord.LaunchLoads=False ' reset launchable type
  2080.                 If Yes Then ' check user input response
  2081.                    ' write current treasure record
  2082.                    Call Share.Record(TreasurFile,Treasure.Number)
  2083.                    Outpt="Treasure which launchs from this device:" ' message
  2084.                    Call IO.O ' send message
  2085.                    ' routine to get treasure number
  2086.                    Call Find.Treasure(Treasure.Device)
  2087.                    ' check treasure number range
  2088.                    If Treasure.Device=False Then
  2089.                       ' read current treasure record
  2090.                       Call Read.Record(TreasureFile,Treasure.Number)
  2091.                       TreasureRecord.Launchable=False ' reset launchable type
  2092.                       TreasureRecord.LaunchLoads=False ' reset launchable type
  2093.                    Else ' check number range
  2094.                       ' read lannchable treasure
  2095.                       Call Read.Record(TreasureFile,Treasure.Device)
  2096.                       If TreasureRecord.LaunchAmmo=False Then ' check launch
  2097.                          ' read current record
  2098.                          Call Read.Record(TreasureFile,Treasure.Number)
  2099.                          Outpt="That treasure does not launch from devices."
  2100.                          Call IO.O ' send error message
  2101.                          ' reset launchable type
  2102.                          TreasureRecord.Launchable=False
  2103.                          TreasureRecord.LaunchLoads=False ' reset launchable
  2104.                       Else ' check launchable type
  2105.                          ' read current record
  2106.                          Call Read.Record(TreasureFile,Treasure.Number)
  2107.                          TreasureRecord.Launchable=True ' set launchable
  2108.                          ' store launch number
  2109.                          TreasureRecord.LaunchLoads=Treasure.Device
  2110.                       Endif ' end check launchable number type
  2111.                    Endif ' end check launchable treasure number
  2112.                    Call Share.Record(TreasureFile,Treasure.Number) ' write current record
  2113.                 Endif ' end check user input
  2114.              Case "T" ' option to change movable type
  2115.                 Outpt="Launchable device can be moved(y/n)? " ' make input
  2116.                 No.Input.Out="Y" ' default input
  2117.                 Call IO.I ' get user input
  2118.                 TreasureRecord.Movable=Yes ' store movable type
  2119.              Case "U" ' option  to change coin type
  2120.                 Outpt="Treasure is coins(y/n)? " ' make input prompt
  2121.                 No.Input.Out="Y" ' default input
  2122.                 Call IO.I ' get user input
  2123.                 TreasureRecord.Coin=Yes ' store coin type
  2124.              Case "V" ' option to change potion type
  2125.                 Outpt="Treasure is potion(y/n)? " ' make input prompt
  2126.                 No.Input.Out="Y" ' default input
  2127.                 Call IO.I ' get user input
  2128.                 TreasureRecord.Potion=Yes ' store potion type
  2129.              Case "W" ' option to change scroll type
  2130.                 Outpt="Treasure is scroll(y/n)? " ' make input prompt
  2131.                 No.Input.Out="Y" ' default input
  2132.                 Call IO.I ' get user input
  2133.                 TreasureRecord.Scroll=Yes ' store scroll type
  2134.              Case "X" ' option to change invisible treasure
  2135.                 Outpt="Treasure is invisible(y/n)? " ' make input prompt
  2136.                 No.Input.Out="Y" ' default input
  2137.                 Call IO.I ' get user input
  2138.                 TreasureRecord.Invisible=Yes ' store invisible type
  2139.              Case "Y" ' option to change container type
  2140.                 Outpt="Treasure is a container(y/n)? " ' make input prompt
  2141.                 No.Input.Out="Y" ' default input
  2142.                 Call IO.I ' get user input
  2143.                 TreasureRecord.Container=Yes ' store container type
  2144.              Case "Z" ' option to change container lock
  2145.                 Outpt="Container is locked(y/n)? " ' make input prompt
  2146.                 No.Input.Out="Y" ' default input
  2147.                 Call IO.I ' get user input
  2148.                 TreasureRecord.Locked=False ' reset container lock
  2149.                 TreasureRecord.Closed=False ' reset container lock
  2150.                 If Yes Then ' check user input response
  2151.                    TreasureRecord.Locked=1 ' set container lock
  2152.                    TreasureRecord.Closed=1 ' set container lock
  2153.                 Endif ' end check user input
  2154.              Case "1" ' option to change key number
  2155.                 Outpt="Treasure key number(1-32767)? " ' make input prompt
  2156.                 No.Input.Out="1" ' default input
  2157.                 Call IO.I ' get user input
  2158.                 TreasureRecord.Keyed=Int(Val(Inpt)) ' store key number
  2159.              Case "2" ' option to change treasure fuel
  2160.                 Outpt="Treasure is fuel(y/n)? " ' make input prompt
  2161.                 No.Input.Out="Y" ' default input
  2162.                 Call IO.I ' get user input
  2163.                 TreasureRecord.FuelType=False ' reset fuel type
  2164.                 TreasureRecord.FuelCharges=False ' reset fuel type
  2165.                 If Yes Then ' check user input response
  2166.                    Outpt="Fuel charges(1-32767)? " ' make input prompt
  2167.                    Call IO.I ' get user input
  2168.                    Fuel.Charges=Int(Val(Inpt)) ' convert input to integer
  2169.                    TreasureRecord.FuelType=True ' set fuel type
  2170.                    ' store fuel charges
  2171.                    TreasureRecord.FuelCharges=Fuel.Charges
  2172.                 Endif ' end check user input
  2173.              Case "3" ' option to change rusting treasure
  2174.                 Outpt="Treasure can rust(y/n)? " ' make input prompt
  2175.                 No.Input.Out="Y" ' default input
  2176.                 Call IO.I ' get user input
  2177.                 TreasureRecord.Rustable=False ' reset rusting treasure
  2178.                 TreasureRecord.RustPercent=False ' reset rusting treasure
  2179.                 If Yes Then ' check user input response
  2180.                    Outpt="Percent chance weapon " ' make input prompt
  2181.                    Outpt=Outpt+"will rust during room rust rate(1-100)? "
  2182.                    No.Input.Out="50" ' default input
  2183.                    Call IO.I ' get user input
  2184.                    Percent=Int(Val(Inpt)) ' convert input to integer
  2185.                    If Percent>=1 And Percent<=100 Then ' check input range
  2186.                       TreasureRecord.Rustable=True ' set rusting treasure
  2187.                       ' store rusting percent
  2188.                       TreasureRecord.RustPercent=Percent
  2189.                    Else ' check range
  2190.                       TreasureRecord.Rustable=False ' reset rusting treasure
  2191.                       ' reset rusting treasure
  2192.                       TreasureRecord.RustPercent=False
  2193.                    Endif ' end check range
  2194.                 Endif ' end check user input
  2195.              Case "4" ' option to change stealable treasure
  2196.                 Outpt="Treasure can be stolen(y/n)? " ' make input prompt
  2197.                 No.Input.Out="Y" ' default input
  2198.                 Call IO.I ' get user input
  2199.                 TreasureRecord.Stealable=False ' reset steable treasure
  2200.                 TreasureRecord.StealPercent=False ' reset steable treasure
  2201.                 If Yes Then ' check user input response
  2202.                    Outpt="Percent chance treasure " ' make input prompt
  2203.                    Outpt=Outpt+"stolen during room steal rate(1-100)? "
  2204.                    No.Input.Out="50" ' default input
  2205.                    Call IO.I ' get user input
  2206.                    Percent=Int(Val(Inpt)) ' convert input to inetger
  2207.                    If Percent>=1 And Percent<=100 Then ' check input range
  2208.                       TreasureRecord.Stealable=True ' set steable treasure
  2209.                       ' set steable percent
  2210.                       TreasureRecord.StealPercent=Percent
  2211.                    Else ' check range
  2212.                       TreasureRecord.Stealable=False ' reset steable treasure
  2213.                       ' reset steable treasure
  2214.                       TreasureRecord.StealPercent=False
  2215.                    Endif ' end check range
  2216.                 Endif ' end check user input
  2217.              Case "Q" ' option to exit treasure change menu
  2218.                 Exit Do ' exit treasure change menu
  2219.              End Select ' end selection of treasure menu option
  2220.           Loop ' end loop through treasure change menu
  2221.           Call Share.Record(TreasureFile,Treasure.Number) ' write treasure record
  2222.           Outpt="Treasure '"+Rtrim$(TreasureRecord.TreasureName)+"' changed."
  2223.           Call IO.O ' send message
  2224.        Endif ' end check number range
  2225.     Case "L" ' option to list range of treasure numbers
  2226.        Max.Treasure=Lof(TreasureFile)/Len(TreasureRecord) ' store length of treasure file
  2227.        ' get range of treasure numbers
  2228.        Call Get.Range(Max.Treasure,Treasure.List1,Treasure.List2)
  2229.        ' loop through treasure numbers
  2230.        Allow.Break=True ' set allow break flag
  2231.        Break=False ' reset control-k flag
  2232.        Continue=False ' set continuous flag
  2233.        For Treasure.Count=Treasure.List1 To Treasure.List2
  2234.           Call Read.Record(TreasureFile,Treasure.Count) ' read treasure record
  2235.           Call Display.Treasure(Treasure.Count) ' routine to display treasure
  2236.           If Break Then ' check control-k flag
  2237.              Exit For ' exit display loop
  2238.           Endif ' end check control-k
  2239.           Graphics.Off=False ' reset color
  2240.           If Continue=False Then ' check continuous flag
  2241.              Call More.Prompt ' routine to pause
  2242.              If No Then ' check pause input response
  2243.                 Exit For ' exit loop through treasure numbers
  2244.              Endif ' end check user input
  2245.           Endif ' end check continuous flag
  2246.        Next ' end loop through treasure numbers
  2247.        Allow.Break=False ' reset allow break flag
  2248.        If Break Then ' check control-k flag
  2249.           Break=False ' reset control-k flag
  2250.           Outpt=Nul ' set output to null
  2251.           Call IO.O ' send empty return
  2252.        Endif ' end check control-k flag
  2253.     Case "Q" ' option to exit treasure edit menu
  2254.        Exit Do ' exit treasure edit menu
  2255.     End Select ' end selection of treasure edit option
  2256.  Loop ' end loop through treasure edit menu
  2257. End Sub ' end routine to edit treasure
  2258.  
  2259.  Rem * routine to edit user file.
  2260.  
  2261. Sub Edit.User
  2262.  On Local Error Resume Next ' local error resume
  2263.  Do ' loop through user edit option menu
  2264.     Graphics.Off=False ' reset color
  2265.     Outpt="User edit:" ' make display message
  2266.     Call IO.O ' send message
  2267.     Graphics.Off=True ' reset color
  2268.     Outpt="[A]dd" ' make display message
  2269.     Call IO.O ' send message
  2270.     Outpt="[C]hange" ' make display message
  2271.     Call IO.O ' send message
  2272.     Outpt="[L]ist" ' make display message
  2273.     Call IO.O ' send message
  2274.     Outpt="[U]pdate" ' make display message
  2275.     Call IO.O ' send message
  2276.     Graphics.Off=False ' reset color
  2277.     Outpt="User edit option(q to quit)? " ' make input prompt
  2278.     No.Input.Out="Q" ' default input
  2279.     Call IO.I ' get user input
  2280.     Select Case Ucase$(Inpt) ' selection of user edit option
  2281.     Case "A" ' option to add user record
  2282.        New.User=Lof(UserFile)/Len(UserRecord)+1 ' store last user number
  2283.        Outpt=Dead$ ' store empty codename
  2284.        Call Valid(Outpt,30) ' validate codename
  2285.        Call Encrypt(Outpt,True) ' encrypt codename
  2286.        UserRecord.CodeName=Outpt ' store empty codename
  2287.        Outpt=Deleted$ ' store empty password
  2288.        Call Valid(Outpt,20) ' validate password
  2289.        Call Encrypt(Outpt,False) ' encrypt password
  2290.        UserRecord.PassWord=Outpt ' store empty password
  2291.        Outpt=Class.Name(1) ' store defualt class name
  2292.        Call Valid(Outpt,20) ' validate class name
  2293.        Call Encrypt(Outpt,True) ' encrypt class name
  2294.        UserRecord.ClassName=Outpt ' store default class name
  2295.        UserRecord.ClassType=Fighter ' store default class type
  2296.        For Array.Index=1 To 7 ' loop through user statistics
  2297.           UserRecord.Stats(Array.Index)=12 ' store default statistic
  2298.        Next ' end loop through statistics
  2299.        For Array.Index=1 To 4 ' loop through user weapons
  2300.           UserRecord.Weapons(Array.Index)=False ' store default weapon
  2301.        Next ' end loop through weapons
  2302.        UserRecord.Weapons(3)=10 ' store default weapon
  2303.        UserRecord.Room=1 ' reset user record item
  2304.        UserRecord.Level=1 ' reset user record item
  2305.        UserRecord.Experience=64 ' reset user record item
  2306.        UserRecord.Gold=2048 ' reset user record item
  2307.        UserRecord.Borrow=False ' reset user record item
  2308.        UserRecord.NumCalls=False ' reset user record item
  2309.        UserRecord.Poison=False ' reset user record item
  2310.        UserRecord.Invisible=False ' reset user record item
  2311.        UserRecord.Race=1 ' reset user record item
  2312.        UserRecord.Proficiency=3 ' reset user record item
  2313.        UserRecord.Bank=False ' reset user record item
  2314.        UserRecord.MonstersKilled=False ' reset user record item
  2315.        UserRecord.Brief=False ' reset user record item
  2316.        UserRecord.Echo=False ' reset user echo mode
  2317.        UserRecord.Linefeeds=False ' reset user linefeed mode
  2318.        UserRecord.Linelength=80 ' reset user linelength
  2319.        UserRecord.Pagelength=24 ' reset pagelength
  2320.        UserRecord.Wordwrap=False ' reset user word wrap
  2321.        Outpt=Date$ ' store current date
  2322.        Call Valid(Outpt,10) ' validate date
  2323.        Call Encrypt(Outpt,True) ' encrypt date
  2324.        UserRecord.DateOn=Outpt ' reset user record item
  2325.        UserRecord.Align1=False ' reset user record item
  2326.        UserRecord.Align2=False ' reset user record item
  2327.        UserRecord.Flags=False ' reset user record item
  2328.        UserRecord.MaxCalls=False ' reset user record item
  2329.        UserRecord.FromHour=False ' reset user record item
  2330.        UserRecord.FromMin=False ' reset user record item
  2331.        UserRecord.ToHour=False ' reset user record item
  2332.        UserRecord.ToMin=False ' reset user record item
  2333.        ContainerRec.Closed=False ' reset user record item
  2334.        ContainerRec.ContainerName=Nul ' reset user record item
  2335.        ContainerRec.Keyed=False ' reset user record item
  2336.        ContainerRec.Locked=False ' reset user record item
  2337.        ContainerRec.ShortName=Nul ' reset user record item
  2338.        ContainerRec.Permanent=False ' reset user record item
  2339.        Call Clear.Container(0,True) ' routine to clear the container structure
  2340.        For Array.Count=1 To 3 ' loop through user containers
  2341.           ' store empty container
  2342.           UserRecord.Container(Array.Count)=ContainerRec
  2343.        Next ' end loop through containers
  2344.        Call Share.Record(UserFile,New.User) ' write user record
  2345.        Outpt="New user record added." ' make display message
  2346.        Call IO.O ' send message
  2347.        Call Read.Record(UserFile,User.Index)
  2348.     Case "C" ' option to change user
  2349.        Graphics.Off=False ' reset color
  2350.        Outpt="Codename, or number" ' make input prompt
  2351.        Outpt=Outpt+"(1-"+Mid$(Str$(Lof(UserFile)/Len(UserRecord)),2)+")? "
  2352.        No.Input.Out="1" ' default input
  2353.        Call IO.I ' get user input
  2354.        Call Parse.Num(Inpt,Parse.Value) ' routine to parse pound sign
  2355.        Inpt=Ucase$(Inpt) ' uppercase input
  2356.        Parse.Number=False ' reset counter
  2357.        User.Found=False ' reset user found flag
  2358.        Input.Length=Len(Inpt) ' store length of input
  2359.        For User.Number=1 To Lof(UserFile)/Len(UserRecord) ' loop through user file
  2360.           Call Read.Record(UserFile,User.Number) ' read user file
  2361.           Code.Name$=UserRecord.CodeName ' store user codename
  2362.           Call Decrypt(Code.Name$) ' decrypt codename
  2363.           ' compare codename to input
  2364.           If Left$(Code.Name$,Input.Length)=Inpt Then
  2365.              Parse.Number=Parse.Number+1 ' increment counter
  2366.              ' compare counters
  2367.              If Parse.Value=False Or Parse.Number=Parse.Value Then
  2368.                 User.Found=True ' set user found flag
  2369.                 Exit For ' exit user loop
  2370.              Endif ' end compare counters
  2371.           Endif ' end compare codename
  2372.        Next ' end loop through users
  2373.        If User.Found=False Then ' check user found flag
  2374.           User.Number=Int(Val(Inpt)) ' convert input to integer
  2375.           ' check bounds
  2376.           If User.Number>False And User.Number<=Lof(UserFile)/Len(UserRecord) Then
  2377.              User.Found=True ' set user found flag
  2378.           Endif ' end check file bounds
  2379.        Endif ' end check user flag
  2380.        If User.Found=False Then ' check user found flag
  2381.           Outpt="Codename not found." ' make not found message
  2382.           Call IO.O ' send message
  2383.        Else ' check user found flag
  2384.           Call Read.Record(UserFile,User.Number) ' read user record
  2385.           Code.Name$=UserRecord.CodeName ' store codename
  2386.           Call Decrypt(Code.Name$) ' decrypt codename
  2387.           If Left$(Code.Name$,9)=Deleted$ Then ' compare deleted codename
  2388.              Outpt="Deleted user record." ' make deleted user message
  2389.              Call IO.O ' send message
  2390.           Else ' compare codename
  2391.              Do ' loop through codename edit option menu
  2392.                 Call Display.User(User.Number) ' routine to display player
  2393.                 Graphics.Off=False ' reset color
  2394.                 Outpt="User change option(q to quit)? " ' make input prompt
  2395.                 No.Input.Out="Q" ' default input
  2396.                 Call IO.I ' get user input
  2397.                 Select Case Ucase$(Inpt) ' selection of player edit option
  2398.                 Case "A" ' option to change player codename
  2399.                    If Local.Mode=False Then ' check local sysop online
  2400.                       Outpt="Remote DMs cannot edit codename." ' make message
  2401.                       Call IO.O ' send error message
  2402.                    Else ' check local sysop
  2403.                       Outpt="Codename? " ' make input prompt
  2404.                       No.Input.Out=Deleted$ ' default input
  2405.                       Call IO.I ' get user input
  2406.                       Inpt=Ucase$(Inpt) ' uppercase input
  2407.                       Call Valid(Inpt,30) ' validate input
  2408.                       If Inpt=Nul Then ' check validation
  2409.                          Outpt="Illegal characters in codename." ' message
  2410.                          Call IO.O ' send error message
  2411.                       Else ' check validation
  2412.                          Call Encrypt(Inpt,True) ' encrypt codename
  2413.                          UserRecord.CodeName=Inpt ' store codename
  2414.                       Endif ' end check validation
  2415.                    Endif ' end check local sysop online
  2416.                 Case "B" ' option to change player password
  2417.                    If Local.Mode=False Then ' check local sysop online
  2418.                       Outpt="Remote DMs cannot edit password." ' make message
  2419.                       Call IO.O ' send error message
  2420.                    Else ' check local sysop
  2421.                       Inpt=UserRecord.PassWord ' store password
  2422.                       Call Decrypt(Inpt) ' decrypt password
  2423.                       If Inpt=Nul Then ' check decryption byte checksum
  2424.                          Outpt="This password has a checksum error." ' message
  2425.                          Call IO.O ' send error message
  2426.                       Endif ' end check byte checksum
  2427.                       Outpt="Password? " ' make input prompt
  2428.                       No.Input.Out=Deleted$ ' default input
  2429.                       Call IO.I ' get user input
  2430.                       Inpt=Ucase$(Inpt) ' uppercase input
  2431.                       Call Valid(Inpt,20) ' validate input
  2432.                       If Inpt=Nul Then ' check validation
  2433.                          Outpt="Illegal characters in password." ' message
  2434.                          Call IO.O ' send error message
  2435.                       Else ' check validation
  2436.                          Call Encrypt(Inpt,False) ' encrypt password
  2437.                          UserRecord.PassWord=Inpt ' store password
  2438.                       Endif ' end check validation
  2439.                    Endif ' end check local sysop online
  2440.                 Case "C" ' option to change player level
  2441.                    Outpt="Level(1-32767)? " ' make input prompt
  2442.                    No.Input.Out="1" ' default input
  2443.                    Call IO.I ' get user input
  2444.                    Level#=Int(Val(Inpt)) ' convert input to double
  2445.                    If Level#>False And Level#<=MaxInt Then ' compare input range
  2446.                       New.Level=Cint(Level#) ' convert input to integer
  2447.                       UserRecord.Level=New.Level ' store player level
  2448.                    Endif ' end compare input range
  2449.                 Case "D" ' option to change player class number
  2450.                    Graphics.Off=True ' reset color
  2451.                    If Local.Mode=False Then ' check local sysop online
  2452.                       Max.Class=8 ' store maximum class number
  2453.                    Else ' check local sysop
  2454.                       Max.Class=10 ' store maximum class number
  2455.                    Endif ' end check local sysop online
  2456.                    ' loop through class number range
  2457.                    For Class.Count=1 To Max.Class
  2458.                       ' make class display message
  2459.                       Outpt="["+Mid$(Str$(Class.Count),2)+"]"+ _
  2460.                       Rtrim$(Class.Name(Class.Count))
  2461.                       Call IO.O ' send message
  2462.                    Next ' end loop through class numbers
  2463.                    Outpt="Class option" ' make range prompt
  2464.                    ' return number from range
  2465.                    Call Get.Range2(1,Max.Class,Class.Number)
  2466.                    ' store player class number
  2467.                    UserRecord.ClassType=Class.Number
  2468.                 Case "E" ' option to change player weapon type
  2469.                    Graphics.Off=True ' reset color
  2470.                    For Weapon.COunt=1 To 4 ' loop through weapon type names
  2471.                       ' make weapon type message
  2472.                       Outpt="["+Mid$(Str$(Weapon.Count),2)+"]"+ _
  2473.                       Rtrim$(Weapon.Type.Name(Weapon.Count))
  2474.                       Call IO.O ' send message
  2475.                    Next ' end loop through weapon type names
  2476.                    Graphics.Off=False ' reset color
  2477.                    Outpt="Weapon proficiency" ' make range prompt
  2478.                    Call Get.Range2(1,4,Weapon.Value) ' get number from range
  2479.                    ' store weapon type number
  2480.                    UserRecord.Proficiency=Weapon.Value
  2481.                 Case "F" ' option to change weapon proficiency number
  2482.                    Outpt="Blunt weapon proficiency%(1-100)? " ' input prompt
  2483.                    No.Input.Out="10" '  default input
  2484.                    Call IO.I ' get user input
  2485.                    UserRecord.Weapons(1)=Int(Val(Inpt)) ' store weapon value
  2486.                 Case "G" ' option to change weapon proficiency number
  2487.                    Outpt="Pole weapon proficiency%(1-100)? " ' input prompt
  2488.                    No.Input.Out="10" '  default input
  2489.                    Call IO.I ' get user input
  2490.                    UserRecord.Weapons(2)=Int(Val(Inpt)) ' store weapon value
  2491.                 Case "H" ' option to change weapon proficiency number
  2492.                    Outpt="Sharp weapon proficiency%(1-100)? " ' input prompt
  2493.                    No.Input.Out="10" '  default input
  2494.                    Call IO.I ' get user input
  2495.                    UserRecord.Weapons(3)=Int(Val(Inpt)) ' store weapon value
  2496.                 Case "I" ' option to change weapon proficiency number
  2497.                    ' input prompt
  2498.                    Outpt="Thrusting weapon proficiency%(1-100)? "
  2499.                    No.Input.Out="10" '  default input
  2500.                    Call IO.I ' get user input
  2501.                    UserRecord.Weapons(4)=Int(Val(Inpt)) ' store weapon value
  2502.                 Case "J" ' option to change player class name
  2503.                    Outpt="Classname? " ' make input prompt
  2504.                    No.Input.Out=Deleted$ ' default input
  2505.                    Call IO.I ' get user input
  2506.                    Call Valid(Inpt,20) ' validate input
  2507.                    If Inpt=Nul Then ' check validation
  2508.                       Outpt="Illegal characters in classname." ' make message
  2509.                       Call IO.O ' send error message
  2510.                    Else ' end check validation
  2511.                       Call Encrypt(Inpt,True) ' encrypt clsss name
  2512.                       UserRecord.ClassName=Inpt ' store class name
  2513.                    Endif ' end check validation
  2514.                 Case "K" ' option to change player statistic
  2515.                    Outpt="Strength? " ' make input prompt
  2516.                    No.Input.Out="12" ' default input
  2517.                    Call IO.I ' get user input
  2518.                    UserRecord.Stats(1)=Int(Val(Inpt)) ' store player staistic
  2519.                 Case "L" ' option to change player statistic
  2520.                    Outpt="Intelligence? " ' make input prompt
  2521.                    No.Input.Out="12" ' default input
  2522.                    Call IO.I ' get user input
  2523.                    UserRecord.Stats(2)=Int(Val(Inpt)) ' store player staistic
  2524.                 Case "M" ' option to change player statistic
  2525.                    Outpt="Wisdom? " ' make input prompt
  2526.                    No.Input.Out="12" ' default input
  2527.                    Call IO.I ' get user input
  2528.                    UserRecord.Stats(3)=Int(Val(Inpt)) ' store player staistic
  2529.                 Case "N" ' option to change player statistic
  2530.                    Outpt="Dexterity? " ' make input prompt
  2531.                    No.Input.Out="12" ' default input
  2532.                    Call IO.I ' get user input
  2533.                    UserRecord.Stats(4)=Int(Val(Inpt)) ' store player staistic
  2534.                 Case "O" ' option to change player statistic
  2535.                    Outpt="Constitution? " ' make input prompt
  2536.                    No.Input.Out="12" ' default input
  2537.                    Call IO.I ' get user input
  2538.                    UserRecord.Stats(5)=Int(Val(Inpt)) ' store player staistic
  2539.                 Case "P" ' option to change player statistic
  2540.                    Outpt="Piety? " ' make input prompt
  2541.                    No.Input.Out="12" ' default input
  2542.                    Call IO.I ' get user input
  2543.                    UserRecord.Stats(6)=Int(Val(Inpt)) ' store player staistic
  2544.                 Case "R" ' option to change player statistic
  2545.                    Outpt="Charisma? " ' make input prompt
  2546.                    No.Input.Out="12" ' default input
  2547.                    Call IO.I ' get user input
  2548.                    UserRecord.Stats(7)=Int(Val(Inpt)) ' store player staistic
  2549.                 Case "S" ' option to change player experience
  2550.                    Outpt="Experience? " ' make input prompt
  2551.                    No.Input.Out="128" ' default input
  2552.                    Call IO.I ' get user input
  2553.                    UserRecord.Experience=Cdbl(Int(Val(Inpt)))
  2554.                 Case "T" ' option to change player gold hoard
  2555.                    Outpt="Gold? " ' make input prompt
  2556.                    No.Input.Out="256" ' default input
  2557.                    Call IO.I ' get user input
  2558.                    UserRecord.Gold=Cdbl(Int(Val(Inpt))) ' store player gold
  2559.                 Case "U" ' option to change player room number
  2560.                    Outpt="Room number? " ' make input prompt
  2561.                    No.Input.Out="1" ' default input
  2562.                    Call IO.I ' get user input
  2563.                    UserRecord.Room=Int(Val(Inpt)) ' store room number
  2564.                 Case "V" ' option to change player calls
  2565.                    Graphics.Off=True ' reset color
  2566.                    Outpt="Calls made today? " ' make input prompt
  2567.                    No.Input.Out="0" ' default input
  2568.                    Call IO.I ' get user input
  2569.                    UserRecord.NumCalls=Int(Val(Inpt)) ' store player calls
  2570.                    Outpt="Maximum calls per day? " ' make input prompt
  2571.                    No.Input.Out="5" ' default input
  2572.                    Call IO.I ' get user input
  2573.                    UserRecord.MaxCalls=Int(Val(Inpt)) ' store plater calls
  2574.                    Outpt="Timeon restriction(from hour: form HH)? " ' prompt
  2575.                    No.Input.Out="00" ' default input
  2576.                    Call IO.I ' get user input
  2577.                    UserRecord.FromHour=Int(Val(Inpt)) ' store player time
  2578.                    Outpt="Timeon restriction(from minute: form MM)? " ' prompt
  2579.                    No.Input.Out="00" ' default input
  2580.                    Call IO.I ' get user input
  2581.                    UserRecord.FromMin=Int(Val(Inpt)) ' store player time
  2582.                    Outpt="Timeon restriction(to hour: form HH)? " ' prompt
  2583.                    No.Input.Out="00" ' default input
  2584.                    Call IO.I ' get user input
  2585.                    UserRecord.ToHour=Int(Val(Inpt)) ' store player time
  2586.                    Outpt="Timeon restriction(to minute: form MM)? " ' prompt
  2587.                    No.Input.Out="00" ' default input
  2588.                    Call IO.I ' get user input
  2589.                    UserRecord.ToMin=Int(Val(Inpt)) ' store player time
  2590.                    Graphics.Off=False ' reset color
  2591.                 Case "W" ' option to edit player inventory
  2592.                    Do ' loop through inventory edit menu
  2593.                       Graphics.Off=True ' reset color
  2594.                       Outpt="[O]bjects" ' make display message
  2595.                       Call IO.O ' send message
  2596.                       Outpt="[T]reasure" ' make display message
  2597.                       Call IO.O ' send message
  2598.                       Graphics.Off=False ' reset color
  2599.                       Outpt="Inventory edit option(q to quit)? " ' prompt
  2600.                       No.Input.Out="Q" ' default input
  2601.                       Call IO.I ' get user input
  2602.                       Select Case Ucase$(Inpt) ' selection of inventory option
  2603.                       Case "O" ' option to edit player object inventory
  2604.                          Do ' loop through object inventory edit menu
  2605.                             Graphics.Off=True ' reset color
  2606.                             ' loop through player objects
  2607.                             For Object.Index=1 To 5
  2608.                                ' store object
  2609.                                Object.Number=UserRecord.Object(Object.Index)
  2610.                                ' check object number
  2611.                                If Object.Number>False And _
  2612.                                Object.Number<=Lof(ObjectFile)/Len(ObjectRecord) Then
  2613.                                   ' read object
  2614.                                   Call Read.Record(ObjectFile,Object.Number)
  2615.                                   ' store
  2616.                                   Object.Name$=ObjectRecord.ObjectName
  2617.                                   ' lowercase name
  2618.                                   Object.Name$=Lcase$(Object.Name$)
  2619.                                   Outpt="["+Mid$(Str$(Object.Index),2)+"]"+ _
  2620.                                   Object.Name$
  2621.                                   Call IO.O ' send object  name message
  2622.                                Endif ' end check object number range
  2623.                             Next ' end loop through player object inventory
  2624.                             Graphics.Off=False ' reset color
  2625.                             Outpt="Object inventory options:" ' make message
  2626.                             Call IO.O ' send message
  2627.                             Graphics.Off=True ' reset color
  2628.                             Outpt="[A]dd" ' make display message
  2629.                             Call IO.O ' send message
  2630.                             Outpt="[D]elete" ' make display message
  2631.                             Call IO.O ' send message
  2632.                             Graphics.Off=False ' reset color
  2633.                             Outpt="Object inventory edit option(q to quit)? "
  2634.                             No.Input.Out="Q" ' default input
  2635.                             Call IO.I ' get user input
  2636.                             ' selection of object edit
  2637.                             Select Case Ucase$(Inpt)
  2638.                             Case "A" ' option to add object
  2639.                                Object.Added=False ' object added flag
  2640.                                ' routine to get object
  2641.                                Call Find.Objects(Object.Number)
  2642.                                ' check object number
  2643.                                If Object.Number>False Then
  2644.                                   Call Add.Object(Object.Number, _
  2645.                                   False,Object.Added)
  2646.                                Endif ' end check object number range
  2647.                                If Object.Added Then ' check object added flag
  2648.                                   Outpt="Object added to inventory." ' message
  2649.                                Else ' check added flag
  2650.                                   Outpt="Object not added to inventory."
  2651.                                Endif ' end check object added flag
  2652.                                Call IO.O ' send message
  2653.                             Case "D" ' option to delete object from inventory
  2654.                                Object.Deleted=False ' object deleted flag
  2655.                                Outpt="Number to delete" ' range prompt
  2656.                                Call Get.Range2(1,5,Object.Number) ' get number
  2657.                                If UserRecord.Object(Object.Number)>False Then
  2658.                                   Call Discard.Inventory.Object(Object.Number)
  2659.                                   ' set object deleted flag
  2660.                                   Object.Deleted=True
  2661.                                Endif ' end check object number range
  2662.                                ' check object deleted flag
  2663.                                If Object.Deleted Then
  2664.                                   Outpt="Object deleted from inventory"
  2665.                                Else ' check object deleted flag
  2666.                                   Outpt="Object not deleted from inventory."
  2667.                                Endif ' end check object deleted flag
  2668.                                Call IO.O ' send message
  2669.                             Case "Q" ' option to exit inventory object menu
  2670.                                Exit Do ' exit inventory object edit menu
  2671.                             End Select ' end selection of object edit option
  2672.                          Loop ' end loop through player object inventory menu
  2673.                       Case "T" ' option to edit player treasure inventory
  2674.                          Do ' loop through treasure inventory edit menu
  2675.                             Graphics.Off=True ' reset color
  2676.                             ' loop through inventory
  2677.                             For Treasure.Index=1 To 20
  2678.                                ' store number
  2679.                                Treasure.Number=UserRecord.Inv(Treasure.Index)
  2680.                                ' check number
  2681.                                If Treasure.Number>False And _
  2682.                                Treasure.Number<=Lof(TreasureFile)/Len(TreasureRecord) Then
  2683.                                   ' get name
  2684.                                   Call Read.Record(TreasureFile,Treasure.Number)
  2685.                                   Treasure.Name$=TreasureRecord.TreasureName
  2686.                                   ' lowercase name
  2687.                                   Treasure.Name$=Lcase$(Treasure.Name$)
  2688.                                   Outpt="["+Mid$(Str$(Treasure.Index),2)+"]"+ _
  2689.                                   Treasure.Name$
  2690.                                   Call IO.O ' send message
  2691.                                Endif ' end check treasure number range
  2692.                             Next ' end loop through inventory treasure
  2693.                             Graphics.Off=False ' reset color
  2694.                             Outpt="Treasure inventory options:" ' message
  2695.                             Call IO.O ' send message
  2696.                             Graphics.Off=True ' reset color
  2697.                             Outpt="[A]dd" ' make message
  2698.                             Call IO.O ' send message
  2699.                             Outpt="[D]elete" ' make message
  2700.                             Call IO.O ' send message
  2701.                             Graphics.Off=False ' reset color
  2702.                             Outpt="Treasure inventory edit option(q to quit)? "
  2703.                             No.Input.Out="Q" ' default input
  2704.                             Call IO.I ' get user input
  2705.                             Select Case Ucase$(Inpt) ' selection of option
  2706.                             Case "A" ' option to add inventory treasure
  2707.                                Treasure.Added=False ' treasure added flag
  2708.                                ' routine to get number
  2709.                                Call Find.Treasure(Treasure.Number)
  2710.                                If Treasure.Number>False Then ' check number
  2711.                                   Call TreasureCharges(Treasure.Charges)
  2712.                                   Call Add.Inventory(Treasure.Number, _
  2713.                                   Treasure.Charges,Treasure.Added)
  2714.                                Endif ' end check treasure number
  2715.                                ' check treasure added flag
  2716.                                If Treasure.Added Then
  2717.                                   Outpt="Treasure added to inventory."
  2718.                                   Call IO.O ' send message
  2719.                                Endif ' end check added flag
  2720.                             Case "D" ' option to delete treasure number
  2721.                                ' reset treasure deleted flag
  2722.                                Treasure.Deleted=False
  2723.                                Outpt="Number to delete" ' range prompt
  2724.                                ' get range
  2725.                                Call Get.Range2(1,20,Treasure.Number)
  2726.                                ' check
  2727.                                If UserRecord.Inv(Treasure.Number)>False Then
  2728.                                   If User.Number=User.Index Then
  2729.                                      Call Discard.Inventory(Treasure.Number, _
  2730.                                      True)
  2731.                                   Else
  2732.                                      ' loop through player inventory
  2733.                                      For Array.Index=Treasure.Number To 19
  2734.                                         ' pack item removed
  2735.                                         UserRecord.Inv(Array.Index)= _
  2736.                                         UserRecord.Inv(Array.Index+1)
  2737.                                         ' pack item removed
  2738.                                         UserRecord.Charges(Array.Index)= _
  2739.                                         UserRecord.Charges(Array.Index+1)
  2740.                                      Next ' end loop through player inventory
  2741.                                      ' clear last item
  2742.                                      UserRecord.Inv(20)=False
  2743.                                      ' clear last item
  2744.                                      UserRecord.Charges(20)=False
  2745.                                   Endif
  2746.                                   Outpt="Treasure deleted from inventory"
  2747.                                   Call IO.O ' send message
  2748.                                Else ' end check number range
  2749.                                   Outpt="Treasure not deleted from inventory."
  2750.                                   Call IO.O ' send message
  2751.                                Endif ' end check deleted flag
  2752.                             Case "Q" ' option to exit inventory treasure edit
  2753.                                Exit Do ' exit inventory treasure edit menu
  2754.                             End Select ' end selection of treasure edit option
  2755.                          Loop ' end loop through treasure edit menu
  2756.                       Case "Q" ' option to exit player inventory edit menu
  2757.                          Exit Do ' exit player inventory edit menu
  2758.                       End Select ' end selection of inventory menu option
  2759.                    Loop ' end loop through player inventory edit menu
  2760.                 Case "X" ' option to change player special class
  2761.                    Do ' loop through special class edit menu
  2762.                       Graphics.Off=True ' reset color
  2763.                       Outpt="[A]Town Mayor" ' make display message
  2764.                       Call IO.O ' send message
  2765.                       Outpt="[B]Governor" ' make display message
  2766.                       Call IO.O ' send message
  2767.                       Outpt="[C]Guild Master" ' make display message
  2768.                       Call IO.O ' send message
  2769.                       Outpt="[D]Sysop" ' make display message
  2770.                       Call IO.O ' send message
  2771.                       Outpt="[E]None" ' make display message
  2772.                       Call IO.O ' send message
  2773.                       Graphics.Off=False ' reset color
  2774.                       Outpt="Special class option(q to quit)? " ' input prompt
  2775.                       No.Input.Out="Q" ' default input
  2776.                       Call IO.I ' get user input
  2777.                       Select Case Ucase$(Inpt) ' selection of special class
  2778.                       Case "A" ' option for special class
  2779.                          UserRecord.Flags=UserRecord.Flags Or Special.Char1
  2780.                          Outpt="Player is now town mayor." ' make message
  2781.                          Call IO.O ' send message
  2782.                       Case "B" ' option for special class
  2783.                          UserRecord.Flags=UserRecord.Flags Or Special.Char2
  2784.                          Outpt="Player is now governor." ' make message
  2785.                          Call IO.O ' send message
  2786.                       Case "C" ' option for special class
  2787.                          UserRecord.Flags=UserRecord.Flags Or Special.Char3
  2788.                          Outpt="Player is now guild master." ' make message
  2789.                          Call IO.O ' send message
  2790.                       Case "D" ' option for special class
  2791.                          UserRecord.Flags=UserRecord.Flags Or Special.Char4
  2792.                          Outpt="Player is now sysop." ' make message
  2793.                          Call IO.O ' send message
  2794.                       Case "E" ' option to clear special class
  2795.                          UserRecord.Flags=UserRecord.Flags And Not _
  2796.                          Special.Char1
  2797.                          UserRecord.Flags=UserRecord.Flags And Not _
  2798.                          Special.Char2
  2799.                          UserRecord.Flags=UserRecord.Flags And Not _
  2800.                          Special.Char3
  2801.                          UserRecord.Flags=UserRecord.Flags And Not _
  2802.                          Special.Char4
  2803.                          Outpt="Player is cleared of special character class."
  2804.                          Call IO.O ' send message
  2805.                       Case "Q" ' option to exit special class menu
  2806.                          Exit Do ' exit special class menu
  2807.                       End Select ' end selection of special class option
  2808.                    Loop ' end loop through special class option menu
  2809.                 Case "!" ' option to delete player
  2810.                    Outpt="Are you sure you want to delete(y/n)? " ' make input prompt
  2811.                    No.Input.Out="N" ' default input
  2812.                    Call IO.I ' get user input
  2813.                    If Yes Then ' check input response
  2814.                       Call Delete.User ' routine to clear user record
  2815.                       Outpt="User deleted." ' make deleted message
  2816.                       Call IO.O ' send message
  2817.                       Exit Do ' exit player edit menu
  2818.                    Endif ' end check input response
  2819.                 Case "Q" ' option to exit player edit menu
  2820.                    Exit Do ' exit player edit menu
  2821.                 End Select ' end selection of player edit option
  2822.              Loop ' end loop through player edit menu
  2823.              Call Share.Record(UserFile,User.Number) ' write user record
  2824.           Endif ' end check user deleted
  2825.        Endif ' end check user found flag
  2826.        Call Read.Record(UserFile,User.Index)
  2827.     Case "L" ' option to list user file
  2828.        Do ' loop through user file list menu
  2829.           Graphics.Off=True ' reset color
  2830.           Outpt="[L]ist" ' make display message
  2831.           Call IO.O ' send message
  2832.           Outpt="[T]op ten" ' make display message
  2833.           Call IO.O ' send message
  2834.           Outpt="[U]sers" ' make display message
  2835.           Call IO.O ' send message
  2836.           Graphics.Off=False ' reset color
  2837.           Outpt="User list option(q to quit)? " ' make input prompt
  2838.           No.Input.Out="Q" ' default input
  2839.           Call IO.I ' get user input
  2840.           Select Case Ucase$(Inpt) ' selection of user list option
  2841.           Case "L" ' option to list range of user numbers
  2842.              Outpt="Enter range:" ' make display message
  2843.              Call IO.O ' send message
  2844.              Max.Users=Lof(UserFile)/Len(UserRecord) ' store length of file
  2845.              ' routine to get range of numbers
  2846.              Call Get.Range(Max.Users,User.List1,User.List2)
  2847.              ' loop through range of user numbers
  2848.              Allow.Break=True ' set allow break flag
  2849.              Break=False ' reset control-k flag
  2850.              Continue=False ' set continuous flag
  2851.              For User.Count=User.List1 To User.List2
  2852.                 Call Read.Record(UserFile,User.Count) ' read user file
  2853.                 Code.Name$=UserRecord.CodeName ' store user codename
  2854.                 Call Decrypt(Code.Name$) ' decrypt codename
  2855.                 If Left$(Code.Name$,9)<>Deleted$ Then ' check deleted codename
  2856.                    Call Display.User(User.Count) ' routine to display user
  2857.                    If Break Then ' check control-k flag
  2858.                       Exit For ' exit display loop
  2859.                    Endif ' end check control-k
  2860.                    If Continue=False Then ' check continuous flag
  2861.                       Call More.Prompt ' routine to pause
  2862.                       If No Then ' check input pause response
  2863.                          Exit For ' exit user list loop
  2864.                       Endif ' end check user input
  2865.                    Endif ' end check continuous flag
  2866.                 Endif '  end check deleted codename
  2867.              Next ' end loop through user numbers
  2868.              Allow.Break=False ' reset allow break flag
  2869.              If Break Then ' check control-k flag
  2870.                 Break=False ' reset control-k flag
  2871.                 Outpt=Nul ' set output to null
  2872.                 Call IO.O ' send empty return
  2873.              Endif ' end check control-k flag
  2874.           Case "T" ' option to list top ten report
  2875.              Call Top.Ten ' routine for top ten
  2876.           Case "U" ' option to list user report
  2877.              Call User.List ' routine for user report
  2878.           Case "Q" ' option to exit user list menu
  2879.              Exit Do ' exit user list menu
  2880.           End Select ' end selection of user list option
  2881.        Loop ' end loop through user list menu
  2882.        Call Read.Record(UserFile,User.Index)
  2883.     Case "U" ' option to update user file
  2884.        Outpt="Delete "+Dead$+" users(y/n)? " ' make input prompt
  2885.        No.Input.Out="Y" ' default input
  2886.        Call IO.I ' get user input
  2887.        Delete.Dead.Users=Yes ' store input response
  2888.        Outpt="Delete users before date(y/n)? " ' make input prompt
  2889.        No.Input.Out="N" ' default input
  2890.        Call IO.I ' get user input
  2891.        Delete.By.Date=Yes ' store user input response
  2892.        If Delete.By.Date Then ' check date update response
  2893.           Outpt="Enter date:" ' make input prompt
  2894.           No.Input.Out="01-01-1980" ' default input
  2895.           Call IO.I ' get user input
  2896.           ' convert input to serial date format
  2897.           Delete.Date#=Int(DateValue(Inpt))
  2898.        Endif ' end check date update response
  2899.        Graphics.Off=False ' reset color
  2900.        Outpt="Updating userfile.." ' make display message
  2901.        Call IO.O ' send message
  2902.        For User.Count=1 To Lof(UserFile)/Len(UserRecord) ' loop through users
  2903.           Call Read.Record(UserFile,User.Count) ' read next user file record
  2904.           Code.Name$=UserRecord.CodeName ' store user codename
  2905.           Call Decrypt(Code.Name$) ' decrypt codename
  2906.           Delete.User.Flag=False ' delete user flag
  2907.           If Delete.Dead.Users Then ' check update flag
  2908.              If UserRecord.Level=False Then ' compare player level
  2909.                 Delete.User.Flag=True ' set delete user flag
  2910.              Endif ' end compare player level
  2911.              If Left$(Code.Name$,Len(Dead$))=Dead$ Then ' compare dead player
  2912.                 Delete.User.Flag=True ' set delete user flag
  2913.              Endif ' end compare dead player
  2914.           Endif ' end check update flag
  2915.           If Delete.By.date Then ' check date update flag
  2916.              Inpt=UserRecord.DateOn ' store player last date online
  2917.              Call Decrypt(Inpt) ' decrypt date
  2918.              ' calculate date differences
  2919.              If Int(DateValue(Inpt))<Delete.Date# Then
  2920.                 Delete.User.Flag=True ' set delete user flag
  2921.              Endif ' end calculate dates
  2922.           Endif ' end check date update flag
  2923.           If Delete.User.Flag Then ' check delete user flag
  2924.              If User.Count<>User.Index Then ' check to current user
  2925.                 Call Delete.User ' routine to clear user record
  2926.                 Call Share.Record(UserFile,User.Count) ' write user record
  2927.              Endif ' end check current user
  2928.           Endif ' end check delete user flag
  2929.        Next ' end loop through user file
  2930.        Call Read.Record(UserFile,User.Index) ' restore current user
  2931.     Case "Q" ' option to exit user edit menu
  2932.        Exit Do ' exit user edit menu
  2933.     End Select ' end selection of user edit option
  2934.  Loop ' end loop through user edit menu options
  2935. End Sub ' end routine to edit user file
  2936.