| 1 | /* |
| 2 | * Copyright (C) 2000,2001 Onlyer ([email protected]) |
| 3 | * Copyright (C) 2001 faster ([email protected]) |
| 4 | * Copyright (C) 2001 sousou ([email protected]) |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * as published by the Free Software Foundation; either version 2 |
| 9 | * of the License, or (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 19 | */ |
| 20 | #ifndef INCLUDED_D2CS_D2GS_CHARACTER_H |
| 21 | #define INCLUDED_D2CS_D2GS_CHARACTER_H |
| 22 | |
| 23 | #include "common/bn_type.h" |
| 24 | #include "common/field_sizes.h" |
| 25 | |
| 26 | #ifdef D2GS |
| 27 | # include "bn_types.h" |
| 28 | #pragma pack(push, character_h, 1) |
| 29 | #endif |
| 30 | |
| 31 | #define D2CHARINFO_MAGICWORD 0x12345678 |
| 32 | #define D2CHARINFO_VERSION 0x00010000 |
| 33 | #define D2CHARINFO_PORTRAIT_PADSIZE 30 |
| 34 | |
| 35 | namespace pvpgn |
| 36 | { |
| 37 | |
| 38 | typedef struct |
| 39 | { |
| 40 | bn_int magicword; /* static for check */ |
| 41 | bn_int version; /* charinfo file version */ |
| 42 | bn_int create_time; /* character creation time */ |
| 43 | bn_int last_time; /* character last access time */ |
| 44 | bn_int checksum; |
| 45 | bn_int total_play_time; /* total in game play time */ |
| 46 | bn_int reserved[6]; |
| 47 | unsigned char charname[MAX_CHARNAME_LEN]; |
| 48 | unsigned char account[MAX_USERNAME_LEN]; |
| 49 | unsigned char realmname[MAX_REALMNAME_LEN]; |
| 50 | } t_d2charinfo_header; |
| 51 | |
| 52 | typedef struct |
| 53 | { |
| 54 | bn_int experience; |
| 55 | bn_int charstatus; |
| 56 | bn_int charlevel; |
| 57 | bn_int charclass; |
| 58 | } t_d2charinfo_summary; |
| 59 | |
| 60 | typedef struct |
| 61 | { |
| 62 | bn_short header; /* 0x84 0x80 */ |
| 63 | bn_byte gfx[11]; |
| 64 | bn_byte chclass; |
| 65 | bn_byte color[11]; |
| 66 | bn_byte level; |
| 67 | bn_byte status; |
| 68 | |
| 69 | |
| 70 | |
| 71 | bn_byte u1[3]; |
| 72 | bn_byte ladder; /* need not be 0xff and 0 to make character displayed as ladder character */ |
| 73 | /* client only check this bit */ |
| 74 | bn_byte u2[2]; |
| 75 | bn_byte end; /* 0x00 */ |
| 76 | } t_d2charinfo_portrait; |
| 77 | |
| 78 | typedef struct |
| 79 | { |
| 80 | t_d2charinfo_header header; |
| 81 | t_d2charinfo_portrait portrait; |
| 82 | bn_byte pad[D2CHARINFO_PORTRAIT_PADSIZE]; |
| 83 | t_d2charinfo_summary summary; |
| 84 | } t_d2charinfo_file; |
| 85 | |
| 86 | } |
| 87 | |
| 88 | #ifdef D2GS |
| 89 | #pragma pack(pop, character_h) |
| 90 | #endif |
| 91 | |
| 92 | #endif |