mxspl***2da

This file defines the spell gaining tables per level.
Where:
First colunm is the PC's/NPC's level.
Columns 2-8 contain of number of spells that CRE should have on the specific level in their spell book (for other MXSPL***.2DA files there is different number of columns, like in  ranger's case we have only three columns or like in wizard's case we have 9 columns that corresponds to their capabilities to case the spells of specified levels.
In case of bard, ranger and paladin there is a possibility to add more levels of spells simply by adding columns in the proper 2DA file.
In BG1 TotS we have (mxsplprs.2da):
2DA V1.0
0
           1          2          3          4          5          6          7
1          1          0          0          0          0          0          0
2          2          0          0          0          0          0          0
3          2          1          0          0          0          0          0
4          3          2          0          0          0          0          0
5          3          3          1          0          0          0          0
6          3          3          2          0          0          0          0
7          3          3          2          1          0          0          0
8          3          3          3          2          0          0          0   
9          4          4          3          2          1          0          0
10         4          4          3          3          2          0          0
11         5          4          4          3          2          1          0
12         6          5          5          3          2          2          0
13         6          6          6          4          2          2          0   
14         6          6          6          5          3          2          1
15         6          6          6          6          4          2          1
16         7          7          7          6          4          3          1
17         7          7          7          7          5          3          2
18         8          8          8          8          6          4          2
19         9          9          8          8          6          4          2
20         9          9          9          8          7          5          2

mxsplwis.2da

This file is responsible for bonus priests (clerics and druids) spells because of their wisdom:
In BG1 TotS we have:
2DA V1.0
0
           1          2          3          4          5          6          7   
13         1          0          0          0          0          0          0   
14         2          0          0          0          0          0          0   
15         2          1          0          0          0          0          0   
16         2          2          0          0          0          0          0   
17         2          2          1          0          0          0          0   
18         2          2          1          1          0          0          0   
19         3          2          1          2          0          0          0   
20         3          3          1          3          0          0          0   
21         3          3          2          3          1          0          0   
22         3          3          2          4          2          0          0   
23         3          3          2          4          4          0          0   
24         3          3          2          4          4          2          0   
25         3          3          2          4          4          3          1   
Columns numerated from 1 to 7 indicates the priest spell book level
First column is the CRE's wisdom.
The crossing of them indicate how many bonus spells have priest creature with specified wisdom.
Description applies to:
mxsplbrd.2da - Bard
mxsplpal.2da - Paladin
mxsplprs.2da - Cleric/Druid
mxsplran.2da - Ranger
mxsplwiz.2da - Mage
mxsplwis.2da - Wisdom bonus spells