mmo.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. // Copyright (c) Athena Dev Teams - Licensed under GNU GPL
  2. // For more information, see LICENCE in the main folder
  3. #ifndef _MMO_H_
  4. #define _MMO_H_
  5. #include "cbasetypes.h"
  6. #include <time.h>
  7. #define FIFOSIZE_SERVERLINK 256*1024
  8. //Remove/Comment this line to disable sc_data saving. [Skotlex]
  9. #define ENABLE_SC_SAVING
  10. //Remove/Comment this line to disable server-side hot-key saving support [Skotlex]
  11. //Note that newer clients no longer save hotkeys in the registry!
  12. //The number is the max number of hotkeys to save (27 = 9 skills x 3 bars)
  13. #define HOTKEY_SAVING 27
  14. #define MAX_MAP_PER_SERVER 1024
  15. #define MAX_INVENTORY 100
  16. //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.
  17. #define MAX_CHARS 9
  18. //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]
  19. //Note: The client seems unable to receive data for more than 4 slots due to all related packets having a fixed size.
  20. #define MAX_SLOTS 4
  21. #define MAX_AMOUNT 30000
  22. #define MAX_ZENY 1000000000
  23. #define MAX_FAME 1000000000
  24. #define MAX_CART 100
  25. #define MAX_SKILL 1100 // Bumped to 1100 for new quest skills, will need to further increase one day... [DracoRPG]
  26. #define GLOBAL_REG_NUM 96
  27. #define ACCOUNT_REG_NUM 64
  28. #define ACCOUNT_REG2_NUM 16
  29. //Should hold the max of GLOBAL/ACCOUNT/ACCOUNT2 (needed for some arrays that hold all three)
  30. #define MAX_REG_NUM 96
  31. #define DEFAULT_WALK_SPEED 150
  32. #define MIN_WALK_SPEED 0
  33. #define MAX_WALK_SPEED 1000
  34. #define MAX_STORAGE 300
  35. #define MAX_GUILD_STORAGE 1000
  36. #define MAX_PARTY 12
  37. #define MAX_GUILD 16+10*6 // increased max guild members +6 per 1 extension levels [Lupus]
  38. #define MAX_GUILDPOSITION 20 // increased max guild positions to accomodate for all members [Valaris] (removed) [PoW]
  39. #define MAX_GUILDEXPULSION 32
  40. #define MAX_GUILDALLIANCE 16
  41. #define MAX_GUILDSKILL 15 // increased max guild skills because of new skills [Sara-chan]
  42. #define MAX_GUILDCASTLE 24 // increased to include novice castles [Valaris]
  43. #define MAX_GUILDLEVEL 50
  44. #define MAX_GUARDIANS 8 //Local max per castle. [Skotlex]
  45. #define MIN_HAIR_STYLE battle_config.min_hair_style
  46. #define MAX_HAIR_STYLE battle_config.max_hair_style
  47. #define MIN_HAIR_COLOR battle_config.min_hair_color
  48. #define MAX_HAIR_COLOR battle_config.max_hair_color
  49. #define MIN_CLOTH_COLOR battle_config.min_cloth_color
  50. #define MAX_CLOTH_COLOR battle_config.max_cloth_color
  51. // for produce
  52. #define MIN_ATTRIBUTE 0
  53. #define MAX_ATTRIBUTE 4
  54. #define ATTRIBUTE_NORMAL 0
  55. #define MIN_STAR 0
  56. #define MAX_STAR 3
  57. #define MIN_PORTAL_MEMO 0
  58. #define MAX_PORTAL_MEMO 2
  59. #define MAX_STATUS_TYPE 5
  60. #define WEDDING_RING_M 2634
  61. #define WEDDING_RING_F 2635
  62. //For character names, title names, guilds, maps, etc.
  63. //Includes null-terminator as it is the length of the array.
  64. #define NAME_LENGTH 24
  65. //For item names, which tend to have much longer names.
  66. #define ITEM_NAME_LENGTH 50
  67. //For Map Names, which the client considers to be 16 in length including the .gat extension
  68. #define MAP_NAME_LENGTH 12
  69. #define MAP_NAME_LENGTH_EXT 16
  70. #define MAX_FRIENDS 40
  71. #define MAX_MEMOPOINTS 10
  72. //Size of the fame list arrays.
  73. #define MAX_FAME_LIST 10
  74. //These max values can be exceeded and the char/map servers will update them with no problems
  75. //These are just meant to minimize the updating needed between char/map servers as players login.
  76. //Room for initial 10K accounts
  77. #define DEFAULT_MAX_ACCOUNT_ID 2010000
  78. #define START_ACCOUNT_NUM 2000000
  79. #define END_ACCOUNT_NUM 100000000
  80. //Room for initial 100k characters
  81. #define DEFAULT_MAX_CHAR_ID 250000
  82. //Base Homun skill.
  83. #define HM_SKILLBASE 8000
  84. #define MAX_HOMUNSKILL 16
  85. #define MAX_HOMUNCULUS_CLASS 16 //[orn]
  86. #define HM_CLASS_BASE 6001
  87. #define HM_CLASS_MAX (HM_CLASS_BASE+MAX_HOMUNCULUS_CLASS-1)
  88. struct item {
  89. int id;
  90. short nameid;
  91. short amount;
  92. unsigned short equip;
  93. char identify;
  94. char refine;
  95. char attribute;
  96. short card[MAX_SLOTS];
  97. };
  98. struct point{
  99. unsigned short map;
  100. short x,y;
  101. };
  102. struct skill {
  103. unsigned short id,lv,flag;
  104. };
  105. struct global_reg {
  106. char str[32];
  107. char value[256]; // [zBuffer]
  108. };
  109. //Holds array of global registries, used by the char server and converter.
  110. struct accreg {
  111. int account_id, char_id;
  112. int reg_num;
  113. struct global_reg reg[MAX_REG_NUM];
  114. };
  115. //For saving status changes across sessions. [Skotlex]
  116. struct status_change_data {
  117. unsigned short type; //SC_type
  118. int val1, val2, val3, val4, tick; //Remaining duration.
  119. };
  120. struct s_pet {
  121. int account_id;
  122. int char_id;
  123. int pet_id;
  124. short class_;
  125. short level;
  126. short egg_id;//pet egg id
  127. short equip;//pet equip name_id
  128. short intimate;//pet friendly
  129. short hungry;//pet hungry
  130. char name[NAME_LENGTH];
  131. char rename_flag;
  132. char incuvate;
  133. };
  134. struct s_homunculus { //[orn]
  135. char name[NAME_LENGTH];
  136. int hom_id;
  137. int char_id;
  138. short class_;
  139. int hp,max_hp,sp,max_sp;
  140. unsigned int intimacy; //[orn]
  141. short hunger;
  142. struct skill hskill[MAX_HOMUNSKILL]; //albator
  143. short skillpts;
  144. short level;
  145. unsigned int exp;
  146. short rename_flag;
  147. short vaporize; //albator
  148. int str ;
  149. int agi ;
  150. int vit ;
  151. int int_ ;
  152. int dex ;
  153. int luk ;
  154. };
  155. struct s_friend {
  156. int account_id;
  157. int char_id;
  158. char name[NAME_LENGTH];
  159. };
  160. #ifdef HOTKEY_SAVING
  161. struct hotkey {
  162. unsigned int id;
  163. unsigned short lv;
  164. unsigned char type; // 0: item, 1: skill
  165. };
  166. #endif
  167. struct mmo_charstatus {
  168. int char_id;
  169. int account_id;
  170. int partner_id;
  171. int father;
  172. int mother;
  173. int child;
  174. unsigned int base_exp,job_exp;
  175. int zeny;
  176. short class_;
  177. unsigned short status_point,skill_point;
  178. int hp,max_hp,sp,max_sp;
  179. unsigned int option;
  180. short manner;
  181. unsigned char karma;
  182. short hair,hair_color,clothes_color;
  183. int party_id,guild_id,pet_id,hom_id;
  184. int fame;
  185. short weapon,shield;
  186. short head_top,head_mid,head_bottom;
  187. char name[NAME_LENGTH];
  188. unsigned int base_level,job_level;
  189. short str,agi,vit,int_,dex,luk;
  190. unsigned char char_num,sex;
  191. uint32 mapip;
  192. uint16 mapport;
  193. struct point last_point,save_point,memo_point[MAX_MEMOPOINTS];
  194. struct item inventory[MAX_INVENTORY],cart[MAX_CART];
  195. struct skill skill[MAX_SKILL];
  196. struct s_friend friends[MAX_FRIENDS]; //New friend system [Skotlex]
  197. #ifdef HOTKEY_SAVING
  198. struct hotkey hotkeys[HOTKEY_SAVING];
  199. #endif
  200. };
  201. struct registry {
  202. int global_num;
  203. struct global_reg global[GLOBAL_REG_NUM];
  204. int account_num;
  205. struct global_reg account[ACCOUNT_REG_NUM];
  206. int account2_num;
  207. struct global_reg account2[ACCOUNT_REG2_NUM];
  208. };
  209. struct storage {
  210. int dirty;
  211. int account_id;
  212. short storage_status;
  213. short storage_amount;
  214. struct item storage_[MAX_STORAGE];
  215. };
  216. struct guild_storage {
  217. int dirty;
  218. int guild_id;
  219. short storage_status;
  220. short storage_amount;
  221. struct item storage_[MAX_GUILD_STORAGE];
  222. };
  223. struct map_session_data;
  224. struct gm_account {
  225. int account_id;
  226. int level;
  227. };
  228. struct party_member {
  229. int account_id;
  230. int char_id;
  231. char name[NAME_LENGTH];
  232. unsigned short class_;
  233. unsigned short map;
  234. unsigned short lv;
  235. unsigned leader : 1,
  236. online : 1;
  237. };
  238. struct party {
  239. int party_id;
  240. char name[NAME_LENGTH];
  241. unsigned char count; //Count of online characters.
  242. unsigned exp : 1,
  243. item : 2; //&1: Party-Share (round-robin), &2: pickup style: shared.
  244. struct party_member member[MAX_PARTY];
  245. };
  246. struct guild_member {
  247. int account_id, char_id;
  248. short hair,hair_color,gender,class_,lv;
  249. unsigned int exp;
  250. int exp_payper;
  251. short online,position;
  252. int rsv1,rsv2;
  253. char name[NAME_LENGTH];
  254. struct map_session_data *sd;
  255. unsigned char modified;
  256. };
  257. struct guild_position {
  258. char name[NAME_LENGTH];
  259. int mode;
  260. int exp_mode;
  261. unsigned char modified;
  262. };
  263. struct guild_alliance {
  264. int opposition;
  265. int guild_id;
  266. char name[NAME_LENGTH];
  267. };
  268. struct guild_expulsion {
  269. char name[NAME_LENGTH];
  270. char mes[40];
  271. char acc[40];
  272. int account_id;
  273. int rsv1,rsv2,rsv3;
  274. };
  275. struct guild_skill {
  276. int id,lv;
  277. };
  278. struct guild {
  279. int guild_id;
  280. short guild_lv, connect_member, max_member, average_lv;
  281. unsigned int exp,next_exp;
  282. int skill_point;
  283. #ifdef TXT_ONLY
  284. //FIXME: Gotta remove this variable completely, but doing so screws up the format of the txt save file...
  285. int castle_id;
  286. #endif
  287. char name[NAME_LENGTH],master[NAME_LENGTH];
  288. struct guild_member member[MAX_GUILD];
  289. struct guild_position position[MAX_GUILDPOSITION];
  290. char mes1[60],mes2[120];
  291. int emblem_len,emblem_id;
  292. char emblem_data[2048];
  293. struct guild_alliance alliance[MAX_GUILDALLIANCE];
  294. struct guild_expulsion expulsion[MAX_GUILDEXPULSION];
  295. struct guild_skill skill[MAX_GUILDSKILL];
  296. #ifndef TXT_ONLY
  297. unsigned short save_flag;
  298. #endif
  299. };
  300. struct guild_castle {
  301. int castle_id;
  302. char map_name[MAP_NAME_LENGTH];
  303. char castle_name[NAME_LENGTH];
  304. char castle_event[NAME_LENGTH];
  305. int guild_id;
  306. int economy;
  307. int defense;
  308. int triggerE;
  309. int triggerD;
  310. int nextTime;
  311. int payTime;
  312. int createTime;
  313. int visibleC;
  314. struct {
  315. unsigned visible : 1;
  316. int hp;
  317. int id;
  318. } guardian[MAX_GUARDIANS]; //New simplified structure. [Skotlex]
  319. };
  320. struct square {
  321. int val1[5];
  322. int val2[5];
  323. };
  324. struct fame_list {
  325. int id;
  326. int fame;
  327. char name[NAME_LENGTH];
  328. };
  329. enum {
  330. GBI_EXP =1, // ギルドのEXP
  331. GBI_GUILDLV, // ギルドのLv
  332. GBI_SKILLPOINT, // ギルドのスキルポイント
  333. GBI_SKILLLV, // ギルドスキルLv
  334. };
  335. enum {
  336. GMI_POSITION =0, // メンバーの役職変更
  337. GMI_EXP,
  338. GMI_HAIR,
  339. GMI_HAIR_COLOR,
  340. GMI_GENDER,
  341. GMI_CLASS,
  342. GMI_LEVEL,
  343. };
  344. enum {
  345. GD_SKILLBASE=10000,
  346. GD_APPROVAL=10000,
  347. GD_KAFRACONTRACT=10001,
  348. GD_GUARDIANRESEARCH=10002,
  349. GD_GUARDUP=10003,
  350. GD_EXTENSION=10004,
  351. GD_GLORYGUILD=10005,
  352. GD_LEADERSHIP=10006,
  353. GD_GLORYWOUNDS=10007,
  354. GD_SOULCOLD=10008,
  355. GD_HAWKEYES=10009,
  356. GD_BATTLEORDER=10010,
  357. GD_REGENERATION=10011,
  358. GD_RESTORE=10012,
  359. GD_EMERGENCYCALL=10013,
  360. GD_DEVELOPMENT=10014,
  361. };
  362. //These mark the ID of the jobs, as expected by the client. [Skotlex]
  363. enum {
  364. JOB_NOVICE,
  365. JOB_SWORDMAN,
  366. JOB_MAGE,
  367. JOB_ARCHER,
  368. JOB_ACOLYTE,
  369. JOB_MERCHANT,
  370. JOB_THIEF,
  371. JOB_KNIGHT,
  372. JOB_PRIEST,
  373. JOB_WIZARD,
  374. JOB_BLACKSMITH,
  375. JOB_HUNTER,
  376. JOB_ASSASSIN,
  377. JOB_KNIGHT2,
  378. JOB_CRUSADER,
  379. JOB_MONK,
  380. JOB_SAGE,
  381. JOB_ROGUE,
  382. JOB_ALCHEMIST,
  383. JOB_BARD,
  384. JOB_DANCER,
  385. JOB_CRUSADER2,
  386. JOB_WEDDING,
  387. JOB_SUPER_NOVICE,
  388. JOB_GUNSLINGER,
  389. JOB_NINJA,
  390. JOB_XMAS,
  391. JOB_NOVICE_HIGH = 4001,
  392. JOB_SWORDMAN_HIGH,
  393. JOB_MAGE_HIGH,
  394. JOB_ARCHER_HIGH,
  395. JOB_ACOLYTE_HIGH,
  396. JOB_MERCHANT_HIGH,
  397. JOB_THIEF_HIGH,
  398. JOB_LORD_KNIGHT,
  399. JOB_HIGH_PRIEST,
  400. JOB_HIGH_WIZARD,
  401. JOB_WHITESMITH,
  402. JOB_SNIPER,
  403. JOB_ASSASSIN_CROSS,
  404. JOB_LORD_KNIGHT2,
  405. JOB_PALADIN,
  406. JOB_CHAMPION,
  407. JOB_PROFESSOR,
  408. JOB_STALKER,
  409. JOB_CREATOR,
  410. JOB_CLOWN,
  411. JOB_GYPSY,
  412. JOB_PALADIN2,
  413. JOB_BABY,
  414. JOB_BABY_SWORDMAN,
  415. JOB_BABY_MAGE,
  416. JOB_BABY_ARCHER,
  417. JOB_BABY_ACOLYTE,
  418. JOB_BABY_MERCHANT,
  419. JOB_BABY_THIEF,
  420. JOB_BABY_KNIGHT,
  421. JOB_BABY_PRIEST,
  422. JOB_BABY_WIZARD,
  423. JOB_BABY_BLACKSMITH,
  424. JOB_BABY_HUNTER,
  425. JOB_BABY_ASSASSIN,
  426. JOB_BABY_KNIGHT2,
  427. JOB_BABY_CRUSADER,
  428. JOB_BABY_MONK,
  429. JOB_BABY_SAGE,
  430. JOB_BABY_ROGUE,
  431. JOB_BABY_ALCHEMIST,
  432. JOB_BABY_BARD,
  433. JOB_BABY_DANCER,
  434. JOB_BABY_CRUSADER2,
  435. JOB_SUPER_BABY,
  436. JOB_TAEKWON,
  437. JOB_STAR_GLADIATOR,
  438. JOB_STAR_GLADIATOR2,
  439. JOB_SOUL_LINKER,
  440. };
  441. #endif /* _MMO_H_ */