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
|
--[[
A collection of detailed packet field information.
]]
require('pack')
require('functions')
require('strings')
require('maths')
require('lists')
require('sets')
local bit = require('bit')
local fields = {}
fields.outgoing = {}
fields.incoming = {}
local func = {
incoming = {},
outgoing = {},
}
-- String decoding definitions
local ls_enc = {
charset = T('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ':split()):update({
[0] = '`',
[60] = 0:char(),
[63] = 0:char(),
}),
bits = 6,
terminator = function(str)
return (#str % 4 == 2 and 60 or 63):binary()
end
}
local sign_enc = {
charset = T('0123456798ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz{':split()):update({
[0] = 0:char(),
}),
bits = 6,
}
-- Function definitions. Used to display packet field information.
local res = require('resources')
local function s(val, from, to)
from = from - 1
to = to
return bit.band(bit.rshift(val, from), 2^(to - from) - 1)
end
local function id(val)
local mob = windower.ffxi.get_mob_by_id(val)
return mob and mob.name or '-'
end
local function index(val)
local mob = windower.ffxi.get_mob_by_index(val)
return mob and mob.name or '-'
end
local function ip(val)
return '%d.%d.%d.%d':format('I':pack(val):unpack('CCCC'))
end
local function gil(val)
return tostring(val):reverse():chunks(3):concat(','):reverse() .. ' G'
end
local function bool(val)
return val ~= 0
end
local function invbool(val)
return val == 0
end
local function div(denom, val)
return val/denom
end
local function add(amount, val)
return val + amount
end
local function sub(amount, val)
return val - amount
end
local time
local utime
do
local now = os.time()
local h, m = (os.difftime(now, os.time(os.date('!*t', now))) / 3600):modf()
local timezone = '%+.2d:%.2d':format(h, 60 * m)
local fn = function(ts)
return os.date('%Y-%m-%dT%H:%M:%S' .. timezone, ts)
end
time = function(ts)
return fn(os.time() - ts)
end
utime = function(ts)
return fn(ts)
end
bufftime = function(ts)
return fn((ts / 60) + 572662306 + 1009810800)
end
end
local time_ms = time .. function(val) return val/1000 end
local dir = function()
local dir_sets = L{'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW', 'N', 'NNE', 'NE', 'ENE', 'E'}
return function(val)
return dir_sets[((val + 8)/16):floor() + 1]
end
end()
local function cap(max, val)
return '%.1f':format(100*val/max)..'%'
end
local function zone(val)
return res.zones[val] and res.zones[val].name or '- (Unknown zone ID: %d)':format(val)
end
local function item(val)
return val ~= 0 and res.items[val] and res.items[val].name or '-'
end
local function server(val)
return res.servers[val].name
end
local function weather(val)
return res.weather[val].name
end
local function buff(val)
return val ~= 0xFF and res.buffs[val].name or '-'
end
local function chat(val)
return res.chat[val].name
end
local function skill(val)
return res.skills[val].name
end
local function title(val)
return res.titles[val].name
end
local function job(val)
return res.jobs[val].name
end
local function emote(val)
return '/' .. res.emotes[val].command
end
local function bag(val)
return res.bags[val].name
end
local function race(val)
return res.races[val].name
end
local function slot(val)
return res.slots[val].name
end
local function statuses(val)
return res.statuses[val] and res.statuses[val].name or 'Unknown'
end
local function srank(val)
return res.synth_ranks[val].name
end
local function arecast(val)
return res.ability_recasts[val].name
end
local function inv(bag, val)
if val == 0 or not res.bags[bag] then
return '-'
end
return item(windower.ffxi.get_items(bag, val).id)
end
local function invp(index, val, data)
return inv(data[index + 1]:byte(), val)
end
local function hex(fill, val)
return val:hex():zfill(2*fill):chunks(2):reverse():concat(' ')
end
local function bin(fill, val)
return type(val) == 'string' and val:binary(' ') or val:binary():zfill(8*fill):chunks(8):reverse():concat(' ')
end
--[[
Custom types
]]
local types = {}
local enums = {
['synth'] = {
[0] = 'Success',
[1] = 'Fail',
[2] = 'Fail, interrupted',
[3] = 'Cancel, invalid recipe',
[4] = 'Cancel',
[5] = 'Fail, crystal lost',
[6] = 'Cancel, skill too low',
[7] = 'Cancel, rare',
},
['logout'] = {
[1] = '/loguot',
[2] = '/pol',
[3] = '/shutdown',
},
['zone'] = {
[1] = 'Logout',
[2] = 'Teleport',
[3] = 'Zone line',
},
[0x038] = {
deru = 'Appear',
kesu = 'Disappear',
},
['itemstat'] = {
[0x00] = 'None',
[0x05] = 'Equipped',
[0x0F] = 'Synthing',
[0x13] = 'Active linkshell',
[0x19] = 'Bazaaring',
},
['ws track'] = {
[1] = 'Update',
[2] = 'Reset (zone)',
[3] = 'Reset (new scan)',
},
['ws mob'] = {
[0] = 'Other',
[1] = 'Friendly',
[2] = 'Enemy',
},
['ws mark'] = {
[1] = 'Start',
[2] = 'End',
},
['bazaar'] = {
[0] = 'Open',
[1] = 'Close',
},
['try'] = {
[0] = 'Succeeded',
[1] = 'Failed',
},
}
local e = function(t, val)
return enums[t][val] or 'Unknown value for \'%s\': %s':format(t, tostring(val))
end
--[[
Outgoing packets
]]
-- Zone In 1
-- Likely triggers specific incoming packets.
-- Does not trigger any packets when randomly injected.
fields.outgoing[0x00C] = L{
{ctype='int', label='_unknown1'}, -- 04 Always 00s?
{ctype='int', label='_unknown2'}, -- 04 Always 00s?
}
-- Client Leave
-- Last packet sent when zoning. Disconnects from the zone server.
fields.outgoing[0x00D] = L{
{ctype='unsigned char', label='_unknown1'}, -- 04 Always 00?
{ctype='unsigned char', label='_unknown2'}, -- 05 Always 00?
{ctype='unsigned char', label='_unknown3'}, -- 06 Always 00?
{ctype='unsigned char', label='_unknown4'}, -- 07 Always 00?
}
-- Zone In 2
-- Likely triggers specific incoming packets.
-- Does not trigger any packets when randomly injected.
fields.outgoing[0x00F] = L{
{ctype='data[32]', label='_unknown1'}, -- 04 Always 00s?
}
-- Zone In 3
-- Likely triggers specific incoming packets.
-- Does not trigger any packets when randomly injected.
fields.outgoing[0x011] = L{
{ctype='int', label='_unknown1'}, -- 04 Always 02 00 00 00?
}
-- Standard Client
fields.outgoing[0x015] = L{
{ctype='float', label='X'}, -- 04
{ctype='float', label='Z'}, -- 08
{ctype='float', label='Y'}, -- 0C
{ctype='unsigned short', label='_junk1'}, -- 10
{ctype='unsigned short', label='Run Count'}, -- 12 Counter that indicates how long you've been running?
{ctype='unsigned char', label='Rotation', fn=dir}, -- 14
{ctype='unsigned char', label='_flags1'}, -- 15 Bit 0x04 indicates that maintenance mode is activated
{ctype='unsigned short', label='Target Index', fn=index}, -- 16
{ctype='unsigned int', label='Timestamp', fn=time_ms}, -- 18 Milliseconds
{ctype='unsigned int', label='_unknown3'}, -- 1C
}
-- Update Request
fields.outgoing[0x016] = L{
{ctype='unsigned short', label='Target Index', fn=index}, -- 04
{ctype='unsigned short', label='_junk1'}, -- 06
}
-- NPC Race Error
fields.outgoing[0x017] = L{
{ctype='unsigned short', label='NPC Index', fn=index}, -- 04
{ctype='unsigned short', label='_unknown1'}, -- 06
{ctype='unsigned int', label='NPC ID', fn=id}, -- 08
{ctype='data[6]', label='_unknown2'}, -- 0C
{ctype='unsigned char', label='Reported NPC type'}, -- 12
{ctype='unsigned char', label='_unknown3'}, -- 13
}
enums['action'] = {
[0x00] = 'NPC Interaction',
[0x02] = 'Engage monster',
[0x03] = 'Magic cast',
[0x04] = 'Disengage',
[0x05] = 'Call for Help',
[0x07] = 'Weaponskill usage',
[0x09] = 'Job ability usage',
[0x0C] = 'Assist',
[0x0D] = 'Reraise dialogue',
[0x0E] = 'Cast Fishing Rod',
[0x0F] = 'Switch target',
[0x10] = 'Ranged attack',
[0x12] = 'Dismount Chocobo',
[0x13] = 'Tractor Dialogue',
[0x14] = 'Zoning/Appear', -- I think, the resource for this is ambiguous.
[0x19] = 'Monsterskill',
[0x1A] = 'Mount',
}
-- Action
fields.outgoing[0x01A] = L{
{ctype='unsigned int', label='Target', fn=id}, -- 04
{ctype='unsigned short', label='Target Index', fn=index}, -- 08
{ctype='unsigned short', label='Category', fn=e+{'action'}}, -- 0A
{ctype='unsigned short', label='Param'}, -- 0C
{ctype='unsigned short', label='_unknown1', const=0}, -- 0E
{ctype='float', label='X Offset'}, -- 10 -- non-zero values only observed for geo spells cast using a repositioned subtarget
{ctype='float', label='Z Offset'}, -- 14
{ctype='float', label='Y Offset'}, -- 18
}
-- /volunteer
fields.outgoing[0x01E] = L{
{ctype='char*', label='Target Name'}, -- 04 null terminated string. Length of name to the nearest 4 bytes.
}
-- Drop Item
fields.outgoing[0x028] = L{
{ctype='unsigned int', label='Count'}, -- 04
{ctype='unsigned char', label='Bag', fn=bag}, -- 08
{ctype='unsigned char', label='Inventory Index', fn=invp+{0x08}}, -- 09
{ctype='unsigned short', label='_junk1'}, -- 0A
}
-- Move Item
fields.outgoing[0x029] = L{
{ctype='unsigned int', label='Count'}, -- 04
{ctype='unsigned char', label='Bag', fn=bag}, -- 08
{ctype='unsigned char', label='Target Bag', fn=bag}, -- 09
{ctype='unsigned char', label='Current Index', fn=invp+{0x08}}, -- 0A
{ctype='unsigned char', label='Target Index'}, -- 0B This byte is 0x52 when moving items between bags. It takes other values when manually sorting.
}
-- Translate
-- German and French translations appear to no longer be supported.
fields.outgoing[0x02B] = L{
{ctype='unsigned char', label='Starting Language'}, -- 04 0 == JP, 1 == EN
{ctype='unsigned char', label='Ending Language'}, -- 05 0 == JP, 1 == EN
{ctype='unsigned short', label='_unknown1', const=0x0000}, -- 06
{ctype='char[64]', label='Phrase'}, -- 08 Quotation marks are removed. Phrase is truncated at 64 characters.
}
-- Trade request
fields.outgoing[0x032] = L{
{ctype='unsigned int', label='Target', fn=id}, -- 04
{ctype='unsigned short', label='Target Index', fn=index}, -- 08
{ctype='data[2]', label='_junk1'} -- 0A
}
enums[0x033] = {
[0] = 'Accept trade',
[1] = 'Cancel trade',
[2] = 'Confirm trade',
}
-- Trade confirm
-- Sent when accepting, confirming or canceling a trade
fields.outgoing[0x033] = L{
{ctype='unsigned int', label='Type', fn=e+{0x033}}, -- 04
{ctype='unsigned int', label='Trade Count'} -- 08 Necessary to set if you are receiving items, comes from incoming packet 0x023
}
-- Trade offer
fields.outgoing[0x034] = L{
{ctype='unsigned int', label='Count'}, -- 04
{ctype='unsigned short', label='Item', fn=item}, -- 08
{ctype='unsigned char', label='Inventory Index', fn=inv+{0}}, -- 0A
{ctype='unsigned char', label='Slot'}, -- 0F
}
-- Menu Item
fields.outgoing[0x036] = L{
-- Item order is Gil -> top row left-to-right -> bottom row left-to-right, but
-- they slide up and fill empty slots
{ctype='unsigned int', label='Target', fn=id}, -- 04
{ctype='unsigned int[9]', label='Item Count'}, -- 08
{ctype='unsigned int', label='_unknown1'}, -- 2C
{ctype='unsigned char[9]', label='Item Index', fn=inv+{0}}, -- 30 Gil has an Inventory Index of 0
{ctype='unsigned char', label='_unknown2'}, -- 39
{ctype='unsigned short', label='Target Index', fn=index}, -- 3A
{ctype='unsigned char', label='Number of Items'}, -- 3C
}
-- Use Item
fields.outgoing[0x037] = L{
{ctype='unsigned int', label='Player', fn=id}, -- 04
{ctype='unsigned int', label='_unknown1'}, -- 08 00 00 00 00 observed
{ctype='unsigned short', label='Player Index', fn=index}, -- 0C
{ctype='unsigned char', label='Slot', fn=inv+{0}}, -- 0E
{ctype='unsigned char', label='_unknown2'}, -- 0F Takes values
{ctype='unsigned char', label='Bag', fn=bag}, -- 10
{ctype='data[3]', label='_unknown3'} -- 11
}
-- Sort Item
fields.outgoing[0x03A] = L{
{ctype='unsigned char', label='Bag', fn=bag}, -- 04
{ctype='unsigned char', label='_unknown1'}, -- 05
{ctype='unsigned short', label='_unknown2'}, -- 06
}
-- Blacklist (add/delete)
fields.outgoing[0x03D] = L{
{ctype='int', label='_unknown1'}, -- 04 Looks like a player ID, but does not match the sender or the receiver.
{ctype='char[16]', label='Name'}, -- 08 Character name
{ctype='bool', label='Add/Remove'}, -- 18 0 = add, 1 = remove
{ctype='data[3]', label='_unknown2'}, -- 19 Values observed on adding but not deleting.
}
-- Lot item
fields.outgoing[0x041] = L{
{ctype='unsigned char', label='Slot'}, -- 04
}
-- Pass item
fields.outgoing[0x042] = L{
{ctype='unsigned char', label='Slot'}, -- 04
}
-- Servmes
-- First 4 bytes resemble the first 4 bytes of the incoming servmessage packet
fields.outgoing[0x04B] = L{
{ctype='unsigned char', label='_unknown1'}, -- 04 Always 1?
{ctype='unsigned char', label='_unknown2'}, -- 05 Can be 1 or 0
{ctype='unsigned char', label='_unknown3'}, -- 06 Always 1?
{ctype='unsigned char', label='_unknown4'}, -- 07 Always 2?
{ctype='data[12]', label='_unknown5'}, -- 08 All 00s
{ctype='unsigned int', label='_unknown5'}, -- 14 EC 00 00 00 observed. May be junk.
}
-- Delivery Box
fields.outgoing[0x04D] = L{
{ctype='unsigned char', label='Type'}, -- 04
--
-- Removing an item from the d-box sends type 0x08
-- It then responds to the server's 0x4B (id=0x08) with a 0x0A type packet.
-- Their assignment is the same, as far as I can see.
{ctype='unsigned char', label='_unknown1'}, -- 05 01 observed
{ctype='unsigned char', label='Slot'}, -- 06
{ctype='data[5]', label='_unknown2'}, -- 07 FF FF FF FF FF observed
{ctype='data[20]', label='_unknown3'}, -- 0C All 00 observed
}
enums['ah otype'] = {
[0x04] = 'Sell item request',
[0x05] = 'Check sales',
[0x0A] = 'Open AH menu',
[0x0B] = 'Sell item confirmation',
[0x0C] = 'Stop sale',
[0x0D] = 'Sale status confirmation',
[0x0E] = 'Place bid',
[0x10] = 'Item sold',
}
func.outgoing[0x04E] = {}
func.outgoing[0x04E].base = L{
{ctype='unsigned char', label='Type', fn=e+{'ah otype'}}, -- 04
}
-- Sent when putting an item up for auction (request)
func.outgoing[0x04E][0x04] = L{
{ctype='data[3]', label='_unknown1'}, -- 05
{ctype='unsigned int', label='Price', fn=gil}, -- 08
{ctype='unsigned short', label='Inventory Index', fn=inv+{0}}, -- 0C
{ctype='unsigned short', label='Item', fn=item}, -- 0E
{ctype='unsigned char', label='Stack', fn=invbool}, -- 10
{ctype='char*', label='_junk'}, -- 11
}
-- Sent when checking your sale status
func.outgoing[0x04E][0x05] = L{
{ctype='char*', label='_junk'}, -- 05
}
-- Sent when initially opening the AH menu
func.outgoing[0x04E][0x0A] = L{
{ctype='unsigned char', label='_unknown1', const=0xFF}, -- 05
{ctype='char*', label='_junk'}, -- 06
}
-- Sent when putting an item up for auction (confirmation)
func.outgoing[0x04E][0x0B] = L{
{ctype='unsigned char', label='Slot'}, -- 05
{ctype='data[2]', label='_unknown1'}, -- 06
{ctype='unsigned int', label='Price', fn=gil}, -- 08
{ctype='unsigned short', label='Inventory Index', fn=inv+{0}}, -- 0C
{ctype='unsigned short', label='_unknown2'}, -- 0E
{ctype='unsigned char', label='Stack', fn=invbool}, -- 10
{ctype='char*', label='_junk'}, -- 11
}
-- Sent when stopping an item from sale
func.outgoing[0x04E][0x0C] = L{
{ctype='unsigned char', label='Slot'}, -- 05
{ctype='char*', label='_junk'}, -- 06
}
-- Sent after receiving the sale status list for each item
func.outgoing[0x04E][0x0D] = L{
{ctype='unsigned char', label='Slot'}, -- 05
{ctype='char*', label='_junk'}, -- 06
}
-- Sent when bidding on an item
func.outgoing[0x04E][0x0E] = L{
{ctype='unsigned char', label='Slot'}, -- 05
{ctype='unsigned short', label='_unknown3'}, -- 06
{ctype='unsigned int', label='Price', fn=gil}, -- 08
{ctype='unsigned short', label='Item', fn=item}, -- 0C
{ctype='unsigned short', label='_unknown4'}, -- 0E
{ctype='bool', label='Stack', fn=invbool}, -- 10
{ctype='char*', label='_junk'}, -- 11
}
-- Sent when taking a sold item from the list
func.outgoing[0x04E][0x10] = L{
{ctype='unsigned char', label='Slot'}, -- 05
{ctype='char*', label='_junk'}, -- 06
}
-- Auction Interaction
fields.outgoing[0x04E] = function(data, type)
type = type or data and data:byte(5)
return func.outgoing[0x04E].base + (func.outgoing[0x04E][type] or L{})
end
-- Equip
fields.outgoing[0x050] = L{
{ctype='unsigned char', label='Item Index', fn=invp+{0x06}}, -- 04
{ctype='unsigned char', label='Equip Slot', fn=slot}, -- 05
{ctype='unsigned char', label='Bag', fn=bag}, -- 06
{ctype='data[1]', label='_junk1'} -- 07
}
types.equipset = L{
{ctype='unsigned char', label='Inventory Index', fn=invp+{0x0A}}, -- 00
{ctype='unsigned char', label='Equipment Slot', fn=slot}, -- 01
{ctype='unsigned char', label='Bag', fn=bag}, -- 02
{ctype='unsigned char', label='_padding1'}, -- 03
}
func.outgoing[0x051] = {}
func.outgoing[0x051].base = L{
{ctype='unsigned char', label='Count'}, -- 04
{ctype='unsigned char[3]', label='_unknown1'}, -- 05 Same as _unknown1 in outgoing 0x052
}
-- Equipset
fields.outgoing[0x051] = function(data, count)
count = count or data:byte(5)
return func.outgoing[0x051].base + L{
-- Only the number given in Count will be properly populated, the rest is junk
{ref=types.equipset, count=count}, -- 08
{ctype='data[%u]':format((16 - count) * 4), label='_junk1'}, -- 08 + 4 * count
}
end
types.equipset_build = L{
{ctype='boolbit', label='Active'}, -- 00
{ctype='bit', label='_unknown1'}, -- 00
{ctype='bit[6]', label='Bag', fn=bag}, -- 00
{ctype='unsigned char', label='Inventory Index'}, -- 01
{ctype='unsigned short', label='Item', fn=item}, -- 02
}
-- Equipset Build
fields.outgoing[0x052] = L{
-- First 8 bytes are for the newly changed item
{ctype='unsigned char', label='New Equipment Slot', fn=slot}, -- 04
{ctype='unsigned char[3]', label='_unknown1'}, -- 05
{ref=types.equipset_build, count=1}, -- 08
-- The next 16 are the entire current equipset, excluding the newly changed item
{ref=types.equipset_build, lookup={res.slots, 0x00}, count=0x10}, -- 0C
}
types.lockstyleset = L{
{ctype='unsigned char', label='Inventory Index'}, -- 00
{ctype='unsigned char', label='Equipment Slot', fn=slot}, -- 01
{ctype='unsigned char', label='Bag', fn=bag}, -- 02
{ctype='unsigned char', label='_unknown2', const=0x00}, -- 03
{ctype='unsigned short', label='Item', fn=item}, -- 04
{ctype='unsigned short', label='_unknown3', const=0x0000}, -- 06
}
-- lockstyleset
fields.outgoing[0x053] = L{
-- First 4 bytes are a header for the set
{ctype='unsigned char', label='Count'}, -- 04
{ctype='unsigned char', label='Type'}, -- 05 0 = "Stop locking style", 1 = "Continue locking style", 3 = "Lock style in this way". Might be flags?
{ctype='unsigned short', label='_unknown1', const=0x0000}, -- 06
{ref=types.lockstyleset, count=16}, -- 08
}
-- End Synth
-- This packet is sent after receiving a result when synthesizing.
fields.outgoing[0x059] = L{
{ctype='unsigned int', label='_unknown1'}, -- 04 Often 00 00 00 00, but 01 00 00 00 observed.
{ctype='data[8]', label='_junk1'} -- 08 Often 00 00 00 00, likely junk from a non-zero'd buffer.
}
-- Conquest
fields.outgoing[0x05A] = L{
}
-- Dialogue options
fields.outgoing[0x05B] = L{
{ctype='unsigned int', label='Target', fn=id}, -- 04
{ctype='unsigned short', label='Option Index'}, -- 08
{ctype='unsigned short', label='_unknown1'}, -- 0A
{ctype='unsigned short', label='Target Index', fn=index}, -- 0C
{ctype='bool', label='Automated Message'}, -- 0E 1 if the response packet is automatically generated, 0 if it was selected by you
{ctype='unsigned char', label='_unknown2'}, -- 0F
{ctype='unsigned short', label='Zone', fn=zone}, -- 10
{ctype='unsigned short', label='Menu ID'}, -- 12
}
-- Warp Request
fields.outgoing[0x05C] = L{
{ctype='float', label='X'}, -- 04
{ctype='float', label='Z'}, -- 08
{ctype='float', label='Y'}, -- 0C
{ctype='unsigned int', label='Target ID', fn=id}, -- 10 NPC that you are requesting a warp from
{ctype='unsigned int', label='_unknown1'}, -- 14 01 00 00 00 observed
{ctype='unsigned short', label='Zone'}, -- 18
{ctype='unsigned short', label='Menu ID'}, -- 1A
{ctype='unsigned short', label='Target Index', fn=index}, -- 1C
{ctype='unsigned char', label='_unknown2', const=1}, -- 1E
{ctype='unsigned char', label='Rotation'}, -- 1F
}
-- Outgoing emote
fields.outgoing[0x05D] = L{
{ctype='unsigned int', label='Target ID', fn=id}, -- 04
{ctype='unsigned short', label='Target Index', fn=index}, -- 08
{ctype='unsigned char', label='Emote', fn=emote}, -- 0A
{ctype='unsigned char', label='Type'}, -- 0B 2 for motion, 0 otherwise
{ctype='unsigned int', label='_unknown1', const=0}, -- 0C
}
-- Zone request
-- Sent when crossing a zone line.
fields.outgoing[0x05E] = L{
{ctype='unsigned int', label='Zone Line'}, -- 04 This seems to be a fourCC consisting of the following chars:
-- 'z' (apparently constant)
-- Region-specific char ('6' for Jeuno, '3' for Qufim, etc.)
-- Zone-specific char ('u' for Port Jeuno, 't' for Lower Jeuno, 's' for Upper Jeuno, etc.)
-- Zone line identifier ('4' for Port Jeuno > Qufim Island, '2' for Port Jeuno > Lower Jeuno, etc.)
{ctype='data[12]', label='_unknown1', const=''}, -- 08
{ctype='unsigned short', label='_unknown2', const=0}, -- 14
{ctype='unsigned char', label='_unknown3', const=0x04}, -- 16 Seemed to never vary for me
{ctype='unsigned char', label='Type'}, -- 17 03 for leaving the MH, 00 otherwise
}
-- Equipment Screen (0x02 length) -- Also observed when zoning
fields.outgoing[0x061] = L{
}
-- Digging Finished
-- This packet alone is responsible for generating the digging result, meaning that anyone that can inject
-- this packet is capable of digging with 0 delay.
fields.outgoing[0x063] = L{
{ctype='unsigned int', label='Player', fn=id}, -- 04
{ctype='unsigned int', label='_unknown1'}, -- 08
{ctype='unsigned short', label='Player Index', fn=index}, -- 0C
{ctype='unsigned char', label='Action?'}, -- 0E Changing it to anything other than 0x11 causes the packet to fail
{ctype='unsigned char', label='_junk1'}, -- 0F Likely junk. Has no effect on anything notable.
}
--"New" Key Item examination packet
fields.outgoing[0x064] = L{
{ctype='unsigned int', label='Player', fn=id}, -- 04
{ctype='data[0x40]', label='flags'}, -- 08 These correspond to a particular section of the 0x55 incoming packet
{ctype='unsigned int', label='_unknown1'}, -- 48 This field somehow denotes which half-0x55-packet the flags corresponds to
}
-- Party invite
fields.outgoing[0x06E] = L{
{ctype='unsigned int', label='Target', fn=id}, -- 04 This is so weird. The client only knows IDs from searching for people or running into them. So if neither has happened, the manual invite will fail, as the ID cannot be retrieved.
{ctype='unsigned short', label='Target Index', fn=index}, -- 08 00 if target not in zone
{ctype='unsigned char', label='Alliance'}, -- 0A 05 for alliance, 00 for party or if invalid alliance target (the client somehow knows..)
{ctype='unsigned char', label='_const1', const=0x041}, -- 0B
}
-- Party leaving
fields.outgoing[0x06F] = L{
{ctype='unsigned char', label='Alliance'}, -- 04 05 for alliance, 00 for party
{ctype='data[3]', label='_junk1'} -- 05
}
-- Party breakup
fields.outgoing[0x070] = L{
{ctype='unsigned char', label='Alliance'}, -- 04 02 for alliance, 00 for party
{ctype='data[3]', label='_junk1'} -- 05
}
-- Kick
fields.outgoing[0x071] = L{
{ctype='data[6]', label='_unknown1'}, -- 04
{ctype='unsigned char', label='Kick Type'}, -- 0A 0 for party, 1 for linkshell, 2 for alliance (maybe)
{ctype='unsigned char', label='_unknown2'}, -- 0B
{ctype='data[16]', label='Member Name'} -- 0C Null terminated string
}
-- Party invite response
fields.outgoing[0x074] = L{
{ctype='bool', label='Join', fn=bool}, -- 04
{ctype='data[3]', label='_junk1'} -- 05
}
--[[ -- Unnamed 0x76
-- Observed when zoning (sometimes). Probably triggers some information to be sent (perhaps about linkshells?)
fields.outgoing[0x076] = L{
{ctype='unsigned char', label='flag'}, -- 04 Only 01 observed
{ctype='data[3]', label='_junk1'}, -- 05 Only 00 00 00 observed.
}]]
-- Change Permissions
fields.outgoing[0x077] = L{
{ctype='char[16]', label='Target Name'}, -- 04 Name of the person to give leader to
{ctype='unsigned char', label='Party Type'}, -- 14 00 = party, 01 = linkshell, 02 = alliance
{ctype='unsigned short', label='Permissions'}, -- 15 01 for alliance leader, 00 for party leader, 03 for linkshell "to sack", 02 for linkshell "to pearl"
{ctype='unsigned short', label='_unknown1'}, -- 16
}
-- Party list request (4 byte packet)
fields.outgoing[0x078] = L{
}
-- Guild NPC Buy
-- Sent when buying an item from a guild NPC
fields.outgoing[0x082] = L{
{ctype='unsigned short', label='Item', fn=item}, -- 08
{ctype='unsigned char', label='_unknown1', const=0x00}, -- 0A
{ctype='unsigned char', label='Count'}, -- 0B Number you are buying
}
-- NPC Buy Item
-- Sent when buying an item from a generic NPC vendor
fields.outgoing[0x083] = L{
{ctype='unsigned int', label='Count'}, -- 04
{ctype='unsigned short', label='_unknown2'}, -- 08 Redirection Index? When buying from a guild helper, this was the index of the real guild NPC.
{ctype='unsigned char', label='Shop Slot'}, -- 0A The same index sent in incoming packet 0x03C
{ctype='unsigned char', label='_unknown3'}, -- 0B Always 0? Possibly padding
{ctype='unsigned int', label='_unknown4'}, -- 0C Always 0?
}
-- NPC Sell price query
-- Sent when trying to sell an item to an NPC
-- Clicking on the item the first time will determine the price
-- Also sent automatically when finalizing a sale, immediately preceeding packet 0x085
fields.outgoing[0x084] = L{
{ctype='unsigned int', label='Count'}, -- 04
{ctype='unsigned short', label='Item', fn=item}, -- 08
{ctype='unsigned char', label='Inventory Index', fn=inv+{0}}, -- 09 Inventory index of the same item
{ctype='unsigned char', label='_unknown3'}, -- 0A Always 0? Likely padding
}
-- NPC Sell confirm
-- Sent when confirming a sell of an item to an NPC
fields.outgoing[0x085] = L{
{ctype='unsigned int', label='_unknown1', const=1}, -- 04 Always 1? Possibly a type
}
-- Synth
fields.outgoing[0x096] = L{
{ctype='unsigned char', label='_unknown1'}, -- 04 Crystal ID? Earth = 0x02, Wind-break = 0x19?, Wind no-break = 0x2D?
{ctype='unsigned char', label='_unknown2'}, -- 05
{ctype='unsigned short', label='Crystal', fn=item}, -- 06
{ctype='unsigned char', label='Crystal Index', fn=inv+{0}}, -- 08
{ctype='unsigned char', label='Ingredient count'}, -- 09
{ctype='unsigned short[8]', label='Ingredient', fn=item}, -- 0A
{ctype='unsigned char[8]', label='Ingredient Index', fn=inv+{0}}, -- 1A
{ctype='unsigned short', label='_junk1'}, -- 22
}
-- /nominate or /proposal
fields.outgoing[0x0A0] = L{
{ctype='unsigned char', label='Packet Type'}, -- 04 Not typical mapping. 0=Open poll (say), 1 = Open poll (party), 3 = conclude poll
-- Just padding if the poll is being concluded.
{ctype='char*', label='Proposal'}, -- 05 Proposal exactly as written. Space delimited with quotes and all. Null terminated.
}
-- /vote
fields.outgoing[0x0A1] = L{
{ctype='unsigned char', label='Option'}, -- 04 Voting option
{ctype='char*', label='Character Name'}, -- 05 Character name. Null terminated.
}
-- /random
fields.outgoing[0x0A2] = L{
{ctype='int', label='_unknown1'}, -- 04 No clear purpose
}
-- Guild Buy Item
-- Sent when buying an item from a guild NPC
fields.outgoing[0x0AA] = L{
{ctype='unsigned short', label='Item', fn=item}, -- 04
{ctype='unsigned char', label='_unknown1', const=0x00}, -- 06
{ctype='unsigned char', label='Count'}, -- 07 Number you are buying
}
-- Get Guild Inv List
-- It's unclear how the server figures out which guild you're asking about, but this triggers 0x83 Incoming.
fields.outgoing[0x0AB] = L{
}
-- Guild Sell Item
-- Sent when selling an item to a guild NPC
fields.outgoing[0x0AC] = L{
{ctype='unsigned short', label='Item', fn=item}, -- 04
{ctype='unsigned char', label='_unknown1'}, -- 06
{ctype='unsigned char', label='Count'}, -- 07 Number you are selling
}
-- Get Guild Sale List
-- It's unclear how the server figures out which guild you're asking about, but this triggers 0x85 Incoming.
fields.outgoing[0x0AD] = L{
}
-- Speech
fields.outgoing[0x0B5] = L{
{ctype='unsigned char', label='Mode', fn=chat}, -- 04
{ctype='unsigned char', label='GM', fn=bool}, -- 05
{ctype='char*', label='Message'}, -- 06
}
-- Tell
fields.outgoing[0x0B6] = L{
{ctype='unsigned char', label='_unknown1', const=0x00}, -- 04 00 for a normal tell -- Varying this does nothing.
{ctype='char[15]', label='Target Name'}, -- 05
{ctype='char*', label='Message'}, -- 14
}
-- Merit Point Increase
fields.outgoing[0x0BE] = L{
{ctype='unsigned char', label='_unknown1', const=0x03}, -- 04 No idea what it is, but it's always 0x03 for me
{ctype='unsigned char', label='Flag'}, -- 05 1 when you're increasing a merit point. 0 when you're decreasing it.
{ctype='unsigned short', label='Merit Point'}, -- 06 No known mapping, but unique to each merit point. Could be an int.
{ctype='unsigned int', label='_unknown2', const=0x00000000}, -- 08
}
-- Job Point Increase
fields.outgoing[0x0BF] = L{
{ctype='bit[5]', label='Type'}, -- 04
{ctype='bit[11]', label='Job', fn=job}, -- 04
{ctype='unsigned short', label='_junk1', const=0x0000}, -- 06 No values seen so far
}
-- Job Point Menu
-- This packet has no content bytes
fields.outgoing[0x0C0] = L{
}
-- /makelinkshell
fields.outgoing[0x0C3] = L{
{ctype='unsigned char', label='_unknown1'}, -- 04
{ctype='unsigned char', label='Linkshell Number'}, -- 05
{ctype='data[2]', label='_junk1'} -- 05
}
-- Equip Linkshell
fields.outgoing[0x0C4] = L{
{ctype='unsigned short', label='_unknown1'}, -- 04 0x00 0x0F for me
{ctype='unsigned char', label='Inventory Slot ID'}, -- 06 Inventory Slot that holds the linkshell
{ctype='unsigned char', label='Linkshell Number'}, -- 07 Inventory Slot that holds the linkshell
{ctype='data[16]', label='String of unclear purpose'} -- 08 Probably going to be used in the future system somehow. Currently "dummy"..string.char(0,0,0).."%s %s "..string.char(0,1)
}
-- Open Mog
fields.outgoing[0x0CB] = L{
{ctype='unsigned char', label='type'}, -- 04 1 = open mog, 2 = close mog
{ctype='data[3]', label='_junk1'} -- 05
}
-- Party Marker Request
fields.outgoing[0x0D2] = L{
{ctype='unsigned short', label='Zone', fn=zone}, -- 04
{ctype='unsigned short', label='_junk1'} -- 06
}
-- Open Help Submenu
fields.outgoing[0x0D4] = L{
{ctype='unsigned int', label='Number of Opens'}, -- 04 Number of times you've opened the submenu.
}
-- Check
fields.outgoing[0x0DD] = L{
{ctype='unsigned int', label='Target', fn=id}, -- 04
{ctype='unsigned short', label='Target Index', fn=index}, -- 08
{ctype='unsigned short', label='_unknown1'}, -- 0A
{ctype='unsigned char', label='Check Type'}, -- 0C 00 = Normal /check, 01 = /checkname, 02 = /checkparam
{ctype='data[3]', label='_junk1'} -- 0D
}
-- Search Comment
fields.outgoing[0x0E0] = L{
{ctype='char[40]', label='Line 1'}, -- 04 Spaces (0x20) fill out any empty characters.
{ctype='char[40]', label='Line 2'}, -- 2C Spaces (0x20) fill out any empty characters.
{ctype='char[40]', label='Line 3'}, -- 54 Spaces (0x20) fill out any empty characters.
{ctype='data[4]', label='_unknown1'}, -- 7C 20 20 20 00 observed.
{ctype='data[24]', label='_unknown2'}, -- 80 Likely contains information about the flags.
}
-- Get LS Message
fields.outgoing[0x0E1] = L{
{ctype='data[136]', label='_unknown1', const=0x0}, -- 04
}
-- Set LS Message
fields.outgoing[0x0E2] = L{
{ctype='unsigned int', label='_unknown1', const=0x00000040}, -- 04
{ctype='unsigned int', label='_unknown2'}, -- 08 Usually 0, but sometimes contains some junk
{ctype='char[128]', label='Message'} -- 0C
}
-- Logout
fields.outgoing[0x0E7] = L{
{ctype='unsigned char', label='_unknown1'}, -- 04 Observed to be 00
{ctype='unsigned char', label='_unknown2'}, -- 05 Observed to be 00
{ctype='unsigned char', label='Logout Type', fn=e+{'logout'}}, -- 06 /logout = 01, /pol == 02 (removed), /shutdown = 03
{ctype='unsigned char', label='_unknown3'}, -- 07 Observed to be 00
}
-- Sit
fields.outgoing[0x0EA] = L{
{ctype='unsigned char', label='Movement'}, -- 04
{ctype='unsigned char', label='_unknown1'}, -- 05
{ctype='unsigned char', label='_unknown2'}, -- 06
{ctype='unsigned char', label='_unknown3'}, -- 07
}
-- Cancel
fields.outgoing[0x0F1] = L{
{ctype='unsigned char', label='Buff'}, -- 04
{ctype='unsigned char', label='_unknown1'}, -- 05
{ctype='unsigned char', label='_unknown2'}, -- 06
{ctype='unsigned char', label='_unknown3'}, -- 07
}
-- Declare Subregion
fields.outgoing[0x0F2] = L{
{ctype='unsigned char', label='_unknown1', const=0x01}, -- 04
{ctype='unsigned char', label='_unknown2', const=0x00}, -- 05
{ctype='unsigned short', label='Subregion Index'}, -- 06
}
-- Unknown packet 0xF2
--[[fields.outgoing[0x0F2] = L{
{ctype='unsigned char', label='type'}, -- 04 Was always 01 for me
{ctype='unsigned char', label='_unknown1'}, -- 05 Was always 00 for me
{ctype='unsigned short', label='Index', fn=index}, -- 07 Has always been the index of a synergy enthusiast or furnace for me
}]]
-- Widescan
fields.outgoing[0x0F4] = L{
{ctype='unsigned char', label='Flags'}, -- 04 1 when requesting widescan information. No other values observed.
{ctype='unsigned char', label='_unknown1'}, -- 05
{ctype='unsigned short', label='_unknown2'}, -- 06
}
-- Widescan Track
fields.outgoing[0x0F5] = L{
{ctype='unsigned short', label='Index', fn=index}, -- 04 Setting an index of 0 stops tracking
{ctype='unsigned short', label='_junk1'}, -- 06
}
-- Widescan Cancel
fields.outgoing[0x0F6] = L{
{ctype='unsigned int', label='_junk1'}, -- 04 Always observed as 00 00 00 00
}
-- Place/Move Furniture
fields.outgoing[0x0FA] = L{
{ctype='unsigned short', label='Item', fn=item}, -- 04 00 00 just gives the general update
{ctype='unsigned char', label='Safe Index', fn=inv+{1}}, -- 06
{ctype='unsigned char', label='X'}, -- 07 0 to 0x12
{ctype='unsigned char', label='Z'}, -- 08 0 to ?
{ctype='unsigned char', label='Y'}, -- 09 0 to 0x17
{ctype='unsigned short', label='_junk1'}, -- 0A 00 00 observed
}
-- Remove Furniture
fields.outgoing[0x0FB] = L{
{ctype='unsigned short', label='Item', fn=item}, -- 04
{ctype='unsigned char', label='Safe Index', fn=inv+{1}}, -- 06
{ctype='unsigned char', label='_junk1'}, -- 07
}
-- Plant Flowerpot
fields.outgoing[0x0FC] = L{
{ctype='unsigned short', label='Flowerpot Item', fn=item}, -- 04
{ctype='unsigned short', label='Seed Item', fn=item}, -- 06
{ctype='unsigned char', label='Flowerpot Safe Index', fn=inv+{1}}, -- 08
{ctype='unsigned char', label='Seed Safe Index', fn=inv+{1}}, -- 09
{ctype='unsigned short', label='_junk1'}, -- 0A 00 00 observed
}
-- Examine Flowerpot
fields.outgoing[0x0FD] = L{
{ctype='unsigned short', label='Flowerpot Item ID'}, -- 04
{ctype='unsigned char', label='Flowerpot Safe Slot'}, -- 06
{ctype='unsigned char', label='_junk1'}, -- 07
}
-- Uproot Flowerpot
fields.outgoing[0x0FE] = L{
{ctype='unsigned short', label='Flowerpot Item', fn=item}, -- 04
{ctype='unsigned char', label='Flowerpot Safe Index', fn=inv+{1}}, -- 06
{ctype='unsigned char', label='_unknown1'}, -- 07 Value of 1 observed.
}
-- Job Change
fields.outgoing[0x100] = L{
{ctype='unsigned char', label='Main Job'}, -- 04
{ctype='unsigned char', label='Sub Job'}, -- 05
{ctype='unsigned char', label='_unknown1'}, -- 06
{ctype='unsigned char', label='_unknown2'}, -- 07
}
-- Untraditional Equip
-- Currently only commented for changing instincts in Monstrosity. Refer to the doku wiki for information on Autos/BLUs.
-- https://gist.github.com/nitrous24/baf9980df69b3dc7d3cf
fields.outgoing[0x102] = L{
{ctype='unsigned short', label='_unknown1'}, -- 04 -- 00 00 for Monsters
{ctype='unsigned short', label='_unknown1'}, -- 06 -- Varies by Monster family for the species change packet. Monsters that share the same tnl seem to have the same value. 00 00 for instinct changing.
{ctype='unsigned char', label='Main Job', fn=job}, -- 08 -- 00x17 for Monsters
{ctype='unsigned char', label='Sub Job', fn=job}, -- 09 -- 00x00 for Monsters
{ctype='unsigned short', label='Flag'}, -- 0A -- 04 00 for Monsters changing instincts. 01 00 for changing Monsters
{ctype='unsigned short', label='Species'}, -- 0C -- True both for species change and instinct change packets
{ctype='unsigned short', label='_unknown2'}, -- 0E -- 00 00 for Monsters
{ctype='unsigned short[12]',label='Instinct'}, -- 10
{ctype='unsigned char', label='Name 1'}, -- 28
{ctype='unsigned char', label='Name 2'}, -- 29
{ctype='char*', label='_unknown'}, -- 2A -- All 00s for Monsters
}
-- Open Bazaar
-- Sent when you open someone's bazaar from the /check window
fields.outgoing[0x105] = L{
{ctype='unsigned int', label='Target', fn=id}, -- 04
{ctype='unsigned short', label='Target Index', fn=index}, -- 08
}
-- Bid Bazaar
-- Sent when you bid on an item in someone's bazaar
fields.outgoing[0x106] = L{
{ctype='unsigned char', label='Inventory Index'}, -- 04 The seller's inventory index of the wanted item
{ctype='data[3]', label='_junk1'}, -- 05
{ctype='unsigned int', label='Count'}, -- 08
}
-- Close own Bazaar
-- Sent when you close your bazaar window
fields.outgoing[0x109] = L{
}
-- Bazaar price set
-- Sent when you set the price of an item in your bazaar
fields.outgoing[0x10A] = L{
{ctype='unsigned char', label='Inventory Index', fn=inv+{0}}, -- 04
{ctype='data[3]', label='_junk1'}, -- 05
{ctype='unsigned int', label='Price', fn=gil}, -- 08
}
-- Open own Bazaar
-- Sent when you attempt to open your bazaar to set prices
fields.outgoing[0x10B] = L{
{ctype='unsigned int', label='_unknown1', const=0x00000000}, -- 04 00 00 00 00 for me
}
-- Start RoE Quest
fields.outgoing[0x10C] = L{
{ctype='unsigned short', label='RoE Quest'}, -- 04 This field is likely actually 12 bits
}
-- Cancel RoE Quest
fields.outgoing[0x10D] = L{
{ctype='unsigned short', label='RoE Quest'}, -- 04 This field is likely actually 12 bits
}
-- Accept RoE Quest reward that was denied due to a full inventory
fields.outgoing[0x10E] = L{
{ctype='unsigned short', label='RoE Quest'}, -- 04 This field is likely actually 12 bits
}
-- Currency Menu
fields.outgoing[0x10F] = L{
}
enums['fishing'] = {
[2] = 'Cast rod',
[3] = 'Release/catch',
[4] = 'Put away rod',
}
-- Fishing Action
fields.outgoing[0x110] = L{
{ctype='unsigned int', label='Player', fn=id}, -- 04
{ctype='unsigned int', label='Fish HP'}, -- 08 Always 200 when releasing, zero when casting and putting away rod
{ctype='unsigned short', label='Player Index', fn=index}, -- 0C
{ctype='unsigned char', label='Action', fn=e+{'fishing'}}, -- 0E
{ctype='unsigned char', label='_unknown1'}, -- 0F Always zero (pre-March fishing update this value would increase over time, probably zone fatigue)
{ctype='unsigned int', label='Catch Key'}, -- 10 When catching this matches the catch key from the 0x115 packet, otherwise zero
}
-- Lockstyle
fields.outgoing[0x111] = L{
{ctype='bool', label='Lock'}, -- 04 0 = unlock, 1 = lock
{ctype='data[3]', label='_junk1'}, -- 05
}
-- ROE quest log request
fields.outgoing[0x112] = L{
{ctype='int', label='_unknown1'}, -- 04
}
-- Homepoint Map Trigger :: 4 bytes, sent when entering a specific zone's homepoint list to cause maps to appear.
fields.outgoing[0x114] = L{
}
-- Currency 2 Menu
fields.outgoing[0x115] = L{
}
-- Open Unity Menu :: Two of these are sent whenever I open my unity menu. The first one has a bool of 0 and the second of 1.
fields.outgoing[0x116] = L{
{ctype='bool', label='_unknown1'}, -- 04
{ctype='char[3]', label='_unknown2'}, -- 05
}
-- Unity Ranking Results :: Sent when I open my Unity Ranking Results menu. Triggers a Sparks Update packet and may trigger ranking packets that I could not record.
fields.outgoing[0x117] = L{
{ctype='int', label='_unknown2'}, -- 04
}
-- Open Chat status
fields.outgoing[0x118] = L{
{ctype='bool', label='Chat Status'}, -- 04 0 for Inactive and 1 for Active
{ctype='char[3]', label='_unknown2'}, -- 05
}
types.job_level = L{
{ctype='unsigned char', label='Level'}, -- 00
}
-- Zone update
fields.incoming[0x00A] = L{
{ctype='unsigned int', label='Player', fn=id}, -- 04
{ctype='unsigned short', label='Player Index', fn=index}, -- 08
{ctype='unsigned char', label='_padding'}, -- 0A
{ctype='unsigned char', label='Heading', fn=dir}, -- 0B -- 0B to
{ctype='float', label='X'}, -- 0C
{ctype='float', label='Z'}, -- 10
{ctype='float', label='Y'}, -- 14
{ctype='unsigned short', label='Run Count'}, -- 18
{ctype='unsigned short', label='Target Index', fn=index}, -- 1A
{ctype='unsigned char', label='Movement Speed'}, -- 1C 32 represents 100%
{ctype='unsigned char', label='Animation Speed'}, -- 1D 32 represents 100%
{ctype='unsigned char', label='HP %', fn=percent}, -- 1E
{ctype='unsigned char', label='Status', fn=statuses}, -- 1F
{ctype='data[16]', label='_unknown1'}, -- 20
{ctype='unsigned short', label='Zone', fn=zone}, -- 30
{ctype='data[6]', label='_unknown2'}, -- 32
{ctype='unsigned int', label='Timestamp 1', fn=time}, -- 38
{ctype='unsigned int', label='Timestamp 2', fn=time}, -- 3C
{ctype='unsigned short', label='_unknown3'}, -- 40
{ctype='unsigned short', label='_dupeZone', fn=zone}, -- 42
{ctype='unsigned char', label='Face'}, -- 44
{ctype='unsigned char', label='Race'}, -- 45
{ctype='unsigned short', label='Head'}, -- 46
{ctype='unsigned short', label='Body'}, -- 48
{ctype='unsigned short', label='Hands'}, -- 4A
{ctype='unsigned short', label='Legs'}, -- 4C
{ctype='unsigned short', label='Feet'}, -- 4E
{ctype='unsigned short', label='Main'}, -- 50
{ctype='unsigned short', label='Sub'}, -- 52
{ctype='unsigned short', label='Ranged'}, -- 54
{ctype='unsigned short', label='Day Music'}, -- 56
{ctype='unsigned short', label='Night Music'}, -- 58
{ctype='unsigned short', label='Solo Combat Music'}, -- 5A
{ctype='unsigned short', label='Party Combat Music'}, -- 5C
{ctype='unsigned short', label='Mount Music'}, -- 5E
{ctype='data[2]', label='_unknown4'}, -- 60
{ctype='unsigned short', label='Menu Zone'}, -- 62 Only set if the menu ID is sent, used as the zone for menu responses (0x5b, 0x5c)
{ctype='unsigned short', label='Menu ID'}, -- 64
{ctype='unsigned short', label='_unknown5'}, -- 66
{ctype='unsigned short', label='Weather', fn=weather}, -- 68
{ctype='unsigned short', label='_unknown6'}, -- 6A
{ctype='data[24]', label='_unknown7'}, -- 6C
{ctype='char[16]', label='Player Name'}, -- 84
{ctype='data[12]', label='_unknown8'}, -- 94
{ctype='unsigned int', label='Abyssea Timestamp', fn=time}, -- A0
{ctype='unsigned int', label='_unknown9', const=0x0003A020}, -- A4
{ctype='data[2]', label='_unknown10'}, -- A8
{ctype='unsigned short', label='Zone model'}, -- AA
{ctype='data[8]', label='_unknown11'}, -- AC 0xAC is 2 for some zones, 0 for others
{ctype='unsigned char', label='Main Job', fn=job}, -- B4
{ctype='unsigned char', label='_unknown12'}, -- B5
{ctype='unsigned char', label='_unknown13'}, -- B6
{ctype='unsigned char', label='Sub Job', fn=job}, -- B7
{ctype='unsigned int', label='_unknown14'}, -- B8
{ref=types.job_level, lookup={res.jobs, 0x00}, count=0x10}, -- BC
{ctype='signed short', label='STR'}, -- CC
{ctype='signed short', label='DEX'}, -- CE
{ctype='signed short', label='VIT'}, -- D0
{ctype='signed short', label='AGI'}, -- D2
{ctype='signed short', label='IND'}, -- F4
{ctype='signed short', label='MND'}, -- D6
{ctype='signed short', label='CHR'}, -- D8
{ctype='signed short', label='STR Bonus'}, -- DA
{ctype='signed short', label='DEX Bonus'}, -- DC
{ctype='signed short', label='VIT Bonus'}, -- DE
{ctype='signed short', label='AGI Bonus'}, -- E0
{ctype='signed short', label='INT Bonus'}, -- E2
{ctype='signed short', label='MND Bonus'}, -- E4
{ctype='signed short', label='CHR Bonus'}, -- E6
{ctype='unsigned int', label='Max HP'}, -- E8
{ctype='unsigned int', label='Max MP'}, -- EC
{ctype='data[20]', label='_unknown15'}, -- F0
}
-- Zone Response
fields.incoming[0x00B] = L{
{ctype='unsigned int', label='Type', fn=e+{'zone'}}, -- 04
{ctype='unsigned int', label='IP', fn=ip}, -- 08
{ctype='unsigned short', label='Port'}, -- 0C
{ctype='unsigned short', label='_unknown1'}, -- 10
{ctype='unsigned short', label='_unknown2'}, -- 12
{ctype='unsigned short', label='_unknown3'}, -- 14
{ctype='unsigned short', label='_unknown4'}, -- 16
{ctype='unsigned short', label='_unknown5'}, -- 18
{ctype='unsigned short', label='_unknown6'}, -- 1A
{ctype='unsigned short', label='_unknown7'}, -- 1C
}
-- PC Update
fields.incoming[0x00D] = L{
-- The flags in this byte are complicated and may not strictly be flags.
-- Byte 0x20: -- Mentor is somewhere in this byte
-- 01 = None
-- 02 = Deletes everyone
-- 04 = Deletes everyone
-- 08 = None
-- 16 = None
-- 32 = None
-- 64 = None
-- 128 = None
-- Byte 0x21:
-- 01 = None
-- 02 = None
-- 04 = None
-- 08 = LFG
-- 16 = Anon
-- 32 = Turns your name orange
-- 64 = Away
-- 128 = None
-- Byte 0x22:
-- 01 = POL Icon, can target?
-- 02 = no notable effect
-- 04 = DCing
-- 08 = Untargettable
-- 16 = No linkshell
-- 32 = No Linkshell again
-- 64 = No linkshell again
-- 128 = No linkshell again
-- Byte 0x23:
-- 01 = Trial Account
-- 02 = Trial Account
-- 04 = GM Mode
-- 08 = None
-- 16 = None
-- 32 = Invisible models
-- 64 = None
-- 128 = Bazaar
{ctype='unsigned int', label='Player', fn=id}, -- 04
{ctype='unsigned short', label='Index', fn=index}, -- 08
{ctype='boolbit', label='Update Position'}, -- 0A:0 Position, Rotation, Target, Speed
{ctype='boolbit', label='Update Status'}, -- 1A:1 Not used for 0x00D
{ctype='boolbit', label='Update Vitals'}, -- 0A:2 HP%, Status, Flags, LS color, "Face Flags"
{ctype='boolbit', label='Update Name'}, -- 0A:3 Name
{ctype='boolbit', label='Update Model'}, -- 0A:4 Race, Face, Gear models
{ctype='boolbit', label='Despawn'}, -- 0A:5 Only set if player runs out of range or zones
{ctype='boolbit', label='_unknown1'}, -- 0A:6
{ctype='boolbit', label='_unknown2'}, -- 0A:6
{ctype='unsigned char', label='Heading', fn=dir}, -- 0B
{ctype='float', label='X'}, -- 0C
{ctype='float', label='Z'}, -- 10
{ctype='float', label='Y'}, -- 14
{ctype='bit[13]', label='Run Count'}, -- 18:0 Analogue to Run Count from outgoing 0x015
{ctype='bit[3]', label='_unknown3'}, -- 19:5 Analogue to Run Count from outgoing 0x015
{ctype='boolbit', label='_unknown4'}, -- 1A:0
{ctype='bit[15]', label='Target Index', fn=index}, -- 1A:1
{ctype='unsigned char', label='Movement Speed'}, -- 1C 32 represents 100%
{ctype='unsigned char', label='Animation Speed'}, -- 1D 32 represents 100%
{ctype='unsigned char', label='HP %', fn=percent}, -- 1E
{ctype='unsigned char', label='Status', fn=statuses}, -- 1F
{ctype='unsigned int', label='Flags', fn=bin+{4}}, -- 20
{ctype='unsigned char', label='Linkshell Red'}, -- 24
{ctype='unsigned char', label='Linkshell Green'}, -- 25
{ctype='unsigned char', label='Linkshell Blue'}, -- 26
{ctype='unsigned char', label='_flags1'}, -- 27 0x80 Autogroup flag
{ctype='unsigned char', label='_flags2'}, -- 28 0x01 puts your weapon on hand, 0x02 Request flag,
{ctype='unsigned char', label='PvP Stuff'}, -- 29 Same pattern than incoming 0x037 packet
{ctype='unsigned char', label='_flags3'}, -- 2A 0x20 Sneak Effect flag, 0x80 New Adventurer flag
{ctype='unsigned char', label='_flags4'}, -- 2B 0x01 Mentor flag
{ctype='data[4]', label='_unknown6'}, -- 2C
{ctype='unsigned short', label='Costume'}, -- 30 ID of the Model
{ctype='data[1]', label='_unknown7'}, -- 32
{ctype='unsigned char', label='_flags5'}, -- 33 0x02 Trial Account flag, 0x40 Job Master Stars flag
{ctype='unsigned int', label='_unknown8'}, -- 34 Related to mounts
{ctype='data[4]', label='_unknown9'}, -- 38
{ctype='unsigned short', label='Pet Index', fn=index}, -- 3C
{ctype='unsigned short', label='Monstrosity Species'}, -- 3E High bit is always set while in monstrosity and determines the display of the third name
{ctype='unsigned char', label='Monstrosity Name 1'}, -- 40
{ctype='unsigned char', label='Monstrosity Name 2'}, -- 41
{ctype='unsigned char', label='Indi Bubble'}, -- 42 Geomancer (GEO) Indi spell effect on players. 0 is no effect.
{ctype='unsigned char', label='Face Flags'}, -- 43 0, 3, 4, or 8
{ctype='bit[4]', label='_unknown10'}, -- 44
{ctype='bit[8]', label='Mount'}, -- 44 Related to Mounts, seems to be mount id + 1, except for chocobo. The value doesn't get zeroed after dismount
{ctype='bit[20]', label='_unknown11'}, -- 45
{ctype='unsigned char', label='Face'}, -- 48
{ctype='unsigned char', label='Race'}, -- 49
{ctype='unsigned short', label='Head'}, -- 4A
{ctype='unsigned short', label='Body'}, -- 4C
{ctype='unsigned short', label='Hands'}, -- 4E
{ctype='unsigned short', label='Legs'}, -- 50
{ctype='unsigned short', label='Feet'}, -- 52
{ctype='unsigned short', label='Main'}, -- 54
{ctype='unsigned short', label='Sub'}, -- 56
{ctype='unsigned short', label='Ranged'}, -- 58
{ctype='char*', label='Character Name'}, -- 5A - *
}
-- NPC Update
-- There are two different types of these packets. One is for regular NPCs, the other occurs for certain NPCs (often nameless) and differs greatly in structure.
-- The common fields seem to be the ID, Index, mask and _unknown3.
-- The second one seems to have an int counter at 0x38 that increases by varying amounts every time byte 0x1F changes.
-- Currently I don't know how to algorithmically distinguish when the packets are different.
-- Mask values (from antiquity):
-- 0x01: "Basic"
-- 0x02: Status
-- 0x04: HP
-- 0x08: Name
-- 0x10: "Bit 4"
-- 0x20: "Bit 5"
-- 0x40: "Bit 6"
-- 0x80: "Bit 7"
-- Status flags (from antiquity):
-- 0b00100000 = CFH Bit
-- 0b10000101 = "Normal_Status?"
fields.incoming[0x00E] = L{
{ctype='unsigned int', label='NPC', fn=id}, -- 04
{ctype='unsigned short', label='Index', fn=index}, -- 08
{ctype='unsigned char', label='Mask', fn=bin+{1}}, -- 0A Bits that control which parts of the packet are actual updates (rest is zeroed). Model is always sent
-- 0A Bit 0: Position, Rotation, Walk Count
-- 0A Bit 1: Claimer ID
-- 0A Bit 2: HP, Status
-- 0A Bit 3: Name
-- 0A Bit 4:
-- 0A Bit 5: The client stops displaying the mob when this bit is set (dead, out of range, etc.)
-- 0A Bit 6:
-- 0A Bit 7:
{ctype='unsigned char', label='Rotation', fn=dir}, -- 0B
{ctype='float', label='X'}, -- 0C
{ctype='float', label='Z'}, -- 10
{ctype='float', label='Y'}, -- 14
{ctype='unsigned int', label='Walk Count'}, -- 18 Steadily increases until rotation changes. Does not reset while the mob isn't walking. Only goes until 0xFF1F.
{ctype='unsigned short', label='_unknown1', fn=bin+{2}}, -- 1A
{ctype='unsigned char', label='HP %', fn=percent}, -- 1E
{ctype='unsigned char', label='Status', fn=statuses}, -- 1F Status used to be 0x20
{ctype='unsigned int', label='_unknown2', fn=bin+{4}}, -- 20
{ctype='unsigned int', label='_unknown3', fn=bin+{4}}, -- 24
{ctype='unsigned int', label='_unknown4', fn=bin+{4}}, -- 28 In Dynamis - Divergence statue's eye colors
{ctype='unsigned int', label='Claimer', fn=id}, -- 2C
{ctype='unsigned short', label='_unknown5'}, -- 30
{ctype='unsigned short', label='Model'}, -- 32
{ctype='char*', label='Name'}, -- 34 - *
}
enums['mentor icon'] = {
[0] = 'None',
[1] = 'Bronze',
[2] = 'Silver',
[3] = 'Gold'
}
func.incoming[0x017] = {}
func.incoming[0x017].base = L{
{ctype='unsigned char', label='Mode', fn=chat}, -- 04
}
func.incoming[0x017].default = L{
{ctype='bool', label='GM'}, -- 05
{ctype='unsigned short', label='_padding1',}, -- 06 Reserved for Yell and Assist Modes
{ctype='char[0xF]', label='Sender Name'}, -- 08
{ctype='char*', label='Message'}, -- 17 Max of 150 characters
}
func.incoming[0x017][0x1A] = L{ -- Yell
{ctype='bool', label='GM'}, -- 05
{ctype='unsigned short', label='Zone', fn=zone}, -- 06 Zone ID of sender
{ctype='char[0xF]', label='Sender Name'}, -- 08
{ctype='char*', label='Message'}, -- 17 Max of 150 characters
}
func.incoming[0x017][0x22] = L{ -- AssistJ
{ctype='bool', label='GM'}, -- 05
{ctype='unsigned char', label='Mastery Rank'}, -- 06 Sender Mastery Rank
{ctype='unsigned char', label='Mentor Icon', fn=e+{'mentor icon'}},-- 07 Color of Mentor Flag
{ctype='char[0xF]', label='Sender Name'}, -- 08
{ctype='char*', label='Message'}, -- 17 Max of 150 characters
}
func.incoming[0x017][0x23] = func.incoming[0x017][0x22] -- AssistE
-- Incoming Chat
fields.incoming[0x017] = function()
local fields = func.incoming[0x017]
return function(data, type)
return fields.base + (fields[type or data:byte(5)] or fields.default)
end
end()
types.job_master= L{
{ctype='boolbit', label='Master'}
}
types.job_master_level= L{
{ctype='unsigned char', label='Master Level'}
}
-- Job Info
fields.incoming[0x01B] = L{
{ctype='unsigned int', label='_unknown1'}, -- 04 Observed value of 05
{ctype='unsigned char', label='Main Job', fn=job}, -- 08
{ctype='unsigned char', label='Flag or Main Job Level?'}, -- 09
{ctype='unsigned char', label='Flag or Sub Job Level?'}, -- 0A
{ctype='unsigned char', label='Sub Job', fn=job}, -- 0B
{ctype='bit[32]', label='Sub/Job Unlock Flags'}, -- 0C Indicate whether subjob is unlocked and which jobs are unlocked. lsb of 0x0C indicates subjob unlock.
{ctype='unsigned char', label='_unknown3'}, -- 10 Flag or List Start
{ref=types.job_level, lookup={res.jobs, 0x01}, count=0x0F}, -- 11
{ctype='unsigned short', label='Base STR'}, -- 20 -- Altering these stat values has no impact on your equipment menu.
{ctype='unsigned short', label='Base DEX'}, -- 22
{ctype='unsigned short', label='Base VIT'}, -- 24
{ctype='unsigned short', label='Base AGI'}, -- 26
{ctype='unsigned short', label='Base INT'}, -- 28
{ctype='unsigned short', label='Base MND'}, -- 2A
{ctype='unsigned short', label='Base CHR'}, -- 2C
{ctype='data[14]', label='_unknown4'}, -- 2E Flags and junk? Hard to say. All 0s observed.
{ctype='unsigned int', label='Maximum HP'}, -- 3C
{ctype='unsigned int', label='Maximum MP'}, -- 40
{ctype='unsigned int', label='Flags'}, -- 44 Looks like a bunch of flags. Observed value if 01 00 00 00
{ctype='unsigned char', label='_unknown5'}, -- 48 Potential flag to signal the list start. Observed value of 01
{ref=types.job_level, lookup={res.jobs, 0x01}, count=0x16}, -- 49
{ctype='unsigned char', label='Current Monster Level'}, -- 5F
{ctype='unsigned int', label='Encumbrance Flags'}, -- 60 [legs, hands, body, head, ammo, range, sub, main,] [back, right_ring, left_ring, right_ear, left_ear, waist, neck, feet] [HP, CHR, MND, INT, AGI, VIT, DEX, STR,] [X X X X X X X MP]
{ctype='unsigned char', label='_unknown7'}, -- 64
{ctype='unsigned char', label='Mentor Icon', fn=e+{'mentor icon'}},-- 65
{ctype='unsigned char', label='Mastery Rank'}, -- 66
{ctype='unsigned char', label='_unknown8'}, -- 67
{ctype='bit[1]', label='_junk1'}, -- 68
{ref=types.job_master, lookup={res.jobs, 0x01}, count=0x16}, -- 68 Indicates if the job is mastered, but only after receiving "Master Breaker" KI. Used to populate "Master Levels" Menu
{ctype='bit[1]', label='_junk2'}, -- 6A
{ctype='unsigned short', label='_junk3'}, -- 6B
{ref=types.job_master_level,lookup={res.jobs, 0x01}, count=0x16}, -- 6D
}
-- Inventory Count
-- It is unclear why there are two representations of the size for this.
-- I have manipulated my inventory size on a mule after the item update packets have
-- all arrived and still did not see any change in the second set of sizes, so they
-- may not be max size/used size chars as I initially assumed. Adding them as shorts
-- for now.
-- There appears to be space for another 8 bags.
fields.incoming[0x01C] = L{
{ctype='unsigned char', label='Inventory Size'}, -- 04
{ctype='unsigned char', label='Safe Size'}, -- 05
{ctype='unsigned char', label='Storage Size'}, -- 06
{ctype='unsigned char', label='Temporary Size'}, -- 07
{ctype='unsigned char', label='Locker Size'}, -- 08
{ctype='unsigned char', label='Satchel Size'}, -- 09
{ctype='unsigned char', label='Sack Size'}, -- 0A
{ctype='unsigned char', label='Case Size'}, -- 0B
{ctype='unsigned char', label='Wardrobe Size'}, -- 0C
{ctype='unsigned char', label='Safe 2 Size'}, -- 0D
{ctype='unsigned char', label='Wardrobe 2 Size'}, -- 0E
{ctype='unsigned char', label='Wardrobe 3 Size'}, -- 0F
{ctype='unsigned char', label='Wardrobe 4 Size'}, -- 10
{ctype='data[19]', label='_padding1', const=''}, -- 11
{ctype='unsigned short', label='_dupeInventory Size'}, -- 24 These "dupe" sizes are set to 0 if the inventory disabled.
{ctype='unsigned short', label='_dupeSafe Size'}, -- 26
{ctype='unsigned short', label='_dupeStorage Size'}, -- 28 The accumulated storage from all items (uncapped) -1
{ctype='unsigned short', label='_dupeTemporary Size'}, -- 2A
{ctype='unsigned short', label='_dupeLocker Size'}, -- 2C
{ctype='unsigned short', label='_dupeSatchel Size'}, -- 2E
{ctype='unsigned short', label='_dupeSack Size'}, -- 30
{ctype='unsigned short', label='_dupeCase Size'}, -- 32
{ctype='unsigned short', label='_dupeWardrobe Size'}, -- 34
{ctype='unsigned short', label='_dupeSafe 2 Size'}, -- 36
{ctype='unsigned short', label='_dupeWardrobe 2 Size'}, -- 38
{ctype='unsigned short', label='_dupeWardrobe 3 Size'}, -- 3A This is not set to 0 despite being disabled for whatever reason
{ctype='unsigned short', label='_dupeWardrobe 4 Size'}, -- 3C This is not set to 0 despite being disabled for whatever reason
{ctype='data[22]', label='_padding2', const=''}, -- 3E
}
-- Finish Inventory
fields.incoming[0x01D] = L{
{ctype='unsigned char', label='Flag', const=0x01}, -- 04
{ctype='data[3]', label='_junk1'}, -- 06
}
-- Modify Inventory
fields.incoming[0x01E] = L{
{ctype='unsigned int', label='Count'}, -- 04
{ctype='unsigned char', label='Bag', fn=bag}, -- 08
{ctype='unsigned char', label='Index', fn=inv+{0}}, -- 09
{ctype='unsigned char', label='Status', fn=e+{'itemstat'}}, -- 0A
{ctype='unsigned char', label='_junk1'}, -- 0B
}
-- Item Assign
fields.incoming[0x01F] = L{
{ctype='unsigned int', label='Count'}, -- 04
{ctype='unsigned short', label='Item', fn=item}, -- 08
{ctype='unsigned char', label='Bag', fn=bag}, -- 0A
{ctype='unsigned char', label='Index', fn=invp+{0x0A}}, -- 0B
{ctype='unsigned char', label='Status', fn=e+{'itemstat'}}, -- 0C
}
-- Item Updates
fields.incoming[0x020] = L{
{ctype='unsigned int', label='Count'}, -- 04
{ctype='unsigned int', label='Bazaar', fn=gil}, -- 08
{ctype='unsigned short', label='Item', fn=item}, -- 0C
{ctype='unsigned char', label='Bag', fn=bag}, -- 0E
{ctype='unsigned char', label='Index', fn=invp+{0x0E}}, -- 0F
{ctype='unsigned char', label='Status', fn=e+{'itemstat'}}, -- 10
{ctype='data[24]', label='ExtData', fn='...':fn()}, -- 11
{ctype='data[3]', label='_junk1'}, -- 29
}
-- Trade request received
fields.incoming[0x021] = L{
{ctype='unsigned int', label='Player', fn=id}, -- 04
{ctype='unsigned short', label='Index', fn=index}, -- 08
{ctype='unsigned short', label='_junk1'}, -- 0A
}
-- Trade request sent
enums['trade'] = {
[0] = 'Trade started',
[1] = 'Trade canceled',
[2] = 'Trade accepted by other party',
[9] = 'Trade successful',
}
fields.incoming[0x022] = L{
{ctype='unsigned int', label='Player', fn=id}, -- 04
{ctype='unsigned int', label='Type', fn=e+{'trade'}}, -- 08
{ctype='unsigned short', label='Index', fn=index}, -- 0C
{ctype='unsigned short', label='_junk1'}, -- 0E
}
-- Trade item, other party
fields.incoming[0x023] = L{
{ctype='unsigned int', label='Count'}, -- 04
{ctype='unsigned short', label='Trade Count'}, -- 08 Seems to increment every time packet 0x023 comes in, i.e. every trade action performed by the other party
{ctype='unsigned short', label='Item', fn=item}, -- 0A If the item is removed, gil is used with a count of zero
{ctype='unsigned char', label='_unknown1', const=0x05}, -- 0C Possibly junk?
{ctype='unsigned char', label='Slot'}, -- 0D Gil itself is in slot 0, whereas the other slots start at 1 and count up horizontally
{ctype='data[24]', label='ExtData'}, -- 0E
{ctype='data[2]', label='_junk1'}, -- 26
}
-- Trade item, self
fields.incoming[0x025] = L{
{ctype='unsigned int', label='Count'}, -- 04
{ctype='unsigned short', label='Item', fn=item}, -- 08 If the item is removed, gil is used with a count of zero
{ctype='unsigned char', label='Slot'}, -- 0A Gil itself is in slot 0, whereas the other slots start at 1 and count up horizontally
{ctype='unsigned char', label='Inventory Index', fn=inv+{0}}, -- 0B
}
-- Count to 80
-- Sent after Item Update chunks for active inventory (sometimes) when zoning.
fields.incoming[0x026] = L{
{ctype='data[1]', label='_unknown1', const=0x00}, -- 04
{ctype='unsigned char', label='Slot'}, -- 05 Corresponds to the slot IDs of the previous incoming packet's Item Update chunks for active Inventory.
{ctype='data[22]', label='_unknown2', const=0}, -- 06
}
-- String Message
fields.incoming[0x027] = L{
{ctype='unsigned int', label='Player', fn=id}, -- 04 0x0112413A in Omen, 0x010B7083 in Legion, Layer Reserve ID for Ambuscade queue, 0x01046062 for Chocobo circuit
{ctype='unsigned short', label='Player Index', fn=index}, -- 08 0x013A in Omen, 0x0083 in Legion , Layer Reserve Index for Ambuscade queue, 0x0062 for Chocobo circuit
{ctype='unsigned short', label='Message ID', fn=sub+{0x8000}}, -- 0A -0x8000
{ctype='unsigned int', label='Type'}, -- 0C 0x04 for Fishing/Salvage, 0x05 for Omen/Legion/Ambuscade queue/Chocobo Circuit
{ctype='unsigned int', label='Param 1'}, -- 10 Parameter 0 on the display messages dat files
{ctype='unsigned int', label='Param 2'}, -- 14 Parameter 1 on the display messages dat files
{ctype='unsigned int', label='Param 3'}, -- 18 Parameter 2 on the display messages dat files
{ctype='unsigned int', label='Param 4'}, -- 1C Parameter 3 on the display messages dat files
{ctype='char[16]', label='Player Name'}, -- 20
{ctype='data[16]', label='_unknown6'}, -- 30
{ctype='char[16]', label='_dupePlayer Name'}, -- 40
{ctype='data[32]', label='_unknown7'}, -- 50
}
-- Action
func.incoming[0x028] = {}
fields.incoming[0x028] = function()
local self = func.incoming[0x028]
-- start and length are both in bits
local extract = function(data, start, length)
return data:unpack('b' .. length, (start / 8):floor() + 1, start % 8 + 1)
end
-- All values here are in bits
local add_effect_offset = 85
local add_effect_size = 37
local spike_effect_size = 34
local add_action = function(data, pos)
action = L{}
action:extend(self.action_base)
action:extend(self.add_effect_base)
pos = pos + add_effect_offset
local has_add_effect = extract(data, pos, 1) == 1
pos = pos + 1
if has_add_effect then
action:extend(self.add_effect_body)
pos = pos + add_effect_size
end
action:extend(self.spike_effect_base)
local has_spike_effect = extract(data, pos, 1) == 1
pos = pos + 1
if has_spike_effect then
action:extend(self.spike_effect_body)
pos = pos + spike_effect_size
end
return action, pos
end
local action_count_offset = 32;
local add_target = function(data, pos)
local target = L{}
target:extend(self.target_base:copy())
pos = pos + action_count_offset
local action_count = extract(data, pos, 4)
pos = pos + 4
for i = 1, action_count do
local action
action, pos = add_action(data, pos)
action = action:copy():map(function(field)
field.label = 'Action %u %s':format(i, field.label)
return field
end)
target:extend(action)
end
return target, pos
end
local target_count_offset = 72
local first_target_offset = 150
return function(data)
local fields = self.base:copy()
local target_count = extract(data, target_count_offset, 10)
pos = first_target_offset
for i = 1, target_count do
local target
target, pos = add_target(data, pos)
target = target:copy():map(function(field)
field.label = 'Target %u %s':format(i, field.label)
return field
end)
fields:extend(target)
end
return fields
end
end()
enums.action_in = {
[1] = 'Melee attack',
[2] = 'Ranged attack finish',
[3] = 'Weapon Skill finish',
[4] = 'Casting finish',
[5] = 'Item finish',
[6] = 'Job Ability',
[7] = 'Weapon Skill start',
[8] = 'Casting start',
[9] = 'Item start',
[11] = 'NPC TP finish',
[12] = 'Ranged attack start',
[13] = 'Avatar TP finish',
[14] = 'Job Ability DNC',
[15] = 'Job Ability RUN',
}
func.incoming[0x028].base = L{
{ctype='unsigned char', label='Size'}, -- 04
{ctype='unsigned int', label='Actor', fn=id}, -- 05
{ctype='bit[10]', label='Target Count'}, -- 09:0
{ctype='bit[4]', label='Category', fn=e+{'action_in'}},-- 0A:2
{ctype='bit[16]', label='Param'}, -- 0C:6
{ctype='bit[16]', label='_unknown1'}, -- 0E:6
{ctype='bit[32]', label='Recast'}, -- 10:6
}
func.incoming[0x028].target_base = L{
{ctype='bit[32]', label='ID', fn=id}, -- 00:0
{ctype='bit[4]', label='Action Count'}, -- 04:0
}
func.incoming[0x028].action_base = L{
{ctype='bit[5]', label='Reaction'}, -- 00:0
{ctype='bit[12]', label='Animation'}, -- 00:5
{ctype='bit[4]', label='Effect'}, -- 02:1 Particle effects: bit 1 finishing blow, bit 2 critical hit, bit 3 hit not connected, bit 4 effect follow up (I have only seen in jishnu's radiance)
{ctype='bit[3]', label='Stagger'}, -- 02:5 head moving animation when getting hit, the value seems to be set based on dmg done, more dmg more bits sets (not sure if raw or percentage)
{ctype='bit[3]', label='Knockback'}, -- 03:0 Knockback effect, the more value the more distance
{ctype='bit[17]', label='Param'}, -- 03:3
{ctype='bit[10]', label='Message'}, -- 06:2
{ctype='bit[31]', label='_unknown'}, -- 07:4 --Message Modifier? If you get a complete (Resist!) this is set to 2 otherwise a regular Resist is 0.
}
func.incoming[0x028].add_effect_base = L{
{ctype='boolbit', label='Has Added Effect'}, -- 00:0
}
func.incoming[0x028].add_effect_body = L{
{ctype='bit[6]', label='Added Effect Animation'}, -- 00:0
{ctype='bit[4]', label='Added Effect Effect'}, -- 00:6
{ctype='bit[17]', label='Added Effect Param'}, -- 01:2
{ctype='bit[10]', label='Added Effect Message'}, -- 04:1
}
func.incoming[0x028].spike_effect_base = L{
{ctype='boolbit', label='Has Spike Effect'}, -- 00:0
}
func.incoming[0x028].spike_effect_body = L{
{ctype='bit[6]', label='Spike Effect Animation'}, -- 00:0
{ctype='bit[4]', label='Spike Effect Effect'}, -- 00:6
{ctype='bit[14]', label='Spike Effect Param'}, -- 01:2
{ctype='bit[10]', label='Spike Effect Message'}, -- 03:0
}
-- Action Message
fields.incoming[0x029] = L{
{ctype='unsigned int', label='Actor', fn=id}, -- 04
{ctype='unsigned int', label='Target', fn=id}, -- 08
{ctype='unsigned int', label='Param 1'}, -- 0C
{ctype='unsigned int', label='Param 2'}, -- 10
{ctype='unsigned short', label='Actor Index', fn=index}, -- 14
{ctype='unsigned short', label='Target Index', fn=index}, -- 16
{ctype='unsigned short', label='Message'}, -- 18
{ctype='unsigned short', label='_unknown1'}, -- 1A
}
--[[ 0x2A can be triggered by knealing in the right areas while in the possession of a VWNM KI:
Field1 will be lights level:
0 = 'Tier 1', -- faintly/feebly depending on whether it's outside of inside Abyssea
1 = 'Tier 2', -- softly
2 = 'Tier 3', -- solidly. Highest Tier in Abyssea
3 = 'Tier 4', --- strongly
4 = 'Tier 5', -- very strongly. Unused currently
5 = 'Tier 6', --- furiously. Unused currently
- But if there are no mobs left in area, or no mobs nearby, field1 will be the KeyItem#
1253 = 'Clear Abyssite'
1254 = 'Colorful Abyssite'
1564 = 'Clear Demilune Abyssite'
etc.
Field2 will be direction:
0 = 'East'
1 = 'Southeast'
2 = 'South'
3 = 'Southwest'
4 = 'West'
5 = 'Northwest'
6 = 'North'
7 = 'Northeast'
Field3 will be distance. When there are no mobs, this value is set to 300000
Field4 will be KI# of the abyssite used. Ex:
1253 = 'Clear Abyssite'
1254 = 'Colorful Abyssite'
1564 = 'Clear Demilune Abyssite'
etc.
]]
--[[ 0x2A can also be triggered by buying/disposing of a VWNM KI from an NPC:
Index/ID field will be those of the NPC
Field1 will be 1000 (gil) when acquiring in Jueno, 300 (cruor) when acquiring in Abyssea
Field2 will be the KI# acquired
Fields are used slighly different when dropping the KI using the NPC.
]]
--[[ 0x2A can also be triggered by spending cruor by buying non-vwnm related items, or even activating/using Flux
Field1 will be the amount of cruor spent
]]
--[[ 0x2A can also be triggered by zoning into Abyssea:
Field1 will be set to your remaining time. 5 at first, then whatever new value when acquiring visiting status.
0x2A will likely be triggered as well when extending your time limit. Needs verification.
]]
--[[ 0x2A can be triggered sometimes when zoning into non-Abyssea:
Not sure what it means.
]]
-- Resting Message
fields.incoming[0x02A] = L{
{ctype='unsigned int', label='Player', fn=id}, -- 04
{ctype='unsigned int', label='Param 1'}, -- 08
{ctype='unsigned int', label='Param 2'}, -- 0C
{ctype='unsigned int', label='Param 3'}, -- 10
{ctype='unsigned int', label='Param 4'}, -- 14
{ctype='unsigned short', label='Player Index', fn=index}, -- 18
{ctype='unsigned short', label='Message ID'}, -- 1A The high bit is occasionally set, though the reason for it is unclear.
{ctype='unsigned int', label='_unknown1'}, -- 1C Possibly flags, 0x06000000 and 0x02000000 observed
}
-- Kill Message
-- Updates EXP gained, RoE messages, Limit Points, and Capacity Points
fields.incoming[0x02D] = L{
{ctype='unsigned int', label='Player', fn=id}, -- 04
{ctype='unsigned int', label='Target', fn=id}, -- 08 Player ID in the case of RoE log updates
{ctype='unsigned short', label='Player Index', fn=index}, -- 0C
{ctype='unsigned short', label='Target Index', fn=index}, -- 0E Player Index in the case of RoE log updates
{ctype='unsigned int', label='Param 1'}, -- 10 EXP gained, etc. Numerator for RoE objectives
{ctype='unsigned int', label='Param 2'}, -- 14 Denominator for RoE objectives
{ctype='unsigned short', label='Message'}, -- 18
{ctype='unsigned short', label='_flags1'}, -- 1A This could also be a third parameter, but I suspect it is flags because I have only ever seen one bit set.
}
-- Mog House Menu
fields.incoming[0x02E] = L{} -- Seems to contain no fields. Just needs to be sent to client to open.
-- Digging Animation
fields.incoming[0x02F] = L{
{ctype='unsigned int', label='Player', fn=id}, -- 04
{ctype='unsigned short', label='Player Index', fn=index}, -- 08
{ctype='unsigned char', label='Animation'}, -- 0A Changing it to anything other than 1 eliminates the animation
{ctype='unsigned char', label='_junk1'}, -- 0B Likely junk. Has no effect on anything notable.
}
-- Synth Animation
fields.incoming[0x030] = L{
{ctype='unsigned int', label='Player', fn=id}, -- 04
{ctype='unsigned short', label='Player Index', fn=index}, -- 08
{ctype='unsigned short', label='Effect'}, -- 0A -- 10 00 is water, 11 00 is wind, 12 00 is fire, 13 00 is earth, 14 00 is lightning, 15 00 is ice, 16 00 is light, 17 00 is dark
{ctype='unsigned char', label='Param'}, -- 0C -- 00 is NQ, 01 is break, 02 is HQ
{ctype='unsigned char', label='Animation'}, -- 0D -- Always C2 for me.
{ctype='unsigned char', label='_unknown1', const=0x00}, -- 0E -- Appears to just be trash.
}
-- Synth List / Synth Recipe
--[[ This packet is used for list of recipes, but also for details of a specific recipe.
If you ask the guild NPC that provides regular Image Suppor for recipes,
s/he will give you a list of recipes, fields are as follows:
Field1-2: NPC ID
Field3: NPC Index
Field4-6: Unknown
Field7-22: Item ID of recipe
Field23: Unknown
Field24: Usually Item ID of the recipe on next page
If you ask a guild NPC for a specific recipe, fields are as follows:
field1: item to make (item id)
field2,3,4: sub-crafts needed. Note that main craft will not be listed.
1 = woodworking
2 = smithing
3 = goldsmithing
4 = clothcraft
5 = leatherworking
6 = bonecraft
7 = Alchemy
8 = Cooking
field5: crystal (item id)
field6: KeyItem needed, if any (in Big Endian)
field7-14: material required (item id)
field15-22: qty for each material above.
field23-24: Unknown
]]
fields.incoming[0x031] = L{
{ctype='unsigned short[24]', label='Field'}, -- 04
}
-- NPC Interaction Type 1
fields.incoming[0x032] = L{
{ctype='unsigned int', label='NPC', fn=id}, -- 04
{ctype='unsigned short', label='NPC Index', fn=index}, -- 08
{ctype='unsigned short', label='Zone', fn=zone}, -- 0A
{ctype='unsigned short', label='Menu ID'}, -- 0C Seems to select between menus within a zone
{ctype='unsigned short', label='_unknown1'}, -- 0E 00 for me
{ctype='unsigned char', label='_dupeZone', fn=zone}, -- 10
{ctype='data[3]', label='_junk1'}, -- 11 Always 00s for me
}
-- String NPC Interaction
fields.incoming[0x033] = L{
{ctype='unsigned int', label='NPC', fn=id}, -- 04
{ctype='unsigned short', label='NPC Index', fn=index}, -- 08
{ctype='unsigned short', label='Zone', fn=zone}, -- 0A
{ctype='unsigned short', label='Menu ID'}, -- 0C Seems to select between menus within a zone
{ctype='unsigned short', label='_unknown1'}, -- 0E 00 00 or 08 00 for me
{ctype='char[16]', label='NPC Name'}, -- 10
{ctype='char[16]', label='_dupeNPC Name1'}, -- 20
{ctype='char[16]', label='_dupeNPC Name2'}, -- 30
{ctype='char[16]', label='_dupeNPC Name3'}, -- 40
{ctype='char[32]', label='Menu Parameters'}, -- 50 The way this information is interpreted varies by menu.
}
-- NPC Interaction Type 2
fields.incoming[0x034] = L{
{ctype='unsigned int', label='NPC', fn=id}, -- 04
{ctype='data[32]', label='Menu Parameters'}, -- 08
{ctype='unsigned short', label='NPC Index', fn=index}, -- 28
{ctype='unsigned short', label='Zone', fn=zone}, -- 2A
{ctype='unsigned short', label='Menu ID'}, -- 2C Seems to select between menus within a zone
{ctype='unsigned short', label='_unknown1'}, -- 2E Ususually 8, but often not for newer menus
{ctype='unsigned short', label='_dupeZone', fn=zone}, -- 30
{ctype='data[2]', label='_junk1'}, -- 31 Always 00s for me
}
--- When messages are fishing related, the player is the Actor.
--- For some areas, the most significant bit of the message ID is set sometimes.
-- NPC Chat
fields.incoming[0x036] = L{
{ctype='unsigned int', label='Actor', fn=id}, -- 04
{ctype='unsigned short', label='Actor Index', fn=index}, -- 08
{ctype='bit[15]', label='Message ID'}, -- 0A
{ctype='bit', label='_unknown1'}, -- 0B
{ctype='unsigned int', label='_unknown2'}, -- 0C Probably junk
}
enums.indi = {
[0x5F] = 'Enemy Dark',
[0x5E] = 'Enemy Light',
[0x5D] = 'Enemy Water',
[0x5C] = 'Enemy Lightning',
[0x5B] = 'Enemy Earth',
[0x5A] = 'Enemy Wind',
[0x59] = 'Enemy Ice',
[0x58] = 'Enemy Fire',
[0x57] = 'Party Dark',
[0x56] = 'Party Light',
[0x55] = 'Party Water',
[0x54] = 'Party Lightning',
[0x53] = 'Party Earth',
[0x52] = 'Party Wind',
[0x51] = 'Party Ice',
[0x50] = 'Party Fire',
[0x00] = 'None',
}
-- Player update
-- Buff IDs go can over 0xFF, but in the packet each buff only takes up one byte.
-- To address that there's a 8 byte bitmask starting at 0x4C where each 2 bits
-- represent how much to add to the value in the respective byte.
--[[ _flags1: The structure here looks similar to byte 0x33 of 0x00D, but left shifted by 1 bit
-- 0x0001 -- Despawns your character
-- 0x0002 -- Also despawns your character, and may trigger an outgoing packet to the server (which triggers an incoming 0x037 packet)
-- 0x0004 -- No obvious effect
-- 0x0008 -- No obvious effect
-- 0x0010 -- LFG flag
-- 0x0020 -- /anon flag - blue name
-- 0x0040 -- orange name?
-- 0x0080 -- Away flag
-- 0x0100 -- No obvious effect
-- 0x0200 -- No obvious effect
-- 0x0400 -- No obvious effect
-- 0x0800 -- No obvious effect
-- 0x1000 -- No obvious effect
-- 0x2000 -- No obvious effect
-- 0x4000 -- No obvious effect
-- 0x8000 -- No obvious effect
_flags2:
-- 0x01 -- POL Icon :: Actually a flag, overrides everything else but does not affect name color
-- 0x02 -- No obvious effect
-- 0x04 -- Disconnection icon :: Actually a flag, overrides everything but POL Icon
-- 0x08 -- No linkshell
-- 0x0A -- No obvious effect
-- 0x10 -- No linkshell
-- 0x20 -- Trial account icon
-- 0x40 -- Trial account icon
-- 0x60 -- POL Icon (lets you walk through NPCs/PCs)
-- 0x80 -- GM mode
-- 0xA0 -- GM mode
-- 0xC0 -- GM mode
-- 0xE0 -- SGM mode
-- No statuses differentiate based on 0x10
-- Bit 0x20 + 0x40 makes 0x60, which is different.
-- Bit 0x80 overpowers those bits
-- Bit 0x80 combines with 0x04 and 0x02 to make SGM.
-- These are basically flags, but they can be combined to mean different things sometimes.
_flags3:
-- 0x10 -- No obvious effect
-- 0x20 -- Event mode? Can't activate the targeting cursor but can still spin the camera
-- 0x40 -- No obvious effect
-- 0x80 -- Invisible model
_flags4:
-- 0x02 -- No obvious effect
-- 0x04 -- No obvious effect
-- 0x08 -- No obvious effect
-- 0x10 -- No obvious effect
-- 0x20 -- Bazaar icon
-- 0x40 -- Event status again? Can't activate the targeting cursor but can move the camera.
-- 0x80 -- No obvious effects
_flags5:
-- 0x01 -- No obvious effect
-- 0x02 -- No obvious effect
-- 0x04 -- Autoinvite icon
_flags6:
-- 0x08 -- Terror flag
-- 0x10 -- No obvious effect
PvP stuff:
-- 0x0020 -- No obvious effect
-- 0x0040 -- San d'Oria ballista flag
-- 0x0060 -- Bastok ballista flag
-- 0x0080 -- Windurst Ballista flag
-- 0x00A0 -- Wyverns team icon
-- 0x00C0 -- Gryphons team icon
-- 0x0100 -- Belligerency icon (used in monstrosity)
-- 0x0200 -- Has some effect
-- 0x0400 -- Pankration red icon
-- 0x0420 -- Pankration blue icon
-- 0x0800 -- and I still don't D:<
-- 0x1000 -- and I still don't D:<
_flags7:
-- 0x0020 -- No obvious effect
-- 0x0040 -- Individually, this bit has no effect. When combined with 0x20, it prevents you from returning to a walking animation after you stop (sliding along the ground while bound)
-- 0x0080 -- No obvious effect
-- 0x0100 -- Request icon
-- 0x0200 -- Trial Account emblem
-- 0x0400 -- Sneak Effect
-- 0x0800 -- New Adventurer icon
-- 0x1000 -- Mentor icon
]]
fields.incoming[0x037] = L{
{ctype='unsigned char[32]', label='Buff', fn=buff}, -- 04
{ctype='unsigned int', label='Player', fn=id}, -- 24
{ctype='unsigned short', label='_flags1'}, -- 28 Called "Flags" on the old dev wiki. Second byte might not be part of the flags, actually.
{ctype='unsigned char', label='HP %', fn=percent}, -- 2A
{ctype='bit[8]', label='_flags2'}, -- 2B
{ctype='bit[12]', label='Movement Speed/2'}, -- 2C Player movement speed
{ctype='bit[4]', label='_flags3'}, -- 2D
{ctype='bit[9]', label='Yalms per step'}, -- 2E Determines how quickly your animation walks
{ctype='bit[7]', label='_flags4'}, -- 2F
{ctype='unsigned char', label='Status', fn=statuses}, -- 30
{ctype='unsigned char', label='LS Color Red'}, -- 31
{ctype='unsigned char', label='LS Color Green'}, -- 32
{ctype='unsigned char', label='LS Color Blue'}, -- 33
{ctype='bit[3]', label='_flags5'}, -- 34
{ctype='bit[16]', label='Pet Index', fn=index}, -- 34 From 0x08 of byte 0x34 to 0x04 of byte 0x36
{ctype='bit[2]', label='_flags6'}, -- 36
{ctype='bit[9]', label='PvP Stuff'}, -- 36 Ballista flags here also makes appear the score, but it is probably modified in a ballista specific packet.
{ctype='bit[8]', label='_flags7'}, -- 37
{ctype='bit[26]', label='_unknown1'}, -- 38 No obvious effect from any of these
{ctype='unsigned int', label='Time offset?', fn=time}, -- 3C For me, this is the number of seconds in 66 hours
{ctype='unsigned int', label='Timestamp', fn=time}, -- 40 This is 32 years off of JST at the time the packet is sent.
{ctype='unsigned short', label='Costume'}, -- 44 ID of the Model
{ctype='data[2]', label='_unknown3'}, -- 46
{ctype='unsigned short', label='Fellow Index', fn=index}, -- 48
{ctype='unsigned char', label='Fishing Start Animation'}, -- 4A mostly 0x0D value and sometimes 0x0C observed
{ctype='data[1]', label='_unknown4'}, -- 4B
{ctype='data[8]', label='Bit Mask'}, -- 4C
{ctype='unsigned short', label='Monstrosity Species'}, -- 54 High bit is always set while in monstrosity and determines the display of the third name
{ctype='unsigned char', label='Monstrosity Name 1'}, -- 56
{ctype='unsigned char', label='Monstrosity Name 2'}, -- 57
{ctype='bit[7]', label='Indi Buff', fn=e+{'indi'}}, -- 58
{ctype='boolbit', label='Job Master Flag'}, -- 58
{ctype='unsigned char', label='Face Flags'}, -- 59
{ctype='unsigned char', label='_unknown5'}, -- 5A
{ctype='unsigned char', label='Mount'}, -- 5B Related to Mounts, seems to be mount id + 1, except for chocobo. The value doesn't get zeroed after dismount
{ctype='boolbit', label='Wardrobe 3'}, -- 5C
{ctype='boolbit', label='Wardrobe 4'}, -- 5C
{ctype='bit[6]', label='_flags8'}, -- 5C
{ctype='data[3]', label='_junk1'}, -- 5D
}
-- Entity Animation
-- Most frequently used for spawning ("deru") and despawning ("kesu")
-- Another example: "sp00" for Selh'teus making his spear of light appear
fields.incoming[0x038] = L{
{ctype='unsigned int', label='Mob', fn=id}, -- 04
{ctype='unsigned int', label='_dupeMob', fn=id}, -- 08
{ctype='char[4]', label='Type', fn=e+{0x038}}, -- 0C Four character animation name
{ctype='unsigned short', label='Mob Index', fn=index}, -- 10
{ctype='unsigned short', label='_dupeMob Index', fn=index}, -- 12
}
-- Env. Animation
-- Animations without entities will have zeroes for ID and Index
-- Example without IDs: Runic Gate/Runic Portal
-- Example with IDs: Diabolos floor tiles
fields.incoming[0x039] = L{
{ctype='unsigned int', label='ID', fn=id}, -- 04
{ctype='unsigned int', label='_dupeID', fn=id}, -- 08
{ctype='char[4]', label='Type', fn=e+{0x038}}, -- 0C Four character animation name
{ctype='unsigned short', label='Index', fn=index}, -- 10
{ctype='unsigned short', label='_dupeIndex', fn=index}, -- 10
}
-- Independent Animation
-- This is sometimes sent along with an Action Message packet, to provide an animation for an action message.
fields.incoming[0x03A] = L{
{ctype='unsigned int', label='Actor ID', fn=id}, -- 04
{ctype='unsigned int', label='Target ID', fn=id}, -- 08
{ctype='unsigned short', label='Actor Index', fn=index}, -- 0C
{ctype='unsigned short', label='Target Index', fn=index}, -- 0E
{ctype='unsigned short', label='Animation ID'}, -- 10
{ctype='unsigned char', label='Animation type'}, -- 12 0 = magic, 1 = item, 2 = JA, 3 = environmental animations, etc.
{ctype='unsigned char', label='_junk1'}, -- 13 Deleting this has no effect
}
types.shop_item = L{
{ctype='unsigned int', label='Price', fn=gil}, -- 00
{ctype='unsigned short', label='Item', fn=item}, -- 04
{ctype='unsigned short', label='Shop Slot'}, -- 08
{ctype='unsigned short', label='Craft Skill'}, -- 0A Zero on normal shops, has values that correlate to res\skills.
{ctype='unsigned short', label='Craft Rank'}, -- 0C Correlates to Rank able to purchase product from GuildNPC
}
-- Shop
fields.incoming[0x03C] = L{
{ctype='unsigned short', label='_zero1', const=0x0000}, -- 04
{ctype='unsigned short', label='_padding1'}, -- 06
{ref=types.shop_item, label='Item', count='*'}, -- 08 - *
}
-- Price/sale response
-- Sent in response to an outgoing price request for an NPC vendor (0x085), and in response to player finalizing a sale.
fields.incoming[0x03D] = L{
{ctype='unsigned int', label='Price', fn=gil}, -- 04
{ctype='unsigned char', label='Inventory Index', fn=inv+{0}}, -- 08
{ctype='unsigned char', label='Type'}, -- 09 0 = on price check, 1 = when sale is finalized
{ctype='unsigned short', label='_junk1'}, -- 0A
{ctype='unsigned int', label='Count'}, -- 0C Will be 1 on price check
}
-- Open Buy/Sell
fields.incoming[0x03E] = L{
{ctype='unsigned char', label='type'}, -- 04 Only 0x04 observed so far
{ctype='data[3]', label='_junk1'}, -- 05
}
types.blacklist_entry = L{
{ctype='unsigned int', label='ID'}, -- 00
{ctype='char[16]', label='Name'}, -- 04
}
-- Shop Buy Response
fields.incoming[0x03F] = L{
{ctype='unsigned short', label='Shop Slot'}, -- 04
{ctype='unsigned short', label='_unknown1'}, -- 06 First byte always seems to be 1, second byte varies between 0 and 1? Unclear correlation to anything.
{ctype='unsigned int', label='Count'}, -- 08
}
-- Blacklist
fields.incoming[0x041] = L{
{ref=types.blacklist_entry, count=12}, -- 08
{ctype='unsigned char', label='_unknown3', const=3}, -- F4 Always 3
{ctype='unsigned char', label='Size'}, -- F5 Blacklist entries
}
-- Blacklist (add/delete)
fields.incoming[0x042] = L{
{ctype='int', label='_unknown1'}, -- 04 Looks like a player ID, but does not match the sender or the receiver.
{ctype='char[16]', label='Name'}, -- 08 Character name
{ctype='bool', label='Add/Remove'}, -- 18 0 = add, 1 = remove
{ctype='data[3]', label='_unknown2'}, -- 19 Values observed on adding but not deleting.
}
-- Pet Stat
-- This packet varies and is indexed by job ID (byte 4)
-- Packet 0x044 is sent twice in sequence when stats could change. This can be caused by anything from
-- using a Maneuver on PUP to changing job. The two packets are the same length. The first
-- contains information about your main job. The second contains information about your
-- subjob and has the Subjob flag flipped.
func.incoming[0x044] = {}
fields.incoming[0x044] = function(data, type)
return func.incoming[0x044].base + (func.incoming[0x044][type or data:byte(5)] or L{})
end
-- Base, shared by all jobs
func.incoming[0x044].base = L{
{ctype='unsigned char', label='Job', fn=job}, -- 04
{ctype='bool', label='Subjob'}, -- 05
{ctype='unsigned short', label='_unknown1'}, -- 06
}
-- PUP
func.incoming[0x044][0x12] = L{
{ctype='unsigned char', label='Automaton Head'}, -- 08 Harlequinn 1, Valoredge 2, Sharpshot 3, Stormwaker 4, Soulsoother 5, Spiritreaver 6
{ctype='unsigned char', label='Automaton Frame'}, -- 09 Harlequinn 20, Valoredge 21, Sharpshot 22, Stormwaker 23
{ctype='unsigned char', label='Slot 1'}, -- 0A Attachment assignments are based off their position in the equipment list.
{ctype='unsigned char', label='Slot 2'}, -- 0B Strobe is 01, etc.
{ctype='unsigned char', label='Slot 3'}, -- 0C
{ctype='unsigned char', label='Slot 4'}, -- 0D
{ctype='unsigned char', label='Slot 5'}, -- 0E
{ctype='unsigned char', label='Slot 6'}, -- 0F
{ctype='unsigned char', label='Slot 7'}, -- 10
{ctype='unsigned char', label='Slot 8'}, -- 11
{ctype='unsigned char', label='Slot 9'}, -- 12
{ctype='unsigned char', label='Slot 10'}, -- 13
{ctype='unsigned char', label='Slot 11'}, -- 14
{ctype='unsigned char', label='Slot 12'}, -- 15
{ctype='unsigned short', label='_unknown2'}, -- 16
{ctype='unsigned int', label='Available Heads'}, -- 18 Flags for the available heads (Position corresponds to Item ID shifted down by 8192)
{ctype='unsigned int', label='Available Bodies'}, -- 1C Flags for the available bodies (Position corresponds to Item ID)
{ctype='unsigned int', label='_unknown3'}, -- 20
{ctype='unsigned int', label='_unknown4'}, -- 24
{ctype='unsigned int', label='_unknown5'}, -- 28
{ctype='unsigned int', label='_unknown6'}, -- 2C
{ctype='unsigned int', label='_unknown7'}, -- 30
{ctype='unsigned int', label='_unknown8'}, -- 34
{ctype='unsigned int', label='Fire Attachments'}, -- 38 Flags for the available Fire Attachments (Position corresponds to Item ID)
{ctype='unsigned int', label='Ice Attachments'}, -- 3C Flags for the available Ice Attachments (Position corresponds to Item ID)
{ctype='unsigned int', label='Wind Attachments'}, -- 40 Flags for the available Wind Attachments (Position corresponds to Item ID)
{ctype='unsigned int', label='Earth Attachments'}, -- 44 Flags for the available Earth Attachments (Position corresponds to Item ID)
{ctype='unsigned int', label='Thunder Attachments'}, -- 48 Flags for the available Thunder Attachments (Position corresponds to Item ID)
{ctype='unsigned int', label='Water Attachments'}, -- 4C Flags for the available Water Attachments (Position corresponds to Item ID)
{ctype='unsigned int', label='Light Attachments'}, -- 50 Flags for the available Light Attachments (Position corresponds to Item ID)
{ctype='unsigned int', label='Dark Attachments'}, -- 54 Flags for the available Dark Attachments (Position corresponds to Item ID)
{ctype='char[16]', label='Pet Name'}, -- 58
{ctype='unsigned short', label='Current HP'}, -- 68
{ctype='unsigned short', label='Max HP'}, -- 6A
{ctype='unsigned short', label='Current MP'}, -- 6C
{ctype='unsigned short', label='Max MP'}, -- 6E
{ctype='unsigned short', label='Current Melee Skill'}, -- 70
{ctype='unsigned short', label='Max Melee Skill'}, -- 72
{ctype='unsigned short', label='Current Ranged Skill'}, -- 74
{ctype='unsigned short', label='Max Ranged Skill'}, -- 76
{ctype='unsigned short', label='Current Magic Skill'}, -- 78
{ctype='unsigned short', label='Max Magic Skill'}, -- 7A
{ctype='unsigned int', label='_unknown9'}, -- 7C
{ctype='unsigned short', label='Base STR'}, -- 80
{ctype='unsigned short', label='Additional STR'}, -- 82
{ctype='unsigned short', label='Base DEX'}, -- 84
{ctype='unsigned short', label='Additional DEX'}, -- 86
{ctype='unsigned short', label='Base VIT'}, -- 88
{ctype='unsigned short', label='Additional VIT'}, -- 8A
{ctype='unsigned short', label='Base AGI'}, -- 8C
{ctype='unsigned short', label='Additional AGI'}, -- 8E
{ctype='unsigned short', label='Base INT'}, -- 90
{ctype='unsigned short', label='Additional INT'}, -- 92
{ctype='unsigned short', label='Base MND'}, -- 94
{ctype='unsigned short', label='Additional MND'}, -- 96
{ctype='unsigned short', label='Base CHR'}, -- 98
{ctype='unsigned short', label='Additional CHR'}, -- 9A
}
-- For BLM, 0x29 to 0x43 appear to represent the black magic that you know
-- MON
func.incoming[0x044][0x17] = L{
{ctype='unsigned short', label='Species'}, -- 08
{ctype='unsigned short', label='_unknown2'}, -- 0A
{ctype='unsigned short[12]',label='Instinct'}, -- 0C Instinct assignments are based off their position in the equipment list.
{ctype='unsigned char', label='Monstrosity Name 1'}, -- 24
{ctype='unsigned char', label='Monstrosity Name 2'}, -- 25
{ctype='data[118]', label='_unknown3'}, -- 26 Zeroing everything beyond this point has no notable effect.
}
-- Translate Response
fields.incoming[0x047] = L{
{ctype='unsigned short', label='Autotranslate Code'}, -- 04 In a 6 byte autotranslate code, these are the 5th and 4 bytes respectively.
{ctype='unsigned char', label='Starting Language'}, -- 06 0 == JP, 1 == EN
{ctype='unsigned char', label='Ending Language'}, -- 07 0 == JP, 1 == EN
{ctype='char[64]', label='Initial Phrase'}, -- 08
{ctype='char[64]', label='Translated Phrase'}, -- 48 Will be 00'd if no match was found.
}
-- Unknown 0x048 incoming :: Sent when loading linkshell information from the Linkshell Concierge
-- One per entry, 128 bytes long, mostly empty, does not contain name as far as I can see.
-- Likely contributes to that information.
-- Delivery Item
func.incoming[0x04B] = {}
fields.incoming[0x04B] = function()
local full = S{0x01, 0x04, 0x06, 0x08, 0x0A} -- This might not catch all packets with 'slot-info' (extra 68 bytes)
return function(data, type)
return full:contains(type or data:byte(5)) and func.incoming[0x04B].slot or func.incoming[0x04B].base
end
end()
enums.delivery = {
-- Seems to occur when refreshing the d-box after any change (or before changes).
[0x01] = 'Slot info',
-- Seems to occur when placing items into the d-box.
[0x02] = 'Place item',
-- Two occur per item that is actually sent (hitting "OK" to send).
[0x03] = 'Send confirm',
-- Two occur per sent item that is Canceled.
[0x04] = 'Send cancel',
-- Seems to occur quasi-randomly. Can be seen following spells.
[0x05] = 'Unknown 0x05',
-- Occurs for new items.
-- Two of these are sent sequentially. The first one doesn't seem to contain much/any
-- information and the second one is very similar to a type 0x01 packet
-- First packet's frst line: 4B 58 xx xx 06 01 00 01 FF FF FF FF 02 02 FF FF
-- Second packet's first line: 4B 58 xx xx 06 01 00 FF FF FF FF FF 01 02 FF FF
[0x06] = 'New item',
-- Occurs as the first packet when removing something from the send box.
[0x07] = 'Remove item (send)',
-- Occurs as the first packet when removing or dropping something from the delivery box.
[0x08] = 'Remove/drop item (delivery)',
-- Occurs when someone returns something from the delivery box.
[0x09] = 'Return item',
-- Occurs as the second packet when removing something from the delivery box or send box.
[0x0A] = 'Remove item confirm',
-- Occurs as the second packet when dropping something from the delivery box.
[0x0B] = 'Drop item (delivery)',
-- Sent after entering a name and hitting "OK" in the outbox.
[0x0C] = 'Send request',
-- Sent after requesting the send box, causes the client to open the send box dialogue.
[0x0D] = 'Send dialogue start',
-- Sent after requesting the delivery box, causes the client to open the delivery box dialogue.
[0x0E] = 'Delivery dialogue start',
-- Sent after closing the delivery box or send box.
[0x0F] = 'Delivery/send dialogue finish',
}
-- This is always sent for every packet of this ID
func.incoming[0x04B].base = L{
{ctype='unsigned char', label='Type', fn=e+{'delivery'}}, -- 04
{ctype='unsigned char', label='_unknown1'}, -- 05 FF if Type is 05, otherwise 01
{ctype='signed char', label='Delivery Slot'}, -- 06 This goes left to right and then drops down a row and left to right again. Value is 00 through 07
-- 01 if Type is 06, otherwise FF
-- 06 Type always seems to come in a pair, this field is only 01 for the first packet
{ctype='signed char', label='_unknown2'}, -- 07 Always FF FF FF FF?
{ctype='signed int', label='_unknown3', const=-1}, -- 0C When in a 0x0D/0x0E type, 01 grants request to open inbox/outbox. With FA you get "Please try again later"
{ctype='signed char', label='_unknown4'}, -- 0D 02 and 03 observed
{ctype='signed char', label='Packet Number'}, -- 0E FF FF observed
{ctype='signed char', label='_unknown5'}, -- 0F FF FF observed
{ctype='signed char', label='_unknown6'}, -- 10 06 00 00 00 and 07 00 00 00 observed - (06 was for the first packet and 07 was for the second)
{ctype='unsigned int', label='_unknown7'}, -- 10 00 00 00 00 also observed
}
-- If the type is 0x01, 0x04, 0x06, 0x08 or 0x0A, these fields appear in the packet in addition to the base. Maybe more
func.incoming[0x04B].slot = L{
{ref=func.incoming[0x04B].base, count=1}, -- 04
{ctype='char[16]', label='Player Name'}, -- 14 This is used for sender (in inbox) and recipient (in outbox)
{ctype='unsigned int', label='_unknown8'}, -- 24 46 32 00 00 and 42 32 00 00 observed - Possibly flags. Rare vs. Rare/Ex.?
{ctype='unsigned int', label='Timestamp', fn=utime}, -- 28
{ctype='unsigned int', label='_unknown9'}, -- 2C 00 00 00 00 observed
{ctype='unsigned short', label='Item', fn=item}, -- 30
{ctype='unsigned short', label='_unknown10'}, -- 32 Fiendish Tome: Chapter 11 had it, but Oneiros Pebble was just 00 00
-- 32 May well be junked, 38 38 observed
{ctype='unsigned int', label='Flags?'}, -- 34 01/04 00 00 00 observed
{ctype='unsigned short', label='Count'}, -- 38
{ctype='unsigned short', label='_unknown11'}, -- 3A
{ctype='data[28]', label='_unknown12'}, -- 3C All 00 observed, ext data? Doesn't seem to be the case, but same size
}
enums['ah itype'] = {
[0x02] = 'Open menu response',
[0x03] = 'Unknown Logout',
[0x04] = 'Sell item confirmation',
[0x05] = 'Open sales status menu',
[0x0A] = 'Open menu confirmation',
[0x0B] = 'Sell item confirmation',
[0x0D] = 'Sales item status',
[0x0E] = 'Purchase item result',
}
func.incoming[0x04C] = {}
func.incoming[0x04C].base = L{
{ctype='unsigned char', label='Type', fn=e+{'ah itype'}}, -- 04
}
func.incoming[0x04C][0x02] = L{
{ctype='unsigned char', label='_unknown1', const=0xFF}, -- 05
{ctype='unsigned char', label='Success', fn=bool}, -- 06
{ctype='unsigned char', label='_unknown2', const=0x00}, -- 07
{ctype='char*', label='_junk'}, -- 08
}
-- Sent when initating logout
func.incoming[0x04C][0x03] = L{
{ctype='unsigned char', label='_unknown1', const=0xFF}, -- 05
{ctype='unsigned char', label='Success', fn=bool}, -- 06
{ctype='unsigned char', label='_unknown2', const=0x00}, -- 07
{ctype='char*', label='_junk'}, -- 08
}
func.incoming[0x04C][0x04] = L{
{ctype='unsigned char', label='_unknown1', const=0xFF}, -- 05
{ctype='unsigned char', label='Success', fn=bool}, -- 06
{ctype='unsigned char', label='_unknown2'}, -- 07
{ctype='unsigned int', label='Fee', fn=gil}, -- 08
{ctype='unsigned short', label='Inventory Index', fn=inv+{0}}, -- 0C
{ctype='unsigned short', label='Item', fn=item}, -- 0E
{ctype='unsigned char', label='Stack', fn=invbool}, -- 10
{ctype='char*', label='_junk'}, -- 11
}
func.incoming[0x04C][0x05] = L{
{ctype='unsigned char', label='_unknown1', const=0xFF}, -- 05
{ctype='unsigned char', label='Success', fn=bool}, -- 06
{ctype='unsigned char', label='_unknown2', const=0x00}, -- 07
{ctype='char*', label='_junk'}, -- 08
}
enums['sale stat'] = {
[0x00] = '-',
[0x02] = 'Placing',
[0x03] = 'On auction',
[0x0A] = 'Sold',
[0x0B] = 'Not sold',
[0x10] = 'Checking',
}
enums['buy stat'] = {
[0x01] = 'Success',
[0x02] = 'Placing',
[0xC5] = 'Failed',
[0xE5] = 'Cannot Bid'
}
-- 0x0A, 0x0B and 0x0D could probably be combined, the fields seem the same.
-- However, they're populated a bit differently. Both 0x0B and 0x0D are sent twice
-- on action completion, the second seems to contain updated information.
func.incoming[0x04C][0x0A] = L{
{ctype='unsigned char', label='Slot'}, -- 05
{ctype='unsigned char', label='_unknown1', const=0x01}, -- 06
{ctype='unsigned char', label='_unknown2', const=0x00}, -- 07
{ctype='data[12]', label='_junk1'}, -- 08
{ctype='unsigned char', label='Sale status', fn=e+{'sale stat'}},-- 14
{ctype='unsigned char', label='_unknown3'}, -- 15
{ctype='unsigned char', label='Inventory Index'}, -- 16 From when the item was put on auction
{ctype='unsigned char', label='_unknown4', const=0x00}, -- 17 Possibly padding
{ctype='char[16]', label='Name'}, -- 18 Seems to always be the player's name
{ctype='unsigned short', label='Item', fn=item}, -- 28
{ctype='unsigned char', label='Count'}, -- 2A
{ctype='unsigned char', label='AH Category'}, -- 2B
{ctype='unsigned int', label='Price', fn=gil}, -- 2C
{ctype='unsigned int', label='_unknown6'}, -- 30
{ctype='unsigned int', label='_unknown7'}, -- 34
{ctype='unsigned int', label='Timestamp', fn=utime}, -- 38
}
func.incoming[0x04C][0x0B] = L{
{ctype='unsigned char', label='Slot'}, -- 05
{ctype='unsigned char', label='_unknown1'}, -- 06 This packet, like 0x0D, is sent twice, the first one always has 0x02 here, the second one 0x01
{ctype='unsigned char', label='_unknown2', const=0x00}, -- 07
{ctype='data[12]', label='_junk1'}, -- 08
{ctype='unsigned char', label='Sale status', fn=e+{'sale stat'}},-- 14
{ctype='unsigned char', label='_unknown3'}, -- 15
{ctype='unsigned char', label='Inventory Index'}, -- 16 From when the item was put on auction
{ctype='unsigned char', label='_unknown4', const=0x00}, -- 17 Possibly padding
{ctype='char[16]', label='Name'}, -- 18 Seems to always be the player's name
{ctype='unsigned short', label='Item', fn=item}, -- 28
{ctype='unsigned char', label='Count'}, -- 2A
{ctype='unsigned char', label='AH Category'}, -- 2B
{ctype='unsigned int', label='Price', fn=gil}, -- 2C
{ctype='unsigned int', label='_unknown6'}, -- 30 Only populated in the second packet
{ctype='unsigned int', label='_unknown7'}, -- 34 Only populated in the second packet
{ctype='unsigned int', label='Timestamp', fn=utime}, -- 38
}
func.incoming[0x04C][0x0D] = L{
{ctype='unsigned char', label='Slot'}, -- 05
{ctype='unsigned char', label='_unknown1'}, -- 06 Some sort of type... the packet seems to always be sent twice, once with this value as 0x02, followed by 0x01
{ctype='unsigned char', label='_unknown2'}, -- 07 If 0x06 is 0x01 this seems to be 0x01 as well, otherwise 0x00
{ctype='data[12]', label='_junk1'}, -- 08
{ctype='unsigned char', label='Sale status', fn=e+{'sale stat'}},-- 14
{ctype='unsigned char', label='_unknown3'}, -- 15
{ctype='unsigned char', label='Inventory Index'}, -- 16 From when the item was put on auction
{ctype='unsigned char', label='_unknown4', const=0x00}, -- 17 Possibly padding
{ctype='char[16]', label='Name'}, -- 18 Seems to always be the player's name
{ctype='unsigned short', label='Item', fn=item}, -- 28
{ctype='unsigned char', label='Count'}, -- 2A
{ctype='unsigned char', label='AH Category'}, -- 2B
{ctype='unsigned int', label='Price', fn=gil}, -- 2C
{ctype='unsigned int', label='_unknown6'}, -- 30
{ctype='unsigned int', label='_unknown7'}, -- 34
{ctype='unsigned int', label='Timestamp', fn=utime}, -- 38
}
func.incoming[0x04C][0x0E] = L{
{ctype='unsigned char', label='_unknown1'}, -- 05
{ctype='unsigned char', label='Buy Status', fn=e+{'buy stat'}}, -- 06
{ctype='unsigned char', label='_unknown2'}, -- 07
{ctype='unsigned int', label='Price', fn=gil}, -- 08
{ctype='unsigned short', label='Item ID', fn=item}, -- 0C
{ctype='unsigned short', label='_unknown3'}, -- 0E
{ctype='unsigned short', label='Count'}, -- 10
{ctype='unsigned int', label='_unknown4'}, -- 12
{ctype='unsigned short', label='_unknown5'}, -- 16
{ctype='char[16]', label='Name'}, -- 18 Character name (pending buy only)
{ctype='unsigned short', label='Pending Item ID', fn=item}, -- 28 Only filled out during pending packets
{ctype='unsigned short', label='Pending Count'}, -- 2A Only filled out during pending packets
{ctype='unsigned int', label='Pending Price', fn=gil}, -- 2C Only filled out during pending packets
{ctype='unsigned int', label='_unknown6'}, -- 30
{ctype='unsigned int', label='_unknown7'}, -- 34
{ctype='unsigned int', label='Timestamp', fn=utime}, -- 38 Only filled out during pending packets
}
func.incoming[0x04C][0x10] = L{
{ctype='unsigned char', label='_unknown1', const=0x00}, -- 05
{ctype='unsigned char', label='Success', fn=bool}, -- 06
{ctype='unsigned char', label='_unknown2', const=0x00}, -- 07
{ctype='char*', label='_junk'}, -- 08
}
-- Auction Interaction
-- All types in here are server responses to the equivalent type in 0x04E
-- The only exception is type 0x02, which is sent to initiate the AH menu
fields.incoming[0x04C] = function()
local fields = func.incoming[0x04C]
return function(data, type)
return fields.base + (fields[type or data:byte(5)] or L{})
end
end()
-- Servmes Resp
-- Length of the packet may vary based on message length? Kind of hard to test.
-- The server message appears to generate some kind of feedback to the server based on the flags?
-- If you set the first byte to 0 in incoming chunk with eval and do /smes, the message will not display until you unload eval.
fields.incoming[0x4D] = L{
{ctype='unsigned char', label='_unknown1'}, -- 04 01 Message does not appear without this
{ctype='unsigned char', label='_unknown2'}, -- 05 01 Nonessential to message appearance
{ctype='unsigned char', label='_unknown3'}, -- 06 01 Message does not appear without this
{ctype='unsigned char', label='_unknown4'}, -- 07 02 Message does not appear without this
{ctype='unsigned int', label='Timestamp', fn=time}, -- 08 UTC Timestamp
{ctype='unsigned int', label='Message Length 1'}, -- 0A Number of characters in the message
{ctype='unsigned int', label='_unknown2'}, -- 10 00 00 00 00 observed
{ctype='unsigned int', label='Message Length 2'}, -- 14 Same as Message Length 1. Not sure why this needs to be an int or in here twice.
{ctype='char*', label='Message'}, -- 18 Currently prefixed with 0x81, 0xA1 - A custom shift-jis character that translates to a square.
}
-- Data Download 2
fields.incoming[0x04F] = L{
-- This packet's contents are nonessential. They are often leftovers from other outgoing
-- packets. It is common to see things like inventory size, equipment information, and
-- character ID in this packet. They do not appear to be meaningful and the client functions
-- normally even if they are blocked.
-- Tends to bookend model change packets (0x51), though blocking it, zeroing it, etc. affects nothing.
{ctype='unsigned int', label='_unknown1'}, -- 04
}
-- Equip
fields.incoming[0x050] = L{
{ctype='unsigned char', label='Inventory Index', fn=invp+{0x06}}, -- 04
{ctype='unsigned char', label='Equipment Slot', fn=slot}, -- 05
{ctype='unsigned char', label='Inventory Bag', fn=bag}, -- 06
{ctype='data[1]', label='_junk1'} -- 07
}
-- Model Change
fields.incoming[0x051] = L{
{ctype='unsigned char', label='Face'}, -- 04
{ctype='unsigned char', label='Race'}, -- 05
{ctype='unsigned short', label='Head'}, -- 06
{ctype='unsigned short', label='Body'}, -- 08
{ctype='unsigned short', label='Hands'}, -- 0A
{ctype='unsigned short', label='Legs'}, -- 0C
{ctype='unsigned short', label='Feet'}, -- 0E
{ctype='unsigned short', label='Main'}, -- 10
{ctype='unsigned short', label='Sub'}, -- 12
{ctype='unsigned short', label='Ranged'}, -- 14
{ctype='unsigned short', label='_unknown1'}, -- 16 May varying meaningfully, but it's unclear
}
enums[0x052] = {
[0x00] = 'Standard',
[0x01] = 'Event',
[0x02] = 'Event Skipped',
[0x03] = 'String Event',
[0x04] = 'Fishing',
}
func.incoming[0x052] = {}
func.incoming[0x052].base = L{
{ctype='unsigned char', label='Type', fn=e+{0x052}}, -- 04
}
func.incoming[0x052][0x02] = L{
{ctype='unsigned short', label='Menu ID'}, -- 05
}
-- NPC Release
fields.incoming[0x052] = function(data, type)
return func.incoming[0x052].base + (func.incoming[0x052][type or data:byte(5)] or L{})
end
-- Logout Time
-- This packet is likely used for an entire class of system messages,
-- but the only one commonly encountered is the logout counter.
fields.incoming[0x053] = L{
{ctype='unsigned int', label='param'}, -- 04 Parameter
{ctype='unsigned int', label='_unknown1'}, -- 08 00 00 00 00 observed
{ctype='unsigned short', label='Message ID'}, -- 0C It is unclear which dialogue table this corresponds to
{ctype='unsigned short', label='_unknown2'}, -- 0E Probably junk.
}
-- Key Item Log
fields.incoming[0x055] = L{
-- There are 6 of these packets sent on zone, which likely corresponds to the 6 categories of key items.
-- FFing these packets between bytes 0x14 and 0x82 gives you access to all (or almost all) key items.
{ctype='data[0x40]', label='Key item available', fn=hex+{0x40}}, -- 04
{ctype='data[0x40]', label='Key item examined', fn=hex+{0x40}}, -- 44 Bit field correlating to the previous, 1 if KI has been examined, 0 otherwise
{ctype='unsigned int', label='Type'}, -- 84 Goes from 0 to 5, determines which KI are being sent
}
enums.quest_mission_log = {
[0x0030] = 'Completed Campaign Missions',
[0x0038] = 'Completed Campaign Missions (2)', -- Starts at index 256
[0x0050] = 'Current San d\'Oria Quests',
[0x0058] = 'Current Bastok Quests',
[0x0060] = 'Current Windurst Quests',
[0x0068] = 'Current Jeuno Quests',
[0x0070] = 'Current Other Quests',
[0x0078] = 'Current Outlands Quests',
[0x0080] = 'Current TOAU Quests and Missions (TOAU, WOTG, Assault, Campaign)',
[0x0088] = 'Current WOTG Quests',
[0x0090] = 'Completed San d\'Oria Quests',
[0x0098] = 'Completed Bastok Quests',
[0x00A0] = 'Completed Windurst Quests',
[0x00A8] = 'Completed Jeuno Quests',
[0x00B0] = 'Completed Other Quests',
[0x00B8] = 'Completed Outlands Quests',
[0x00C0] = 'Completed TOAU Quests and Assaults',
[0x00C8] = 'Completed WOTG Quests',
[0x00D0] = 'Completed Missions (Nations, Zilart)',
[0x00D8] = 'Completed Missions (TOAU, WOTG)',
[0x00E0] = 'Current Abyssea Quests',
[0x00E8] = 'Completed Abyssea Quests',
[0x00F0] = 'Current Adoulin Quests',
[0x00F8] = 'Completed Adoulin Quests',
[0x0100] = 'Current Coalition Quests',
[0x0108] = 'Completed Coalition Quests',
[0xFFFF] = 'Current Missions',
}
-- There are 27 variations of this packet to populate different quest information.
-- Current quests, completed quests, and completed missions (where applicable) are represented by bit flags where the position
-- corresponds to the quest index in the respective DAT.
-- "Current Mission" fields refer to the mission ID, except COP, SOA, and ROV, which represent a mapping of some sort(?)
-- Additionally, COP, SOA, and ROV do not have a "completed" missions packet, they are instead updated with the current mission.
-- Quests will remain in your 'current' list after they are completed unless they are repeatable.
func.incoming[0x056] = {}
fields.incoming[0x056] = function (data, type)
return (func.incoming[0x056][type or data and data:unpack('H',0x25)] or L{{ctype='data[32]', label='Quest Flags'}}) + func.incoming[0x056].type
end
func.incoming[0x056].type = L{
{ctype='unsigned short',label='Type', fn=e+{'quest_mission_log'}} -- 24
}
func.incoming[0x056][0x0080] = L{
{ctype='data[16]', label='Current TOAU Quests'}, -- 04
{ctype='int', label='Current Assault Mission'}, -- 14
{ctype='int', label='Current TOAU Mission'}, -- 18
{ctype='int', label='Current WOTG Mission'}, -- 1C
{ctype='int', label='Current Campaign Mission'}, -- 20
}
func.incoming[0x056][0x00C0] = L{
{ctype='data[16]', label='Completed TOAU Quests'}, -- 04
{ctype='data[16]', label='Completed Assaults'}, -- 14
}
func.incoming[0x056][0x00D0] = L{
{ctype='data[8]', label='Completed San d\'Oria Missions'}, -- 04
{ctype='data[8]', label='Completed Bastok Missions'}, -- 0C
{ctype='data[8]', label='Completed Windurst Missions'}, -- 14
{ctype='data[8]', label='Completed Zilart Missions'}, -- 1C
}
func.incoming[0x056][0x00D8] = L{
{ctype='data[8]', label='Completed TOAU Missions'}, -- 04
{ctype='data[8]', label='Completed WOTG Missions'}, -- 0C
{ctype='data[16]', label='_junk'}, -- 14
}
func.incoming[0x056][0xFFFF] = L{
{ctype='int', label='Nation'}, -- 04
{ctype='int', label='Current Nation Mission'}, -- 08
{ctype='int', label='Current ROZ Mission'}, -- 0C
{ctype='int', label='Current COP Mission'}, -- 10 Doesn't correspond directly to DAT
{ctype='int', label='_unknown1'}, -- 14
{ctype='bit[4]', label='Current ACP Mission'}, -- 18 lower 4
{ctype='bit[4]', label='Current MKD Mission'}, -- 18 upper 4
{ctype='bit[4]', label='Current ASA Mission'}, -- 19 lower 4
{ctype='bit[4]', label='_junk1'}, -- 19 upper 4
{ctype='short', label='_junk2'}, -- 1A
{ctype='int', label='Current SOA Mission'}, -- 1C Doesn't correspond directly to DAT
{ctype='int', label='Current ROV Mission'}, -- 20 Doesn't correspond directly to DAT
}
-- Weather Change
fields.incoming[0x057] = L{
{ctype='unsigned int', label='Vanadiel Time', fn=vtime}, -- 04 Units of minutes.
{ctype='unsigned char', label='Weather', fn=weather}, -- 08
{ctype='unsigned char', label='_unknown1'}, -- 09
{ctype='unsigned short', label='_unknown2'}, -- 0A
}
enums.spawntype = {
[0x03] = 'Monster',
[0x00] = 'Casket or NPC',
[0x0A] = 'Self',
}
-- Assist Response
fields.incoming[0x058] = L{
{ctype='unsigned int', label='Player', fn=id}, -- 04
{ctype='unsigned int', label='Target', fn=id}, -- 08
{ctype='unsigned short', label='Player Index', fn=index}, -- 0C
}
-- Emote
fields.incoming[0x05A] = L{
{ctype='unsigned int', label='Player ID', fn=id}, -- 04
{ctype='unsigned int', label='Target ID', fn=id}, -- 08
{ctype='unsigned short', label='Player Index', fn=index}, -- 0C
{ctype='unsigned short', label='Target Index', fn=index}, -- 0E
{ctype='unsigned short', label='Emote', fn=emote}, -- 10
{ctype='unsigned short', label='_unknown1'}, -- 12
{ctype='unsigned short', label='_unknown2'}, -- 14
{ctype='unsigned char', label='Type'}, -- 16 2 for motion, 0 otherwise
{ctype='unsigned char', label='_unknown3'}, -- 17
{ctype='data[32]', label='_unknown4'}, -- 18
}
-- Spawn
fields.incoming[0x05B] = L{
{ctype='float', label='X'}, -- 04
{ctype='float', label='Z'}, -- 08
{ctype='float', label='Y'}, -- 0C
{ctype='unsigned int', label='ID', fn=id}, -- 10
{ctype='unsigned short', label='Index', fn=index}, -- 14
{ctype='unsigned char', label='Type', fn=e+{'spawntype'}},-- 16 3 for regular Monsters, 0 for Treasure Caskets and NPCs
{ctype='unsigned char', label='_unknown1'}, -- 17 Always 0 if Type is 3, otherwise a seemingly random non-zero number
{ctype='unsigned int', label='_unknown2'}, -- 18
}
-- Dialogue Information
fields.incoming[0x05C] = L{
{ctype='data[32]', label='Menu Parameters'}, -- 04 How information is packed in this region depends on the particular dialogue exchange.
}
-- Campaign/Besieged Map information
-- Bitpacked Campaign Info:
-- First Byte: Influence ranking including Beastmen
-- Second Byte: Influence ranking excluding Beastmen
-- Third Byte (bitpacked xxww bbss -- First two bits are for beastmen)
-- 0 = Minimal
-- 1 = Minor
-- 2 = Major
-- 3 = Dominant
-- Fourth Byte: Ownership (value)
-- 0 = Neutral
-- 1 = Sandy
-- 2 = Bastok
-- 3 = Windurst
-- 4 = Beastmen
-- 0xFF = Jeuno
-- Bitpacked Besieged Info:
-- Candescence Owners:
-- 0 = Whitegate
-- 1 = MMJ
-- 2 = Halvung
-- 3 = Arrapago
-- Orders:
-- 0 = Defend Al Zahbi
-- 1 = Intercept Enemy
-- 2 = Invade Enemy Base
-- 3 = Recover the Orb
-- Beastman Status
-- 0 = Training
-- 1 = Advancing
-- 2 = Attacking
-- 3 = Retreating
-- 4 = Defending
-- 5 = Preparing
-- Bitpacked region int (for the actual locations on the map, not the overview)
-- 3 Least Significant Bits -- Beastman Status for that region
-- 8 following bits -- Number of Forces
-- 4 following bits -- Level
-- 4 following bits -- Number of Archaic Mirrors
-- 4 following bits -- Number of Prisoners
-- 9 following bits -- No clear purpose
fields.incoming[0x05E] = L{
{ctype='unsigned char', label='Balance of Power'}, -- 04 Bitpacked: xxww bbss -- Unclear what the first two bits are for. Number stored is ranking (0-3)
{ctype='unsigned char', label='Alliance Indicator'}, -- 05 Indicates whether two nations are allied (always the bottom two).
{ctype='data[20]', label='_unknown1'}, -- 06 All Zeros, and changed nothing when 0xFF'd.
{ctype='unsigned int', label='Bitpacked Ronfaure Info'}, -- 1A
{ctype='unsigned int', label='Bitpacked Zulkheim Info'}, -- 1E
{ctype='unsigned int', label='Bitpacked Norvallen Info'}, -- 22
{ctype='unsigned int', label='Bitpacked Gustaberg Info'}, -- 26
{ctype='unsigned int', label='Bitpacked Derfland Info'}, -- 2A
{ctype='unsigned int', label='Bitpacked Sarutabaruta Info'}, -- 2E
{ctype='unsigned int', label='Bitpacked Kolshushu Info'}, -- 32
{ctype='unsigned int', label='Bitpacked Aragoneu Info'}, -- 36
{ctype='unsigned int', label='Bitpacked Fauregandi Info'}, -- 3A
{ctype='unsigned int', label='Bitpacked Valdeaunia Info'}, -- 3E
{ctype='unsigned int', label='Bitpacked Qufim Info'}, -- 42
{ctype='unsigned int', label="Bitpacked Li'Telor Info"}, -- 46
{ctype='unsigned int', label='Bitpacked Kuzotz Info'}, -- 4A
{ctype='unsigned int', label='Bitpacked Vollbow Info'}, -- 4E
{ctype='unsigned int', label='Bitpacked Elshimo Lowlands Info'}, -- 52
{ctype='unsigned int', label="Bitpacked Elshimo Uplands Info"}, -- 56
{ctype='unsigned int', label="Bitpacked Tu'Lia Info"}, -- 5A
{ctype='unsigned int', label='Bitpacked Movapolos Info'}, -- 5E
{ctype='unsigned int', label='Bitpacked Tavnazian Archipelago Info'}, -- 62
{ctype='data[32]', label='_unknown2'}, -- 66 All Zeros, and changed nothing when 0xFF'd.
{ctype='unsigned char', label="San d'Oria region bar"}, -- 86 These indicate how full the current region's bar is (in percent).
{ctype='unsigned char', label="Bastok region bar"}, -- 87
{ctype='unsigned char', label="Windurst region bar"}, -- 88
{ctype='unsigned char', label="San d'Oria region bar without beastmen"},-- 86 Unsure of the purpose of the without beastman indicators
{ctype='unsigned char', label="Bastok region bar without beastmen"}, -- 87
{ctype='unsigned char', label="Windurst region bar without beastmen"}, -- 88
{ctype='unsigned char', label="Days to tally"}, -- 8C Number of days to the next conquest tally
{ctype='data[3]', label="_unknown4"}, -- 8D All Zeros, and changed nothing when 0xFF'd.
{ctype='int', label='Conquest Points'}, -- 90
{ctype='unsigned char', label="Beastmen region bar"}, -- 94
{ctype='data[12]', label="_unknown5"}, -- 95 Mostly zeros and noticed no change when 0xFF'd.
-- These bytes are for the overview summary on the map.
-- The two least significant bits code for the owner of the Astral Candescence.
-- The next two bits indicate the current orders.
-- The four most significant bits indicate the MMJ level.
{ctype='unsigned char', label="MMJ Level, Orders, and AC"}, -- A0
-- Halvung is the 4 least significant bits.
-- Arrapago is the 4 most significant bits.
{ctype='unsigned char', label="Halvung and Arrapago Level"}, -- A1
{ctype='unsigned char', label="Beastman Status (1) "}, -- A2 The 3 LS bits are the MMJ Orders, next 3 bits are the Halvung Orders, top 2 bits are part of the Arrapago Orders
{ctype='unsigned char', label="Beastman Status (2) "}, -- A3 The Least Significant bit is the top bit of the Arrapago orders. Rest of the byte doesn't seem to do anything?
-- These bytes are for the individual stronghold displays. See above!
{ctype='unsigned int', label='Bitpacked MMJ Info'}, -- A4
{ctype='unsigned int', label='Bitpacked Halvung Info'}, -- A8
{ctype='unsigned int', label='Bitpacked Arrapago Info'}, -- AC
{ctype='int', label='Imperial Standing'}, -- B0
}
-- Music Change
fields.incoming[0x05F] = L{
{ctype='unsigned short', label='BGM Type'}, -- 04 01 = idle music, 06 = mog house music. 00, 02, and 03 are fight musics and some other stuff.
{ctype='unsigned short', label='Song ID'}, -- 06 See the setBGM addon for more information
}
-- Char Stats
fields.incoming[0x061] = L{
{ctype='unsigned int', label='Maximum HP'}, -- 04
{ctype='unsigned int', label='Maximum MP'}, -- 08
{ctype='unsigned char', label='Main Job', fn=job}, -- 0C
{ctype='unsigned char', label='Main Job Level'}, -- 0D
{ctype='unsigned char', label='Sub Job', fn=job}, -- 0E
{ctype='unsigned char', label='Sub Job Level'}, -- 0F
{ctype='unsigned short', label='Current EXP'}, -- 10
{ctype='unsigned short', label='Required EXP'}, -- 12
{ctype='unsigned short', label='Base STR'}, -- 14
{ctype='unsigned short', label='Base DEX'}, -- 16
{ctype='unsigned short', label='Base VIT'}, -- 18
{ctype='unsigned short', label='Base AGI'}, -- 1A
{ctype='unsigned short', label='Base INT'}, -- 1C
{ctype='unsigned short', label='Base MND'}, -- 1E
{ctype='unsigned short', label='Base CHR'}, -- 20
{ctype='signed short', label='Added STR'}, -- 22
{ctype='signed short', label='Added DEX'}, -- 24
{ctype='signed short', label='Added VIT'}, -- 26
{ctype='signed short', label='Added AGI'}, -- 28
{ctype='signed short', label='Added INT'}, -- 2A
{ctype='signed short', label='Added MND'}, -- 2C
{ctype='signed short', label='Added CHR'}, -- 2E
{ctype='unsigned short', label='Attack'}, -- 30
{ctype='unsigned short', label='Defense'}, -- 32
{ctype='signed short', label='Fire Resistance'}, -- 34
{ctype='signed short', label='Wind Resistance'}, -- 36
{ctype='signed short', label='Lightning Resistance'}, -- 38
{ctype='signed short', label='Light Resistance'}, -- 3A
{ctype='signed short', label='Ice Resistance'}, -- 3C
{ctype='signed short', label='Earth Resistance'}, -- 3E
{ctype='signed short', label='Water Resistance'}, -- 40
{ctype='signed short', label='Dark Resistance'}, -- 42
{ctype='unsigned short', label='Title', fn=title}, -- 44
{ctype='unsigned short', label='Nation rank'}, -- 46
{ctype='unsigned short', label='Rank points', fn=cap+{0xFFF}}, -- 48
{ctype='unsigned short', label='Home point', fn=zone}, -- 4A
{ctype='unsigned short', label='_unknown1'}, -- 4C 0xFF-ing this last region has no notable effect.
{ctype='unsigned short', label='_unknown2'}, -- 4E
{ctype='unsigned char', label='Nation'}, -- 50 0 = sandy, 1 = bastok, 2 = windy
{ctype='unsigned char', label='_unknown3'}, -- 51 Possibly Unity ID (always 7 for me, I'm in Aldo's unity)
{ctype='unsigned char', label='Su Level'}, -- 52
{ctype='unsigned char', label='_unknown4'}, -- 53 Always 00 for me
{ctype='unsigned char', label='Maximum iLevel'}, -- 54
{ctype='unsigned char', label='iLevel over 99'}, -- 55 0x10 would be an iLevel of 115
{ctype='unsigned char', label='Main Hand iLevel'}, -- 56
{ctype='unsigned char', label='_unknown5'}, -- 57 Always 00 for me
{ctype='bit[5]', label='Unity ID'}, -- 58 0=None, 1=Pieuje, 2=Ayame, 3=Invincible Shield, 4=Apururu, 5=Maat, 6=Aldo, 7=Jakoh Wahcondalo, 8=Naja Salaheem, 9=Flavira
{ctype='bit[5]', label='Unity Rank'}, -- 58 Danger, 00ing caused my client to crash
{ctype='bit[16]', label='Unity Points'}, -- 59
{ctype='bit[6]', label='_unknown6'}, -- 5A No obvious function
{ctype='unsigned int', label='_junk1'}, -- 5C
{ctype='unsigned int', label='_junk2'}, -- 60
{ctype='unsigned char', label='_unknown7'}, -- 64
{ctype='unsigned char', label='Master Level'}, -- 65
{ctype='boolbit', label='Master Breaker'}, -- 66
{ctype='bit[15]', label='_junk3'}, -- 66
{ctype='unsigned int', label='Current Exemplar Points'}, -- 68
{ctype='unsigned int', label='Required Exemplar Points'}, -- 6C
}
types.combat_skill = L{
{ctype='bit[15]', label='Level'}, -- 00
{ctype='boolbit', label='Capped'}, -- 01
}
types.craft_skill = L{
{ctype='bit[5]', label='Rank', fn=srank}, -- 00
{ctype='bit[10]', label='Level'}, -- 00
{ctype='boolbit', label='Capped'}, -- 01
}
-- Skills Update
fields.incoming[0x062] = L{
{ctype='char[124]', label='_junk1'},
{ref=types.combat_skill, lookup={res.skills,0x00}, count=0x30}, -- 80
{ref=types.craft_skill, lookup={res.skills,0x30}, count=0x0A}, -- E0
{ctype='unsigned short[6]', label='_junk2'}, -- F4
}
-- Set Update
-- This packet likely varies based on jobs, but currently I only have it worked out for Monstrosity.
-- It also appears in three chunks, so it's double-varying.
-- Packet was expanded in the March 2014 update and now includes a fourth packet, which contains CP values.
func.incoming[0x063] = {}
fields.incoming[0x063] = function(data, type)
return func.incoming[0x063].base + (func.incoming[0x063][type or data:byte(5)] or L{})
end
func.incoming[0x063].base = L{
{ctype='unsigned short', label='Order'}, -- 04
}
func.incoming[0x063][0x02] = L{
{ctype='data[7]', label='_flags1', fn=bin+{7}}, -- 06 The 3rd bit of the last byte is the flag that indicates whether or not you are xp capped (blue levels)
}
func.incoming[0x063][0x03] = L{
{ctype='unsigned short', label='_flags1'}, -- 06 Consistently D8 for me
{ctype='unsigned short', label='_flags2'}, -- 08 Vary when I change species
{ctype='unsigned short', label='_flags3'}, -- 0A Consistent across species
{ctype='unsigned char', label='Mon. Rank'}, -- 0C 00 = Mon, 01 = NM, 02 = HNM
{ctype='unsigned char', label='_unknown1'}, -- 0D 00
{ctype='unsigned short', label='_unknown2'}, -- 0E 00 00
{ctype='unsigned short', label='_unknown3'}, -- 10 76 00
{ctype='unsigned short', label='Infamy'}, -- 12
{ctype='unsigned int', label='_unknown4'}, -- 14 00s
{ctype='unsigned int', label='_unknown5'}, -- 18 00s
{ctype='data[64]', label='Instinct Bitfield 1'}, -- 1C See below
-- Bitpacked 2-bit values. 0 = no instincts from that species, 1 == first instinct, 2 == first and second instinct, 3 == first, second, and third instinct.
{ctype='data[128]', label='Monster Level Char field'}, -- 5C Mapped onto the item ID for these creatures. (00 doesn't exist, 01 is rabbit, 02 is behemoth, etc.)
}
func.incoming[0x063][0x04] = L{
{ctype='unsigned short', label='_unknown1'}, -- 06 B0 00
{ctype='data[126]', label='_unknown2'}, -- 08 FF-ing has no effect.
{ctype='unsigned char', label='Slime Level'}, -- 86
{ctype='unsigned char', label='Spriggan Level'}, -- 87
{ctype='data[12]', label='Instinct Bitfield 3'}, -- 88 Contains job/race instincts from the 0x03 set. Has 8 unused bytes. This is a 1:1 mapping.
{ctype='data[32]', label='Variants Bitfield'}, -- 94 Does not show normal monsters, only variants. Bit is 1 if the variant is owned. Length is an estimation including the possible padding.
}
types.job_point_info = L{
{ctype='unsigned short', label='Capacity Points'}, -- 00
{ctype='unsigned short', label='Job Points'}, -- 02
{ctype='unsigned short', label='Spent Job Points'}, -- 04
}
func.incoming[0x063][0x05] = L{
{ctype='unsigned short', label='_unknown1', const=0x0098}, -- 06
{ctype='unsigned short', label='_unknown2'}, -- 08 Lowest bit of this might indicate JP availability
{ctype='unsigned short', label='_unknown3'}, -- 0A
{ref=types.job_point_info, lookup={res.jobs, 0x00}, count=24}, -- 0C
}
func.incoming[0x063][0x09] = L{
{ctype='unsigned short', label='_unknown1', const=0x00C4}, -- 06
{ctype='unsigned short[32]',label='Buffs', fn=buff}, -- 08
{ctype='unsigned int[32]', label='Time', fn=bufftime}, -- 48
}
-- Repositioning
fields.incoming[0x065] = L{
-- This is identical to the spawn packet, but has 4 more unused bytes.
{ctype='float', label='X'}, -- 04
{ctype='float', label='Z'}, -- 08
{ctype='float', label='Y'}, -- 0C
{ctype='unsigned int', label='ID', fn=id}, -- 10
{ctype='unsigned short', label='Index', fn=index}, -- 14
{ctype='unsigned char', label='Animation'}, -- 16
{ctype='unsigned char', label='Rotation'}, -- 17
{ctype='data[6]', label='_unknown3'}, -- 18 All zeros observed.
}
-- Pet Info
fields.incoming[0x067] = L{
-- The length of this packet is 24, 28, 36 or 40 bytes, featuring a 0, 4, 8, 12, or 16 byte name field.
-- The Mask is a bitpacked combination of a number indicating the type of information in the packet and
-- a field indicating the length of the packet.
-- The lower 6 bits of the Mask is the type of packet:
-- 2 occurs often even with no pet, contains player index, id and main job level
-- 3 identifies (potential) pets and who owns them
-- 4 gives status information about your pet
-- The upper 10 bits of the Mask is the length in bytes of the data excluding the header and any padding
-- after the pet name.
{ctype='bit[6]', label='Message Type'}, -- 04
{ctype='bit[10]', label='Message Length'}, -- 05
{ctype='unsigned short', label='Pet Index', fn=index}, -- 06
{ctype='unsigned int', label='Pet ID', fn=id}, -- 08
{ctype='unsigned short', label='Owner Index', fn=index}, -- 0C
{ctype='unsigned char', label='Current HP%', fn=percent}, -- 0E
{ctype='unsigned char', label='Current MP%', fn=percent}, -- 0F
{ctype='unsigned int', label='Pet TP'}, -- 10
{ctype='unsigned int', label='_unknown1'}, -- 14
{ctype='char*', label='Pet Name'}, -- 18
}
-- Pet Status
-- It is sent every time a pet performs an action, every time anything about its vitals changes (HP, MP, TP) and every time its target changes
fields.incoming[0x068] = L{
{ctype='bit[6]', label='Message Type', const=0x04}, -- 04 Seems to always be 4
{ctype='bit[10]', label='Message Length'}, -- 05 Number of bytes from the start of the packet (including header) until the last non-null character in the name
{ctype='unsigned short', label='Owner Index', fn=index}, -- 06
{ctype='unsigned int', label='Owner ID', fn=id}, -- 08
{ctype='unsigned short', label='Pet Index', fn=index}, -- 0C
{ctype='unsigned char', label='Current HP%', fn=percent}, -- 0E
{ctype='unsigned char', label='Current MP%', fn=percent}, -- 0F
{ctype='unsigned int', label='Pet TP'}, -- 10
{ctype='unsigned int', label='Target ID', fn=id}, -- 14
{ctype='char*', label='Pet Name'}, -- 18
}
types.synth_skills = L{
{ctype='bit[6]', label='Skill'}, -- 1A - 1D:0
{ctype='boolbit', label='Skillup Allowed'}, -- 1A - 1D:6
{ctype='boolbit', label='Desynth'}, -- 1A - 1D:7
}
-- Self Synth Result
fields.incoming[0x06F] = L{
{ctype='unsigned char', label='Result', fn=e+{'synth'}}, -- 04
{ctype='signed char', label='Quality'}, -- 05
{ctype='unsigned char', label='Count'}, -- 06 Even set for fail (set as the NQ amount in that case)
{ctype='unsigned char', label='_junk1'}, -- 07
{ctype='unsigned short', label='Item', fn=item}, -- 08
{ctype='unsigned short[8]', label='Lost Item', fn=item}, -- 0A
{ref=types.synth_skills, count=4},
{ctype='unsigned char[4]', label='Skillup', fn=div+{10}}, -- 1E
{ctype='unsigned short', label='Crystal', fn=item}, -- 22
}
-- Others Synth Result
fields.incoming[0x070] = L{
{ctype='unsigned char', label='Result', fn=e+{'synth'}}, -- 04
{ctype='signed char', label='Quality'}, -- 05
{ctype='unsigned char', label='Count'}, -- 06
{ctype='unsigned char', label='_junk1'}, -- 07
{ctype='unsigned short', label='Item', fn=item}, -- 08
{ctype='unsigned short[8]', label='Lost Item', fn=item}, -- 0A
{ref=types.synth_skills, count=4},
{ctype='char*', label='Player Name'}, -- 1E Name of the player
}
-- Unity Start
-- Only observed being used for Unity fights.
fields.incoming[0x075] = L{
{ctype='unsigned int', label='Fight Designation'}, -- 04 Anything other than 0 makes a timer. 0 deletes the timer.
{ctype='unsigned int', label='Timestamp Offset', fn=time}, -- 08 Number of seconds since 15:00:00 GMT 31/12/2002 (0x3C307D70)
{ctype='unsigned int', label='Fight Duration', fn=time}, -- 0C
{ctype='data[12]', label='_unknown1'}, -- 10 This packet clearly needs position information, but it's unclear how these bytes carry it
{ctype='unsigned int', label='Battlefield Radius'}, -- 1C Yalms*1000, so a 50 yalm battlefield would have 50,000 for this field
{ctype='unsigned int', label='Render Radius'}, -- 20 Yalms*1000, so a fence that renders when you're 25 yalms away would have 25,000 for this field
}
-- Party status icon update
-- Buff IDs go can over 0xFF, but in the packet each buff only takes up one byte.
-- To address that there's a 8 byte bitmask starting at 0x4C where each 2 bits
-- represent how much to add to the value in the respective byte.
types.party_buff_entry = L{
{ctype='unsigned int', label='ID', fn=id}, -- 00
{ctype='unsigned short', label='Index', fn=index}, -- 04
{ctype='unsigned short', label='_unknown1'}, -- 06
{ctype='data[8]', label='Bit Mask'}, -- 08
{ctype='data[32]', label='Buffs'}, -- 10
}
fields.incoming[0x076] = L{
{ref=types.party_buff_entry,label='Party Buffs', count=5}, -- 04 This is 00'd out for absent party members.
}
-- Proposal
fields.incoming[0x078] = L{
{ctype='unsigned int', label='Proposer ID', fn=id}, -- 04
{ctype='unsigned int', label='_unknown1'}, -- 08 Proposal ID?
{ctype='unsigned short', label='Proposer Index'}, -- 0C
{ctype='char[15]', label='Proposer Name'}, -- 0E
{ctype='unsigned char', label='Chat mode'}, -- 1D Not typical chat mode mapping. 1 = Party
{ctype='char*', label='Proposal'}, -- 1E Proposal text, complete with special characters
}
-- Proposal Update
fields.incoming[0x079] = L{
{ctype='unsigned int', label='_unknown1'}, -- 04
{ctype='data[21]', label='_unknown2'}, -- 08 Likely contains information about the current chat mode and vote count
{ctype='char[16]', label='Proposer Name'}, -- 1D
{ctype='data[3]', label='_junk1'}, -- 1E All 00s
}
-- Guild Buy Response
-- Sent when buying an item from a guild NPC
fields.incoming[0x082] = L{
{ctype='unsigned short', label='Item', fn=item}, -- 08
{ctype='unsigned char', label='_junk1'}, -- 0A No obvious purpose
{ctype='unsigned char', label='Count'}, -- 0B Number you bought
}
types.guild_entry = L{
{ctype='unsigned short', label='Item', fn=item}, -- 00
{ctype='unsigned char', label='Current Stock'}, -- 02 Number in stock
{ctype='unsigned char', label='Max Stock'}, -- 03 Max stock can hold
{ctype='unsigned int', label='Price'}, -- 04
}
-- Guild Inv List
fields.incoming[0x083] = L{
{ref=types.guild_entry, label='Item', count='30'}, -- 04
{ctype='unsigned char', label='Item Count'}, -- F4
{ctype='bit[4]', label='Order'}, -- F5
{ctype='bit[4]', label='_unknown'},
{ctype='unsigned short', label='_padding'} -- F6
}
-- Guild Sell Response
-- Sent when selling an item to a guild NPC
fields.incoming[0x084] = L{
{ctype='unsigned short', label='Item', fn=item}, -- 08
{ctype='unsigned char', label='_junk1'}, -- 0A No obvious purpose
{ctype='unsigned char', label='Count'}, -- 0B Number you bought. If 0, the transaction failed.
}
-- Guild Sale List
fields.incoming[0x085] = L{
{ref=types.guild_entry, label='Item', count='30'}, -- 04
{ctype='unsigned char', label='Item Count'}, -- F4
{ctype='bit[4]', label='Order'}, -- F5
{ctype='bit[4]', label='_unknown'},
{ctype='unsigned short', label='_padding'} -- F6
}
-- Guild Open
-- Sent to update guild status or open the guild menu.
fields.incoming[0x086] = L{
{ctype='unsigned char', label='Open Menu'}, -- 04 0x00 = Open guild menu, 0x01 = Guild is closed, 0x03 = nothing, so this is treated as an unsigned char
{ctype='data[3]', label='_junk1'}, -- 05 Does not seem to matter in any permutation of this packet
{ctype='data[3]', label='Guild Hours'}, -- 08 First 1 indicates the opening hour. First 0 after that indicates the closing hour. In the event that there are no 0s, 91022244 is used.
{ctype='unsigned char', label='_flags1'}, -- 0B Most significant bit (0x80) indicates whether the "close guild" message should be displayed.
}
types.merit_entry = L{
{ctype='unsigned short', label='Merit'}, -- 00
{ctype='unsigned char', label='Next Cost'}, -- 02
{ctype='unsigned char', label='Value'}, -- 03
}
-- Merits
fields.incoming[0x08C] = function(data, merits)
return L{
{ctype='unsigned char', label='Count'}, -- 04 Number of merits entries in this packet (possibly a short, although it wouldn't make sense)
{ctype='data[3]', label='_unknown1'}, -- 05 Always 00 0F 01?
{ref=types.merit_entry, count=merits or data:byte(5)}, -- 08
{ctype='unsigned int', label='_unknown2', const=0x00000000}, ---04
}
end
types.job_point = L{
{ctype='unsigned short', label='Job Point ID'}, -- 00 32 potential values for every job, which means you could decompose this into a value bitpacked with job ID if you wanted
{ctype='bit[10]', label='_unknown1'}, -- 02 Always 1 in cases where the ID is set at the moment. Zeroing this has no effect.
{ctype='bit[6]', label='Current Level'}, -- 03 Current enhancement for this job point ID
}
-- Job Points
-- These packets are currently not used by the client in any detectable way.
-- The below pattern repeats itself for the entirety of the packet. There are 2 jobs per packet,
-- and 11 of these packets are sent at the moment in response to the first 0x0C0 outgoing packet since zoning.
-- This is how it works as of 3-19-14, and it is safe to assume that it will change in the future.
fields.incoming[0x08D] = L{
{ref=types.job_point, count='*'}, -- 04
}
-- Campaign Map Info
-- fields.incoming[0x071]
-- Perhaps it's my lack of interest, but this (triple-ish) packet is nearly incomprehensible to me.
-- Does not appear to contain zone IDs. It's probably bitpacked or something.
-- Has a byte that seems to be either 02 or 03, but the packet is sent three times. There are two 02s.
-- The second 02 packet contains different information after the ~48th content byte.
types.alliance_member = L{
{ctype='unsigned int', label='ID', fn=id}, -- 00
{ctype='unsigned short', label='Index', fn=index}, -- 04
{ctype='unsigned short', label='Flags', fn=bin+{2}}, -- 06
{ctype='unsigned short', label='Zone', fn=zone}, -- 08
{ctype='unsigned short', label='_unknown2'}, -- 0A Always 0?
}
-- Party Map Marker
-- This packet is ignored if your party member is within 50' of you.
fields.incoming[0x0A0] = L{
{ctype='unsigned int', label='ID', fn=id}, -- 04
{ctype='unsigned short', label='Zone', fn=zone}, -- 08
{ctype='unsigned short', label='_unknown1'}, -- 0A Look like junk
{ctype='float', label='X'}, -- 0C
{ctype='float', label='Z'}, -- 10
{ctype='float', label='Y'}, -- 14
}
--0x0AA, 0x0AC, and 0x0AE are all bitfields where the lsb indicates whether you have index 0 of the related resource.
-- Help Desk submenu open
fields.incoming[0x0B5] = L{
{ctype='data[0x14]', label='_unknown1'}, -- 04
{ctype='unsigned int', label='Number of Opens'}, -- 18
{ctype='unsigned int', label='_unknown2'}, -- 1C
}
-- Alliance status update
fields.incoming[0x0C8] = L{
{ctype='unsigned char', label='_unknown1'}, -- 04
{ctype='data[3]', label='_junk1'}, -- 05
{ref=types.alliance_member, count=18}, -- 08
{ctype='data[0x18]', label='_unknown3', const=''}, -- E0 Always 0?
}
types.check_item = L{
{ctype='unsigned short', label='Item', fn=item}, -- 00
{ctype='unsigned char', label='Slot', fn=slot}, -- 02
{ctype='unsigned char', label='_unknown1'}, -- 03
{ctype='data[0x18]', label='ExtData', fn=hex+{0x18}}, -- 04
}
-- Check data
func.incoming[0x0C9] = {}
fields.incoming[0x0C9] = function(data, type)
return func.incoming[0x0C9].base + func.incoming[0x0C9][type or data:byte(0x0B)]
end
enums[0x0C9] = {
[0x01] = 'Metadata',
[0x03] = 'Equipment',
}
-- Common to all messages
func.incoming[0x0C9].base = L{
{ctype='unsigned int', label='Target ID', fn=id}, -- 04
{ctype='unsigned short', label='Target Index', fn=index}, -- 08
{ctype='unsigned char', label='Type', fn=e+{0x0C9}}, -- 0A
}
-- Equipment listing
func.incoming[0x0C9][0x03] = L{
{ctype='unsigned char', label='Count'}, -- 0B
{ref=types.check_item, count_ref=0x0B}, -- 0C
}
-- Metadata
-- The title needs to be somewhere in here, but not sure where, maybe bit packed?
func.incoming[0x0C9][0x01] = L{
{ctype='data[3]', label='_junk1'}, -- 0B
{ctype='unsigned char', label='Icon Set Subtype'}, -- 0E 0 = Unopened Linkshell?, 1 = Linkshell, 2 = Pearlsack, 3 = Linkpearl, 4 = Ripped Pearlsack (I think), 5 = Broken Linkpearl?
{ctype='unsigned char', label='Icon Set ID'}, -- 0F This identifies the icon set, always 2 for linkshells.
{ctype='data[16]', label='Linkshell', enc=ls_enc}, -- 10 6-bit packed
{ctype='bit[4]', label='_junk1'}, -- 20
{ctype='bit[4]', label='Linkshell Red'}, -- 20 0xGR, 0x-B
{ctype='bit[4]', label='Linkshell Green'}, -- 21
{ctype='bit[4]', label='Linkshell Blue'}, -- 21
{ctype='unsigned char', label='_unknown1'}, -- 22
{ctype='unsigned char', label='Sub Job', fn=job}, -- 23
{ctype='unsigned char', label='Main Job Level'}, -- 24
{ctype='unsigned char', label='Sub Job Level'}, -- 25
{ctype='unsigned char', label='Main Job', fn=job}, -- 26
{ctype='unsigned char', label='Master Level'}, -- 27
{ctype='boolbit', label='Master Breaker'}, -- 28
{ctype='bit[7]', label='_junk2'}, -- 28
{ctype='data[43]', label='_unknown5'}, -- 29 At least the first two bytes and the last twelve bytes are junk, possibly more
}
-- Bazaar Message
fields.incoming[0x0CA] = L{
{ctype='char[124]', label='Bazaar Message'}, -- 04 Terminated with a vertical tab
{ctype='char[16]', label='Player Name'}, -- 80
{ctype='unsigned short', label='Player Title ID'}, -- 90
{ctype='unsigned short', label='_unknown4'}, -- 92 00 00 observed.
}
-- LS Message
fields.incoming[0x0CC] = L{
{ctype='int', label='_unknown1'}, -- 04
{ctype='char[128]', label='Message'}, -- 08
{ctype='unsigned int', label='Timestamp', fn=time}, -- 88
{ctype='char[16]', label='Player Name'}, -- 8C
{ctype='unsigned int', label='Permissions'}, -- 98
{ctype='data[15]', label='Linkshell', enc=ls_enc}, -- 9C 6-bit packed
}
-- Found Item
fields.incoming[0x0D2] = L{
{ctype='unsigned int', label='_unknown1'}, -- 04 Could be characters starting the line - FD 02 02 18 observed
-- 04 Arcon: Only ever observed 0x00000001 for this
{ctype='unsigned int', label='Dropper', fn=id}, -- 08
{ctype='unsigned int', label='Count'}, -- 0C Takes values greater than 1 in the case of gil
{ctype='unsigned short', label='Item', fn=item}, -- 10
{ctype='unsigned short', label='Dropper Index', fn=index}, -- 12
{ctype='unsigned char', label='Index'}, -- 14 This is the internal index in memory, not the one it appears in in the menu
{ctype='bool', label='Old'}, -- 15 This is true if it's not a new drop, but appeared in the pool before you joined a party
{ctype='unsigned char', label='_unknown4', const=0x00}, -- 16 Seems to always be 00
{ctype='unsigned char', label='_unknown5'}, -- 17 Seemingly random, both 00 and FF observed, as well as many values in between
{ctype='unsigned int', label='Timestamp', fn=utime}, -- 18
{ctype='data[28]', label='_unknown6'}, -- AC Always 0 it seems?
{ctype='unsigned int', label='_junk1'}, -- 38
}
-- Item lot/drop
fields.incoming[0x0D3] = L{
{ctype='unsigned int', label='Highest Lotter', fn=id}, -- 04
{ctype='unsigned int', label='Current Lotter', fn=id}, -- 08
{ctype='unsigned short', label='Highest Lotter Index',fn=index}, -- 0C
{ctype='unsigned short', label='Highest Lot'}, -- 0E
{ctype='bit[15]', label='Current Lotter Index',fn=index}, -- 10
{ctype='bit[1]', label='_unknown1'}, -- 11 Always seems set
{ctype='unsigned short', label='Current Lot'}, -- 12 0xFF FF if passing
{ctype='unsigned char', label='Index'}, -- 14
{ctype='unsigned char', label='Drop'}, -- 15 0 if no drop, 1 if dropped to player, 3 if floored
{ctype='char[16]', label='Highest Lotter Name'}, -- 16
{ctype='char[16]', label='Current Lotter Name'}, -- 26
{ctype='data[6]', label='_junk1'}, -- 36
}
-- Party Invite
fields.incoming[0x0DC] = L{
{ctype='unsigned int', label='Inviter ID', fn=id}, -- 04
{ctype='unsigned int', label='Flags'}, -- 08 This may also contain the type of invite (alliance vs. party)
{ctype='char[16]', label='Inviter Name'}, -- 0C
{ctype='unsigned short', label='_unknown1'}, -- 1C
{ctype='unsigned short', label='_junk1'}, -- 1E
}
-- Party member update
fields.incoming[0x0DD] = L{
{ctype='unsigned int', label='ID', fn=id}, -- 04
{ctype='unsigned int', label='HP'}, -- 08
{ctype='unsigned int', label='MP'}, -- 0C
{ctype='unsigned int', label='TP', fn=percent}, -- 10
{ctype='unsigned short', label='Flags', fn=bin+{2}}, -- 14
{ctype='unsigned short', label='_unknown1'}, -- 16
{ctype='unsigned short', label='Index', fn=index}, -- 18
{ctype='unsigned short', label='_unknown2'}, -- 1A
{ctype='unsigned char', label='_unknown3'}, -- 1C
{ctype='unsigned char', label='HP%', fn=percent}, -- 1D
{ctype='unsigned char', label='MP%', fn=percent}, -- 1E
{ctype='unsigned char', label='_unknown4'}, -- 1F
{ctype='unsigned short', label='Zone', fn=zone}, -- 20
{ctype='unsigned char', label='Main job', fn=job}, -- 22
{ctype='unsigned char', label='Main job level'}, -- 23
{ctype='unsigned char', label='Sub job', fn=job}, -- 24
{ctype='unsigned char', label='Sub job level'}, -- 25
{ctype='unsigned char', label='Master Level'}, -- 26
{ctype='boolbit', label='Master Breaker'}, -- 27
{ctype='bit[7]', label='_junk2'}, -- 27
{ctype='char*', label='Name'}, -- 28
}
-- Unnamed 0xDE packet
-- 8 bytes long, sent in response to opening/closing mog house. Occasionally sent when zoning.
-- Injecting it with different values has no obvious effect.
--[[fields.incoming[0x0DE] = L{
{ctype='unsigned char', label='type'}, -- 04 Was always 0x4 for opening/closing mog house
{ctype='data[3]', label='_junk1'}, -- 05 Looked like junk
}]]
-- Char Update
fields.incoming[0x0DF] = L{
{ctype='unsigned int', label='ID', fn=id}, -- 04
{ctype='unsigned int', label='HP'}, -- 08
{ctype='unsigned int', label='MP'}, -- 0C
{ctype='unsigned int', label='TP', fn=percent}, -- 10
{ctype='unsigned short', label='Index', fn=index}, -- 14
{ctype='unsigned char', label='HPP', fn=percent}, -- 16
{ctype='unsigned char', label='MPP', fn=percent}, -- 17
{ctype='unsigned short', label='_unknown1'}, -- 18
{ctype='unsigned short', label='_unknown2'}, -- 1A
{ctype='unsigned short', label='Monstrosity Species'}, -- 1C High bit is always set while in monstrosity and determines the display of the third name
{ctype='unsigned char', label='Monstrosity Name 1'}, -- 1E
{ctype='unsigned char', label='Monstrosity Name 2'}, -- 1F
{ctype='unsigned char', label='Main job', fn=job}, -- 20
{ctype='unsigned char', label='Main job level'}, -- 21
{ctype='unsigned char', label='Sub job', fn=job}, -- 22
{ctype='unsigned char', label='Sub job level'}, -- 23
{ctype='unsigned char', label='Master Level'}, -- 24
{ctype='boolbit', label='Master Breaker'}, -- 25
{ctype='bit[7]', label='_junk2'}, -- 25
}
-- Unknown packet 0x0E0: I still can't make heads or tails of the content. The packet is always 8 bytes long.
-- Linkshell Equip
fields.incoming[0x0E0] = L{
{ctype='unsigned char', label='Linkshell Number'}, -- 04
{ctype='unsigned char', label='Inventory Slot'}, -- 05
{ctype='unsigned short', label='_junk1'}, -- 06
}
-- Party Member List
fields.incoming[0x0E1] = L{
{ctype='unsigned short', label='Party ID'}, -- 04 For whatever reason, this is always valid ASCII in my captured packets.
{ctype='unsigned short', label='_unknown1', const=0x8000}, -- 06 Likely contains information about the current chat mode and vote count
}
-- Char Info
fields.incoming[0x0E2] = L{
{ctype='unsigned int', label='ID', fn=id}, -- 04
{ctype='unsigned int', label='HP'}, -- 08
{ctype='unsigned int', label='MP'}, -- 0A
{ctype='unsigned int', label='TP', fn=percent}, -- 10
{ctype='unsigned int', label='_unknown1'}, -- 14 Looks like it could be flags for something.
{ctype='unsigned short', label='Index', fn=index}, -- 18
{ctype='unsigned char', label='_unknown2'}, -- 1A
{ctype='unsigned char', label='_unknown3'}, -- 1B
{ctype='unsigned char', label='_unknown4'}, -- 1C
{ctype='unsigned char', label='HPP', fn=percent}, -- 1D
{ctype='unsigned char', label='MPP', fn=percent}, -- 1E
{ctype='unsigned char', label='_unknown5'}, -- 1F
{ctype='unsigned char', label='_unknown6'}, -- 20
{ctype='unsigned char', label='_unknown7'}, -- 21 Could be an initialization for the name. 0x01 observed.
{ctype='char*', label='Name'}, -- 22 * Maybe a base stat
}
-- Toggle Heal
fields.incoming[0x0E8] = L{
{ctype='unsigned char', label='Movement'}, -- 04 02 if caused by movement
{ctype='unsigned char', label='_unknown2'}, -- 05 00 observed
{ctype='unsigned char', label='_unknown3'}, -- 06 00 observed
{ctype='unsigned char', label='_unknown4'}, -- 07 00 observed
}
-- Widescan Mob
fields.incoming[0x0F4] = L{
{ctype='unsigned short', label='Index', fn=index}, -- 04
{ctype='unsigned char', label='Level'}, -- 06
{ctype='unsigned char', label='Type', fn=e+{'ws mob'}}, -- 07
{ctype='short', label='X Offset', fn=pixel}, -- 08 Offset on the map
{ctype='short', label='Y Offset', fn=pixel}, -- 0A
{ctype='char[16]', label='Name'}, -- 0C Slugged, may not extend all the way to 27. Up to 25 has been observed. This will be used if Type == 0
}
-- Widescan Track
fields.incoming[0x0F5] = L{
{ctype='float', label='X'}, -- 04
{ctype='float', label='Z'}, -- 08
{ctype='float', label='Y'}, -- 0C
{ctype='unsigned char', label='Level'}, -- 10
{ctype='unsigned char', label='_padding1'}, -- 11
{ctype='unsigned short', label='Index', fn=index}, -- 12
{ctype='unsigned int', label='Status', fn=e+{'ws track'}}, -- 14
}
-- Widescan Mark
fields.incoming[0x0F6] = L{
{ctype='unsigned int', label='Type', fn=e+{'ws mark'}}, -- 04
}
enums['reraise'] = {
[0x01] = 'Raise dialogue',
[0x02] = 'Tractor dialogue',
}
-- Reraise Activation
fields.incoming[0x0F9] = L{
{ctype='unsigned int', label='ID', fn=id}, -- 04
{ctype='unsigned short', label='Index', fn=index}, -- 08
{ctype='unsigned char', label='Category', fn=e+{'reraise'}}, -- 0A
{ctype='unsigned char', label='_unknown1'}, -- 0B
}
-- Furniture Interaction
fields.incoming[0x0FA] = L{
{ctype='unsigned short', label='Item', fn=item}, -- 04
{ctype='data[6]', label='_unknown1'}, -- 06 Always 00s for me
{ctype='unsigned char', label='Safe Slot'}, -- 0C Safe slot for the furniture being interacted with
{ctype='data[3]', label='_unknown2'}, -- 0D Takes values, but doesn't look particularly meaningful
}
-- Bazaar item listing
fields.incoming[0x105] = L{
{ctype='unsigned int', label='Price', fn=gil}, -- 04
{ctype='unsigned int', label='Count'}, -- 08
{ctype='unsigned short', label='_unknown1'}, -- 0C
{ctype='unsigned short', label='Item', fn=item}, -- 0E
{ctype='unsigned char', label='Inventory Index'}, -- 10 This is the seller's inventory index of the item
}
-- Bazaar Seller Info Packet
-- Information on the purchase sent to the buyer when they attempt to buy
-- something from a bazaar (whether or not they are successful)
fields.incoming[0x106] = L{
{ctype='unsigned int', label='Type', fn=e+{'try'}}, -- 04
{ctype='char[16]', label='Name'}, -- 08
}
-- Bazaar closed
-- Sent when the bazaar closes while you're browsing it
-- This includes you buying the last item which leads to the message:
-- "Player's bazaar was closed midway through your transaction"
fields.incoming[0x107] = L{
{ctype='char[16]', label='Name'}, -- 04
}
-- Bazaar visitor
-- Sent when someone opens your bazaar
fields.incoming[0x108] = L{
{ctype='unsigned int', label='ID', fn=id}, -- 04
{ctype='unsigned int', label='Type', fn=e+{'bazaar'}}, -- 08
{ctype='unsigned char', label='_unknown1', const=0x00}, -- 0C Always zero?
{ctype='unsigned char', label='_unknown2'}, -- 0D Possibly junk, often zero, sometimes random
{ctype='unsigned short', label='Index', fn=index}, -- 0E
{ctype='char[16]', label='Name'}, -- 10
}
-- Bazaar Purchase Info Packet
-- Information on the purchase sent to the buyer when the purchase is successful.
fields.incoming[0x109] = L{
{ctype='unsigned int', label='Buyer ID', fn=id}, -- 04
{ctype='unsigned int', label='Quantity'}, -- 08
{ctype='unsigned short', label='Buyer Index', fn=index}, -- 0C
{ctype='unsigned short', label='Bazaar Index', fn=index}, -- 0E
{ctype='char[16]', label='Buyer Name'}, -- 10
{ctype='unsigned int', label='_unknown1'}, -- 20 Was 05 00 02 00 for me
}
-- Bazaar Buyer Info Packet
-- Information on the purchase sent to the seller when a sale is successful.
fields.incoming[0x10A] = L{
{ctype='unsigned int', label='Quantity'}, -- 04
{ctype='unsigned short', label='Item ID'}, -- 08
{ctype='char[16]', label='Buyer Name'}, -- 0A
{ctype='unsigned int', label='_unknown1'}, -- 1A Was 00 00 00 00 for me
{ctype='unsigned short', label='_unknown2'}, -- 1C Was 64 00 for me. Seems to be variable length? Also got 32 32 00 00 00 00 00 00 once.
}
-- Bazaar Open Packet
-- Packet sent when you open your bazaar.
fields.incoming[0x10B] = L{
{ctype='unsigned int', label='_unknown1'}, -- 04 Was 00 00 00 00 for me
}
-- Sparks update packet
fields.incoming[0x110] = L{
{ctype='unsigned int', label='Sparks Total'}, -- 04
{ctype='unsigned char', label='Unity (Shared) designator'}, -- 08 Unity (Shared) designator (0=A, 1=B, 2=C, etc.)
{ctype='unsigned char', label='Unity (Person) designator '}, -- 09 The game does not distinguish these
{ctype='char[6]', label='_unknown2'}, -- 0A Currently all 0xFF'd, never seen it change.
}
types.roe_quest = L{
{ctype='bit[12]', label='RoE Quest ID'}, -- 00
{ctype='bit[20]', label='RoE Quest Progress'}, -- 01
}
-- Eminence Update
fields.incoming[0x111] = L{
{ref=types.roe_quest, count=30}, -- 04
{ctype='data[132]', label='_junk'}, -- 7C All 0s observed. Likely reserved in case they decide to expand allowed objectives.
{ctype='bit[12]', label='Limited Time RoE Quest ID'}, -- 100
{ctype='bit[20]', label='Limited Time RoE Quest Progress'}, -- 101 upper 4
}
-- RoE Quest Log
fields.incoming[0x112] = L{
{ctype='data[128]', label='RoE Quest Bitfield'}, -- 04 See next line
-- Bitpacked quest completion flags. The position of the bit is the quest ID.
-- Data regarding available quests and repeatability is handled client side or
-- somewhere else
{ctype='unsigned int', label='Order'}, -- 84 0,1,2,3
}
--Currency Info (Currencies I)
fields.incoming[0x113] = L{
{ctype='signed int', label='Conquest Points (San d\'Oria)'}, -- 04
{ctype='signed int', label='Conquest Points (Bastok)'}, -- 08
{ctype='signed int', label='Conquest Points (Windurst)'}, -- 0C
{ctype='unsigned short', label='Beastman Seals'}, -- 10
{ctype='unsigned short', label='Kindred Seals'}, -- 12
{ctype='unsigned short', label='Kindred Crests'}, -- 14
{ctype='unsigned short', label='High Kindred Crests'}, -- 16
{ctype='unsigned short', label='Sacred Kindred Crests'}, -- 18
{ctype='unsigned short', label='Ancient Beastcoins'}, -- 1A
{ctype='unsigned short', label='Valor Points'}, -- 1C
{ctype='unsigned short', label='Scylds'}, -- 1E
{ctype='signed int', label='Guild Points (Fishing)'}, -- 20
{ctype='signed int', label='Guild Points (Woodworking)'}, -- 24
{ctype='signed int', label='Guild Points (Smithing)'}, -- 28
{ctype='signed int', label='Guild Points (Goldsmithing)'}, -- 2C
{ctype='signed int', label='Guild Points (Weaving)'}, -- 30
{ctype='signed int', label='Guild Points (Leathercraft)'}, -- 34
{ctype='signed int', label='Guild Points (Bonecraft)'}, -- 38
{ctype='signed int', label='Guild Points (Alchemy)'}, -- 3C
{ctype='signed int', label='Guild Points (Cooking)'}, -- 40
{ctype='signed int', label='Cinders'}, -- 44
{ctype='unsigned char', label='Synergy Fewell (Fire)'}, -- 48
{ctype='unsigned char', label='Synergy Fewell (Ice)'}, -- 49
{ctype='unsigned char', label='Synergy Fewell (Wind)'}, -- 4A
{ctype='unsigned char', label='Synergy Fewell (Earth)'}, -- 4B
{ctype='unsigned char', label='Synergy Fewell (Lightning)'}, -- 4C
{ctype='unsigned char', label='Synergy Fewell (Water)'}, -- 4D
{ctype='unsigned char', label='Synergy Fewell (Light)'}, -- 4E
{ctype='unsigned char', label='Synergy Fewell (Dark)'}, -- 4F
{ctype='signed int', label='Ballista Points'}, -- 50
{ctype='signed int', label='Fellow Points'}, -- 54
{ctype='unsigned short', label='Chocobucks (San d\'Oria)'}, -- 58
{ctype='unsigned short', label='Chocobucks (Bastok)'}, -- 5A
{ctype='unsigned short', label='Chocobucks (Windurst)'}, -- 5C
{ctype='unsigned short', label='Daily Tally'}, -- 5E
{ctype='signed int', label='Research Marks'}, -- 60
{ctype='unsigned char', label='Wizened Tunnel Worms'}, -- 64
{ctype='unsigned char', label='Wizened Morion Worms'}, -- 65
{ctype='unsigned char', label='Wizened Phantom Worms'}, -- 66
{ctype='char', label='_unknown1'}, -- 67 Currently holds no value
{ctype='signed int', label='Moblin Marbles'}, -- 68
{ctype='unsigned short', label='Infamy'}, -- 6C
{ctype='unsigned short', label='Prestige'}, -- 6E
{ctype='signed int', label='Legion Points'}, -- 70
{ctype='signed int', label='Sparks of Eminence'}, -- 74
{ctype='signed int', label='Shining Stars'}, -- 78
{ctype='signed int', label='Imperial Standing'}, -- 7C
{ctype='signed int', label='Assault Points (Leujaoam Sanctum)'}, -- 80
{ctype='signed int', label='Assault Points (M.J.T.G.)'}, -- 84
{ctype='signed int', label='Assault Points (Lebros Cavern)'}, -- 88
{ctype='signed int', label='Assault Points (Periqia)'}, -- 8C
{ctype='signed int', label='Assault Points (Ilrusi Atoll)'}, -- 90
{ctype='signed int', label='Nyzul Tokens'}, -- 94
{ctype='signed int', label='Zeni'}, -- 98
{ctype='signed int', label='Jettons'}, -- 9C
{ctype='signed int', label='Therion Ichor'}, -- A0
{ctype='signed int', label='Allied Notes'}, -- A4
{ctype='unsigned short', label='A.M.A.N. Vouchers Stored'}, -- A8
{ctype='unsigned short', label="Login Points"}, -- AA
{ctype='signed int', label='Cruor'}, -- AC
{ctype='signed int', label='Resistance Credits'}, -- B0
{ctype='signed int', label='Dominion Notes'}, -- B4
{ctype='unsigned char', label='5th Echelon Battle Trophies'}, -- B8
{ctype='unsigned char', label='4th Echelon Battle Trophies'}, -- B9
{ctype='unsigned char', label='3rd Echelon Battle Trophies'}, -- BA
{ctype='unsigned char', label='2nd Echelon Battle Trophies'}, -- BB
{ctype='unsigned char', label='1st Echelon Battle Trophies'}, -- BC
{ctype='unsigned char', label='Cave Conservation Points'}, -- BD
{ctype='unsigned char', label='Imperial Army ID Tags'}, -- BE
{ctype='unsigned char', label='Op Credits'}, -- BF
{ctype='signed int', label='Traverser Stones'}, -- C0
{ctype='signed int', label='Voidstones'}, -- C4
{ctype='signed int', label='Kupofried\'s Corundums'}, -- C8
{ctype='unsigned char', label='Moblin Pheromone Sacks'}, -- CC
{ctype='data[1]', label='_unknown2'}, -- CD
{ctype='unsigned char', label="Rems Tale Chapter 1"}, -- CE
{ctype='unsigned char', label="Rems Tale Chapter 2"}, -- CF
{ctype='unsigned char', label="Rems Tale Chapter 3"}, -- D0
{ctype='unsigned char', label="Rems Tale Chapter 4"}, -- D1
{ctype='unsigned char', label="Rems Tale Chapter 5"}, -- D2
{ctype='unsigned char', label="Rems Tale Chapter 6"}, -- D3
{ctype='unsigned char', label="Rems Tale Chapter 7"}, -- D4
{ctype='unsigned char', label="Rems Tale Chapter 8"}, -- D5
{ctype='unsigned char', label="Rems Tale Chapter 9"}, -- D6
{ctype='unsigned char', label="Rems Tale Chapter 10"}, -- D7
{ctype='data[8]', label="_unknown3"}, -- D8
{ctype='signed int', label="Reclamation Marks"}, -- E0
{ctype='signed int', label='Unity Accolades'}, -- E4
{ctype='unsigned short', label="Fire Crystals"}, -- E8
{ctype='unsigned short', label="Ice Crystals"}, -- EA
{ctype='unsigned short', label="Wind Crystals"}, -- EC
{ctype='unsigned short', label="Earth Crystals"}, -- EE
{ctype='unsigned short', label="Lightning Crystals"}, -- E0
{ctype='unsigned short', label="Water Crystals"}, -- F2
{ctype='unsigned short', label="Light Crystals"}, -- F4
{ctype='unsigned short', label="Dark Crystals"}, -- F6
{ctype='signed int', label="Deeds"}, -- F8
}
-- Fish Bite Info
fields.incoming[0x115] = L{
{ctype='unsigned short', label='_unknown1'}, -- 04
{ctype='unsigned short', label='_unknown2'}, -- 06
{ctype='unsigned short', label='_unknown3'}, -- 08
{ctype='unsigned int', label='Fish Bite ID'}, -- 0A Unique to the type of fish that bit
{ctype='unsigned short', label='_unknown4'}, -- 0E
{ctype='unsigned short', label='_unknown5'}, -- 10
{ctype='unsigned short', label='_unknown6'}, -- 12
{ctype='unsigned int', label='Catch Key'}, -- 14 This value is used in the catch key of the 0x110 packet when catching a fish
}
-- Equipset Build Response
fields.incoming[0x116] = L{
{ref=types.equipset_build, lookup={res.slots, 0x00}, count=0x10},
}
func.incoming[0x117] = {}
func.incoming[0x117].base = L{
{ctype='unsigned char', label='Count'}, -- 04
{ctype='unsigned char[3]', label='_unknown1'}, -- 05
}
-- Equipset
fields.incoming[0x117] = function(data, count)
count = count or data:byte(5)
return func.incoming[0x117].base + L{
-- Only the number given in Count will be properly populated, the rest is junk
{ref=types.equipset, count=count}, -- 08
{ctype='data[%u]':format((16 - count) * 4), label='_junk1'}, -- 08 + 4 * count
{ref=types.equipset, lookup={res.slots, 0x00}, count=0x10}, -- 48
}
end
-- Currency Info (Currencies2)
fields.incoming[0x118] = L{
{ctype='signed int', label='Bayld'}, -- 04
{ctype='unsigned short', label='Kinetic Units'}, -- 08
{ctype='unsigned char', label='Coalition Imprimaturs'}, -- 0A
{ctype='unsigned char', label='Mystical Canteens'}, -- 0B
{ctype='signed int', label='Obsidian Fragments'}, -- 0C
{ctype='unsigned short', label='Lebondopt Wings Stored'}, -- 10
{ctype='unsigned short', label='Pulchridopt Wings Stored'}, -- 12
{ctype='signed int', label='Mweya Plasm Corpuscles'}, -- 14
{ctype='unsigned char', label='Ghastly Stones Stored'}, -- 18
{ctype='unsigned char', label='Ghastly Stones +1 Stored'}, -- 19
{ctype='unsigned char', label='Ghastly Stones +2 Stored'}, -- 1A
{ctype='unsigned char', label='Verdigris Stones Stored'}, -- 1B
{ctype='unsigned char', label='Verdigris Stones +1 Stored'}, -- 1C
{ctype='unsigned char', label='Verdigris Stones +2 Stored'}, -- 1D
{ctype='unsigned char', label='Wailing Stones Stored'}, -- 1E
{ctype='unsigned char', label='Wailing Stones +1 Stored'}, -- 1F
{ctype='unsigned char', label='Wailing Stones +2 Stored'}, -- 20
{ctype='unsigned char', label='Snowslit Stones Stored'}, -- 21
{ctype='unsigned char', label='Snowslit Stones +1 Stored'}, -- 22
{ctype='unsigned char', label='Snowslit Stones +2 Stored'}, -- 23
{ctype='unsigned char', label='Snowtip Stones Stored'}, -- 24
{ctype='unsigned char', label='Snowtip Stones +1 Stored'}, -- 25
{ctype='unsigned char', label='Snowtip Stones +2 Stored'}, -- 26
{ctype='unsigned char', label='Snowdim Stones Stored'}, -- 27
{ctype='unsigned char', label='Snowdim Stones +1 Stored'}, -- 28
{ctype='unsigned char', label='Snowdim Stones +2 Stored'}, -- 29
{ctype='unsigned char', label='Snoworb Stones Stored'}, -- 2A
{ctype='unsigned char', label='Snoworb Stones +1 Stored'}, -- 2B
{ctype='unsigned char', label='Snoworb Stones +2 Stored'}, -- 2C
{ctype='unsigned char', label='Leafslit Stones Stored'}, -- 2D
{ctype='unsigned char', label='Leafslit Stones +1 Stored'}, -- 2E
{ctype='unsigned char', label='Leafslit Stones +2 Stored'}, -- 2F
{ctype='unsigned char', label='Leaftip Stones Stored'}, -- 30
{ctype='unsigned char', label='Leaftip Stones +1 Stored'}, -- 31
{ctype='unsigned char', label='Leaftip Stones +2 Stored'}, -- 32
{ctype='unsigned char', label='Leafdim Stones Stored'}, -- 33
{ctype='unsigned char', label='Leafdim Stones +1 Stored'}, -- 34
{ctype='unsigned char', label='Leafdim Stones +2 Stored'}, -- 35
{ctype='unsigned char', label='Leaforb Stones Stored'}, -- 36
{ctype='unsigned char', label='Leaforb Stones +1 Stored'}, -- 37
{ctype='unsigned char', label='Leaforb Stones +2 Stored'}, -- 38
{ctype='unsigned char', label='Duskslit Stones Stored'}, -- 39
{ctype='unsigned char', label='Duskslit Stones +1 Stored'}, -- 3A
{ctype='unsigned char', label='Duskslit Stones +2 Stored'}, -- 3B
{ctype='unsigned char', label='Dusktip Stones Stored'}, -- 3C
{ctype='unsigned char', label='Dusktip Stones +1 Stored'}, -- 3D
{ctype='unsigned char', label='Dusktip Stones +2 Stored'}, -- 3E
{ctype='unsigned char', label='Duskdim Stones Stored'}, -- 3F
{ctype='unsigned char', label='Duskdim Stones +1 Stored'}, -- 40
{ctype='unsigned char', label='Duskdim Stones +2 Stored'}, -- 41
{ctype='unsigned char', label='Duskorb Stones Stored'}, -- 42
{ctype='unsigned char', label='Duskorb Stones +1 Stored'}, -- 43
{ctype='unsigned char', label='Duskorb Stones +2 Stored'}, -- 44
{ctype='unsigned char', label='Pellucid Stones Stored'}, -- 45
{ctype='unsigned char', label='Fern Stones Stored'}, -- 46
{ctype='unsigned char', label='Taupe Stones Stored'}, -- 47
{ctype='unsigned short', label='Mellidopt Wings Stored'}, -- 48
{ctype='unsigned short', label='Escha Beads'}, -- 4A
{ctype='signed int', label='Escha Silt'}, -- 4C
{ctype='signed int', label='Potpourri'}, -- 50
{ctype='signed int', label='Hallmarks'}, -- 54
{ctype='signed int', label='Total Hallmarks'}, -- 58
{ctype='signed int', label='Badges of Gallantry'}, -- 5C
{ctype='signed int', label='Crafter Points'}, -- 60
{ctype='unsigned char', label='Fire Crystals Set'}, -- 64
{ctype='unsigned char', label='Ice Crystals Set'}, -- 65
{ctype='unsigned char', label='Wind Crystals Set'}, -- 66
{ctype='unsigned char', label='Earth Crystals Set'}, -- 67
{ctype='unsigned char', label='Lightning Crystals Set'}, -- 68
{ctype='unsigned char', label='Water Crystals Set'}, -- 69
{ctype='unsigned char', label='Light Crystals Set'}, -- 6A
{ctype='unsigned char', label='Dark Crystals Set'}, -- 6B
{ctype='unsigned char', label='MC-S-SR01s Set'}, -- 6C
{ctype='unsigned char', label='MC-S-SR02s Set'}, -- 6D
{ctype='unsigned char', label='MC-S-SR03s Set'}, -- 6E
{ctype='unsigned char', label='Liquefaction Spheres Set'}, -- 6F
{ctype='unsigned char', label='Induration Spheres Set'}, -- 70
{ctype='unsigned char', label='Detonation Spheres Set'}, -- 71
{ctype='unsigned char', label='Scission Spheres Set'}, -- 72
{ctype='unsigned char', label='Impaction Spheres Set'}, -- 73
{ctype='unsigned char', label='Reverberation Spheres Set'}, -- 74
{ctype='unsigned char', label='Transfixion Spheres Set'}, -- 75
{ctype='unsigned char', label='Compression Spheres Set'}, -- 76
{ctype='unsigned char', label='Fusion Spheres Set'}, -- 77
{ctype='unsigned char', label='Distortion Spheres Set'}, -- 78
{ctype='unsigned char', label='Fragmentation Spheres Set'}, -- 79
{ctype='unsigned char', label='Gravitation Spheres Set'}, -- 7A
{ctype='unsigned char', label='Light Spheres Set'}, -- 7B
{ctype='unsigned char', label='Darkness Spheres Set'}, -- 7C
{ctype='data[0x03]', label='_unknown1'}, -- 7D Presumably Unused Padding
{ctype='signed int', label='Silver A.M.A.N. Vouchers Stored'}, -- 80
}
types.ability_recast = L{
{ctype='unsigned short', label='Duration', fn=div+{1}}, -- 00
{ctype='unsigned char', label='_unknown1', const=0x00}, -- 02
{ctype='unsigned char', label='Recast', fn=arecast}, -- 03
{ctype='unsigned int', label='_unknown2'} -- 04
}
-- Ability timers
fields.incoming[0x119] = L{
{ref=types.ability_recast, count=0x1F}, -- 04
}
return fields
--[[
Copyright © 2013-2015, Windower
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of Windower nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Windower BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]
|