summaryrefslogtreecommitdiff
path: root/src/common/mmo.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/mmo.h')
-rw-r--r--src/common/mmo.h165
1 files changed, 133 insertions, 32 deletions
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 981c1b30b..276e0eb08 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -23,6 +23,7 @@
#include "config/core.h"
#include "common/cbasetypes.h"
+#include "common/db.h" // VECTORS
// server->client protocol version
// 0 - pre-?
@@ -114,40 +115,85 @@
#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
//Max amount of a single stacked item
#define MAX_AMOUNT 30000
-#define MAX_ZENY 1000000000
+#define MAX_ZENY INT_MAX
//Official Limit: 2.1b ( the var that stores the money doesn't go much higher than this by default )
#define MAX_BANK_ZENY INT_MAX
+#ifndef MAX_LEVEL
#define MAX_LEVEL 175
+#endif
#define MAX_FAME 1000000000
#define MAX_CART 100
-#define MAX_SKILL 1478
+#ifndef MAX_SKILL
+#define MAX_SKILL 1510
+#endif
+#ifndef MAX_SKILL_ID
#define MAX_SKILL_ID 10015 // [Ind/Hercules] max used skill ID
+#endif
+#ifndef MAX_SKILL_TREE
// Update this max as necessary. 86 is the value needed for Expanded Super Novice.
#define MAX_SKILL_TREE 86
+#endif
+#ifndef DEFAULT_WALK_SPEED
#define DEFAULT_WALK_SPEED 150
+#endif
+#ifndef MIN_WALK_SPEED
#define MIN_WALK_SPEED 20 /* below 20 clips animation */
+#endif
+#ifndef MAX_WALK_SPEED
#define MAX_WALK_SPEED 1000
+#endif
+#ifndef MAX_STORAGE
#define MAX_STORAGE 600
+#endif
+#ifndef MAX_GUILD_STORAGE
#define MAX_GUILD_STORAGE 600
+#endif
+#ifndef MAX_PARTY
#define MAX_PARTY 12
+#endif
+#ifndef BASE_GUILD_SIZE
#define BASE_GUILD_SIZE 16 // Base guild members (without GD_EXTENSION)
+#endif
+#ifndef MAX_GUILD
#define MAX_GUILD (BASE_GUILD_SIZE+10*6) // Increased max guild members +6 per 1 extension levels [Lupus]
+#endif
+#ifndef MAX_GUILDPOSITION
#define MAX_GUILDPOSITION 20 // Increased max guild positions to accomodate for all members [Valaris] (removed) [PoW]
+#endif
+#ifndef MAX_GUILDEXPULSION
#define MAX_GUILDEXPULSION 32
+#endif
+#ifndef MAX_GUILDALLIANCE
#define MAX_GUILDALLIANCE 16
+#endif
+#ifndef MAX_GUILDSKILL
#define MAX_GUILDSKILL 15 // Increased max guild skills because of new skills [Sara-chan]
+#endif
+#ifndef MAX_GUILDLEVEL
#define MAX_GUILDLEVEL 50
+#endif
+#ifndef MAX_GUARDIANS
#define MAX_GUARDIANS 8 // Local max per castle. [Skotlex]
+#endif
+#ifndef MAX_QUEST_OBJECTIVES
#define MAX_QUEST_OBJECTIVES 3 // Max quest objectives for a quest
-#define MAX_START_ITEMS 32 // Max number of items allowed to be given to a char whenever it's created. [mkbu95]
+#endif
// for produce
#define MIN_ATTRIBUTE 0
@@ -170,7 +216,9 @@
#define MAP_NAME_LENGTH (11 + 1)
#define MAP_NAME_LENGTH_EXT (MAP_NAME_LENGTH + 4)
+#ifndef MAX_FRIENDS
#define MAX_FRIENDS 40
+#endif
#define MAX_MEMOPOINTS 3
// Size of the fame list arrays.
@@ -186,8 +234,12 @@
#define MAX_GUILDMES2 120
// Base Homun skill.
+#ifndef HM_SKILLBASE
#define HM_SKILLBASE 8001
+#endif
+#ifndef MAX_HOMUNSKILL
#define MAX_HOMUNSKILL 43
+#endif
// Mail System
#define MAIL_MAX_INBOX 30
@@ -195,31 +247,44 @@
#define MAIL_BODY_LENGTH 200
// Mercenary System
+#ifndef MC_SKILLBASE
#define MC_SKILLBASE 8201
+#endif
+#ifndef MAX_MERCSKILL
#define MAX_MERCSKILL 40
+#endif
// Elemental System
+#ifndef MAX_ELEMENTALSKILL
#define MAX_ELEMENTALSKILL 42
+#endif
+#ifndef EL_SKILLBASE
#define EL_SKILLBASE 8401
+#endif
+#ifndef MAX_ELESKILLTREE
#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.");
// 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
-
-//Packet DB
-#define MIN_PACKET_DB 0x0064 //what's the point of minimum packet id ? [hemagx]
-#define MAX_PACKET_DB 0x0F00
-#define MAX_PACKET_POS 20
+#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
+#define INFINITE_DURATION (-1) // Infinite duration for status changes
+
struct hplugin_data_store;
enum item_types {
@@ -236,7 +301,9 @@ enum item_types {
IT_AMMO, //10
IT_DELAYCONSUME,//11
IT_CASH = 18,
+#ifndef IT_MAX
IT_MAX
+#endif
};
#define INDEX_NOT_FOUND (-1) ///< Used as invalid/failure value in various functions that return an index
@@ -256,6 +323,11 @@ struct quest {
enum quest_state state; ///< Current quest state
};
+enum attribute_flag {
+ ATTR_NONE = 0,
+ ATTR_BROKEN = 1,
+};
+
struct item {
int id;
short nameid;
@@ -269,6 +341,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
@@ -300,7 +378,7 @@ enum equip_pos {
struct point {
unsigned short map;
- short x,y;
+ int16 x, y;
};
enum e_skill_flag
@@ -328,7 +406,9 @@ enum e_item_bound_type {
IBT_GUILD = 0x2,
IBT_PARTY = 0x3,
IBT_CHARACTER = 0x4,
+#ifndef IBT_MAX
IBT_MAX = 0x4,
+#endif
};
enum {
@@ -357,6 +437,7 @@ enum {
OPTION_DRAGON5 = 0x04000000,
OPTION_HANBOK = 0x08000000,
OPTION_OKTOBERFEST = 0x10000000,
+ OPTION_SUMMER2 = 0x20000000,
#ifndef NEW_CARTS
OPTION_CART1 = 0x00000008,
OPTION_CART2 = 0x00000080,
@@ -368,7 +449,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 {
@@ -392,16 +473,18 @@ struct script_reg_str {
char *value;
};
-// For saving status changes across sessions. [Skotlex]
+/// For saving status changes across sessions. [Skotlex]
struct status_change_data {
- unsigned short type; //SC_type
- int val1, val2, val3, val4;
- unsigned int tick; //Remaining duration.
+ unsigned short type; ///< Status change type (@see enum sc_type)
+ int val1, val2, val3, val4; ///< Parameters (meaning depends on type).
+ int tick; ///< Remaining duration.
};
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 {
@@ -473,7 +556,7 @@ struct s_elemental {
int elemental_id;
int char_id;
short class_;
- int mode;
+ uint32 mode;
int hp, sp, max_hp, max_sp, matk, atk, atk2;
short hit, flee, amotion, def, mdef;
int life_time;
@@ -507,8 +590,8 @@ struct mmo_charstatus {
int zeny;
int bank_vault;
- short class_;
- unsigned int status_point,skill_point;
+ int16 class;
+ int status_point, skill_point;
int hp,max_hp,sp,max_sp;
unsigned int option;
short manner; // Defines how many minutes a char will be muted, each negative point is equivalent to a minute.
@@ -528,7 +611,7 @@ struct mmo_charstatus {
short robe;
char name[NAME_LENGTH];
- unsigned int base_level,job_level;
+ int base_level, job_level;
short str,agi,vit,int_,dex,luk;
unsigned char slot,sex;
@@ -537,7 +620,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]
@@ -611,7 +693,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,
@@ -630,7 +712,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;
@@ -718,6 +802,7 @@ struct fame_list {
};
enum fame_list_type {
+ RANKTYPE_UNKNOWN = -1,
RANKTYPE_BLACKSMITH = 0,
RANKTYPE_ALCHEMIST = 1,
RANKTYPE_TAEKWON = 2,
@@ -775,7 +860,9 @@ enum {
GD_RESTORE=10012,
GD_EMERGENCYCALL=10013,
GD_DEVELOPMENT=10014,
+#ifndef GD_MAX
GD_MAX,
+#endif
};
//These mark the ID of the jobs, as expected by the client. [Skotlex]
@@ -932,7 +1019,11 @@ enum {
JOB_OBORO,
JOB_REBELLION = 4215,
+ JOB_SUMMONER = 4218,
+
+#ifndef JOB_MAX
JOB_MAX,
+#endif
};
//Total number of classes (for data storage)
@@ -969,7 +1060,9 @@ enum weapon_type {
W_GRENADE, //21
W_HUUMA, //22
W_2HSTAFF, //23
- MAX_WEAPON_TYPE,
+#ifndef MAX_SINGLE_WEAPON_TYPE
+ MAX_SINGLE_WEAPON_TYPE,
+#endif
// dual-wield constants
W_DOUBLE_DD, ///< 2 daggers
W_DOUBLE_SS, ///< 2 swords
@@ -977,6 +1070,9 @@ enum weapon_type {
W_DOUBLE_DS, ///< dagger + sword
W_DOUBLE_DA, ///< dagger + axe
W_DOUBLE_SA, ///< sword + axe
+#ifndef MAX_WEAPON_TYPE
+ MAX_WEAPON_TYPE,
+#endif
};
enum ammo_type {
@@ -997,6 +1093,7 @@ enum e_char_server_type {
CST_OVER18 = 2,
CST_PAYING = 3,
CST_F2P = 4,
+ CST_MAX,
};
enum e_pc_reg_loading {
@@ -1045,4 +1142,8 @@ enum hz_char_ask_name_answer {
#error MAX_ZENY is too big
#endif
+#if MAX_SLOTS < 4
+#error MAX_SLOTS it too small
+#endif
+
#endif /* COMMON_MMO_H */