diff options
Diffstat (limited to 'src/common/mmo.h')
-rw-r--r-- | src/common/mmo.h | 129 |
1 files changed, 107 insertions, 22 deletions
diff --git a/src/common/mmo.h b/src/common/mmo.h index 77f706f0d..52f68b719 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -23,6 +23,7 @@ #include "config/core.h" #include "common/cbasetypes.h" +#include "common/db.h" // VECTORS // server->client protocol version // 0 - pre-? @@ -114,7 +115,15 @@ #define MAX_INVENTORY 100 //Max number of characters per account. Note that changing this setting alone is not enough if the client is not hexed to support more characters as well. -#define MAX_CHARS 9 +#if PACKETVER >= 20100413 +#ifndef MAX_CHARS + #define MAX_CHARS 12 +#endif +#else +#ifndef MAX_CHARS + #define MAX_CHARS 9 +#endif +#endif //Number of slots carded equipment can have. Never set to less than 4 as they are also used to keep the data of forged items/equipment. [Skotlex] //Note: The client seems unable to receive data for more than 4 slots due to all related packets having a fixed size. #define MAX_SLOTS 4 @@ -131,7 +140,7 @@ #define MAX_FAME 1000000000 #define MAX_CART 100 #ifndef MAX_SKILL -#define MAX_SKILL 1478 +#define MAX_SKILL 1510 #endif #ifndef MAX_SKILL_ID #define MAX_SKILL_ID 10015 // [Ind/Hercules] max used skill ID @@ -256,15 +265,32 @@ #define MAX_ELESKILLTREE 3 #endif +// Maximum item options [Smokexyz] +#ifndef MAX_ITEM_OPTIONS +#define MAX_ITEM_OPTIONS 5 +#endif +STATIC_ASSERT(MAX_ITEM_OPTIONS <= 5, "This value is limited by the client and database layout and should only be increased if you know the consequences."); + +// RoDEX +#define RODEX_TITLE_LENGTH (40 + 1) +#define RODEX_BODY_LENGTH (500 + 1) +#define RODEX_MAX_ITEM (5) +#define RODEX_EXPIRE (1 * 15 * 24 * 60 * 60) +#if PACKETVER >= 20170419 +#define RODEX_MAIL_PER_PAGE 32 +#else +#define RODEX_MAIL_PER_PAGE 7 +#endif + // The following system marks a different job ID system used by the map server, // which makes a lot more sense than the normal one. [Skotlex] // These marks the "level" of the job. -#define JOBL_2_1 0x100 //256 -#define JOBL_2_2 0x200 //512 -#define JOBL_2 0x300 -#define JOBL_UPPER 0x1000 //4096 -#define JOBL_BABY 0x2000 //8192 -#define JOBL_THIRD 0x4000 //16384 +#define JOBL_2_1 0x0100 +#define JOBL_2_2 0x0200 +#define JOBL_2 0x0300 // JOBL_2_1 | JOBL_2_2 +#define JOBL_UPPER 0x1000 +#define JOBL_BABY 0x2000 +#define JOBL_THIRD 0x4000 #define SCRIPT_VARNAME_LENGTH 32 ///< Maximum length of a script variable @@ -326,6 +352,12 @@ struct item { char favorite; unsigned char bound; uint64 unique_id; + + struct { + int16 index; + int16 value; + uint8 param; + } option[MAX_ITEM_OPTIONS]; }; //Equip position constants @@ -390,7 +422,7 @@ enum e_item_bound_type { #endif }; -enum { +enum e_option { OPTION_NOTHING = 0x00000000, OPTION_SIGHT = 0x00000001, OPTION_HIDE = 0x00000002, @@ -416,6 +448,7 @@ enum { OPTION_DRAGON5 = 0x04000000, OPTION_HANBOK = 0x08000000, OPTION_OKTOBERFEST = 0x10000000, + OPTION_SUMMER2 = 0x20000000, #ifndef NEW_CARTS OPTION_CART1 = 0x00000008, OPTION_CART2 = 0x00000080, @@ -427,7 +460,7 @@ enum { #endif // compound constants OPTION_DRAGON = OPTION_DRAGON1|OPTION_DRAGON2|OPTION_DRAGON3|OPTION_DRAGON4|OPTION_DRAGON5, - OPTION_COSTUME = OPTION_WEDDING|OPTION_XMAS|OPTION_SUMMER|OPTION_HANBOK|OPTION_OKTOBERFEST, + OPTION_COSTUME = OPTION_WEDDING | OPTION_XMAS | OPTION_SUMMER | OPTION_HANBOK | OPTION_OKTOBERFEST | OPTION_SUMMER2, }; struct s_skill { @@ -459,8 +492,10 @@ struct status_change_data { }; struct storage_data { - int storage_amount; - struct item items[MAX_STORAGE]; + bool save; ///< save flag. + bool received; ///< received flag. + int aggregate; ///< total item count. + VECTOR_DECL(struct item) item; ///< item vector. }; struct guild_storage { @@ -562,11 +597,11 @@ struct mmo_charstatus { int mother; int child; - unsigned int base_exp,job_exp; + uint64 base_exp, job_exp; int zeny; int bank_vault; - short class_; + int16 class; int status_point, skill_point; int hp,max_hp,sp,max_sp; unsigned int option; @@ -581,10 +616,14 @@ struct mmo_charstatus { int spear_faith, spear_calls; int sword_faith, sword_calls; - short weapon; // enum weapon_type - short shield; // view-id - short head_top,head_mid,head_bottom; - short robe; + struct { + short weapon; ///< Weapon view sprite id. + short shield; ///< Shield view sprite id. + short head_top; ///< Top headgear view sprite id. + short head_mid; ///< Middle headgear view sprite id. + short head_bottom; ///< Bottom headgear view sprite id. + short robe; ///< Robe view sprite id. + } look; char name[NAME_LENGTH]; int base_level, job_level; @@ -596,7 +635,6 @@ struct mmo_charstatus { struct point last_point,save_point,memo_point[MAX_MEMOPOINTS]; struct item inventory[MAX_INVENTORY],cart[MAX_CART]; - struct storage_data storage; struct s_skill skill[MAX_SKILL]; struct s_friend friends[MAX_FRIENDS]; //New friend system [Skotlex] @@ -670,7 +708,7 @@ struct party_member { int account_id; int char_id; char name[NAME_LENGTH]; - unsigned short class_; + int16 class; unsigned short map; unsigned short lv; unsigned leader : 1, @@ -689,7 +727,9 @@ struct party { struct map_session_data; struct guild_member { int account_id, char_id; - short hair,hair_color,gender,class_,lv; + short hair,hair_color,gender; + int16 class; + short lv; uint64 exp; int exp_payper; short online,position; @@ -777,12 +817,54 @@ struct fame_list { }; enum fame_list_type { + RANKTYPE_UNKNOWN = -1, RANKTYPE_BLACKSMITH = 0, RANKTYPE_ALCHEMIST = 1, RANKTYPE_TAEKWON = 2, RANKTYPE_PK = 3, //Not supported yet }; +struct rodex_message { + int64 id; + int sender_id; + char sender_name[NAME_LENGTH]; + int receiver_id; + int receiver_accountid; + char receiver_name[NAME_LENGTH]; + char title[RODEX_TITLE_LENGTH]; + char body[RODEX_BODY_LENGTH]; + struct { + struct item item; + int idx; + + } items[RODEX_MAX_ITEM]; + int64 zeny; + uint8 type; + int8 opentype; + bool is_read; + bool is_deleted; + int send_date; + int expire_date; + int weight; + int items_count; +}; + +VECTOR_STRUCT_DECL(rodex_maillist, struct rodex_message); + +enum rodex_opentype { + RODEX_OPENTYPE_MAIL = 0, + RODEX_OPENTYPE_ACCOUNT = 1, + RODEX_OPENTYPE_RETURN = 2, + RODEX_OPENTYPE_UNSET = 3, +}; + +enum MAIL_TYPE { + MAIL_TYPE_TEXT = 0x0, + MAIL_TYPE_ZENY = 0x2, + MAIL_TYPE_ITEM = 0x4, + MAIL_TYPE_NPC = 0x8 +}; + /** * Guild Basic Information * It is used to request changes via intif_guild_change_basicinfo in map-server and to @@ -840,7 +922,7 @@ enum { }; //These mark the ID of the jobs, as expected by the client. [Skotlex] -enum { +enum e_class { JOB_NOVICE, JOB_SWORDMAN, JOB_MAGE, @@ -993,6 +1075,8 @@ enum { JOB_OBORO, JOB_REBELLION = 4215, + JOB_SUMMONER = 4218, + #ifndef JOB_MAX JOB_MAX, #endif @@ -1057,6 +1141,7 @@ enum ammo_type { A_KUNAI, //7 A_CANNONBALL, //8 A_THROWWEAPON, //9 + MAX_AMMO_TYPE }; enum e_char_server_type { |