-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathPacket.h
2989 lines (2639 loc) · 84.3 KB
/
Packet.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
// packet.h - RO EP 6.0 packet
// Collected by JunkBot
// last updated: 14 May 2004
//----------------------------------------------------------------------------
#ifndef _PACKET_H
#define _PACKET_H
#include <winsock.h>
#ifdef __cplusplus
extern "C" {
#endif
#pragma pack(1) // solve the alignment problem
//--------------------------------------------------------------------
// header for variable length message
typedef struct
{
unsigned short cmd; // 00-01
unsigned short msglen; // 02-03
} msghdr;
//--------------------------------------------------------------------
// 0x0000: Flushing ?? - we've got this message when connected to server
typedef struct
{
unsigned short cmd; // 00-01
unsigned char unknown[2]; // 02-03
} msg0x0000;
//--------------------------------------------------------------------
// 0x0064: Master Login
typedef struct
{
unsigned short cmd; // 00-01
unsigned long patch; // 02-05
unsigned char username[24]; // 06-29
unsigned char passwd[24]; // 30-53
unsigned char version; // 54
} msg0x0064;
//--------------------------------------------------------------------
// 0x0065: Game Login
typedef struct
{
unsigned short cmd; // 00-01
unsigned long accountID; // 02-05
unsigned long sessionID; // 06-09
unsigned long token; // 10-13
unsigned short unknown; // 14-15
unsigned char sex; // 16
} msg0x0065;
//--------------------------------------------------------------------
// 0x0066: Character Login
typedef struct
{
unsigned short cmd; // 00-01
unsigned char charID; // 02
} msg0x0066;
//--------------------------------------------------------------------
// 0x0069: Char Server Information
typedef struct
{
unsigned short cmd; // 00-01
unsigned short msglen; // 02-03
unsigned long sessionID; // 04-07
unsigned long accountID; // 08-11
unsigned long token; // 12-15
unsigned char serverinfo[30]; // 16-45
unsigned char sexID; // 46
} msg0x0069;
// server_info
// 00 - normal
// 01 - under maintenance
// 02 - for 18+ only
// 03-ff - reserved
typedef struct
{
struct in_addr ip; // 00-03
unsigned short port; // 04-05
unsigned char servername[20]; // 06-25
unsigned short players; // 26-27
unsigned short server_info; // 28-29 - see above
unsigned short new_server; // 30-31 - if 1 - display "new" before server name
} msg0x0069ex;
//--------------------------------------------------------------------
// 0x006A: Login Error
// result:
// 00 - id unregistered
// 01 - incorrect password
// 02 - id expired
// 03 - unused
// 04 - blocked by GM
// 05 - client version mismatched
// 06 - blocked until %s (infor in errormsg)
// 07 - too many players are online
// 08 - ???
// 09-62 - reserved
// 63 - id has been deleted
// 64-ff - reserved
typedef struct
{
unsigned short cmd; // 00-01
unsigned char result; // 02 - see above
unsigned char errormsg[20]; // 03-22
} msg0x006A;
//--------------------------------------------------------------------
// 0x006B: Character Information for Selection
// state:
// 00 - normal
// 01 - stoned (paralysed)
// 02 - frozen
// 03 - stun
// 04 - sleep
// 05 - reserved
// 06 - darkness
// ailments
// 0000 0000 0000 0001 - Poison
// 0000 0000 0000 0010 - Curse
// 0000 0000 0000 0100 - Silence
// 0000 0000 0000 1000 - Confusion
// 0000 0000 0001 0000 - blind
// 0000 0000 0010 0000 - something about pet?
// option
// 0000 0000 0000 0001 - Sight / Ruwach
// 0000 0000 0000 0010 - Hide
// 0000 0000 0000 0100 - Cloak
// 0000 0000 0000 1000 - Cart (Lv 1-40)
// 0000 0000 0001 0000 - Falcon
// 0000 0000 0010 0000 - Pecopeco
// 0000 0000 0100 0000 - Disappear
// 0000 0000 1000 0000 - Cart (Lv 41-65)
// 0000 0001 0000 0000 - Cart (Lv 66-80)
// 0000 0010 0000 0000 - Cart (Lv 81-90)
// 0000 0100 0000 0000 - Cart (Lv 91-99)
// 0000 1000 0000 0000 - Hideous Mark
// weapon
// 00 - Fist
// 01 - Dagger
// 02 - Sword
// 03 - 2-handed sword
// 04 - Spear
// 05 - 2-handed Spear
// 06 - Axe
// 07 - 2-handed Axe
// 08 - Mace
// 09 - Special Mace
// 10 - Wand
// 11 - Bow
// 12-15 reserved
// 16 - Katar
// 17 - Katar2
// 18 - Sword 2
// 19 - Axe 2
// 20 - Katar + Sword
// 21 - Katar + Axe
// 22 - Axe + Sword
// 23 - error
typedef struct
{
unsigned long charID; // 000-003
unsigned long baseExp; // 004-007
unsigned long zeny; // 008-011
unsigned long jobExp; // 012-015
unsigned long jobLv; // 016-019
unsigned long state; // 020-023 - see above
unsigned long ailments; // 024-027 - see above
unsigned long options; // 028-031 - see above
unsigned long karma; // 032-035
unsigned long manner; // 036-039
unsigned short status_pt; // 040-041 - unallocated status point
unsigned short HP; // 042-043
unsigned short maxHP; // 044-045
unsigned short SP; // 046-047
unsigned short maxSP; // 048-049
unsigned short move_delay; // 050-051
unsigned short jobID; // 052-053
unsigned short hair_style; // 054-055
unsigned short weapon; // 056-057 - see above
unsigned short baseLv; // 058-059
unsigned short skill_pt; // 060-061 - unallocated skill point
unsigned short lower_mask; // 062-063
unsigned short shield; // 064-065
unsigned short helmet; // 066-067
unsigned short mid_mask; // 068-069
unsigned short hair_color; // 070-071
unsigned short cloth_color; // 072-073
unsigned char name[24]; // 074-097
unsigned char STR; // 098
unsigned char AGI; // 099
unsigned char VIT; // 100
unsigned char INT; // 101
unsigned char DEX; // 102
unsigned char LUK; // 103
unsigned char index; // 104
unsigned char reserved; // 105
} msg0x006B;
//--------------------------------------------------------------------
// 0x006C: Bad Character Selection
typedef struct
{
unsigned short cmd; // 00-01
} msg0x006C;
//--------------------------------------------------------------------
// 0x006D: Create Character
typedef struct
{
unsigned short cmd; // 00-01
} msg0x006D;
//--------------------------------------------------------------------
// 0x006E: Character creation Failed
typedef struct
{
unsigned short cmd; // 00-01
unsigned char code; // 02 - 0 - name exists, 1 - underaged, 2-255 denied
} msg0x006E;
//--------------------------------------------------------------------
// 0x006F: Delete Character
typedef struct
{
unsigned short cmd; // 00-01
} msg0x006F;
//--------------------------------------------------------------------
// 0x0071: Map Server Information
typedef struct
{
unsigned short cmd; // 00-01
unsigned long charID; // 02-05
unsigned char mapname[16]; // 06-21
struct in_addr ip; // 22-25
unsigned short port; // 26-27
} msg0x0071;
//--------------------------------------------------------------------
// 0x0072: Map Login
typedef struct
{
unsigned short cmd; // 00-01
unsigned long accountID; // 02-05
unsigned long charID; // 06-09
unsigned long sessionID; // 10-13
unsigned long tick; // 14-17
unsigned char sex; // 18
} msg0x0072;
//--------------------------------------------------------------------
// 0x0073: Character Initial Position
// coordination format:
// xxxx xxxx xxyy yyyy yyyy dddd - x, y, direction
typedef struct
{
unsigned short cmd; // 00-01
unsigned long tick; // 02-05
unsigned char coord[3]; // 06-08 - see above
unsigned short reserved; // 09-10
} msg0x0073;
//--------------------------------------------------------------------
// 0x0075: Unknown
typedef struct
{
unsigned short cmd; // 00-01
unsigned char unknown[9]; // 02-10
} msg0x0075;
//--------------------------------------------------------------------
// 0x0077: Unknown
typedef struct
{
unsigned short cmd; // 00-01
unsigned char unknown[2]; // 02-03
} msg0x0077;
//--------------------------------------------------------------------
// 0x0078: Existing Character
typedef struct
{
unsigned short cmd; // 00-01
unsigned long id; // 02-05
unsigned short move_delay; // 06-07 - delay per block
unsigned short state; // 08-09 - see 0x006B
unsigned short ailments; // 10-11 - see 0x006B
unsigned short options; // 12-13 - see 0x006B
unsigned short type; // 14-15
unsigned short hair_style; // 16-17 - if value is 20 - it's a pet
unsigned short weapon; // 18-19
unsigned short lower_mask; // 20-21
unsigned short shield; // 22-23
unsigned short helmet; // 24-25
unsigned short mid_mask; // 26-27
unsigned short hair_color; // 28-29
unsigned short cloth_color; // 30-31
unsigned short head_dir; // 32-33
unsigned long guild_id; // 34-37
unsigned short guild_pos; // 38-39
unsigned short manner; // 40-41
unsigned short karma; // 42-43
unsigned char stance; // 44 - 0 - normal, 1 - ready to fight
unsigned char sex; // 45
unsigned char coord[3]; // 46-48 - see 0x0073
unsigned char unknown[2]; // 49-50
unsigned char Sitting; // 51 - 0 - standing, 1 - lying dead, 2 - sitting
unsigned short baseLv; // 52-53
} msg0x0078;
//--------------------------------------------------------------------
// 0x0079: Connected Character
typedef struct
{
unsigned short cmd; // 00-01
unsigned long id; // 02-05
unsigned short move_delay; // 06-07 - delay per block
unsigned short state; // 08-09 - see 0x006B
unsigned short ailments; // 10-11 - see 0x006B
unsigned short options; // 12-13 - see 0x006B
unsigned short type; // 14-15
unsigned short hair_style; // 16-17 - if value is 20 - it's a pet
unsigned short weapon; // 18-19
unsigned short lower_mask; // 20-21
unsigned short shield; // 22-23
unsigned short helmet; // 24-25
unsigned short mid_mask; // 26-27
unsigned short hair_color; // 28-29
unsigned short cloth_color; // 30-31
unsigned short head_dir; // 32-33
unsigned long guild_id; // 34-37
unsigned short guild_pos; // 38-39
unsigned short manner; // 40-41
unsigned short karma; // 42-43
unsigned char stance; // 44 - 0 - normal, 1 - ready to fight
unsigned char sex; // 45
unsigned char coord[3]; // 46-48 - see 0x0073
unsigned char unknown[2]; // 49-50
unsigned short baseLv; // 51-52
} msg0x0079;
//--------------------------------------------------------------------
// 0x007A: Unknown
typedef struct
{
unsigned short cmd; // 00-01
unsigned char unknown[2]; // 02-03
} msg0x007A;
//--------------------------------------------------------------------
// 0x007B: Character Move
// coord
// 0 1 2 3 4
// xxxx xxxx xxyy yyyy yyyy xxxx xxxx xxyy yyyy yyyy
// |--------- src --------| |--------- dst --------|
// orientation
// xxxxyyyy
// These packets contain the movement of pet (unnamed) Chon Chon
// it's ID is 00002b7C (7C 2B 00 00)
//21:44:33 Outgoing packet to client: 60 bytes
//0x0000 (0000):7b 00 xx xx xx xx 96 00 00 00 00 00 00 00 f3 03 {.|+.... ........
//0x0010 (0016):14 00 00 00 00 00 55 98 d5 54 00 00 00 00 00 00 ......U. .T......
//0x0020 (0032):00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
//0x0030 (0048):00 00 10 8c b1 10 cb 98 00 00 04 00
//21:46:14 Outgoing packet to client: 60 bytes
//0x0000 (0000):7b 00 xx xx xx xx 96 00 00 00 00 00 00 00 f3 03 {.|+.... ........
//0x0010 (0016):14 00 00 00 00 00 9a 23 d7 54 00 00 00 00 00 00 .......# .T......
//0x0020 (0032):00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........
//0x0030 (0048):00 00 0e cc 20 e4 c1 66 00 00 04 00 .......f ....
//
typedef struct
{
unsigned short cmd; // 00-01
unsigned long id; // 02-05
unsigned short move_delay; // 06-07 - delay per block
unsigned short state; // 08-09 - see 0x006B
unsigned short ailments; // 10-11 - see 0x006B
unsigned short options; // 12-13 - see 0x006B
unsigned short type; // 14-15
unsigned short hair_style; // 16-17 - if value is 20 - it's a pet
unsigned short weapon; // 18-19
unsigned short lower_mask; // 20-21
unsigned long tick; // 22-25
unsigned short shield; // 26-27
unsigned short helmet; // 28-29
unsigned short mid_mask; // 30-31
unsigned short hair_color; // 32-33
unsigned short cloth_color; // 34-35
unsigned short head_dir; // 36-37
unsigned long guild_id; // 38-41
unsigned short guild_pos; // 42-43
unsigned short manner; // 44-45
unsigned short karma; // 46-47
unsigned char stance; // 48 - 0 - normal, 1 - ready to fight
unsigned char sex; // 49
unsigned char coord[5]; // 50-54 - see above
unsigned char orientation; // 55 - see above
unsigned char unknown[2]; // 56-57
unsigned short baseLv; // 58-59
} msg0x007B;
//--------------------------------------------------------------------
// 0x007C: NPC respawn
typedef struct
{
unsigned short cmd; // 00-01
unsigned long id; // 02-05
unsigned short move_delay; // 06-07
unsigned short state; // 08-09 - see 0x006B
unsigned short ailments; // 10-11 - see 0x006B
unsigned short options; // 12-13 - see 0x006B
unsigned short lower_mask; // 14-15
unsigned long tick; // 16-19
unsigned short type; // 20-21
unsigned char unknown2[13]; // 22-34
unsigned char sex; // 35
unsigned char coord[3]; // 36-38 // see 0x0073
unsigned char unknown3[2]; // 39-40
} msg0x007C;
//--------------------------------------------------------------------
// 0x007D: Confirm Map is Loaded
typedef struct
{
unsigned short cmd; // 00-01
} msg0x007D;
//--------------------------------------------------------------------
// 0x007E: Time Sycnhronisation
typedef struct
{
unsigned short cmd; // 00-01
unsigned long time; // 02-05
} msg0x007E;
//--------------------------------------------------------------------
// 0x007F: Time Synchronisation
typedef struct
{
unsigned short cmd; // 00-01
unsigned long time; // 02-05
} msg0x007F;
//--------------------------------------------------------------------
// 0x0080: Character Died
typedef struct
{
unsigned short cmd; // 00-01
unsigned long ID; // 02-05
unsigned char type; // 06
} msg0x0080;
//--------------------------------------------------------------------
// 0x0081: Disconnected from Server
typedef struct
{
unsigned short cmd; // 00-01;
unsigned char code; // 02
} msg0x0081;
//--------------------------------------------------------------------
// 0x0085: Moving
//
// coordination format:
// xxxx xxxx xxyy yyyy yyyy dddd - x, y, direction
typedef struct
{
unsigned short cmd; // 00-01
unsigned char coord[3]; // 02-04
} msg0x0085;
//--------------------------------------------------------------------
// 0x0087: Character Moved
typedef struct
{
unsigned short cmd; // 00-01
unsigned long tick; // 02-05
unsigned char coord[5]; // 07-10
unsigned char orientation; // 11
} msg0x0087;
//--------------------------------------------------------------------
// 0x0088: New character position
typedef struct
{
unsigned short cmd; // 00-01
unsigned long id; // 02-05
unsigned short x; // 06-07
unsigned short y; // 08-09
} msg0x0088;
//--------------------------------------------------------------------
// 0x0089: Action
typedef struct
{
// action code
// 00 - attack once
// 02 - sitdown
// 03 - standup
// 07 - lock target
unsigned short cmd; // 00-01
unsigned long target; // 02-05
unsigned char action; // 06 07
} msg0x0089;
//--------------------------------------------------------------------
// 0x008A: Action to Character
// action type
// 00 - single attack
// 01 - pickup item
// 02 - sit down
// 03 - stand up
// 04 - attack to endured target
// 08 - multiple attack
// 0a - critical attack
// 0b - perfect dodge
typedef struct
{
unsigned short cmd; // 00-01
unsigned long srcID; // 02-05
unsigned long dstID; // 06-09
unsigned long tick; // 10-13
unsigned long src_speed; // 14-17
unsigned long dst_speed; // 18-21
unsigned short damage; // 22-23
unsigned short attack_count; // 24-25 - exclude lefthand damage
unsigned char actiontype; // 26 - see above
unsigned short lefthand_dmg; // 27-28
} msg0x008A;
//--------------------------------------------------------------------
// 0x008B: Action to Character
typedef struct
{
unsigned short cmd; // 00-01
unsigned long srcID; // 02-05
unsigned long dstID; // 06-09
unsigned long tick; // 10-13
unsigned long src_speed; // 14-17
unsigned long dst_speed; // 18-21
unsigned short damage; // 22-23
unsigned short attack_count; // 24-25 - exclude lefthand damage
unsigned char actiontype; // 26 - see 0x008A
unsigned short lefthand_dmg; // 27-28
} msg0x008B;
//--------------------------------------------------------------------
// 0x008C: Chat message
typedef struct
{
unsigned short cmd; // 00-01
unsigned short msglen; // 02-03
unsigned char msg[]; // 04-
} msg0x008C;
//--------------------------------------------------------------------
// 0x008D: Chat message
typedef struct
{
unsigned short cmd; // 00-01
unsigned short msglen; // 02-03
unsigned long ID; // 04-07
unsigned char msg[]; // 08-
} msg0x008D;
//--------------------------------------------------------------------
// 0x008E: Chat message
typedef struct
{
unsigned short cmd; // 00-01
unsigned short msglen; // 02-03
unsigned char msg[]; // 04-
} msg0x008E;
//--------------------------------------------------------------------
// 0x008F: Unknown
typedef struct
{
unsigned short cmd; // 00-01
unsigned char unknown[2]; // 02-03
} msg0x008F;
//--------------------------------------------------------------------
// 0x0090: Talk to NPC
typedef struct
{
unsigned short cmd; // 00-01
unsigned long npcID; // 02-05
unsigned char flag; // 06
} msg0x0090;
//--------------------------------------------------------------------
// 0x0091: Map Changed
typedef struct
{
unsigned short cmd; // 00-01
unsigned char mapname[16]; // 02-17
unsigned short x; // 18-19
unsigned short y; // 20-21
} msg0x0091;
//--------------------------------------------------------------------
// 0x0092: Map Server Changed
typedef struct
{
unsigned short cmd; // 00-01
unsigned char mapname[16]; // 02-17
unsigned short x; // 18-19
unsigned short y; // 20-21
struct in_addr ip; // 22-25
unsigned short port; // 26-27
} msg0x0092;
//--------------------------------------------------------------------
// 0x0093: Unknown
typedef struct
{
unsigned short cmd; // 00-01
} msg0x0093;
//--------------------------------------------------------------------
// 0x0094: Request for Player Information
typedef struct
{
unsigned short cmd; // 00-01
unsigned long accountID; // 02-05
} msg0x0094;
//--------------------------------------------------------------------
// 0x0095: Character's name
typedef struct
{
unsigned short cmd; // 00-01
unsigned long ID; // 02-05
unsigned char name[24]; // 06-29
} msg0x0095;
//--------------------------------------------------------------------
// 0x0096: Send private message
typedef struct
{
unsigned short cmd; // 00-01
unsigned short msglen; // 02-03
unsigned char name[24]; // 04-27
unsigned char msg[]; // 28-
} msg0x0096;
//--------------------------------------------------------------------
// 0x0097: Incoming Whisper
typedef struct
{
unsigned short cmd; // 00-01
unsigned short msglen; // 02-03
unsigned char from[24]; // 04-27
unsigned char msg[]; // 28-
} msg0x0097;
//--------------------------------------------------------------------
// 0x0098: Whisper Result
typedef struct
{
unsigned short cmd; // 00-01
unsigned char result; // 02
} msg0x0098;
//--------------------------------------------------------------------
// 0x009A: Chat (9A)
typedef struct
{
unsigned short cmd; // 00-01
unsigned short msglen; // 02-03
unsigned char msg[]; // 04-
} msg0x009A;
//--------------------------------------------------------------------
// 0x009B: Look At (outgoing)
typedef struct
{
unsigned short cmd; // 00-01
unsigned short head; // 02-03 - 0 forward, 1 left, 2 right
unsigned char body; // 04 - 0 north, 1 - north-west, 2 - west, 3 - south-west, 4 - south, 5 - south-east, 6 - east, 7 - north-west
} msg0x009B;
//--------------------------------------------------------------------
// 0x009C: Look At (incoming)
typedef struct
{
unsigned short cmd; // 00-01
unsigned long ID; // 02-05
unsigned short head; // 06-07 - 0 forward, 1 left, 2 right
unsigned char body; // 08 - see 0x009B
} msg0x009C;
//--------------------------------------------------------------------
// 0x009D: Item Exists
typedef struct
{
unsigned short cmd; // 00-01
unsigned long ID; // 02-05
unsigned short type; // 06-07
unsigned char nonequip; // 08
unsigned short x; // 09-10
unsigned short y; // 11-12
unsigned short amount; // 13-14
unsigned short unknown; // 15-16 - sub x, sub y ???
} msg0x009D;
//--------------------------------------------------------------------
// 0x009E: Item Appears
typedef struct
{
unsigned short cmd; // 00-01
unsigned long ID; // 02-05
unsigned short type; // 06-07
unsigned char nonequip; // 08
unsigned short x; // 09-10
unsigned short y; // 11-12
unsigned short unknown; // 13-14
unsigned short amount; // 15-16 - sub x, sub y ???
} msg0x009E;
//--------------------------------------------------------------------
// 0x009F: Pick Item
typedef struct
{
unsigned short cmd; // 00-01
unsigned long itemID; // 02-05
} msg0x009F;
//--------------------------------------------------------------------
// 0x00A0: Item Picked Up
typedef struct
{
unsigned short cmd; // 00-01
union
{
struct
{
unsigned short index; // 02-03
unsigned short amount; // 04-05
} inventory;
unsigned long id; // 02-05
} info;
unsigned short type; // 06-07
unsigned char identified; // 08
unsigned char element; // 09 - 00 - Neutral, 01 - Water, 02 - Earth, 03 - Fire, 04 Wind
unsigned char refine; // 10
// unsigned short slot[4]; // 11-18
union
{
unsigned short slot[4];
struct
{
unsigned short flag; // always = 0x00FF
unsigned char element; // 1 - Water, 2 - Earth, 3 - Fire, 4 - Wind
unsigned char strength; // 5 - very strong, 10 - very very strong
unsigned long bsid; // id of BS who build this weapon
} smitten;
} attributes; // 11-18
unsigned short equiptype; // 19-20
unsigned char category; // 21
unsigned char result; // 22
// result:
// 00 - success
// 01 - was picked by others
// 02 - Overweight
// 03 - success - add to existing item in inventory
// 04 - ??
// 05 - cannot have more than 30,000 pieces in inventory
// 06 - anti-looted
} msg0x00A0;
//--------------------------------------------------------------------
// 0x00A1: Item Disappeared
typedef struct
{
unsigned short cmd; // 00-01
unsigned long ID; // 02-05
} msg0x00A1;
//--------------------------------------------------------------------
// 0x00A2: Drop Item
typedef struct
{
unsigned short cmd; // 00-01
unsigned short index; // 02-03
unsigned long amount; // 04-07
} msg0x00A2;
//--------------------------------------------------------------------
// 0x00A3: Item in the Inventory
typedef struct
{
unsigned short index; // 00-01
unsigned short type; // 02-03
unsigned char category; // 04
unsigned char identified; // 05
unsigned short amount; // 06-07
unsigned short unknown; // 08-09
} msg0x00A3;
//--------------------------------------------------------------------
// 0x00A4: Equipment in the Inventory
// 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19
// -----------------------------------------------------------
// xx 00 82 05 09 01 00 00 00 00 00 05 ff 00 01 0a xx xx xx xx +5 Very Very Strong <name>'s Ice Lance
// xx 00 e0 05 05 01 00 00 00 00 00 08 ff 00 03 05 xx xx xx xx +8 Very Strong <name>'s Fire Mace
// xx 00 82 05 09 01 00 00 00 00 00 05 ff 00 03 0a xx xx xx xx +5 Very Very Strong <name>'s Fire Lance
// xx 00 82 05 09 01 00 00 00 00 00 05 ff 00 04 0a xx xx xx xx +5 Very Very Strong <name>'s Wind Lance
typedef struct
{
unsigned short index; // 00-01
unsigned short type; // 02-03
unsigned char category; // 04
unsigned char identified; // 05
unsigned short equiptype; // 06-07
unsigned short equipping; // 08-09
unsigned char element; // 10
unsigned char refine; // 11
// unsigned short slot[4]; // 12-19
union
{
unsigned short slot[4];
struct
{
unsigned short flag; // always = 0x00FF
unsigned char element; // 1 - Water, 2 - Earth, 3 - Fire, 4 - Wind
unsigned char strength; // 5 - very strong, 10 - very very strong
unsigned long bsid; // id of BS who build this weapon
} smitten;
} attributes; // 12-19
} msg0x00A4;
//--------------------------------------------------------------------
// 0x00A5: Item in Storage
typedef struct
{
unsigned short index; // 00-01
unsigned short type; // 02-03
unsigned char category; // 04
unsigned char identified; // 05 << always 1?
unsigned long amount; // 06-09
} msg0x00A5;
//--------------------------------------------------------------------
// 0x00A6: Equipment in Storage
typedef struct
{
unsigned short index; // 00-01
unsigned short type; // 02-03
unsigned char category; // 04
unsigned char identified; // 05
unsigned short equiptype; // 06-07
unsigned short equipping; // 08-09
unsigned char element; // 10
unsigned char refine; // 11
union
{
unsigned short slot[4];
struct
{
unsigned short flag; // always = 0x00FF
unsigned char element; // 1 - Water, 2 - Earth, 3 - Fire, 4 - Wind
unsigned char strength; // 5 - very strong, 10 - very very strong
unsigned long bsid; // id of BS who build this weapon
} smitten;
} attributes; // 12-19
} msg0x00A6;
//--------------------------------------------------------------------
// 0x00A7: Use item
typedef struct
{
unsigned short cmd; // 00-01
unsigned short index; // 02-03
unsigned long accID; // 04-07
} msg0x00A7;
//--------------------------------------------------------------------
// 0x00A8: Item used
typedef struct
{
unsigned short cmd; // 00-01
unsigned short index; // 02-03
unsigned short remaining; // 04-05
unsigned char amount; // 06
} msg0x00A8;
//--------------------------------------------------------------------
// 0x00A9: Equip equipment
typedef struct
{
unsigned short cmd; // 00-01
unsigned short index; // 02-03
unsigned short equiptype; // 04-05
} msg0x00A9;
//--------------------------------------------------------------------
// 0x00AA: Equipment equipped
typedef struct
{
unsigned short cmd; // 00-01
unsigned short index; // 02-03
unsigned short equipping; // 04-05
unsigned char result; // 06 : 1 = success
} msg0x00AA;
//--------------------------------------------------------------------
// 0x00AB: Unequip equipment
typedef struct
{
unsigned short cmd; // 00-01
unsigned short index; // 02-03
} msg0x00AB;
//--------------------------------------------------------------------
// 0x00AC: Equipment unequipped
typedef struct
{
unsigned short cmd; // 00-01
unsigned short index; // 02-03
unsigned short equipping; // 04-05
unsigned char result; // 06 : 1 = successfully unequipped
} msg0x00AC;
//--------------------------------------------------------------------
// 0x00AF: Item Dropped
typedef struct
{
unsigned short cmd; // 00-01