00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00053 #ifndef NEWCLIENT_H
00054 #define NEWCLIENT_H
00055
00056 #include <stddef.h>
00057
00063 #define MAP2_COORD_OFFSET 15
00064
00074 #define MAP2_COORD_ENCODE(x, y, flags) ((((x)+MAP2_COORD_OFFSET)&0x3f)<<10|(((y)+MAP2_COORD_OFFSET)&0x3f)<<4|(flags&0x0f))
00075
00076 #define CS_QUERY_YESNO 0x1
00077 #define CS_QUERY_SINGLECHAR 0x2
00078 #define CS_QUERY_HIDEINPUT 0x4
00080 #define CS_SAY_NORMAL 0x1
00081 #define CS_SAY_SHOUT 0x2
00082 #define CS_SAY_GSAY 0x4
00089 #define FLOAT_MULTI 100000
00090 #define FLOAT_MULTF 100000.0
00091
00092
00093
00094 #define CS_STAT_HP 1
00095 #define CS_STAT_MAXHP 2
00096 #define CS_STAT_SP 3
00097 #define CS_STAT_MAXSP 4
00098 #define CS_STAT_STR 5
00099 #define CS_STAT_INT 6
00100 #define CS_STAT_WIS 7
00101 #define CS_STAT_DEX 8
00102 #define CS_STAT_CON 9
00103 #define CS_STAT_CHA 10
00104 #define CS_STAT_EXP 11
00105 #define CS_STAT_LEVEL 12
00106 #define CS_STAT_WC 13
00107 #define CS_STAT_AC 14
00108 #define CS_STAT_DAM 15
00109 #define CS_STAT_ARMOUR 16
00110 #define CS_STAT_SPEED 17
00111 #define CS_STAT_FOOD 18
00112 #define CS_STAT_WEAP_SP 19
00113 #define CS_STAT_RANGE 20
00114 #define CS_STAT_TITLE 21
00115 #define CS_STAT_POW 22
00116 #define CS_STAT_GRACE 23
00117 #define CS_STAT_MAXGRACE 24
00118 #define CS_STAT_FLAGS 25
00119 #define CS_STAT_WEIGHT_LIM 26
00120 #define CS_STAT_EXP64 28
00121 #define CS_STAT_SPELL_ATTUNE 29
00122 #define CS_STAT_SPELL_REPEL 30
00123 #define CS_STAT_SPELL_DENY 31
00124
00125
00126 #define CS_STAT_RESIST_START 100
00127 #define CS_STAT_RESIST_END 117
00128 #define CS_STAT_RES_PHYS 100
00129 #define CS_STAT_RES_MAG 101
00130 #define CS_STAT_RES_FIRE 102
00131 #define CS_STAT_RES_ELEC 103
00132 #define CS_STAT_RES_COLD 104
00133 #define CS_STAT_RES_CONF 105
00134 #define CS_STAT_RES_ACID 106
00135 #define CS_STAT_RES_DRAIN 107
00136 #define CS_STAT_RES_GHOSTHIT 108
00137 #define CS_STAT_RES_POISON 109
00138 #define CS_STAT_RES_SLOW 110
00139 #define CS_STAT_RES_PARA 111
00140 #define CS_STAT_TURN_UNDEAD 112
00141 #define CS_STAT_RES_FEAR 113
00142 #define CS_STAT_RES_DEPLETE 114
00143 #define CS_STAT_RES_DEATH 115
00144 #define CS_STAT_RES_HOLYWORD 116
00145 #define CS_STAT_RES_BLIND 117
00146
00147
00148 #define CS_STAT_SKILLEXP_START 118
00149 #define CS_STAT_SKILLEXP_END 129
00150 #define CS_STAT_SKILLEXP_AGILITY 118
00151 #define CS_STAT_SKILLEXP_AGLEVEL 119
00152 #define CS_STAT_SKILLEXP_PERSONAL 120
00153 #define CS_STAT_SKILLEXP_PELEVEL 121
00154 #define CS_STAT_SKILLEXP_MENTAL 122
00155 #define CS_STAT_SKILLEXP_MELEVEL 123
00156 #define CS_STAT_SKILLEXP_PHYSIQUE 124
00157 #define CS_STAT_SKILLEXP_PHLEVEL 125
00158 #define CS_STAT_SKILLEXP_MAGIC 126
00159 #define CS_STAT_SKILLEXP_MALEVEL 127
00160 #define CS_STAT_SKILLEXP_WISDOM 128
00161 #define CS_STAT_SKILLEXP_WILEVEL 129
00162
00170 #define CS_STAT_SKILLINFO 140
00171 #define CS_NUM_SKILLS 50
00172
00177 #define SF_FIREON 0x01
00178 #define SF_RUNON 0x02
00179
00195 #define NDI_BLACK 0
00196 #define NDI_WHITE 1
00197 #define NDI_NAVY 2
00198 #define NDI_RED 3
00199 #define NDI_ORANGE 4
00200 #define NDI_BLUE 5
00201 #define NDI_DK_ORANGE 6
00202 #define NDI_GREEN 7
00203 #define NDI_LT_GREEN 8
00205 #define NDI_GREY 9
00206 #define NDI_BROWN 10
00207 #define NDI_GOLD 11
00208 #define NDI_TAN 12
00210 #define NDI_MAX_COLOR 12
00211 #define NDI_COLOR_MASK 0xff
00216 #define NDI_UNIQUE 0x100
00217 #define NDI_ALL 0x200
00218 #define NDI_ALL_DMS 0x400
00220
00221
00222 enum {a_none, a_readied, a_wielded, a_worn, a_active, a_applied};
00223 #define F_APPLIED 0x000F
00224 #define F_LOCATION 0x00F0
00225 #define F_UNPAID 0x0200
00226 #define F_MAGIC 0x0400
00227 #define F_CURSED 0x0800
00228 #define F_DAMNED 0x1000
00229 #define F_OPEN 0x2000
00230 #define F_NOPICK 0x4000
00231 #define F_LOCKED 0x8000
00232 #define F_BLESSED 0x0100
00233
00234 #define CF_FACE_NONE 0
00235 #define CF_FACE_BITMAP 1
00236 #define CF_FACE_XPM 2
00237 #define CF_FACE_PNG 3
00238 #define CF_FACE_CACHE 0x10
00239
00245 #define FACE_FLOOR 0x80
00246 #define FACE_WALL 0x40
00247
00248
00249 #define FACE_COLOR_MASK 0xf
00250
00251 #define UPD_LOCATION 0x01
00252 #define UPD_FLAGS 0x02
00253 #define UPD_WEIGHT 0x04
00254 #define UPD_FACE 0x08
00255 #define UPD_NAME 0x10
00256 #define UPD_ANIM 0x20
00257 #define UPD_ANIMSPEED 0x40
00258 #define UPD_NROF 0x80
00259 #define UPD_ALL 0xFF
00260
00261
00262 #define UPD_SP_MANA 0x01
00263 #define UPD_SP_GRACE 0x02
00264 #define UPD_SP_DAMAGE 0x04
00265
00266 #define SOUND_NORMAL 0
00267 #define SOUND_SPELL 1
00268
00269 #define FACE_IS_ANIM 1<<15
00270 #define ANIM_RANDOM 1<<13
00271 #define ANIM_SYNC 2<<13
00272
00273
00274 #define ANIM_FLAGS_MASK 0x6000
00275
00276
00277 #define ANIM_MASK 0x1fff
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295 #define EMI_NOREDRAW 0x01
00296 #define EMI_SMOOTH 0x02
00297
00298
00299
00300
00301
00302
00303 #define EMI_HASMOREBITS 0x80
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314 #define MSG_TYPE_BOOK 1
00315 #define MSG_TYPE_CARD 2
00316 #define MSG_TYPE_PAPER 3
00317 #define MSG_TYPE_SIGN 4
00318 #define MSG_TYPE_MONUMENT 5
00319 #define MSG_TYPE_DIALOG 6
00320 #define MSG_TYPE_MOTD 7
00321 #define MSG_TYPE_ADMIN 8
00322 #define MSG_TYPE_SHOP 9
00323 #define MSG_TYPE_COMMAND 10
00324 #define MSG_TYPE_ATTRIBUTE 11
00325
00326 #define MSG_TYPE_SKILL 12
00327 #define MSG_TYPE_APPLY 13
00328 #define MSG_TYPE_ATTACK 14
00329 #define MSG_TYPE_COMMUNICATION 15
00330 #define MSG_TYPE_SPELL 16
00331 #define MSG_TYPE_ITEM 17
00332 #define MSG_TYPE_MISC 18
00333 #define MSG_TYPE_VICTIM 19
00334 #define MSG_TYPE_LAST 20
00335
00336 #define MSG_SUBTYPE_NONE 0
00337
00338
00339 #define MSG_TYPE_BOOK_CLASP_1 1
00340 #define MSG_TYPE_BOOK_CLASP_2 2
00341 #define MSG_TYPE_BOOK_ELEGANT_1 3
00342 #define MSG_TYPE_BOOK_ELEGANT_2 4
00343 #define MSG_TYPE_BOOK_QUARTO_1 5
00344 #define MSG_TYPE_BOOK_QUARTO_2 6
00345 #define MSG_TYPE_BOOK_SPELL_EVOKER 7
00346 #define MSG_TYPE_BOOK_SPELL_PRAYER 8
00347 #define MSG_TYPE_BOOK_SPELL_PYRO 9
00348 #define MSG_TYPE_BOOK_SPELL_SORCERER 10
00349 #define MSG_TYPE_BOOK_SPELL_SUMMONER 11
00350
00351
00352 #define MSG_TYPE_CARD_SIMPLE_1 1
00353 #define MSG_TYPE_CARD_SIMPLE_2 2
00354 #define MSG_TYPE_CARD_SIMPLE_3 3
00355 #define MSG_TYPE_CARD_ELEGANT_1 4
00356 #define MSG_TYPE_CARD_ELEGANT_2 5
00357 #define MSG_TYPE_CARD_ELEGANT_3 6
00358 #define MSG_TYPE_CARD_STRANGE_1 7
00359 #define MSG_TYPE_CARD_STRANGE_2 8
00360 #define MSG_TYPE_CARD_STRANGE_3 9
00361 #define MSG_TYPE_CARD_MONEY_1 10
00362 #define MSG_TYPE_CARD_MONEY_2 11
00363 #define MSG_TYPE_CARD_MONEY_3 12
00364
00365
00366 #define MSG_TYPE_PAPER_NOTE_1 1
00367 #define MSG_TYPE_PAPER_NOTE_2 2
00368 #define MSG_TYPE_PAPER_NOTE_3 3
00369 #define MSG_TYPE_PAPER_LETTER_OLD_1 4
00370 #define MSG_TYPE_PAPER_LETTER_OLD_2 5
00371 #define MSG_TYPE_PAPER_LETTER_NEW_1 6
00372 #define MSG_TYPE_PAPER_LETTER_NEW_2 7
00373 #define MSG_TYPE_PAPER_ENVELOPE_1 8
00374 #define MSG_TYPE_PAPER_ENVELOPE_2 9
00375 #define MSG_TYPE_PAPER_SCROLL_OLD_1 10
00376 #define MSG_TYPE_PAPER_SCROLL_OLD_2 11
00377 #define MSG_TYPE_PAPER_SCROLL_NEW_1 12
00378 #define MSG_TYPE_PAPER_SCROLL_NEW_2 13
00379 #define MSG_TYPE_PAPER_SCROLL_MAGIC 14
00380
00381
00382 #define MSG_TYPE_SIGN_BASIC 1
00383 #define MSG_TYPE_SIGN_DIR_LEFT 2
00384 #define MSG_TYPE_SIGN_DIR_RIGHT 3
00385 #define MSG_TYPE_SIGN_DIR_BOTH 4
00386
00387
00388 #define MSG_TYPE_MONUMENT_STONE_1 1
00389 #define MSG_TYPE_MONUMENT_STONE_2 2
00390 #define MSG_TYPE_MONUMENT_STONE_3 3
00391 #define MSG_TYPE_MONUMENT_STATUE_1 4
00392 #define MSG_TYPE_MONUMENT_STATUE_2 5
00393 #define MSG_TYPE_MONUMENT_STATUE_3 6
00394 #define MSG_TYPE_MONUMENT_GRAVESTONE_1 7
00395 #define MSG_TYPE_MONUMENT_GRAVESTONE_2 8
00396 #define MSG_TYPE_MONUMENT_GRAVESTONE_3 9
00397 #define MSG_TYPE_MONUMENT_WALL_1 10
00398 #define MSG_TYPE_MONUMENT_WALL_2 11
00399 #define MSG_TYPE_MONUMENT_WALL_3 12
00400
00401
00402 #define MSG_TYPE_DIALOG_NPC 1
00403 #define MSG_TYPE_DIALOG_ALTAR 2
00404 #define MSG_TYPE_DIALOG_MAGIC_MOUTH 3
00405
00406
00407
00408
00409 #define MSG_TYPE_ADMIN_RULES 1
00410 #define MSG_TYPE_ADMIN_NEWS 2
00411 #define MSG_TYPE_ADMIN_PLAYER 3
00412 #define MSG_TYPE_ADMIN_DM 4
00413 #define MSG_TYPE_ADMIN_HISCORE 5
00414 #define MSG_TYPE_ADMIN_LOADSAVE 6
00415 #define MSG_TYPE_ADMIN_LOGIN 7
00416 #define MSG_TYPE_ADMIN_VERSION 8
00417
00418
00419
00420
00421
00422
00423 #define MSG_TYPE_SHOP_LISTING 1
00424
00425 #define MSG_TYPE_SHOP_PAYMENT 2
00426
00427 #define MSG_TYPE_SHOP_SELL 3
00428 #define MSG_TYPE_SHOP_MISC 4
00429
00430
00431
00432
00433
00434 #define MSG_TYPE_COMMAND_WHO 1
00435 #define MSG_TYPE_COMMAND_MAPS 2
00436 #define MSG_TYPE_COMMAND_BODY 3
00437 #define MSG_TYPE_COMMAND_MALLOC 4
00438 #define MSG_TYPE_COMMAND_WEATHER 5
00439 #define MSG_TYPE_COMMAND_STATISTICS 6
00440 #define MSG_TYPE_COMMAND_CONFIG 7
00441 #define MSG_TYPE_COMMAND_INFO 8
00442 #define MSG_TYPE_COMMAND_QUESTS 9
00443 #define MSG_TYPE_COMMAND_DEBUG 10
00444 #define MSG_TYPE_COMMAND_ERROR 11
00445 #define MSG_TYPE_COMMAND_SUCCESS 12
00446 #define MSG_TYPE_COMMAND_FAILURE 13
00447 #define MSG_TYPE_COMMAND_EXAMINE 14
00448 #define MSG_TYPE_COMMAND_INVENTORY 15
00449 #define MSG_TYPE_COMMAND_HELP 16
00450 #define MSG_TYPE_COMMAND_DM 17
00451 #define MSG_TYPE_COMMAND_NEWPLAYER 18
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463 #define MSG_TYPE_ATTRIBUTE_ATTACKTYPE_GAIN 1
00464 #define MSG_TYPE_ATTRIBUTE_ATTACKTYPE_LOSS 2
00465
00466
00467
00468 #define MSG_TYPE_ATTRIBUTE_PROTECTION_GAIN 3
00469 #define MSG_TYPE_ATTRIBUTE_PROTECTION_LOSS 4
00470
00471
00472
00473
00474 #define MSG_TYPE_ATTRIBUTE_MOVE 5
00475
00476 #define MSG_TYPE_ATTRIBUTE_RACE 6
00477 #define MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START 7
00478 #define MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END 8
00479 #define MSG_TYPE_ATTRIBUTE_STAT_GAIN 9
00480 #define MSG_TYPE_ATTRIBUTE_STAT_LOSS 10
00481 #define MSG_TYPE_ATTRIBUTE_LEVEL_GAIN 11
00482 #define MSG_TYPE_ATTRIBUTE_LEVEL_LOSS 12
00483 #define MSG_TYPE_ATTRIBUTE_GOOD_EFFECT_START 13
00484 #define MSG_TYPE_ATTRIBUTE_GOOD_EFFECT_END 14
00485 #define MSG_TYPE_ATTRIBUTE_GOD 15
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498 #define MSG_TYPE_SKILL_MISSING 1
00499 #define MSG_TYPE_SKILL_ERROR 2
00500 #define MSG_TYPE_SKILL_SUCCESS 3
00501 #define MSG_TYPE_SKILL_FAILURE 4
00502 #define MSG_TYPE_SKILL_PRAY 5
00503 #define MSG_TYPE_SKILL_LIST 6
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513 #define MSG_TYPE_APPLY_ERROR 1
00514 #define MSG_TYPE_APPLY_UNAPPLY 2
00515 #define MSG_TYPE_APPLY_SUCCESS 3
00516 #define MSG_TYPE_APPLY_FAILURE 4
00517 #define MSG_TYPE_APPLY_CURSED 5
00518 #define MSG_TYPE_APPLY_TRAP 6
00519 #define MSG_TYPE_APPLY_BADBODY 7
00520 #define MSG_TYPE_APPLY_PROHIBITION 8
00521 #define MSG_TYPE_APPLY_BUILD 9
00522
00523
00524 #define MSG_TYPE_ATTACK_DID_HIT 1
00525 #define MSG_TYPE_ATTACK_PET_HIT 2
00526 #define MSG_TYPE_ATTACK_FUMBLE 3
00527 #define MSG_TYPE_ATTACK_DID_KILL 4
00528 #define MSG_TYPE_ATTACK_PET_DIED 5
00529 #define MSG_TYPE_ATTACK_NOKEY 6
00530 #define MSG_TYPE_ATTACK_NOATTACK 7
00531 #define MSG_TYPE_ATTACK_PUSHED 8
00532 #define MSG_TYPE_ATTACK_MISS 9
00533
00534 #define MSG_TYPE_COMMUNICATION_RANDOM 1
00535 #define MSG_TYPE_COMMUNICATION_SAY 2
00536 #define MSG_TYPE_COMMUNICATION_ME 3
00537 #define MSG_TYPE_COMMUNICATION_TELL 4
00538 #define MSG_TYPE_COMMUNICATION_EMOTE 5
00539 #define MSG_TYPE_COMMUNICATION_PARTY 6
00540 #define MSG_TYPE_COMMUNICATION_SHOUT 7
00541 #define MSG_TYPE_COMMUNICATION_CHAT 8
00542
00543 #define MSG_TYPE_SPELL_HEAL 1
00544 #define MSG_TYPE_SPELL_PET 2
00545 #define MSG_TYPE_SPELL_FAILURE 3
00546 #define MSG_TYPE_SPELL_END 4
00547 #define MSG_TYPE_SPELL_SUCCESS 5
00548 #define MSG_TYPE_SPELL_ERROR 6
00549 #define MSG_TYPE_SPELL_PERCEIVE_SELF 7
00550 #define MSG_TYPE_SPELL_TARGET 8
00551 #define MSG_TYPE_SPELL_INFO 9
00552
00553
00554 #define MSG_TYPE_ITEM_REMOVE 1
00555 #define MSG_TYPE_ITEM_ADD 2
00556 #define MSG_TYPE_ITEM_CHANGE 3
00557 #define MSG_TYPE_ITEM_INFO 3
00558
00559
00560
00561
00562
00563 #define MSG_TYPE_VICTIM_SWAMP 1
00564 #define MSG_TYPE_VICTIM_WAS_HIT 2
00565 #define MSG_TYPE_VICTIM_STEAL 3
00566 #define MSG_TYPE_VICTIM_SPELL 4
00567 #define MSG_TYPE_VICTIM_DIED 5
00568 #define MSG_TYPE_VICTIM_WAS_PUSHED 6
00569
00571 typedef struct SockList {
00572 size_t len;
00573 unsigned char buf[2+65536UL+1];
00574 } SockList;
00575
00577 typedef struct CS_Stats {
00578 int ibytes;
00579 int obytes;
00580 short max_conn;
00581 time_t time_start;
00582 } CS_Stats;
00583
00584 extern CS_Stats cst_tot, cst_lst;
00585
00586 #endif