Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[93e1a9]: Structs.h Maximize Restore History

Download this file

Structs.h    2327 lines (2176 with data), 52.1 kB

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
#if !defined(AFX_STRUCTS_H__42E3FDEA_0FCA_4733_8AD1_6E396250B019__INCLUDED_)
#define AFX_STRUCTS_H__42E3FDEA_0FCA_4733_8AD1_6E396250B019__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//ie structs
#include "myafxtempl.h" //the original stuff was too restricting, trying to overcome that
#pragma pack(1)
#define SLOT_COUNT 38
#define PST_SLOT_COUNT 46
#define IWD2_SLOT_COUNT 50
#define SND_SLOT_COUNT 100
#define SND_SLOT_IWD2 64
#define IWD2_NUM_FEAT 64
#define IWD2_SKILL_COUNT 66
#define BG2_SPSLOTNUM 3
#define IWD2_SPSLOTNUM 7
#define ATTR_CRITICAL 1
#define ATTR_TWOHAND 2
#define ATTR_MOVABLE 4
#define ATTR_DISPLAY 8
#define ATTR_CURSED 16
#define ATTR_COPYABLE 32
#define ATTR_MAGICAL 64
#define ATTR_BOW 128
#define ATTR_SILVER 256
#define ATTR_COLD 512
#define ATTR_STOLEN 1024
#define ATTR_CONVERS 2048
//all the rest is unknown
//bit locations for matched fields
#define FLG_MPROJ 0
#define FLG_MPROJ2 1
#define FLG_MTYPE 2
#define FLG_MTYPE2 3
#define FLG_MFEAT 4
#define FLG_MFEAT2 5
#define FLG_MRES 6
#define FLG_MITEM 7
#define FLG_MEA 8
#define FLG_MEA2 9
#define FLG_MGENERAL 10
#define FLG_MGENERAL2 11
#define FLG_MRACE 12
#define FLG_MRACE2 13
#define FLG_MCLASS 14
#define FLG_MCLASS2 15
#define FLG_MSPECIFIC 16
#define FLG_MSPECIFIC2 17
#define FLG_MGENDER 18
#define FLG_MGENDER2 19
#define FLG_MALIGN 20
#define FLG_MALIGN2 21
#define FLG_MVAR 22
#define FLG_MSTRREF 23
#define FLG_CHANGE 30
#define FLG_CHANGE2 31
//internal
typedef struct {
CString bifname;//bif or filename
long index;
long size;
unsigned short bifindex; // used for extraction (marks bif), original index
unsigned short cdloc;
CString resref; // the key itself
} loc_entry;
typedef struct {
CString ref;
loc_entry entry;
} stringloc_entry;
//dialog.tlk header
typedef struct {
char signature[4];
char version[4];
short unused;
long entrynum;
long start;
} tlk_header;
typedef char resref_t[8];
typedef struct {
unsigned short flags;
resref_t soundref;
unsigned long pitch;
unsigned long volume;
long offset;
long length;
} tlk_reference;
typedef struct {
tlk_reference reference;
CString text;
} tlk_entry;
//bif
typedef struct {
char signature[4];
char version[4];
long file_entries;
long tile_entries;
long file_offset;
} bif_header;
typedef struct {
long res_loc;
long offset;
long size;
short restype;
short unused;
} bif_entry;
typedef struct {
long res_loc;
long offset;
long numtiles; //extra field compared to bif_entry
long size;
short restype;
short unused;
} tis_entry;
typedef struct {
CString filename;
long uncompressed;
long compressed;
} sav_entry;
//chitin.key
typedef struct {
char signature[4]; //'KEY '
char version[4]; //'V1 '
long numbif;
unsigned long numref;
long offbif;
long offref;
} key_header;
typedef struct {
long biflen;
long offbif; //name offset in this file
short namelen; //name length
short location; //location of bif (we will always look in the data section ?)
} keybif_entry;
typedef struct {
long biflen;
CString bifname;
short location;
} membif_entry;
typedef struct {
resref_t filename;
short restype;
unsigned long residx;
} key_entry;
//*.chu
typedef struct
{
char filetype[4];
char revision[4];
long windowcnt;
long controloffs; //this could be checked easily
long windowoffs;
} chui_header;
typedef struct
{
short windowid;
short unknown1; //unknown
short xpos, ypos;
short width, height;
short flags; //1 if has background
short controlcount;
char mos[8];
short controlidx; //first control index
short other; //may be strref
} chui_window;
typedef struct
{
short controlid;
short idflags;
short xpos, ypos;
short width, height;
char controltype;
unsigned char unknown;
} chui_control_common;
typedef struct//0
{
char bam[8];
unsigned char cycle;
unsigned char flags;
unsigned short unpressed;
unsigned short pressed;
unsigned short selected;
unsigned short disabled;
} chui_button;
typedef struct//1
{
char mos1[8];
char mos2[8];
char bam[8];
short jumpcount; //if this is 0 then the bam is a mos, and its width is the jumpcount
short cycle; //this is zero if the progressbar is a mos
short xpos, ypos; //the position of the progressbar 'bam' if it is a mos
short xposcap, yposcap; //the position of the cap 'bam' if it is a mos
} chui_progress;
typedef struct//2
{
char mos[8];
char bam[8];
short cycle;
short released;
short grabbed;
short xpos;
short ypos;
short jumpwidth;
short jumpcount;
short top;
short bottom;
short left;
short right;
} chui_slider;
typedef struct//3
{
char mos1[8];
char mos2[8];
char mos3[8];
char cursor[8]; //cursor bam
short cycle;
short frame;
short xpos;
short ypos;
long unknown2;
char font[8]; //font bam
char unknown3[34];
short length;
long uppercase;
} chui_editbox;
typedef struct//5
{
char bam1[8]; //initials
char bam2[8]; //text
unsigned char rgb1r,rgb1g,rgb1b,rgb1a;
unsigned char rgb2r,rgb2g,rgb2b,rgb2a;
unsigned char rgb3r,rgb3g,rgb3b,rgb3a;
long scrollcontrolid;
} chui_textarea;
typedef struct //6
{
long strref;
char font[8];
unsigned char rgb1r,rgb1g,rgb1b,rgb1a;
unsigned char rgb2r,rgb2g,rgb2b,rgb2a;
short justify;
} chui_label;
typedef struct //7
{
char bam[8];
short cycle;
short upunpressed;
short uppressed;
short downunpressed;
short downpressed;
short trough;
short slider;
long textcontrolid;
} chui_scrollbar;
//*.spl
typedef struct
{
char filetype[4]; //'SPL '
char revision[4]; //'V1.0'
long spellname;
long unknown0c;
char wavc[8]; //completion sound
unsigned char itmattr;
unsigned char splattr;
unsigned short unkattr2;
short spelltype;
unsigned short school1;
unsigned short priesttype; //0, 4000, 8000
unsigned short castingglow;
unsigned char unknown24;
short school3; //spell school from school.ids
unsigned char sectype; //secondary type from sectype.ids
long unknown28;
long unknown2c;
long unknown30;
long level;
short unknown38;
char icon[8];
short unknown42;
long unknown44;
long unknown48;
long unknown4c;
long desc; //strref
long unknown54;
long unknown58;
long unknown5c;
long unknown60;
long extheadoffs;
short extheadcount;
long featureoffs;
short featblkoffs;
short featblkcount;
} spell_header;
typedef struct
{
unsigned char spellform;
unsigned char unknown01;
unsigned short location; //innate or spell (the high nibble disables the spell)
char useicon[8];
unsigned char target_type;
unsigned char target_num;
unsigned short range;
unsigned short level;
unsigned long speed;
unsigned long unknown16;
unsigned long unknown1a;
unsigned short fbcount;
unsigned short fboffs;
short unknown22;
short unknown24;
unsigned short proref; //projectl.ids reference
} spl_ext_header;
//*.itm
typedef struct
{
char filetype[4]; //'ITM '
char revision[4]; //'V1.0'
long unidref; //dialog.tlk reference
long idref; //dialog.tlk reference
char destname[8]; //filename(.itm)
unsigned short itmattr; //item attribute bits
unsigned short splattr; //spell attribute bits
short itemtype; //2 byte chars
char usability[4]; //bits class/alignment/race
char animtype[2]; //animation type
unsigned char minlevel; //minimum level
unsigned char padding1;
unsigned char minstr; //minimum strength
unsigned char padding2;
unsigned char minstrpl; //minimum strength 18 + x
unsigned char kits1; //bits
unsigned char minint; //
unsigned char kits2; //more kit bits
unsigned char mindex;
unsigned char kits3;
unsigned char minwis;
unsigned char kits4;
unsigned char mincon;
unsigned char weaprof; //weapon proficiency type
unsigned char mincha; //
unsigned char padding3;
unsigned long price; //item price
short maxstack; //maximum stack
char invicon[8]; //inventory icon
short loreid; //lore to identify
char grnicon[8]; //ground icon
unsigned long weight;
long uniddesc; //unidentified description reference
long iddesc; //identified desc. ref.
char descicon[8]; //description icon
unsigned long mplus; //magic level
long extheadoffs;
short extheadcount;
long featureoffs;
short featblkoffs;
short featblkcount;
} item_header;
typedef struct
{
unsigned char unknown[16];
} iwd2_header;
typedef struct
{
char dialog[8];
unsigned long nameref;
unsigned short colour; //wielding colour
unsigned char unknown80[26];
} pst_header;
typedef struct
{
long capacity;
unsigned char unknown[80];
} iwd2store_header;
typedef struct
{
unsigned char attack_type;
unsigned char force_id;
unsigned char location;
unsigned char altdmgdicetype;
char useicon[8];
unsigned char target_type;
unsigned char target_num;
unsigned short range;
unsigned char projectile;
unsigned char altdmgdicecnt;
unsigned char speed;
unsigned char altdmgplus;
short thaco;
unsigned char damdice;
unsigned char school;
unsigned char dammult;
unsigned char sectype;
short damplus;
unsigned short damtype;
unsigned short fbcount;
unsigned short fboffs;
unsigned short charges;
unsigned short drained;
unsigned long flags;
unsigned short proref; //projectl.ids reference
unsigned short animation[3];
unsigned short missile[3];
} ext_header;
typedef union
{
long parl;
unsigned short parw[2];
unsigned char parb[4];
} parameter;
typedef struct {
short feature;
unsigned char target;
unsigned char power;
parameter par1;
parameter par2;
unsigned char timing;
unsigned char resist;
long duration;
unsigned char prob2;
unsigned char prob1;
char vvc[8];
long count;
long sides;
long stype;
long sbonus;
long special;
} feat_block;
typedef struct {
char filetype[4]; //'STOR'
char revision[4]; //'V1.0'
long type; //store type
long strref; //store name
long flags; //bit 0 means this shop sells items (important)
long selling; //selling markup 1
long buying; //buying markup 2
long depreciation; //depreciacion 3
short steal; //steal success 4
short capacity; //capacity
char dlgresref1[8];
long pitemoffset;
long pitemcount;
long offset; //important
long itemcount; //important
long lore;
long idprice;
char dlgresref2[8];
long drinkoffset;
long drinkcount;
char dlgresref3[8];
long rent;
long prices[4];
long cureoffset;
long curecount;
unsigned char unknown[36];
} store_header;
typedef struct {
char drinkscript[8]; //drinkspell/drinkscript resref
long drinkname;
long price;
long strength; //rumour-drink strength
} store_drink;
typedef struct {
char curename[8]; //spell resref
long price; //cure price
} store_cure;
typedef struct {
char itemname[8]; //resref
short timer;
unsigned short usages[3];
long flags;
long count; //count must be 1 for bags
long infinite;
} store_item_entry;
typedef struct {
char itemname[8]; //resref
short timer;
unsigned short usages[3];
long flags;
long count; //count must be 1 for bags
long infinite;
long trigger;
char unknown2c[56];
} store_item_entry11; //this is for sto v1.1
typedef struct {
char filetype[4]; //'PRO '
char revision[4]; //'V1.0'
short type;
short speed;
short sparks;
short unknown0e;
char wavc1[8];
char wavc2[8];
char vvc[8];
short spkcolour; //cannot be 0 if there are sparks (must be 1-12)
short spknumber;
long extflags; //0x2c //flags used by gemrb
long text; //0x30 //text strref
long rgb; //0x34 //rgb single pulse color
short pulsespeed; //0x38 //pulse speed
short shake; //0x3a //screen shake
short affects; //0x3c //ids targeting value (0-255) just like with ids targeting opcode
short atype; //0x3e //ids targeting type (1-7) just like with ids targeting opcode
short affects2; //0x40 //second ids targeting value
short atype2; //0x42 //second ids targeting type
char failspell[8];//0x44 //un-hardcoded failure effect for projectile specific effects
char succspell[8];//0x4c //un-hardcoded success effect for projectile specific effects
char unknown54[172]; //unknown till next 256 block
unsigned long attr;
char bam1[8];
char bam2[8];
unsigned char seq1, seq2; //both seq for shadow/projectile
short lightz;
short lightx;
short lighty;
char bmp[8]; //sttravl.. (a bmp filename)
unsigned char colours[7]; //more colours
unsigned char smokepuff;
unsigned char smokecols[7];
unsigned char aim; // 1 or 5
unsigned short smokeanim; //from animate IDS
char trailbam[3][8];
short trailtype[3];
char unknown154[172];
} proj_header;
typedef struct {
short aoe; //bitflags
short flags;
short tradius;//256=30'
short radius; // 256=30'
char wavc1[8]; //trigger sound
short delay;
unsigned short fragmentanim; // animate.ids
short proref; //this is a projectile too, played at setoff
unsigned char duration;
unsigned char expgr2; //set off
short expclr;
short projectile; //another projectile comes now
char vvc[8]; //center animation (x)
short conewidth;
short unknown26;
char spread[8]; //spread animation (a) 0x30
char second[8]; //recoil animation? (r) 0x38
char wavc2[8]; //area sound 0x40
long gemrbflags; //gemrb specific area flags 0x48
short dicecount;
short dicesides;
short tilex;
short tiley;
char unknown45[180];
} proj_extension;
typedef struct
{
char filetype[4]; //'EFF '
char revision[4]; //'V2.0 '
char signature[4]; //'EFF '
char version[4]; //'V2.0 '
// unsigned short feature; // hardcoded effect number
// unsigned short filler;
unsigned long feature;
unsigned long target;
unsigned long power;
parameter par1;
parameter par2;
unsigned short timing;
unsigned short unknown2; //part of timing
unsigned long duration;
unsigned short prob2;
unsigned short prob1;
char resource[8];
unsigned long count;
unsigned long sides;
unsigned long stype;
long sbonus;
long unknown2c;
long school;
long u3;
long minlevel;
long maxlevel;
long resist;
long par3;
long par4;
unsigned char unused2[8];
char vvc[8];
char resource3[8];
long sx, sy;
long dx, dy;
long unused3;
char source[8];
long unused4;
long projectile;//the effect uses this projectile (from spell)
long slot; //the equipping slot
char variable[32];
long casterlevel;//(in items this is set to 10)
long firstcast;
long sectype;
unsigned char unused9[60];
} eff_header;
//+2 is for the equipped item info (dword)
typedef short creature_itemslots[IWD2_SLOT_COUNT+2]; //IWD2 has more slots
typedef struct
{
char filetype[4]; //'CHR '
char revision[4]; //'V2.1'-bg2/tob, v1.0 - iwd
char name[32];
long creoffset;
long cresize;
char filler[0x34];
} character_header;
typedef struct
{
char filetype[4]; //'CHR '
char revision[4]; //'V2.2'-iwd2
char name[32];
long creoffset;
long cresize;
char filler[0x1f4];
} character_iwd2_header;
typedef struct
{
char filetype[4]; //'CRE '
char revision[4]; //'V1.0'
long longname;
long shortname;
unsigned long flags;
long expval;
long expcur;
long gold;
long state;
short curhp;
short maxhp;
unsigned long animid;
unsigned char colours[7];
char effbyte;
char iconm[8];
char iconl[8];
unsigned char reputation; //unused in team
unsigned char hideskill;
short natac;
short effac;
short crushac;
short missac;
short piercac;
short slashac;
char thac0;
unsigned char attacks;
unsigned char sdeath;
unsigned char swands;
unsigned char spoly;
unsigned char sbreath;
unsigned char sspell;
char resfire;
char rescold;
char reselec;
char resacid;
char resmagic;
char resmfire;
char resmcold;
char resslash;
char rescrush;
char respierc;
char resmiss;
unsigned char detillusion;
unsigned char settraps;
unsigned char lore;
unsigned char lockpick;
unsigned char stealth;
unsigned char findtrap;
unsigned char pickpock;
unsigned char fatigue;
unsigned char intox;
char luck;
unsigned char unused[21]; //old weapon proficiencies
unsigned char tracking;
unsigned long unused2[8];
long strrefs[SND_SLOT_COUNT];
unsigned char levels[3];
unsigned char sex;
unsigned char strstat;
unsigned char strbon;
unsigned char intstat;
unsigned char wisstat;
unsigned char dexstat;
unsigned char constat;
unsigned char chastat;
unsigned char morale;
unsigned char moralebreak;
unsigned char enemy;
unsigned char moralerecover;
unsigned char unknown243;
long kit;
char scripts[5][8];
unsigned char idsea;
unsigned char idsgeneral;
unsigned char idsrace;
unsigned char idsclass;
unsigned char idsspecific;
unsigned char idsgender;
unsigned char idsinternal[5];
unsigned char idsalign;
short globalID;
short localID;
char dvar[32];
long bookoffs;
long bookcnt;
long selectoffs;
long selectcnt;
long memoffs;
long memcnt;
//////
long itemslots;
long itemoffs;
long itemcnt;
long effectoffs;
long effectcnt;
char dialogresref[8];
} creature_header;
typedef struct
{
char resref[8];
long flags;
short timing;
unsigned char type;
unsigned char u1;
long duration;
long u2;
long u3;
long u4;
long u5;
} creature_pst_overlay;
typedef struct
{
char filetype[4]; //'CRE '
char revision[4]; //'V1.2'
long longname;
long shortname;
unsigned long flags;
long expval;
long expcur;
long gold;
long state;
short curhp;
short maxhp;
unsigned long animid;
unsigned char unused[7]; //colors
char effbyte;
char iconm[8];
char iconl[8];
unsigned char reputation; //unused in team
unsigned char hideskill;
short natac;
short effac;
short crushac;
short missac;
short piercac;
short slashac;
char thac0;
unsigned char attacks;
unsigned char sdeath;
unsigned char swands;
unsigned char spoly;
unsigned char sbreath;
unsigned char sspell;
char resfire;
char rescold;
char reselec;
char resacid;
char resmagic;
char resmfire;
char resmcold;
char resslash;
char rescrush;
char respierc;
char resmiss;
unsigned char detillusion;
unsigned char settraps;
unsigned char lore;
unsigned char lockpick;
unsigned char stealth;
unsigned char findtrap;
unsigned char pickpock;
unsigned char fatigue;
unsigned char intox;
char luck;
unsigned char profs[21];
unsigned char tracking;
unsigned long unused2[8];
long strrefs[SND_SLOT_COUNT];
unsigned char levels[3];
unsigned char sex;
unsigned char strstat;
unsigned char strbon;
unsigned char intstat;
unsigned char wisstat;
unsigned char dexstat;
unsigned char constat;
unsigned char chastat;
unsigned char morale;
unsigned char moralebreak;
unsigned char enemy;
unsigned char moralerecover;
unsigned char unknown243;
long kit;
char scripts[5][8];
char unknown270[36];
long overlayoffs;
long overlaysize;
long magexp;
long thiefxp;
char internals[20]; //2a4
char good, law, lady, murder;
char bestiary[32]; //2bc
unsigned char dialogradius;
unsigned char feetcircle;
unsigned char unknown2de;
unsigned char colornum;
unsigned long killflags;
short colours[7]; //24e
unsigned char unknown2f2[3];
unsigned char colorslots[7];
unsigned char unknown2fc[21];
unsigned char idsspecies;
unsigned char idsteam;
unsigned char idsfaction;
unsigned char idsea;
unsigned char idsgeneral;
unsigned char idsrace;
unsigned char idsclass;
unsigned char idsspecific;
unsigned char idsgender;
unsigned char idsinternal[5];
unsigned char idsalign;
short globalID;
short localID;
char dvar[32];
long bookoffs;
long bookcnt;
long selectoffs;
long selectcnt;
long memoffs;
long memcnt;
long itemslots;
long itemoffs;
long itemcnt;
long effectoffs;
long effectcnt;
char dialogresref[8];
} creature_pst_header;
typedef struct
{
char filetype[4]; //'CRE '
char revision[4]; //'V9.0'
long longname;
long shortname;
unsigned long flags;
long expval;
long expcur;
long gold;
long state;
short curhp;
short maxhp;
unsigned long animid;
unsigned char colours[7];
char effbyte;
char iconm[8];
char iconl[8];
unsigned char reputation; //unused in team
unsigned char hideskill;
short natac;
short effac;
short crushac;
short missac;
short piercac;
short slashac;
char thac0;
unsigned char attacks;
unsigned char sdeath;
unsigned char swands;
unsigned char spoly;
unsigned char sbreath;
unsigned char sspell;
char resfire;
char rescold;
char reselec;
char resacid;
char resmagic;
char resmfire;
char resmcold;
char resslash;
char rescrush;
char respierc;
char resmiss;
unsigned char detillusion;
unsigned char settraps;
unsigned char lore;
unsigned char lockpick;
unsigned char stealth;
unsigned char findtrap;
unsigned char pickpock;
unsigned char fatigue;
unsigned char intox;
char luck;
unsigned char profs[21];
unsigned char tracking;
unsigned long unused2[8];
long strrefs[SND_SLOT_COUNT];
unsigned char levels[3];
unsigned char sex;
unsigned char strstat;
unsigned char strbon;
unsigned char intstat;
unsigned char wisstat;
unsigned char dexstat;
unsigned char constat;
unsigned char chastat;
unsigned char morale;
unsigned char moralebreak;
unsigned char enemy;
unsigned char moralerecover;
unsigned char unknown243;
long kit;
char scripts[5][8];
char scriptflags[4]; //3. flag is kill var count
//long unknown270;
short internals[5];
char scriptname[32];
char scriptname2[32];
short unknown;
short savedx, savedy, savedir; //saved location
char unknown2be[18];
unsigned char idsea;
unsigned char idsgeneral;
unsigned char idsrace;
unsigned char idsclass;
unsigned char idsspecific;
unsigned char idsgender;
unsigned char idsinternal[5];
unsigned char idsalign;
short globalID;
short localID;
char dvar[32];
long bookoffs;
long bookcnt;
long selectoffs;
long selectcnt;
long memoffs;
long memcnt;
long itemslots;
long itemoffs;
long itemcnt;
long effectoffs;
long effectcnt;
char dialogresref[8];
} creature_iwd_header;
typedef struct
{
char filetype[4]; //'CRE '
char revision[4]; //'V2.2'
long longname;
long shortname;
unsigned long flags;
long expval;
long expcur;
long gold;
long state;
short curhp;
short maxhp;
unsigned long animid;
char colours[7];
char effbyte;
char iconm[8];
char iconl[8];
char reputation; //unused in team
char hideskill;
short natac;
short crushac;
short missac;
short piercac;
short slashac;
char thac0; //unused
unsigned char attacks; //unused
unsigned char sfort;
unsigned char sreflex;
unsigned char swill;
char resfire;
char rescold;
char reselec;
char resacid;
char resmagic;
char resmfire;
char resmcold;
char resslash;
char rescrush;
char respierc;
char resmiss;
char resmdam;
unsigned char unknown61[4];
unsigned char fatigue;
unsigned char intox;
char luck;
unsigned char turnundead;
unsigned char unknown69[33];
unsigned char totlevel;
unsigned char levels[11];
unsigned char unknown96[22];
long strrefs[64];
unsigned char script1[8]; //team script
unsigned char script2[8]; //special script1
long dr; //damage resistance
long feat[6];
unsigned char feats[64];
unsigned char skills[IWD2_SKILL_COUNT];
unsigned char cr;
unsigned char enemy[8];
unsigned char subrace;
unsigned char unknown264;
unsigned char sex;
unsigned char strstat;
unsigned char intstat;
unsigned char wisstat;
unsigned char dexstat;
unsigned char constat;
unsigned char chastat;
unsigned char morale;
unsigned char moralebreak;
unsigned char moralerecover;
unsigned char unknown26f;
long kit;
char scripts[5][8];
char scriptflags[4]; //3. flag is kill var count
short internals[5];
char scriptname[32];
char scriptname2[32];
short unknown2ea;
short savedx, savedy, savedir; //saved location
char unknown2f2[15];
unsigned char translucency;
unsigned char fadespeed;
unsigned char specflags;
unsigned char visible;
char unknown305;
char unknown306;
unsigned char skillpoints;
char unknown308[124];
unsigned char idsea;
unsigned char idsgeneral;
unsigned char idsrace;
unsigned char idsclass;
unsigned char idsspecific;
unsigned char idsgender;
unsigned char idsinternal[5]; //func spec
unsigned char idsalign;
short globalID;
short localID;
char dvar[32];
char unknown3b4[6]; //3 words
long spelloffs[IWD2_SPSLOTNUM][9]; //7 types: bard, cleric, druid, paladin, ranger, sorc, wizard
long spellcnt[IWD2_SPSLOTNUM][9]; //7 types
long domainoffs[9]; //plus domain
long domaincnt[9];
long innateoffs;
long innatecnt;
long songoffs;
long songcnt;
long shapeoffs;
long shapecnt;
////
long itemslots;
long itemoffs;
long itemcnt;
long effectoffs;
long effectcnt;
char dialogresref[8];
} creature_iwd2_header;
typedef struct
{
unsigned long animid;
char scripts[5][8];
char dialogresref[8];
char iwd2scripts[2][8];
char scriptname[32];
} creature_data;
typedef struct {
char resref[8];
short level;
short spelltype;
} creature_book;
typedef struct {
long type;
long total;
long remaining;
long unknown;
} creature_iwd2_spell;
typedef struct {
short level;
short num1;
short num2;
short spelltype;
long index;
long count;
} creature_select;
typedef struct {
char resref[8];
long flags;
} creature_memory;
typedef struct {
char itemname[8];
short timer;
short usages[3];
long flags;
} creature_item;
typedef struct {
char signature[4]; //'EFF '
char version[4]; //'V2.0 '
unsigned long feature; // hardcoded effect number
unsigned long target;
unsigned long power;
parameter par1;
parameter par2;
unsigned char timing;
unsigned char unknown;
unsigned short unknown2;
unsigned long duration;
unsigned short prob2;
unsigned short prob1;
char resource[8];
unsigned long count;
unsigned long sides;
unsigned long stype;
long sbonus;
long special;
long school;
long u3,u4,u5;
long resist;
long par3;
unsigned char unused2[12];
char vvc[8];
unsigned char unused3[28];
char source[8];
long unused4;
long projectile;//the effect uses this projectile
long unused6;
char variable[32];
long unused7;
long unused8;
long sectype;
unsigned char unused9[60];
} creature_effect;
typedef struct
{
char filetype[4]; //'VVC '
char revision[4]; //'V1.0 '
char bam[8];
char shadow[8];
unsigned char transparency;
unsigned char trans2;
unsigned char colouring;
unsigned char col2;
long unknown1c;
long sequencing;
long unknown24;
long xpos;
long ypos;
long hasorient;
long framerate;
long facecount;
long currorient;
long position;
char palette[8];
long zpos;
long spotX;
long spotY;
long spotZ;
long duration;
char name[8];
long seq1;
long seq2;
long currentseq;
long spanseq;
char sound1[8];
char sound2[8];
char alpha[8];
long unknown90;
char sound3[8];
char unused[336];
} vvc_header;
typedef struct
{
char filetype[4]; //'WFX '
char revision[4]; //'V1.0'
long srcurve;
long flags;
long frvar;
long volvar;
char unused[240];
} wfx_header;
// *.are
typedef struct
{
char filetype[4]; //'AREA'
char revision[4]; //'V1.0'
char wed[8];
long lastsaved;
unsigned long areaflags; //can save, dream, etc
char northref[8];
long northflags;
char westref[8];
long westflags;
char southref[8];
long southflags;
char eastref[8];
long eastflags;
unsigned char areatype; //forest, extended night, etc
unsigned char unkflags;
short rain;
short snow;
short fog;
short lightning;
short windspeed;
long actoroffset;
short actorcnt;
short infocnt;
long infooffset;
long spawnoffset;
long spawncnt;
long entranceoffset;
long entrancecnt;
long containeroffset;
short containercnt;
short itemcnt;
long itemoffset;
long vertexoffset;
short vertexcnt;
short ambicnt;
long ambioffset;
long variableoffset;
short variablecnt;
short tileflagcnt;
long tileflagoffset;
char scriptref[8];
long exploredsize;
long exploredoffset;
long doorcnt;
long dooroffset;
long animationcnt;
long animationoffset;
long tilecnt;
long tileoffset;
long songoffset;
long intoffset;
long mapnoteoffset;
long mapnotecnt;
long pstmapnotecnt; //also trapoffset
long trapcnt;
char sleep1[8];
char sleep2[8];
char unused[56];
} area_header;
typedef struct {
char filetype[4]; //'WED '
char revision[4]; //'V1.3'
long overlaycnt;
long doorcnt;
long overlayoffset;
long secheaderoffset;
long dooroffset;
long tilecelloffset;
} wed_header;
typedef struct {
short width;
short height;
char tis[8];
long unknownc;
long tilemapoffset;
long tileidxoffset;
} wed_overlay;
typedef struct {
long wallpolycnt;
long polygonoffset;
long verticeoffset;
long wallgroupoffset;
long polygonidxoffset;
} wed_secondary_header;
typedef struct {
char doorid[8]; //matched with area_door.doorid
short closed;
short firstdoortileidx;//door tile cell indices are 16 bit values
short countdoortileidx;
short countpolygonopen;
short countpolygonclose;
long offsetpolygonopen;
long offsetpolygonclose;
} wed_door;
typedef struct {
unsigned short firsttileprimary;
unsigned short counttileprimary; //tile indices are 16 bit values
short alternate;
short flags;
short unknown;
} wed_tilemap;
// polygon indices could be POINTS type, x=index, y=count
typedef struct {
short index;
short count;
} wed_polyidx;
typedef struct {
long firstvertex;
long countvertex;
unsigned char flags;
unsigned char unkflags;
short minx, maxx, miny, maxy;
} wed_polygon;
typedef struct {
char actorname[32];
short posx;
short posy;
short destx;
short desty;
long fields; //used fields
short type;
char firstchar;
char unknown2f;
long animation;//actor's animation type
short face;
short unknown36;
long expiration; //time to appear for (0x38)
short huntingrange;
short followrange;
unsigned long schedule;
long talknum;
char dialog[8];
char scroverride[8];
char scrgeneral[8];
char scrclass[8];
char scrrace[8];
char scrdefault[8];
char scrspecific[8];
char creresref[8];
long creoffset;
long cresize;
char scrarea[8];
char notused[120];
} area_actor;
typedef struct {
char infoname[32];
short triggertype;
short p1x, p1y, p2x, p2y;
short vertexcount;
long vertindx;
long unknown30;
long cursortype;
char destref[8]; //area resref
char destname[32]; //destination name in destination area
long infoflags;
long strref;
short trapdetect;
short trapremove;
short trapped;
short detected;
short launchx,launchy;
char key[8];
char scriptref[8]; //script of this trigger
short pointx, pointy;
char unknown[36];
char wavres[8]; //pst thing too
short pstpointx, pstpointy;
long dialogstrref; //at least in pst, trigger points can talk
char dialogref[8];
} area_trigger;
typedef struct {
char spawnname[32];
short px, py;
char creatures[10][8];
short creaturecnt;
short difficulty;
short delay; //seconds
short method; //usually 1
long expiry;
short randomwalk;
short unknown82;
short max;
short min; // ?
unsigned long schedule;
short percent1;
short percent2;
char unused[56];
} area_spawn;
typedef struct {
char entrancename[32];
short px, py;
short face;
short unknown26;
short unknown28;
short unknown2a;
char unused[60];
} area_entrance;
typedef struct {
char containername[32];
short posx, posy;
short type;
short lockdiff;
long locked;
short trapdetect;
short trapremove;
short trapped;
short trapvisible;
short launchx, launchy;
short p1x, p1y, p2x, p2y; //minimum bounding box
long firstitem;
long itemcount;
char trapscript[8];
long firstvertex;
short vertexcount;
short unknown56;
char trapname[32];
char keyitem[8];
short unknown80;
short unknown82;
long strref; //STRREF!!!
char unused[56];
} area_container;
typedef struct {
char itemname[8];
short timer;
short usages[3];
long flags;
} area_item;
typedef struct {
char ambiname[32];
short posx, posy;
short radius;
short unknown26;
unsigned long pitchvariance;
short volumevariance;
short volume;
char ambients[10][8];
short ambientnum;
short ambientnum2; // ????
long period; //was interval
long periodvariance; // was sounds to use
unsigned long schedule;
long flags;
long unknown90;
char unused[60];
} area_ambient;
typedef struct {
char variablename[32];
long unknown20;
long unknown24;
long value;
char unused[40];
} area_variable;
typedef struct {
char doorname[32];
char doorid[8];
long flags;
long firstvertexopen;
short countvertexopen;
short countvertexclose;
long firstvertexclose;
short op1x,op1y,op2x,op2y; //minimum bounding box for open
short cp1x,cp1y,cp2x,cp2y; //minimum bounding box for close
long firstblockopen;
short countblockopen;
short countblockclose;
long firstblockclose;
long unknown54; //short,short
char openres[8];
char closeres[8];
long cursortype;
short trapdetect;
short trapremoval;
short trapflags;
short trapdetflags;
short launchx, launchy;
char key[8];
char openscript[8];
long locked;
long lockremoval;
short locp1x, locp1y; //open location 1
short locp2x, locp2y; //open location 2
long strref; //check this for missing strings STRREF!!!
char regionlink[32];
long nameref; //this is unsure
char dialogref[8]; //also unsure
} area_door;
typedef struct {
char animname[32];
short posx, posy;
unsigned long schedule;
char bam[8];
short cyclenum;
short framenum;
short flags;
short unknown36;
short height;
short transparency;
short current; //current frame?
unsigned char progress;
unsigned char skipcycle;
char bmp[8]; //palette bmp
long unknown48;
} area_anim;
typedef struct {
short px,py;
long strref;
short unknownc;
short colour;
long cnt;
char unused[36];
} area_mapnote;
typedef struct {
long px, py;
char text[500];
long readonly;
long unused[5];
} pst_area_mapnote;
typedef struct {
char projectile[8];
long offset;
short size;
short proj;
short delay;
short explosions;
short posx,posy;
short posz;
unsigned char ea;
unsigned char caster;
} area_trap;
typedef struct {
char tilename[32];
char resref[8]; //script ?
long unknown;
long prstr;
long prnum;
long secstr;
long secnum;
char unused[48];
} area_tile;
typedef struct {
long unknown;
} area_tileflag;
typedef struct { //10 songrefs, day,night,battle, etc
long songs[10];
char dayambi1[8];
char dayambi2[8];
long volumed;
char nightambi1[8];
char nightambi2[8];
long volumen;
long songflag; //in pst
char unused[60];
} area_song;
typedef struct {
char intname[32];
long strrefs[10];
char creatures[10][8];
short creaturecnt; //entry number
short difficulty; //creature number depends on this
long unknown9c; //1000
short unknowna0; //1000
short unknowna2; //1000
short maxnumber; //??
short minnumber; //??
short day;
short night;
short unknownac;
short unknownae;
char unused[52];
} area_int;
typedef struct {
unsigned short x,y;
} area_vertex;
//this pointer list will free previous elements
//Do we need this for removehead/tail as well ?
class CMyPtrList : public CPtrList
{
public:
void RemoveAt(POSITION pos)
{
void *poi;
poi=GetAt(pos);
if(poi) delete [] poi;
CPtrList::RemoveAt(pos);
}
void SetAt(POSITION pos, void *poi)
{
void *poi2;
poi2=GetAt(pos);
if(poi2) delete [] poi2;
CPtrList::SetAt(pos,poi);
}
};
/* we won't use this, we will simply cut 4 bytes
typedef struct {
char filetype[4]; //'DLG '
char revision[4]; //'V1.0'
long numstates;
long offstates;
long numtrans;
long offtrans;
long offsttrigger;
long numsttrigger;
long offtrtrigger;
long numtrtrigger;
long offaction;
long numaction;
} dlg_header_old;
*/
typedef struct {
char filetype[4]; //'DLG '
char revision[4]; //'V1.0'
long numstates;
long offstates;
long numtrans;
long offtrans;
long offsttrigger;
long numsttrigger;
long offtrtrigger;
long numtrtrigger;
long offaction;
long numaction;
unsigned long flags;
} dlg_header;
typedef struct {
long actorstr;
long trindex; //transition index
long trnumber; //transition number
long stindex; //state trigger index
} dlg_state;
typedef struct {
long flags;
long playerstr;
long journalstr;
long trtrindex; //transition trigger index
long actionindex; //action index
char nextdlg[8]; //transition dlg
long stateindex; //next state index
} dlg_trans;
typedef struct {
long textoffset;
long textlength;
} offset_length;
typedef struct {
char filetype[4]; //'GAM '
char revision[4]; //'V1.0' or 'V2.0'
long gametime; //300 units == 1 hour
short formation;
short formations[5];
long gold;
short areaviewed;
short weather;
long pcoffset;
long pccount;
long unknown1offset;
long unknown1count;
long npcoffset;
long npccount;
long variableoffset;
long variablecount;
char currentarea[8];
long currentlink; //set this to -1
long journalcount;
long journaloffset;
long reputation;
char masterarea[8];
long controls;
long version;
long familiaroffset;
long slocoffset;
long sloccount;
long realtime;
long ppoffset;
long ppcount;
char unknown80[52];
} gam_header;
typedef struct {
char area[8];
short xpos, ypos;
} gam_sloc;
typedef struct {
char filetype[4]; //'GAME'
char revision[4]; //'V1.1'
long gametime; //300 units == 1 hour
short formation;
short formations[5];
long gold;
short unknown1c;
short unknown1e;
long pcoffset;
long pccount;
long unknown1offset;
long unknown1count;
long npcoffset;
long npccount;
long variableoffset;
long variablecount;
char mainarea[8];
long unknown48;
long journalcount;
long journaloffset;
long mazeoffset;
long reputation;
char curarea[8];
long dvaroffset;
long dvarcount;
long familiaroffset;
char unknownarea[8];
char unknown74[64];
} gam_pst_header;
typedef struct {
char familiars[9][8];
long offset;
} gam_familiar;
typedef struct {
short selected;
short slot;
long creoffset;
long cresize;
char creresref[8]; //name of resource (if creature isn't embedded)
long direction;
char curarea[8];
short xpos, ypos;
short vrectx, vrecty;
//bardsong = 1
//detecting traps = 2
//hide in shadows = 3
//turning undead = 4
short action;
short happiness;
char unknown2c[96];
} gam_npc;
typedef struct {
short weapons[4];
short wslots[4];
char quickspells[3][8];
short quickitems[3];
short quickslots[3];
char name[32];
long talkcount;
long nameofmpv; //name of most powerful vanquished
long xpofmpv; //xp of most powerful vanquished
long absent;
long joindate;
long unknown3;
long killxp; //this chapter
long killnum;
long totalkillxp;
long totalkillnum;
char favspell[4][8];
short favspcnt[4];
char favweap[4][8];
short favwpcnt[4];
char soundset[8];
} gam_bg_npc;
typedef struct {
short weapons[4];
short wslots[4];
char quickspells[3][8];
short quickitems[5];
short quickslots[5];
char name[32];
long talkcount; //numtimestalkedto
long nameofmpv; //name of most powerful vanquished
long xpofmpv; //xp of most powerful vanquished
long absent;
long joindate;
long withparty;
long killxp; //this chapter
long killnum;
long totalkillxp;
long totalkillnum;
char favspell[4][8];
short favspcnt[4];
char favweap[4][8];
short favwpcnt[4];
char soundset[8];
} gam_pst_npc;
typedef struct {
short weapons[4];
short wslots[4];
char quickspells[3][8];
short quickitems[3];
short quickslots[3];
char name[32];
long talkcount;
long nameofmpv; //name of most powerful vanquished
long xpofmpv; //xp of most powerful vanquished
long absent;
long joindate;
long unknown3;
long killxp; //this chapter
long killnum;
long totalkillxp;
long totalkillnum;
char favspell[4][8];
short favspcnt[4];
char favweap[4][8];
short favwpcnt[4];
char soundset[8];
char voiceset[32];
} gam_iwd_npc;
typedef struct {
short weapons[8];
short wslots[8];
char quickspells[9][8];
char qsclass[9];
char unknown;
short quickitems[3];
short quickslots[3];
char quickinnates[9][8];
char quicksongs[9][8];
long qslots[9];
char name[32];
long talkcount;
long nameofmpv; //name of most powerful vanquished
long xpofmpv; //xp of most powerful vanquished
long absent;
long joindate;
long unknown3;
long killxp; //this chapter
long killnum;
long totalkillxp;
long totalkillnum;
char favspell[4][8];
short favspcnt[4];
char favweap[4][8];
short favwpcnt[4];
char soundset[8];
char voiceset[32];
char unknown4[194];
} gam_iwd2_npc;
typedef union {
gam_bg_npc gbn;
gam_pst_npc gpn;
gam_iwd_npc gin;
gam_iwd2_npc gwn;
} gam_npc_extension;
typedef struct {
char unknown[20];
} gam_unknown1;
typedef struct {
char unknown[1720]; //not so big hack
} gam_mazedata;
typedef struct {
char variablename[32];
char unknown20[8];
long value;
char unknown2c[40];
} gam_variable;
typedef struct {
long strref;
long time;
unsigned char chapter;
unsigned char unknown09;
unsigned char section;
unsigned char user; //1f means user entry
} gam_journal;
typedef struct {
char filetype[4]; //'WMAP'
char revision[4]; //'V1.0'
long wmapcount;
long wmapoffset;
} map_mainheader;
typedef struct {
char mos[8];
long width;
long height;
long mapnumber;
long mapname; //strref!!!
long unknown18;
long unknown1c;
long areacount;
long areaoffset;
long arealinkoffset;
long arealinkcount;
char mapicons[8];
char unused38[128];
} map_header;
typedef struct {
char areaname[8]; //2da resref ?
char arearesref[8]; //area resref
char areadesc[32]; //for editors ?
long flags;
long bamindex; //bam index in mapicons.bam
long xpos,ypos;
long caption; //strref
long tooltip; //strref
char loadscreen[8]; //mos
long northidx;
long northcnt;
long westidx;
long westcnt;
long southidx;
long southcnt;
long eastidx;
long eastcnt;
char unused70[128];
} map_area;
typedef struct {
long link; //link to another 'map_area'
char entryname[32]; //an entrypoint (entrance in .are file)
long distancescale;
long flags; //entry direction (empty entryname is allowed?)
char encounters[5][8]; //encounter areas
long chance; //encounter chance
char unused58[128];
} map_arealink;
typedef struct {
char filetype[4];
char version[4];
unsigned long numtiles; //global size/5120
unsigned long tilelength;//5120
unsigned long offset; //20
unsigned long pixelsize; //64
} tis_header;
typedef struct {
char signature[2]; //BM
unsigned long fullsize; //offset+width*height
unsigned long unknown1; //zero, reserved
unsigned long offset; //0x36
unsigned long headersize; //0x28 (40) (the size of the rest of the header)
unsigned long width;
unsigned long height;
unsigned short planes; //1 ?
unsigned short bits; //24 3*8?
unsigned long compression; //0
unsigned long size; //width*height*3 (3 bytes for 24 bits)
unsigned long hres; //0xb12 ?
unsigned long vres; //0xb12 ?
unsigned long colors; //0
unsigned long impcolors; //important colors
} bmp_header;
typedef struct {
char signature[2]; //BM
unsigned long fullsize; //offset+width*height
unsigned long unknown1; //zero, reserved
unsigned long offset; //0x36
unsigned long headersize; //0x0c (12) (the size of the rest of the header)
unsigned short width;
unsigned short height;
unsigned short planes; //1 ?
unsigned short bits; //24 3*8?
} bmpos2_header;
//tbg & iap
typedef struct
{
char signature[4]; //TBG3
long unused; //null
char filename[12]; //filename+extension
long fileoffset;
long filelength;
long genre; //1-bg1, 2-pst, 3-iwd, 4-bg2, 5-iwd2
long textentryoffset;//strings start
long tlkentrycount; //text header count
long tlkentryoffset; //text header ofset
} tbg3_header;
typedef struct
{
char signature[4]; //TBG4
long unused; //null
char filename[12]; //filename+extension
long fileoffset;
long filelength;
long genre; //1-bg1, 2-pst, 3-iwd, 4-bg2, 5-iwd2
long textentryoffset;//strings start
long tlkentrycount; //text header count
long tlkentryoffset; //text header ofset
long strrefcount;
long strrefoffset;
long asciicount;
long asciioffset;
} tbg4_header;
typedef struct
{
char signature[4]; //TBG4
long unused; //null
long npccount;
long npcoffset;
short genre; //1-bg1, 2-pst, 3-iwd, 4-bg2, 5-iwd2
} tbgn_header;
typedef struct
{
char npcname[8];
char area[8];
short x;
short y;
} npc_header;
typedef struct //text header
{
long offset;
long length;
char soundref[8];
unsigned long volume;
unsigned long pitch;
unsigned short flags;
long strrefoffset;
long strrefcount;
long asciioffset;
long asciicount;
long asciimodoffset;
long asciimodcount;
} tbg_tlk_reference;
typedef struct
{
long offset;
long length;
long insert;
char soundref[8];
} tbg3_tlk_reference;
typedef struct {
int which;
unsigned long newvalue;
char newresource[8];
long strref;
long param1, param2; //to display parameters for effects
long projectile, projectile2;
short itemtype, itemtype2;
short feature, feature2;
char resource[8];
char itemname[8];
char variable[32];
unsigned char ea, ea2;
unsigned char general, general2;
unsigned char race, race2;
unsigned char class1, class2;
unsigned char specific, specific2;
unsigned char gender, gender2;
unsigned char align, align2;
} search_data;
typedef struct {
CString opcodetext;
CString opcodedesc;
CString par1;
CString par2;
} opcode_struct;
typedef struct
{
int bytes[14]; //iwd2 12, others 6
int area[4]; //only in pst, iwd
char var[8+32+1];
int bytes2[2]; //only in iwd2
} object;
class action
{
public:
int opcode;
object obj[3];
int bytes[5];
char var1[8+32+1];
char var2[8+32+1];
void Reset()
{
int i;
opcode=0;
memset(bytes,0,sizeof(bytes));
memset(var1,0,sizeof(var1));
memset(var2,0,sizeof(var2));
for(i=0;i<3;i++) memset(obj+i,0,sizeof(object) );
}
action()
{
Reset();
}
};
class response
{
public:
int weight;
int actioncount;
action *actions;
void Reset()
{
int i;
weight=0;
for(i=0;i<actioncount;i++) actions[i].Reset();
}
response()
{
actioncount=0;
actions=NULL;
weight=0;
}
};
class trigger
{
public:
int opcode;
bool negate;
int bytes[6]; //PST triggers got 2 extra bytes (points)
char var1[6+32+1];
char var2[6+32+1];
object trobj;
void Reset()
{
opcode=0;
negate=false;
memset(bytes,0,sizeof(bytes));
memset(var1,0,sizeof(var1));
memset(var2,0,sizeof(var2));
memset(&trobj,0,sizeof(object));
}
trigger()
{
Reset();
}
};
class block
{
public:
int triggercount;
trigger *triggers;
int responsecount;
response *responses;
void Reset()
{
int i;
for(i=0;i<triggercount;i++) triggers[i].Reset();
for(i=0;i<responsecount;i++) responses[i].Reset();
}
block()
{
triggercount=0;
responsecount=0;
triggers=NULL;
responses=NULL;
}
};
typedef struct
{
short type;
CString idsfile;
} parameter_data;
class compiler_data//hashed compiler data
{
public:
CString keyword;
int opcode;
int parnum;
int parnumx; //prototype code (parameter count, but strings add 16)
parameter_data *parameters;
public:
compiler_data()
{
parameters=NULL;
parnum=0;
}
};
typedef struct
{
int data[3];
} tooltip_data;
typedef struct
{
CString a,b;
} CString2;
typedef CList<CString2, CString2&> CString2List;
typedef CMap<CString, LPCSTR, int, int&> CStringMapInt;
typedef CMap<int, int, int, int&> CIntMapInt;
typedef CMap<int, int, CString, LPCSTR> CIntMapString;
typedef CMap<CString, LPCSTR, tooltip_data, tooltip_data&> CStringMapTooltip;
typedef CMap<CString, LPCSTR, compiler_data, compiler_data&> CStringMapToCompiler;
typedef CTypedPtrMap<CMapStringToOb, CString, CStringMapInt*> CStringMapToCStringMapInt;
typedef CMap<CString, LPCSTR, CString, LPCSTR> CStringMapString;
typedef CTypedPtrMap<CMapStringToOb, CString, CStringMapString*> CStringMapToCStringMapString;
typedef COLORREF palettetype[256];
typedef struct
{
unsigned long checkopt;
unsigned long editopt;
unsigned long gameopt;
CString bgfolder;
CString descpath;
} gameprops;
typedef CMap<CString, LPCSTR, gameprops, gameprops&> CStringMapGameProps;
#endif AFX_STRUCTS_H__42E3FDEA_0FCA_4733_8AD1_6E396250B019__INCLUDED_