#define CHAR_SET_SIZE 18
#define CS_CLASS 0
#define CS_WEAPON1_TYPE 1
#define CS_WEAPON2_TYPE 2
#define CS_WEAPON1_DATA 12
#define CS_WEAPON2_DATA 13
#define CS_HELMET1 13
#define CS_HELMET2 9
#define CS_HELMET3 3
#define CS_ARMOR1 14
#define CS_ARMOR2 9
#define CS_ARMOR3 3
#define CS_PANTS1 14
#define CS_PANTS2 9
#define CS_PANTS3 4
#define CS_GLOVES1 15
#define CS_GLOVES2 9
#define CS_GLOVES3 4
#define CS_BOOTS1 15
#define CS_BOOTS2 9
#define CS_BOOTS3 5
#define CHECK_LIMIT(value, limit) ( ((value)<0)?false
(value)>((limit)-1))?false:true )
#define CHECK_LIMIT2(value, base, limit) ( ((value)<base)?false
(value)>((limit)-1))?false:true )
#define CHECK_CLASS(value, type) ( ((value)!=(type))?FALSE:TRUE )
#define CS_GET_CLASS(x) ( (((x)>>4)<<5)&(0xE0) )
#define CS_GET_CHANGEUP(x) ( ((x)&0x07) )
#define CS_GET_MASTERCLASS(x) ( (((x)>>1)<<3)&(0x08) )
#define CS_SET_CLASS(x) ( ((x)<<5)& 0xE0 )
#define CS_SET_CHANGEUP(x) ( ((x) << 4) & 0x10 )
#define CS_SET_CHANGEUP2(x) ( ((x) << 3) & 0x08 )
#define CS_SET_HELMET1(x) ( ((x) & 0x1E0) >> 5 )
#define CS_SET_HELMET2(x) ( ((x) & 0x10 ) << 3 )
#define CS_SET_HELMET3(x) ( ((x) & 0x0F ) << 4 )
#define CS_SET_ARMOR1(x) ( ((x) & 0x1E0) >> 1 )
#define CS_SET_ARMOR2(x) ( ((x) & 0x10 ) << 2 )
#define CS_SET_ARMOR3(x) ( ((x) & 0x0F ) )
#define CS_SET_PANTS1(x) ( ((x) & 0x1E0) >> 5 )
#define CS_SET_PANTS2(x) ( ((x) & 0x10 ) << 1 )
#define CS_SET_PANTS3(x) ( ((x) & 0x0F ) << 4 )
#define CS_SET_GLOVES1(x) ( ((x) & 0x1E0) >> 1 )
#define CS_SET_GLOVES2(x) ( ((x) & 0x10 ) )
#define CS_SET_GLOVES3(x) ( ((x) & 0x0F ) )
#define CS_SET_BOOTS1(x) ( ((x) & 0x1E0) >> 5 )
#define CS_SET_BOOTS2(x) ( ((x) & 0x10 ) >> 1 )
#define CS_SET_BOOTS3(x) ( ((x) & 0x0F ) << 4 )
#define CS_SET_WING1(x) ( ((x) & 0x03 ) << 2 )
#define CS_SET_HELPER(x) ( ((x) & 0x03 ) )
#define CS_SET_SMALLLEVEL_RH(x) ( (x) )
#define CS_SET_SMALLLEVEL_LH(x) ( (x) << 3 )
#define CS_SET_SMALLLEVEL_HELMET(x) ( (x) << 6 )
#define CS_SET_SMALLLEVEL_ARMOR(x) ( (x) << 9 )
#define CS_SET_SMALLLEVEL_PANTS(x) ( (x) << 12 )
#define CS_SET_SMALLLEVEL_GLOVES(x) ( (x) << 15 )
#define CS_SET_SMALLLEVEL_BOOTS(x) ( (x) << 18 )
#define CS_SET_SMALLLEVEL1(x) ( ((x) >> 16) & 0xFF )
#define CS_SET_SMALLLEVEL2(x) ( ((x) >> 8 ) & 0xFF )
#define CS_SET_SMALLLEVEL3(x) ((x) & 0xFF )