mmo.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878
  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 "../config/core.h"
  7. #include "db.h"
  8. #include <time.h>
  9. // server->client protocol version
  10. // 0 - pre-?
  11. // 1 - ? - 0x196
  12. // 2 - ? - 0x78, 0x79
  13. // 3 - ? - 0x1c8, 0x1c9, 0x1de
  14. // 4 - ? - 0x1d7, 0x1d8, 0x1d9, 0x1da
  15. // 5 - 2003-12-18aSakexe+ - 0x1ee, 0x1ef, 0x1f0, ?0x1c4, 0x1c5?
  16. // 6 - 2004-03-02aSakexe+ - 0x1f4, 0x1f5
  17. // 7 - 2005-04-11aSakexe+ - 0x229, 0x22a, 0x22b, 0x22c
  18. // see conf/battle/client.conf for other version
  19. #ifndef PACKETVER
  20. #define PACKETVER 20130807
  21. //#define PACKETVER 20120410
  22. #endif
  23. // Check if the specified packetversion supports the pincode system
  24. #define PACKETVER_SUPPORTS_PINCODE PACKETVER>=20110309
  25. ///Remove/Comment this line to disable sc_data saving. [Skotlex]
  26. #define ENABLE_SC_SAVING
  27. /** Remove/Comment this line to disable server-side hot-key saving support [Skotlex]
  28. * Note that newer clients no longer save hotkeys in the registry! */
  29. #define HOTKEY_SAVING
  30. #if PACKETVER < 20090603
  31. // (27 = 9 skills x 3 bars) (0x02b9,191)
  32. #define MAX_HOTKEYS 27
  33. #elif PACKETVER < 20090617
  34. // (36 = 9 skills x 4 bars) (0x07d9,254)
  35. #define MAX_HOTKEYS 36
  36. #else
  37. // (38 = 9 skills x 4 bars & 2 Quickslots)(0x07d9,268)
  38. #define MAX_HOTKEYS 38
  39. #endif
  40. #define MAX_MAP_PER_SERVER 1500 /// Increased to allow creation of Instance Maps
  41. #define MAX_INVENTORY 100 ///Maximum items in player inventory
  42. /** 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.
  43. * Max value tested was 265 */
  44. #define MAX_CHARS 9
  45. /** 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]
  46. * Note: The client seems unable to receive data for more than 4 slots due to all related packets having a fixed size. */
  47. #define MAX_SLOTS 4
  48. #define MAX_AMOUNT 30000 ////Max amount of a single stacked item
  49. #define MAX_ZENY 1000000000 ///Max zeny
  50. #define MAX_BANK_ZENY SINT32_MAX ///Max zeny in Bank
  51. #define MAX_FAME 1000000000 ///Max fame points
  52. #define MAX_CART 100 ///Maximum item in cart
  53. #define MAX_SKILL 1200 ///Maximum skill can be hold by Player, Homunculus, & Mercenary (skill list) AND skill_db limit
  54. #define DEFAULT_WALK_SPEED 150 ///Default walk speed
  55. #define MIN_WALK_SPEED 20 ///Min walk speed
  56. #define MAX_WALK_SPEED 1000 ///Max walk speed
  57. #define MAX_STORAGE 600 ///Max number of storage slots a player can have
  58. #define MAX_GUILD_STORAGE 600 ///Max number of storage slots a guild
  59. #define MAX_PARTY 12 ///Max party member
  60. #define MAX_GUILD 16+10*6 ///Increased max guild members +6 per 1 extension levels [Lupus]
  61. #define MAX_GUILDPOSITION 20 ///Increased max guild positions to accomodate for all members [Valaris] (removed) [PoW]
  62. #define MAX_GUILDEXPULSION 32 ///Max Guild expulsion
  63. #define MAX_GUILDALLIANCE 16 ///Max Guild alliance
  64. #define MAX_GUILDSKILL 15 ///Increased max guild skills because of new skills [Sara-chan]
  65. #define MAX_GUILDLEVEL 50 ///Max Guild level
  66. #define MAX_GUARDIANS 8 ///Local max per castle. If this value is increased, need to add more fields on MySQL `guild_castle` table [Skotlex]
  67. #define MAX_QUEST_OBJECTIVES 3 ///Max quest objectives for a quest
  68. #define MAX_QUEST_DROPS 3 ///Max quest drops for a quest
  69. #define MAX_PC_BONUS_SCRIPT 50 ///Max bonus script can be fetched from `bonus_script` table on player load [Cydh]
  70. // for produce
  71. #define MIN_ATTRIBUTE 0
  72. #define MAX_ATTRIBUTE 4
  73. #define ATTRIBUTE_NORMAL 0
  74. #define MIN_STAR 0
  75. #define MAX_STAR 3
  76. #define MAX_STATUS_TYPE 5
  77. #define WEDDING_RING_M 2634
  78. #define WEDDING_RING_F 2635
  79. //For character names, title names, guilds, maps, etc.
  80. //Includes null-terminator as it is the length of the array.
  81. #define NAME_LENGTH (23 + 1)
  82. #define PASSWD_LENGTH (32+1)
  83. //For item names, which tend to have much longer names.
  84. #define ITEM_NAME_LENGTH 50
  85. //For Map Names, which the client considers to be 16 in length including the .gat extension
  86. #define MAP_NAME_LENGTH (11 + 1)
  87. #define MAP_NAME_LENGTH_EXT (MAP_NAME_LENGTH + 4)
  88. //Pincode Length
  89. #define PINCODE_LENGTH 4
  90. #define MAX_FRIENDS 40
  91. #define MAX_MEMOPOINTS 3
  92. #define MAX_SKILLCOOLDOWN 20
  93. //Size of the fame list arrays.
  94. #define MAX_FAME_LIST 10
  95. //Limits to avoid ID collision with other game objects
  96. #define START_ACCOUNT_NUM 2000000
  97. #define END_ACCOUNT_NUM 100000000
  98. #define START_CHAR_NUM 150000
  99. //Guilds
  100. #define MAX_GUILDMES1 60
  101. #define MAX_GUILDMES2 120
  102. //Base Homun skill.
  103. #define HM_SKILLBASE 8001
  104. #define MAX_HOMUNSKILL 43
  105. #define MAX_HOMUNCULUS_CLASS 52 //[orn], Increased to 60 from 16 to allow new Homun-S.
  106. #define HM_CLASS_BASE 6001
  107. #define HM_CLASS_MAX (HM_CLASS_BASE+MAX_HOMUNCULUS_CLASS-1)
  108. //Mail System
  109. #define MAIL_MAX_INBOX 30
  110. #define MAIL_TITLE_LENGTH 40
  111. #define MAIL_BODY_LENGTH 200
  112. //Mercenary System
  113. #define MC_SKILLBASE 8201
  114. #define MAX_MERCSKILL 40
  115. #define MAX_MERCENARY_CLASS 61
  116. //Elemental System
  117. #define MAX_ELEMENTALSKILL 42
  118. #define EL_SKILLBASE 8401
  119. #define MAX_ELESKILLTREE 3
  120. #define MAX_ELEMENTAL_CLASS 12
  121. #define EL_CLASS_BASE 2114
  122. #define EL_CLASS_MAX (EL_CLASS_BASE+MAX_ELEMENTAL_CLASS-1)
  123. enum item_types {
  124. IT_HEALING = 0,
  125. IT_UNKNOWN, //1
  126. IT_USABLE, //2
  127. IT_ETC, //3
  128. IT_ARMOR, //4
  129. IT_WEAPON, //5
  130. IT_CARD, //6
  131. IT_PETEGG, //7
  132. IT_PETARMOR,//8
  133. IT_UNKNOWN2,//9
  134. IT_AMMO, //10
  135. IT_DELAYCONSUME,//11
  136. IT_SHADOWGEAR, //12
  137. IT_CASH = 18,
  138. IT_MAX
  139. };
  140. // Questlog states
  141. enum quest_state {
  142. Q_INACTIVE, ///< Inactive quest (the user can toggle between active and inactive quests)
  143. Q_ACTIVE, ///< Active quest
  144. Q_COMPLETE, ///< Completed quest
  145. };
  146. /// Questlog entry
  147. struct quest {
  148. int quest_id; ///< Quest ID
  149. unsigned int time; ///< Expiration time
  150. int count[MAX_QUEST_OBJECTIVES]; ///< Kill counters of each quest objective
  151. enum quest_state state; ///< Current quest state
  152. };
  153. struct item {
  154. int id;
  155. unsigned short nameid;
  156. short amount;
  157. unsigned int equip; // location(s) where item is equipped (using enum equip_pos for bitmasking)
  158. char identify;
  159. char refine;
  160. char attribute;
  161. unsigned short card[MAX_SLOTS];
  162. unsigned int expire_time;
  163. char favorite, bound;
  164. uint64 unique_id;
  165. };
  166. //Equip position constants
  167. enum equip_pos {
  168. EQP_HEAD_LOW = 0x000001,
  169. EQP_HEAD_MID = 0x000200, // 512
  170. EQP_HEAD_TOP = 0x000100, // 256
  171. EQP_HAND_R = 0x000002, // 2
  172. EQP_HAND_L = 0x000020, // 32
  173. EQP_ARMOR = 0x000010, // 16
  174. EQP_SHOES = 0x000040, // 64
  175. EQP_GARMENT = 0x000004, // 4
  176. EQP_ACC_L = 0x000008, // 8
  177. EQP_ACC_R = 0x000080, // 128
  178. EQP_COSTUME_HEAD_TOP = 0x000400, // 1024
  179. EQP_COSTUME_HEAD_MID = 0x000800, // 2048
  180. EQP_COSTUME_HEAD_LOW = 0x001000, // 4096
  181. EQP_COSTUME_GARMENT = 0x002000, // 8192
  182. //EQP_COSTUME_FLOOR = 0x004000, // 16384
  183. EQP_AMMO = 0x008000, // 32768
  184. EQP_SHADOW_ARMOR = 0x010000, // 65536
  185. EQP_SHADOW_WEAPON = 0x020000, // 131072
  186. EQP_SHADOW_SHIELD = 0x040000, // 262144
  187. EQP_SHADOW_SHOES = 0x080000, // 524288
  188. EQP_SHADOW_ACC_R = 0x100000, // 1048576
  189. EQP_SHADOW_ACC_L = 0x200000, // 2097152
  190. };
  191. struct point {
  192. unsigned short map;
  193. short x,y;
  194. };
  195. struct startitem {
  196. unsigned short nameid, amount;
  197. short pos;
  198. };
  199. enum e_skill_flag
  200. {
  201. SKILL_FLAG_PERMANENT,
  202. SKILL_FLAG_TEMPORARY,
  203. SKILL_FLAG_PLAGIARIZED,
  204. SKILL_FLAG_PERM_GRANTED, // Permanent, granted through someway e.g. script
  205. SKILL_FLAG_TMP_COMBO, //@FIXME for homunculus combo atm
  206. //! NOTE: This flag be the last flag, and don't change the value if not needed!
  207. SKILL_FLAG_REPLACED_LV_0 = 10, // temporary skill overshadowing permanent skill of level 'N - SKILL_FLAG_REPLACED_LV_0',
  208. };
  209. enum e_mmo_charstatus_opt {
  210. OPT_NONE = 0x0,
  211. OPT_SHOW_EQUIP = 0x1,
  212. OPT_ALLOW_PARTY = 0x2,
  213. };
  214. struct s_skill {
  215. uint16 id;
  216. uint8 lv;
  217. uint8 flag; // see enum e_skill_flag
  218. };
  219. struct script_reg_state {
  220. 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.
  221. unsigned int update : 1; // whether it needs to be sent to char server for insertion/update/delete
  222. };
  223. struct script_reg_num {
  224. struct script_reg_state flag;
  225. int value;
  226. };
  227. struct script_reg_str {
  228. struct script_reg_state flag;
  229. char *value;
  230. };
  231. //For saving status changes across sessions. [Skotlex]
  232. struct status_change_data {
  233. unsigned short type; //SC_type
  234. long val1, val2, val3, val4, tick; //Remaining duration.
  235. };
  236. #define MAX_BONUS_SCRIPT_LENGTH 512
  237. struct bonus_script_data {
  238. char script_str[MAX_BONUS_SCRIPT_LENGTH]; //< Script string
  239. uint32 tick; ///< Tick
  240. uint16 flag; ///< Flags @see enum e_bonus_script_flags
  241. int16 icon; ///< Icon SI
  242. uint8 type; ///< 0 - None, 1 - Buff, 2 - Debuff
  243. };
  244. struct skill_cooldown_data {
  245. unsigned short skill_id;
  246. long tick;
  247. };
  248. enum storage_type {
  249. TABLE_INVENTORY,
  250. TABLE_CART,
  251. TABLE_STORAGE,
  252. TABLE_GUILD_STORAGE,
  253. };
  254. struct s_storage {
  255. bool dirty; ///< Dirty status, data needs to be saved
  256. bool status; ///< Current status of storage (opened or closed)
  257. int amount; ///< Amount of items in storage
  258. bool lock; ///< If locked, can't use storage when item bound retrieval
  259. uint32 id; ///< Account ID / Character ID / Guild ID (owner of storage)
  260. enum storage_type type; ///< Type of storage (inventory, cart, storage, guild storage)
  261. union { // Max for inventory, storage, cart, and guild storage are 1637 each without changing this struct and struct item [2014/10/27]
  262. struct item items_inventory[MAX_INVENTORY];
  263. struct item items_storage[MAX_STORAGE];
  264. struct item items_cart[MAX_CART];
  265. struct item items_guild[MAX_GUILD_STORAGE];
  266. } u;
  267. };
  268. struct s_pet {
  269. uint32 account_id;
  270. uint32 char_id;
  271. int pet_id;
  272. short class_;
  273. short level;
  274. short egg_id;//pet egg id
  275. short equip;//pet equip name_id
  276. short intimate;//pet friendly
  277. short hungry;//pet hungry
  278. char name[NAME_LENGTH];
  279. char rename_flag;
  280. char incubate;
  281. };
  282. struct s_homunculus { //[orn]
  283. char name[NAME_LENGTH];
  284. int hom_id;
  285. uint32 char_id;
  286. short class_;
  287. short prev_class;
  288. int hp,max_hp,sp,max_sp;
  289. unsigned int intimacy; //[orn]
  290. short hunger;
  291. struct s_skill hskill[MAX_HOMUNSKILL]; //albator
  292. short skillpts;
  293. short level;
  294. unsigned int exp;
  295. short rename_flag;
  296. short vaporize; //albator
  297. int str;
  298. int agi;
  299. int vit;
  300. int int_;
  301. int dex;
  302. int luk;
  303. int str_value;
  304. int agi_value;
  305. int vit_value;
  306. int int_value;
  307. int dex_value;
  308. int luk_value;
  309. char spiritball; //for homun S [lighta]
  310. };
  311. struct s_mercenary {
  312. int mercenary_id;
  313. uint32 char_id;
  314. short class_;
  315. int hp, sp;
  316. unsigned int kill_count;
  317. unsigned int life_time;
  318. };
  319. struct s_elemental {
  320. int elemental_id;
  321. uint32 char_id;
  322. short class_;
  323. int mode;
  324. int hp, sp, max_hp, max_sp, matk, atk, atk2;
  325. short hit, flee, amotion, def, mdef;
  326. int life_time;
  327. };
  328. struct s_friend {
  329. uint32 account_id;
  330. uint32 char_id;
  331. char name[NAME_LENGTH];
  332. };
  333. #ifdef HOTKEY_SAVING
  334. struct hotkey {
  335. unsigned int id;
  336. unsigned short lv;
  337. unsigned char type; // 0: item, 1: skill
  338. };
  339. #endif
  340. struct mmo_charstatus {
  341. uint32 char_id;
  342. uint32 account_id;
  343. uint32 partner_id;
  344. uint32 father;
  345. uint32 mother;
  346. uint32 child;
  347. unsigned int base_exp,job_exp;
  348. int zeny;
  349. short class_;
  350. unsigned int status_point,skill_point;
  351. int hp,max_hp,sp,max_sp;
  352. unsigned int option;
  353. short manner; // Defines how many minutes a char will be muted, each negative point is equivalent to a minute.
  354. unsigned char karma;
  355. short hair,hair_color,clothes_color,body;
  356. int party_id,guild_id,pet_id,hom_id,mer_id,ele_id;
  357. int fame;
  358. // Mercenary Guilds Rank
  359. int arch_faith, arch_calls;
  360. int spear_faith, spear_calls;
  361. int sword_faith, sword_calls;
  362. short weapon; // enum weapon_type
  363. short shield; // view-id
  364. short head_top,head_mid,head_bottom;
  365. short robe;
  366. char name[NAME_LENGTH];
  367. unsigned int base_level,job_level;
  368. unsigned short str,agi,vit,int_,dex,luk;
  369. unsigned char slot,sex;
  370. uint32 mapip;
  371. uint16 mapport;
  372. struct point last_point,save_point,memo_point[MAX_MEMOPOINTS];
  373. struct s_skill skill[MAX_SKILL];
  374. struct s_friend friends[MAX_FRIENDS]; //New friend system [Skotlex]
  375. #ifdef HOTKEY_SAVING
  376. struct hotkey hotkeys[MAX_HOTKEYS];
  377. #endif
  378. bool show_equip,allow_party;
  379. short rename;
  380. time_t delete_date;
  381. time_t unban_time;
  382. // Char server addon system
  383. unsigned int character_moves;
  384. unsigned char font;
  385. bool cashshop_sent; // Whether the player has received the CashShop list
  386. uint32 uniqueitem_counter;
  387. unsigned char hotkey_rowshift;
  388. };
  389. typedef enum mail_status {
  390. MAIL_NEW,
  391. MAIL_UNREAD,
  392. MAIL_READ,
  393. } mail_status;
  394. struct mail_message {
  395. int id;
  396. uint32 send_id; //hold char_id of sender
  397. char send_name[NAME_LENGTH]; //sender nickname
  398. uint32 dest_id; //hold char_id of receiver
  399. char dest_name[NAME_LENGTH]; //receiver nickname
  400. char title[MAIL_TITLE_LENGTH];
  401. char body[MAIL_BODY_LENGTH];
  402. mail_status status;
  403. time_t timestamp; // marks when the message was sent
  404. uint32 zeny;
  405. struct item item;
  406. };
  407. struct mail_data {
  408. short amount;
  409. bool full;
  410. short unchecked, unread;
  411. struct mail_message msg[MAIL_MAX_INBOX];
  412. };
  413. struct auction_data {
  414. unsigned int auction_id;
  415. int seller_id;
  416. char seller_name[NAME_LENGTH];
  417. int buyer_id;
  418. char buyer_name[NAME_LENGTH];
  419. struct item item;
  420. // This data is required for searching, as itemdb is not read by char server
  421. char item_name[ITEM_NAME_LENGTH];
  422. short type;
  423. unsigned short hours;
  424. int price, buynow;
  425. time_t timestamp; // auction's end time
  426. int auction_end_timer;
  427. };
  428. struct party_member {
  429. uint32 account_id;
  430. uint32 char_id;
  431. char name[NAME_LENGTH];
  432. unsigned short class_;
  433. unsigned short map;
  434. unsigned short lv;
  435. unsigned leader : 1,
  436. online : 1;
  437. };
  438. struct party {
  439. int party_id;
  440. char name[NAME_LENGTH];
  441. unsigned char count; //Count of online characters.
  442. unsigned exp : 1,
  443. item : 2; //&1: Party-Share (round-robin), &2: pickup style: shared.
  444. struct party_member member[MAX_PARTY];
  445. };
  446. struct map_session_data;
  447. struct guild_member {
  448. uint32 account_id, char_id;
  449. short hair,hair_color,gender,class_,lv;
  450. uint64 exp;
  451. int exp_payper;
  452. short online,position;
  453. char name[NAME_LENGTH];
  454. struct map_session_data *sd;
  455. unsigned char modified;
  456. };
  457. struct guild_position {
  458. char name[NAME_LENGTH];
  459. int mode;
  460. int exp_mode;
  461. unsigned char modified;
  462. };
  463. struct guild_alliance {
  464. int opposition;
  465. int guild_id;
  466. char name[NAME_LENGTH];
  467. };
  468. struct guild_expulsion {
  469. char name[NAME_LENGTH];
  470. char mes[40];
  471. uint32 account_id;
  472. };
  473. struct guild_skill {
  474. int id,lv;
  475. };
  476. struct Channel;
  477. struct guild {
  478. int guild_id;
  479. short guild_lv, connect_member, max_member, average_lv;
  480. uint64 exp;
  481. unsigned int next_exp;
  482. int skill_point;
  483. char name[NAME_LENGTH],master[NAME_LENGTH];
  484. struct guild_member member[MAX_GUILD];
  485. struct guild_position position[MAX_GUILDPOSITION];
  486. char mes1[MAX_GUILDMES1],mes2[MAX_GUILDMES2];
  487. int emblem_len,emblem_id;
  488. char emblem_data[2048];
  489. struct guild_alliance alliance[MAX_GUILDALLIANCE];
  490. struct guild_expulsion expulsion[MAX_GUILDEXPULSION];
  491. struct guild_skill skill[MAX_GUILDSKILL];
  492. struct Channel *channel;
  493. /* Used by char-server to save events for guilds */
  494. unsigned short save_flag;
  495. };
  496. struct guild_castle {
  497. int castle_id;
  498. int mapindex;
  499. char castle_name[NAME_LENGTH];
  500. char castle_event[NAME_LENGTH];
  501. int guild_id;
  502. int economy;
  503. int defense;
  504. int triggerE;
  505. int triggerD;
  506. int nextTime;
  507. int payTime;
  508. int createTime;
  509. int visibleC;
  510. struct {
  511. unsigned visible : 1;
  512. int id; // object id
  513. } guardian[MAX_GUARDIANS];
  514. int* temp_guardians; // ids of temporary guardians (mobs)
  515. int temp_guardians_max;
  516. };
  517. struct fame_list {
  518. int id;
  519. int fame;
  520. char name[NAME_LENGTH];
  521. };
  522. enum e_guild_info { //Change Guild Infos
  523. GBI_EXP =1, // Guild Experience (EXP)
  524. GBI_GUILDLV, // Guild level
  525. GBI_SKILLPOINT, // Guild skillpoints
  526. GBI_SKILLLV, // Guild skill_lv ?? seem unused
  527. };
  528. enum e_guild_member_info { //Change Member Infos
  529. GMI_POSITION =0,
  530. GMI_EXP,
  531. GMI_HAIR,
  532. GMI_HAIR_COLOR,
  533. GMI_GENDER,
  534. GMI_CLASS,
  535. GMI_LEVEL,
  536. };
  537. enum e_guild_skill {
  538. GD_SKILLBASE=10000,
  539. GD_APPROVAL=10000,
  540. GD_KAFRACONTRACT=10001,
  541. GD_GUARDRESEARCH=10002,
  542. GD_GUARDUP=10003,
  543. GD_EXTENSION=10004,
  544. GD_GLORYGUILD=10005,
  545. GD_LEADERSHIP=10006,
  546. GD_GLORYWOUNDS=10007,
  547. GD_SOULCOLD=10008,
  548. GD_HAWKEYES=10009,
  549. GD_BATTLEORDER=10010,
  550. GD_REGENERATION=10011,
  551. GD_RESTORE=10012,
  552. GD_EMERGENCYCALL=10013,
  553. GD_DEVELOPMENT=10014,
  554. GD_ITEMEMERGENCYCALL=10015,
  555. GD_MAX,
  556. };
  557. #define MAX_SKILL_ID GD_MAX
  558. //These mark the ID of the jobs, as expected by the client. [Skotlex]
  559. enum e_job {
  560. JOB_NOVICE,
  561. JOB_SWORDMAN,
  562. JOB_MAGE,
  563. JOB_ARCHER,
  564. JOB_ACOLYTE,
  565. JOB_MERCHANT,
  566. JOB_THIEF,
  567. JOB_KNIGHT,
  568. JOB_PRIEST,
  569. JOB_WIZARD,
  570. JOB_BLACKSMITH,
  571. JOB_HUNTER,
  572. JOB_ASSASSIN,
  573. JOB_KNIGHT2,
  574. JOB_CRUSADER,
  575. JOB_MONK,
  576. JOB_SAGE,
  577. JOB_ROGUE,
  578. JOB_ALCHEMIST,
  579. JOB_BARD,
  580. JOB_DANCER,
  581. JOB_CRUSADER2,
  582. JOB_WEDDING,
  583. JOB_SUPER_NOVICE,
  584. JOB_GUNSLINGER,
  585. JOB_NINJA,
  586. JOB_XMAS,
  587. JOB_SUMMER,
  588. JOB_HANBOK,
  589. JOB_OKTOBERFEST,
  590. JOB_MAX_BASIC,
  591. JOB_NOVICE_HIGH = 4001,
  592. JOB_SWORDMAN_HIGH,
  593. JOB_MAGE_HIGH,
  594. JOB_ARCHER_HIGH,
  595. JOB_ACOLYTE_HIGH,
  596. JOB_MERCHANT_HIGH,
  597. JOB_THIEF_HIGH,
  598. JOB_LORD_KNIGHT,
  599. JOB_HIGH_PRIEST,
  600. JOB_HIGH_WIZARD,
  601. JOB_WHITESMITH,
  602. JOB_SNIPER,
  603. JOB_ASSASSIN_CROSS,
  604. JOB_LORD_KNIGHT2,
  605. JOB_PALADIN,
  606. JOB_CHAMPION,
  607. JOB_PROFESSOR,
  608. JOB_STALKER,
  609. JOB_CREATOR,
  610. JOB_CLOWN,
  611. JOB_GYPSY,
  612. JOB_PALADIN2,
  613. JOB_BABY,
  614. JOB_BABY_SWORDMAN,
  615. JOB_BABY_MAGE,
  616. JOB_BABY_ARCHER,
  617. JOB_BABY_ACOLYTE,
  618. JOB_BABY_MERCHANT,
  619. JOB_BABY_THIEF,
  620. JOB_BABY_KNIGHT,
  621. JOB_BABY_PRIEST,
  622. JOB_BABY_WIZARD,
  623. JOB_BABY_BLACKSMITH,
  624. JOB_BABY_HUNTER,
  625. JOB_BABY_ASSASSIN,
  626. JOB_BABY_KNIGHT2,
  627. JOB_BABY_CRUSADER,
  628. JOB_BABY_MONK,
  629. JOB_BABY_SAGE,
  630. JOB_BABY_ROGUE,
  631. JOB_BABY_ALCHEMIST,
  632. JOB_BABY_BARD,
  633. JOB_BABY_DANCER,
  634. JOB_BABY_CRUSADER2,
  635. JOB_SUPER_BABY,
  636. JOB_TAEKWON,
  637. JOB_STAR_GLADIATOR,
  638. JOB_STAR_GLADIATOR2,
  639. JOB_SOUL_LINKER,
  640. JOB_GANGSI,
  641. JOB_DEATH_KNIGHT,
  642. JOB_DARK_COLLECTOR,
  643. JOB_RUNE_KNIGHT = 4054,
  644. JOB_WARLOCK,
  645. JOB_RANGER,
  646. JOB_ARCH_BISHOP,
  647. JOB_MECHANIC,
  648. JOB_GUILLOTINE_CROSS,
  649. JOB_RUNE_KNIGHT_T,
  650. JOB_WARLOCK_T,
  651. JOB_RANGER_T,
  652. JOB_ARCH_BISHOP_T,
  653. JOB_MECHANIC_T,
  654. JOB_GUILLOTINE_CROSS_T,
  655. JOB_ROYAL_GUARD,
  656. JOB_SORCERER,
  657. JOB_MINSTREL,
  658. JOB_WANDERER,
  659. JOB_SURA,
  660. JOB_GENETIC,
  661. JOB_SHADOW_CHASER,
  662. JOB_ROYAL_GUARD_T,
  663. JOB_SORCERER_T,
  664. JOB_MINSTREL_T,
  665. JOB_WANDERER_T,
  666. JOB_SURA_T,
  667. JOB_GENETIC_T,
  668. JOB_SHADOW_CHASER_T,
  669. JOB_RUNE_KNIGHT2,
  670. JOB_RUNE_KNIGHT_T2,
  671. JOB_ROYAL_GUARD2,
  672. JOB_ROYAL_GUARD_T2,
  673. JOB_RANGER2,
  674. JOB_RANGER_T2,
  675. JOB_MECHANIC2,
  676. JOB_MECHANIC_T2,
  677. JOB_BABY_RUNE = 4096,
  678. JOB_BABY_WARLOCK,
  679. JOB_BABY_RANGER,
  680. JOB_BABY_BISHOP,
  681. JOB_BABY_MECHANIC,
  682. JOB_BABY_CROSS,
  683. JOB_BABY_GUARD,
  684. JOB_BABY_SORCERER,
  685. JOB_BABY_MINSTREL,
  686. JOB_BABY_WANDERER,
  687. JOB_BABY_SURA,
  688. JOB_BABY_GENETIC,
  689. JOB_BABY_CHASER,
  690. JOB_BABY_RUNE2,
  691. JOB_BABY_GUARD2,
  692. JOB_BABY_RANGER2,
  693. JOB_BABY_MECHANIC2,
  694. JOB_SUPER_NOVICE_E = 4190,
  695. JOB_SUPER_BABY_E,
  696. JOB_KAGEROU = 4211,
  697. JOB_OBORO,
  698. JOB_REBELLION = 4215,
  699. JOB_SUMMONER = 4218,
  700. JOB_MAX,
  701. };
  702. enum e_sex {
  703. SEX_FEMALE = 0,
  704. SEX_MALE,
  705. SEX_SERVER
  706. };
  707. /// Item Bound Type
  708. enum bound_type {
  709. BOUND_NONE = 0, /// No bound
  710. BOUND_ACCOUNT, /// 1- Account Bound
  711. BOUND_GUILD, /// 2 - Guild Bound
  712. BOUND_PARTY, /// 3 - Party Bound
  713. BOUND_CHAR, /// 4 - Character Bound
  714. BOUND_MAX,
  715. BOUND_ONEQUIP = 1, ///< Show notification when item will be bound on equip
  716. BOUND_DISPYELLOW = 2, /// Shows the item name in yellow color
  717. };
  718. enum e_pc_reg_loading {
  719. PRL_NONE = 0x0,
  720. PRL_CHAR = 0x1,
  721. PRL_ACCL = 0x2, // local
  722. PRL_ACCG = 0x4, // global
  723. PRL_ALL = 0xFF,
  724. };
  725. // Sanity checks...
  726. #if MAX_ZENY > INT_MAX
  727. #error MAX_ZENY is too big
  728. #endif
  729. // This sanity check is required, because some other places(like skill.c) rely on this
  730. #if MAX_PARTY < 2
  731. #error MAX_PARTY is too small, you need at least 2 players for a party
  732. #endif
  733. #ifndef VIP_ENABLE
  734. #define MIN_STORAGE MAX_STORAGE // If the VIP system is disabled the min = max.
  735. #define MIN_CHARS MAX_CHARS // Default number of characters per account.
  736. #define MAX_CHAR_BILLING 0
  737. #define MAX_CHAR_VIP 0
  738. #endif
  739. #if (MIN_CHARS + MAX_CHAR_VIP + MAX_CHAR_BILLING) > MAX_CHARS
  740. #error Config of MAX_CHARS is invalid
  741. #endif
  742. #if MIN_STORAGE > MAX_STORAGE
  743. #error Config of MIN_STORAGE is invalid
  744. #endif
  745. #ifdef PACKET_OBFUSCATION
  746. #if PACKETVER < 20110817
  747. #undef PACKET_OBFUSCATION
  748. #endif
  749. #endif
  750. /* Feb 1st 2012 */
  751. #if PACKETVER >= 20120201
  752. #define NEW_CARTS
  753. #ifndef ENABLE_SC_SAVING
  754. #warning "Cart won't be able to be saved for relog"
  755. #endif
  756. #if PACKETVER >= 20150826
  757. #define MAX_CARTS 12 // used for 3 new cart design
  758. #else
  759. #define MAX_CARTS 9
  760. #endif
  761. #else
  762. #define MAX_CARTS 5
  763. #endif
  764. #endif /* _MMO_H_ */