mmo.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857
  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, (up to ~850 tested)
  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. enum e_skill_flag
  196. {
  197. SKILL_FLAG_PERMANENT,
  198. SKILL_FLAG_TEMPORARY,
  199. SKILL_FLAG_PLAGIARIZED,
  200. SKILL_FLAG_PERM_GRANTED, // Permanent, granted through someway e.g. script
  201. SKILL_FLAG_TMP_COMBO, //@FIXME for homunculus combo atm
  202. //! NOTE: This flag be the last flag, and don't change the value if not needed!
  203. SKILL_FLAG_REPLACED_LV_0 = 10, // temporary skill overshadowing permanent skill of level 'N - SKILL_FLAG_REPLACED_LV_0',
  204. };
  205. enum e_mmo_charstatus_opt {
  206. OPT_NONE = 0x0,
  207. OPT_SHOW_EQUIP = 0x1,
  208. OPT_ALLOW_PARTY = 0x2,
  209. };
  210. struct s_skill {
  211. uint16 id;
  212. uint8 lv;
  213. uint8 flag; // see enum e_skill_flag
  214. };
  215. struct script_reg_state {
  216. 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.
  217. unsigned int update : 1; // whether it needs to be sent to char server for insertion/update/delete
  218. };
  219. struct script_reg_num {
  220. struct script_reg_state flag;
  221. int value;
  222. };
  223. struct script_reg_str {
  224. struct script_reg_state flag;
  225. char *value;
  226. };
  227. //For saving status changes across sessions. [Skotlex]
  228. struct status_change_data {
  229. unsigned short type; //SC_type
  230. long val1, val2, val3, val4, tick; //Remaining duration.
  231. };
  232. #define MAX_BONUS_SCRIPT_LENGTH 512
  233. struct bonus_script_data {
  234. char script_str[MAX_BONUS_SCRIPT_LENGTH]; //< Script string
  235. uint32 tick; ///< Tick
  236. uint16 flag; ///< Flags @see enum e_bonus_script_flags
  237. int16 icon; ///< Icon SI
  238. uint8 type; ///< 0 - None, 1 - Buff, 2 - Debuff
  239. };
  240. struct skill_cooldown_data {
  241. unsigned short skill_id;
  242. long tick;
  243. };
  244. struct storage_data {
  245. int storage_amount;
  246. struct item items[MAX_STORAGE];
  247. };
  248. /// Guild storgae struct
  249. struct guild_storage {
  250. bool dirty; ///< Dirty status, need to be saved
  251. int guild_id; ///< Guild ID
  252. short storage_amount; ///< Amount of item on storage
  253. struct item items[MAX_GUILD_STORAGE]; ///< Item entries
  254. bool locked; ///< If locked, can't use storage when item bound retrieval
  255. uint32 opened; ///< Holds the char_id that open the storage
  256. };
  257. struct s_pet {
  258. uint32 account_id;
  259. uint32 char_id;
  260. int pet_id;
  261. short class_;
  262. short level;
  263. short egg_id;//pet egg id
  264. short equip;//pet equip name_id
  265. short intimate;//pet friendly
  266. short hungry;//pet hungry
  267. char name[NAME_LENGTH];
  268. char rename_flag;
  269. char incubate;
  270. };
  271. struct s_homunculus { //[orn]
  272. char name[NAME_LENGTH];
  273. int hom_id;
  274. uint32 char_id;
  275. short class_;
  276. short prev_class;
  277. int hp,max_hp,sp,max_sp;
  278. unsigned int intimacy; //[orn]
  279. short hunger;
  280. struct s_skill hskill[MAX_HOMUNSKILL]; //albator
  281. short skillpts;
  282. short level;
  283. unsigned int exp;
  284. short rename_flag;
  285. short vaporize; //albator
  286. int str;
  287. int agi;
  288. int vit;
  289. int int_;
  290. int dex;
  291. int luk;
  292. int str_value;
  293. int agi_value;
  294. int vit_value;
  295. int int_value;
  296. int dex_value;
  297. int luk_value;
  298. char spiritball; //for homun S [lighta]
  299. };
  300. struct s_mercenary {
  301. int mercenary_id;
  302. uint32 char_id;
  303. short class_;
  304. int hp, sp;
  305. unsigned int kill_count;
  306. unsigned int life_time;
  307. };
  308. struct s_elemental {
  309. int elemental_id;
  310. uint32 char_id;
  311. short class_;
  312. int mode;
  313. int hp, sp, max_hp, max_sp, matk, atk, atk2;
  314. short hit, flee, amotion, def, mdef;
  315. int life_time;
  316. };
  317. struct s_friend {
  318. uint32 account_id;
  319. uint32 char_id;
  320. char name[NAME_LENGTH];
  321. };
  322. #ifdef HOTKEY_SAVING
  323. struct hotkey {
  324. unsigned int id;
  325. unsigned short lv;
  326. unsigned char type; // 0: item, 1: skill
  327. };
  328. #endif
  329. struct mmo_charstatus {
  330. uint32 char_id;
  331. uint32 account_id;
  332. uint32 partner_id;
  333. int father;
  334. int mother;
  335. int child;
  336. unsigned int base_exp,job_exp;
  337. int zeny;
  338. short class_;
  339. unsigned int status_point,skill_point;
  340. int hp,max_hp,sp,max_sp;
  341. unsigned int option;
  342. short manner; // Defines how many minutes a char will be muted, each negative point is equivalent to a minute.
  343. unsigned char karma;
  344. short hair,hair_color,clothes_color;
  345. int party_id,guild_id,pet_id,hom_id,mer_id,ele_id;
  346. int fame;
  347. // Mercenary Guilds Rank
  348. int arch_faith, arch_calls;
  349. int spear_faith, spear_calls;
  350. int sword_faith, sword_calls;
  351. short weapon; // enum weapon_type
  352. short shield; // view-id
  353. short head_top,head_mid,head_bottom;
  354. short robe;
  355. char name[NAME_LENGTH];
  356. unsigned int base_level,job_level;
  357. unsigned short str,agi,vit,int_,dex,luk;
  358. unsigned char slot,sex;
  359. uint32 mapip;
  360. uint16 mapport;
  361. struct point last_point,save_point,memo_point[MAX_MEMOPOINTS];
  362. struct item inventory[MAX_INVENTORY],cart[MAX_CART];
  363. struct storage_data storage;
  364. struct s_skill skill[MAX_SKILL];
  365. struct s_friend friends[MAX_FRIENDS]; //New friend system [Skotlex]
  366. #ifdef HOTKEY_SAVING
  367. struct hotkey hotkeys[MAX_HOTKEYS];
  368. #endif
  369. bool show_equip,allow_party;
  370. short rename;
  371. time_t delete_date;
  372. time_t unban_time;
  373. // Char server addon system
  374. unsigned int character_moves;
  375. unsigned char font;
  376. bool cashshop_sent; // Whether the player has received the CashShop list
  377. uint32 uniqueitem_counter;
  378. unsigned char hotkey_rowshift;
  379. };
  380. typedef enum mail_status {
  381. MAIL_NEW,
  382. MAIL_UNREAD,
  383. MAIL_READ,
  384. } mail_status;
  385. struct mail_message {
  386. int id;
  387. int send_id;
  388. char send_name[NAME_LENGTH];
  389. int dest_id;
  390. char dest_name[NAME_LENGTH];
  391. char title[MAIL_TITLE_LENGTH];
  392. char body[MAIL_BODY_LENGTH];
  393. mail_status status;
  394. time_t timestamp; // marks when the message was sent
  395. int zeny;
  396. struct item item;
  397. };
  398. struct mail_data {
  399. short amount;
  400. bool full;
  401. short unchecked, unread;
  402. struct mail_message msg[MAIL_MAX_INBOX];
  403. };
  404. struct auction_data {
  405. unsigned int auction_id;
  406. int seller_id;
  407. char seller_name[NAME_LENGTH];
  408. int buyer_id;
  409. char buyer_name[NAME_LENGTH];
  410. struct item item;
  411. // This data is required for searching, as itemdb is not read by char server
  412. char item_name[ITEM_NAME_LENGTH];
  413. short type;
  414. unsigned short hours;
  415. int price, buynow;
  416. time_t timestamp; // auction's end time
  417. int auction_end_timer;
  418. };
  419. struct party_member {
  420. uint32 account_id;
  421. uint32 char_id;
  422. char name[NAME_LENGTH];
  423. unsigned short class_;
  424. unsigned short map;
  425. unsigned short lv;
  426. unsigned leader : 1,
  427. online : 1;
  428. };
  429. struct party {
  430. int party_id;
  431. char name[NAME_LENGTH];
  432. unsigned char count; //Count of online characters.
  433. unsigned exp : 1,
  434. item : 2; //&1: Party-Share (round-robin), &2: pickup style: shared.
  435. struct party_member member[MAX_PARTY];
  436. };
  437. struct map_session_data;
  438. struct guild_member {
  439. uint32 account_id, char_id;
  440. short hair,hair_color,gender,class_,lv;
  441. uint64 exp;
  442. int exp_payper;
  443. short online,position;
  444. char name[NAME_LENGTH];
  445. struct map_session_data *sd;
  446. unsigned char modified;
  447. };
  448. struct guild_position {
  449. char name[NAME_LENGTH];
  450. int mode;
  451. int exp_mode;
  452. unsigned char modified;
  453. };
  454. struct guild_alliance {
  455. int opposition;
  456. int guild_id;
  457. char name[NAME_LENGTH];
  458. };
  459. struct guild_expulsion {
  460. char name[NAME_LENGTH];
  461. char mes[40];
  462. uint32 account_id;
  463. };
  464. struct guild_skill {
  465. int id,lv;
  466. };
  467. struct Channel;
  468. struct guild {
  469. int guild_id;
  470. short guild_lv, connect_member, max_member, average_lv;
  471. uint64 exp;
  472. unsigned int next_exp;
  473. int skill_point;
  474. char name[NAME_LENGTH],master[NAME_LENGTH];
  475. struct guild_member member[MAX_GUILD];
  476. struct guild_position position[MAX_GUILDPOSITION];
  477. char mes1[MAX_GUILDMES1],mes2[MAX_GUILDMES2];
  478. int emblem_len,emblem_id;
  479. char emblem_data[2048];
  480. struct guild_alliance alliance[MAX_GUILDALLIANCE];
  481. struct guild_expulsion expulsion[MAX_GUILDEXPULSION];
  482. struct guild_skill skill[MAX_GUILDSKILL];
  483. struct Channel *channel;
  484. /* Used by char-server to save events for guilds */
  485. unsigned short save_flag;
  486. };
  487. struct guild_castle {
  488. int castle_id;
  489. int mapindex;
  490. char castle_name[NAME_LENGTH];
  491. char castle_event[NAME_LENGTH];
  492. int guild_id;
  493. int economy;
  494. int defense;
  495. int triggerE;
  496. int triggerD;
  497. int nextTime;
  498. int payTime;
  499. int createTime;
  500. int visibleC;
  501. struct {
  502. unsigned visible : 1;
  503. int id; // object id
  504. } guardian[MAX_GUARDIANS];
  505. int* temp_guardians; // ids of temporary guardians (mobs)
  506. int temp_guardians_max;
  507. };
  508. struct fame_list {
  509. int id;
  510. int fame;
  511. char name[NAME_LENGTH];
  512. };
  513. enum e_guild_info { //Change Guild Infos
  514. GBI_EXP =1, // Guild Experience (EXP)
  515. GBI_GUILDLV, // Guild level
  516. GBI_SKILLPOINT, // Guild skillpoints
  517. GBI_SKILLLV, // Guild skill_lv ?? seem unused
  518. };
  519. enum e_guild_member_info { //Change Member Infos
  520. GMI_POSITION =0,
  521. GMI_EXP,
  522. GMI_HAIR,
  523. GMI_HAIR_COLOR,
  524. GMI_GENDER,
  525. GMI_CLASS,
  526. GMI_LEVEL,
  527. };
  528. enum e_guild_skill {
  529. GD_SKILLBASE=10000,
  530. GD_APPROVAL=10000,
  531. GD_KAFRACONTRACT=10001,
  532. GD_GUARDRESEARCH=10002,
  533. GD_GUARDUP=10003,
  534. GD_EXTENSION=10004,
  535. GD_GLORYGUILD=10005,
  536. GD_LEADERSHIP=10006,
  537. GD_GLORYWOUNDS=10007,
  538. GD_SOULCOLD=10008,
  539. GD_HAWKEYES=10009,
  540. GD_BATTLEORDER=10010,
  541. GD_REGENERATION=10011,
  542. GD_RESTORE=10012,
  543. GD_EMERGENCYCALL=10013,
  544. GD_DEVELOPMENT=10014,
  545. GD_ITEMEMERGENCYCALL=10015,
  546. GD_MAX,
  547. };
  548. #define MAX_SKILL_ID GD_MAX
  549. //These mark the ID of the jobs, as expected by the client. [Skotlex]
  550. enum e_job {
  551. JOB_NOVICE,
  552. JOB_SWORDMAN,
  553. JOB_MAGE,
  554. JOB_ARCHER,
  555. JOB_ACOLYTE,
  556. JOB_MERCHANT,
  557. JOB_THIEF,
  558. JOB_KNIGHT,
  559. JOB_PRIEST,
  560. JOB_WIZARD,
  561. JOB_BLACKSMITH,
  562. JOB_HUNTER,
  563. JOB_ASSASSIN,
  564. JOB_KNIGHT2,
  565. JOB_CRUSADER,
  566. JOB_MONK,
  567. JOB_SAGE,
  568. JOB_ROGUE,
  569. JOB_ALCHEMIST,
  570. JOB_BARD,
  571. JOB_DANCER,
  572. JOB_CRUSADER2,
  573. JOB_WEDDING,
  574. JOB_SUPER_NOVICE,
  575. JOB_GUNSLINGER,
  576. JOB_NINJA,
  577. JOB_XMAS,
  578. JOB_SUMMER,
  579. JOB_HANBOK,
  580. JOB_OKTOBERFEST,
  581. JOB_MAX_BASIC,
  582. JOB_NOVICE_HIGH = 4001,
  583. JOB_SWORDMAN_HIGH,
  584. JOB_MAGE_HIGH,
  585. JOB_ARCHER_HIGH,
  586. JOB_ACOLYTE_HIGH,
  587. JOB_MERCHANT_HIGH,
  588. JOB_THIEF_HIGH,
  589. JOB_LORD_KNIGHT,
  590. JOB_HIGH_PRIEST,
  591. JOB_HIGH_WIZARD,
  592. JOB_WHITESMITH,
  593. JOB_SNIPER,
  594. JOB_ASSASSIN_CROSS,
  595. JOB_LORD_KNIGHT2,
  596. JOB_PALADIN,
  597. JOB_CHAMPION,
  598. JOB_PROFESSOR,
  599. JOB_STALKER,
  600. JOB_CREATOR,
  601. JOB_CLOWN,
  602. JOB_GYPSY,
  603. JOB_PALADIN2,
  604. JOB_BABY,
  605. JOB_BABY_SWORDMAN,
  606. JOB_BABY_MAGE,
  607. JOB_BABY_ARCHER,
  608. JOB_BABY_ACOLYTE,
  609. JOB_BABY_MERCHANT,
  610. JOB_BABY_THIEF,
  611. JOB_BABY_KNIGHT,
  612. JOB_BABY_PRIEST,
  613. JOB_BABY_WIZARD,
  614. JOB_BABY_BLACKSMITH,
  615. JOB_BABY_HUNTER,
  616. JOB_BABY_ASSASSIN,
  617. JOB_BABY_KNIGHT2,
  618. JOB_BABY_CRUSADER,
  619. JOB_BABY_MONK,
  620. JOB_BABY_SAGE,
  621. JOB_BABY_ROGUE,
  622. JOB_BABY_ALCHEMIST,
  623. JOB_BABY_BARD,
  624. JOB_BABY_DANCER,
  625. JOB_BABY_CRUSADER2,
  626. JOB_SUPER_BABY,
  627. JOB_TAEKWON,
  628. JOB_STAR_GLADIATOR,
  629. JOB_STAR_GLADIATOR2,
  630. JOB_SOUL_LINKER,
  631. JOB_GANGSI,
  632. JOB_DEATH_KNIGHT,
  633. JOB_DARK_COLLECTOR,
  634. JOB_RUNE_KNIGHT = 4054,
  635. JOB_WARLOCK,
  636. JOB_RANGER,
  637. JOB_ARCH_BISHOP,
  638. JOB_MECHANIC,
  639. JOB_GUILLOTINE_CROSS,
  640. JOB_RUNE_KNIGHT_T,
  641. JOB_WARLOCK_T,
  642. JOB_RANGER_T,
  643. JOB_ARCH_BISHOP_T,
  644. JOB_MECHANIC_T,
  645. JOB_GUILLOTINE_CROSS_T,
  646. JOB_ROYAL_GUARD,
  647. JOB_SORCERER,
  648. JOB_MINSTREL,
  649. JOB_WANDERER,
  650. JOB_SURA,
  651. JOB_GENETIC,
  652. JOB_SHADOW_CHASER,
  653. JOB_ROYAL_GUARD_T,
  654. JOB_SORCERER_T,
  655. JOB_MINSTREL_T,
  656. JOB_WANDERER_T,
  657. JOB_SURA_T,
  658. JOB_GENETIC_T,
  659. JOB_SHADOW_CHASER_T,
  660. JOB_RUNE_KNIGHT2,
  661. JOB_RUNE_KNIGHT_T2,
  662. JOB_ROYAL_GUARD2,
  663. JOB_ROYAL_GUARD_T2,
  664. JOB_RANGER2,
  665. JOB_RANGER_T2,
  666. JOB_MECHANIC2,
  667. JOB_MECHANIC_T2,
  668. JOB_BABY_RUNE = 4096,
  669. JOB_BABY_WARLOCK,
  670. JOB_BABY_RANGER,
  671. JOB_BABY_BISHOP,
  672. JOB_BABY_MECHANIC,
  673. JOB_BABY_CROSS,
  674. JOB_BABY_GUARD,
  675. JOB_BABY_SORCERER,
  676. JOB_BABY_MINSTREL,
  677. JOB_BABY_WANDERER,
  678. JOB_BABY_SURA,
  679. JOB_BABY_GENETIC,
  680. JOB_BABY_CHASER,
  681. JOB_BABY_RUNE2,
  682. JOB_BABY_GUARD2,
  683. JOB_BABY_RANGER2,
  684. JOB_BABY_MECHANIC2,
  685. JOB_SUPER_NOVICE_E = 4190,
  686. JOB_SUPER_BABY_E,
  687. JOB_KAGEROU = 4211,
  688. JOB_OBORO,
  689. JOB_REBELLION = 4215,
  690. JOB_MAX,
  691. };
  692. enum e_sex {
  693. SEX_FEMALE = 0,
  694. SEX_MALE,
  695. SEX_SERVER
  696. };
  697. /// Item Bound Type
  698. enum bound_type {
  699. BOUND_NONE = 0, /// No bound
  700. BOUND_ACCOUNT, /// 1- Account Bound
  701. BOUND_GUILD, /// 2 - Guild Bound
  702. BOUND_PARTY, /// 3 - Party Bound
  703. BOUND_CHAR, /// 4 - Character Bound
  704. BOUND_MAX,
  705. BOUND_ONEQUIP = 1, ///< Show notification when item will be bound on equip
  706. BOUND_DISPYELLOW = 2, /// Shows the item name in yellow color
  707. };
  708. enum e_pc_reg_loading {
  709. PRL_NONE = 0x0,
  710. PRL_CHAR = 0x1,
  711. PRL_ACCL = 0x2, // local
  712. PRL_ACCG = 0x4, // global
  713. PRL_ALL = 0xFF,
  714. };
  715. // Sanity checks...
  716. #if MAX_ZENY > INT_MAX
  717. #error MAX_ZENY is too big
  718. #endif
  719. #ifndef VIP_ENABLE
  720. #define MIN_STORAGE MAX_STORAGE // If the VIP system is disabled the min = max.
  721. #define MIN_CHARS MAX_CHARS // Default number of characters per account.
  722. #define MAX_CHAR_BILLING 0
  723. #define MAX_CHAR_VIP 0
  724. #endif
  725. #if (MIN_CHARS + MAX_CHAR_VIP + MAX_CHAR_BILLING) > MAX_CHARS
  726. #error Config of MAX_CHARS is invalid
  727. #endif
  728. #if MIN_STORAGE > MAX_STORAGE
  729. #error Config of MIN_STORAGE is invalid
  730. #endif
  731. #ifdef PACKET_OBFUSCATION
  732. #if PACKETVER < 20110817
  733. #undef PACKET_OBFUSCATION
  734. #endif
  735. #endif
  736. /* Feb 1st 2012 */
  737. #if PACKETVER >= 20120201
  738. #define NEW_CARTS
  739. #ifndef ENABLE_SC_SAVING
  740. #warning "Cart won't be able to be saved for relog"
  741. #endif
  742. #define MAX_CARTS 9
  743. #else
  744. #define MAX_CARTS 5
  745. #endif
  746. #endif /* _MMO_H_ */