 REM File: Dndinit6 for Dndbbs Version v5.0a Release r2.0 Tweak t6.0a
 REM $INCLUDE: 'DNDINIT.INC'

SUB WRITE.TREASURE.FILE3
 RESTORE Data7
 CLOSE #1
 OPEN Treasure.FileName FOR RANDOM AS #1 LEN = LEN(TreasureRecord)
 FOR TempX = 201 TO 216
    READ TreasureRecord.TreasureName
    READ TreasureRecord.ShortName
    READ TreasureRecord.Weight
    READ TreasureRecord.Gold
    READ TreasureRecord.Spell
    READ TreasureRecord.Plus
    READ TreasureRecord.Coin
    READ TreasureRecord.Keyed
    READ TreasureRecord.Scroll
    READ TreasureRecord.Charges
    READ TreasureRecord.Potion
    Read ArmorType
    Read ShieldType
    Read WeaponType
    READ TreasureRecord.Loadable
    READ TreasureRecord.Ammunition
    READ TreasureRecord.AmmoLoads
    READ TreasureRecord.Invisible
    READ TreasureRecord.Proficiency
    READ TreasureRecord.RingType
    TreasureRecord.WeaponNumber=False
    If ArmorType Then
       TreasureRecord.WeaponNumber=1
    Endif
    If ShieldType Then
       TreasureRecord.WeaponNumber=5
    Endif
    If WeaponType Then
       TreasureRecord.WeaponNumber=7
       If TreasureRecord.Proficiency=False Then
          TreasureRecord.Proficiency=3
       Endif
    Endif
    If TreasureRecord.RingType Then
       TreasureRecord.WeaponNumber=4
    Endif
    READ TreasureRecord.RingSpell
    READ TreasureRecord.Edible
    READ TreasureRecord.Rustable
    READ TreasureRecord.RustPercent
    READ TreasureRecord.Stealable
    READ TreasureRecord.StealPercent
    READ TreasureRecord.Launchable
    READ TreasureRecord.LaunchLoads
    READ TreasureRecord.LaunchAmmo
    READ TreasureRecord.Movable
    READ TreasureRecord.Vehicle
    READ TreasureRecord.VehicleType
    READ TreasureRecord.LightType
    READ TreasureRecord.LightCharges
    READ TreasureRecord.FuelType
    READ TreasureRecord.FuelCharges
    TreasureRecord.Permanent=False
    TreasureRecord.StaysInRoom=False
    TreasureRecord.Occupants=False
    If TempX>214 Then
       TreasureRecord.Permanent=True
    Endif
    TreasureRecord.Container=False
    TreasureRecord.ContainerMax=False
    TreasureRecord.ContainerPrefix=Nul
    TreasureRecord.ContainerDisappears=False
    TreasureRecord.ContainerSelfImplodes=False
    TreasureRecord.ContainerSize=False
    TreasureRecord.ContainerMaterial=False
    TreasureRecord.PotionType=False
    TreasureRecord.NewPotion=False
    TreasureRecord.MixPotion=False
    TreasureRecord.TwoHanded=False
    TreasureRecord.Locked=False
    TreasureRecord.RequireStr=False
    TreasureRecord.RequireDex=False
    TreasureRecord.RequireInt=False
    TreasureRecord.Prefix1=""
    Select Case TreasureRecord.WeaponNumber
    Case 0 ' treasure
       If TreasureRecord.Container Then
          TreasureRecord.Prefix1=Strng3+"FE"
       Else
          If TreasureRecord.Spell Then
             TreasureRecord.Prefix1=Strng3+"F5"
          Else
             If TreasureRecord.Coin Then
                TreasureRecord.Prefix1=Strng3+"F5"
             Else
                If TreasureRecord.Vehicle Then
                   TreasureRecord.Prefix1=Strng3+"F6"
                Endif
                If TreasureRecord.Loadable Then
                   TreasureRecord.Prefix1=Strng3+"F6"
                Endif
                If TreasureRecord.Ammunition Then
                   TreasureRecord.Prefix1=Strng3+"F6"
                Endif
                If TreasureRecord.AmmoLoads Then
                   TreasureRecord.Prefix1=Strng3+"F6"
                Endif
                If TreasureRecord.Launchable Then
                   TreasureRecord.Prefix1=Strng3+"F6"
                Endif
                If TreasureRecord.LaunchLoads Then
                   TreasureRecord.Prefix1=Strng3+"F6"
                Endif
                If TreasureRecord.LaunchAmmo Then
                   TreasureRecord.Prefix1=Strng3+"F6"
                Endif
             Endif
          Endif
       Endif
    Case 1 ' armor
       TreasureRecord.Prefix1=Strng3+"F9"
    Case 2 ' boots
       TreasureRecord.Prefix1=Strng3+"F1"
    Case 3 ' helmet
       TreasureRecord.Prefix1=Strng3+"F2"
    Case 4 ' ring(left)
       TreasureRecord.Prefix1=Strng3+"F3"
    Case 5 ' shield
       TreasureRecord.Prefix1=Strng3+"FA"
    Case 6 ' bracers
       TreasureRecord.Prefix1=Strng3+"F4"
    Case 7 ' weapon
       TreasureRecord.Prefix1=Strng3+"FB"
    Case 8 ' cloak
       TreasureRecord.Prefix1=Strng3+"FC"
    Case 9 ' ring(right)
       TreasureRecord.Prefix1=Strng3+"F3"
    Case 10 ' amulet
       TreasureRecord.Prefix1=Strng3+"FD"
    Case Else
       TreasureRecord.Prefix1=Strng3+"FF"
    End Select
    PUT 1, TempX, TreasureRecord
 NEXT
END SUB

Data7:
Data "some iron armor","ARMOR",10,1000,0,50,0,0,0,50,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data "a large plate shield","SHIELD",9,1000,0,10,0,0,0,100,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data "an ivory horn","HORN",3,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data "the power cloak","CLOAK",1,50,0,5,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data "a silver amulet","AMULET",3,50,19,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data "a dark coin","COIN",1,32,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data "a evil orb","ORB",1,1,17,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data "a staff of power","STAFF",2,10,1,0,0,0,0,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data "a large potion","POTION",40,10,3,0,0,0,0,5,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data "some copper coins","COINS",4,45,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data "an iron mace","MACE",1,2500,8,37,0,0,0,50,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data "some oak twigs","TWIGS",1,1,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data "a large sack of gems","GEMS",1,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data "a large scroll","SCROLL",40,10,3,0,0,0,-1,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Data "a catapult","CATAPULT",10,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,216,0,-1,0,0,0,0,0,0
Data "a boulder","BOULDER",5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0
