mmo.hpp 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201
  1. // Copyright (c) rAthena Dev Teams - Licensed under GNU GPL
  2. // For more information, see LICENCE in the main folder
  3. #ifndef MMO_HPP
  4. #define MMO_HPP
  5. #include <ctime>
  6. #include <config/core.hpp>
  7. #include "cbasetypes.hpp"
  8. #include "db.hpp"
  9. #include "timer.hpp" // t_tick
  10. #ifndef PACKETVER
  11. #error Please define PACKETVER in src/config/packets.hpp
  12. #endif
  13. ///Remove/Comment this line to disable sc_data saving. [Skotlex]
  14. #define ENABLE_SC_SAVING
  15. /** Remove/Comment this line to disable server-side hot-key saving support [Skotlex]
  16. * Note that newer clients no longer save hotkeys in the registry! */
  17. #define HOTKEY_SAVING
  18. #if PACKETVER < 20090603
  19. // (27 = 9 skills x 3 bars) (0x02b9,191)
  20. #define MAX_HOTKEYS 27
  21. #elif PACKETVER < 20090617
  22. // (36 = 9 skills x 4 bars) (0x07d9,254)
  23. #define MAX_HOTKEYS 36
  24. #else
  25. // (38 = 9 skills x 4 bars & 2 Quickslots)(0x07d9,268)
  26. #define MAX_HOTKEYS 38
  27. #endif
  28. #if PACKETVER_MAIN_NUM >= 20190522 || PACKETVER_RE_NUM >= 20190508 || PACKETVER_ZERO_NUM >= 20190605
  29. #define MAX_HOTKEYS_DB ((MAX_HOTKEYS) * 2)
  30. #else
  31. #define MAX_HOTKEYS_DB MAX_HOTKEYS
  32. #endif
  33. #define MAX_MAP_PER_SERVER 1500 /// Maximum amount of maps available on a server
  34. #ifndef INVENTORY_BASE_SIZE
  35. #define INVENTORY_BASE_SIZE 100 // Amount of inventory slots each player has
  36. #endif
  37. #ifndef INVENTORY_EXPANSION_SIZE
  38. #if PACKETVER_MAIN_NUM >= 20181031 || PACKETVER_RE_NUM >= 20181031 || PACKETVER_ZERO_NUM >= 20181114
  39. #define INVENTORY_EXPANSION_SIZE 100 // Amount of additional inventory slots a player can have
  40. #else
  41. #define INVENTORY_EXPANSION_SIZE 0
  42. #endif
  43. #endif
  44. #ifndef MAX_INVENTORY
  45. #define MAX_INVENTORY ( INVENTORY_BASE_SIZE + INVENTORY_EXPANSION_SIZE ) // Maximum items in player inventory (in total)
  46. #else
  47. #if MAX_INVENTORY < ( INVENTORY_BASE_SIZE + INVENTORY_EXPANSION_SIZE )
  48. #error Your custom MAX_INVENTORY define is too low
  49. #endif
  50. #endif
  51. /** 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.
  52. * Max value tested was 265 */
  53. #ifndef MAX_CHARS
  54. #if PACKETVER >= 20180124
  55. #define MAX_CHARS 15
  56. #elif PACKETVER >= 20100413
  57. #define MAX_CHARS 12
  58. #else
  59. #define MAX_CHARS 9
  60. #endif
  61. #endif
  62. typedef uint32 t_itemid;
  63. /** 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]
  64. * Note: The client seems unable to receive data for more than 4 slots due to all related packets having a fixed size. */
  65. #define MAX_SLOTS 4
  66. #define MAX_AMOUNT 30000 ////Max amount of a single stacked item
  67. #define MAX_ZENY INT_MAX ///Max zeny
  68. #define MAX_BANK_ZENY SINT32_MAX ///Max zeny in Bank
  69. #ifndef MAX_CASHPOINT
  70. #define MAX_CASHPOINT INT_MAX
  71. #endif
  72. #ifndef MAX_KAFRAPOINT
  73. #define MAX_KAFRAPOINT INT_MAX
  74. #endif
  75. #define MAX_FAME 1000000000 ///Max fame points
  76. #define MAX_CART 100 ///Maximum item in cart
  77. #define MAX_SKILL 1624 ///Maximum skill can be hold by Player, Homunculus, & Mercenary (skill list) AND skill_db limit
  78. #define DEFAULT_WALK_SPEED 150 ///Default walk speed (other than NPC)
  79. #define DEFAULT_NPC_WALK_SPEED 200 ///Default NPC walk speed
  80. #define MIN_WALK_SPEED 20 ///Min walk speed
  81. #define MAX_WALK_SPEED 1000 ///Max walk speed
  82. #define MAX_STORAGE 600 ///Max number of storage slots a player can have
  83. #define MAX_GUILD_STORAGE 600 ///Max number of storage slots a guild
  84. #define MAX_PARTY 12 ///Max party member
  85. #define MAX_GUILD 16+10*6 ///Increased max guild members +6 per 1 extension levels [Lupus]
  86. #define MAX_GUILDPOSITION 20 ///Increased max guild positions to accomodate for all members [Valaris] (removed) [PoW]
  87. #define MAX_GUILDEXPULSION 32 ///Max Guild expulsion
  88. #define MAX_GUILDALLIANCE 16 ///Max Guild alliance
  89. #ifdef RENEWAL
  90. #define MAX_GUILDSKILL 20 ///Max Guild skills
  91. #else
  92. #define MAX_GUILDSKILL 15 ///Max Guild skills
  93. #endif
  94. #define MAX_GUILDLEVEL 50 ///Max Guild level
  95. #define MAX_GUARDIANS 8 ///Local max per castle. If this value is increased, need to add more fields on MySQL `guild_castle` table [Skotlex]
  96. #define MAX_QUEST_OBJECTIVES 3 ///Max quest objectives for a quest
  97. #define MAX_PC_BONUS_SCRIPT 50 ///Max bonus script can be fetched from `bonus_script` table on player load [Cydh]
  98. #define MAX_ITEM_RDM_OPT 5 /// Max item random option [Napster]
  99. #define DB_NAME_LEN 256 //max len of dbs
  100. #define MAX_CLAN 500
  101. #define MAX_CLANALLIANCE 6
  102. #ifndef MAX_BARTER_REQUIREMENTS
  103. #define MAX_BARTER_REQUIREMENTS 6
  104. #endif
  105. #ifndef WEB_AUTH_TOKEN_LENGTH
  106. #define WEB_AUTH_TOKEN_LENGTH 16+1
  107. #endif
  108. enum e_enchantgrade : uint16{
  109. ENCHANTGRADE_NONE = 0,
  110. ENCHANTGRADE_D,
  111. ENCHANTGRADE_C,
  112. ENCHANTGRADE_B,
  113. ENCHANTGRADE_A
  114. };
  115. #ifdef RENEWAL
  116. #define MAX_WEAPON_LEVEL 5
  117. #define MAX_ARMOR_LEVEL 2
  118. #define MAX_ENCHANTGRADE ENCHANTGRADE_A
  119. #else
  120. #define MAX_WEAPON_LEVEL 4
  121. #define MAX_ARMOR_LEVEL 1
  122. #define MAX_ENCHANTGRADE ENCHANTGRADE_NONE
  123. #endif
  124. // for produce
  125. #define MIN_ATTRIBUTE 0
  126. #define MAX_ATTRIBUTE 4
  127. #define ATTRIBUTE_NORMAL 0
  128. #define MIN_STAR 0
  129. #define MAX_STAR 3
  130. const t_itemid WEDDING_RING_M = 2634;
  131. const t_itemid WEDDING_RING_F = 2635;
  132. //For character names, title names, guilds, maps, etc.
  133. //Includes null-terminator as it is the length of the array.
  134. #define NAME_LENGTH (23 + 1)
  135. #define PASSWD_LENGTH (32 + 1)
  136. //NPC names can be longer than it's displayed on client (NAME_LENGTH).
  137. #define NPC_NAME_LENGTH 50
  138. // <NPC_NAME_LENGTH> for npc name + 2 for a "::" + <NAME_LENGTH> for label + 1 for EOS
  139. #define EVENT_NAME_LENGTH ( NPC_NAME_LENGTH + 2 + NAME_LENGTH + 1 )
  140. //For item names, which tend to have much longer names.
  141. #define ITEM_NAME_LENGTH 50
  142. //For Map Names, which the client considers to be 16 in length including the .gat extension
  143. #define MAP_NAME_LENGTH (11 + 1)
  144. #define MAP_NAME_LENGTH_EXT (MAP_NAME_LENGTH + 4)
  145. //Pincode Length
  146. #define PINCODE_LENGTH 4
  147. #define MAX_FRIENDS 40
  148. #define MAX_MEMOPOINTS 3
  149. #define MAX_SKILLCOOLDOWN 20
  150. //Size of the fame list arrays.
  151. #define MAX_FAME_LIST 10
  152. //Limits to avoid ID collision with other game objects
  153. #define START_ACCOUNT_NUM 2000000
  154. #define END_ACCOUNT_NUM 100000000
  155. #define START_CHAR_NUM 150000
  156. //Guilds
  157. #define MAX_GUILDMES1 60
  158. #define MAX_GUILDMES2 120
  159. //Base Homun skill.
  160. #define HM_SKILLBASE 8001
  161. #define MAX_HOMUNSKILL 59
  162. #define MAX_HOMUNCULUS_CLASS 52 //[orn], Increased to 60 from 16 to allow new Homun-S.
  163. #define HM_CLASS_BASE 6001
  164. #define HM_CLASS_MAX (HM_CLASS_BASE+MAX_HOMUNCULUS_CLASS-1)
  165. //Mail System
  166. #define MAIL_MAX_INBOX 30
  167. #define MAIL_TITLE_LENGTH 40
  168. #if PACKETVER < 20150513
  169. #define MAIL_BODY_LENGTH 200
  170. #define MAIL_MAX_ITEM 1
  171. #else
  172. #define MAIL_BODY_LENGTH 500
  173. #define MAIL_MAX_ITEM 5
  174. #define MAIL_PAGE_SIZE 7
  175. #endif
  176. #ifndef MAIL_ITERATION_SIZE
  177. #define MAIL_ITERATION_SIZE 100
  178. #endif
  179. //Mercenary System
  180. #define MC_SKILLBASE 8201
  181. #define MAX_MERCSKILL 41
  182. //Elemental System
  183. #define MAX_ELEMENTALSKILL 57
  184. #define EL_SKILLBASE 8401
  185. //Automated Battle Robot System
  186. #define ABR_SKILLBASE 8601
  187. #define MAX_ABRSKILL 5
  188. //Achievement System
  189. #define MAX_ACHIEVEMENT_OBJECTIVES 10 /// Maximum different objectives in achievement_db.yml
  190. #define MAX_ACHIEVEMENT_DEPENDENTS 20 /// Maximum different dependents in achievement_db.yml
  191. #define ACHIEVEMENT_NAME_LENGTH 50 /// Max Achievement Name length
  192. enum item_types {
  193. IT_HEALING = 0,
  194. IT_UNKNOWN, //1
  195. IT_USABLE, //2
  196. IT_ETC, //3
  197. IT_ARMOR, //4
  198. IT_WEAPON, //5
  199. IT_CARD, //6
  200. IT_PETEGG, //7
  201. IT_PETARMOR,//8
  202. IT_UNKNOWN2,//9
  203. IT_AMMO, //10
  204. IT_DELAYCONSUME,//11
  205. IT_SHADOWGEAR, //12
  206. IT_CASH = 18,
  207. IT_MAX
  208. };
  209. /// Monster mode definitions to clear up code reading. [Skotlex]
  210. enum e_mode {
  211. MD_NONE = 0x0000000,
  212. MD_CANMOVE = 0x0000001,
  213. MD_LOOTER = 0x0000002,
  214. MD_AGGRESSIVE = 0x0000004,
  215. MD_ASSIST = 0x0000008,
  216. MD_CASTSENSORIDLE = 0x0000010,
  217. MD_NORANDOMWALK = 0x0000020,
  218. MD_NOCAST = 0x0000040,
  219. MD_CANATTACK = 0x0000080,
  220. //FREE = 0x0000100,
  221. MD_CASTSENSORCHASE = 0x0000200,
  222. MD_CHANGECHASE = 0x0000400,
  223. MD_ANGRY = 0x0000800,
  224. MD_CHANGETARGETMELEE = 0x0001000,
  225. MD_CHANGETARGETCHASE = 0x0002000,
  226. MD_TARGETWEAK = 0x0004000,
  227. MD_RANDOMTARGET = 0x0008000,
  228. MD_IGNOREMELEE = 0x0010000,
  229. MD_IGNOREMAGIC = 0x0020000,
  230. MD_IGNORERANGED = 0x0040000,
  231. MD_MVP = 0x0080000,
  232. MD_IGNOREMISC = 0x0100000,
  233. MD_KNOCKBACKIMMUNE = 0x0200000,
  234. MD_TELEPORTBLOCK = 0x0400000,
  235. //FREE = 0x0800000,
  236. MD_FIXEDITEMDROP = 0x1000000,
  237. MD_DETECTOR = 0x2000000,
  238. MD_STATUSIMMUNE = 0x4000000,
  239. MD_SKILLIMMUNE = 0x8000000,
  240. };
  241. #define MD_MASK 0x000FFFF
  242. #define ATR_MASK 0x0FF0000
  243. #define CL_MASK 0xF000000
  244. // Questlog states
  245. enum e_quest_state : uint8 {
  246. Q_INACTIVE, ///< Inactive quest (the user can toggle between active and inactive quests)
  247. Q_ACTIVE, ///< Active quest
  248. Q_COMPLETE, ///< Completed quest
  249. };
  250. /// Questlog entry
  251. struct quest {
  252. int quest_id; ///< Quest ID
  253. uint32 time; ///< Expiration time
  254. int count[MAX_QUEST_OBJECTIVES]; ///< Kill counters of each quest objective
  255. e_quest_state state; ///< Current quest state
  256. };
  257. /// Achievement log entry
  258. struct achievement {
  259. int achievement_id; ///< Achievement ID
  260. int count[MAX_ACHIEVEMENT_OBJECTIVES]; ///< Counters of each achievement objective
  261. time_t completed; ///< Date completed
  262. time_t rewarded; ///< Received reward?
  263. int score; ///< Amount of points achievement is worth
  264. };
  265. // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
  266. #if !defined( sun ) && ( !defined( __NETBSD__ ) || __NetBSD_Version__ >= 600000000 )
  267. #pragma pack( push, 1 )
  268. #endif
  269. struct s_item_randomoption {
  270. short id;
  271. short value;
  272. char param;
  273. } __attribute__((packed));
  274. struct item {
  275. int id;
  276. t_itemid nameid;
  277. short amount;
  278. unsigned int equip; // location(s) where item is equipped (using enum equip_pos for bitmasking)
  279. char identify;
  280. char refine;
  281. char attribute;
  282. t_itemid card[MAX_SLOTS];
  283. struct s_item_randomoption option[MAX_ITEM_RDM_OPT]; // max of 5 random options can be supported.
  284. unsigned int expire_time;
  285. char favorite, bound;
  286. uint64 unique_id;
  287. unsigned int equipSwitch; // location(s) where item is equipped for equip switching (using enum equip_pos for bitmasking)
  288. uint8 enchantgrade;
  289. } __attribute__((packed));
  290. // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
  291. #if !defined( sun ) && ( !defined( __NETBSD__ ) || __NetBSD_Version__ >= 600000000 )
  292. #pragma pack( pop )
  293. #endif
  294. //Equip position constants
  295. enum equip_pos : uint32 {
  296. EQP_HEAD_LOW = 0x000001,
  297. EQP_HEAD_MID = 0x000200, // 512
  298. EQP_HEAD_TOP = 0x000100, // 256
  299. EQP_HAND_R = 0x000002, // 2
  300. EQP_HAND_L = 0x000020, // 32
  301. EQP_ARMOR = 0x000010, // 16
  302. EQP_SHOES = 0x000040, // 64
  303. EQP_GARMENT = 0x000004, // 4
  304. EQP_ACC_R = 0x000008, // 8
  305. EQP_ACC_L = 0x000080, // 128
  306. EQP_COSTUME_HEAD_TOP = 0x000400, // 1024
  307. EQP_COSTUME_HEAD_MID = 0x000800, // 2048
  308. EQP_COSTUME_HEAD_LOW = 0x001000, // 4096
  309. EQP_COSTUME_GARMENT = 0x002000, // 8192
  310. //EQP_COSTUME_FLOOR = 0x004000, // 16384
  311. EQP_AMMO = 0x008000, // 32768
  312. EQP_SHADOW_ARMOR = 0x010000, // 65536
  313. EQP_SHADOW_WEAPON = 0x020000, // 131072
  314. EQP_SHADOW_SHIELD = 0x040000, // 262144
  315. EQP_SHADOW_SHOES = 0x080000, // 524288
  316. EQP_SHADOW_ACC_R = 0x100000, // 1048576
  317. EQP_SHADOW_ACC_L = 0x200000, // 2097152
  318. // Combined
  319. EQP_ACC_RL = EQP_ACC_R|EQP_ACC_L,
  320. EQP_SHADOW_ACC_RL = EQP_SHADOW_ACC_R|EQP_SHADOW_ACC_L,
  321. };
  322. struct point {
  323. uint16 map;
  324. uint16 x,y;
  325. };
  326. struct s_point_str{
  327. char map[MAP_NAME_LENGTH_EXT];
  328. uint16 x,y;
  329. };
  330. struct startitem {
  331. t_itemid nameid;
  332. unsigned short amount;
  333. uint32 pos;
  334. };
  335. enum e_skill_flag : int8
  336. {
  337. SKILL_FLAG_NONE = -1,
  338. SKILL_FLAG_PERMANENT,
  339. SKILL_FLAG_TEMPORARY,
  340. SKILL_FLAG_PLAGIARIZED,
  341. SKILL_FLAG_PERM_GRANTED, // Permanent, granted through someway e.g. script
  342. SKILL_FLAG_TMP_COMBO, //@FIXME for homunculus combo atm
  343. //! NOTE: This flag be the last flag, and don't change the value if not needed!
  344. SKILL_FLAG_REPLACED_LV_0 = 10, // temporary skill overshadowing permanent skill of level 'N - SKILL_FLAG_REPLACED_LV_0',
  345. };
  346. struct s_skill {
  347. uint16 id;
  348. uint8 lv;
  349. uint8 flag; // see enum e_skill_flag
  350. };
  351. struct script_reg_state {
  352. unsigned int type : 1; // because I'm a memory hoarder and having them in the same struct would be a 8-byte/instance waste while ints outnumber str on a 10000-to-1 ratio.
  353. unsigned int update : 1; // whether it needs to be sent to char server for insertion/update/delete
  354. };
  355. struct script_reg_num {
  356. struct script_reg_state flag;
  357. int64 value;
  358. };
  359. struct script_reg_str {
  360. struct script_reg_state flag;
  361. char *value;
  362. };
  363. //For saving status changes across sessions. [Skotlex]
  364. struct status_change_data {
  365. unsigned short type; //SC_type
  366. long val1, val2, val3, val4;
  367. t_tick tick; //Remaining duration.
  368. };
  369. #define MAX_BONUS_SCRIPT_LENGTH 512
  370. struct bonus_script_data {
  371. char script_str[MAX_BONUS_SCRIPT_LENGTH]; //< Script string
  372. t_tick tick; ///< Tick
  373. uint16 flag; ///< Flags @see enum e_bonus_script_flags
  374. int16 icon; ///< Icon SI
  375. uint8 type; ///< 0 - None, 1 - Buff, 2 - Debuff
  376. };
  377. struct skill_cooldown_data {
  378. unsigned short skill_id;
  379. t_tick tick;
  380. };
  381. enum storage_type {
  382. TABLE_INVENTORY = 1,
  383. TABLE_CART,
  384. TABLE_STORAGE,
  385. TABLE_GUILD_STORAGE,
  386. };
  387. enum e_storage_mode {
  388. STOR_MODE_NONE = 0x0,
  389. STOR_MODE_GET = 0x1,
  390. STOR_MODE_PUT = 0x2,
  391. STOR_MODE_ALL = 0x3,
  392. };
  393. struct s_storage {
  394. bool dirty; ///< Dirty status, data needs to be saved
  395. bool status; ///< Current status of storage (opened or closed)
  396. uint16 amount; ///< Amount of items in storage
  397. bool lock; ///< If locked, can't use storage when item bound retrieval
  398. uint32 id; ///< Account ID / Character ID / Guild ID (owner of storage)
  399. enum storage_type type; ///< Type of storage (inventory, cart, storage, guild storage)
  400. uint16 max_amount; ///< Maximum amount of items in storage
  401. uint8 stor_id; ///< Storage ID
  402. struct {
  403. unsigned get : 1;
  404. unsigned put : 1;
  405. } state;
  406. union { // Max for inventory, storage, cart, and guild storage are 818 each without changing this struct and struct item [2016/08/14]
  407. struct item items_inventory[MAX_INVENTORY];
  408. struct item items_storage[MAX_STORAGE];
  409. struct item items_cart[MAX_CART];
  410. struct item items_guild[MAX_GUILD_STORAGE];
  411. } u;
  412. };
  413. struct s_storage_table {
  414. char name[NAME_LENGTH];
  415. char table[DB_NAME_LEN];
  416. uint16 max_num;
  417. uint8 id;
  418. };
  419. struct s_pet {
  420. uint32 account_id;
  421. uint32 char_id;
  422. int pet_id;
  423. short class_;
  424. short level;
  425. t_itemid egg_id;//pet egg id
  426. t_itemid equip;//pet equip name_id
  427. short intimate;//pet friendly
  428. short hungry;//pet hungry
  429. char name[NAME_LENGTH];
  430. char rename_flag;
  431. char incubate;
  432. bool autofeed;
  433. };
  434. struct s_homunculus { //[orn]
  435. char name[NAME_LENGTH];
  436. int hom_id;
  437. uint32 char_id;
  438. short class_;
  439. short prev_class;
  440. uint32 hp,max_hp,sp,max_sp;
  441. unsigned int intimacy; //[orn]
  442. short hunger;
  443. struct s_skill hskill[MAX_HOMUNSKILL]; //albator
  444. short skillpts;
  445. short level;
  446. t_exp exp;
  447. short rename_flag;
  448. short vaporize; //albator
  449. int str;
  450. int agi;
  451. int vit;
  452. int int_;
  453. int dex;
  454. int luk;
  455. int str_value;
  456. int agi_value;
  457. int vit_value;
  458. int int_value;
  459. int dex_value;
  460. int luk_value;
  461. char spiritball; //for homun S [lighta]
  462. bool autofeed;
  463. };
  464. struct s_mercenary {
  465. int mercenary_id;
  466. uint32 char_id;
  467. short class_;
  468. int hp, sp;
  469. unsigned int kill_count;
  470. t_tick life_time;
  471. };
  472. struct s_elemental {
  473. int elemental_id;
  474. uint32 char_id;
  475. short class_;
  476. int mode;
  477. int hp, sp, max_hp, max_sp, matk, atk, atk2;
  478. short hit, flee, amotion, def, mdef;
  479. t_tick life_time;
  480. };
  481. struct s_friend {
  482. uint32 account_id;
  483. uint32 char_id;
  484. char name[NAME_LENGTH];
  485. };
  486. #ifdef HOTKEY_SAVING
  487. struct hotkey {
  488. unsigned int id;
  489. unsigned short lv;
  490. unsigned char type; // 0: item, 1: skill
  491. };
  492. #endif
  493. struct mmo_charstatus {
  494. uint32 char_id;
  495. uint32 account_id;
  496. uint32 partner_id;
  497. uint32 father;
  498. uint32 mother;
  499. uint32 child;
  500. t_exp base_exp,job_exp;
  501. int zeny;
  502. short class_; ///< Player's JobID
  503. unsigned int status_point,skill_point,trait_point;
  504. int hp,max_hp,sp,max_sp,ap,max_ap;
  505. unsigned int option;
  506. short manner; // Defines how many minutes a char will be muted, each negative point is equivalent to a minute.
  507. unsigned char karma;
  508. short hair,hair_color,clothes_color,body;
  509. int party_id,guild_id,pet_id,hom_id,mer_id,ele_id,clan_id;
  510. int fame;
  511. // Mercenary Guilds Rank
  512. int arch_faith, arch_calls;
  513. int spear_faith, spear_calls;
  514. int sword_faith, sword_calls;
  515. short weapon; // enum weapon_type
  516. short shield; // view-id
  517. short head_top,head_mid,head_bottom;
  518. short robe;
  519. uint8 body_direction;
  520. char name[NAME_LENGTH];
  521. unsigned int base_level,job_level;
  522. unsigned short str,agi,vit,int_,dex,luk;
  523. unsigned short pow,sta,wis,spl,con,crt;
  524. unsigned char slot,sex;
  525. uint32 mapip;
  526. uint16 mapport;
  527. struct s_point_str last_point;
  528. int32 last_point_instanceid;
  529. struct s_point_str save_point;
  530. struct s_point_str memo_point[MAX_MEMOPOINTS];
  531. struct s_skill skill[MAX_SKILL];
  532. struct s_friend friends[MAX_FRIENDS]; //New friend system [Skotlex]
  533. #ifdef HOTKEY_SAVING
  534. struct hotkey hotkeys[MAX_HOTKEYS_DB];
  535. #endif
  536. bool show_equip, disable_call;
  537. bool disable_partyinvite;
  538. short rename;
  539. time_t delete_date;
  540. time_t unban_time;
  541. // Char server addon system
  542. unsigned int character_moves;
  543. unsigned char font;
  544. bool cashshop_sent; // Whether the player has received the CashShop list
  545. uint32 uniqueitem_counter;
  546. unsigned char hotkey_rowshift;
  547. unsigned char hotkey_rowshift2;
  548. unsigned long title_id;
  549. uint16 inventory_slots;
  550. };
  551. typedef enum mail_status {
  552. MAIL_NEW,
  553. MAIL_UNREAD,
  554. MAIL_READ,
  555. } mail_status;
  556. enum mail_inbox_type {
  557. MAIL_INBOX_NORMAL = 0,
  558. MAIL_INBOX_ACCOUNT,
  559. MAIL_INBOX_RETURNED
  560. };
  561. enum mail_attachment_type {
  562. MAIL_ATT_NONE = 0,
  563. MAIL_ATT_ZENY = 1,
  564. MAIL_ATT_ITEM = 2,
  565. MAIL_ATT_ALL = MAIL_ATT_ZENY | MAIL_ATT_ITEM
  566. };
  567. struct mail_message {
  568. int id;
  569. uint32 send_id; //hold char_id of sender
  570. char send_name[NAME_LENGTH]; //sender nickname
  571. uint32 dest_id; //hold char_id of receiver
  572. char dest_name[NAME_LENGTH]; //receiver nickname
  573. char title[MAIL_TITLE_LENGTH];
  574. char body[MAIL_BODY_LENGTH];
  575. enum mail_inbox_type type;
  576. time_t scheduled_deletion;
  577. mail_status status;
  578. time_t timestamp; // marks when the message was sent
  579. uint32 zeny;
  580. struct item item[MAIL_MAX_ITEM];
  581. };
  582. struct mail_data {
  583. short amount;
  584. bool full;
  585. short unchecked, unread;
  586. struct mail_message msg[MAIL_MAX_INBOX];
  587. };
  588. struct auction_data {
  589. unsigned int auction_id;
  590. int seller_id;
  591. char seller_name[NAME_LENGTH];
  592. int buyer_id;
  593. char buyer_name[NAME_LENGTH];
  594. struct item item;
  595. // This data is required for searching, as itemdb is not read by char server
  596. char item_name[ITEM_NAME_LENGTH];
  597. short type;
  598. unsigned short hours;
  599. int price, buynow;
  600. time_t timestamp; // auction's end time
  601. int auction_end_timer;
  602. };
  603. struct party_member {
  604. uint32 account_id;
  605. uint32 char_id;
  606. char name[NAME_LENGTH];
  607. unsigned short class_;
  608. char map[MAP_NAME_LENGTH_EXT];
  609. unsigned short lv;
  610. unsigned leader : 1,
  611. online : 1;
  612. };
  613. struct party {
  614. int party_id;
  615. char name[NAME_LENGTH];
  616. unsigned char count; //Count of online characters.
  617. unsigned exp : 1,
  618. item : 2; //&1: Party-Share (round-robin), &2: pickup style: shared.
  619. struct party_member member[MAX_PARTY];
  620. };
  621. class map_session_data;
  622. struct guild_member {
  623. uint32 account_id, char_id;
  624. short hair,hair_color,gender,class_,lv;
  625. t_exp exp;
  626. short online,position;
  627. char name[NAME_LENGTH];
  628. map_session_data *sd;
  629. unsigned char modified;
  630. uint32 last_login;
  631. };
  632. struct guild_position {
  633. char name[NAME_LENGTH];
  634. int mode;
  635. int exp_mode;
  636. unsigned char modified;
  637. };
  638. struct guild_alliance {
  639. int opposition;
  640. int guild_id;
  641. char name[NAME_LENGTH];
  642. };
  643. struct guild_expulsion {
  644. char name[NAME_LENGTH];
  645. char mes[40];
  646. uint32 account_id;
  647. uint32 char_id;
  648. };
  649. struct guild_skill {
  650. int id,lv;
  651. };
  652. struct Channel;
  653. struct mmo_guild {
  654. int guild_id;
  655. short guild_lv, connect_member, max_member, average_lv;
  656. t_exp exp;
  657. t_exp next_exp;
  658. int skill_point;
  659. char name[NAME_LENGTH],master[NAME_LENGTH];
  660. struct guild_member member[MAX_GUILD];
  661. struct guild_position position[MAX_GUILDPOSITION];
  662. char mes1[MAX_GUILDMES1],mes2[MAX_GUILDMES2];
  663. int emblem_len,emblem_id;
  664. char emblem_data[2048];
  665. struct guild_alliance alliance[MAX_GUILDALLIANCE];
  666. struct guild_expulsion expulsion[MAX_GUILDEXPULSION];
  667. struct guild_skill skill[MAX_GUILDSKILL];
  668. time_t last_leader_change;
  669. };
  670. enum e_woe_type{
  671. WOE_FIRST_EDITION = 1,
  672. WOE_SECOND_EDITION,
  673. WOE_THIRD_EDITION,
  674. WOE_MAX
  675. };
  676. struct guild_castle {
  677. int castle_id;
  678. int mapindex;
  679. char castle_name[NAME_LENGTH];
  680. char castle_event[NPC_NAME_LENGTH];
  681. e_woe_type type;
  682. uint16 client_id;
  683. bool warp_enabled;
  684. uint16 warp_x;
  685. uint16 warp_y;
  686. uint32 zeny;
  687. uint32 zeny_siege;
  688. int guild_id;
  689. int economy;
  690. int defense;
  691. int triggerE;
  692. int triggerD;
  693. int nextTime;
  694. int payTime;
  695. int createTime;
  696. int visibleC;
  697. struct {
  698. unsigned visible : 1;
  699. int id; // object id
  700. } guardian[MAX_GUARDIANS];
  701. int* temp_guardians; // ids of temporary guardians (mobs)
  702. int temp_guardians_max;
  703. };
  704. /// Enum for guild castle data script commands
  705. enum e_castle_data : uint8 {
  706. CD_NONE = 0,
  707. CD_GUILD_ID, ///< Guild ID
  708. CD_CURRENT_ECONOMY, ///< Castle Economy score
  709. CD_CURRENT_DEFENSE, ///< Castle Defense score
  710. CD_INVESTED_ECONOMY, ///< Number of times the economy was invested in today
  711. CD_INVESTED_DEFENSE, ///< Number of times the defense was invested in today
  712. CD_NEXT_TIME, ///< unused
  713. CD_PAY_TIME, ///< unused
  714. CD_CREATE_TIME, ///< unused
  715. CD_ENABLED_KAFRA, ///< Is 1 if a Kafra was hired for this castle, 0 otherwise
  716. CD_ENABLED_GUARDIAN00, ///< Is 1 if the 1st guardian is present (Soldier Guardian)
  717. // The others in between are not needed in src, but are exported for the script engine
  718. CD_MAX = CD_ENABLED_GUARDIAN00 + MAX_GUARDIANS
  719. };
  720. /// Guild Permissions
  721. enum e_guild_permission {
  722. GUILD_PERM_INVITE = 0x001,
  723. GUILD_PERM_EXPEL = 0x010,
  724. GUILD_PERM_STORAGE = 0x100,
  725. #if PACKETVER >= 20140205
  726. GUILD_PERM_ALL = GUILD_PERM_INVITE|GUILD_PERM_EXPEL|GUILD_PERM_STORAGE,
  727. #else
  728. GUILD_PERM_ALL = GUILD_PERM_INVITE|GUILD_PERM_EXPEL,
  729. #endif
  730. GUILD_PERM_DEFAULT = GUILD_PERM_ALL,
  731. };
  732. struct fame_list {
  733. int id;
  734. int fame;
  735. char name[NAME_LENGTH];
  736. };
  737. enum e_guild_info { //Change Guild Infos
  738. GBI_EXP =1, // Guild Experience (EXP)
  739. GBI_GUILDLV, // Guild level
  740. GBI_SKILLPOINT, // Guild skillpoints
  741. GBI_SKILLLV, // Guild skill_lv ?? seem unused
  742. };
  743. enum e_guild_member_info { //Change Member Infos
  744. GMI_POSITION =0,
  745. GMI_EXP,
  746. GMI_HAIR,
  747. GMI_HAIR_COLOR,
  748. GMI_GENDER,
  749. GMI_CLASS,
  750. GMI_LEVEL,
  751. };
  752. enum e_guild_skill {
  753. GD_SKILLBASE = 10000,
  754. GD_APPROVAL = 10000,
  755. GD_KAFRACONTRACT,
  756. GD_GUARDRESEARCH,
  757. GD_GUARDUP,
  758. GD_EXTENSION,
  759. GD_GLORYGUILD,
  760. GD_LEADERSHIP,
  761. GD_GLORYWOUNDS,
  762. GD_SOULCOLD,
  763. GD_HAWKEYES,
  764. GD_BATTLEORDER,
  765. GD_REGENERATION,
  766. GD_RESTORE,
  767. GD_EMERGENCYCALL,
  768. GD_DEVELOPMENT,
  769. GD_ITEMEMERGENCYCALL,
  770. GD_GUILD_STORAGE,
  771. GD_CHARGESHOUT_FLAG,
  772. GD_CHARGESHOUT_BEATING,
  773. GD_EMERGENCY_MOVE,
  774. GD_MAX,
  775. };
  776. #define MAX_SKILL_ID GD_MAX
  777. //These mark the ID of the jobs, as expected by the client. [Skotlex]
  778. enum e_job {
  779. JOB_NOVICE,
  780. JOB_SWORDMAN,
  781. JOB_MAGE,
  782. JOB_ARCHER,
  783. JOB_ACOLYTE,
  784. JOB_MERCHANT,
  785. JOB_THIEF,
  786. JOB_KNIGHT,
  787. JOB_PRIEST,
  788. JOB_WIZARD,
  789. JOB_BLACKSMITH,
  790. JOB_HUNTER,
  791. JOB_ASSASSIN,
  792. JOB_KNIGHT2,
  793. JOB_CRUSADER,
  794. JOB_MONK,
  795. JOB_SAGE,
  796. JOB_ROGUE,
  797. JOB_ALCHEMIST,
  798. JOB_BARD,
  799. JOB_DANCER,
  800. JOB_CRUSADER2,
  801. JOB_WEDDING,
  802. JOB_SUPER_NOVICE,
  803. JOB_GUNSLINGER,
  804. JOB_NINJA,
  805. JOB_XMAS,
  806. JOB_SUMMER,
  807. JOB_HANBOK,
  808. JOB_OKTOBERFEST,
  809. JOB_SUMMER2,
  810. JOB_MAX_BASIC,
  811. JOB_NOVICE_HIGH = 4001,
  812. JOB_SWORDMAN_HIGH,
  813. JOB_MAGE_HIGH,
  814. JOB_ARCHER_HIGH,
  815. JOB_ACOLYTE_HIGH,
  816. JOB_MERCHANT_HIGH,
  817. JOB_THIEF_HIGH,
  818. JOB_LORD_KNIGHT,
  819. JOB_HIGH_PRIEST,
  820. JOB_HIGH_WIZARD,
  821. JOB_WHITESMITH,
  822. JOB_SNIPER,
  823. JOB_ASSASSIN_CROSS,
  824. JOB_LORD_KNIGHT2,
  825. JOB_PALADIN,
  826. JOB_CHAMPION,
  827. JOB_PROFESSOR,
  828. JOB_STALKER,
  829. JOB_CREATOR,
  830. JOB_CLOWN,
  831. JOB_GYPSY,
  832. JOB_PALADIN2,
  833. JOB_BABY,
  834. JOB_BABY_SWORDMAN,
  835. JOB_BABY_MAGE,
  836. JOB_BABY_ARCHER,
  837. JOB_BABY_ACOLYTE,
  838. JOB_BABY_MERCHANT,
  839. JOB_BABY_THIEF,
  840. JOB_BABY_KNIGHT,
  841. JOB_BABY_PRIEST,
  842. JOB_BABY_WIZARD,
  843. JOB_BABY_BLACKSMITH,
  844. JOB_BABY_HUNTER,
  845. JOB_BABY_ASSASSIN,
  846. JOB_BABY_KNIGHT2,
  847. JOB_BABY_CRUSADER,
  848. JOB_BABY_MONK,
  849. JOB_BABY_SAGE,
  850. JOB_BABY_ROGUE,
  851. JOB_BABY_ALCHEMIST,
  852. JOB_BABY_BARD,
  853. JOB_BABY_DANCER,
  854. JOB_BABY_CRUSADER2,
  855. JOB_SUPER_BABY,
  856. JOB_TAEKWON,
  857. JOB_STAR_GLADIATOR,
  858. JOB_STAR_GLADIATOR2,
  859. JOB_SOUL_LINKER,
  860. JOB_GANGSI,
  861. JOB_DEATH_KNIGHT,
  862. JOB_DARK_COLLECTOR,
  863. JOB_RUNE_KNIGHT = 4054,
  864. JOB_WARLOCK,
  865. JOB_RANGER,
  866. JOB_ARCH_BISHOP,
  867. JOB_MECHANIC,
  868. JOB_GUILLOTINE_CROSS,
  869. JOB_RUNE_KNIGHT_T,
  870. JOB_WARLOCK_T,
  871. JOB_RANGER_T,
  872. JOB_ARCH_BISHOP_T,
  873. JOB_MECHANIC_T,
  874. JOB_GUILLOTINE_CROSS_T,
  875. JOB_ROYAL_GUARD,
  876. JOB_SORCERER,
  877. JOB_MINSTREL,
  878. JOB_WANDERER,
  879. JOB_SURA,
  880. JOB_GENETIC,
  881. JOB_SHADOW_CHASER,
  882. JOB_ROYAL_GUARD_T,
  883. JOB_SORCERER_T,
  884. JOB_MINSTREL_T,
  885. JOB_WANDERER_T,
  886. JOB_SURA_T,
  887. JOB_GENETIC_T,
  888. JOB_SHADOW_CHASER_T,
  889. JOB_RUNE_KNIGHT2,
  890. JOB_RUNE_KNIGHT_T2,
  891. JOB_ROYAL_GUARD2,
  892. JOB_ROYAL_GUARD_T2,
  893. JOB_RANGER2,
  894. JOB_RANGER_T2,
  895. JOB_MECHANIC2,
  896. JOB_MECHANIC_T2,
  897. JOB_BABY_RUNE_KNIGHT = 4096,
  898. JOB_BABY_WARLOCK,
  899. JOB_BABY_RANGER,
  900. JOB_BABY_ARCH_BISHOP,
  901. JOB_BABY_MECHANIC,
  902. JOB_BABY_GUILLOTINE_CROSS,
  903. JOB_BABY_ROYAL_GUARD,
  904. JOB_BABY_SORCERER,
  905. JOB_BABY_MINSTREL,
  906. JOB_BABY_WANDERER,
  907. JOB_BABY_SURA,
  908. JOB_BABY_GENETIC,
  909. JOB_BABY_SHADOW_CHASER,
  910. JOB_BABY_RUNE_KNIGHT2,
  911. JOB_BABY_ROYAL_GUARD2,
  912. JOB_BABY_RANGER2,
  913. JOB_BABY_MECHANIC2,
  914. JOB_SUPER_NOVICE_E = 4190,
  915. JOB_SUPER_BABY_E,
  916. JOB_KAGEROU = 4211,
  917. JOB_OBORO,
  918. JOB_REBELLION = 4215,
  919. JOB_SUMMONER = 4218,
  920. JOB_BABY_SUMMONER = 4220,
  921. JOB_BABY_NINJA = 4222,
  922. JOB_BABY_KAGEROU,
  923. JOB_BABY_OBORO,
  924. JOB_BABY_TAEKWON,
  925. JOB_BABY_STAR_GLADIATOR,
  926. JOB_BABY_SOUL_LINKER,
  927. JOB_BABY_GUNSLINGER,
  928. JOB_BABY_REBELLION,
  929. JOB_BABY_STAR_GLADIATOR2 = 4238,
  930. JOB_STAR_EMPEROR,
  931. JOB_SOUL_REAPER,
  932. JOB_BABY_STAR_EMPEROR,
  933. JOB_BABY_SOUL_REAPER,
  934. JOB_STAR_EMPEROR2,
  935. JOB_BABY_STAR_EMPEROR2,
  936. JOB_DRAGON_KNIGHT = 4252,
  937. JOB_MEISTER,
  938. JOB_SHADOW_CROSS,
  939. JOB_ARCH_MAGE,
  940. JOB_CARDINAL,
  941. JOB_WINDHAWK,
  942. JOB_IMPERIAL_GUARD,
  943. JOB_BIOLO,
  944. JOB_ABYSS_CHASER,
  945. JOB_ELEMENTAL_MASTER,
  946. JOB_INQUISITOR,
  947. JOB_TROUBADOUR,
  948. JOB_TROUVERE,
  949. JOB_WINDHAWK2 = 4278,
  950. JOB_MEISTER2,
  951. JOB_DRAGON_KNIGHT2,
  952. JOB_IMPERIAL_GUARD2,
  953. JOB_SKY_EMPEROR = 4302,
  954. JOB_SOUL_ASCETIC,
  955. JOB_SHINKIRO,
  956. JOB_SHIRANUI,
  957. JOB_NIGHT_WATCH,
  958. JOB_HYPER_NOVICE,
  959. JOB_SPIRIT_HANDLER,
  960. JOB_SKY_EMPEROR2 = 4316,
  961. JOB_MAX,
  962. };
  963. enum e_sex : uint8 {
  964. SEX_FEMALE = 0,
  965. SEX_MALE,
  966. SEX_BOTH,
  967. SEX_SERVER
  968. };
  969. /// Item Bound Type
  970. enum bound_type {
  971. BOUND_NONE = 0, /// No bound
  972. BOUND_ACCOUNT, /// 1- Account Bound
  973. BOUND_GUILD, /// 2 - Guild Bound
  974. BOUND_PARTY, /// 3 - Party Bound
  975. BOUND_CHAR, /// 4 - Character Bound
  976. BOUND_MAX,
  977. BOUND_ONEQUIP = 1, ///< Show notification when item will be bound on equip
  978. BOUND_DISPYELLOW = 2, /// Shows the item name in yellow color
  979. };
  980. enum e_pc_reg_loading {
  981. PRL_NONE = 0x0,
  982. PRL_CHAR = 0x1,
  983. PRL_ACCL = 0x2, // local
  984. PRL_ACCG = 0x4, // global
  985. PRL_ALL = 0xFF,
  986. };
  987. enum e_party_member_withdraw {
  988. PARTY_MEMBER_WITHDRAW_LEAVE, ///< /leave
  989. PARTY_MEMBER_WITHDRAW_EXPEL, ///< Kicked
  990. PARTY_MEMBER_WITHDRAW_CANT_LEAVE, ///< Cannot /leave
  991. PARTY_MEMBER_WITHDRAW_CANT_EXPEL, ///< Cannot be kicked
  992. };
  993. enum e_rank {
  994. RANK_BLACKSMITH = 0,
  995. RANK_ALCHEMIST = 1,
  996. RANK_TAEKWON = 2,
  997. RANK_KILLER = 3
  998. };
  999. struct clan_alliance {
  1000. int opposition;
  1001. int clan_id;
  1002. char name[NAME_LENGTH];
  1003. };
  1004. struct clan{
  1005. int id;
  1006. char name[NAME_LENGTH];
  1007. char master[NAME_LENGTH];
  1008. char map[MAP_NAME_LENGTH_EXT];
  1009. short max_member, connect_member;
  1010. map_session_data *members[MAX_CLAN];
  1011. struct clan_alliance alliance[MAX_CLANALLIANCE];
  1012. unsigned short instance_id;
  1013. };
  1014. // Sanity checks...
  1015. #if MAX_ZENY > INT_MAX
  1016. #error MAX_ZENY is too big
  1017. #endif
  1018. // This sanity check is required, because some other places(like skill.cpp) rely on this
  1019. #if MAX_PARTY < 2
  1020. #error MAX_PARTY is too small, you need at least 2 players for a party
  1021. #endif
  1022. #ifndef MIN_CHARS
  1023. #define MIN_CHARS ( MAX_CHARS - MAX_CHAR_VIP - MAX_CHAR_BILLING ) // Default number of characters per account.
  1024. #endif
  1025. #if (MIN_CHARS + MAX_CHAR_VIP + MAX_CHAR_BILLING) > MAX_CHARS
  1026. #error Config of MAX_CHARS is invalid
  1027. #endif
  1028. #if MIN_STORAGE > MAX_STORAGE
  1029. #error Config of MIN_STORAGE is invalid
  1030. #endif
  1031. #ifdef PACKET_OBFUSCATION
  1032. #if PACKETVER < 20110817
  1033. #undef PACKET_OBFUSCATION
  1034. #endif
  1035. #endif
  1036. /* Feb 1st 2012 */
  1037. #if PACKETVER >= 20120201
  1038. #define NEW_CARTS
  1039. #ifndef ENABLE_SC_SAVING
  1040. #warning "Cart won't be able to be saved for relog"
  1041. #endif
  1042. #if PACKETVER >= 20191106
  1043. #define MAX_CARTS 13 // used for another new cart design
  1044. #elif PACKETVER >= 20150826
  1045. #define MAX_CARTS 12 // used for 3 new cart design
  1046. #else
  1047. #define MAX_CARTS 9
  1048. #endif
  1049. #else
  1050. #define MAX_CARTS 5
  1051. #endif
  1052. #endif /* MMO_HPP */