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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
// Devilution reference knowledge base
// Source: https://github.com/diasurgical/devilution
// Compiler: MSVC 4.2 (Visual C++ 4.2)
// NOTE: Addresses are for DIABLO.EXE, not the current binary.
// Struct/enum definitions are portable across binaries.

// === Struct definitions (from Diablo 1 decomp) ===


//////////////////////////////////////////////////
// control
//////////////////////////////////////////////////

typedef struct RECT32 {
	int x;
	int y;
	int w;
	int h;
} RECT32;

//////////////////////////////////////////////////
// items
//////////////////////////////////////////////////

typedef struct PLStruct {
	const char *PLName;
	int PLPower;
	int PLParam1;
	int PLParam2;
	char PLMinLvl;
	int PLIType;
	BYTE PLGOE;
	BOOL PLDouble;
	BOOL PLOk;
	int PLMinVal;
	int PLMaxVal;
	int PLMultVal;
} PLStruct;

typedef struct UItemStruct {
	const char *UIName;
	char UIItemId;
	char UIMinLvl;
	char UINumPL;
	int UIValue;
	char UIPower1;
	int UIParam1;
	int UIParam2;
	char UIPower2;
	int UIParam3;
	int UIParam4;
	char UIPower3;
	int UIParam5;
	int UIParam6;
	char UIPower4;
	int UIParam7;
	int UIParam8;
	char UIPower5;
	int UIParam9;
	int UIParam10;
	char UIPower6;
	int UIParam11;
	int UIParam12;
} UItemStruct;

typedef struct ItemDataStruct {
	int iRnd;
	char iClass;
	char iLoc;
	int iCurs;
	char itype;
	char iItemId;
	const char *iName;
	const char *iSName;
	char iMinMLvl;
	int iDurability;
	int iMinDam;
	int iMaxDam;
	int iMinAC;
	int iMaxAC;
	char iMinStr;
	char iMinMag;
	char iMinDex;
	// item_special_effect
	int iFlags;
	// item_misc_id
	int iMiscId;
	// spell_id
	int iSpell;
	BOOL iUsable;
	int iValue;
	int iMaxValue;
} ItemDataStruct;

typedef struct ItemGetRecordStruct {
	int nSeed;
	unsigned short wCI;
	int nIndex;
	unsigned int dwTimestamp;
} ItemGetRecordStruct;

typedef struct ItemStruct {
	int _iSeed;
	WORD _iCreateInfo;
	int _itype;
	int _ix;
	int _iy;
	BOOL _iAnimFlag;
	unsigned char *_iAnimData; // PSX name -> ItemFrame
	int _iAnimLen;             // Number of frames in current animation
	int _iAnimFrame;           // Current frame of animation.
	int _iAnimWidth;
	int _iAnimWidth2; // width 2?
	BOOL _iDelFlag;   // set when item is flagged for deletion, deprecated in 1.02
	char _iSelFlag;
	BOOL _iPostDraw;
	BOOL _iIdentified;
	char _iMagical;
	char _iName[64];
	char _iIName[64];
	char _iLoc;
	// item_class enum
	char _iClass;
	int _iCurs;
	int _ivalue;
	int _iIvalue;
	int _iMinDam;
	int _iMaxDam;
	int _iAC;
	// item_special_effect
	int _iFlags;
	// item_misc_id
	int _iMiscId;
	// spell_id
	int _iSpell;
	int _iCharges;
	int _iMaxCharges;
	int _iDurability;
	int _iMaxDur;
	int _iPLDam;
	int _iPLToHit;
	int _iPLAC;
	int _iPLStr;
	int _iPLMag;
	int _iPLDex;
	int _iPLVit;
	int _iPLFR;
	int _iPLLR;
	int _iPLMR;
	int _iPLMana;
	int _iPLHP;
	int _iPLDamMod;
	int _iPLGetHit;
	int _iPLLight;
	char _iSplLvlAdd;
	char _iRequest;
	int _iUid;
	int _iFMinDam;
	int _iFMaxDam;
	int _iLMinDam;
	int _iLMaxDam;
	int _iPLEnAc;
	char _iPrePower;
	char _iSufPower;
	int _iVAdd1;
	int _iVMult1;
	int _iVAdd2;
	int _iVMult2;
	char _iMinStr;
	unsigned char _iMinMag;
	char _iMinDex;
	BOOL _iStatFlag;
	int IDidx;
	int offs016C; // _oldlight or _iInvalid
#ifdef HELLFIRE
	int _iDamAcFlags;
#endif
} ItemStruct;

//////////////////////////////////////////////////
// player
//////////////////////////////////////////////////

typedef struct PlayerStruct {
	int _pmode;
	char walkpath[MAX_PATH_LENGTH];
	BOOLEAN plractive;
	int destAction;
	int destParam1;
	int destParam2;
	int destParam3;
	int destParam4;
	int plrlevel;
	int _px;      // Tile X-position of player
	int _py;      // Tile Y-position of player
	int _pfutx;   // Future tile X-position of player. Set at start of walking animation
	int _pfuty;   // Future tile Y-position of player. Set at start of walking animation
	int _ptargx;  // Target tile X-position for player movment. Set during pathfinding
	int _ptargy;  // Target tile Y-position for player movment. Set during pathfinding
	int _pownerx; // Tile X-position of player. Set via network on player input
	int _pownery; // Tile X-position of player. Set via network on player input
	int _poldx;   // Most recent X-position in dPlayer.
	int _poldy;   // Most recent Y-position in dPlayer.
	int _pxoff;   // Player sprite's pixel X-offset from tile.
	int _pyoff;   // Player sprite's pixel Y-offset from tile.
	int _pxvel;   // Pixel X-velocity while walking. Indirectly applied to _pxoff via _pvar6
	int _pyvel;   // Pixel Y-velocity while walking. Indirectly applied to _pyoff via _pvar7
	int _pdir;    // Direction faced by player (direction enum)
	int _nextdir; // Unused
	int _pgfxnum; // Bitmask indicating what variant of the sprite the player is using. Lower byte define weapon (anim_weapon_id) and higher values define armour (starting with anim_armor_id)
	unsigned char *_pAnimData;
	int _pAnimDelay; // Tick length of each frame in the current animation
	int _pAnimCnt;   // Increases by one each game tick, counting how close we are to _pAnimDelay
	int _pAnimLen;   // Number of frames in current animation
	int _pAnimFrame; // Current frame of animation.
	int _pAnimWidth;
	int _pAnimWidth2;
	int _peflag;
	int _plid;
	int _pvid;
	int _pSpell;
	char _pSplType;
	char _pSplFrom;
	int _pTSpell;
	char _pTSplType;
	int _pRSpell;
	// enum spell_type
	char _pRSplType;
	int _pSBkSpell;
	char _pSBkSplType;
	char _pSplLvl[64];
	unsigned __int64 _pMemSpells;  // Bitmask of learned spells
	unsigned __int64 _pAblSpells;  // Bitmask of abilities
	unsigned __int64 _pScrlSpells; // Bitmask of spells avalible via scrolls
	UCHAR _pSpellFlags;
	int _pSplHotKey[4];
	char _pSplTHotKey[4];
	int _pwtype;
	BOOLEAN _pBlockFlag;
	BOOLEAN _pInvincible;
	char _pLightRad;
	BOOLEAN _pLvlChanging; // True when the player is transitioning between levels
	char _pName[PLR_NAME_LEN];
	// plr_class enum value.
	// TODO: this could very well be `enum plr_class _pClass`
	// since there are 3 bytes of alingment after this field.
	// it could just be that the compiler optimized away all accesses to
	// the higher bytes by using byte instructions, since all possible values
	// of plr_class fit into one byte.
	char _pClass;
	int _pStrength;
	int _pBaseStr;
	int _pMagic;
	int _pBaseMag;
	int _pDexterity;
	int _pBaseDex;
	int _pVitality;
	int _pBaseVit;
	int _pStatPts;
	int _pDamageMod;
	int _pBaseToBlk;
	int _pHPBase;
	int _pMaxHPBase;
	int _pHitPoints;
	int _pMaxHP;
	int _pHPPer;
	int _pManaBase;
	int _pMaxManaBase;
	int _pMana;
	int _pMaxMana;
	int _pManaPer;
	char _pLevel;
	char _pMaxLvl;
	int _pExperience;
	int _pMaxExp;
	int _pNextExper;
	char _pArmorClass;
	char _pMagResist;
	char _pFireResist;
	char _pLghtResist;
	int _pGold;
	BOOL _pInfraFlag;
	int _pVar1; // Used for referring to X-position of player when finishing moving one tile (also used to define target coordinates for spells and ranged attacks)
	int _pVar2; // Used for referring to Y-position of player when finishing moving one tile (also used to define target coordinates for spells and ranged attacks)
	int _pVar3; // Player's direction when ending movement. Also used for casting direction of SPL_FIREWALL.
	int _pVar4; // Used for storing X-position of a tile which should have its BFLAG_PLAYERLR flag removed after walking. When starting to walk the game places the player in the dPlayer array -1 in the Y coordinate, and uses BFLAG_PLAYERLR to check if it should be using -1 to the Y coordinate when rendering the player (also used for storing the level of a spell when the player casts it)
	int _pVar5; // Used for storing Y-position of a tile which should have its BFLAG_PLAYERLR flag removed after walking. When starting to walk the game places the player in the dPlayer array -1 in the Y coordinate, and uses BFLAG_PLAYERLR to check if it should be using -1 to the Y coordinate when rendering the player (also used for storing the level of a spell when the player casts it)
	int _pVar6; // Same as _pxoff but contains the value in a higher range
	int _pVar7; // Same as _pyoff but contains the value in a higher range
	int _pVar8; // Used for counting how close we are to reaching the next tile when walking (usually counts to 8, which is equal to the walk animation length). Also used for stalling the appearance of the options screen after dying in singleplayer
	BOOLEAN _pLvlVisited[NUMLEVELS];
	BOOLEAN _pSLvlVisited[NUMLEVELS]; // only 10 used
	int _pGFXLoad;
	unsigned char *_pNAnim[8]; // Stand animations
	int _pNFrames;
	int _pNWidth;
	unsigned char *_pWAnim[8]; // Walk animations
	int _pWFrames;
	int _pWWidth;
	unsigned char *_pAAnim[8]; // Attack animations
	int _pAFrames;
	int _pAWidth;
	int _pAFNum;
	unsigned char *_pLAnim[8]; // Lightning spell cast animations
	unsigned char *_pFAnim[8]; // Fire spell cast animations
	unsigned char *_pTAnim[8]; // Generic spell cast animations
	int _pSFrames;
	int _pSWidth;
	int _pSFNum;
	unsigned char *_pHAnim[8]; // Getting hit animations
	int _pHFrames;
	int _pHWidth;
	unsigned char *_pDAnim[8]; // Death animations
	int _pDFrames;
	int _pDWidth;
	unsigned char *_pBAnim[8]; // Block animations
	int _pBFrames;
	int _pBWidth;
	ItemStruct InvBody[NUM_INVLOC];
	ItemStruct InvList[NUM_INV_GRID_ELEM];
	int _pNumInv;
	char InvGrid[NUM_INV_GRID_ELEM];
	ItemStruct SpdList[MAXBELTITEMS];
	ItemStruct HoldItem;
	int _pIMinDam;
	int _pIMaxDam;
	int _pIAC;
	int _pIBonusDam;
	int _pIBonusToHit;
	int _pIBonusAC;
	int _pIBonusDamMod;
	unsigned __int64 _pISpells; // Bitmask of staff spell
	int _pIFlags;
	int _pIGetHit;
	char _pISplLvlAdd;
	char _pISplCost;
	int _pISplDur;
	int _pIEnAc;
	int _pIFMinDam;
	int _pIFMaxDam;
	int _pILMinDam;
	int _pILMaxDam;
	int _pOilType;
	unsigned char pTownWarps;
	unsigned char pDungMsgs;
	unsigned char pLvlLoad;
#ifdef HELLFIRE
	unsigned char pDungMsgs2;
#else
	unsigned char pBattleNet;
#endif
	BOOLEAN pManaShield;
	char bReserved[3];
	WORD wReflections;
	short wReserved[7];
	DWORD pDiabloKillLevel;
	int pDifficulty;
	int pDamAcFlags;
	int dwReserved[5];
	unsigned char *_pNData;
	unsigned char *_pWData;
	unsigned char *_pAData;
	unsigned char *_pLData;
	unsigned char *_pFData;
	unsigned char *_pTData;
	unsigned char *_pHData;
	unsigned char *_pDData;
	unsigned char *_pBData;
	void *pReserved;
} PlayerStruct;

//////////////////////////////////////////////////
// textdat
//////////////////////////////////////////////////

typedef struct TextDataStruct {
	const char *txtstr;
	int scrlltxt;
	int txtspd;
	int sfxnr;
} TextDataStruct;

//////////////////////////////////////////////////
// missiles
//////////////////////////////////////////////////

// TPDEF PTR FCN VOID MIADDPRC
// TPDEF PTR FCN VOID MIPROC

typedef struct MissileData {
	unsigned char mName;
	void (*mAddProc)(int, int, int, int, int, int, char, int, int);
	void (*mProc)(int);
	BOOL mDraw;
	unsigned char mType;
	unsigned char mResist;
	unsigned char mFileNum;
	int mlSFX;
	int miSFX;
} MissileData;

typedef struct MisFileData {
	unsigned char mAnimName;
	unsigned char mAnimFAmt;
	const char *mName;
	int mFlags;
	unsigned char *mAnimData[16];
	unsigned char mAnimDelay[16];
	unsigned char mAnimLen[16];
	int mAnimWidth[16];
	int mAnimWidth2[16];
} MisFileData;

typedef struct ChainStruct {
	int idx;
	int _mitype;
	int _mirange;
} ChainStruct;

typedef struct MissileStruct {
	int _mitype;  // Type of projectile (missile_id)
	int _mix;     // Tile X-position of the missile
	int _miy;     // Tile Y-position of the missile
	int _mixoff;  // Sprite pixel X-offset for the missile
	int _miyoff;  // Sprite pixel Y-offset for the missile
	int _mixvel;  // Missile tile X-velocity while walking. This gets added onto _mitxoff each game tick
	int _miyvel;  // Missile tile Y-velocity while walking. This gets added onto _mitxoff each game tick
	int _misx;    // Initial tile X-position for missile
	int _misy;    // Initial tile Y-position for missile
	int _mitxoff; // How far the missile has travelled in its lifespan along the X-axis. mix/miy/mxoff/myoff get updated every game tick based on this
	int _mityoff; // How far the missile has travelled in its lifespan along the Y-axis. mix/miy/mxoff/myoff get updated every game tick based on this
	int _mimfnum; // The direction of the missile (direction enum)
	int _mispllvl;
	BOOL _miDelFlag; // Indicate weather the missile should be deleted
	BYTE _miAnimType;
	int _miAnimFlags;
	unsigned char *_miAnimData;
	int _miAnimDelay; // Tick length of each frame in the current animation
	int _miAnimLen;   // Number of frames in current animation
	int _miAnimWidth;
	int _miAnimWidth2;
	int _miAnimCnt; // Increases by one each game tick, counting how close we are to _pAnimDelay
	int _miAnimAdd;
	int _miAnimFrame; // Current frame of animation.
	BOOL _miDrawFlag;
	BOOL _miLightFlag;
	BOOL _miPreFlag;
	int _miUniqTrans;
	int _mirange; // Time to live for the missile in game ticks, oncs 0 the missile will be marked for deletion via _miDelFlag
	int _misource;
	int _micaster;
	int _midam;
	BOOL _miHitFlag;
	int _midist; // Used for arrows to measure distance travelled (increases by 1 each game tick). Higher value is a penalty for accuracy calculation when hitting enemy
	int _mlid;
	int _mirnd;
	int _miVar1;
	int _miVar2;
	int _miVar3;
	int _miVar4;
	int _miVar5;
	int _miVar6;
	int _miVar7;
	int _miVar8;
} MissileStruct;

//////////////////////////////////////////////////
// effects/sound
//////////////////////////////////////////////////

typedef struct CKINFO {
	DWORD dwSize;
	DWORD dwOffset;
} CKINFO;

typedef struct TSnd {
	WAVEFORMATEX fmt;
	CKINFO chunk;
	const char *sound_path;
	LPDIRECTSOUNDBUFFER DSB;
	int start_tc;
} TSnd;

#pragma pack(push, 1)
typedef struct TSFX {
	unsigned char bFlags;
	const char *pszName;
	TSnd *pSnd;
} TSFX;
#pragma pack(pop)

//////////////////////////////////////////////////
// monster
//////////////////////////////////////////////////

typedef struct AnimStruct {
	BYTE *CMem;
	BYTE *Data[8];
	int Frames;
	int Rate;
} AnimStruct;

typedef struct MonsterData {
	int width;
	int mImage;
	const char *GraphicType;
	BOOL has_special;
	const char *sndfile;
	BOOL snd_special;
	BOOL has_trans;
	const char *TransFile;
	int Frames[6];
	int Rate[6];
	const char *mName;
	char mMinDLvl;
	char mMaxDLvl;
	char mLevel;
	int mMinHP;
	int mMaxHP;
	char mAi;
	int mFlags;
	unsigned char mInt;
	unsigned char mHit; // BUGFIX: Some monsters overflow this value on high difficulty
	unsigned char mAFNum;
	unsigned char mMinDamage;
	unsigned char mMaxDamage;
	unsigned char mHit2; // BUGFIX: Some monsters overflow this value on high difficulty
	unsigned char mAFNum2;
	unsigned char mMinDamage2;
	unsigned char mMaxDamage2;
	unsigned char mArmorClass;
	char mMonstClass;
	unsigned short mMagicRes;
	unsigned short mMagicRes2;
	unsigned short mTreasure;
	char mSelFlag;
	unsigned short mExp;
} MonsterData;

typedef struct CMonster {
#ifdef HELLFIRE
	int mtype;
#else
	unsigned char mtype;
#endif
	// TODO: Add enum for place flags
	unsigned char mPlaceFlags;
	AnimStruct Anims[6];
	TSnd *Snds[4][2];
	int width;
	int width2;
#ifdef HELLFIRE
	int mMinHP;
	int mMaxHP;
#else
	unsigned char mMinHP;
	unsigned char mMaxHP;
#endif
	BOOL has_special;
	unsigned char mAFNum;
	char mdeadval;
	MonsterData *MData;
	// A TRN file contains a sequence of colour transitions, represented
	// as indexes into a palette. (a 256 byte array of palette indices)
	BYTE *trans_file;
} CMonster;

typedef struct MonsterStruct { // note: missing field _mAFNum
	int _mMTidx;
	int _mmode; /* MON_MODE */
	unsigned char _mgoal;
	int _mgoalvar1;
	int _mgoalvar2;
	int _mgoalvar3;
	int field_18;
	unsigned char _pathcount;
	int _mx;                // Tile X-position of monster
	int _my;                // Tile Y-position of monster
	int _mfutx;             // Future tile X-position of monster. Set at start of walking animation
	int _mfuty;             // Future tile Y-position of monster. Set at start of walking animation
	int _moldx;             // Most recent X-position in dMonster.
	int _moldy;             // Most recent Y-position in dMonster.
	int _mxoff;             // Monster sprite's pixel X-offset from tile.
	int _myoff;             // Monster sprite's pixel Y-offset from tile.
	int _mxvel;             // Pixel X-velocity while walking. Applied to _mxoff
	int _myvel;             // Pixel Y-velocity while walking. Applied to _myoff
	int _mdir;              // Direction faced by monster (direction enum)
	int _menemy;            // The current target of the monster. An index into either the plr or monster array based on the _meflag value.
	unsigned char _menemyx; // X-coordinate of enemy (usually correspond's to the enemy's futx value)
	unsigned char _menemyy; // Y-coordinate of enemy (usually correspond's to the enemy's futy value)
	short falign_52;        // probably _mAFNum (unused)
	unsigned char *_mAnimData;
	int _mAnimDelay; // Tick length of each frame in the current animation
	int _mAnimCnt;   // Increases by one each game tick, counting how close we are to _pAnimDelay
	int _mAnimLen;   // Number of frames in current animation
	int _mAnimFrame; // Current frame of animation.
	BOOL _meflag;
	BOOL _mDelFlag;
	int _mVar1;
	int _mVar2;
	int _mVar3;
	int _mVar4;
	int _mVar5;
	int _mVar6; // Used as _mxoff but with a higher range so that we can correctly apply velocities of a smaller number
	int _mVar7; // Used as _myoff but with a higher range so that we can correctly apply velocities of a smaller number
	int _mVar8; // Value used to measure progress for moving from one tile to another
	int _mmaxhp;
	int _mhitpoints;
	unsigned char _mAi;
	unsigned char _mint;
	short falign_9A;
	int _mFlags;
	BYTE _msquelch;
	int falign_A4;
	int _lastx;
	int _lasty;
	int _mRndSeed;
	int _mAISeed;
	int falign_B8;
	unsigned char _uniqtype;
	unsigned char _uniqtrans;
	char _udeadval;
	char mWhoHit;
	char mLevel;
	unsigned short mExp;
	unsigned char mHit;
	unsigned char mMinDamage;
	unsigned char mMaxDamage;
	unsigned char mHit2;
	unsigned char mMinDamage2;
	unsigned char mMaxDamage2;
#ifdef HELLFIRE
	char mArmorClass;
#else
	unsigned char mArmorClass;
#endif
	char falign_CB;
	unsigned short mMagicRes;
	int mtalkmsg;
	unsigned char leader;
	unsigned char leaderflag;
	unsigned char packsize;
	unsigned char mlid;
	const char *mName;
	CMonster *MType;
	MonsterData *MData;
} MonsterStruct;

typedef struct UniqMonstStruct {
#ifdef HELLFIRE
	int mtype;
#else
	char mtype;
#endif
	const char *mName;
	const char *mTrnName;
	unsigned char mlevel;
	unsigned short mmaxhp;
	unsigned char mAi;
	unsigned char mint;
	unsigned char mMinDamage;
	unsigned char mMaxDamage;
	unsigned short mMagicRes;
	unsigned short mUnqAttr;
	unsigned char mUnqVar1;
	unsigned char mUnqVar2;
	int mtalkmsg;
} UniqMonstStruct;

//////////////////////////////////////////////////
// objects
//////////////////////////////////////////////////

typedef struct ObjDataStruct {
	char oload;
	char ofindex;
	char ominlvl;
	char omaxlvl;
	char olvltype;
	char otheme;
	char oquest;
	int oAnimFlag;
	int oAnimDelay; // Tick length of each frame in the current animation
	int oAnimLen;   // Number of frames in current animation
	int oAnimWidth;
	BOOL oSolidFlag;
	BOOL oMissFlag;
	BOOL oLightFlag;
	char oBreak;
	char oSelFlag;
	BOOL oTrapFlag;
} ObjDataStruct;

typedef struct ObjectStruct {
	int _otype;
	int _ox;
	int _oy;
	int _oLight;
	int _oAnimFlag;
	unsigned char *_oAnimData;
	int _oAnimDelay; // Tick length of each frame in the current animation
	int _oAnimCnt;   // Increases by one each game tick, counting how close we are to _pAnimDelay
	int _oAnimLen;   // Number of frames in current animation
	int _oAnimFrame; // Current frame of animation.
	int _oAnimWidth;
	int _oAnimWidth2;
	BOOL _oDelFlag;
	char _oBreak; // check
	BOOL _oSolidFlag;
	BOOL _oMissFlag;
	char _oSelFlag; // check
	BOOL _oPreFlag;
	BOOL _oTrapFlag;
	BOOL _oDoorFlag;
	int _olid;
	int _oRndSeed;
	int _oVar1;
	int _oVar2;
	int _oVar3;
	int _oVar4;
	int _oVar5;
	int _oVar6;
	int _oVar7;
	int _oVar8;
} ObjectStruct;

//////////////////////////////////////////////////
// portal
//////////////////////////////////////////////////

typedef struct PortalStruct {
	BOOL open;
	int x;
	int y;
	int level;
	int ltype;
	BOOL setlvl;
} PortalStruct;

//////////////////////////////////////////////////
// msg
//////////////////////////////////////////////////

#pragma pack(push, 1)
typedef struct TCmd {
	BYTE bCmd;
} TCmd;

typedef struct TCmdLoc {
	BYTE bCmd;
	BYTE x;
	BYTE y;
} TCmdLoc;

typedef struct TCmdLocParam1 {
	BYTE bCmd;
	BYTE x;
	BYTE y;
	WORD wParam1;
} TCmdLocParam1;

typedef struct TCmdLocParam2 {
	BYTE bCmd;
	BYTE x;
	BYTE y;
	WORD wParam1;
	WORD wParam2;
} TCmdLocParam2;

typedef struct TCmdLocParam3 {
	BYTE bCmd;
	BYTE x;
	BYTE y;
	WORD wParam1;
	WORD wParam2;
	WORD wParam3;
} TCmdLocParam3;

typedef struct TCmdParam1 {
	BYTE bCmd;
	WORD wParam1;
} TCmdParam1;

typedef struct TCmdParam2 {
	BYTE bCmd;
	WORD wParam1;
	WORD wParam2;
} TCmdParam2;

typedef struct TCmdParam3 {
	BYTE bCmd;
	WORD wParam1;
	WORD wParam2;
	WORD wParam3;
} TCmdParam3;

typedef struct TCmdGolem {
	BYTE bCmd;
	BYTE _mx;
	BYTE _my;
	BYTE _mdir;
	char _menemy;
	int _mhitpoints;
	BYTE _currlevel;
} TCmdGolem;

typedef struct TCmdQuest {
	BYTE bCmd;
	BYTE q;
	BYTE qstate;
	BYTE qlog;
	BYTE qvar1;
} TCmdQuest;

typedef struct TCmdGItem {
	BYTE bCmd;
	BYTE bMaster;
	BYTE bPnum;
	BYTE bCursitem;
	BYTE bLevel;
	BYTE x;
	BYTE y;
	WORD wIndx;
	WORD wCI;
	int dwSeed;
	BYTE bId;
	BYTE bDur;
	BYTE bMDur;
	BYTE bCh;
	BYTE bMCh;
	WORD wValue;
	DWORD dwBuff;
	int dwTime;
#ifdef HELLFIRE
	WORD wToHit;
	WORD wMaxDam;
	BYTE bMinStr;
	BYTE bMinMag;
	BYTE bMinDex;
	BYTE bAC;
#endif
} TCmdGItem;

typedef struct TCmdPItem {
	BYTE bCmd;
	BYTE x;
	BYTE y;
	WORD wIndx;
	WORD wCI;
	int dwSeed;
	BYTE bId;
	BYTE bDur;
	BYTE bMDur;
	BYTE bCh;
	BYTE bMCh;
	WORD wValue;
	DWORD dwBuff;
#ifdef HELLFIRE
	WORD wToHit;
	WORD wMaxDam;
	BYTE bMinStr;
	BYTE bMinMag;
	BYTE bMinDex;
	BYTE bAC;
#endif
} TCmdPItem;

typedef struct TCmdChItem {
	BYTE bCmd;
	BYTE bLoc;
	WORD wIndx;
	WORD wCI;
	int dwSeed;
	BOOLEAN bId;
} TCmdChItem;

typedef struct TCmdDelItem {
	BYTE bCmd;
	BYTE bLoc;
} TCmdDelItem;

typedef struct TCmdDamage {
	BYTE bCmd;
	BYTE bPlr;
	DWORD dwDam;
} TCmdDamage;

#ifdef HELLFIRE
typedef struct TCmdMonDamage {
	BYTE bCmd;
	WORD wMon;
	DWORD dwDam;
} TCmdMonDamage;
#endif

typedef struct TCmdPlrInfoHdr {
	BYTE bCmd;
	WORD wOffset;
	WORD wBytes;
} TCmdPlrInfoHdr;

typedef struct TCmdString {
	BYTE bCmd;
	char str[MAX_SEND_STR_LEN];
} TCmdString;

typedef struct TFakeCmdPlr {
	BYTE bCmd;
	BYTE bPlr;
} TFakeCmdPlr;

typedef struct TFakeDropPlr {
	BYTE bCmd;
	BYTE bPlr;
	DWORD dwReason;
} TFakeDropPlr;

typedef struct TSyncHeader {
	BYTE bCmd;
	BYTE bLevel;
	WORD wLen;
	BYTE bObjId;
	BYTE bObjCmd;
	BYTE bItemI;
	BYTE bItemX;
	BYTE bItemY;
	WORD wItemIndx;
	WORD wItemCI;
	DWORD dwItemSeed;
	BYTE bItemId;
	BYTE bItemDur;
	BYTE bItemMDur;
	BYTE bItemCh;
	BYTE bItemMCh;
	WORD wItemVal;
	DWORD dwItemBuff;
	BYTE bPInvLoc;
	WORD wPInvIndx;
	WORD wPInvCI;
	DWORD dwPInvSeed;
	BYTE bPInvId;
#ifdef HELLFIRE
	WORD wToHit;
	WORD wMaxDam;
	BYTE bMinStr;
	BYTE bMinMag;
	BYTE bMinDex;
	BYTE bAC;
#endif
} TSyncHeader;

typedef struct TSyncMonster {
	BYTE _mndx;
	BYTE _mx;
	BYTE _my;
	BYTE _menemy;
	BYTE _mdelta;
} TSyncMonster;

typedef struct TPktHdr {
	BYTE px;
	BYTE py;
	BYTE targx;
	BYTE targy;
	int php;
	int pmhp;
	BYTE bstr;
	BYTE bmag;
	BYTE bdex;
	WORD wCheck;
	WORD wLen;
} TPktHdr;

typedef struct TPkt {
	TPktHdr hdr;
	BYTE body[493];
} TPkt;

typedef struct DMonsterStr {
	BYTE _mx;
	BYTE _my;
	BYTE _mdir;
	BYTE _menemy;
	BYTE _mactive;
	int _mhitpoints;
} DMonsterStr;

typedef struct DObjectStr {
	BYTE bCmd;
} DObjectStr;

typedef struct DLevel {
	TCmdPItem item[MAXITEMS];
	DObjectStr object[MAXOBJECTS];
	DMonsterStr monster[MAXMONSTERS];
} DLevel;

typedef struct LocalLevel {
	BYTE automapsv[DMAXX][DMAXY];
} LocalLevel;

typedef struct DPortal {
	BYTE x;
	BYTE y;
	BYTE level;
	BYTE ltype;
	BYTE setlvl;
} DPortal;

typedef struct MultiQuests {
	BYTE qstate;
	BYTE qlog;
	BYTE qvar1;
} MultiQuests;

typedef struct DJunk {
	DPortal portal[MAXPORTAL];
	MultiQuests quests[MAXMULTIQUESTS];
} DJunk;
#pragma pack(pop)

typedef struct TMegaPkt {
	struct TMegaPkt *pNext;
	DWORD dwSpaceLeft;
	BYTE data[32000];
} TMegaPkt;

typedef struct TBuffer {
	DWORD dwNextWriteOffset;
	BYTE bData[4096];
} TBuffer;

//////////////////////////////////////////////////
// quests
//////////////////////////////////////////////////

typedef struct QuestStruct {
	unsigned char _qlevel;
	unsigned char _qtype;
	unsigned char _qactive;
	unsigned char _qlvltype;
	int _qtx;
	int _qty;
	unsigned char _qslvl;
	unsigned char _qidx;
#ifndef HELLFIRE
	unsigned char _qmsg;
#else
	unsigned int _qmsg;
#endif
	unsigned char _qvar1;
	unsigned char _qvar2;
	BOOL _qlog;
} QuestStruct;

typedef struct QuestData {
	unsigned char _qdlvl;
	char _qdmultlvl;
	unsigned char _qlvlt;
	unsigned char _qdtype;
	unsigned char _qdrnd;
	unsigned char _qslvl;
	int _qflags; /* unsigned char */
	int _qdmsg;
	const char *_qlstr;
} QuestData;

#ifdef HELLFIRE
typedef struct CornerStoneStruct {
	int x;
	int y;
	BOOL activated;
	ItemStruct item;
} CornerStoneStruct;
#endif

//////////////////////////////////////////////////
// gamemenu/gmenu
//////////////////////////////////////////////////

// TPDEF PTR FCN VOID TMenuFcn

typedef struct TMenuItem {
	DWORD dwFlags;
	const char *pszStr;
	void (*fnMenu)(BOOL); /* fix, should have one arg */
} TMenuItem;

// TPDEF PTR FCN VOID TMenuUpdateFcn

//////////////////////////////////////////////////
// spells
//////////////////////////////////////////////////

typedef struct SpellData {
	unsigned char sName;
	unsigned char sManaCost;
	unsigned char sType;
	const char *sNameText;
	const char *sSkillText;
	int sBookLvl;
	int sStaffLvl;
	BOOL sTargeted;
	BOOL sTownSpell;
	int sMinInt;
	unsigned char sSFX;
	unsigned char sMissiles[3];
	unsigned char sManaAdj;
	unsigned char sMinMana;
	int sStaffMin;
	int sStaffMax;
	int sBookCost;
	int sStaffCost;
} SpellData;

//////////////////////////////////////////////////
// towners
//////////////////////////////////////////////////

typedef struct TNQ {
	unsigned char _qsttype;
	unsigned char _qstmsg;
	BOOLEAN _qstmsgact;
} TNQ;

typedef struct TownerStruct {
	int _tmode;
	int _ttype;
	int _tx;    // Tile X-position of NPC
	int _ty;    // Tile Y-position of NPC
	int _txoff; // Sprite X-offset (unused)
	int _tyoff; // Sprite Y-offset (unused)
	int _txvel; // X-velocity during movement (unused)
	int _tyvel; // Y-velocity during movement (unused)
	int _tdir;  // Facing of NPC (unused)
	unsigned char *_tAnimData;
	int _tAnimDelay; // Tick length of each frame in the current animation
	int _tAnimCnt;   // Increases by one each game tick, counting how close we are to _pAnimDelay
	int _tAnimLen;   // Number of frames in current animation
	int _tAnimFrame; // Current frame of animation.
	int _tAnimFrameCnt;
	char _tAnimOrder;
	int _tAnimWidth;
	int _tAnimWidth2;
	int _tTenPer;
	int _teflag;
	int _tbtcnt;
	int _tSelFlag;
	BOOL _tMsgSaid;
	TNQ qsts[MAXQUESTS];
	int _tSeed;
	int _tVar1;
	int _tVar2;
	int _tVar3;
	int _tVar4;
	char _tName[PLR_NAME_LEN];
	unsigned char *_tNAnim[8];
	int _tNFrames;
	unsigned char *_tNData;
} TownerStruct;

typedef struct QuestTalkData {
	int _qinfra;
	int _qblkm;
	int _qgarb;
	int _qzhar;
	int _qveil;
	int _qmod;
	int _qbutch;
	int _qbol;
	int _qblind;
	int _qblood;
	int _qanvil;
	int _qwarlrd;
	int _qking;
	int _qpw;
	int _qbone;
	int _qvb;
#ifdef HELLFIRE
	int _qgrv;
	int _qfarm;
	int _qgirl;
	int _qtrade;
	int _qdefiler;
	int _qnakrul;
	int _qjersy;
	int _qhf8;
#endif
} QuestTalkData;

//////////////////////////////////////////////////
// gendung
//////////////////////////////////////////////////

typedef struct ScrollStruct {
	int _sxoff; // X-offset of camera position. This usually corresponds to a negative version of plr[myplr]._pxoff
	int _syoff; // Y-offset of camera position. This usually corresponds to a negative version of plr[myplr]._pyoff
	int _sdx;
	int _sdy;
	int _sdir;
} ScrollStruct;

typedef struct THEME_LOC {
	int x;
	int y;
	int ttval;
	int width;
	int height;
} THEME_LOC;

typedef struct MICROS {
	WORD mt[16];
} MICROS;

//////////////////////////////////////////////////
// drlg
//////////////////////////////////////////////////

typedef struct ShadowStruct {
	unsigned char strig;
	unsigned char s1;
	unsigned char s2;
	unsigned char s3;
	unsigned char nv1;
	unsigned char nv2;
	unsigned char nv3;
} ShadowStruct;

typedef struct HALLNODE {
	int nHallx1;
	int nHally1;
	int nHallx2;
	int nHally2;
	int nHalldir;
	struct HALLNODE *pNext;
} HALLNODE;

typedef struct ROOMNODE {
	int nRoomx1;
	int nRoomy1;
	int nRoomx2;
	int nRoomy2;
	int nRoomDest;
} ROOMNODE;

//////////////////////////////////////////////////
// themes
//////////////////////////////////////////////////

typedef struct ThemeStruct {
	char ttype; /* aligned 4 */
	int ttval;
} ThemeStruct;

//////////////////////////////////////////////////
// inv
//////////////////////////////////////////////////

typedef struct InvXY {
	int X;
	int Y;
} InvXY;

//////////////////////////////////////////////////
// lighting
//////////////////////////////////////////////////

typedef struct LightListStruct {
	int _lx;
	int _ly;
	int _lradius;
	int _lid;
	int _ldel;
	int _lunflag;
	int field_18;
	int _lunx;
	int _luny;
	int _lunr;
	int _xoff;
	int _yoff;
	int _lflags;
} LightListStruct;

//////////////////////////////////////////////////
// dead
//////////////////////////////////////////////////

typedef struct DeadStruct {
	unsigned char *_deadData[8];
	int _deadFrame;
	int _deadWidth;
	int _deadWidth2;
	char _deadtrans;
} DeadStruct;

//////////////////////////////////////////////////
// diabloui
//////////////////////////////////////////////////

// TPDEF PTR FCN VOID PLAYSND

typedef struct _gamedata {
	int dwSeed;
	BYTE bDiff;
} _gamedata;

typedef struct _uidefaultstats {
	WORD strength;
	WORD magic;
	WORD dexterity;
	WORD vitality;
} _uidefaultstats;

typedef struct _uiheroinfo {
	struct _uiheroinfo *next;
	char name[16];
	WORD level;
	BYTE heroclass;
	BYTE herorank;
	WORD strength;
	WORD magic;
	WORD dexterity;
	WORD vitality;
	int gold;
	int hassaved;
	BOOL spawned;
} _uiheroinfo;

// TPDEF PTR FCN UCHAR ENUMHEROPROC
// TPDEF PTR FCN UCHAR ENUMHEROS
// TPDEF PTR FCN UCHAR CREATEHERO
// TPDEF PTR FCN UCHAR DELETEHERO
// TPDEF PTR FCN UCHAR GETDEFHERO

// TPDEF PTR FCN INT PROGRESSFCN

//////////////////////////////////////////////////
// storm
//////////////////////////////////////////////////

// TPDEF PTR FCN UCHAR SMSGIDLEPROC
// TPDEF PTR FCN VOID SMSGHANDLER

typedef struct _SNETCAPS {
	DWORD size;
	DWORD flags;
	DWORD maxmessagesize;
	DWORD maxqueuesize;
	DWORD maxplayers;
	DWORD bytessec;
	DWORD latencyms;
	DWORD defaultturnssec;
	DWORD defaultturnsintransit;
} _SNETCAPS;

typedef struct _SNETEVENT {
	DWORD eventid;
	DWORD playerid;
	void *data;
	DWORD databytes;
} _SNETEVENT;

// TPDEF PTR FCN UCHAR SNETABORTPROC
// TPDEF PTR FCN UCHAR SNETCATEGORYPROC
// TPDEF PTR FCN UCHAR SNETCHECKAUTHPROC
// TPDEF PTR FCN UCHAR SNETCREATEPROC
// TPDEF PTR FCN UCHAR SNETDRAWDESCPROC
// TPDEF PTR FCN UCHAR SNETENUMDEVICESPROC
// TPDEF PTR FCN UCHAR SNETENUMGAMESPROC
// TPDEF PTR FCN UCHAR SNETENUMPROVIDERSPROC
// TPDEF PTR FCN VOID SNETEVENTPROC
// TPDEF PTR FCN UCHAR SNETGETARTPROC
// TPDEF PTR FCN UCHAR SNETGETDATAPROC
// TPDEF PTR FCN INT SNETMESSAGEBOXPROC
// TPDEF PTR FCN UCHAR SNETPLAYSOUNDPROC
// TPDEF PTR FCN UCHAR SNETSELECTEDPROC
// TPDEF PTR FCN UCHAR SNETSTATUSPROC

typedef struct _SNETPLAYERDATA {
	int size;
	char *playername;
	char *playerdescription;
	int reserved;
} _SNETPLAYERDATA;

typedef struct _SNETPROGRAMDATA {
	int size;
	const char *programname;
	const char *programdescription;
	int programid;
	int versionid;
	int reserved1;
	int maxplayers;
	_gamedata *initdata;
	int initdatabytes;
	void *reserved2;
	int optcategorybits;
	char *cdkey;
	char *registereduser;
	int spawned;
	int lcid;
} _SNETPROGRAMDATA;

typedef struct _SNETUIDATA {
	int size;
	int uiflags;
	HWND parentwindow;
	void (*artcallback)();
	void (*authcallback)();
	void (*createcallback)();
	void (*drawdesccallback)();
	void (*selectedcallback)();
	void (*messageboxcallback)();
	void (*soundcallback)();
	void (*statuscallback)();
	void (*getdatacallback)();
	void (*categorycallback)();
	void (*categorylistcallback)();
	void (*newaccountcallback)();
	void (*profilecallback)();
	const char **profilefields;
	void (*profilebitmapcallback)();
	int(__stdcall *selectnamecallback)(
	    const struct _SNETPROGRAMDATA *,
	    const struct _SNETPLAYERDATA *,
	    const struct _SNETUIDATA *,
	    const struct _SNETVERSIONDATA *,
	    DWORD provider, /* e.g. 'IPXN', 'BNET' etc. */
	    char *, DWORD,  /* character name will be copied here */
	    char *, DWORD,  /* character "description" will be copied here (used to advertise games) */
	    BOOL *          /* new character? - unsure about this */
	);
	void (*changenamecallback)();
} _SNETUIDATA;

typedef struct _SNETVERSIONDATA {
	int size;
	const char *versionstring;
	const char *executablefile;
	const char *originalarchivefile;
	const char *patcharchivefile;
} _SNETVERSIONDATA;

// TPDEF PTR FCN UCHAR SNETSPIBIND
// TPDEF PTR FCN UCHAR SNETSPIQUERY

//////////////////////////////////////////////////
// pack
//////////////////////////////////////////////////

#pragma pack(push, 1)
typedef struct PkItemStruct {
	DWORD iSeed;
	WORD iCreateInfo;
	WORD idx;
	BYTE bId;
	BYTE bDur;
	BYTE bMDur;
	BYTE bCh;
	BYTE bMCh;
	WORD wValue;
	DWORD dwBuff;
} PkItemStruct;

typedef struct PkPlayerStruct {
	FILETIME archiveTime;
	char destAction;
	char destParam1;
	char destParam2;
	BYTE plrlevel;
	BYTE px;
	BYTE py;
	BYTE targx;
	BYTE targy;
	char pName[PLR_NAME_LEN];
	char pClass;
	BYTE pBaseStr;
	BYTE pBaseMag;
	BYTE pBaseDex;
	BYTE pBaseVit;
	char pLevel;
	BYTE pStatPts;
	int pExperience;
	int pGold;
	int pHPBase;
	int pMaxHPBase;
	int pManaBase;
	int pMaxManaBase;
	char pSplLvl[37]; // Should be MAX_SPELLS but set to 37 to make save games compatible
	unsigned __int64 pMemSpells;
	PkItemStruct InvBody[NUM_INVLOC];
	PkItemStruct InvList[NUM_INV_GRID_ELEM];
	char InvGrid[NUM_INV_GRID_ELEM];
	BYTE _pNumInv;
	PkItemStruct SpdList[MAXBELTITEMS];
	char pTownWarps;
	char pDungMsgs;
	char pLvlLoad;
#ifdef HELLFIRE
	unsigned char pDungMsgs2;
#else
	char pBattleNet;
#endif
	BOOLEAN pManaShield;
	char bReserved[3];
	WORD wReflections;
	short wReserved2;
	char pSplLvl2[10]; // Hellfire spells
	short wReserved8;
	DWORD pDiabloKillLevel;
	int pDifficulty;
	int pDamAcFlags;
	int dwReserved[5];
} PkPlayerStruct;
#pragma pack(pop)

//////////////////////////////////////////////////
// path
//////////////////////////////////////////////////

typedef struct PATHNODE {
	char f;
	char h;
	char g;
	int x;
	int y;
	struct PATHNODE *Parent;
	struct PATHNODE *Child[8];
	struct PATHNODE *NextNode;
} PATHNODE;

// TPDEF PTR FCN UCHAR CHECKFUNC1

// TPDEF PTR FCN UCHAR CHECKFUNC

//////////////////////////////////////////////////
// sha
//////////////////////////////////////////////////

typedef struct SHA1Context {
	int state[5];
	int count[2];
	char buffer[64];
} SHA1Context;

//////////////////////////////////////////////////
// tmsg
//////////////////////////////////////////////////

#pragma pack(push, 1)
typedef struct TMsg TMsg;

typedef struct TMsgHdr {
	TMsg *pNext;
	int dwTime;
	BYTE bLen;
} TMsgHdr;

typedef struct TMsg {
	TMsgHdr hdr;
	// this is actually alignment padding, but the message body is appended to the struct
	// so it's convenient to use byte-alignment and name it "body"
	unsigned char body[3];
} TMsg;
#pragma pack(pop)

//////////////////////////////////////////////////
// mpqapi
//////////////////////////////////////////////////

typedef struct _FILEHEADER {
	int signature;
	int headersize;
	int filesize;
	WORD version;
	short sectorsizeid;
	int hashoffset;
	int blockoffset;
	int hashcount;
	int blockcount;
	char pad[72];
} _FILEHEADER;

typedef struct _HASHENTRY {
	int hashcheck[2];
	int lcid;
	int block;
} _HASHENTRY;

typedef struct _BLOCKENTRY {
	int offset;
	int sizealloc;
	int sizefile;
	int flags;
} _BLOCKENTRY;

// TPDEF PTR FCN UCHAR TGetNameFcn

// TPDEF PTR FCN VOID TCrypt

//////////////////////////////////////////////////
// trigs
//////////////////////////////////////////////////

typedef struct TriggerStruct {
	int _tx;
	int _ty;
	int _tmsg;
	int _tlvl;
} TriggerStruct;

//////////////////////////////////////////////////
// stores
//////////////////////////////////////////////////

typedef struct STextStruct {
	int _sx;
	int _syoff;
	char _sstr[128];
	BOOL _sjust;
	char _sclr;
	int _sline;
	BOOL _ssel;
	int _sval;
} STextStruct;

//////////////////////////////////////////////////
// wave
//////////////////////////////////////////////////

typedef struct MEMFILE {
	DWORD end;
	LONG offset;
	DWORD buf_len;
	DWORD dist;
	DWORD bytes_to_read;
	BYTE *buf;
	HANDLE file;
} MEMFILE;

//////////////////////////////////////////////////
// plrmsg
//////////////////////////////////////////////////

typedef struct _plrmsg {
	DWORD time;
	unsigned char player;
	char str[144];
} _plrmsg;

//////////////////////////////////////////////////
// capture
//////////////////////////////////////////////////

typedef struct _PcxHeader {
	BYTE Manufacturer;
	BYTE Version;
	BYTE Encoding;
	BYTE BitsPerPixel;
	WORD Xmin;
	WORD Ymin;
	WORD Xmax;
	WORD Ymax;
	WORD HDpi;
	WORD VDpi;
	BYTE Colormap[48];
	BYTE Reserved;
	BYTE NPlanes;
	WORD BytesPerLine;
	WORD PaletteInfo;
	WORD HscreenSize;
	WORD VscreenSize;
	BYTE Filler[54];
} PCXHEADER;

//////////////////////////////////////////////////
// encrypt
//////////////////////////////////////////////////

typedef struct TDataInfo {
	BYTE *srcData;
	DWORD srcOffset;
	BYTE *destData;
	DWORD destOffset;
	DWORD size;
} TDataInfo;

// === Enum definitions ===


typedef enum item_quality {
	ITEM_QUALITY_NORMAL = 0,
	ITEM_QUALITY_MAGIC  = 1,
	ITEM_QUALITY_UNIQUE = 2,
} item_quality;

typedef enum unique_base_item {
	UITYPE_NONE        = 0x0,
	UITYPE_SHORTBOW    = 0x1,
	UITYPE_LONGBOW     = 0x2,
	UITYPE_HUNTBOW     = 0x3,
	UITYPE_COMPBOW     = 0x4,
	UITYPE_WARBOW      = 0x5,
	UITYPE_BATTLEBOW   = 0x6,
	UITYPE_DAGGER      = 0x7,
	UITYPE_FALCHION    = 0x8,
	UITYPE_CLAYMORE    = 0x9,
	UITYPE_BROADSWR    = 0xA,
	UITYPE_SABRE       = 0xB,
	UITYPE_SCIMITAR    = 0xC,
	UITYPE_LONGSWR     = 0xD,
	UITYPE_BASTARDSWR  = 0xE,
	UITYPE_TWOHANDSWR  = 0xF,
	UITYPE_GREATSWR    = 0x10,
	UITYPE_CLEAVER     = 0x11,
	UITYPE_LARGEAXE    = 0x12,
	UITYPE_BROADAXE    = 0x13,
	UITYPE_SMALLAXE    = 0x14,
	UITYPE_BATTLEAXE   = 0x15,
	UITYPE_GREATAXE    = 0x16,
	UITYPE_MACE        = 0x17,
	UITYPE_MORNSTAR    = 0x18,
	UITYPE_SPIKCLUB    = 0x19,
	UITYPE_MAUL        = 0x1A,
	UITYPE_WARHAMMER   = 0x1B,
	UITYPE_FLAIL       = 0x1C,
	UITYPE_LONGSTAFF   = 0x1D,
	UITYPE_SHORTSTAFF  = 0x1E,
	UITYPE_COMPSTAFF   = 0x1F,
	UITYPE_QUARSTAFF   = 0x20,
	UITYPE_WARSTAFF    = 0x21,
	UITYPE_SKULLCAP    = 0x22,
	UITYPE_HELM        = 0x23,
	UITYPE_GREATHELM   = 0x24,
	UITYPE_CROWN       = 0x25,
	UITYPE_38          = 0x26,
	UITYPE_RAGS        = 0x27,
	UITYPE_STUDARMOR   = 0x28,
	UITYPE_CLOAK       = 0x29,
	UITYPE_ROBE        = 0x2A,
	UITYPE_CHAINMAIL   = 0x2B,
	UITYPE_LEATHARMOR  = 0x2C,
	UITYPE_BREASTPLATE = 0x2D,
	UITYPE_CAPE        = 0x2E,
	UITYPE_PLATEMAIL   = 0x2F,
	UITYPE_FULLPLATE   = 0x30,
	UITYPE_BUCKLER     = 0x31,
	UITYPE_SMALLSHIELD = 0x32,
	UITYPE_LARGESHIELD = 0x33,
	UITYPE_KITESHIELD  = 0x34,
	UITYPE_GOTHSHIELD  = 0x35,
	UITYPE_RING        = 0x36,
	UITYPE_55          = 0x37,
	UITYPE_AMULET      = 0x38,
	UITYPE_SKCROWN     = 0x39,
	UITYPE_INFRARING   = 0x3A,
	UITYPE_OPTAMULET   = 0x3B,
	UITYPE_TRING       = 0x3C,
	UITYPE_HARCREST    = 0x3D,
	UITYPE_MAPOFDOOM   = 0x3E,
	UITYPE_ELIXIR      = 0x3F,
	UITYPE_ARMOFVAL    = 0x40,
	UITYPE_STEELVEIL   = 0x41,
	UITYPE_GRISWOLD    = 0x42,
	UITYPE_LGTFORGE    = 0x43,
	UITYPE_LAZSTAFF    = 0x44,
#ifdef HELLFIRE
	UITYPE_BOVINE      = 0x45,
#endif
	UITYPE_INVALID     = -1,
} unique_base_item;

typedef enum item_effect_type {
	IPL_TOHIT            = 0x0,
	IPL_TOHIT_CURSE      = 0x1,
	IPL_DAMP             = 0x2,
	IPL_DAMP_CURSE       = 0x3,
	IPL_TOHIT_DAMP       = 0x4,
	IPL_TOHIT_DAMP_CURSE = 0x5,
	IPL_ACP              = 0x6,
	IPL_ACP_CURSE        = 0x7,
	IPL_FIRERES          = 0x8,
	IPL_LIGHTRES         = 0x9,
	IPL_MAGICRES         = 0xA,
	IPL_ALLRES           = 0xB,
	IPL_SPLCOST          = 0xC, /* only used in beta */
	IPL_SPLDUR           = 0xD, /* only used in beta */
	IPL_SPLLVLADD        = 0xE,
	IPL_CHARGES          = 0xF,
	IPL_FIREDAM          = 0x10,
	IPL_LIGHTDAM         = 0x11,
	IPL_STR              = 0x13,
	IPL_STR_CURSE        = 0x14,
	IPL_MAG              = 0x15,
	IPL_MAG_CURSE        = 0x16,
	IPL_DEX              = 0x17,
	IPL_DEX_CURSE        = 0x18,
	IPL_VIT              = 0x19,
	IPL_VIT_CURSE        = 0x1A,
	IPL_ATTRIBS          = 0x1B,
	IPL_ATTRIBS_CURSE    = 0x1C,
	IPL_GETHIT_CURSE     = 0x1D,
	IPL_GETHIT           = 0x1E,
	IPL_LIFE             = 0x1F,
	IPL_LIFE_CURSE       = 0x20,
	IPL_MANA             = 0x21,
	IPL_MANA_CURSE       = 0x22,
	IPL_DUR              = 0x23,
	IPL_DUR_CURSE        = 0x24,
	IPL_INDESTRUCTIBLE   = 0x25,
	IPL_LIGHT            = 0x26,
	IPL_LIGHT_CURSE      = 0x27,
	IPL_MULT_ARROWS      = 0x29, /* only used in hellfire */
	IPL_FIRE_ARROWS      = 0x2A,
	IPL_LIGHT_ARROWS     = 0x2B,
	IPL_INVCURS          = 0x2C,
	IPL_THORNS           = 0x2D,
	IPL_NOMANA           = 0x2E,
	IPL_NOHEALPLR        = 0x2F,
	IPL_FIREBALL         = 0x32, /* only used in hellfire */
	IPL_ABSHALFTRAP      = 0x34,
	IPL_KNOCKBACK        = 0x35,
	IPL_NOHEALMON        = 0x36,
	IPL_STEALMANA        = 0x37,
	IPL_STEALLIFE        = 0x38,
	IPL_TARGAC           = 0x39,
	IPL_FASTATTACK       = 0x3A,
	IPL_FASTRECOVER      = 0x3B,
	IPL_FASTBLOCK        = 0x3C,
	IPL_DAMMOD           = 0x3D,
	IPL_RNDARROWVEL      = 0x3E,
	IPL_SETDAM           = 0x3F,
	IPL_SETDUR           = 0x40,
	IPL_NOMINSTR         = 0x41,
	IPL_SPELL            = 0x42,
	IPL_FASTSWING        = 0x43,
	IPL_ONEHAND          = 0x44,
	IPL_3XDAMVDEM        = 0x45,
	IPL_ALLRESZERO       = 0x46,
	IPL_DRAINLIFE        = 0x48,
	IPL_RNDSTEALLIFE     = 0x49,
	IPL_INFRAVISION      = 0x4A,
	IPL_SETAC            = 0x4B,
	IPL_ADDACLIFE        = 0x4C,
	IPL_ADDMANAAC        = 0x4D,
	IPL_FIRERESCLVL      = 0x4E,
	IPL_AC_CURSE         = 0x4F,
#ifdef HELLFIRE
	IPL_FIRERES_CURSE    = 0x50,
	IPL_LIGHTRES_CURSE   = 0x51,
	IPL_MAGICRES_CURSE   = 0x52,
	IPL_ALLRES_CURSE     = 0x53,
	IPL_DEVASTATION      = 0x54,
	IPL_DECAY            = 0x55,
	IPL_PERIL            = 0x56,
	IPL_JESTERS          = 0x57,
	IPL_CRYSTALLINE      = 0x58,
	IPL_DOPPELGANGER     = 0x59,
	IPL_ACDEMON          = 0x5A,
	IPL_ACUNDEAD         = 0x5B,
	IPL_MANATOLIFE       = 0x5C,
	IPL_LIFETOMANA       = 0x5D,
#endif
	IPL_INVALID          = -1,
} item_effect_type;

typedef enum affix_item_type {
	PLT_MISC  = 0x1,
	PLT_BOW   = 0x10,
	PLT_STAFF = 0x100,
	PLT_WEAP  = 0x1000,
	PLT_SHLD  = 0x10000,
	PLT_ARMO  = 0x100000,
} affix_item_type;

/// Item graphic IDs; frame_num-11 of objcurs.cel.
typedef enum item_cursor_graphic {
	ICURS_POTION_OF_FULL_MANA         = 0,
	ICURS_SCROLL_OF                   = 1,
	ICURS_GOLD_SMALL                  = 4,
	ICURS_GOLD_MEDIUM                 = 5,
	ICURS_GOLD_LARGE                  = 6,
	ICURS_RING_OF_TRUTH               = 10,
	ICURS_RING                        = 12,
	ICURS_SPECTRAL_ELIXIR             = 15,
	ICURS_GOLDEN_ELIXIR               = 17,
	ICURS_EMPYREAN_BAND               = 18,
	ICURS_EAR_SORCEROR                = 19,
	ICURS_EAR_WARRIOR                 = 20,
	ICURS_EAR_ROGUE                   = 21,
	ICURS_BLOOD_STONE                 = 25,
#ifdef HELLFIRE
	ICURS_OIL                         = 30,
#endif
	ICURS_ELIXIR_OF_VITALITY          = 31,
	ICURS_POTION_OF_HEALING           = 32,
	ICURS_POTION_OF_FULL_REJUVENATION = 33,
	ICURS_ELIXIR_OF_MAGIC             = 34,
	ICURS_POTION_OF_FULL_HEALING      = 35,
	ICURS_ELIXIR_OF_DEXTERITY         = 36,
	ICURS_POTION_OF_REJUVENATION      = 37,
	ICURS_ELIXIR_OF_STRENGTH          = 38,
	ICURS_POTION_OF_MANA              = 39,
	ICURS_BRAIN                       = 40,
	ICURS_OPTIC_AMULET                = 44,
	ICURS_AMULET                      = 45,
	ICURS_DAGGER                      = 51,
	ICURS_BLADE                       = 56,
	ICURS_BASTARD_SWORD               = 57,
	ICURS_MACE                        = 59,
	ICURS_LONG_SWORD                  = 60,
	ICURS_BROAD_SWORD                 = 61,
	ICURS_FALCHION                    = 62,
	ICURS_MORNING_STAR                = 63,
	ICURS_SHORT_SWORD                 = 64,
	ICURS_CLAYMORE                    = 65,
	ICURS_CLUB                        = 66,
	ICURS_SABRE                       = 67,
	ICURS_SPIKED_CLUB                 = 70,
	ICURS_SCIMITAR                    = 72,
	ICURS_FULL_HELM                   = 75,
	ICURS_MAGIC_ROCK                  = 76,
	ICURS_THE_UNDEAD_CROWN            = 78,
	ICURS_HELM                        = 82,
	ICURS_BUCKLER                     = 83,
	ICURS_VIEL_OF_STEEL               = 85,
	ICURS_BOOK_GREY                   = 86,
	ICURS_BOOK_RED                    = 87,
	ICURS_BOOK_BLUE                   = 88,
	ICURS_BLACK_MUSHROOM              = 89,
	ICURS_SKULL_CAP                   = 90,
	ICURS_CAP                         = 91,
	ICURS_HARLEQUIN_CREST             = 93,
	ICURS_CROWN                       = 95,
	ICURS_MAP_OF_THE_STARS            = 96,
	ICURS_FUNGAL_TOME                 = 97,
	ICURS_GREAT_HELM                  = 98,
	ICURS_BATTLE_AXE                  = 101,
	ICURS_HUNTERS_BOW                 = 102,
	ICURS_FIELD_PLATE                 = 103,
	ICURS_SMALL_SHIELD                = 105,
	ICURS_CLEAVER                     = 106,
	ICURS_STUDDED_LEATHER_ARMOR       = 107,
	ICURS_SHORT_STAFF                 = 109,
	ICURS_TWO_HANDED_SWORD            = 110,
	ICURS_CHAIN_MAIL                  = 111,
	ICURS_SMALL_AXE                   = 112,
	ICURS_KITE_SHIELD                 = 113,
	ICURS_SCALE_MAIL                  = 114,
	ICURS_SHORT_BOW                   = 118,
	ICURS_LONG_WAR_BOW                = 119,
	ICURS_WAR_HAMMER                  = 121,
	ICURS_MAUL                        = 122,
	ICURS_LONG_STAFF                  = 123,
	ICURS_WAR_STAFF                   = 124,
	ICURS_TAVERN_SIGN                 = 126,
	ICURS_HARD_LEATHER_ARMOR          = 127,
	ICURS_RAGS                        = 128,
	ICURS_QUILTED_ARMOR               = 129,
	ICURS_FLAIL                       = 131,
	ICURS_TOWER_SHIELD                = 132,
	ICURS_COMPOSITE_BOW               = 133,
	ICURS_GREAT_SWORD                 = 134,
	ICURS_LEATHER_ARMOR               = 135,
	ICURS_SPLINT_MAIL                 = 136,
	ICURS_ROBE                        = 137,
	ICURS_ANVIL_OF_FURY               = 140,
	ICURS_BROAD_AXE                   = 141,
	ICURS_LARGE_AXE                   = 142,
	ICURS_GREAT_AXE                   = 143,
	ICURS_AXE                         = 144,
	ICURS_LARGE_SHIELD                = 147,
	ICURS_GOTHIC_SHIELD               = 148,
	ICURS_CLOAK                       = 149,
	ICURS_CAPE                        = 150,
	ICURS_FULL_PLATE_MAIL             = 151,
	ICURS_GOTHIC_PLATE                = 152,
	ICURS_BREAST_PLATE                = 153,
	ICURS_RING_MAIL                   = 154,
	ICURS_STAFF_OF_LAZARUS            = 155,
	ICURS_ARKAINES_VALOR              = 157,
	ICURS_SHORT_WAR_BOW               = 165,
	ICURS_COMPOSITE_STAFF             = 166,
	ICURS_SHORT_BATTLE_BOW            = 167,
	ICURS_GOLD                        = 168,
#ifdef HELLFIRE
	ICURS_AURIC_AMULET                = 180,
	ICURS_RUNE_BOMB                   = 187,
	ICURS_THEODORE                    = 188,
	ICURS_TORN_NOTE_1                 = 189,
	ICURS_TORN_NOTE_2                 = 190,
	ICURS_TORN_NOTE_3                 = 191,
	ICURS_RECONSTRUCTED_NOTE          = 192,
	ICURS_RUNE_OF_FIRE                = 193,
	ICURS_GREATER_RUNE_OF_FIRE        = 194,
	ICURS_RUNE_OF_LIGHTNING           = 195,
	ICURS_GREATER_RUNE_OF_LIGHTNING   = 196,
	ICURS_RUNE_OF_STONE               = 197,
	ICURS_GREY_SUIT                   = 198,
	ICURS_BROWN_SUIT                  = 199,
	ICURS_BOVINE                      = 226,
#endif
} item_cursor_graphic;

typedef enum _sfx_id {
	PS_WALK1,
	PS_WALK2,
	PS_WALK3,
	PS_WALK4,
	PS_BFIRE,
	PS_FMAG,
	PS_TMAG,
	PS_LGHIT,
	PS_LGHIT1,
	PS_SWING,
	PS_SWING2,
	PS_DEAD,
#ifdef HELLFIRE
	IS_STING1,
	IS_FBALLBOW,
#endif
	IS_QUESTDN,
	IS_ARMRFKD,
	IS_BARLFIRE,
	IS_BARREL,
#ifdef HELLFIRE
	IS_POPPOP8,
	IS_POPPOP5,
	IS_POPPOP3,
	IS_POPPOP2,
#endif
	IS_BHIT,
	IS_BHIT1,
	IS_CHEST,
	IS_DOORCLOS,
	IS_DOOROPEN,
	IS_FANVL,
	IS_FAXE,
	IS_FBLST,
	IS_FBODY,
	IS_FBOOK,
	IS_FBOW,
	IS_FCAP,
	IS_FHARM,
	IS_FLARM,
	IS_FMAG,
	IS_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FIRE
	LS_NESTXPLD,
#endif
	LS_NOVA,
	LS_PORTAL,
	LS_PUDDLE,
	LS_RESUR,
	LS_SCURSE,
	LS_SCURIMP,
	LS_SENTINEL,
	LS_SHATTER,
	LS_SOULFIRE,
	LS_SPOUTLOP,
	LS_SPOUTSTR,
	LS_STORM,
	LS_TRAPDIS,
	LS_TELEPORT,
	LS_VTHEFT,
	LS_WALLLOOP,
	LS_WALLSTRT,
#ifdef HELLFIRE
	LS_LMAG,
#endif
#ifndef SPAWN
	TSFX_BMAID1,
	TSFX_BMAID2,
	TSFX_BMAID3,
	TSFX_BMAID4,
	TSFX_BMAID5,
	TSFX_BMAID6,
	TSFX_BMAID7,
	TSFX_BMAID8,
	TSFX_BMAID9,
	TSFX_BMAID10,
	TSFX_BMAID11,
	TSFX_BMAID12,
	TSFX_BMAID13,
	TSFX_BMAID14,
	TSFX_BMAID15,
	TSFX_BMAID16,
	TSFX_BMAID17,
	TSFX_BMAID18,
	TSFX_BMAID19,
	TSFX_BMAID20,
	TSFX_BMAID21,
	TSFX_BMAID22,
	TSFX_BMAID23,
	TSFX_BMAID24,
	TSFX_BMAID25,
	TSFX_BMAID26,
	TSFX_BMAID27,
	TSFX_BMAID28,
	TSFX_BMAID29,
	TSFX_BMAID30,
#endif
	TSFX_BMAID31,
#ifndef SPAWN
	TSFX_BMAID32,
	TSFX_BMAID33,
	TSFX_BMAID34,
	TSFX_BMAID35,
	TSFX_BMAID36,
	TSFX_BMAID37,
	TSFX_BMAID38,
	TSFX_BMAID39,
	TSFX_BMAID40,
	TSFX_SMITH1,
	TSFX_SMITH2,
	TSFX_SMITH3,
	TSFX_SMITH4,
	TSFX_SMITH5,
	TSFX_SMITH6,
	TSFX_SMITH7,
	TSFX_SMITH8,
	TSFX_SMITH9,
	TSFX_SMITH10,
	TSFX_SMITH11,
	TSFX_SMITH12,
	TSFX_SMITH13,
	TSFX_SMITH14,
	TSFX_SMITH15,
	TSFX_SMITH16,
	TSFX_SMITH17,
	TSFX_SMITH18,
	TSFX_SMITH19,
	TSFX_SMITH20,
	TSFX_SMITH21,
	TSFX_SMITH22,
	TSFX_SMITH23,
	TSFX_SMITH24,
	TSFX_SMITH25,
	TSFX_SMITH26,
	TSFX_SMITH27,
	TSFX_SMITH28,
	TSFX_SMITH29,
	TSFX_SMITH30,
	TSFX_SMITH31,
	TSFX_SMITH32,
	TSFX_SMITH33,
	TSFX_SMITH34,
	TSFX_SMITH35,
	TSFX_SMITH36,
	TSFX_SMITH37,
	TSFX_SMITH38,
	TSFX_SMITH39,
	TSFX_SMITH40,
	TSFX_SMITH41,
	TSFX_SMITH42,
	TSFX_SMITH43,
#endif
	TSFX_SMITH44,
#ifndef SPAWN
	TSFX_SMITH45,
	TSFX_SMITH46,
	TSFX_SMITH47,
	TSFX_SMITH48,
	TSFX_SMITH49,
	TSFX_SMITH50,
	TSFX_SMITH51,
	TSFX_SMITH52,
	TSFX_SMITH53,
	TSFX_SMITH54,
	TSFX_SMITH55,
	TSFX_SMITH56,
#endif
	TSFX_COW1,
	TSFX_COW2,
#ifdef HELLFIRE
	TSFX_COW7,
	TSFX_COW8,
#endif
#ifndef SPAWN
	TSFX_DEADGUY,
	TSFX_DRUNK1,
	TSFX_DRUNK2,
	TSFX_DRUNK3,
	TSFX_DRUNK4,
	TSFX_DRUNK5,
	TSFX_DRUNK6,
	TSFX_DRUNK7,
	TSFX_DRUNK8,
	TSFX_DRUNK9,
	TSFX_DRUNK10,
	TSFX_DRUNK11,
	TSFX_DRUNK12,
	TSFX_DRUNK13,
	TSFX_DRUNK14,
	TSFX_DRUNK15,
	TSFX_DRUNK16,
	TSFX_DRUNK17,
	TSFX_DRUNK18,
	TSFX_DRUNK19,
	TSFX_DRUNK20,
	TSFX_DRUNK21,
	TSFX_DRUNK22,
	TSFX_DRUNK23,
	TSFX_DRUNK24,
	TSFX_DRUNK25,
	TSFX_DRUNK26,
#endif
	TSFX_DRUNK27,
#ifndef SPAWN
	TSFX_DRUNK28,
	TSFX_DRUNK29,
	TSFX_DRUNK30,
	TSFX_DRUNK31,
	TSFX_DRUNK32,
	TSFX_DRUNK33,
	TSFX_DRUNK34,
	TSFX_DRUNK35,
	TSFX_HEALER1,
	TSFX_HEALER2,
	TSFX_HEALER3,
	TSFX_HEALER4,
	TSFX_HEALER5,
	TSFX_HEALER6,
	TSFX_HEALER7,
	TSFX_HEALER8,
	TSFX_HEALER9,
	TSFX_HEALER10,
	TSFX_HEALER11,
	TSFX_HEALER12,
	TSFX_HEALER13,
	TSFX_HEALER14,
	TSFX_HEALER15,
	TSFX_HEALER16,
	TSFX_HEALER17,
	TSFX_HEALER18,
	TSFX_HEALER19,
	TSFX_HEALER20,
	TSFX_HEALER21,
	TSFX_HEALER22,
	TSFX_HEALER23,
	TSFX_HEALER24,
	TSFX_HEALER25,
	TSFX_HEALER26,
	TSFX_HEALER27,
	TSFX_HEALER28,
	TSFX_HEALER29,
	TSFX_HEALER30,
	TSFX_HEALER31,
	TSFX_HEALER32,
	TSFX_HEALER33,
	TSFX_HEALER34,
	TSFX_HEALER35,
	TSFX_HEALER36,
#endif
	TSFX_HEALER37,
#ifndef SPAWN
	TSFX_HEALER38,
	TSFX_HEALER39,
	TSFX_HEALER40,
	TSFX_HEALER41,
	TSFX_HEALER42,
	TSFX_HEALER43,
	TSFX_HEALER44,
	TSFX_HEALER45,
	TSFX_HEALER46,
	TSFX_HEALER47,
	TSFX_PEGBOY1,
	TSFX_PEGBOY2,
	TSFX_PEGBOY3,
	TSFX_PEGBOY4,
	TSFX_PEGBOY5,
	TSFX_PEGBOY6,
	TSFX_PEGBOY7,
	TSFX_PEGBOY8,
	TSFX_PEGBOY9,
	TSFX_PEGBOY10,
	TSFX_PEGBOY11,
	TSFX_PEGBOY12,
	TSFX_PEGBOY13,
	TSFX_PEGBOY14,
	TSFX_PEGBOY15,
	TSFX_PEGBOY16,
	TSFX_PEGBOY17,
	TSFX_PEGBOY18,
	TSFX_PEGBOY19,
	TSFX_PEGBOY20,
	TSFX_PEGBOY21,
	TSFX_PEGBOY22,
	TSFX_PEGBOY23,
	TSFX_PEGBOY24,
	TSFX_PEGBOY25,
	TSFX_PEGBOY26,
	TSFX_PEGBOY27,
	TSFX_PEGBOY28,
	TSFX_PEGBOY29,
	TSFX_PEGBOY30,
	TSFX_PEGBOY31,
#endif
	TSFX_PEGBOY32,
#ifndef SPAWN
	TSFX_PEGBOY33,
	TSFX_PEGBOY34,
	TSFX_PEGBOY35,
	TSFX_PEGBOY36,
	TSFX_PEGBOY37,
	TSFX_PEGBOY38,
	TSFX_PEGBOY39,
	TSFX_PEGBOY40,
	TSFX_PEGBOY41,
	TSFX_PEGBOY42,
	TSFX_PEGBOY43,
	TSFX_PRIEST0,
	TSFX_PRIEST1,
	TSFX_PRIEST2,
	TSFX_PRIEST3,
	TSFX_PRIEST4,
	TSFX_PRIEST5,
	TSFX_PRIEST6,
	TSFX_PRIEST7,
	TSFX_STORY0,
	TSFX_STORY1,
	TSFX_STORY2,
	TSFX_STORY3,
	TSFX_STORY4,
	TSFX_STORY5,
	TSFX_STORY6,
	TSFX_STORY7,
	TSFX_STORY8,
	TSFX_STORY9,
	TSFX_STORY10,
	TSFX_STORY11,
	TSFX_STORY12,
	TSFX_STORY13,
	TSFX_STORY14,
	TSFX_STORY15,
	TSFX_STORY16,
	TSFX_STORY17,
	TSFX_STORY18,
	TSFX_STORY19,
	TSFX_STORY20,
	TSFX_STORY21,
	TSFX_STORY22,
	TSFX_STORY23,
	TSFX_STORY24,
#endif
	TSFX_STORY25,
#ifndef SPAWN
	TSFX_STORY26,
	TSFX_STORY27,
	TSFX_STORY28,
	TSFX_STORY29,
	TSFX_STORY30,
	TSFX_STORY31,
	TSFX_STORY32,
	TSFX_STORY33,
	TSFX_STORY34,
	TSFX_STORY35,
	TSFX_STORY36,
	TSFX_STORY37,
	TSFX_STORY38,
#endif
	TSFX_TAVERN0,
#ifndef SPAWN
	TSFX_TAVERN1,
	TSFX_TAVERN2,
	TSFX_TAVERN3,
	TSFX_TAVERN4,
	TSFX_TAVERN5,
	TSFX_TAVERN6,
	TSFX_TAVERN7,
	TSFX_TAVERN8,
	TSFX_TAVERN9,
	TSFX_TAVERN10,
	TSFX_TAVERN11,
	TSFX_TAVERN12,
	TSFX_TAVERN13,
	TSFX_TAVERN14,
	TSFX_TAVERN15,
	TSFX_TAVERN16,
	TSFX_TAVERN17,
	TSFX_TAVERN18,
	TSFX_TAVERN19,
	TSFX_TAVERN20,
	TSFX_TAVERN21,
	TSFX_TAVERN22,
	TSFX_TAVERN23,
	TSFX_TAVERN24,
	TSFX_TAVERN25,
	TSFX_TAVERN26,
	TSFX_TAVERN27,
	TSFX_TAVERN28,
	TSFX_TAVERN29,
	TSFX_TAVERN30,
	TSFX_TAVERN31,
	TSFX_TAVERN32,
	TSFX_TAVERN33,
	TSFX_TAVERN34,
	TSFX_TAVERN35,
#endif
	TSFX_TAVERN36,
#ifndef SPAWN
	TSFX_TAVERN37,
	TSFX_TAVERN38,
	TSFX_TAVERN39,
	TSFX_TAVERN40,
	TSFX_TAVERN41,
	TSFX_TAVERN42,
	TSFX_TAVERN43,
	TSFX_TAVERN44,
	TSFX_TAVERN45,
	TSFX_WITCH1,
	TSFX_WITCH2,
	TSFX_WITCH3,
	TSFX_WITCH4,
	TSFX_WITCH5,
	TSFX_WITCH6,
	TSFX_WITCH7,
	TSFX_WITCH8,
	TSFX_WITCH9,
	TSFX_WITCH10,
	TSFX_WITCH11,
	TSFX_WITCH12,
	TSFX_WITCH13,
	TSFX_WITCH14,
	TSFX_WITCH15,
	TSFX_WITCH16,
	TSFX_WITCH17,
	TSFX_WITCH18,
	TSFX_WITCH19,
	TSFX_WITCH20,
	TSFX_WITCH21,
	TSFX_WITCH22,
	TSFX_WITCH23,
	TSFX_WITCH24,
	TSFX_WITCH25,
	TSFX_WITCH26,
	TSFX_WITCH27,
	TSFX_WITCH28,
	TSFX_WITCH29,
	TSFX_WITCH30,
	TSFX_WITCH31,
	TSFX_WITCH32,
	TSFX_WITCH33,
	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UE56,
	PS_ROGUE57,
	PS_ROGUE58,
	PS_ROGUE59,
	PS_ROGUE60,
	PS_ROGUE61,
	PS_ROGUE62,
	PS_ROGUE63,
	PS_ROGUE64,
	PS_ROGUE65,
	PS_ROGUE66,
	PS_ROGUE67,
	PS_ROGUE68,
	PS_ROGUE69,
	PS_ROGUE69B,
	PS_ROGUE70,
	PS_ROGUE71,
	PS_ROGUE72,
	PS_ROGUE73,
	PS_ROGUE74,
	PS_ROGUE75,
	PS_ROGUE76,
	PS_ROGUE77,
	PS_ROGUE78,
	PS_ROGUE79,
	PS_ROGUE80,
	PS_ROGUE81,
	PS_ROGUE82,
	PS_ROGUE83,
	PS_ROGUE84,
	PS_ROGUE85,
	PS_ROGUE86,
	PS_ROGUE87,
	PS_ROGUE88,
	PS_ROGUE89,
	PS_ROGUE90,
	PS_ROGUE91,
	PS_ROGUE92,
	PS_ROGUE93,
	PS_ROGUE94,
	PS_ROGUE95,
	PS_ROGUE96,
	PS_ROGUE97,
	PS_ROGUE98,
	PS_ROGUE99,
	PS_ROGUE100,
	PS_ROGUE101,
	PS_ROGUE102,
	PS_WARR1,
	PS_WARR2,
	PS_WARR3,
	PS_WARR4,
	PS_WARR5,
	PS_WARR6,
	PS_WARR7,
	PS_WARR8,
	PS_WARR9,
	PS_WARR10,
	PS_WARR11,
	PS_WARR12,
#endif
	PS_WARR13,
	PS_WARR14,
	PS_WARR14B,
	PS_WARR14C,
	PS_WARR15,
	PS_WARR15B,
	PS_WARR15C,
	PS_WARR16,
	PS_WARR16B,
	PS_WARR16C,
	PS_WARR17,
	PS_WARR18,
	PS_WARR19,
	PS_WARR20,
	PS_WARR21,
	PS_WARR22,
	PS_WARR23,
	PS_WARR24,
	PS_WARR25,
	PS_WARR26,
	PS_WARR27,
	PS_WARR28,
	PS_WARR29,
	PS_WARR30,
	PS_WARR31,
	PS_WARR32,
	PS_WARR33,
	PS_WARR34,
	PS_WARR35,
	PS_WARR36,
	PS_WARR37,
	PS_WARR38,
	PS_WARR39,
	PS_WARR40,
	PS_WARR41,
	PS_WARR42,
	PS_WARR43,
	PS_WARR44,
	PS_WARR45,
	PS_WARR46,
	PS_WARR47,
	PS_WARR48,
	PS_WARR49,
	PS_WARR50,
	PS_WARR51,
	PS_WARR52,
	PS_WARR53,
	PS_WARR54,
	PS_WARR55,
	PS_WARR56,
	PS_WARR57,
	PS_WARR58,
	PS_WARR59,
	PS_WARR60,
	PS_WARR61,
	PS_WARR62,
	PS_WARR63,
	PS_WARR64,
	PS_WARR65,
	PS_WARR66,
	PS_WARR67,
	PS_WARR68,
	PS_WARR69,
	PS_WARR69B,
	PS_WARR70,
	PS_WARR71,
	PS_WARR72,
	PS_WARR73,
	PS_WARR74,
	PS_WARR75,
	PS_WARR76,
	PS_WARR77,
	PS_WARR78,
	PS_WARR79,
#ifndef SPAWN
	PS_WARR80,
	PS_WARR81,
	PS_WARR82,
	PS_WARR83,
	PS_WARR84,
	PS_WARR85,
	PS_WARR86,
	PS_WARR87,
	PS_WARR88,
	PS_WARR89,
	PS_WARR90,
	PS_WARR91,
	PS_WARR92,
	PS_WARR93,
	PS_WARR94,
	PS_WARR95,
	PS_WARR95B,
	PS_WARR95C,
	PS_WARR95D,
	PS_WARR95E,
	PS_WARR95F,
#endif
	PS_WARR96B,
	PS_WARR97,
	PS_WARR98,
	PS_WARR99,
#ifndef SPAWN
	PS_WARR100,
	PS_WARR101,
	PS_WARR102,
#endif
#ifdef HELLFIRE
	PS_MONK1,
	PS_MONK2,
	PS_MONK3,
	PS_MONK4,
	PS_MONK5,
	PS_MONK6,
	PS_MONK7,
	PS_MONK8,
	PS_MONK9,
	PS_MONK10,
	PS_MONK11,
	PS_MONK12,
	PS_MONK13,
	PS_MONK14,
	PS_MONK15,
	PS_MONK16,
	PS_MONK17,
	PS_MONK18,
	PS_MONK19,
	PS_MONK20,
	PS_MONK21,
	PS_MONK22,
	PS_MONK23,
	PS_MONK24,
	PS_MONK25,
	PS_MONK26,
	PS_MONK27,
	PS_MONK28,
	PS_MONK29,
	PS_MONK30,
	PS_MONK31,
	PS_MONK32,
	PS_MONK33,
	PS_MONK34,
	PS_MONK35,
	PS_MONK36,
	PS_MONK37,
	PS_MONK38,
	PS_MONK39,
	PS_MONK40,
	PS_MONK41,
	PS_MONK42,
	PS_MONK43,
	PS_MONK44,
	PS_MONK45,
	PS_MONK46,
	PS_MONK47,
	PS_MONK48,
	PS_MONK49,
	PS_MONK50,
	PS_MONK51,
	PS_MONK52,
	PS_MONK53,
	PS_MONK54,
	PS_MONK55,
	PS_MONK56,
	PS_MONK57,
	PS_MONK58,
	PS_MONK59,
	PS_MONK60,
	PS_MONK61,
	PS_MONK62,
	PS_MONK63,
	PS_MONK64,
	PS_MONK65,
	PS_MONK66,
	PS_MONK67,
	PS_MONK68,
	PS_MONK69,
	PS_MONK69B,
	PS_MONK70,
	PS_MONK71,
	PS_MONK72,
	PS_MONK73,
	PS_MONK74,
	PS_MONK75,
	PS_MONK76,
	PS_MONK77,
	PS_MONK78,
	PS_MONK79,
	PS_MONK80,
	PS_MONK81,
	PS_MONK82,
	PS_MONK83,
	PS_MONK84,
	PS_MONK85,
	PS_MONK86,
	PS_MONK87,
	PS_MONK88,
	PS_MONK89,
	PS_MONK90,
	PS_MONK91,
	PS_MONK92,
	PS_MONK93,
	PS_MONK94,
	PS_MONK95,
	PS_MONK96,
	PS_MONK97,
	PS_MONK98,
	PS_MONK99,
	PS_MONK100,
	PS_MONK101,
	PS_MONK102,
#endif
#ifndef SPAWN
	PS_NAR1,
	PS_NAR2,
	PS_NAR3,
	PS_NAR4,
	PS_NAR5,
	PS_NAR6,
	PS_NAR7,
	PS_NAR8,
	PS_NAR9,
	PS_DIABLVLINT,
	USFX_CLEAVER,
	USFX_GARBUD1,
	USFX_GARBUD2,
	USFX_GARBUD3,
	USFX_GARBUD4,
	USFX_IZUAL1,
	USFX_LACH1,
	USFX_LACH2,
	USFX_LACH3,
	USFX_LAZ1,
	USFX_LAZ2,
	USFX_SKING1,
	USFX_SNOT1,
	USFX_SNOT2,
	USFX_SNOT3,
	USFX_WARLRD1,
	USFX_WLOCK1,
	USFX_ZHAR1,
	USFX_ZHAR2,
	USFX_DIABLOD,
#endif
#ifdef HELLFIRE
	TSFX_FARMER1,
	TSFX_FARMER2,
	TSFX_FARMER2A,
	TSFX_FARMER3,
	TSFX_FARMER4,
	TSFX_FARMER5,
	TSFX_FARMER6,
	TSFX_FARMER7,
	TSFX_FARMER8,
	TSFX_FARMER9,
	TSFX_TEDDYBR1,
	TSFX_TEDDYBR2,
	TSFX_TEDDYBR3,
	TSFX_TEDDYBR4,
	USFX_DEFILER1,
	USFX_DEFILER2,
	USFX_DEFILER3,
	USFX_DEFILER4,
	USFX_DEFILER8,
	USFX_DEFILER6,
	USFX_DEFILER7,
	USFX_NAKRUL1,
	USFX_NAKRUL2,
	USFX_NAKRUL3,
	USFX_NAKRUL4,
	USFX_NAKRUL5,
	USFX_NAKRUL6,
	PS_NARATR3,
	TSFX_COWSUT1,
	TSFX_COWSUT2,
	TSFX_COWSUT3,
	TSFX_COWSUT4,
	TSFX_COWSUT4A,
	TSFX_COWSUT5,
	TSFX_COWSUT6,
	TSFX_COWSUT7,
	TSFX_COWSUT8,
	TSFX_COWSUT9,
	TSFX_COWSUT10,
	TSFX_COWSUT11,
	TSFX_COWSUT12,
	USFX_SKLJRN1,
	PS_NARATR6,
	PS_NARATR7,
	PS_NARATR8,
	PS_NARATR5,
	PS_NARATR9,
	PS_NARATR4,
	TSFX_TRADER1,
	IS_CROPEN,
	IS_CRCLOS,
#endif
} _sfx_id;

typedef enum sfx_flag {
	sfx_STREAM   = 0x01,
	sfx_MISC     = 0x02,
	sfx_UI       = 0x04,
	sfx_MONK     = 0x08,
	sfx_ROGUE    = 0x10,
	sfx_WARRIOR  = 0x20,
	sfx_SORCEROR = 0x40,
	sfx_LOADED   = 0x80,
} sfx_flag;

typedef enum item_equip_type {
	ILOC_NONE        = 0x0,
	ILOC_ONEHAND     = 0x1,
	ILOC_TWOHAND     = 0x2,
	ILOC_ARMOR       = 0x3,
	ILOC_HELM        = 0x4,
	ILOC_RING        = 0x5,
	ILOC_AMULET      = 0x6,
	ILOC_UNEQUIPABLE = 0x7,
	ILOC_BELT        = 0x8,
	ILOC_INVALID     = -1,
} item_equip_type;

typedef enum missile_id {
	MIS_ARROW         = 0x0,
	MIS_FIREBOLT      = 0x1,
	MIS_GUARDIAN      = 0x2,
	MIS_RNDTELEPORT   = 0x3,
	MIS_LIGHTBALL     = 0x4,
	MIS_FIREWALL      = 0x5,
	MIS_FIREBALL      = 0x6,
	MIS_LIGHTCTRL     = 0x7,
	MIS_LIGHTNING     = 0x8,
	MIS_MISEXP        = 0x9,
	MIS_TOWN          = 0xA,
	MIS_FLASH         = 0xB,
	MIS_FLASH2        = 0xC,
	MIS_MANASHIELD    = 0xD,
	MIS_FIREMOVE      = 0xE,
	MIS_CHAIN         = 0xF,
	MIS_SENTINAL      = 0x10, // TODO: Check beta
	MIS_BLODSTAR      = 0x11, // TODO: Check beta
	MIS_BONE          = 0x12, // TODO: Check beta
	MIS_METLHIT       = 0x13, // TODO: Check beta
	MIS_RHINO         = 0x14,
	MIS_MAGMABALL     = 0x15,
	MIS_LIGHTCTRL2    = 0x16,
	MIS_LIGHTNING2    = 0x17,
	MIS_FLARE         = 0x18,
	MIS_MISEXP2       = 0x19,
	MIS_TELEPORT      = 0x1A,
	MIS_FARROW        = 0x1B,
	MIS_DOOMSERP      = 0x1C,
	MIS_FIREWALLA     = 0x1D, // TODO: Check beta
	MIS_STONE         = 0x1E,
	MIS_NULL_1F       = 0x1F,
	MIS_INVISIBL      = 0x20,
	MIS_GOLEM         = 0x21,
	MIS_ETHEREALIZE   = 0x22,
	MIS_BLODBUR       = 0x23, // TODO: Check beta
	MIS_BOOM          = 0x24,
	MIS_HEAL          = 0x25,
	MIS_FIREWALLC     = 0x26,
	MIS_INFRA         = 0x27,
	MIS_IDENTIFY      = 0x28,
	MIS_WAVE          = 0x29,
	MIS_NOVA          = 0x2A,
	MIS_BLODBOIL      = 0x2B,
	MIS_APOCA         = 0x2C,
	MIS_REPAIR        = 0x2D,
	MIS_RECHARGE      = 0x2E,
	MIS_DISARM        = 0x2F,
	MIS_FLAME         = 0x30,
	MIS_FLAMEC        = 0x31,
	MIS_FIREMAN       = 0x32, // TODO: Check beta
	MIS_KRULL         = 0x33, // TODO: Check beta
	MIS_CBOLT         = 0x34,
	MIS_HBOLT         = 0x35,
	MIS_RESURRECT     = 0x36,
	MIS_TELEKINESIS   = 0x37,
	MIS_LARROW        = 0x38,
	MIS_ACID          = 0x39,
	MIS_MISEXP3       = 0x3A,
	MIS_ACIDPUD       = 0x3B,
	MIS_HEALOTHER     = 0x3C,
	MIS_ELEMENT       = 0x3D,
	MIS_RESURRECTBEAM = 0x3E,
	MIS_BONESPIRIT    = 0x3F,
	MIS_WEAPEXP       = 0x40,
	MIS_RPORTAL       = 0x41,
	MIS_BOOM2         = 0x42,
	MIS_DIABAPOCA     = 0x43,
#ifdef HELLFIRE
	MIS_MANA          = 0x44,
	MIS_MAGI          = 0x45,
	MIS_LIGHTWALL     = 0x46,
	MIS_LIGHTNINGWALL = 0x47,
	MIS_IMMOLATION    = 0x48,
	MIS_SPECARROW     = 0x49,
	MIS_FIRENOVA      = 0x4A,
	MIS_LIGHTARROW    = 0x4B,
	MIS_CBOLTARROW    = 0x4C,
	MIS_HBOLTARROW    = 0x4D,
	MIS_WARP          = 0x4E,
	MIS_REFLECT       = 0x4F,
	MIS_BERSERK       = 0x50,
	MIS_FIRERING      = 0x51,
	MIS_STEALPOTS     = 0x52,
	MIS_MANATRAP      = 0x53,
	MIS_LIGHTRING     = 0x54,
	MIS_SEARCH        = 0x55,
	MIS_FLASHFR       = 0x56,
	MIS_FLASHBK       = 0x57,
	MIS_IMMOLATION2   = 0x58,
	MIS_RUNEFIRE      = 0x59,
	MIS_RUNELIGHT     = 0x5A,
	MIS_RUNENOVA      = 0x5B,
	MIS_RUNEIMMOLAT   = 0x5C,
	MIS_RUNESTONE     = 0x5D,
	MIS_HIVEEXP       = 0x5E,
	MIS_HORKDMN       = 0x5F,
	MIS_JESTER        = 0x60,
	MIS_HIVEEXP2      = 0x61,
	MIS_LICH          = 0x62,
	MIS_PSYCHORB      = 0x63,
	MIS_NECROMORB     = 0x64,
	MIS_ARCHLICH      = 0x65,
	MIS_BONEDEMON     = 0x66,
	MIS_EXYEL2        = 0x67,
	MIS_EXRED3        = 0x68,
	MIS_EXBL2         = 0x69,
	MIS_EXBL3         = 0x6A,
	MIS_EXORA1        = 0x6B,
#endif
} missile_id;

typedef enum missile_graphic_id {
	MFILE_ARROWS,
	MFILE_FIREBA,
	MFILE_GUARD,
	MFILE_LGHNING,
	MFILE_FIREWAL,
	MFILE_MAGBLOS,
	MFILE_PORTAL,
	MFILE_BLUEXFR,
	MFILE_BLUEXBK,
	MFILE_MANASHLD,
	MFILE_BLOOD,
	MFILE_BONE,
	MFILE_METLHIT,
	MFILE_FARROW,
	MFILE_DOOM,
	MFILE_0F,
	MFILE_BLODBUR,
	MFILE_NEWEXP,
	MFILE_SHATTER1,
	MFILE_BIGEXP,
	MFILE_INFERNO,
	MFILE_THINLGHT,
	MFILE_FLARE,
	MFILE_FLAREEXP,
	MFILE_MAGBALL,
	MFILE_KRULL,
	MFILE_MINILTNG,
	MFILE_HOLY,
	MFILE_HOLYEXPL,
	MFILE_LARROW,
	MFILE_FIRARWEX,
	MFILE_ACIDBF,
	MFILE_ACIDSPLA,
	MFILE_ACIDPUD,
	MFILE_ETHRSHLD,
	MFILE_FIRERUN,
	MFILE_RESSUR1,
	MFILE_SKLBALL,
	MFILE_RPORTAL,
	MFILE_FIREPLAR,
	MFILE_SCUBMISB,
	MFILE_SCBSEXPB,
	MFILE_SCUBMISC,
	MFILE_SCBSEXPC,
	MFILE_SCUBMISD,
	MFILE_SCBSEXPD,
#ifdef HELLFIRE
	MFILE_SPAWNS,
	MFILE_REFLECT,
	MFILE_LICH,
	MFILE_MSBLA,
	MFILE_NECROMORB,
	MFILE_ARCHLICH,
	MFILE_RUNE,
	MFILE_EXYEL2,
	MFILE_EXBL2,
	MFILE_EXRED3,
	MFILE_BONEDEMON,
	MFILE_EXORA1,
	MFILE_EXBL3,
#endif
	MFILE_NULL,
	MFILE_NONE = 0xFF, // BUGFIX: should be `MFILE_NONE = MFILE_SCBSEXPD+1`, i.e. MFILE_NULL, since there would otherwise be an out-of-bounds in SetMissAnim when accessing misfiledata for any of the missiles that have MFILE_NONE as mFileNum in missiledata.
} missile_graphic_id;

typedef enum _mai_id {
	AI_ZOMBIE   = 0,
	AI_FAT      = 1,
	AI_SKELSD   = 2,
	AI_SKELBOW  = 3,
	AI_SCAV     = 4,
	AI_RHINO    = 5,
	AI_GOATMC   = 6,
	AI_GOATBOW  = 7,
	AI_FALLEN   = 8,
	AI_MAGMA    = 9,
	AI_SKELKING = 10,
	AI_BAT      = 11,
	AI_GARG     = 12,
	AI_CLEAVER  = 13,
	AI_SUCC     = 14,
	AI_SNEAK    = 15,
	AI_STORM    = 16,
	AI_FIREMAN  = 17,
	AI_GARBUD   = 18,
	AI_ACID     = 19,
	AI_ACIDUNIQ = 20,
	AI_GOLUM    = 21,
	AI_ZHAR     = 22,
	AI_SNOTSPIL = 23,
	AI_SNAKE    = 24,
	AI_COUNSLR  = 25,
	AI_MEGA     = 26,
	AI_DIABLO   = 27,
	AI_LAZURUS  = 28,
	AI_LAZHELP  = 29,
	AI_LACHDAN  = 30,
	AI_WARLORD  = 31,
#ifdef HELLFIRE
	AI_FIREBAT   = 32,
	AI_TORCHANT  = 33,
	AI_HORKDMN   = 34,
	AI_LICH      = 35,
	AI_ARCHLICH  = 36,
	AI_PSYCHORB  = 37,
	AI_NECROMORB = 38,
	AI_BONEDEMON = 39,
#endif
} _mai_id;

typedef enum _mc_id {
	MC_UNDEAD = 0,
	MC_DEMON  = 1,
	MC_ANIMAL = 2,
} _mc_id;

typedef enum FILE_SYSTEM {
	FS_PC = 0,
	FS_CD = 1,
} FILE_SYSTEM;

typedef enum _artfonts {
	AF_SMALL     = 0,
	AF_SMALLGRAY = 1,
	AF_MED       = 2,
	AF_MEDGRAY   = 3,
	AF_BIG       = 4,
	AF_BIGGRAY   = 5,
	AF_HUGE      = 6,
	AF_HUGEGRAY  = 7,
} _artfonts;

typedef enum _monster_id {
	MT_NZOMBIE  = 0x0,
	MT_BZOMBIE  = 0x1,
	MT_GZOMBIE  = 0x2,
	MT_YZOMBIE  = 0x3,
	MT_RFALLSP  = 0x4,
	MT_DFALLSP  = 0x5,
	MT_YFALLSP  = 0x6,
	MT_BFALLSP  = 0x7,
	MT_WSKELAX  = 0x8,
	MT_TSKELAX  = 0x9,
	MT_RSKELAX  = 0xA,
	MT_XSKELAX  = 0xB,
	MT_RFALLSD  = 0xC,
	MT_DFALLSD  = 0xD,
	MT_YFALLSD  = 0xE,
	MT_BFALLSD  = 0xF,
	MT_NSCAV    = 0x10,
	MT_BSCAV    = 0x11,
	MT_WSCAV    = 0x12,
	MT_YSCAV    = 0x13,
	MT_WSKELBW  = 0x14,
	MT_TSKELBW  = 0x15,
	MT_RSKELBW  = 0x16,
	MT_XSKELBW  = 0x17,
	MT_WSKELSD  = 0x18,
	MT_TSKELSD  = 0x19,
	MT_RSKELSD  = 0x1A,
	MT_XSKELSD  = 0x1B,
	MT_INVILORD = 0x1C,
	MT_SNEAK    = 0x1D,
	MT_STALKER  = 0x1E,
	MT_UNSEEN   = 0x1F,
	MT_ILLWEAV  = 0x20,
	MT_LRDSAYTR = 0x21,
	MT_NGOATMC  = 0x22,
	MT_BGOATMC  = 0x23,
	MT_RGOATMC  = 0x24,
	MT_GGOATMC  = 0x25,
	MT_FIEND    = 0x26,
	MT_BLINK    = 0x27,
	MT_GLOOM    = 0x28,
	MT_FAMILIAR = 0x29,
	MT_NGOATBW  = 0x2A,
	MT_BGOATBW  = 0x2B,
	MT_RGOATBW  = 0x2C,
	MT_GGOATBW  = 0x2D,
	MT_NACID    = 0x2E,
	MT_RACID    = 0x2F,
	MT_BACID    = 0x30,
	MT_XACID    = 0x31,
	MT_SKING    = 0x32,
	MT_CLEAVER  = 0x33,
	MT_FAT      = 0x34,
	MT_MUDMAN   = 0x35,
	MT_TOAD     = 0x36,
	MT_FLAYED   = 0x37,
	MT_WYRM     = 0x38,
	MT_CAVSLUG  = 0x39,
	MT_DVLWYRM  = 0x3A,
	MT_DEVOUR   = 0x3B,
	MT_NMAGMA   = 0x3C,
	MT_YMAGMA   = 0x3D,
	MT_BMAGMA   = 0x3E,
	MT_WMAGMA   = 0x3F,
	MT_HORNED   = 0x40,
	MT_MUDRUN   = 0x41,
	MT_FROSTC   = 0x42,
	MT_OBLORD   = 0x43,
	MT_BONEDMN  = 0x44,
	MT_REDDTH   = 0x45,
	MT_LTCHDMN  = 0x46,
	MT_UDEDBLRG = 0x47,
	MT_INCIN    = 0x48,
	MT_FLAMLRD  = 0x49,
	MT_DOOMFIRE = 0x4A,
	MT_HELLBURN = 0x4B,
	MT_STORM    = 0x4C,
	MT_RSTORM   = 0x4D,
	MT_STORML   = 0x4E,
	MT_MAEL     = 0x4F,
	MT_BIGFALL  = 0x50,
	MT_WINGED   = 0x51,
	MT_GARGOYLE = 0x52,
	MT_BLOODCLW = 0x53,
	MT_DEATHW   = 0x54,
	MT_MEGA     = 0x55,
	MT_GUARD    = 0x56,
	MT_VTEXLRD  = 0x57,
	MT_BALROG   = 0x58,
	MT_NSNAKE   = 0x59,
	MT_RSNAKE   = 0x5A,
	MT_BSNAKE   = 0x5B,
	MT_GSNAKE   = 0x5C,
	MT_NBLACK   = 0x5D,
	MT_RTBLACK  = 0x5E,
	MT_BTBLACK  = 0x5F,
	MT_RBLACK   = 0x60,
	MT_UNRAV    = 0x61,
	MT_HOLOWONE = 0x62,
	MT_PAINMSTR = 0x63,
	MT_REALWEAV = 0x64,
	MT_SUCCUBUS = 0x65,
	MT_SNOWWICH = 0x66,
	MT_HLSPWN   = 0x67,
	MT_SOLBRNR  = 0x68,
	MT_COUNSLR  = 0x69,
	MT_MAGISTR  = 0x6A,
	MT_CABALIST = 0x6B,
	MT_ADVOCATE = 0x6C,
	MT_GOLEM    = 0x6D,
	MT_DIABLO   = 0x6E,
	MT_DARKMAGE = 0x6F,
#ifdef HELLFIRE
	MT_HELLBOAR = 0x70,
	MT_STINGER  = 0x71,
	MT_PSYCHORB = 0x72,
	MT_ARACHNON = 0x73,
	MT_FELLTWIN = 0x74,
	MT_HORKSPWN = 0x75,
	MT_VENMTAIL = 0x76,
	MT_NECRMORB = 0x77,
	MT_SPIDLORD = 0x78,
	MT_LASHWORM = 0x79,
	MT_TORCHANT = 0x7A,
	MT_HORKDMN  = 0x7B,
	MT_DEFILER  = 0x7C,
	MT_GRAVEDIG = 0x7D,
	MT_TOMBRAT  = 0x7E,
	MT_FIREBAT  = 0x7F,
	MT_SKLWING  = 0x80,
	MT_LICH     = 0x81,
	MT_CRYPTDMN = 0x82,
	MT_HELLBAT  = 0x83,
	MT_BONEDEMN = 0x84,
	MT_ARCHLICH = 0x85,
	MT_BICLOPS  = 0x86,
	MT_FLESTHNG = 0x87,
	MT_REAPER   = 0x88,
	MT_NAKRUL   = 0x89,
	NUM_MTYPES,
#else
	NUM_MTYPES  = 0x6F, /// BUGFIX the count is off by one
#endif
} _monster_id;

// this enum contains indexes from UniqMonst array for special unique monsters (usually quest related)
typedef enum {
	UMT_GARBUD    = 0,
	UMT_SKELKING  = 1,
	UMT_ZHAR      = 2,
	UMT_SNOTSPIL  = 3,
	UMT_LAZURUS   = 4,
	UMT_RED_VEX   = 5,
	UMT_BLACKJADE = 6,
	UMT_LACHDAN   = 7,
	UMT_WARLORD   = 8,
	UMT_BUTCHER   = 9,
#ifdef HELLFIRE
	UMT_HORKDMN   = 10,
	UMT_DEFILER   = 11,
	UMT_NAKRUL    = 12,
#endif
} _uniq_monsterid;

typedef enum monster_flag {
	MFLAG_HIDDEN          = 0x01,
	MFLAG_LOCK_ANIMATION  = 0x02,
	MFLAG_ALLOW_SPECIAL   = 0x04,
	MFLAG_NOHEAL          = 0x08,
	MFLAG_TARGETS_MONSTER = 0x10,
	MFLAG_GOLEM           = 0x20,
	MFLAG_QUEST_COMPLETE  = 0x40,
	MFLAG_KNOCKBACK       = 0x80,
	MFLAG_SEARCH          = 0x100,
	MFLAG_CAN_OPEN_DOOR   = 0x200,
	MFLAG_NO_ENEMY        = 0x400,
	MFLAG_BERSERK         = 0x800,
	MFLAG_NOLIFESTEAL     = 0x1000
} monster_flag;

typedef enum monster_goal {
	MGOAL_NORMAL    = 1,
	MGOAL_RETREAT   = 2,
	MGOAL_HEALING   = 3,
	MGOAL_MOVE      = 4,
	MGOAL_ATTACK2   = 5,
	MGOAL_INQUIRING = 6,
	MGOAL_TALKING   = 7,
} monster_goal;

typedef enum monster_resistance {
	RESIST_MAGIC     = 0x01,
	RESIST_FIRE      = 0x02,
	RESIST_LIGHTNING = 0x04,
	IMMUNE_MAGIC     = 0x08,
	IMMUNE_FIRE      = 0x10,
	IMMUNE_LIGHTNING = 0x20,
	IMMUNE_NULL_40   = 0x40,
	IMMUNE_ACID      = 0x80,
} monster_resistance;

typedef enum missile_resistance {
	MISR_NONE      = 0,
	MISR_FIRE      = 1,
	MISR_LIGHTNING = 2,
	MISR_MAGIC     = 3,
	MISR_ACID      = 4,
} missile_resistance;

typedef enum _speech_id {
	TEXT_KING1      = 0x0,
	TEXT_KING2      = 0x1,
	TEXT_KING3      = 0x2,
	TEXT_KING4      = 0x3,
	TEXT_KING5      = 0x4,
	TEXT_KING6      = 0x5,
	TEXT_KING7      = 0x6,
	TEXT_KING8      = 0x7,
	TEXT_KING9      = 0x8,
	TEXT_KING10     = 0x9,
	TEXT_KING11     = 0xA,
	TEXT_BANNER1    = 0xB,
	TEXT_BANNER2    = 0xC,
	TEXT_BANNER3    = 0xD,
	TEXT_BANNER4    = 0xE,
	TEXT_BANNER5    = 0xF,
	TEXT_BANNER6    = 0x10,
	TEXT_BANNER7    = 0x11,
	TEXT_BANNER8    = 0x12,
	TEXT_BANNER9    = 0x13,
	TEXT_BANNER10   = 0x14,
	TEXT_BANNER11   = 0x15,
	TEXT_BANNER12   = 0x16,
	TEXT_VILE1      = 0x17,
	TEXT_VILE2      = 0x18,
	TEXT_VILE3      = 0x19,
	TEXT_VILE4      = 0x1A,
	TEXT_VILE5      = 0x1B,
	TEXT_VILE6      = 0x1C,
	TEXT_VILE7      = 0x1D,
	TEXT_VILE8      = 0x1E,
	TEXT_VILE9      = 0x1F,
	TEXT_VILE10     = 0x20,
	TEXT_VILE11     = 0x21,
	TEXT_VILE12     = 0x22,
	TEXT_VILE13     = 0x23,
	TEXT_VILE14     = 0x24,
	TEXT_POISON1    = 0x25,
	TEXT_POISON2    = 0x26,
	TEXT_POISON3    = 0x27,
	TEXT_POISON4    = 0x28,
	TEXT_POISON5    = 0x29,
	TEXT_POISON6    = 0x2A,
	TEXT_POISON7    = 0x2B,
	TEXT_POISON8    = 0x2C,
	TEXT_POISON9    = 0x2D,
	TEXT_POISON10   = 0x2E,
	TEXT_BONE1      = 0x2F,
	TEXT_BONE2      = 0x30,
	TEXT_BONE3      = 0x31,
	TEXT_BONE4      = 0x32,
	TEXT_BONE5      = 0x33,
	TEXT_BONE6      = 0x34,
	TEXT_BONE7      = 0x35,
	TEXT_BONE8      = 0x36,
	TEXT_BUTCH1     = 0x37,
	TEXT_BUTCH2     = 0x38,
	TEXT_BUTCH3     = 0x39,
	TEXT_BUTCH4     = 0x3A,
	TEXT_BUTCH5     = 0x3B,
	TEXT_BUTCH6     = 0x3C,
	TEXT_BUTCH7     = 0x3D,
	TEXT_BUTCH8     = 0x3E,
	TEXT_BUTCH9     = 0x3F,
	TEXT_BUTCH10    = 0x40,
	TEXT_BLIND1     = 0x41,
	TEXT_BLIND2     = 0x42,
	TEXT_BLIND3     = 0x43,
	TEXT_BLIND4     = 0x44,
	TEXT_BLIND5     = 0x45,
	TEXT_BLIND6     = 0x46,
	TEXT_BLIND7     = 0x47,
	TEXT_BLIND8     = 0x48,
	TEXT_VEIL1      = 0x49,
	TEXT_VEIL2      = 0x4A,
	TEXT_VEIL3      = 0x4B,
	TEXT_VEIL4      = 0x4C,
	TEXT_VEIL5      = 0x4D,
	TEXT_VEIL6      = 0x4E,
	TEXT_VEIL7      = 0x4F,
	TEXT_VEIL8      = 0x50,
	TEXT_VEIL9      = 0x51,
	TEXT_VEIL10     = 0x52,
	TEXT_VEIL11     = 0x53,
	TEXT_ANVIL1     = 0x54,
	TEXT_ANVIL2     = 0x55,
	TEXT_ANVIL3     = 0x56,
	TEXT_ANVIL4     = 0x57,
	TEXT_ANVIL5     = 0x58,
	TEXT_ANVIL6     = 0x59,
	TEXT_ANVIL7     = 0x5A,
	TEXT_ANVIL8     = 0x5B,
	TEXT_ANVIL9     = 0x5C,
	TEXT_ANVIL10    = 0x5D,
	TEXT_BLOOD1     = 0x5E,
	TEXT_BLOOD2     = 0x5F,
	TEXT_BLOOD3     = 0x60,
	TEXT_BLOOD4     = 0x61,
	TEXT_BLOOD5     = 0x62,
	TEXT_BLOOD6     = 0x63,
	TEXT_BLOOD7     = 0x64,
	TEXT_BLOOD8     = 0x65,
	TEXT_WARLRD1    = 0x66,
	TEXT_WARLRD2    = 0x67,
	TEXT_WARLRD3    = 0x68,
	TEXT_WARLRD4    = 0x69,
	TEXT_WARLRD5    = 0x6A,
	TEXT_WARLRD6    = 0x6B,
	TEXT_WARLRD7    = 0x6C,
	TEXT_WARLRD8    = 0x6D,
	TEXT_WARLRD9    = 0x6E,
	TEXT_INFRA1     = 0x6F,
	TEXT_INFRA2     = 0x70,
	TEXT_INFRA3     = 0x71,
	TEXT_INFRA4     = 0x72,
	TEXT_INFRA5     = 0x73,
	TEXT_INFRA6     = 0x74,
	TEXT_INFRA7     = 0x75,
	TEXT_INFRA8     = 0x76,
	TEXT_INFRA9     = 0x77,
	TEXT_INFRA10    = 0x78,
	TEXT_MUSH1      = 0x79,
	TEXT_MUSH2      = 0x7A,
	TEXT_MUSH3      = 0x7B,
	TEXT_MUSH4      = 0x7C,
	TEXT_MUSH5      = 0x7D,
	TEXT_MUSH6      = 0x7E,
	TEXT_MUSH7      = 0x7F,
	TEXT_MUSH8      = 0x80,
	TEXT_MUSH9      = 0x81,
	TEXT_MUSH10     = 0x82,
	TEXT_MUSH11     = 0x83,
	TEXT_MUSH12     = 0x84,
	TEXT_MUSH13     = 0x85,
	TEXT_DOOM1      = 0x86,
	TEXT_DOOM2      = 0x87,
	TEXT_DOOM3      = 0x88,
	TEXT_DOOM4      = 0x89,
	TEXT_DOOM5      = 0x8A,
	TEXT_DOOM6      = 0x8B,
	TEXT_DOOM7      = 0x8C,
	TEXT_DOOM8      = 0x8D,
	TEXT_DOOM9      = 0x8E,
	TEXT_DOOM10     = 0x8F,
	TEXT_GARBUD1    = 0x90,
	TEXT_GARBUD2    = 0x91,
	TEXT_GARBUD3    = 0x92,
	TEXT_GARBUD4    = 0x93,
	TEXT_ZHAR1      = 0x94,
	TEXT_ZHAR2      = 0x95,
	TEXT_STORY1     = 0x96,
	TEXT_STORY2     = 0x97,
	TEXT_STORY3     = 0x98,
	TEXT_STORY4     = 0x99,
	TEXT_STORY5     = 0x9A,
	TEXT_STORY6     = 0x9B,
	TEXT_STORY7     = 0x9C,
	TEXT_STORY9     = 0x9D,
	TEXT_STORY10    = 0x9E,
	TEXT_STORY11    = 0x9F,
	TEXT_OGDEN1     = 0xA0,
	TEXT_OGDEN2     = 0xA1,
	TEXT_OGDEN3     = 0xA2,
	TEXT_OGDEN4     = 0xA3,
	TEXT_OGDEN5     = 0xA4,
	TEXT_OGDEN6     = 0xA5,
	TEXT_OGDEN8     = 0xA6,
	TEXT_OGDEN9     = 0xA7,
	TEXT_OGDEN10    = 0xA8,
	TEXT_PEPIN1     = 0xA9,
	TEXT_PEPIN2     = 0xAA,
	TEXT_PEPIN3     = 0xAB,
	TEXT_PEPIN4     = 0xAC,
	TEXT_PEPIN5     = 0xAD,
	TEXT_PEPIN6     = 0xAE,
	TEXT_PEPIN7     = 0xAF,
	TEXT_PEPIN9     = 0xB0,
	TEXT_PEPIN10    = 0xB1,
	TEXT_PEPIN11    = 0xB2,
	TEXT_GILLIAN1   = 0xB3,
	TEXT_GILLIAN2   = 0xB4,
	TEXT_GILLIAN3   = 0xB5,
	TEXT_GILLIAN4   = 0xB6,
	TEXT_GILLIAN5   = 0xB7,
	TEXT_GILLIAN6   = 0xB8,
	TEXT_GILLIAN7   = 0xB9,
	TEXT_GILLIAN9   = 0xBA,
	TEXT_GILLIAN10  = 0xBB,
	TEXT_GRISWOLD1  = 0xBC,
	TEXT_GRISWOLD2  = 0xBD,
	TEXT_GRISWOLD3  = 0xBE,
	TEXT_GRISWOLD4  = 0xBF,
	TEXT_GRISWOLD5  = 0xC0,
	TEXT_GRISWOLD6  = 0xC1,
	TEXT_GRISWOLD7  = 0xC2,
	TEXT_GRISWOLD8  = 0xC3,
	TEXT_GRISWOLD9  = 0xC4,
	TEXT_GRISWOLD10 = 0xC5,
	TEXT_GRISWOLD12 = 0xC6,
	TEXT_GRISWOLD13 = 0xC7,
	TEXT_FARNHAM1   = 0xC8,
	TEXT_FARNHAM2   = 0xC9,
	TEXT_FARNHAM3   = 0xCA,
	TEXT_FARNHAM4   = 0xCB,
	TEXT_FARNHAM5   = 0xCC,
	TEXT_FARNHAM6   = 0xCD,
	TEXT_FARNHAM8   = 0xCE,
	TEXT_FARNHAM9   = 0xCF,
	TEXT_FARNHAM10  = 0xD0,
	TEXT_FARNHAM11  = 0xD1,
	TEXT_FARNHAM12  = 0xD2,
	TEXT_FARNHAM13  = 0xD3,
	TEXT_ADRIA1     = 0xD4,
	TEXT_ADRIA2     = 0xD5,
	TEXT_ADRIA3     = 0xD6,
	TEXT_ADRIA4     = 0xD7,
	TEXT_ADRIA5     = 0xD8,
	TEXT_ADRIA6     = 0xD9,
	TEXT_ADRIA7     = 0xDA,
	TEXT_ADRIA8     = 0xDB,
	TEXT_ADRIA9     = 0xDC,
	TEXT_ADRIA10    = 0xDD,
	TEXT_ADRIA12    = 0xDE,
	TEXT_ADRIA13    = 0xDF,
	TEXT_WIRT1      = 0xE0,
	TEXT_WIRT2      = 0xE1,
	TEXT_WIRT3      = 0xE2,
	TEXT_WIRT4      = 0xE3,
	TEXT_WIRT5      = 0xE4,
	TEXT_WIRT6      = 0xE5,
	TEXT_WIRT7      = 0xE6,
	TEXT_WIRT8      = 0xE7,
	TEXT_WIRT9      = 0xE8,
	TEXT_WIRT11     = 0xE9,
	TEXT_WIRT12     = 0xEA,
	TEXT_BONER      = 0xEB,
	TEXT_BLOODY     = 0xEC,
	TEXT_BLINDING   = 0xED,
	TEXT_BLOODWAR   = 0xEE,
	TEXT_MBONER     = 0xEF,
	TEXT_MBLOODY    = 0xF0,
	TEXT_MBLINDING  = 0xF1,
	TEXT_MBLOODWAR  = 0xF2,
	TEXT_RBONER     = 0xF3,
	TEXT_RBLOODY    = 0xF4,
	TEXT_RBLINDING  = 0xF5,
	TEXT_RBLOODWAR  = 0xF6,
	TEXT_COW1       = 0xF7,
	TEXT_COW2       = 0xF8,
	TEXT_BOOK11     = 0xF9,
	TEXT_BOOK12     = 0xFA,
	TEXT_BOOK13     = 0xFB,
	TEXT_BOOK21     = 0xFC,
	TEXT_BOOK22     = 0xFD,
	TEXT_BOOK23     = 0xFE,
	TEXT_BOOK31     = 0xFF,
	TEXT_BOOK32     = 0x100,
	TEXT_BOOK33     = 0x101,
	TEXT_INTRO      = 0x102,
#ifdef HELLFIRE
	TEXT_HBONER    = 0x103,
	TEXT_HBLOODY   = 0x104,
	TEXT_HBLINDING = 0x105,
	TEXT_HBLOODWAR = 0x106,
	TEXT_BBONER    = 0x107,
	TEXT_BBLOODY   = 0x108,
	TEXT_BBLINDING = 0x109,
	TEXT_BBLOODWAR = 0x10A,
	TEXT_GRAVE1    = 0x10B,
	TEXT_GRAVE2    = 0x10C,
	TEXT_GRAVE3    = 0x10D,
	TEXT_GRAVE4    = 0x10E,
	TEXT_GRAVE5    = 0x10F,
	TEXT_GRAVE6    = 0x110,
	TEXT_GRAVE7    = 0x111,
	TEXT_GRAVE8    = 0x112,
	TEXT_GRAVE9    = 0x113,
	TEXT_GRAVE10   = 0x114,
	TEXT_FARMER1   = 0x115,
	TEXT_FARMER2   = 0x116,
	TEXT_FARMER3   = 0x117,
	TEXT_FARMER4   = 0x118,
	TEXT_FARMER5   = 0x119,
	TEXT_GIRL1     = 0x11A,
	TEXT_GIRL2     = 0x11B,
	TEXT_GIRL3     = 0x11C,
	TEXT_GIRL4     = 0x11D,
	TEXT_DEFILER1  = 0x11E,
	TEXT_DEFILER2  = 0x11F,
	TEXT_DEFILER3  = 0x120,
	TEXT_DEFILER4  = 0x121,
	TEXT_DEFILER5  = 0x122,
	TEXT_NAKRUL1   = 0x123,
	TEXT_NAKRUL2   = 0x124,
	TEXT_NAKRUL3   = 0x125,
	TEXT_NAKRUL4   = 0x126,
	TEXT_NAKRUL5   = 0x127,
	TEXT_CORNSTN   = 0x128,
	TEXT_JERSEY1   = 0x129,
	TEXT_JERSEY2   = 0x12A,
	TEXT_JERSEY3   = 0x12B,
	TEXT_JERSEY4   = 0x12C,
	TEXT_JERSEY5   = 0x12D,
	TEXT_JERSEY6   = 0x12E,
	TEXT_JERSEY7   = 0x12F,
	TEXT_JERSEY8   = 0x130,
	TEXT_JERSEY9   = 0x131,
	TEXT_TRADER    = 0x132,
	TEXT_FARMER6   = 0x133,
	TEXT_FARMER7   = 0x134,
	TEXT_FARMER8   = 0x135,
	TEXT_FARMER9   = 0x136,
	TEXT_FARMER10  = 0x137,
	TEXT_JERSEY10  = 0x138,
	TEXT_JERSEY11  = 0x139,
	TEXT_JERSEY12  = 0x13A,
	TEXT_JERSEY13  = 0x13B,
	TEXT_SKLJRN    = 0x13C,
	TEXT_BOOK4     = 0x13D,
	TEXT_BOOK5     = 0x13E,
	TEXT_BOOK6     = 0x13F,
	TEXT_BOOK7     = 0x140,
	TEXT_BOOK8     = 0x141,
	TEXT_BOOK9     = 0x142,
	TEXT_BOOKA     = 0x143,
	TEXT_BOOKB     = 0x144,
	TEXT_BOOKC     = 0x145,
	TEXT_OBOOKA    = 0x146,
	TEXT_OBOOKB    = 0x147,
	TEXT_OBOOKC    = 0x148,
	TEXT_MBOOKA    = 0x149,
	TEXT_MBOOKB    = 0x14A,
	TEXT_MBOOKC    = 0x14B,
	TEXT_RBOOKA    = 0x14C,
	TEXT_RBOOKB    = 0x14D,
	TEXT_RBOOKC    = 0x14E,
	TEXT_BBOOKA    = 0x14F,
	TEXT_BBOOKB    = 0x150,
	TEXT_BBOOKC    = 0x151,
#endif
} _speech_id;

typedef enum object_graphic_id {
	OFILE_L1BRAZ   = 0x0,
	OFILE_L1DOORS  = 0x1,
	OFILE_LEVER    = 0x2,
	OFILE_CHEST1   = 0x3,
	OFILE_CHEST2   = 0x4,
	OFILE_BANNER   = 0x5,
	OFILE_SKULPILE = 0x6,
	OFILE_SKULFIRE = 0x7,
	OFILE_SKULSTIK = 0x8,
	OFILE_CRUXSK1  = 0x9,
	OFILE_CRUXSK2  = 0xA,
	OFILE_CRUXSK3  = 0xB,
	OFILE_BOOK1    = 0xC,
	OFILE_BOOK2    = 0xD,
	OFILE_ROCKSTAN = 0xE,
	OFILE_ANGEL    = 0xF,
	OFILE_CHEST3   = 0x10,
	OFILE_BURNCROS = 0x11,
	OFILE_CANDLE2  = 0x12,
	OFILE_NUDE2    = 0x13,
	OFILE_SWITCH4  = 0x14,
	OFILE_TNUDEM   = 0x15,
	OFILE_TNUDEW   = 0x16,
	OFILE_TSOUL    = 0x17,
	OFILE_L2DOORS  = 0x18,
	OFILE_WTORCH4  = 0x19,
	OFILE_WTORCH3  = 0x1A,
	OFILE_SARC     = 0x1B,
	OFILE_FLAME1   = 0x1C,
	OFILE_PRSRPLT1 = 0x1D,
	OFILE_TRAPHOLE = 0x1E,
	OFILE_MINIWATR = 0x1F,
	OFILE_WTORCH2  = 0x20,
	OFILE_WTORCH1  = 0x21,
	OFILE_BCASE    = 0x22,
	OFILE_BSHELF   = 0x23,
	OFILE_WEAPSTND = 0x24,
	OFILE_BARREL   = 0x25,
	OFILE_BARRELEX = 0x26,
	OFILE_LSHRINEG = 0x27,
	OFILE_RSHRINEG = 0x28,
	OFILE_BLOODFNT = 0x29,
	OFILE_DECAP    = 0x2A,
	OFILE_PEDISTL  = 0x2B,
	OFILE_L3DOORS  = 0x2C,
	OFILE_PFOUNTN  = 0x2D,
	OFILE_ARMSTAND = 0x2E,
	OFILE_GOATSHRN = 0x2F,
	OFILE_CAULDREN = 0x30,
	OFILE_MFOUNTN  = 0x31,
	OFILE_TFOUNTN  = 0x32,
	OFILE_ALTBOY   = 0x33,
	OFILE_MCIRL    = 0x34,
	OFILE_BKSLBRNT = 0x35,
	OFILE_MUSHPTCH = 0x36,
	OFILE_LZSTAND  = 0x37,
} object_graphic_id;

typedef enum dungeon_type {
	DTYPE_TOWN      = 0x0,
	DTYPE_CATHEDRAL = 0x1,
	DTYPE_CATACOMBS = 0x2,
	DTYPE_CAVES     = 0x3,
	DTYPE_HELL      = 0x4,
#ifdef HELLFIRE
	DTYPE_NEST      = 0x5,
	DTYPE_CRYPT     = 0x6,
#endif
	DTYPE_NONE      = 0xFF,
} dungeon_type;

typedef enum dflag {
	BFLAG_MISSILE     = 0x01,
	BFLAG_VISIBLE     = 0x02,
	BFLAG_DEAD_PLAYER = 0x04,
	BFLAG_POPULATED   = 0x08,
	BFLAG_MONSTLR     = 0x10,
	BFLAG_PLAYERLR    = 0x20,
	BFLAG_LIT         = 0x40,
	BFLAG_EXPLORED    = 0x80,
} dflag;

typedef enum clicktype {
	CLICK_NONE  = 0,
	CLICK_LEFT  = 1,
	CLICK_RIGHT = 2,
} clicktype;

typedef enum placeflag {
	PLACE_SCATTER = 1,
	PLACE_SPECIAL = 2,
	PLACE_UNIQUE  = 4,
} placeflag;

typedef enum mienemy_type {
	TARGET_MONSTERS = 0,
	TARGET_PLAYERS  = 1,
	TARGET_BOTH     = 2,
} mienemy_type;

/*

Looks like someone treated hex values as binary, so 0x10 came after 0x01, that's why we have 1 and 16, they did the same thing with affix_item_type

*/
typedef enum goodorevil {
	GOE_ANY  = 0x00,
	GOE_EVIL = 0x01,
	GOE_GOOD = 0x10,
} goodorevil;

/*

 First 5 bits store level

 6th bit stores onlygood flag

 7th bit stores uper15 flag - uper means unique percent, this flag is true for unique monsters and loot from them has 15% to become unique

 8th bit stores uper1 flag - this is loot from normal monsters, which has 1% to become unique

 9th bit stores info if item is unique

 10th bit stores info if item is a basic one from griswold

 11th bit stores info if item is a premium one from griswold

 12th bit stores info if item is from wirt

 13th bit stores info if item is from adria

 14th bit stores info if item is from pepin

 15th bit stores pregen flag



 combining CF_UPER15 and CF_UPER1 flags (CF_USEFUL) is used to mark potions and town portal scrolls created on the ground

 CF_TOWN is combining all store flags and indicates if item has been bought from a NPC

 */
typedef enum icreateinfo_flag {
	CF_LEVEL        = (1 << 6) - 1,
	CF_ONLYGOOD     = 1 << 6,
	CF_UPER15       = 1 << 7,
	CF_UPER1        = 1 << 8,
	CF_UNIQUE       = 1 << 9,
	CF_SMITH        = 1 << 10,
	CF_SMITHPREMIUM = 1 << 11,
	CF_BOY          = 1 << 12,
	CF_WITCH        = 1 << 13,
	CF_HEALER       = 1 << 14,
	CF_PREGEN       = 1 << 15,

	CF_USEFUL = CF_UPER15 | CF_UPER1,
	CF_TOWN   = CF_SMITH | CF_SMITHPREMIUM | CF_BOY | CF_WITCH | CF_HEALER,
} icreateinfo_flag;

typedef enum dungeon_message {
	DMSG_CATHEDRAL = 1 << 0,
	DMSG_CATACOMBS = 1 << 1,
	DMSG_CAVES     = 1 << 2,
	DMSG_HELL      = 1 << 3,
	DMSG_DIABLO    = 1 << 4,
} dungeon_message;

typedef enum diablo_message {
	EMSG_NONE                   = 0,
	EMSG_NO_AUTOMAP_IN_TOWN     = 1,
	EMSG_NO_MULTIPLAYER_IN_DEMO = 2,
	EMSG_DIRECT_SOUND_FAILED    = 3,
	EMSG_NOT_IN_SHAREWARE       = 4,
	EMSG_NO_SPACE_TO_SAVE       = 5,
	EMSG_NO_PAUSE_IN_TOWN       = 6,
	EMSG_COPY_TO_HDD            = 7,
	EMSG_DESYNC                 = 8,
	EMSG_NO_PAUSE_IN_MP         = 9,
	EMSG_LOADING                = 10,
	EMSG_SAVING                 = 11,
	EMSG_SHRINE_MYSTERIOUS      = 12,
	EMSG_SHRINE_HIDDEN          = 13,
	EMSG_SHRINE_GLOOMY          = 14,
	EMSG_SHRINE_WEIRD           = 15,
	EMSG_SHRINE_MAGICAL         = 16,
	EMSG_SHRINE_STONE           = 17,
	EMSG_SHRINE_RELIGIOUS       = 18,
	EMSG_SHRINE_ENCHANTED       = 19,
	EMSG_SHRINE_THAUMATURGIC    = 20,
	EMSG_SHRINE_FASCINATING     = 21,
	EMSG_SHRINE_CRYPTIC         = 22,
	EMSG_SHRINE_UNUSED          = 23,
	EMSG_SHRINE_ELDRITCH        = 24,
	EMSG_SHRINE_EERIE           = 25,
	EMSG_SHRINE_DIVINE          = 26,
	EMSG_SHRINE_HOLY            = 27,
	EMSG_SHRINE_SACRED          = 28,
	EMSG_SHRINE_SPIRITUAL       = 29,
	EMSG_SHRINE_SPOOKY1         = 30,
	EMSG_SHRINE_SPOOKY2         = 31,
	EMSG_SHRINE_ABANDONED       = 32,
	EMSG_SHRINE_CREEPY          = 33,
	EMSG_SHRINE_QUIET           = 34,
	EMSG_SHRINE_SECLUDED        = 35,
	EMSG_SHRINE_ORNATE          = 36,
	EMSG_SHRINE_GLIMMERING      = 37,
	EMSG_SHRINE_TAINTED1        = 38,
	EMSG_SHRINE_TAINTED2        = 39,
	EMSG_REQUIRES_LVL_8         = 40,
	EMSG_REQUIRES_LVL_13        = 41,
	EMSG_REQUIRES_LVL_17        = 42,
	EMSG_BONECHAMB              = 43,
#ifdef HELLFIRE
	EMSG_SHRINE_OILY            = 44,
	EMSG_SHRINE_GLOWING         = 45,
	EMSG_SHRINE_MENDICANT       = 46,
	EMSG_SHRINE_SPARKLING       = 47,
	EMSG_SHRINE_TOWN            = 48,
	EMSG_SHRINE_SHIMMERING      = 49,
	EMSG_SHRINE_SOLAR1          = 50,
	EMSG_SHRINE_SOLAR2          = 51,
	EMSG_SHRINE_SOLAR3          = 52,
	EMSG_SHRINE_SOLAR4          = 53,
	EMSG_SHRINE_MURPHYS         = 54,
#endif
} diablo_message;

typedef enum magic_type {
	STYPE_FIRE      = 0x0,
	STYPE_LIGHTNING = 0x1,
	STYPE_MAGIC     = 0x2,
} magic_type;

typedef enum theme_id {
	THEME_BARREL            = 0x0,
	THEME_SHRINE            = 0x1,
	THEME_MONSTPIT          = 0x2,
	THEME_SKELROOM          = 0x3,
	THEME_TREASURE          = 0x4,
	THEME_LIBRARY           = 0x5,
	THEME_TORTURE           = 0x6,
	THEME_BLOODFOUNTAIN     = 0x7,
	THEME_DECAPITATED       = 0x8,
	THEME_PURIFYINGFOUNTAIN = 0x9,
	THEME_ARMORSTAND        = 0xA,
	THEME_GOATSHRINE        = 0xB,
	THEME_CAULDRON          = 0xC,
	THEME_MURKYFOUNTAIN     = 0xD,
	THEME_TEARFOUNTAIN      = 0xE,
	THEME_BRNCROSS          = 0xF,
	THEME_WEAPONRACK        = 0x10,
	THEME_NONE              = -1,
} theme_id;

typedef enum event_type {
	EVENT_TYPE_PLAYER_CREATE_GAME = 1,
	EVENT_TYPE_2                  = 2,
	EVENT_TYPE_PLAYER_LEAVE_GAME  = 3,
	EVENT_TYPE_PLAYER_MESSAGE     = 4,
	EVENT_TYPE_5                  = 5,
	EVENT_TYPE_6                  = 6,
	EVENT_TYPE_7                  = 7,
	EVENT_TYPE_8                  = 8,
	EVENT_TYPE_9                  = 9,
	EVENT_TYPE_10                 = 10,
	EVENT_TYPE_11                 = 11,
	EVENT_TYPE_12                 = 12,
	EVENT_TYPE_13                 = 13,
	EVENT_TYPE_14                 = 14,
	EVENT_TYPE_15                 = 15,
} event_type;

typedef enum _copyprot_results {
	COPYPROT_OK     = 1,
	COPYPROT_CANCEL = 2,
} _copyprot_results;

typedef enum text_color {
	COL_WHITE = 0x0,
	COL_BLUE  = 0x1,
	COL_RED   = 0x2,
	COL_GOLD  = 0x3,
} text_color;

typedef enum item_color {
	ICOL_WHITE = PAL16_YELLOW + 5,
	ICOL_BLUE  = PAL16_BLUE + 5,
	ICOL_RED   = PAL16_RED + 5,
} item_color;

typedef enum _difficulty {
	DIFF_NORMAL      = 0x0,
	DIFF_NIGHTMARE   = 0x1,
	DIFF_HELL        = 0x2,
	NUM_DIFFICULTIES = 0x3,
} _difficulty;

typedef enum MON_MODE {
	MM_STAND     = 0,
	MM_WALK      = 1,
	MM_WALK2     = 2,
	MM_WALK3     = 3,
	MM_ATTACK    = 4,
	MM_GOTHIT    = 5,
	MM_DEATH     = 6,
	MM_SATTACK   = 7,
	MM_FADEIN    = 8,
	MM_FADEOUT   = 9,
	MM_RATTACK   = 10,
	MM_SPSTAND   = 11,
	MM_RSPATTACK = 12,
	MM_DELAY     = 13,
	MM_CHARGE    = 14,
	MM_STONE     = 15,
	MM_HEAL      = 16,
	MM_TALK      = 17,
} MON_MODE;

typedef enum MON_ANIM {
	MA_STAND   = 0,
	MA_WALK    = 1,
	MA_ATTACK  = 2,
	MA_GOTHIT  = 3,
	MA_DEATH   = 4,
	MA_SPECIAL = 5,
} MON_ANIM;

typedef enum PLR_MODE {
	PM_STAND   = 0,
	PM_WALK    = 1,
	PM_WALK2   = 2,
	PM_WALK3   = 3,
	PM_ATTACK  = 4,
	PM_RATTACK = 5,
	PM_BLOCK   = 6,
	PM_GOTHIT  = 7,
	PM_DEATH   = 8,
	PM_SPELL   = 9,
	PM_NEWLVL  = 10,
	PM_QUIT    = 11,
} PLR_MODE;

typedef enum spell_type {
	RSPLTYPE_SKILL   = 0x0,
	RSPLTYPE_SPELL   = 0x1,
	RSPLTYPE_SCROLL  = 0x2,
	RSPLTYPE_CHARGES = 0x3,
	RSPLTYPE_INVALID = 0x4,
} spell_type;

typedef enum cursor_id {
	CURSOR_NONE        = 0x0,
	CURSOR_HAND        = 0x1,
	CURSOR_IDENTIFY    = 0x2,
	CURSOR_REPAIR      = 0x3,
	CURSOR_RECHARGE    = 0x4,
	CURSOR_DISARM      = 0x5,
	CURSOR_OIL         = 0x6,
	CURSOR_TELEKINESIS = 0x7,
	CURSOR_RESURRECT   = 0x8,
	CURSOR_TELEPORT    = 0x9,
	CURSOR_HEALOTHER   = 0xA,
	CURSOR_HOURGLASS   = 0xB,
	CURSOR_FIRSTITEM   = 0xC,
} cursor_id;

typedef enum direction {
	DIR_S    = 0x0,
	DIR_SW   = 0x1,
	DIR_W    = 0x2,
	DIR_NW   = 0x3,
	DIR_N    = 0x4,
	DIR_NE   = 0x5,
	DIR_E    = 0x6,
	DIR_SE   = 0x7,
	DIR_OMNI = 0x8,
} direction;

typedef enum _scroll_direction {
	SDIR_NONE = 0x0,
	SDIR_N    = 0x1,
	SDIR_NE   = 0x2,
	SDIR_E    = 0x3,
	SDIR_SE   = 0x4,
	SDIR_S    = 0x5,
	SDIR_SW   = 0x6,
	SDIR_W    = 0x7,
	SDIR_NW   = 0x8,
} _scroll_direction;

typedef enum interface_mode {
	WM_DIABNEXTLVL  = 0x402, // WM_USER+2
	WM_DIABPREVLVL  = 0x403,
	WM_DIABRTNLVL   = 0x404,
	WM_DIABSETLVL   = 0x405,
	WM_DIABWARPLVL  = 0x406,
	WM_DIABTOWNWARP = 0x407,
	WM_DIABTWARPUP  = 0x408,
	WM_DIABRETOWN   = 0x409,
	WM_DIABNEWGAME  = 0x40A,
	WM_DIABLOADGAME = 0x40B
	// WM_LEIGHSKIP = 0x40C, // psx only
	// WM_DIAVNEWLVL = 0x40D, // psx only
} interface_mode;

typedef enum lvl_entry {
	ENTRY_MAIN    = 0,
	ENTRY_PREV    = 1,
	ENTRY_SETLVL  = 2,
	ENTRY_RTNLVL  = 3,
	ENTRY_LOAD    = 4,
	ENTRY_WARPLVL = 5,
	ENTRY_TWARPDN = 6,
	ENTRY_TWARPUP = 7,
} lvl_entry;

typedef enum game_info {
	GAMEINFO_NAME         = 1,
	GAMEINFO_PASSWORD     = 2,
	GAMEINFO_STATS        = 3,
	GAMEINFO_MODEFLAG     = 4,
	GAMEINFO_GAMETEMPLATE = 5,
	GAMEINFO_PLAYERS      = 6,
} game_info;

typedef enum spell_id {
	SPL_NULL        = 0x0,
	SPL_FIREBOLT    = 0x1,
	SPL_HEAL        = 0x2,
	SPL_LIGHTNING   = 0x3,
	SPL_FLASH       = 0x4,
	SPL_IDENTIFY    = 0x5,
	SPL_FIREWALL    = 0x6,
	SPL_TOWN        = 0x7,
	SPL_STONE       = 0x8,
	SPL_INFRA       = 0x9,
	SPL_RNDTELEPORT = 0xA,
	SPL_MANASHIELD  = 0xB,
	SPL_FIREBALL    = 0xC,
	SPL_GUARDIAN    = 0xD,
	SPL_CHAIN       = 0xE,
	SPL_WAVE        = 0xF,
	SPL_DOOMSERP    = 0x10,
	SPL_BLODRIT     = 0x11,
	SPL_NOVA        = 0x12,
	SPL_INVISIBIL   = 0x13,
	SPL_FLAME       = 0x14,
	SPL_GOLEM       = 0x15,
	SPL_BLODBOIL    = 0x16,
	SPL_TELEPORT    = 0x17,
	SPL_APOCA       = 0x18,
	SPL_ETHEREALIZE = 0x19,
	SPL_REPAIR      = 0x1A,
	SPL_RECHARGE    = 0x1B,
	SPL_DISARM      = 0x1C,
	SPL_ELEMENT     = 0x1D,
	SPL_CBOLT       = 0x1E,
	SPL_HBOLT       = 0x1F,
	SPL_RESURRECT   = 0x20,
	SPL_TELEKINESIS = 0x21,
	SPL_HEALOTHER   = 0x22,
	SPL_FLARE       = 0x23,
	SPL_BONESPIRIT  = 0x24,
#ifdef HELLFIRE
	SPL_MANA        = 0x25,
	SPL_MAGI        = 0x26,
	SPL_JESTER      = 0x27,
	SPL_LIGHTWALL   = 0x28,
	SPL_IMMOLAT     = 0x29,
	SPL_WARP        = 0x2A,
	SPL_REFLECT     = 0x2B,
	SPL_BERSERK     = 0x2C,
	SPL_FIRERING    = 0x2D,
	SPL_SEARCH      = 0x2E,
	SPL_RUNEFIRE    = 0x2F,
	SPL_RUNELIGHT   = 0x30,
	SPL_RUNENOVA    = 0x31,
	SPL_RUNEIMMOLAT = 0x32,
	SPL_RUNESTONE   = 0x33,
#endif
	SPL_INVALID     = -1,
} spell_id;

typedef enum _cmd_id {
	CMD_STAND,
	CMD_WALKXY,
	CMD_ACK_PLRINFO,
	CMD_ADDSTR,
	CMD_ADDMAG,
	CMD_ADDDEX,
	CMD_ADDVIT,
	CMD_SBSPELL,
	CMD_GETITEM,
	CMD_AGETITEM,
	CMD_PUTITEM,
	CMD_RESPAWNITEM,
	CMD_ATTACKXY,
	CMD_RATTACKXY,
	CMD_SPELLXY,
	CMD_TSPELLXY,
	CMD_OPOBJXY,
	CMD_DISARMXY,
	CMD_ATTACKID,
	CMD_ATTACKPID,
	CMD_RATTACKID,
	CMD_RATTACKPID,
	CMD_SPELLID,
	CMD_SPELLPID,
	CMD_TSPELLID,
	CMD_TSPELLPID,
	CMD_RESURRECT,
	CMD_OPOBJT,
	CMD_KNOCKBACK,
	CMD_TALKXY,
	CMD_NEWLVL,
	CMD_WARP,
	CMD_CHEAT_EXPERIENCE,
	CMD_CHEAT_SPELL_LEVEL,
	CMD_DEBUG,
	CMD_SYNCDATA,
	CMD_MONSTDEATH,
	CMD_MONSTDAMAGE,
	CMD_PLRDEAD,
	CMD_REQUESTGITEM,
	CMD_REQUESTAGITEM,
	CMD_GOTOGETITEM,
	CMD_GOTOAGETITEM,
	CMD_OPENDOOR,
	CMD_CLOSEDOOR,
	CMD_OPERATEOBJ,
	CMD_PLROPOBJ,
	CMD_BREAKOBJ,
	CMD_CHANGEPLRITEMS,
	CMD_DELPLRITEMS,
	CMD_PLRDAMAGE,
	CMD_PLRLEVEL,
	CMD_DROPITEM,
	CMD_PLAYER_JOINLEVEL,
	CMD_SEND_PLRINFO,
	CMD_SATTACKXY,
	CMD_ACTIVATEPORTAL,
	CMD_DEACTIVATEPORTAL,
	CMD_DLEVEL_0,
	CMD_DLEVEL_1,
	CMD_DLEVEL_2,
	CMD_DLEVEL_3,
	CMD_DLEVEL_4,
	CMD_DLEVEL_5,
	CMD_DLEVEL_6,
	CMD_DLEVEL_7,
	CMD_DLEVEL_8,
	CMD_DLEVEL_9,
	CMD_DLEVEL_10,
	CMD_DLEVEL_11,
	CMD_DLEVEL_12,
	CMD_DLEVEL_13,
	CMD_DLEVEL_14,
	CMD_DLEVEL_15,
	CMD_DLEVEL_16,
#ifdef HELLFIRE
	CMD_DLEVEL_17,
	CMD_DLEVEL_18,
	CMD_DLEVEL_19,
	CMD_DLEVEL_20,
	CMD_DLEVEL_21,
	CMD_DLEVEL_22,
	CMD_DLEVEL_23,
	CMD_DLEVEL_24,
#endif
	CMD_DLEVEL_JUNK,
	CMD_DLEVEL_END,
	CMD_HEALOTHER,
	CMD_STRING,
	CMD_SETSTR,
	CMD_SETMAG,
	CMD_SETDEX,
	CMD_SETVIT,
	CMD_RETOWN,
	CMD_SPELLXYD,
	CMD_ITEMEXTRA,
	CMD_SYNCPUTITEM,
	CMD_KILLGOLEM,
	CMD_SYNCQUEST,
	CMD_ENDSHIELD,
	CMD_AWAKEGOLEM,
#ifdef HELLFIRE
	CMD_REFLECT,
	CMD_NAKRUL,
	CMD_OPENHIVE,
	CMD_OPENCRYPT,
#else
	CMD_NOVA,
	CMD_SETSHIELD,
	CMD_REMSHIELD,
#endif
	FAKE_CMD_SETID,
	FAKE_CMD_DROPID,
	NUM_CMDS,
} _cmd_id;

typedef enum _talker_id {
	TOWN_SMITH   = 0x0,
	TOWN_HEALER  = 0x1,
	TOWN_DEADGUY = 0x2,
	TOWN_TAVERN  = 0x3,
	TOWN_STORY   = 0x4,
	TOWN_DRUNK   = 0x5,
	TOWN_WITCH   = 0x6,
	TOWN_BMAID   = 0x7,
	TOWN_PEGBOY  = 0x8,
	TOWN_COW     = 0x9,
#ifdef HELLFIRE
	TOWN_FARMER  = 0xA,
	TOWN_GIRL    = 0xB,
	TOWN_COWFARM = 0xC,
#else
	TOWN_PRIEST  = 0xA,
#endif
} _talker_id;

typedef enum _music_id {
	TMUSIC_TOWN,
	TMUSIC_L1,
	TMUSIC_L2,
	TMUSIC_L3,
	TMUSIC_L4,
#ifdef HELLFIRE
	TMUSIC_L5,
	TMUSIC_L6,
#endif
	TMUSIC_INTRO,
	NUM_MUSIC,
} _music_id;

typedef enum _mainmenu_selections {
	MAINMENU_SINGLE_PLAYER = 1,
	MAINMENU_MULTIPLAYER,
	MAINMENU_REPLAY_INTRO,
#ifdef HELLFIRE
	MAINMENU_SHOW_SUPPORT,
#endif
	MAINMENU_SHOW_CREDITS,
	MAINMENU_EXIT_DIABLO,
	MAINMENU_ATTRACT_MODE,
} _mainmenu_selections;

typedef enum _selhero_selections {
	SELHERO_NEW_DUNGEON = 1,
	SELHERO_CONTINUE    = 2,
	SELHERO_CONNECT     = 3,
	SELHERO_PREVIOUS    = 4
} _selhero_selections;

typedef enum panel_button_id {
	PANBTN_CHARINFO  = 0,
	PANBTN_QLOG      = 1,
	PANBTN_AUTOMAP   = 2,
	PANBTN_MAINMENU  = 3,
	PANBTN_INVENTORY = 4,
	PANBTN_SPELLBOOK = 5,
	PANBTN_SENDMSG   = 6,
	PANBTN_FRIENDLY  = 7,
} panel_button_id;

typedef enum attribute_id {
	ATTRIB_STR = 0,
	ATTRIB_MAG = 1,
	ATTRIB_DEX = 2,
	ATTRIB_VIT = 3,
} attribute_id;

typedef enum _object_id {
	OBJ_L1LIGHT      = 0x0,
	OBJ_L1LDOOR      = 0x1,
	OBJ_L1RDOOR      = 0x2,
	OBJ_SKFIRE       = 0x3,
	OBJ_LEVER        = 0x4,
	OBJ_CHEST1       = 0x5,
	OBJ_CHEST2       = 0x6,
	OBJ_CHEST3       = 0x7,
	OBJ_CANDLE1      = 0x8,
	OBJ_CANDLE2      = 0x9,
	OBJ_CANDLEO      = 0xA,
	OBJ_BANNERL      = 0xB,
	OBJ_BANNERM      = 0xC,
	OBJ_BANNERR      = 0xD,
	OBJ_SKPILE       = 0xE,
	OBJ_SKSTICK1     = 0xF,
	OBJ_SKSTICK2     = 0x10,
	OBJ_SKSTICK3     = 0x11,
	OBJ_SKSTICK4     = 0x12,
	OBJ_SKSTICK5     = 0x13,
	OBJ_CRUX1        = 0x14,
	OBJ_CRUX2        = 0x15,
	OBJ_CRUX3        = 0x16,
	OBJ_STAND        = 0x17,
	OBJ_ANGEL        = 0x18,
	OBJ_BOOK2L       = 0x19,
	OBJ_BCROSS       = 0x1A,
	OBJ_NUDEW2R      = 0x1B,
	OBJ_SWITCHSKL    = 0x1C,
	OBJ_TNUDEM1      = 0x1D,
	OBJ_TNUDEM2      = 0x1E,
	OBJ_TNUDEM3      = 0x1F,
	OBJ_TNUDEM4      = 0x20,
	OBJ_TNUDEW1      = 0x21,
	OBJ_TNUDEW2      = 0x22,
	OBJ_TNUDEW3      = 0x23,
	OBJ_TORTURE1     = 0x24,
	OBJ_TORTURE2     = 0x25,
	OBJ_TORTURE3     = 0x26,
	OBJ_TORTURE4     = 0x27,
	OBJ_TORTURE5     = 0x28,
	OBJ_BOOK2R       = 0x29,
	OBJ_L2LDOOR      = 0x2A,
	OBJ_L2RDOOR      = 0x2B,
	OBJ_TORCHL       = 0x2C,
	OBJ_TORCHR       = 0x2D,
	OBJ_TORCHL2      = 0x2E,
	OBJ_TORCHR2      = 0x2F,
	OBJ_SARC         = 0x30,
	OBJ_FLAMEHOLE    = 0x31,
	OBJ_FLAMELVR     = 0x32,
	OBJ_WATER        = 0x33,
	OBJ_BOOKLVR      = 0x34,
	OBJ_TRAPL        = 0x35,
	OBJ_TRAPR        = 0x36,
	OBJ_BOOKSHELF    = 0x37,
	OBJ_WEAPRACK     = 0x38,
	OBJ_BARREL       = 0x39,
	OBJ_BARRELEX     = 0x3A,
	OBJ_SHRINEL      = 0x3B,
	OBJ_SHRINER      = 0x3C,
	OBJ_SKELBOOK     = 0x3D,
	OBJ_BOOKCASEL    = 0x3E,
	OBJ_BOOKCASER    = 0x3F,
	OBJ_BOOKSTAND    = 0x40,
	OBJ_BOOKCANDLE   = 0x41,
	OBJ_BLOODFTN     = 0x42,
	OBJ_DECAP        = 0x43,
	OBJ_TCHEST1      = 0x44,
	OBJ_TCHEST2      = 0x45,
	OBJ_TCHEST3      = 0x46,
	OBJ_BLINDBOOK    = 0x47,
	OBJ_BLOODBOOK    = 0x48,
	OBJ_PEDISTAL     = 0x49,
	OBJ_L3LDOOR      = 0x4A,
	OBJ_L3RDOOR      = 0x4B,
	OBJ_PURIFYINGFTN = 0x4C,
	OBJ_ARMORSTAND   = 0x4D,
	OBJ_ARMORSTANDN  = 0x4E,
	OBJ_GOATSHRINE   = 0x4F,
	OBJ_CAULDRON     = 0x50,
	OBJ_MURKYFTN     = 0x51,
	OBJ_TEARFTN      = 0x52,
	OBJ_ALTBOY       = 0x53,
	OBJ_MCIRCLE1     = 0x54,
	OBJ_MCIRCLE2     = 0x55,
	OBJ_STORYBOOK    = 0x56,
	OBJ_STORYCANDLE  = 0x57,
	OBJ_STEELTOME    = 0x58,
	OBJ_WARARMOR     = 0x59,
	OBJ_WARWEAP      = 0x5A,
	OBJ_TBCROSS      = 0x5B,
	OBJ_WEAPONRACK   = 0x5C,
	OBJ_WEAPONRACKN  = 0x5D,
	OBJ_MUSHPATCH    = 0x5E,
	OBJ_LAZSTAND     = 0x5F,
	OBJ_SLAINHERO    = 0x60,
	OBJ_SIGNCHEST    = 0x61,
	OBJ_NULL_98      = 0x62,
} _object_id;

typedef enum item_misc_id {
	IMISC_NONE      = 0x0,
	IMISC_USEFIRST  = 0x1,
	IMISC_FULLHEAL  = 0x2,
	IMISC_HEAL      = 0x3,
	IMISC_OLDHEAL   = 0x4,
	IMISC_DEADHEAL  = 0x5,
	IMISC_MANA      = 0x6,
	IMISC_FULLMANA  = 0x7,
	IMISC_POTEXP    = 0x8, /* add experience */
	IMISC_POTFORG   = 0x9, /* remove experience */
	IMISC_ELIXSTR   = 0xA,
	IMISC_ELIXMAG   = 0xB,
	IMISC_ELIXDEX   = 0xC,
	IMISC_ELIXVIT   = 0xD,
	IMISC_ELIXWEAK  = 0xE, /* double check with alpha */
	IMISC_ELIXDIS   = 0xF,
	IMISC_ELIXCLUM  = 0x10,
	IMISC_ELIXSICK  = 0x11,
	IMISC_REJUV     = 0x12,
	IMISC_FULLREJUV = 0x13,
	IMISC_USELAST   = 0x14,
	IMISC_SCROLL    = 0x15,
	IMISC_SCROLLT   = 0x16,
	IMISC_STAFF     = 0x17,
	IMISC_BOOK      = 0x18,
	IMISC_RING      = 0x19,
	IMISC_AMULET    = 0x1A,
	IMISC_UNIQUE    = 0x1B,
	IMISC_FOOD      = 0x1C, /* from demo/PSX */
	IMISC_OILFIRST  = 0x1D,
	IMISC_OILOF     = 0x1E, /* oils are beta or hellfire only */
	IMISC_OILACC    = 0x1F,
	IMISC_OILMAST   = 0x20,
	IMISC_OILSHARP  = 0x21,
	IMISC_OILDEATH  = 0x22,
	IMISC_OILSKILL  = 0x23,
	IMISC_OILBSMTH  = 0x24,
	IMISC_OILFORT   = 0x25,
	IMISC_OILPERM   = 0x26,
	IMISC_OILHARD   = 0x27,
	IMISC_OILIMP    = 0x28,
	IMISC_OILLAST   = 0x29,
	IMISC_MAPOFDOOM = 0x2A,
	IMISC_EAR       = 0x2B,
	IMISC_SPECELIX  = 0x2C,
#ifdef HELLFIRE
	IMISC_RUNEFIRST = 0x2E,
	IMISC_RUNEF     = 0x2F,
	IMISC_RUNEL     = 0x30,
	IMISC_GR_RUNEL  = 0x31,
	IMISC_GR_RUNEF  = 0x32,
	IMISC_RUNES     = 0x33,
	IMISC_RUNELAST  = 0x34,
	IMISC_AURIC     = 0x35,
	IMISC_NOTE      = 0x36,
#endif
	IMISC_INVALID   = -1,
} item_misc_id;

typedef enum item_type {
	ITYPE_MISC   = 0x0,
	ITYPE_SWORD  = 0x1,
	ITYPE_AXE    = 0x2,
	ITYPE_BOW    = 0x3,
	ITYPE_MACE   = 0x4,
	ITYPE_SHIELD = 0x5,
	ITYPE_LARMOR = 0x6,
	ITYPE_HELM   = 0x7,
	ITYPE_MARMOR = 0x8,
	ITYPE_HARMOR = 0x9,
	ITYPE_STAFF  = 0xA,
	ITYPE_GOLD   = 0xB,
	ITYPE_RING   = 0xC,
	ITYPE_AMULET = 0xD,
	ITYPE_FOOD   = 0xE, /* used in demo */
	ITYPE_NONE   = -1,
} item_type;

typedef enum _item_indexes {
	IDI_GOLD,
	IDI_WARRIOR,
	IDI_WARRSHLD,
	IDI_WARRCLUB,
	IDI_ROGUE,
	IDI_SORCEROR,
	IDI_CLEAVER,
	IDI_FIRSTQUEST = IDI_CLEAVER,
	IDI_SKCROWN,
	IDI_INFRARING,
	IDI_ROCK,
	IDI_OPTAMULET,
	IDI_TRING,
	IDI_BANNER,
	IDI_HARCREST,
	IDI_STEELVEIL,
	IDI_GLDNELIX,
	IDI_ANVIL,
	IDI_MUSHROOM,
	IDI_BRAIN,
	IDI_FUNGALTM,
	IDI_SPECELIX,
	IDI_BLDSTONE,
	IDI_MAPOFDOOM,
	IDI_LASTQUEST = IDI_MAPOFDOOM,
	IDI_EAR,
	IDI_HEAL,
	IDI_MANA,
	IDI_IDENTIFY,
	IDI_PORTAL,
	IDI_ARMOFVAL,
	IDI_FULLHEAL,
	IDI_FULLMANA,
	IDI_GRISWOLD,
	IDI_LGTFORGE,
	IDI_LAZSTAFF,
	IDI_RESURRECT,
#ifdef HELLFIRE
	IDI_OIL,
	IDI_SHORTSTAFF,
	IDI_BARDSWORD,
	IDI_BARDDAGGER,
	IDI_RUNEBOMB,
	IDI_THEODORE,
	IDI_AURIC,
	IDI_NOTE1,
	IDI_NOTE2,
	IDI_NOTE3,
	IDI_FULLNOTE,
	IDI_BROWNSUIT,
	IDI_GREYSUIT,
#endif
} _item_indexes;

typedef enum _setlevels {
	//SL_BUTCHCHAMB = 0x0,
	SL_SKELKING     = 0x1,
	SL_BONECHAMB    = 0x2,
	SL_MAZE         = 0x3,
	SL_POISONWATER  = 0x4,
	SL_VILEBETRAYER = 0x5,
} _setlevels;

typedef enum quest_id {
	Q_ROCK     = 0x00,
	Q_MUSHROOM = 0x01,
	Q_GARBUD   = 0x02,
	Q_ZHAR     = 0x03,
	Q_VEIL     = 0x04,
	Q_DIABLO   = 0x05,
	Q_BUTCHER  = 0x06,
	Q_LTBANNER = 0x07,
	Q_BLIND    = 0x08,
	Q_BLOOD    = 0x09,
	Q_ANVIL    = 0x0A,
	Q_WARLORD  = 0x0B,
	Q_SKELKING = 0x0C,
	Q_PWATER   = 0x0D,
	Q_SCHAMB   = 0x0E,
	Q_BETRAYER = 0x0F,
#ifdef HELLFIRE
	Q_GRAVE    = 0x10,
	Q_FARMER   = 0x11,
	Q_GIRL     = 0x12,
	Q_TRADER   = 0x13,
	Q_DEFILER  = 0x14,
	Q_NAKRUL   = 0x15,
	Q_CORNSTN  = 0x16,
	Q_JERSEY   = 0x17,
#endif
	Q_INVALID  = -1,
} quest_id;

typedef enum quest_state {
	QUEST_NOTAVAIL = 0,
	QUEST_INIT     = 1,
	QUEST_ACTIVE   = 2,
	QUEST_DONE     = 3
} quest_state;

typedef enum quest_gametype {
	QUEST_SINGLE = 0,
	QUEST_ANY    = 1,
	QUEST_MULTI  = 2,
} quest_gametype;

typedef enum quest_mush_state {
	QS_INIT         = 0,
	QS_TOMESPAWNED  = 1,
	QS_TOMEGIVEN    = 2,
	QS_MUSHSPAWNED  = 3,
	QS_MUSHPICKED   = 4,
	QS_MUSHGIVEN    = 5,
	QS_BRAINSPAWNED = 6,
	QS_BRAINGIVEN   = 7,
} quest_mush_state;

typedef enum talk_id {
	STORE_NONE      = 0x0,
	STORE_SMITH     = 0x1,
	STORE_SBUY      = 0x2,
	STORE_SSELL     = 0x3,
	STORE_SREPAIR   = 0x4,
	STORE_WITCH     = 0x5,
	STORE_WBUY      = 0x6,
	STORE_WSELL     = 0x7,
	STORE_WRECHARGE = 0x8,
	STORE_NOMONEY   = 0x9,
	STORE_NOROOM    = 0xA,
	STORE_CONFIRM   = 0xB,
	STORE_BOY       = 0xC,
	STORE_BBOY      = 0xD,
	STORE_HEALER    = 0xE,
	STORE_STORY     = 0xF,
	STORE_HBUY      = 0x10,
	STORE_SIDENTIFY = 0x11,
	STORE_SPBUY     = 0x12,
	STORE_GOSSIP    = 0x13,
	STORE_IDSHOW    = 0x14,
	STORE_TAVERN    = 0x15,
	STORE_DRUNK     = 0x16,
	STORE_BARMAID   = 0x17,
} talk_id;

typedef enum _unique_items {
	UITEM_CLEAVER      = 0x0,
	UITEM_SKCROWN      = 0x1,
	UITEM_INFRARING    = 0x2,
	UITEM_OPTAMULET    = 0x3,
	UITEM_TRING        = 0x4,
	UITEM_HARCREST     = 0x5,
	UITEM_STEELVEIL    = 0x6,
	UITEM_ARMOFVAL     = 0x7,
	UITEM_GRISWOLD     = 0x8,
#ifndef HELLFIRE
	UITEM_LGTFORGE     = 0x9,
#else
	UITEM_BOVINE       = 0x9,
#endif
	UITEM_RIFTBOW      = 0xA,
	UITEM_NEEDLER      = 0xB,
	UITEM_CELESTBOW    = 0xC,
	UITEM_DEADLYHUNT   = 0xD,
	UITEM_BOWOFDEAD    = 0xE,
	UITEM_BLKOAKBOW    = 0xF,
	UITEM_FLAMEDART    = 0x10,
	UITEM_FLESHSTING   = 0x11,
	UITEM_WINDFORCE    = 0x12,
	UITEM_EAGLEHORN    = 0x13,
	UITEM_GONNAGALDIRK = 0x14,
	UITEM_DEFENDER     = 0x15,
	UITEM_GRYPHONCLAW  = 0x16,
	UITEM_BLACKRAZOR   = 0x17,
	UITEM_GIBBOUSMOON  = 0x18,
	UITEM_ICESHANK     = 0x19,
	UITEM_EXECUTIONER  = 0x1A,
	UITEM_BONESAW      = 0x1B,
	UITEM_SHADHAWK     = 0x1C,
	UITEM_WIZSPIKE     = 0x1D,
	UITEM_LGTSABRE     = 0x1E,
	UITEM_FALCONTALON  = 0x1F,
	UITEM_INFERNO      = 0x20,
	UITEM_DOOMBRINGER  = 0x21,
	UITEM_GRIZZLY      = 0x22,
	UITEM_GRANDFATHER  = 0x23,
	UITEM_MANGLER      = 0x24,
	UITEM_SHARPBEAK    = 0x25,
	UITEM_BLOODLSLAYER = 0x26,
	UITEM_CELESTAXE    = 0x27,
	UITEM_WICKEDAXE    = 0x28,
	UITEM_STONECLEAV   = 0x29,
	UITEM_AGUHATCHET   = 0x2A,
	UITEM_HELLSLAYER   = 0x2B,
	UITEM_MESSERREAVER = 0x2C,
	UITEM_CRACKRUST    = 0x2D,
	UITEM_JHOLMHAMM    = 0x2E,
	UITEM_CIVERBS      = 0x2F,
	UITEM_CELESTSTAR   = 0x30,
	UITEM_BARANSTAR    = 0x31,
	UITEM_GNARLROOT    = 0x32,
	UITEM_CRANBASH     = 0x33,
	UITEM_SCHAEFHAMM   = 0x34,
	UITEM_DREAMFLANGE  = 0x35,
	UITEM_STAFFOFSHAD  = 0x36,
	UITEM_IMMOLATOR    = 0x37,
	UITEM_STORMSPIRE   = 0x38,
	UITEM_GLEAMSONG    = 0x39,
	UITEM_THUNDERCALL  = 0x3A,
	UITEM_PROTECTOR    = 0x3B,
	UITEM_NAJPUZZLE    = 0x3C,
	UITEM_MINDCRY      = 0x3D,
	UITEM_RODOFONAN    = 0x3E,
	UITEM_SPIRITSHELM  = 0x3F,
	UITEM_THINKINGCAP  = 0x40,
	UITEM_OVERLORDHELM = 0x41,
	UITEM_FOOLSCREST   = 0x42,
	UITEM_GOTTERDAM    = 0x43,
	UITEM_ROYCIRCLET   = 0x44,
	UITEM_TORNFLESH    = 0x45,
	UITEM_GLADBANE     = 0x46,
	UITEM_RAINCLOAK    = 0x47,
	UITEM_LEATHAUT     = 0x48,
	UITEM_WISDWRAP     = 0x49,
	UITEM_SPARKMAIL    = 0x4A,
	UITEM_SCAVCARAP    = 0x4B,
	UITEM_NIGHTSCAPE   = 0x4C,
	UITEM_NAJPLATE     = 0x4D,
	UITEM_DEMONSPIKE   = 0x4E,
	UITEM_DEFLECTOR    = 0x4F,
	UITEM_SKULLSHLD    = 0x50,
	UITEM_DRAGONBRCH   = 0x51,
	UITEM_BLKOAKSHLD   = 0x52,
	UITEM_HOLYDEF      = 0x53,
	UITEM_STORMSHLD    = 0x54,
	UITEM_BRAMBLE      = 0x55,
	UITEM_REGHA        = 0x56,
	UITEM_BLEEDER      = 0x57,
	UITEM_CONSTRICT    = 0x58,
	UITEM_ENGAGE       = 0x59,
	UITEM_INVALID      = 0x5A,
} _unique_items;

typedef enum plr_class {
	PC_WARRIOR  = 0x0,
	PC_ROGUE    = 0x1,
	PC_SORCERER = 0x2,
#ifdef HELLFIRE
	PC_MONK      = 0x3,
	PC_BARD      = 0x4,
	PC_BARBARIAN = 0x5,
#endif
	NUM_CLASSES
} plr_class;

typedef enum _ui_classes {
	UI_WARRIOR     = 0x0,
	UI_ROGUE       = 0x1,
	UI_SORCERER    = 0x2,
#ifdef HELLFIRE
	UI_MONK        = 0x3,
	UI_BARD        = 0x4,
	UI_BARBARIAN   = 0x5,
#endif
	UI_NUM_CLASSES,
} _ui_classes;

typedef enum _walk_path {
	WALK_NE   = 0x1,
	WALK_NW   = 0x2,
	WALK_SE   = 0x3,
	WALK_SW   = 0x4,
	WALK_N    = 0x5,
	WALK_E    = 0x6,
	WALK_S    = 0x7,
	WALK_W    = 0x8,
	WALK_NONE = -1,
} _walk_path;

typedef enum player_weapon_type {
	WT_MELEE  = 0,
	WT_RANGED = 1,
} player_weapon_type;

typedef enum item_class {
	ICLASS_NONE   = 0,
	ICLASS_WEAPON = 1,
	ICLASS_ARMOR  = 2,
	ICLASS_MISC   = 3,
	ICLASS_GOLD   = 4,
	ICLASS_QUEST  = 5,
} item_class;

typedef enum item_drop_rate {
	IDROP_NEVER   = 0,
	IDROP_REGULAR = 1,
	IDROP_DOUBLE  = 2,
} item_drop_rate;

typedef enum item_special_effect {
	ISPL_NONE           = 0x00000000,
	ISPL_INFRAVISION    = 0x00000001,
	ISPL_RNDSTEALLIFE   = 0x00000002,
	ISPL_RNDARROWVEL    = 0x00000004,
	ISPL_FIRE_ARROWS    = 0x00000008,
	ISPL_FIREDAM        = 0x00000010,
	ISPL_LIGHTDAM       = 0x00000020,
	ISPL_DRAINLIFE      = 0x00000040,
	ISPL_UNKNOWN_1      = 0x00000080,
	ISPL_NOHEALPLR      = 0x00000100,
	ISPL_MULT_ARROWS    = 0x00000200,
	ISPL_UNKNOWN_3      = 0x00000400,
	ISPL_KNOCKBACK      = 0x00000800,
	ISPL_NOHEALMON      = 0x00001000,
	ISPL_STEALMANA_3    = 0x00002000,
	ISPL_STEALMANA_5    = 0x00004000,
	ISPL_STEALLIFE_3    = 0x00008000,
	ISPL_STEALLIFE_5    = 0x00010000,
	ISPL_QUICKATTACK    = 0x00020000,
	ISPL_FASTATTACK     = 0x00040000,
	ISPL_FASTERATTACK   = 0x00080000,
	ISPL_FASTESTATTACK  = 0x00100000,
	ISPL_FASTRECOVER    = 0x00200000,
	ISPL_FASTERRECOVER  = 0x00400000,
	ISPL_FASTESTRECOVER = 0x00800000,
	ISPL_FASTBLOCK      = 0x01000000,
	ISPL_LIGHT_ARROWS   = 0x02000000,
	ISPL_THORNS         = 0x04000000,
	ISPL_NOMANA         = 0x08000000,
	ISPL_ABSHALFTRAP    = 0x10000000,
	ISPL_UNKNOWN_4      = 0x20000000,
	ISPL_3XDAMVDEM      = 0x40000000,
	ISPL_ALLRESZERO     = 0x80000000,
} item_special_effect;

typedef enum item_special_effect_hf {
    ISPLHF_DEVASTATION  = 0x01,
    ISPLHF_DECAY        = 0x02,
    ISPLHF_PERIL        = 0x04,
    ISPLHF_JESTERS      = 0x08,
    ISPLHF_DOPPELGANGER = 0x10,
    ISPLHF_ACDEMON      = 0x20,
    ISPLHF_ACUNDEAD     = 0x40,
} item_special_effect_hf;

// Logical equipment locations
typedef enum inv_body_loc {
	INVLOC_HEAD       = 0,
	INVLOC_RING_LEFT  = 1,
	INVLOC_RING_RIGHT = 2,
	INVLOC_AMULET     = 3,
	INVLOC_HAND_LEFT  = 4,
	INVLOC_HAND_RIGHT = 5,
	INVLOC_CHEST      = 6,
	NUM_INVLOC,
} inv_body_loc;

typedef enum inv_item {
	INVITEM_HEAD       = 0,
	INVITEM_RING_LEFT  = 1,
	INVITEM_RING_RIGHT = 2,
	INVITEM_AMULET     = 3,
	INVITEM_HAND_LEFT  = 4,
	INVITEM_HAND_RIGHT = 5,
	INVITEM_CHEST      = 6,
	INVITEM_INV_FIRST  = 7,
	INVITEM_INV_LAST   = 46,
	INVITEM_BELT_FIRST = 47,
	INVITEM_BELT_LAST  = 54,
	NUM_INVELEM
} inv_item;

// identifiers for each of the inventory squares
// see https://github.com/sanctuary/graphics/blob/master/inventory.png
typedef enum inv_xy_slot {
	SLOTXY_HEAD_FIRST       = 0,
	SLOTXY_HEAD_LAST        = 3,
	SLOTXY_RING_LEFT        = 4,
	SLOTXY_RING_RIGHT       = 5,
	SLOTXY_AMULET           = 6,
	SLOTXY_HAND_LEFT_FIRST  = 7,
	SLOTXY_HAND_LEFT_LAST   = 12,
	SLOTXY_HAND_RIGHT_FIRST = 13,
	SLOTXY_HAND_RIGHT_LAST  = 18,
	SLOTXY_CHEST_FIRST      = 19,
	SLOTXY_CHEST_LAST       = 24,

	// regular inventory
	SLOTXY_INV_FIRST = 25,
	SLOTXY_INV_LAST  = 64,

	// belt items
	SLOTXY_BELT_FIRST = 65,
	SLOTXY_BELT_LAST  = 72,
	NUM_XY_SLOTS      = 73
} inv_xy_slot;

typedef enum player_graphic {
	PFILE_STAND     = 1 << 0,
	PFILE_WALK      = 1 << 1,
	PFILE_ATTACK    = 1 << 2,
	PFILE_HIT       = 1 << 3,
	PFILE_LIGHTNING = 1 << 4,
	PFILE_FIRE      = 1 << 5,
	PFILE_MAGIC     = 1 << 6,
	PFILE_DEATH     = 1 << 7,
	PFILE_BLOCK     = 1 << 8,
	// everything except PFILE_DEATH
	// 0b1_0111_1111
	PFILE_NONDEATH = 0x17F
} player_graphic;

typedef enum anim_weapon_id {
	ANIM_ID_UNARMED        = 0x00,
	ANIM_ID_UNARMED_SHIELD = 0x01,
	ANIM_ID_SWORD          = 0x02,
	ANIM_ID_SWORD_SHIELD   = 0x03,
	ANIM_ID_BOW            = 0x04,
	ANIM_ID_AXE            = 0x05,
	ANIM_ID_MACE           = 0x06,
	ANIM_ID_MACE_SHIELD    = 0x07,
	ANIM_ID_STAFF          = 0x08
} anim_weapon_id;

typedef enum anim_armor_id {
	ANIM_ID_LIGHT_ARMOR = 0x00,
#ifndef SPAWN
	ANIM_ID_MEDIUM_ARMOR = 0x10,
	ANIM_ID_HEAVY_ARMOR  = 0x20
#endif
} anim_armor_id;

typedef enum shrine_gametype {
	SHRINETYPE_ANY    = 0,
	SHRINETYPE_SINGLE = 1,
	SHRINETYPE_MULTI  = 2,
} shrine_gametype;

typedef enum shrine_type {
	SHRINE_MYSTERIOUS   = 0,
	SHRINE_HIDDEN       = 1,
	SHRINE_GLOOMY       = 2,
	SHRINE_WEIRD        = 3,
	SHRINE_MAGICAL      = 4,
	SHRINE_STONE        = 5,
	SHRINE_RELIGIOUS    = 6,
	SHRINE_ENCHANTED    = 7,
	SHRINE_THAUMATURGIC = 8,
	SHRINE_FASCINATING  = 9,
	SHRINE_CRYPTIC      = 10,
	SHRINE_MAGICAL2     = 11,
	SHRINE_ELDRITCH     = 12,
	SHRINE_EERIE        = 13,
	SHRINE_DIVINE       = 14,
	SHRINE_HOLY         = 15,
	SHRINE_SACRED       = 16,
	SHRINE_SPIRITUAL    = 17,
	SHRINE_SPOOKY       = 18,
	SHRINE_ABANDONED    = 19,
	SHRINE_CREEPY       = 20,
	SHRINE_QUIET        = 21,
	SHRINE_SECLUDED     = 22,
	SHRINE_ORNATE       = 23,
	SHRINE_GLIMMERING   = 24,
	SHRINE_TAINTED      = 25,
#ifdef HELLFIRE
	SHRINE_OILY         = 26,
	SHRINE_GLOWING      = 27,
	SHRINE_MENDICANT    = 28,
	SHRINE_SPARKLING    = 29,
	SHRINE_TOWN         = 30,
	SHRINE_SHIMMERING   = 31,
	SHRINE_SOLAR        = 32,
	SHRINE_MURPHYS      = 33,
#endif
	NUM_SHRINETYPE
} shrine_type;

typedef enum action_id {
	ACTION_NONE        = -1,
	ACTION_ATTACK      = 9,
	ACTION_RATTACK     = 10,
	ACTION_SPELL       = 12,
	ACTION_OPERATE     = 13,
	ACTION_DISARM      = 14,
	ACTION_PICKUPITEM  = 15, // put item in hand (inventory screen open)
	ACTION_PICKUPAITEM = 16, // put item in inventory
	ACTION_TALK        = 17,
	ACTION_OPERATETK   = 18, // operate via telekinesis
	ACTION_ATTACKMON   = 20,
	ACTION_ATTACKPLR   = 21,
	ACTION_RATTACKMON  = 22,
	ACTION_RATTACKPLR  = 23,
	ACTION_SPELLMON    = 24,
	ACTION_SPELLPLR    = 25,
	ACTION_SPELLWALL   = 26,
} action_id;

typedef enum dlrg_flag {
	DLRG_HDOOR     = 0x01,
	DLRG_VDOOR     = 0x02,
	DLRG_CHAMBER   = 0x40,
	DLRG_PROTECTED = 0x80,
} dlrg_flag;

// === Type definitions ===

#ifndef _TYPES_H
#define _TYPES_H

#define WIN32_LEAN_AND_MEAN

#include "resource.h"

#include <windows.h>
#include <mmsystem.h>
#include <stdio.h>
#include <stdlib.h>
#include <ddraw.h>
#include <dsound.h>
#include <io.h>
#include <limits.h>
#include <math.h>
#include <time.h>
#include <process.h>
#include <shlobj.h>
#include <shellapi.h>

#ifdef __GNUC__
#include <ctype.h>
#endif

// tell Visual C++ to shut the hell up
#ifdef _MSC_VER
#pragma warning(disable : 4305) // truncation of int
#pragma warning(disable : 4018) // signed/unsigned mismatch
#pragma warning(disable : 4700) // used without having been initialized
#pragma warning(disable : 4244) // conversion loss
#pragma warning(disable : 4146) // negative unsigned
#pragma warning(disable : 4996) // deprecation warning
#pragma warning(disable : 4309) // VC2017: truncation of constant value
#pragma warning(disable : 4267) // VC2017: conversion from 'size_t' to 'char'
#pragma warning(disable : 4302) // VC2017: type cast truncation
#pragma warning(disable : 4334) // VC2017: result of 32-bit shift implicitly converted to 64 bits
#endif

#include "defs.h"
#include "enums.h"
#include "structs.h"

#if (_MSC_VER >= 800) && (_MSC_VER <= 1200)
#define USE_ASM
#endif

// If defined, use copy protection [Default -> Defined]
#if !defined(_DEBUG) && !defined(SPAWN)
#define COPYPROT
#endif

// If defined, don't reload for debuggers [Default -> Undefined]
// Note that with patch 1.03 the command line was hosed, this is required to pass arguments to the game
#ifdef _DEBUG
#define DEBUGGER
#endif

// If defined, don't fry the CPU [Default -> Undefined]
#ifdef _DEBUG
#define SLEEPFIX
#endif

// If defined, fix palette glitch in Windows Vista+ [Default -> Undefined]
//#define COLORFIX

#endif