-
Notifications
You must be signed in to change notification settings - Fork 757
/
packets_struct.h
5995 lines (5548 loc) · 157 KB
/
packets_struct.h
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
/**
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
* Copyright (C) 2013-2024 Hercules Dev Team
*
* Hercules is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* Hercules Renewal: Phase Two http://herc.ws/board/topic/383-hercules-renewal-phase-two/ */
#ifndef MAP_PACKETS_STRUCT_H
#define MAP_PACKETS_STRUCT_H
#include "common/cbasetypes.h"
#include "common/mmo.h"
#include "common/packetsstatic_len.h"
// Packet DB
#define MAX_PACKET_POS 20
/**
*
**/
enum packet_headers {
banking_withdraw_ackType = 0x9aa,
banking_deposit_ackType = 0x9a8,
banking_checkType = 0x9a6,
cart_additem_ackType = 0x12c,
sc_notickType = 0x196,
#if PACKETVER < 4
idle_unitType = 0x78,
#elif PACKETVER < 7
idle_unitType = 0x1d8,
#elif PACKETVER < 20080102
idle_unitType = 0x22a,
#elif PACKETVER < 20091103
idle_unitType = 0x2ee,
#elif PACKETVER < 20101124
idle_unitType = 0x7f9,
#elif PACKETVER < 20120221
idle_unitType = 0x857,
#elif PACKETVER < 20131223
idle_unitType = 0x915,
#elif PACKETVER < 20150513
idle_unitType = 0x9dd,
#else
idle_unitType = 0x9ff,
#endif
#if PACKETVER >= 20120618
status_changeType = 0x983,
#elif PACKETVER >= 20090121
status_changeType = 0x43f,
#else
status_changeType = sc_notickType,/* 0x196 */
#endif
status_change2Type = 0x43f,
status_change_endType = 0x196,
#if PACKETVER < 20091103
spawn_unit2Type = 0x7c,
idle_unit2Type = 0x78,
#endif
#if PACKETVER < 20071113
damageType = 0x8a,
#elif PACKETVER < 20131223
damageType = 0x2e1,
#else
damageType = 0x8c8,
#endif
#if PACKETVER < 4
spawn_unitType = 0x79,
#elif PACKETVER < 7
spawn_unitType = 0x1d9,
#elif PACKETVER < 20080102
spawn_unitType = 0x22b,
#elif PACKETVER < 20091103
spawn_unitType = 0x2ed,
#elif PACKETVER < 20101124
spawn_unitType = 0x7f8,
#elif PACKETVER < 20120221
spawn_unitType = 0x858,
#elif PACKETVER < 20131223
spawn_unitType = 0x90f,
#elif PACKETVER < 20150513
spawn_unitType = 0x9dc,
#else
spawn_unitType = 0x9fe,
#endif
#if PACKETVER < 20080102
authokType = 0x73,
#elif PACKETVER < 20141022
authokType = 0x2eb,
// Some clients smaller than 20160330 cant be tested [4144]
#elif PACKETVER < 20160330
authokType = 0xa18,
#else
authokType = 0x2eb,
#endif
script_clearType = 0x8d6,
package_item_announceType = 0x7fd,
item_drop_announceType = 0x7fd,
#if PACKETVER < 4
unit_walkingType = 0x7b,
#elif PACKETVER < 7
unit_walkingType = 0x1da,
#elif PACKETVER < 20080102
unit_walkingType = 0x22c,
#elif PACKETVER < 20091103
unit_walkingType = 0x2ec,
#elif PACKETVER < 20101124
unit_walkingType = 0x7f7,
#elif PACKETVER < 20120221
unit_walkingType = 0x856,
#elif PACKETVER < 20131223
unit_walkingType = 0x914,
#elif PACKETVER < 20150513
unit_walkingType = 0x9db,
#else
unit_walkingType = 0x9fd,
#endif
bgqueue_ackType = 0x8d8,
bgqueue_notice_deleteType = 0x8db,
bgqueue_registerType = 0x8d7,
bgqueue_updateinfoType = 0x8d9,
bgqueue_checkstateType = 0x90a,
bgqueue_revokereqType = 0x8da,
bgqueue_battlebeginackType = 0x8e0,
bgqueue_notify_entryType = 0x8d9,
bgqueue_battlebeginsType = 0x8df,
notify_bounditemType = 0x2d3,
#if PACKETVER < 20110718
skill_entryType = 0x11f,
#elif PACKETVER < 20121212
skill_entryType = 0x8c7,
#elif PACKETVER < 20130731
skill_entryType = 0x99f,
#else
skill_entryType = 0x9ca,
#endif
graffiti_entryType = 0x1c9,
#if defined(PACKETVER_ZERO) || PACKETVER >= 20180418
dropflooritemType = 0xadd,
#elif PACKETVER > 20130000 /* not sure date */
dropflooritemType = 0x84b,
#else
dropflooritemType = 0x9e,
#endif
#if PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002
inventorylistnormalType = 0xb09,
#elif PACKETVER >= 20120925
inventorylistnormalType = 0x991,
#elif PACKETVER >= 20080102
inventorylistnormalType = 0x2e8,
#elif PACKETVER >= 20071002
inventorylistnormalType = 0x1ee,
#else
inventorylistnormalType = 0xa3,
#endif
#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20221024
inventorylistequipType = 0xb39,
#elif PACKETVER_MAIN_NUM >= 20181002 || PACKETVER_RE_NUM >= 20180912 || PACKETVER_ZERO_NUM >= 20180919
inventorylistequipType = 0xb0a,
#elif PACKETVER >= 20150226
inventorylistequipType = 0xa0d,
#elif PACKETVER >= 20120925
inventorylistequipType = 0x992,
#elif PACKETVER >= 20080102
inventorylistequipType = 0x2d0,
#elif PACKETVER >= 20071002
inventorylistequipType = 0x295,
#else
inventorylistequipType = 0xa4,
#endif
#if PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002
storageListNormalType = 0xb09,
#elif PACKETVER >= 20120925
storageListNormalType = 0x995,
#elif PACKETVER >= 20080102
storageListNormalType = 0x2ea,
#elif PACKETVER >= 20071002
storageListNormalType = 0x295,
#else
storageListNormalType = 0xa5,
#endif
#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20221024
storageListEquipType = 0xb39,
#elif PACKETVER_MAIN_NUM >= 20181002 || PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919
storageListEquipType = 0xb0a,
#elif PACKETVER >= 20150226
storageListEquipType = 0xa10,
#elif PACKETVER >= 20120925
storageListEquipType = 0x996,
#elif PACKETVER >= 20080102
storageListEquipType = 0x2d1,
#elif PACKETVER >= 20071002
storageListEquipType = 0x296,
#else
storageListEquipType = 0xa6,
#endif
#if PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919 || PACKETVER_MAIN_NUM >= 20181002
cartlistnormalType = 0xb09,
#elif PACKETVER >= 20120925
cartlistnormalType = 0x993,
#elif PACKETVER >= 20080102
cartlistnormalType = 0x2e9,
#elif PACKETVER >= 20071002
cartlistnormalType = 0x1ef,
#else
cartlistnormalType = 0x123,
#endif
#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20221024
cartlistequipType = 0xb39,
#elif PACKETVER_MAIN_NUM >= 20181002 || PACKETVER_RE_NUM >= 20180829 || PACKETVER_ZERO_NUM >= 20180919
cartlistequipType = 0xb0a,
#elif PACKETVER >= 20150226
cartlistequipType = 0xa0f,
#elif PACKETVER >= 20120925
cartlistequipType = 0x994,
#elif PACKETVER >= 20080102
cartlistequipType = 0x2d2,
#elif PACKETVER >= 20071002
cartlistequipType = 0x297,
#else
cartlistequipType = 0x122,
#endif
openvendingType = 0x136,
#if PACKETVER >= 20120925
equipitemType = 0x998,
#else
equipitemType = 0xa9,
#endif
#if PACKETVER >= 20120925
unequipitemackType = 0x99a,
#else
unequipitemackType = 0xac,
#endif
notifybindonequip = 0x2d3,
monsterhpType = 0x977,
maptypeproperty2Type = 0x99b,
#if PACKETVER >= 20131223 // version probably can be 20131030 [4144]
wisendType = 0x9df,
#else
wisendType = 0x98,
#endif
partyleaderchangedType = 0x7fc,
rouletteinfoackType = 0xa1c,
roulettgenerateackType = 0xa20,
roulettercvitemackType = 0xa22,
#if PACKETVER >= 20141016
achievementListType = 0xa23,
achievementUpdateType = 0xa24,
achievementRewardAckType = 0xa26,
#endif // PACKETVER >= 20141016
#if PACKETVER_ZERO_NUM >= 20181010 || PACKETVER >= 20181017
questListType = 0xaff, ///< ZC_ALL_QUEST_LIST4
#elif PACKETVER >= 20150513 // [4144] 0x09f8 handling in client from 2014-10-29aRagexe and 2014-03-26cRagexeRE
questListType = 0x9f8, ///< ZC_ALL_QUEST_LIST3
#elif PACKETVER >= 20141022
questListType = 0x97a, ///< ZC_ALL_QUEST_LIST2
#else // PACKETVER < 20141022
questListType = 0x2b1, ///< ZC_ALL_QUEST_LIST
#endif // PACKETVER >= 20141022
/* Rodex */
rodexicon = 0x09E7,
rodexwriteresult = 0x09ED,
rodexnextpage = 0x09F0,
rodexgetzeny = 0x09F2,
rodexgetitem = 0x09F4,
rodexdelete = 0x09F6,
rodexremoveitem = 0x0A07,
rodexopenwrite = 0x0A12,
#if PACKETVER < 20160601
rodexmailList = 0x09F0,
#elif PACKETVER < 20170419
rodexmailList = 0x0A7D,
#else // PACKETVER >= 20170419
rodexmailList = 0x0Ac2,
#endif
#if PACKETVER >= 20151223
skillscale = 0xA41,
#endif
#if PACKETVER >= 20130821
progressbarunit = 0x09D1,
#endif
#if PACKETVER >= 20171207
partymemberinfo = 0x0ae4,
partyinfo = 0x0ae5,
#elif PACKETVER_MAIN_NUM >= 20170524 || PACKETVER_RE_NUM >= 20170502 || defined(PACKETVER_ZERO)
partymemberinfo = 0x0a43,
partyinfo = 0x0a44,
#else
partymemberinfo = 0x01e9,
partyinfo = 0x00fb,
#endif
#if PACKETVER >= 20120716
clanOnlineCount = 0x0988, ///< ZC_NOTIFY_CLAN_CONNECTINFO
clanLeave = 0x0989, ///< ZC_ACK_CLAN_LEAVE
clanMessage = 0x098E, ///< ZC_NOTIFY_CLAN_CHAT
#endif
#if PACKETVER_ZERO_NUM >= 20181010 || PACKETVER >= 20181017
questAddType = 0xb0c,
#elif PACKETVER >= 20150513 // [4144] 0x09f9 handled in client from 2014-10-29aRagexe and 2014-03-26cRagexeRE
questAddType = 0x9f9,
#else
questAddType = 0x2b3,
#endif // PACKETVER < 20150513
#if PACKETVER_ZERO_NUM >= 20181010 || PACKETVER >= 20181017
questUpdateType = 0xafe,
#elif PACKETVER >= 20150513
questUpdateType = 0x9fa,
#else
questUpdateType = 0x2b5,
#endif // PACKETVER < 20150513
questUpdateType2 = 0x8fe,
#if PACKETVER >= 20180627
authError = 0xb02,
#elif PACKETVER >= 20101123
authError = 0x83e,
#else
authError = 0x6a,
#endif
#if PACKETVER >= 3
useItemAckType = 0x1c8,
#else
useItemAckType = 0xa8,
#endif
#if PACKETVER >= 4
sendLookType = 0x1d7,
#else
sendLookType = 0xc3,
#endif
#if PACKETVER >= 20141016
buyingStoreUpdateItemType = 0x9e6,
#else
buyingStoreUpdateItemType = 0x81b,
#endif
reqName = 0x95,
#if PACKETVER_MAIN_NUM >= 20170502 || PACKETVER_RE_NUM >= 20170419 || defined(PACKETVER_ZERO)
skilWarpPointType = 0xabe,
#else
skilWarpPointType = 0x11c,
#endif
#if PACKETVER_MAIN_NUM >= 20161019 || PACKETVER_RE_NUM >= 20160921 || defined(PACKETVER_ZERO)
guildExpulsion = 0xa82,
#elif PACKETVER >= 20100803
guildExpulsion = 0x839,
#else
guildExpulsion = 0x15c,
#endif
#if PACKETVER_MAIN_NUM >= 20161019 || PACKETVER_RE_NUM >= 20160921 || defined(PACKETVER_ZERO)
guildLeave = 0xa83,
#else
guildLeave = 0x15a,
#endif
};
#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20221024
DEFINE_PACKET_ID(ZC_PAR_4JOB_CHANGE, 0x0b25);
#endif // PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20221024
#if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
#pragma pack(push, 1)
#endif // not NetBSD < 6 / Solaris
struct PACKET_ZC_PAR_CHANGE {
int16 PacketType;
uint16 varID;
int32 count;
} __attribute__((packed));
DEFINE_PACKET_HEADER(ZC_PAR_CHANGE, 0x00b0);
struct PACKET_ZC_LONGPAR_CHANGE {
int16 PacketType;
uint16 varID;
int32 amount;
} __attribute__((packed));
DEFINE_PACKET_ID(ZC_LONGPAR_CHANGE, 0x00b1);
struct PACKET_ZC_STATUS_CHANGE {
int16 PacketType;
uint16 statusID;
uint8 value;
} __attribute__((packed));
DEFINE_PACKET_HEADER(ZC_STATUS_CHANGE, 0x00be);
struct PACKET_ZC_NOTIFY_CARTITEM_COUNTINFO {
int16 PacketType;
int16 curCount;
int16 maxCount;
int32 curWeight;
int32 maxWeight;
} __attribute__((packed));
DEFINE_PACKET_HEADER(ZC_NOTIFY_CARTITEM_COUNTINFO, 0x0121);
struct PACKET_ZC_ATTACK_RANGE {
int16 PacketType;
int16 currentAttRange;
} __attribute__((packed));
DEFINE_PACKET_HEADER(ZC_ATTACK_RANGE, 0x013a);
struct PACKET_ZC_COUPLESTATUS {
int16 PacketType;
uint32 statusType;
int32 defaultStatus;
int32 plusStatus;
} __attribute__((packed));
DEFINE_PACKET_ID(ZC_COUPLESTATUS, 0x0141);
#if PACKETVER_MAIN_NUM >= 20170906 || PACKETVER_RE_NUM >= 20170830 || defined(PACKETVER_ZERO)
struct PACKET_ZC_LONGLONGPAR_CHANGE {
int16 PacketType;
uint16 varID;
int64 amount;
} __attribute__((packed));
DEFINE_PACKET_ID(ZC_LONGLONGPAR_CHANGE, 0x0acb);
#endif // PACKETVER_MAIN_NUM >= 20170906 || PACKETVER_RE_NUM >= 20170830 || defined(PACKETVER_ZERO)
/**
* structs for data
*/
struct EQUIPSLOTINFO {
#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
uint32 card[4];
#else
uint16 card[4];
#endif
} __attribute__((packed));
struct NORMALITEM_INFO {
int16 index;
#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
uint32 ITID;
#else
uint16 ITID;
#endif
uint8 type;
#if PACKETVER < 20120925
uint8 IsIdentified;
#endif
int16 count;
#if PACKETVER >= 20120925
uint32 WearState;
#else
uint16 WearState;
#endif
#if PACKETVER >= 5
struct EQUIPSLOTINFO slot;
#endif
#if PACKETVER >= 20080102
int32 HireExpireDate;
#endif
#if PACKETVER >= 20120925
struct {
uint8 IsIdentified : 1;
uint8 PlaceETCTab : 1;
uint8 SpareBits : 6;
} Flag;
#endif
} __attribute__((packed));
struct ItemOptions {
int16 index;
int16 value;
uint8 param;
} __attribute__((packed));
// TODO split struct inside blocks of #if/#elif
struct EQUIPITEM_INFO {
int16 index;
#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
uint32 ITID;
#else
uint16 ITID;
#endif
uint8 type;
#if PACKETVER < 20120925
uint8 IsIdentified;
#endif
#if PACKETVER >= 20120925
uint32 location;
uint32 WearState;
#else
uint16 location;
uint16 WearState;
#endif
#if PACKETVER < 20120925
uint8 IsDamaged;
#endif
#if !(PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20221024)
uint8 RefiningLevel;
#endif // !(PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20221024)
struct EQUIPSLOTINFO slot;
#if PACKETVER >= 20071002
int32 HireExpireDate;
#endif
#if PACKETVER >= 20080102
uint16 bindOnEquipType;
#endif
#if PACKETVER >= 20100629
uint16 wItemSpriteNumber;
#endif
#if PACKETVER >= 20150226
uint8 option_count;
struct ItemOptions option_data[MAX_ITEM_OPTIONS];
#endif
#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20221024
uint8 RefiningLevel;
uint8 grade;
#endif // PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20221024
#if PACKETVER >= 20120925
struct {
uint8 IsIdentified : 1;
uint8 IsDamaged : 1;
uint8 PlaceETCTab : 1;
uint8 SpareBits : 5;
} Flag;
#endif
} __attribute__((packed));
struct packet_authok {
int16 PacketType;
uint32 startTime;
uint8 PosDir[3];
uint8 xSize;
uint8 ySize;
#if PACKETVER >= 20080102
int16 font;
#endif
// Some clients smaller than 20160330 cant be tested [4144]
#if PACKETVER >= 20141022 && PACKETVER < 20160330
uint8 sex;
#endif
} __attribute__((packed));
struct packet_monster_hp {
int16 PacketType;
uint32 GID;
int32 HP;
int32 MaxHP;
} __attribute__((packed));
struct packet_sc_notick {
int16 PacketType;
int16 index;
uint32 AID;
uint8 state;
} __attribute__((packed));
// TODO put struct under #ifdef/#elif
// [4144] dates unconfirmed
struct PACKET_ZC_ITEM_PICKUP_ACK {
int16 PacketType;
uint16 Index;
uint16 count;
#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
uint32 nameid;
#else
uint16 nameid;
#endif
uint8 IsIdentified;
uint8 IsDamaged;
#if !(PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20221024)
uint8 refiningLevel;
#endif // !(PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20221024)
struct EQUIPSLOTINFO slot;
#if PACKETVER >= 20120925
uint32 location;
#else
uint16 location;
#endif
uint8 type;
uint8 result;
#if PACKETVER >= 20061218
int32 HireExpireDate;
#endif
#if PACKETVER >= 20071002
uint16 bindOnEquipType;
#endif
#if PACKETVER >= 20150226
struct ItemOptions option_data[MAX_ITEM_OPTIONS];
#endif
#if PACKETVER >= 20160921
uint8 favorite;
uint16 look;
#endif
#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20221024
uint8 refiningLevel;
uint8 grade;
#endif // PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20221024
} __attribute__((packed));
#if PACKETVER_MAIN_NUM >= 20200916 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20221024
DEFINE_PACKET_HEADER(ZC_ITEM_PICKUP_ACK, 0x0b41);
#elif PACKETVER >= 20160921
DEFINE_PACKET_HEADER(ZC_ITEM_PICKUP_ACK, 0x0a37);
#elif PACKETVER >= 20150226
DEFINE_PACKET_HEADER(ZC_ITEM_PICKUP_ACK, 0x0a0c);
#elif PACKETVER >= 20120925
DEFINE_PACKET_HEADER(ZC_ITEM_PICKUP_ACK, 0x0990);
#elif PACKETVER >= 20071002
DEFINE_PACKET_HEADER(ZC_ITEM_PICKUP_ACK, 0x02d4);
#elif PACKETVER >= 20061218
DEFINE_PACKET_HEADER(ZC_ITEM_PICKUP_ACK, 0x029a);
#else
DEFINE_PACKET_HEADER(ZC_ITEM_PICKUP_ACK, 0x00a0);
#endif
struct packet_dropflooritem {
int16 PacketType;
uint32 ITAID;
#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
uint32 ITID;
#else
uint16 ITID;
#endif
#if PACKETVER >= 20130000 /* not sure date */
uint16 type;
#endif
uint8 IsIdentified;
int16 xPos;
int16 yPos;
uint8 subX;
uint8 subY;
int16 count;
#if defined(PACKETVER_ZERO) || PACKETVER >= 20180418
int8 showdropeffect;
int16 dropeffectmode;
#endif
} __attribute__((packed));
struct packet_idle_unit2 {
#if PACKETVER < 20091103
int16 PacketType;
#if PACKETVER >= 20071106
uint8 objecttype;
#endif
uint32 GID;
int16 speed;
int16 bodyState;
int16 healthState;
int16 effectState;
int16 job;
uint16 head;
uint16 weapon;
uint16 accessory;
uint16 shield;
uint16 accessory2;
uint16 accessory3;
int16 headpalette;
int16 bodypalette;
int16 headDir;
uint32 GUID;
int16 GEmblemVer;
int16 honor;
int16 virtue;
uint8 isPKModeON;
uint8 sex;
uint8 PosDir[3];
uint8 xSize;
uint8 ySize;
uint8 state;
int16 clevel;
#else // ! PACKETVER < 20091103
UNAVAILABLE_STRUCT;
#endif // PACKETVER < 20091103
} __attribute__((packed));
struct packet_spawn_unit2 {
#if PACKETVER < 20091103
int16 PacketType;
#if PACKETVER >= 20071106
uint8 objecttype;
#endif
uint32 GID;
int16 speed;
int16 bodyState;
int16 healthState;
int16 effectState;
uint16 head;
uint16 weapon;
uint16 accessory;
int16 job;
uint16 shield;
uint16 accessory2;
uint16 accessory3;
int16 headpalette;
int16 bodypalette;
int16 headDir;
uint8 isPKModeON;
uint8 sex;
uint8 PosDir[3];
uint8 xSize;
uint8 ySize;
#else // ! PACKETVER < 20091103
UNAVAILABLE_STRUCT;
#endif // PACKETVER < 20091103
} __attribute__((packed));
struct packet_spawn_unit {
int16 PacketType;
#if PACKETVER >= 20091103
int16 PacketLength;
uint8 objecttype;
#endif
#if PACKETVER >= 20131223
uint32 AID;
#endif
uint32 GID;
int16 speed;
int16 bodyState;
int16 healthState;
#if PACKETVER < 20080102
int16 effectState;
#else
int32 effectState;
#endif
int16 job;
uint16 head;
#if PACKETVER < 7
uint16 weapon;
#else
uint32 weapon;
#endif
#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
uint32 shield;
#endif
uint16 accessory;
#if PACKETVER < 7
uint16 shield;
#endif
uint16 accessory2;
uint16 accessory3;
int16 headpalette;
int16 bodypalette;
int16 headDir;
#if PACKETVER >= 20101124
uint16 robe;
#endif
uint32 GUID;
int16 GEmblemVer;
int16 honor;
#if PACKETVER > 7
int32 virtue;
#else
int16 virtue;
#endif
uint8 isPKModeON;
uint8 sex;
uint8 PosDir[3];
uint8 xSize;
uint8 ySize;
int16 clevel;
#if PACKETVER >= 20080102
int16 font;
#endif
#if PACKETVER >= 20120221
int32 maxHP;
int32 HP;
uint8 isBoss;
#endif
#if PACKETVER >= 20150513
int16 body;
#endif
/* Might be earlier, this is when the named item bug began */
#if PACKETVER >= 20131223
char name[NAME_LENGTH];
#endif
} __attribute__((packed));
struct packet_unit_walking {
int16 PacketType;
#if PACKETVER >= 20091103
int16 PacketLength;
#endif
#if PACKETVER >= 20071106
uint8 objecttype;
#endif
#if PACKETVER >= 20131223
uint32 AID;
#endif
uint32 GID;
int16 speed;
int16 bodyState;
int16 healthState;
#if PACKETVER < 7
int16 effectState;
#else
int32 effectState;
#endif
int16 job;
uint16 head;
#if PACKETVER < 7
uint16 weapon;
#else
uint32 weapon;
#endif
#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
uint32 shield;
#endif
uint16 accessory;
uint32 moveStartTime;
#if PACKETVER < 7
uint16 shield;
#endif
uint16 accessory2;
uint16 accessory3;
int16 headpalette;
int16 bodypalette;
int16 headDir;
#if PACKETVER >= 20101124
uint16 robe;
#endif
uint32 GUID;
int16 GEmblemVer;
int16 honor;
#if PACKETVER > 7
int32 virtue;
#else
int16 virtue;
#endif
uint8 isPKModeON;
uint8 sex;
uint8 MoveData[6];
uint8 xSize;
uint8 ySize;
int16 clevel;
#if PACKETVER >= 20080102
int16 font;
#endif
#if PACKETVER >= 20120221
int32 maxHP;
int32 HP;
uint8 isBoss;
#endif
#if PACKETVER >= 20150513
uint16 body;
#endif
/* Might be earlier, this is when the named item bug began */
#if PACKETVER >= 20131223
char name[NAME_LENGTH];
#endif
} __attribute__((packed));
struct packet_idle_unit {
int16 PacketType;
#if PACKETVER >= 20091103
int16 PacketLength;
uint8 objecttype;
#endif
#if PACKETVER >= 20131223
uint32 AID;
#endif
uint32 GID;
int16 speed;
int16 bodyState;
int16 healthState;
#if PACKETVER < 20080102
int16 effectState;
#else
int32 effectState;
#endif
int16 job;
uint16 head;
#if PACKETVER < 7
uint16 weapon;
#else
uint32 weapon;
#endif
#if PACKETVER_MAIN_NUM >= 20181121 || PACKETVER_RE_NUM >= 20180704 || PACKETVER_ZERO_NUM >= 20181114
uint32 shield;
#endif
uint16 accessory;
#if PACKETVER < 7
uint16 shield;
#endif
uint16 accessory2;
uint16 accessory3;
int16 headpalette;
int16 bodypalette;
int16 headDir;
#if PACKETVER >= 20101124
uint16 robe;
#endif
uint32 GUID;
int16 GEmblemVer;
int16 honor;
#if PACKETVER > 7
int32 virtue;
#else
int16 virtue;
#endif
uint8 isPKModeON;
uint8 sex;
uint8 PosDir[3];
uint8 xSize;
uint8 ySize;
uint8 state;
int16 clevel;
#if PACKETVER >= 20080102
int16 font;
#endif
#if PACKETVER >= 20120221
int32 maxHP;
int32 HP;
uint8 isBoss;
#endif
#if PACKETVER >= 20150513
uint16 body;
#endif
/* Might be earlier, this is when the named item bug began */
#if PACKETVER >= 20131223
char name[NAME_LENGTH];
#endif
} __attribute__((packed));
struct packet_status_change {
int16 PacketType;
int16 index;
uint32 AID;
uint8 state;
#if PACKETVER >= 20120618
uint32 Total;
#endif
#if PACKETVER >= 20090121
uint32 Left;
int32 val1;
int32 val2;
int32 val3;
#endif
} __attribute__((packed));
struct packet_status_change_end {
int16 PacketType;
int16 index;
uint32 AID;
uint8 state;
} __attribute__((packed));
struct packet_status_change2 {
int16 PacketType;
int16 index;
uint32 AID;
uint8 state;
uint32 Left;
int32 val1;
int32 val2;
int32 val3;
} __attribute__((packed));
struct packet_maptypeproperty2 {
int16 PacketType;
int16 type;
struct {
uint32 party : 1; // Show attack cursor on non-party members (PvP)
uint32 guild : 1; // Show attack cursor on non-guild members (GvG)
uint32 siege : 1; // Show emblem over characters' heads when in GvG (WoE castle)
uint32 mineffect : 1; // Automatically enable /mineffect
uint32 nolockon : 1; // TODO: What does this do? (shows attack cursor on non-party members)
uint32 countpk : 1; /// Show the PvP counter
uint32 nopartyformation : 1; /// Prevent party creation/modification
uint32 bg : 1; // TODO: What does this do? Probably related to Battlegrounds, but I'm not sure on the effect
uint32 nocostume : 1; /// Does not show costume sprite.
uint32 usecart : 1; /// Allow opening cart inventory
uint32 summonstarmiracle : 1; // TODO: What does this do? Related to Taekwon Masters, but I have no idea.
uint32 SpareBits : 21; /// Currently ignored, reserved for future updates
} flag;
} __attribute__((packed));
struct packet_bgqueue_ack {
int16 PacketType;
uint8 type;
char bg_name[NAME_LENGTH];
} __attribute__((packed));
struct packet_bgqueue_notice_delete {
int16 PacketType;
uint8 type;
char bg_name[NAME_LENGTH];
} __attribute__((packed));
struct packet_bgqueue_register {
int16 PacketType;
int16 type;
char bg_name[NAME_LENGTH];
} __attribute__((packed));
struct packet_bgqueue_update_info {
int16 PacketType;
char bg_name[NAME_LENGTH];
int32 position;