rndwep.2da

This file defines what items are generated when a creature uses an item of filename RNDWEPx#.ITM, where x=any character (even letters and symbols, and has no bearing on how RNDMAGIC.2DA is read), and #=the row number of RNDWEP.2DA to use (can be 1-9). RNDWEPx#.ITM is replaced by the generated item. Therefore, this works like a random treasure table.

The first column of RNDWEP.2DA specifies the name of the row, currently a simple generic name. The rest of the 20 columns have headers 1, 2, 3, 4, 5, ..., 18, 19, 20. The column used is specified by a roll of 2D10. Note that this is different from RNDTREAS.2DA and RNDMAGIC.2DA, which do not have the column labelled '1', but similar to RNDSCROL.2DA and RNDEQUIP.2DA. Only 21 columns in total are supported, else the 2da file will fail to work entirely. When this happens, all RNDWEPx#.ITMs are replaced by erroneous invisible items that cannot be removed.

The BG2:ToB version of RNDWEP.2DA is shown below. In essence, RNDWEP.2DA works exactly the same as RNDEQUIP.2DA, so see RNDEQUIP.2DA for an example of how RNDWEP.2DA works. However, RNDWEP.2DA can be directly referenced by RNDEQUIP.2DA, RNDTREAS.2DA or RNDMAGIC.2DA without actually having RNDWEPx#.ITM as a resource. For example, an entry in RNDMAGIC.2DA that reads RNDWEP03, and a 2D10 roll of 3 will replace RNDWEPx#.ITM with CHAN05.

In BG2:ToB we have:
2DA V1.0
*
           1          2          3          4          5          6          7          8          9          10         11         12         13         14         15         16         17         18         19         20         
1st        PLAT01     SHLD04     SHLD02     BOW06      BOW02      LEAT05     SCRL68     LEAT05     PLAT01     CHAN01     CHAN02     DAGG02     DAGG02     BLUN03     BLUN07     SW1H08     SW1H05     DAGG02     SPER05     SPER06     
2nd        PLAT04     CHAN08     CHAN02     LEAT11     SW2H11     SHLD06     STAF02     HAMM02     SW1H44     SW1H47     SW1H05     SW1H04     HALB02     DAGG15     AX1H02     AX1H11     BLUN05     BOW04      BOW18      BOW17      
3rd        PLAT14     PLAT10     CHAN05     LEAT15     LEAT12     SHLD19     STAF18     HAMM08     SW1H02     SW1H05     SW1H22     SPER02     SW2H02     SW1H09     SW1H42     SW1H41     BLUN21     XBOW07     XBOW09     BOW16      
RNDWEP.2DA supports 9 functional rows of random treasure. Rows 10 and above are completely ignored. If RNDWEPx#.ITM references a non-existant or an ignored row number (or if #=0 under any circumstances), then RNDWEPx#.ITM is replaced by an erroneous invisible item that cannot be removed. Note that the replacing item is NOT RNDWEPx#.ITM itself, in this case. This blank item can likely be altered by setting the default 2da entry to a valid item.

Items that can be referenced:

Items that cannot be referenced:

Since RNDWEP.2DA can reference RNDSCROL.2DA but not RNDMAGIC.2DA nor RNDTREAS.2DA nor RNDEQUIP.2DA, this 2da file is the fourth to the top of the random treasure table hierarchy.