1 /*!
2  * \file
3  * \ingroup protocol
4  * \brief this file defines the core client server protocol.
5  */
6 #ifndef __CLIENT_SERV_H__
7 #define __CLIENT_SERV_H__
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*!
14  * \name Actor types
15  */
16 /*! @{ */
17 typedef enum actor_types_type
18 {
19 	human_female = 0,
20 	human_male = 1,
21 	elf_female = 2,
22 	elf_male = 3,
23 	dwarf_female = 4,
24 	dwarf_male = 5,
25 	wraith = 6,
26 	cyclops = 7,
27 	beaver = 8,
28 	rat = 9,
29 	goblin_male_2 = 10,
30 	goblin_female_1 = 11,
31 	town_folk4 = 12,
32 	town_folk5 = 13,
33 	shop_girl3 = 14,
34 	deer = 15,
35 	bear = 16,
36 	wolf = 17,
37 	white_rabbit = 18,
38 	brown_rabbit = 19,
39 	boar = 20,
40 	bear2 = 21,
41 	snake1 = 22,
42 	snake2 = 23,
43 	snake3 = 24,
44 	fox = 25,
45 	puma = 26,
46 	ogre_male_1 = 27,
47 	goblin_male_1 = 28,
48 	orc_male_1 = 29,
49 	orc_female_1 = 30,
50 	skeleton = 31,
51 	gargoyle1 = 32,
52 	gargoyle2 = 33,
53 	gargoyle3 = 34,
54 	troll = 35,
55 	chimeran_wolf_mountain = 36,
56 	gnome_female = 37,
57 	gnome_male = 38,
58 	orchan_female = 39,
59 	orchan_male = 40,
60 	draegoni_female = 41,
61 	draegoni_male = 42,
62 	skunk_1 = 43,
63 	racoon_1 = 44,
64 	unicorn_1 = 45,
65 	chimeran_wolf_desert = 46,
66 	chimeran_wolf_forest = 47,
67 	bear_3 = 48,
68 	bear_4 = 49,
69 	panther = 50,
70 	feran = 51,
71 	leopard_1 = 52,
72 	leopard_2 = 53,
73 	chimeran_wolf_arctic = 54,
74 	tiger_1 = 55,
75 	tiger_2 = 56,
76 	armed_female_orc = 57,
77 	armed_male_orc = 58,
78 	armed_skeleton = 59,
79 	phantom_warrior = 60,
80 	imp = 61,
81 	brownie = 62,
82 	leprechaun = 63,
83 	spider_s_1 = 64,
84 	spider_s_2 = 65,
85 	spider_s_3 = 66,
86 	spider_l_1 = 67,
87 	spider_l_2 = 68,
88 	spider_l_3 = 69,
89 	wood_sprite = 70,
90 	spider_l_4 = 71,
91 	spider_s_4 = 72,
92 	giant_1 = 73,
93 	hobgoblin = 74,
94 	yeti = 75,
95 	snake4 = 76,
96 	feros = 77,
97 	dragon1 = 78
98 } actor_types_type;
99 /*! @} */
100 
101 /*!
102  * \name Skin colors
103  */
104 /*! @{ */
105 #define SKIN_BROWN		0
106 #define SKIN_NORMAL		1
107 #define SKIN_PALE		2
108 #define SKIN_TAN		3
109 #define SKIN_DARK_BLUE	4	// for Elf
110 #define SKIN_WHITE		5	// for Draegoni
111 /*! @} */
112 
113 /*!
114  * \name Shirt colors
115  */
116 /*! @{ */
117 #define SHIRT_BLACK 0
118 #define SHIRT_BLUE 1
119 #define SHIRT_BROWN 2
120 #define SHIRT_GREY 3
121 #define SHIRT_GREEN 4
122 #define SHIRT_LIGHTBROWN 5
123 #define SHIRT_ORANGE 6
124 #define SHIRT_PINK 7
125 #define SHIRT_PURPLE 8
126 #define SHIRT_RED 9
127 #define SHIRT_WHITE 10
128 #define SHIRT_YELLOW 11
129 #define SHIRT_LEATHER_ARMOR 12
130 #define SHIRT_CHAIN_ARMOR 13
131 #define SHIRT_STEEL_CHAIN_ARMOR 14
132 #define SHIRT_TITANIUM_CHAIN_ARMOR 15
133 #define SHIRT_IRON_PLATE_ARMOR 16
134 #define SHIRT_AUGMENTED_LEATHER_ARMOR 17
135 #define SHIRT_FUR 18
136 #define SHIRT_STEEL_PLATE_ARMOR 19
137 #define SHIRT_TITANIUM_PLATE_ARMOR 20
138 #define SHIRT_BRONZE_PLATE_ARMOR 21
139 
140 /*! @} */
141 
142 /*!
143  * \name No armor flags
144  */
145 /*! @{ */
146 #define NO_BODY_ARMOR 0
147 #define NO_PANTS_ARMOR 0
148 #define NO_BOOTS_ARMOR 0
149 /*! @} */
150 
151 /*!
152  * \name Hair colors
153  */
154 /*! @{ */
155 #define HAIR_BLACK	0
156 #define HAIR_BLOND	1
157 #define HAIR_BROWN	2
158 #define HAIR_GRAY	3
159 #define HAIR_RED	4
160 #define HAIR_WHITE	5
161 #define HAIR_BLUE	6	// for Draegoni
162 #define HAIR_GREEN	7	// for Draegoni
163 #define HAIR_PURPLE 8	// for Draegoni
164 #define HAIR_DARK_BROWN	9
165 #define HAIR_STRAWBERRY	10
166 #define HAIR_LIGHT_BLOND	11
167 #define HAIR_DIRTY_BLOND	12
168 #define HAIR_BROWN_GRAY	13
169 #define HAIR_DARK_GRAY	14
170 #define HAIR_DARK_RED	15
171 /*! @} */
172 
173 /*!
174  * \name Eyes colors
175  */
176 /*! @{ */
177 #define EYES_BROWN	0
178 #define EYES_DARK_BROWN	1
179 #define EYES_BROWN_RED	2
180 #define EYES_LIGHT_BLUE	3
181 #define EYES_BLUE	4
182 #define EYES_DARK_BLUE	5
183 #define EYES_LIGHT_GREEN	6
184 #define EYES_GREEN	7
185 #define EYES_DARK_GREEN	8
186 #define EYES_LAVENDER	9
187 #define EYES_VIOLET	10
188 #define EYES_GOLD	11
189 /*! @} */
190 
191 /*!
192  * \name Boots colors
193  */
194 /*! @{ */
195 #define BOOTS_BLACK 0
196 #define BOOTS_BROWN 1
197 #define BOOTS_DARKBROWN 2
198 #define BOOTS_DULLBROWN 3
199 #define BOOTS_LIGHTBROWN 4
200 #define BOOTS_ORANGE 5
201 #define BOOTS_LEATHER 6
202 #define BOOTS_FUR 7
203 #define BOOTS_IRON_GREAVE 8
204 #define BOOTS_STEEL_GREAVE 9
205 #define BOOTS_TITANIUM_GREAVE 10
206 #define BOOTS_BRONZE_GREAVE 11
207 #define BOOTS_AUGMENTED_LEATHER_GREAVE 12
208 /*! @} */
209 
210 /*!
211  * \name Pants colors
212  */
213 /*! @{ */
214 #define PANTS_BLACK 0
215 #define PANTS_BLUE 1
216 #define PANTS_BROWN 2
217 #define PANTS_DARKBROWN 3
218 #define PANTS_GREY 4
219 #define PANTS_GREEN 5
220 #define PANTS_LIGHTBROWN 6
221 #define PANTS_RED 7
222 #define PANTS_WHITE 8
223 #define PANTS_LEATHER 9
224 #define PANTS_IRON_CUISSES 10
225 #define PANTS_FUR 11
226 #define PANTS_STEEL_CUISSES 12
227 #define PANTS_TITANIUM_CUISSES 13
228 #define PANTS_BRONZE_CUISSES 14
229 #define PANTS_AUGMENTED_LEATHER_CUISSES 15
230 /*! @} */
231 
232 /*!
233  * \name Capes
234  */
235 /*! @{ */
236 #define CAPE_BLACK 0
237 #define CAPE_BLUE 1
238 #define CAPE_BLUEGRAY 2
239 #define CAPE_BROWN 3
240 #define CAPE_BROWNGRAY 4
241 #define CAPE_GRAY 5
242 #define CAPE_GREEN 6
243 #define CAPE_GREENGRAY 7
244 #define CAPE_PURPLE 8
245 #define CAPE_WHITE 9
246 #define CAPE_FUR 10
247 #define CAPE_GOLD 11
248 #define CAPE_RED 12
249 #define CAPE_ORANGE 13
250 #define CAPE_MOD 14
251 #define CAPE_DERIN 15
252 #define CAPE_RAVENOD 16
253 #define CAPE_PLACID 17
254 #define CAPE_LORD_VERMOR 18
255 #define CAPE_AISLINN 19
256 #define CAPE_SOLDUS 20
257 #define CAPE_LOTHARION 21
258 #define CAPE_LEARNER 22
259 #define CAPE_NONE 30
260 /*! @} */
261 
262 /*!
263  * \name Heads
264  */
265 /*! @{ */
266 #define HEAD_1 0
267 #define HEAD_2 1
268 #define HEAD_3 2
269 #define HEAD_4 3
270 #define HEAD_5 4
271 /*! @} */
272 
273 /*!
274  * \name Types of wearable items
275  */
276 /*! @{ */
277 #define KIND_OF_WEAPON 0
278 #define KIND_OF_SHIELD 1
279 #define KIND_OF_CAPE 2
280 #define KIND_OF_HELMET 3
281 #define KIND_OF_LEG_ARMOR 4
282 #define KIND_OF_BODY_ARMOR 5
283 #define KIND_OF_BOOT_ARMOR 6
284 #define KIND_OF_NECK 7
285 
286 //NECK ITEMS CODES
287 #define NECK_NONE 0
288 
289 
290 /*! @} */
291 
292 
293 
294 /*!
295  * \name Helmets
296  */
297 /*! @{ */
298 #define HELMET_IRON 0
299 #define HELMET_FUR 1
300 #define HELMET_LEATHER 2
301 #define HELMET_RACOON 3
302 #define HELMET_SKUNK 4
303 #define HELMET_CROWN_OF_MANA 5
304 #define HELMET_CROWN_OF_LIFE 6
305 #define HELMET_STEEL 7
306 #define HELMET_TITANIUM 8
307 #define HELMET_BRONZE 9
308 #define HELMET_NONE 20
309 /*! @} */
310 
311 /*!
312  * \name Shields
313  */
314 /*! @{ */
315 #define SHIELD_WOOD 0
316 #define SHIELD_WOOD_ENHANCED 1
317 #define SHIELD_IRON 2
318 #define SHIELD_STEEL 3
319 #define SHIELD_TITANIUM 4
320 #define SHIELD_BRONZE 5
321 #define QUIVER_ARROWS 7
322 #define SHIELD_NONE 11
323 #define QUIVER_BOLTS 13
324 /*! @} */
325 
326 /*!
327  * \name Weapons
328  */
329 /*! @{ */
330 #define WEAPON_NONE 0
331 #define SWORD_1 1
332 #define SWORD_2 2
333 #define SWORD_3 3
334 #define SWORD_4 4
335 #define SWORD_5 5
336 #define SWORD_6 6
337 #define SWORD_7 7
338 #define STAFF_1 8
339 #define STAFF_2 9
340 #define STAFF_3 10
341 #define STAFF_4 11
342 #define HAMMER_1 12
343 #define HAMMER_2 13
344 #define PICKAX 14
345 #define SWORD_1_FIRE 15
346 #define SWORD_2_FIRE 16
347 #define SWORD_2_COLD 17
348 #define SWORD_3_FIRE 18
349 #define SWORD_3_COLD 19
350 #define SWORD_3_MAGIC 20
351 #define SWORD_4_FIRE 21
352 #define SWORD_4_COLD 22
353 #define SWORD_4_MAGIC 23
354 #define SWORD_4_THERMAL 24
355 #define SWORD_5_FIRE 25
356 #define SWORD_5_COLD 26
357 #define SWORD_5_MAGIC 27
358 #define SWORD_5_THERMAL 28
359 #define SWORD_6_FIRE 29
360 #define SWORD_6_COLD 30
361 #define SWORD_6_MAGIC 31
362 #define SWORD_6_THERMAL 32
363 #define SWORD_7_FIRE 33
364 #define SWORD_7_COLD 34
365 #define SWORD_7_MAGIC 35
366 #define SWORD_7_THERMAL 36
367 #define PICKAX_MAGIC 37
368 #define BATTLEAXE_IRON 38
369 #define BATTLEAXE_STEEL 39
370 #define BATTLEAXE_TITANIUM 40
371 #define BATTLEAXE_IRON_FIRE 41
372 #define BATTLEAXE_STEEL_COLD 42
373 #define BATTLEAXE_STEEL_FIRE 43
374 #define BATTLEAXE_TITANIUM_COLD 44
375 #define BATTLEAXE_TITANIUM_FIRE 45
376 #define BATTLEAXE_TITANIUM_MAGIC 46
377 #define GLOVE_FUR 47
378 #define GLOVE_LEATHER 48
379 #define BONE_1 49
380 #define STICK_1 50
381 #define SWORD_EMERALD_CLAYMORE 51
382 #define SWORD_CUTLASS 52
383 #define SWORD_SUNBREAKER 53
384 #define SWORD_ORC_SLAYER 54
385 #define SWORD_EAGLE_WING 55
386 #define SWORD_RAPIER 56
387 #define SWORD_JAGGED_SABER 57
388 #define SWORD_BRONZE 58
389 #define BOW_LONG 64
390 #define BOW_SHORT 65
391 #define BOW_RECURVE 66
392 #define BOW_ELVEN 67
393 #define BOW_CROSS 68
394 
395 /*! @} */
396 
397 /*!
398  * \name Frames
399  */
400 /*! @{ */
401 #define frame_walk 0
402 #define frame_run 1
403 #define frame_die1 2
404 #define frame_die2 3
405 #define frame_pain1 4
406 #define frame_pain2 11
407 #define frame_pick 5
408 #define frame_drop 6
409 #define frame_idle 7
410 #define frame_harvest 8
411 #define frame_cast 9
412 #define frame_ranged 10
413 #define frame_sit 12
414 #define frame_stand 13
415 #define frame_sit_idle 14
416 #define frame_combat_idle 15
417 #define frame_in_combat 16
418 #define frame_out_combat 17
419 #define frame_attack_up_1 18
420 #define frame_attack_up_2 19
421 #define frame_attack_up_3 20
422 #define frame_attack_up_4 21
423 #define frame_attack_down_1 22
424 #define frame_attack_down_2 23
425 #define frame_attack_down_3 24
426 #define frame_attack_down_4 25
427 #define frame_attack_down_5 26
428 #define frame_attack_down_6 27
429 #define frame_attack_down_7 28
430 #define frame_attack_down_8 29
431 #define frame_attack_down_9 30
432 #define frame_attack_down_10 31
433 #define frame_attack_up_5 32
434 #define frame_attack_up_6 33
435 #define frame_attack_up_7 34
436 #define frame_attack_up_8 35
437 #define frame_attack_up_9 36
438 #define frame_attack_up_10 37
439 //frame values for poses (40 different poses)
440 #define frame_poses_start 100
441 #define frame_poses_end 140
442 /*! @} */
443 
444 /*!
445  * \name Colors
446  */
447 /*! @{ */
448 #define c_lbound 0
449 #define c_red1 0
450 #define c_red2 7
451 #define c_red3 14
452 #define c_red4 21
453 #define c_orange1 1
454 #define c_orange2 8
455 #define c_orange3 15
456 #define c_orange4 22
457 #define c_yellow1 2
458 #define c_yellow2 9
459 #define c_yellow3 16
460 #define c_yellow4 23
461 #define c_green1 3
462 #define c_green2 10
463 #define c_green3 17
464 #define c_green4 24
465 #define c_blue1 4
466 #define c_blue2 11
467 #define c_blue3 18
468 #define c_blue4 25
469 #define c_purple1 5
470 #define c_purple2 12
471 #define c_purple3 19
472 #define c_purple4 26
473 #define c_grey1 6
474 #define c_grey2 13
475 #define c_grey3 20
476 #define c_grey4 27
477 #define c_ubound 27
478 /*! @} */
479 
480 /*!
481  * \name Foreign chars
482  */
483 /*! @{ */
484 #define SPECIALCHAR_LBOUND 180
485 #define EACUTE 181
486 #define ACIRC 182
487 #define AGRAVE 183
488 #define CCEDIL 184
489 #define ECIRC 185
490 #define EUML 186
491 #define EGRAVE 187
492 #define IUML 188
493 #define OCIRC 189
494 #define uGRAVE 190
495 #define aUMLAUT 191
496 #define oUMLAUT 192
497 #define uUMLAUT 193
498 #define AUMLAUT 194
499 #define OUMLAUT 195
500 #define UUMLAUT 196
501 #define DOUBLES 197
502 #define aELIG 198
503 #define oSLASH 199
504 #define aRING 200
505 #define AELIG 201
506 #define OSLASH 202
507 #define ARING 203
508 #define EnyE 204
509 #define ENYE 205
510 #define aACCENT 206
511 #define AACCENT 207
512 #define EACCENT 208
513 #define iACCENT 209
514 #define IACCENT 210
515 #define oACCENT 211
516 #define OACCENT 212
517 #define uACCENT 213
518 #define UACCENT 214
519 #define SPECIALCHAR_UBOUND 214
520 
521 /*! @} */
522 
523 /*!
524  * \name Windows
525  */
526 /*! @{ */
527 #define RULE_WIN 1
528 #define RULE_INTERFACE 2
529 #define NEW_CHAR_INTERFACE 3
530 /*! @} */
531 
532 /*!
533  * \name Actor commands
534  *
535  * Note to other developers: \#defines are generally *bad form*.  They
536  * interfere with innocent calls, like my call to eye_candy.idle(), in very
537  * confusing ways (in my case, "expected unqualified-id before numeric
538  * constant").  This is what enums are for; please use them.  I'm fixing this
539  * one for you as an example.
540  *
541  *  - Karen (meme@daughtersoftiresias.org)
542  */
543 /*! @{ */
544 typedef enum actor_commands
545 {
546   nothing = 0,
547   kill_me = 1,
548   die1 = 3,
549   die2 = 4,
550   pain1 = 5,
551   pain2 = 17,
552   pick = 6,
553   drop = 7,
554   idle = 8,
555   harvest = 9,
556   cast = 10,
557   ranged = 11,
558   meele = 12,
559   sit_down = 13,
560   stand_up = 14,
561   turn_left = 15,
562   turn_right = 16,
563   enter_combat = 18,
564   leave_combat = 19,
565 
566   move_n = 20,
567   move_ne = 21,
568   move_e = 22,
569   move_se = 23,
570   move_s = 24,
571   move_sw = 25,
572   move_w = 26,
573   move_nw = 27,
574 
575 
576   run_n = 30,
577   run_ne = 31,
578   run_e = 32,
579   run_se = 33,
580   run_s = 34,
581   run_sw = 35,
582   run_w = 36,
583   run_nw = 37,
584 
585   turn_n = 38,
586   turn_ne = 39,
587   turn_e = 40,
588   turn_se = 41,
589   turn_s = 42,
590   turn_sw = 43,
591   turn_w = 44,
592   turn_nw = 45,
593 
594   attack_up_1 = 46,
595   attack_up_2 = 47,
596   attack_up_3 = 48,
597   attack_up_4 = 49,
598   attack_down_1 = 50,
599   attack_down_2 = 51,
600 
601   enter_aim_mode = 52,
602   leave_aim_mode = 53,
603   aim_mode_reload = 54,
604   aim_mode_fire = 55,
605   missile_miss = 56,
606   //unwear_bow = 57,
607   //unwear_quiver = 58,
608   missile_critical = 59,
609 
610   attack_down_3 = 60,
611   attack_down_4 = 61,
612   attack_down_5 = 62,
613   attack_down_6 = 63,
614   attack_down_7 = 64,
615   attack_down_8 = 65,
616   attack_down_9 = 66,
617   attack_down_10 = 67,
618 
619   attack_up_5 = 68,
620   attack_up_6 = 69,
621   attack_up_7 = 70,
622   attack_up_8 = 71,
623   attack_up_9 = 72,
624   attack_up_10 = 73,
625 
626   emote_cmd = 100,
627 
628   //from 100 to 255, commands are reserved for emotes
629 //#ifdef MORE_ATTACHED_ACTORS
630   wait_cmd=256, //to synch actor/horse (not sent by server)
631 //#endif
632 } actor_commands;
633 
634 /*! @} */
635 
636 
637 /*!
638  * \name Weather types
639  */
640 /*! @{ */
641 typedef enum
642 {
643 	//precipitation types MUST come first, in the same order as in weather.c . same indexen.
644 	weather_effect_rain = 1,
645 	weather_effect_snow = 2,
646 	weather_effect_hail = 3,
647 	weather_effect_sand = 4,
648 	weather_effect_dust = 5,
649 	weather_effect_lava = 6,
650 	//other effects can be put at the end
651 	weather_effect_wind = 20,
652 	weather_effect_leaves = 21
653 } weather_type;
654 
655 /*! @} */
656 
657 
658 /*!
659  * \name To server commands
660  */
661 /*! @{ */
662 #define MOVE_TO 1
663 #define SEND_PM 2
664 #define GET_PLAYER_INFO 5
665 #define RUN_TO 6
666 #define SIT_DOWN 7
667 #define SEND_ME_MY_ACTORS 8
668 #define SEND_OPENING_SCREEN 9
669 #define SEND_VERSION 10
670 #define TURN_LEFT 11
671 #define TURN_RIGHT 12
672 #define PING 13
673 #define HEART_BEAT 14
674 #define LOCATE_ME 15
675 #define USE_MAP_OBJECT 16
676 #define SEND_MY_STATS 17
677 #define SEND_MY_INVENTORY 18
678 #define LOOK_AT_INVENTORY_ITEM 19
679 #define MOVE_INVENTORY_ITEM 20
680 #define HARVEST 21
681 #define DROP_ITEM 22
682 #define PICK_UP_ITEM 23
683 #define LOOK_AT_GROUND_ITEM 24
684 #define INSPECT_BAG 25
685 #define S_CLOSE_BAG 26
686 #define LOOK_AT_MAP_OBJECT 27
687 #define TOUCH_PLAYER 28
688 #define RESPOND_TO_NPC 29
689 #define MANUFACTURE_THIS 30
690 #define USE_INVENTORY_ITEM 31
691 #define TRADE_WITH 32
692 #define ACCEPT_TRADE 33
693 #define REJECT_TRADE 34
694 #define EXIT_TRADE 35
695 #define PUT_OBJECT_ON_TRADE 36
696 #define REMOVE_OBJECT_FROM_TRADE 37
697 #define LOOK_AT_TRADE_ITEM 38
698 #define CAST_SPELL 39
699 #define ATTACK_SOMEONE 40
700 #define GET_KNOWLEDGE_INFO 41
701 #define ITEM_ON_ITEM 42
702 #define SEND_BOOK 43
703 #define GET_STORAGE_CATEGORY 44
704 #define DEPOSITE_ITEM 45
705 #define WITHDRAW_ITEM 46
706 #define LOOK_AT_STORAGE_ITEM 47
707 #define SPELL_NAME 48
708 #define SEND_VIDEO_INFO 49
709 #define POPUP_REPLY 50
710 #define FIRE_MISSILE_AT_OBJECT 51
711 
712 #define PING_RESPONSE 60
713 #define SET_ACTIVE_CHANNEL 61
714 
715 /* send: 16 bit quest id, request the server to supply quest title using HERE_IS_QUEST_ID */
716 #define WHAT_QUEST_IS_THIS_ID 63
717 
718 #define DO_EMOTE 70
719 
720 /* send: 16 bit buff bit-mask (only one set bit), server responds with SEND_BUFF_DURATION */
721 #define GET_BUFF_DURATION 71
722 
723 #define LOG_IN 140
724 #define CREATE_CHAR 141
725 
726 #define GET_DATE 230
727 #define GET_TIME 231
728 #define SERVER_STATS 232
729 #define ORIGINAL_IP 233
730 /*! @} */
731 
732 /*!
733  * \name To client commands
734  */
735 /*! @{ */
736 #define ADD_NEW_ACTOR 1
737 #define ADD_ACTOR_COMMAND 2
738 #define YOU_ARE 3
739 #define SYNC_CLOCK 4
740 #define NEW_MINUTE 5
741 #define REMOVE_ACTOR 6
742 #define CHANGE_MAP 7
743 #define COMBAT_MODE 8
744 #define KILL_ALL_ACTORS 9
745 #define GET_TELEPORTERS_LIST 10
746 #define PONG 11
747 #define TELEPORT_IN 12
748 #define TELEPORT_OUT 13
749 #define PLAY_SOUND 14
750 #define START_RAIN 15	//delete later on
751 #define STOP_RAIN 16	//delete later on
752 #define THUNDER 17
753 #define HERE_YOUR_STATS 18
754 #define HERE_YOUR_INVENTORY 19
755 #define INVENTORY_ITEM_TEXT 20
756 #define GET_NEW_INVENTORY_ITEM 21
757 #define REMOVE_ITEM_FROM_INVENTORY 22
758 #define HERE_YOUR_GROUND_ITEMS 23
759 #define GET_NEW_GROUND_ITEM 24
760 #define REMOVE_ITEM_FROM_GROUND 25
761 #define CLOSE_BAG 26
762 #define GET_NEW_BAG 27
763 #define GET_BAGS_LIST 28
764 #define DESTROY_BAG 29
765 #define NPC_TEXT 30
766 #define NPC_OPTIONS_LIST 31
767 #define CLOSE_NPC_MENU 32
768 #define SEND_NPC_INFO 33
769 #define GET_TRADE_INFO 34//delete later on
770 #define GET_TRADE_OBJECT 35
771 #define GET_TRADE_ACCEPT 36
772 #define GET_TRADE_REJECT 37
773 #define GET_TRADE_EXIT 38
774 #define REMOVE_TRADE_OBJECT 39
775 #define GET_YOUR_TRADEOBJECTS 40
776 #define GET_TRADE_PARTNER_NAME 41
777 #define GET_YOUR_SIGILS 42
778 #define SPELL_ITEM_TEXT 43
779 #define GET_ACTIVE_SPELL 44
780 #define GET_ACTIVE_SPELL_LIST 45
781 #define REMOVE_ACTIVE_SPELL 46
782 #define GET_ACTOR_DAMAGE 47
783 #define GET_ACTOR_HEAL 48
784 #define SEND_PARTIAL_STAT 49
785 #define SPAWN_BAG_PARTICLES 50
786 #define ADD_NEW_ENHANCED_ACTOR 51
787 #define ACTOR_WEAR_ITEM 52
788 #define ACTOR_UNWEAR_ITEM 53
789 #define PLAY_MUSIC 54
790 #define GET_KNOWLEDGE_LIST 55
791 #define GET_NEW_KNOWLEDGE 56
792 #define GET_KNOWLEDGE_TEXT 57
793 #define BUDDY_EVENT 59
794 #define PING_REQUEST 60
795 #define FIRE_PARTICLES 61
796 #define REMOVE_FIRE_AT 62
797 #define DISPLAY_CLIENT_WINDOW 63
798 #define OPEN_BOOK 64
799 #define READ_BOOK 65
800 #define CLOSE_BOOK 66
801 #define STORAGE_LIST 67
802 #define STORAGE_ITEMS 68
803 #define STORAGE_TEXT 69
804 #define SPELL_CAST 70
805 #define GET_ACTIVE_CHANNELS 71
806 #define MAP_FLAGS 72
807 #define GET_ACTOR_HEALTH 73
808 #define GET_3D_OBJ_LIST 74
809 #define GET_3D_OBJ 75
810 #define REMOVE_3D_OBJ 76
811 #define GET_ITEMS_COOLDOWN 77
812 #define SEND_BUFFS 78
813 #define SEND_SPECIAL_EFFECT 79
814 #define REMOVE_MINE 80
815 #define GET_NEW_MINE 81
816 #define GET_MINES_LIST 82
817 #define DISPLAY_POPUP 83
818 #define MISSILE_AIM_A_AT_B 84
819 #define MISSILE_AIM_A_AT_XYZ 85
820 #define MISSILE_FIRE_A_TO_B 86
821 #define MISSILE_FIRE_A_TO_XYZ 87
822 #define MISSILE_FIRE_XYZ_TO_B 88
823 #define ADD_ACTOR_ANIMATION 89
824 #define SEND_MAP_MARKER 90
825 #define REMOVE_MAP_MARKER 91
826 /* sent: 16 bit quest id for the next npc message */
827 #define NEXT_NPC_MESSAGE_IS_QUEST 92
828 /* sent: non null terminated string giving the title of the quest */
829 #define HERE_IS_QUEST_ID 93
830 /* sent: 16 bit quest id, this quest should be shown as finished */
831 #define QUEST_FINISHED 94
832 /* sent: 5 x 32 bit integers, each active bit is an achievement the last "You see: name" player has */
833 #define SEND_ACHIEVEMENTS 95
834 /* sent: 1 single byte buff duration, time remaining in seconds */
835 #define SEND_BUFF_DURATION 96
836 
837 #define SEND_WEATHER 100
838 
839 // reserved for future expansion 220-229, not being used in the server yet
840 #define MAP_SET_OBJECTS 220
841 #define MAP_STATE_OBJECTS 221
842 
843 #define UPGRADE_NEW_VERSION 240	// TODO: Consider combining all this into one packet followed by one byte (plus optional text)
844 #define UPGRADE_TOO_OLD 241
845 #define REDEFINE_YOUR_COLORS 248
846 #define YOU_DONT_EXIST 249
847 #define LOG_IN_OK 250
848 #define LOG_IN_NOT_OK 251
849 #define CREATE_CHAR_OK 252
850 #define CREATE_CHAR_NOT_OK 253
851 /*! @} */
852 
853 /*!
854  * \name Common (both to the server and client) commands
855  */
856 /*! @{ */
857 #define RAW_TEXT 0
858 #define PROXY 254	// reserved for advanced PROXY support
859 #define BYE 255
860 /*! @} */
861 
862 
863 /*!
864  * \name Protocol places
865  */
866 #define PROTOCOL 0 /*!< is an unsigned char */
867 
868 /*!
869  * \name Stats
870  */
871 /*! @{ */
872 #define PHY_CUR 0
873 #define PHY_BASE 1
874 #define COO_CUR 2
875 #define COO_BASE 3
876 #define REAS_CUR 4
877 #define REAS_BASE 5
878 #define WILL_CUR 6
879 #define WILL_BASE 7
880 #define INST_CUR 8
881 #define INST_BASE 9
882 #define VIT_CUR 10
883 #define VIT_BASE 11
884 #define HUMAN_CUR 12
885 #define HUMAN_BASE 13
886 #define ANIMAL_CUR 14
887 #define ANIMAL_BASE 15
888 #define VEGETAL_CUR 16
889 #define VEGETAL_BASE 17
890 #define INORG_CUR 18
891 #define INORG_BASE 19
892 #define ARTIF_CUR 20
893 #define ARTIF_BASE 21
894 #define MAGIC_CUR 22
895 #define MAGIC_BASE 23
896 #define MAN_S_CUR 24
897 #define MAN_S_BASE 25
898 #define HARV_S_CUR 26
899 #define HARV_S_BASE 27
900 #define ALCH_S_CUR 28
901 #define ALCH_S_BASE 29
902 #define OVRL_S_CUR 30
903 #define OVRL_S_BASE 31
904 #define DEF_S_CUR 32
905 #define DEF_S_BASE 33
906 #define ATT_S_CUR 34
907 #define ATT_S_BASE 35
908 #define MAG_S_CUR 36
909 #define MAG_S_BASE 37
910 #define POT_S_CUR 38
911 #define POT_S_BASE 39
912 #define CARRY_WGHT_CUR 40
913 #define CARRY_WGHT_BASE 41
914 #define MAT_POINT_CUR 42
915 #define MAT_POINT_BASE 43
916 #define ETH_POINT_CUR 44
917 #define ETH_POINT_BASE 45
918 #define FOOD_LEV 46
919 #define RESEARCHING 47
920 #define MAG_RES 48
921 #define MAN_EXP 49
922 #define MAN_EXP_NEXT 50
923 #define HARV_EXP 51
924 #define HARV_EXP_NEXT 52
925 #define ALCH_EXP 53
926 #define ALCH_EXP_NEXT 54
927 #define OVRL_EXP 55
928 #define OVRL_EXP_NEXT 56
929 #define DEF_EXP 57
930 #define DEF_EXP_NEXT 58
931 #define ATT_EXP 59
932 #define ATT_EXP_NEXT 60
933 #define MAG_EXP 61
934 #define MAG_EXP_NEXT 62
935 #define POT_EXP 63
936 #define POT_EXP_NEXT 64
937 #define RESEARCH_COMPLETED 65
938 #define RESEARCH_TOTAL 66
939 #define SUM_EXP 67
940 #define SUM_EXP_NEXT 68
941 #define SUM_S_CUR 69
942 #define SUM_S_BASE 70
943 #define CRA_EXP 71
944 #define CRA_EXP_NEXT 72
945 #define CRA_S_CUR 73
946 #define CRA_S_BASE 74
947 #define ENG_EXP 75
948 #define ENG_EXP_NEXT 76
949 #define ENG_S_CUR 77
950 #define ENG_S_BASE 78
951 #define RANG_EXP 79
952 #define RANG_EXP_NEXT 80
953 #define RANG_S_CUR 81
954 #define RANG_S_BASE 82
955 #define TAIL_EXP 83
956 #define TAIL_EXP_NEXT 84
957 #define TAIL_S_CUR 85
958 #define TAIL_S_BASE 86
959 #define ACTION_POINTS_CUR 87
960 #define ACTION_POINTS_BASE 88
961 /*! @} */
962 
963 /*!
964  * \name Sound
965  */
966 /*! @{ */
967 #define snd_rain     0
968 #define snd_tele_in  1
969 #define snd_tele_out 2
970 #define snd_teleprtr 3
971 #define snd_thndr_1  4
972 #define snd_thndr_2  5
973 #define snd_thndr_3  6
974 #define snd_thndr_4  7
975 #define snd_thndr_5  8
976 #define snd_fire     9
977 /*! @} */
978 
979 /*!
980  * \name Text channels
981  */
982 /*! @{ */
983 #define CHAT_LOCAL	0
984 #define CHAT_PERSONAL	1
985 #define CHAT_GM		2
986 #define CHAT_SERVER	3
987 #define CHAT_MOD	4
988 #define CHAT_CHANNEL1	5
989 #define CHAT_CHANNEL2	6
990 #define CHAT_CHANNEL3	7
991 #define CHAT_MODPM	8
992 #define CHAT_POPUP 0xFF
993 /*! @} */
994 
995 /*!
996  * \name Actor scaling constants
997  */
998 /*! @{ */
999 #define	ACTOR_SCALE_BASE	0x4000
1000 #define	ACTOR_SCALE_MAX		0x7FFF
1001 /*! @} */
1002 
1003 /*!
1004  * \name Special spell effects
1005  */
1006 /*! @{ */
1007 typedef enum {
1008 	//when one player uses the poison spell on another one. Player to Player
1009 	SPECIAL_EFFECT_POISON = 0,
1010 
1011 	//when one player heals another. Player to Player
1012 	SPECIAL_EFFECT_REMOTE_HEAL = 1,
1013 
1014 	//when one player harms another. Player to Player
1015 	SPECIAL_EFFECT_HARM = 2,
1016 
1017 	//when one player casts shield on himself. Player
1018 	SPECIAL_EFFECT_SHIELD = 3,
1019 
1020 	//when one player casts restoration. Player
1021 	SPECIAL_EFFECT_RESTORATION = 4,
1022 
1023 	//when one player casts a smite summonings. Player
1024 	SPECIAL_EFFECT_SMITE_SUMMONINGS = 5,
1025 
1026 	//when a player goes invisible. Player
1027 	SPECIAL_EFFECT_CLOAK = 6,
1028 
1029 	//when a player becomes visible. Player
1030 	SPECIAL_EFFECT_DECLOAK = 7,
1031 
1032 	//when an invasion starts. Location
1033 	SPECIAL_EFFECT_INVASION_BEAMING = 8,
1034 
1035 	//when a player casts heal summoned. Player
1036 	SPECIAL_EFFECT_HEAL_SUMMONED = 9,
1037 
1038 	//When a player casts mana drain. Player to Player.
1039 	SPECIAL_EFFECT_MANA_DRAIN = 10,
1040 
1041 	//when a player teleports to range. Player, Location
1042 	SPECIAL_EFFECT_TELEPORT_TO_RANGE = 11,
1043 
1044 	//when a player teleports to range. Player, Location
1045 	SPECIAL_EFFECT_HEAL = 12,
1046 
1047 	//when a player finds a rare stone
1048 	SPECIAL_EFFECT_HARVEST_RARE_STONE = 13,
1049 
1050 	//when a player is blessed by MN with exp
1051 	SPECIAL_EFFECT_HARVEST_MN_EXP_BLESSING = 14,
1052 
1053 	//when a player is blessed by MN with money
1054 	SPECIAL_EFFECT_HARVEST_MN_MONEY_BLESSING = 15,
1055 
1056 	//when a wall colapses over a player
1057 	SPECIAL_EFFECT_HARVEST_WALL_COLLAPSE = 16,
1058 
1059 	//when a bees sting a player
1060 	SPECIAL_EFFECT_HARVEST_BEES = 17,
1061 
1062 	//when a radeon hits
1063 	SPECIAL_EFFECT_HARVEST_RADON = 18,
1064 
1065 	//when a tool breaks
1066 	SPECIAL_EFFECT_HARVEST_TOOL_BREAKS = 19,
1067 
1068 	//when teleport nexus actor_id,x1,y1,x2,y2
1069 	SPECIAL_EFFECT_HARVEST_TELEPORT_NEXUS = 20,
1070 
1071 	//when MN takes your health
1072 	SPECIAL_EFFECT_HARVEST_MOTHER_NATURE_PISSED = 21,
1073 
1074 	//when a manufacture tool breaks
1075 	SPECIAL_EFFECT_MANUFACTURE_TOOL_BREAKS = 22,
1076 
1077 	//when a special item is created
1078 	SPECIAL_EFFECT_MANUFACTURE_RARE_ITEM = 23,
1079 
1080 	//when a "who doesn't see me" spell is cast
1081 	SPECIAL_EFFECT_MAKE_PLAYER_GLOW = 24,
1082 
1083 	//Summoning stuff
1084 	SPECIAL_EFFECT_SUMMON_RABBIT = 25,
1085 	SPECIAL_EFFECT_SUMMON_RAT = 26,
1086 	SPECIAL_EFFECT_SUMMON_BEAVER = 27,
1087 	SPECIAL_EFFECT_SUMMON_SKUNK = 28,
1088 	SPECIAL_EFFECT_SUMMON_RACOON = 29,
1089 	SPECIAL_EFFECT_SUMMON_DEER = 30,
1090 	SPECIAL_EFFECT_SUMMON_GREEN_SNAKE = 31,
1091 	SPECIAL_EFFECT_SUMMON_RED_SNAKE = 32,
1092 	SPECIAL_EFFECT_SUMMON_BROWN_SNAKE = 33,
1093 	SPECIAL_EFFECT_SUMMON_FOX = 34,
1094 	SPECIAL_EFFECT_SUMMON_BOAR = 35,
1095 	SPECIAL_EFFECT_SUMMON_WOLF = 36,
1096 	SPECIAL_EFFECT_SUMMON_SKELETON = 37,
1097 	SPECIAL_EFFECT_SUMMON_SMAL_GARG = 38,
1098 	SPECIAL_EFFECT_SUMMON_MEDIUM_GARG = 39,
1099 	SPECIAL_EFFECT_SUMMON_BIG_GARG = 40,
1100 	SPECIAL_EFFECT_SUMMON_PUMA = 41,
1101 	SPECIAL_EFFECT_SUMMON_FEM_GOBLIN = 42,
1102 	SPECIAL_EFFECT_SUMMON_POLAR_BEAR = 43,
1103 	SPECIAL_EFFECT_SUMMON_BEAR = 44,
1104 	SPECIAL_EFFECT_SUMMON_ARMED_MALE_GOB = 45,
1105 	SPECIAL_EFFECT_SUMMON_ARMED_SKELETON = 46,
1106 	SPECIAL_EFFECT_SUMMON_FEMALE_ORC = 47,
1107 	SPECIAL_EFFECT_SUMMON_MALE_ORC = 48,
1108 	SPECIAL_EFFECT_SUMMON_ARMED_FEM_ORC = 49,
1109 	SPECIAL_EFFECT_SUMMON_ARMED_MALE_ORC = 50,
1110 	SPECIAL_EFFECT_SUMMON_CYCLOP = 51,
1111 	SPECIAL_EFFECT_SUMMON_FLUFFY_RABBIT = 52,
1112 	SPECIAL_EFFECT_SUMMON_PHANTOM_WARRIOR = 53,
1113 	SPECIAL_EFFECT_SUMMON_MOUNTAIN_CHIM = 54,
1114 	SPECIAL_EFFECT_SUMMON_YETI = 55,
1115 	SPECIAL_EFFECT_SUMMON_ARCTIC_CHIM = 56,
1116 	SPECIAL_EFFECT_SUMMON_GIANT = 57,
1117 	SPECIAL_EFFECT_SUMMON_GIANT_SNAKE = 58,
1118 	SPECIAL_EFFECT_SUMMON_SPIDER = 59,
1119 	SPECIAL_EFFECT_SUMMON_TIGER = 60,
1120 
1121 	// Mines stuff
1122 	SPECIAL_EFFECT_SMALL_MINE_GOES_BOOM = 61,
1123 	SPECIAL_EFFECT_MEDIUM_MINE_GOES_BOOM = 62,
1124 	SPECIAL_EFFECT_HIGH_EXPLOSIVE_MINE_GOES_BOOM = 63,
1125 	SPECIAL_EFFECT_SNARE_GOES_BOOM = 64,
1126 	SPECIAL_EFFECT_CALTROP_GOES_BOOM = 65,
1127 	SPECIAL_EFFECT_POISONED_CALTROP_GOES_BOOM = 66,
1128 	SPECIAL_EFFECT_MANA_DRAINER_GOES_BOOM = 67,
1129 	SPECIAL_EFFECT_MANA_BURNER_GOES_BOOM = 68,
1130 	SPECIAL_EFFECT_UNINVIZIBILIZER_GOES_BOOM = 69,
1131 	SPECIAL_EFFECT_MAGIC_IMMUNITY_REMOVAL_GOES_BOOM = 70,
1132 
1133 	// Heal allies spell
1134 	SPECIAL_EFFECT_HEAL_ALLIES = 71,
1135 
1136 	// when one player casts heat shield on himself
1137 	SPECIAL_EFFECT_HEATSHIELD = 72,
1138 	// when one player casts cold shield on himself
1139 	SPECIAL_EFFECT_COLDSHIELD = 73,
1140 	// when one player casts radiation shield on himself
1141 	SPECIAL_EFFECT_RADIATIONSHIELD = 74,
1142 	// magic immunity spell
1143 	SPECIAL_EFFECT_MAGIC_IMMUNITY = 75,
1144 	// magic protection spell
1145 	SPECIAL_EFFECT_MAGIC_PROTECTION = 76
1146 } special_effect_enum;
1147 	/*! @} */
1148 
1149 /*!
1150  * \name Mine types
1151  */
1152 /*! @{ */
1153 #define MINE_TYPE_SMALL_MINE 0
1154 #define MINE_TYPE_MEDIUM_MINE 1
1155 #define MINE_TYPE_HIGH_EXPLOSIVE_MINE 2
1156 #define MINE_TYPE_TRAP 3
1157 #define MINE_TYPE_CALTROP 4
1158 #define MINE_TYPE_POISONED_CALTROP 5
1159 #define MINE_TYPE_BARRICADE 6
1160 #define MINE_TYPE_MANA_DRAINER 7
1161 #define MINE_TYPE_MANA_BURNER 8
1162 #define MINE_TYPE_UNINVIZIBILIZER 9
1163 #define MINE_TYPE_MAGIC_IMMUNITY_REMOVAL 10
1164 /*! @} */
1165 
1166 /*!
1167  * \name Actor buffs constants
1168  */
1169 typedef enum {
1170 	BUFF_INVISIBILITY = 1,
1171 	BUFF_MAGIC_IMMUNITY = 2,
1172 	BUFF_MAGIC_PROTECTION = 4,
1173 	BUFF_COLD_SHIELD = 8,
1174 	BUFF_HEAT_SHIELD = 16,
1175 	BUFF_RADIATION_SHIELD = 32,
1176 	BUFF_SHIELD = 64,
1177 	BUFF_TRUE_SIGHT = 128,
1178 	BUFF_ACCURACY = 256,
1179 	BUFF_EVASION = 512,
1180 	BUFF_DOUBLE_SPEED = 1024
1181 } buffs;
1182 
1183 #ifdef __cplusplus
1184 } // extern "C"
1185 #endif
1186 
1187 #endif
1188