Guest User

mmo requested

a guest
Aug 23rd, 2014
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.11 KB | None | 0 0
  1. // Copyright (c) Hercules Dev Team, licensed under GNU GPL.
  2. // See the LICENSE file
  3. // Portions Copyright (c) Athena Dev Teams
  4.  
  5. #ifndef _COMMON_MMO_H_
  6. #define _COMMON_MMO_H_
  7.  
  8. #include "cbasetypes.h"
  9. #include "../common/db.h"
  10. #include <time.h>
  11.  
  12. // server->client protocol version
  13. // 0 - pre-?
  14. // 1 - ? - 0x196
  15. // 2 - ? - 0x78, 0x79
  16. // 3 - ? - 0x1c8, 0x1c9, 0x1de
  17. // 4 - ? - 0x1d7, 0x1d8, 0x1d9, 0x1da
  18. // 5 - 2003-12-18aSakexe+ - 0x1ee, 0x1ef, 0x1f0, ?0x1c4, 0x1c5?
  19. // 6 - 2004-03-02aSakexe+ - 0x1f4, 0x1f5
  20. // 7 - 2005-04-11aSakexe+ - 0x229, 0x22a, 0x22b, 0x22c
  21. // 20061023 - 2006-10-23aSakexe+ - 0x6b, 0x6d
  22. // 20070521 - 2007-05-21aSakexe+ - 0x283
  23. // 20070821 - 2007-08-21aSakexe+ - 0x2c5
  24. // 20070918 - 2007-09-18aSakexe+ - 0x2d7, 0x2d9, 0x2da
  25. // 20071106 - 2007-11-06aSakexe+ - 0x78, 0x7c, 0x22c
  26. // 20080102 - 2008-01-02aSakexe+ - 0x2ec, 0x2ed , 0x2ee
  27. // 20081126 - 2008-11-26aSakexe+ - 0x1a2
  28. // 20090408 - 2009-04-08aSakexe+ - 0x44a (dont use as it overlaps with RE client packets)
  29. // 20080827 - 2008-08-27aRagexeRE+ - First RE Client
  30. // 20081217 - 2008-12-17aRagexeRE+ - 0x6d (Note: This one still use old Char Info Packet Structure)
  31. // 20081218 - 2008-12-17bRagexeRE+ - 0x6d (Note: From this one client use new Char Info Packet Structure)
  32. // 20090603 - 2009-06-03aRagexeRE+ - 0x7d7, 0x7d8, 0x7d9, 0x7da
  33. // 20090617 - 2009-06-17aRagexeRE+ - 0x7d9
  34. // 20090922 - 2009-09-22aRagexeRE+ - 0x7e5, 0x7e7, 0x7e8, 0x7e9
  35. // 20091103 - 2009-11-03aRagexeRE+ - 0x7f7, 0x7f8, 0x7f9
  36. // 20100105 - 2010-01-05aRagexeRE+ - 0x133, 0x800, 0x801
  37. // 20100126 - 2010-01-26aRagexeRE+ - 0x80e
  38. // 20100223 - 2010-02-23aRagexeRE+ - 0x80f
  39. // 20100413 - 2010-04-13aRagexeRE+ - 0x6b
  40. // 20100629 - 2010-06-29aRagexeRE+ - 0x2d0, 0xaa, 0x2d1, 0x2d2
  41. // 20100721 - 2010-07-21aRagexeRE+ - 0x6b, 0x6d
  42. // 20100727 - 2010-07-27aRagexeRE+ - 0x6b, 0x6d
  43. // 20100803 - 2010-08-03aRagexeRE+ - 0x6b, 0x6d, 0x827, 0x828, 0x829, 0x82a, 0x82b, 0x82c, 0x842, 0x843
  44. // 20101124 - 2010-11-24aRagexeRE+ - 0x856, 0x857, 0x858
  45. // 20110111 - 2011-01-11aRagexeRE+ - 0x6b, 0x6d
  46. // 20110928 - 2011-09-28aRagexeRE+ - 0x6b, 0x6d
  47. // 20111025 - 2011-10-25aRagexeRE+ - 0x6b, 0x6d
  48. // 20120307 - 2012-03-07aRagexeRE+ - 0x970
  49.  
  50. #ifndef PACKETVER
  51. #define PACKETVER 20140205
  52. #endif // PACKETVER
  53.  
  54. //Uncomment the following line if your client is ragexeRE instead of ragexe (required because of conflicting packets in ragexe vs ragexeRE).
  55. //#define ENABLE_PACKETVER_RE
  56. //#ifdef ENABLE_PACKETVER_RE
  57. // #define PACKETVER_RE
  58. // #undef ENABLE_PACKETVER_RE
  59. //#endif // DISABLE_PACKETVER_RE
  60.  
  61. // Client support for experimental RagexeRE UI present in 2012-04-10 and 2012-04-18
  62. #if defined(PACKETVER_RE) && ( PACKETVER == 20120410 || PACKETVER == 20120418 )
  63. #define PARTY_RECRUIT
  64. #endif // PACKETVER_RE && (PACKETVER == 20120410 || PACKETVER == 10120418)
  65.  
  66. // Comment the following line to disable sc_data saving. [Skotlex]
  67. #define ENABLE_SC_SAVING
  68.  
  69. #if PACKETVER >= 20070227
  70. // Comment the following like to disable server-side hot-key saving support. [Skotlex]
  71. // Note that newer clients no longer save hotkeys in the registry!
  72. #define HOTKEY_SAVING
  73.  
  74. #if PACKETVER < 20090603
  75. // (27 = 9 skills x 3 bars) (0x02b9,191)
  76. #define MAX_HOTKEYS 27
  77. #elif PACKETVER < 20090617
  78. // (36 = 9 skills x 4 bars) (0x07d9,254)
  79. #define MAX_HOTKEYS 36
  80. #else // >= 20090617
  81. // (38 = 9 skills x 4 bars & 2 Quickslots)(0x07d9,268)
  82. #define MAX_HOTKEYS 38
  83. #endif // 20090603
  84. #endif // 20070227
  85.  
  86. #define MAX_INVENTORY 100
  87. //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.
  88. #define MAX_CHARS 12
  89. //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]
  90. //Note: The client seems unable to receive data for more than 4 slots due to all related packets having a fixed size.
  91. #define MAX_SLOTS 4
  92. //Max amount of a single stacked item
  93. #define MAX_AMOUNT 30000
  94. #define MAX_ZENY 1000000000
  95.  
  96. //Official Limit: 2.1b ( the var that stores the money doesn't go much higher than this by default )
  97. #define MAX_BANK_ZENY 2100000000
  98.  
  99. #define MAX_FAME 1000000000
  100. #define MAX_CART 100
  101. #define MAX_SKILL 1478
  102. #define MAX_SKILL_ID 10015 // [Ind/Hercules] max used skill ID
  103. // Update this max as necessary. 86 is the value needed for Expanded Super Novice.
  104. #define MAX_SKILL_TREE 86
  105. #define DEFAULT_WALK_SPEED 150
  106. #define MIN_WALK_SPEED 20 /* below 20 clips animation */
  107. #define MAX_WALK_SPEED 1000
  108. #define MAX_STORAGE 600
  109. #define MAX_GUILD_STORAGE 600
  110. #define MAX_PARTY 12
  111. #define MAX_GUILD (15+10*1) // Increased max guild members +6 per 1 extension levels [Lupus]
  112. #define MAX_GUILDPOSITION 20 // Increased max guild positions to accomodate for all members [Valaris] (removed) [PoW]
  113. #define MAX_GUILDEXPULSION 32
  114. #define MAX_GUILDALLIANCE 16
  115. #define MAX_GUILDSKILL 15 // Increased max guild skills because of new skills [Sara-chan]
  116. #define MAX_GUILDLEVEL 50
  117. #define MAX_GUARDIANS 8 // Local max per castle. [Skotlex]
  118. #define MAX_QUEST_OBJECTIVES 3 // Max quest objectives for a quest
  119. #define MAX_START_ITEMS 32 // Max number of items allowed to be given to a char whenever it's created. [mkbu95]
  120.  
  121. // for produce
  122. #define MIN_ATTRIBUTE 0
  123. #define MAX_ATTRIBUTE 4
  124. #define ATTRIBUTE_NORMAL 0
  125. #define MIN_STAR 0
  126. #define MAX_STAR 3
  127.  
  128. #define MAX_STATUS_TYPE 5
  129.  
  130. #define WEDDING_RING_M 2634
  131. #define WEDDING_RING_F 2635
  132.  
  133. //For character names, title names, guilds, maps, etc.
  134. //Includes null-terminator as it is the length of the array.
  135. #define NAME_LENGTH (23 + 1)
  136. //For item names, which tend to have much longer names.
  137. #define ITEM_NAME_LENGTH 50
  138. //For Map Names, which the client considers to be 16 in length including the .gat extension.
  139. #define MAP_NAME_LENGTH (11 + 1)
  140. #define MAP_NAME_LENGTH_EXT (MAP_NAME_LENGTH + 4)
  141.  
  142. #define MAX_FRIENDS 40
  143. #define MAX_MEMOPOINTS 3
  144.  
  145. // Size of the fame list arrays.
  146. #define MAX_FAME_LIST 10
  147.  
  148. // Limits to avoid ID collision with other game objects
  149. #define START_ACCOUNT_NUM 2000000
  150. #define END_ACCOUNT_NUM 100000000
  151. #define START_CHAR_NUM 150000
  152.  
  153. // Guilds
  154. #define MAX_GUILDMES1 60
  155. #define MAX_GUILDMES2 120
  156.  
  157. // Base Homun skill.
  158. #define HM_SKILLBASE 8001
  159. #define MAX_HOMUNSKILL 43
  160. #define MAX_HOMUNCULUS_CLASS 52 // [orn] Increased to 60 from 16 to allow new Homun-S.
  161. #define HM_CLASS_BASE 6001
  162. #define HM_CLASS_MAX (HM_CLASS_BASE+MAX_HOMUNCULUS_CLASS-1)
  163.  
  164. // Mail System
  165. #define MAIL_MAX_INBOX 30
  166. #define MAIL_TITLE_LENGTH 40
  167. #define MAIL_BODY_LENGTH 200
  168.  
  169. // Mercenary System
  170. #define MC_SKILLBASE 8201
  171. #define MAX_MERCSKILL 40
  172. #define MAX_MERCENARY_CLASS 61
  173.  
  174. // Elemental System
  175. #define MAX_ELEMENTALSKILL 42
  176. #define EL_SKILLBASE 8401
  177. #define MAX_ELESKILLTREE 3
  178. #define MAX_ELEMENTAL_CLASS 12
  179. #define EL_CLASS_BASE 2114
  180. #define EL_CLASS_MAX (EL_CLASS_BASE+MAX_ELEMENTAL_CLASS-1)
  181.  
  182. struct HPluginData;
  183.  
  184. enum item_types {
  185. IT_HEALING = 0,
  186. IT_UNKNOWN, //1
  187. IT_USABLE, //2
  188. IT_ETC, //3
  189. IT_WEAPON, //4
  190. IT_ARMOR, //5
  191. IT_CARD, //6
  192. IT_PETEGG, //7
  193. IT_PETARMOR,//8
  194. IT_UNKNOWN2,//9
  195. IT_AMMO, //10
  196. IT_DELAYCONSUME,//11
  197. IT_CASH = 18,
  198. IT_MAX
  199. };
  200.  
  201.  
  202. // Questlog states
  203. enum quest_state {
  204. Q_INACTIVE, ///< Inactive quest (the user can toggle between active and inactive quests)
  205. Q_ACTIVE, ///< Active quest
  206. Q_COMPLETE, ///< Completed quest
  207. };
  208.  
  209. /// Questlog entry
  210. struct quest {
  211. int quest_id; ///< Quest ID
  212. unsigned int time; ///< Expiration time
  213. int count[MAX_QUEST_OBJECTIVES]; ///< Kill counters of each quest objective
  214. enum quest_state state; ///< Current quest state
  215. };
  216.  
  217. struct item {
  218. int id;
  219. short nameid;
  220. short amount;
  221. unsigned int equip; // Location(s) where item is equipped (using enum equip_pos for bitmasking).
  222. char identify;
  223. char refine;
  224. char attribute;
  225. short card[MAX_SLOTS];
  226. unsigned int expire_time;
  227. char favorite;
  228. unsigned char bound;
  229. uint64 unique_id;
  230. };
  231. //Equip position constants
  232. enum equip_pos {
  233. EQP_HEAD_LOW = 0x000001,
  234. EQP_HEAD_MID = 0x000200, //512
  235. EQP_HEAD_TOP = 0x000100, //256
  236. EQP_HAND_R = 0x000002, //2
  237. EQP_HAND_L = 0x000020, //32
  238. EQP_ARMOR = 0x000010, //16
  239. EQP_SHOES = 0x000040, //64
  240. EQP_GARMENT = 0x000004, //4
  241. EQP_ACC_L = 0x000008, //8
  242. EQP_ACC_R = 0x000080, //128
  243. EQP_COSTUME_HEAD_TOP = 0x000400, //1024
  244. EQP_COSTUME_HEAD_MID = 0x000800, //2048
  245. EQP_COSTUME_HEAD_LOW = 0x001000, //4096
  246. EQP_COSTUME_GARMENT = 0x002000, //8192
  247. //UNUSED_COSTUME_FLOOR = 0x004000, //16384
  248. EQP_AMMO = 0x008000, //32768
  249. EQP_SHADOW_ARMOR = 0x010000, //65536
  250. EQP_SHADOW_WEAPON = 0x020000, //131072
  251. EQP_SHADOW_SHIELD = 0x040000, //262144
  252. EQP_SHADOW_SHOES = 0x080000, //524288
  253. EQP_SHADOW_ACC_R = 0x100000, //1048576
  254. EQP_SHADOW_ACC_L = 0x200000, //2097152
  255. };
  256.  
  257. struct point {
  258. unsigned short map;
  259. short x,y;
  260. };
  261.  
  262. enum e_skill_flag
  263. {
  264. SKILL_FLAG_PERMANENT,
  265. SKILL_FLAG_TEMPORARY,
  266. SKILL_FLAG_PLAGIARIZED,
  267. SKILL_FLAG_UNUSED, /* needed to maintain the order since the values are saved, can be renamed and used if a new flag is necessary */
  268. SKILL_FLAG_PERM_GRANTED, // Permanent, granted through someway (e.g. script).
  269. /* */
  270. /* MUST be the last, because with it the flag value stores a dynamic value (flag+lv) */
  271. SKILL_FLAG_REPLACED_LV_0, // Temporary skill overshadowing permanent skill of level 'N - SKILL_FLAG_REPLACED_LV_0',
  272. };
  273.  
  274. enum e_mmo_charstatus_opt {
  275. OPT_NONE = 0x0,
  276. OPT_SHOW_EQUIP = 0x1,
  277. OPT_ALLOW_PARTY = 0x2,
  278. };
  279.  
  280. enum e_item_bound_type {
  281. IBT_MIN = 0x1,
  282. IBT_ACCOUNT = 0x1,
  283. IBT_GUILD = 0x2,
  284. IBT_PARTY = 0x3,
  285. IBT_CHARACTER = 0x4,
  286. IBT_MAX = 0x4,
  287. };
  288.  
  289. struct s_skill {
  290. unsigned short id;
  291. unsigned char lv;
  292. unsigned char flag; // See enum e_skill_flag
  293. };
  294.  
  295. struct script_reg_state {
  296. 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. */
  297. unsigned int update : 1;/* whether it needs to be sent to char server for insertion/update/delete */
  298. };
  299.  
  300. struct script_reg_num {
  301. struct script_reg_state flag;
  302. int value;
  303. };
  304.  
  305. struct script_reg_str {
  306. struct script_reg_state flag;
  307. char *value;
  308. };
  309.  
  310. // For saving status changes across sessions. [Skotlex]
  311. struct status_change_data {
  312. unsigned short type; //SC_type
  313. int val1, val2, val3, val4;
  314. unsigned int tick; //Remaining duration.
  315. };
  316.  
  317. struct storage_data {
  318. int storage_amount;
  319. struct item items[MAX_STORAGE];
  320. };
  321.  
  322. struct guild_storage {
  323. int dirty;
  324. int guild_id;
  325. short storage_status;
  326. short storage_amount;
  327. struct item items[MAX_GUILD_STORAGE];
  328. unsigned short lock;
  329. };
  330.  
  331. struct s_pet {
  332. int account_id;
  333. int char_id;
  334. int pet_id;
  335. short class_;
  336. short level;
  337. short egg_id;//pet egg id
  338. short equip;//pet equip name_id
  339. short intimate;//pet friendly
  340. short hungry;//pet hungry
  341. char name[NAME_LENGTH];
  342. char rename_flag;
  343. char incuvate;
  344. };
  345.  
  346. struct s_homunculus { //[orn]
  347. char name[NAME_LENGTH];
  348. int hom_id;
  349. int char_id;
  350. short class_;
  351. short prev_class;
  352. int hp,max_hp,sp,max_sp;
  353. unsigned int intimacy; //[orn]
  354. short hunger;
  355. struct s_skill hskill[MAX_HOMUNSKILL]; //albator
  356. short skillpts;
  357. short level;
  358. unsigned int exp;
  359. short rename_flag;
  360. short vaporize; //albator
  361. int str;
  362. int agi;
  363. int vit;
  364. int int_;
  365. int dex;
  366. int luk;
  367. int8 spiritball; //for homun S [lighta]
  368. };
  369.  
  370. struct s_mercenary {
  371. int mercenary_id;
  372. int char_id;
  373. short class_;
  374. int hp, sp;
  375. unsigned int kill_count;
  376. unsigned int life_time;
  377. };
  378.  
  379. struct s_elemental {
  380. int elemental_id;
  381. int char_id;
  382. short class_;
  383. int mode;
  384. int hp, sp, max_hp, max_sp, matk, atk, atk2;
  385. short hit, flee, amotion, def, mdef;
  386. int life_time;
  387. };
  388.  
  389. struct s_friend {
  390. int account_id;
  391. int char_id;
  392. char name[NAME_LENGTH];
  393. };
  394.  
  395. #ifdef HOTKEY_SAVING
  396. struct hotkey {
  397. unsigned int id;
  398. unsigned short lv;
  399. unsigned char type; // 0: item, 1: skill
  400. };
  401. #endif
  402.  
  403. struct mmo_charstatus {
  404. int char_id;
  405. int account_id;
  406. int partner_id;
  407. int father;
  408. int mother;
  409. int child;
  410.  
  411. unsigned int base_exp,job_exp;
  412. int zeny;
  413. int bank_vault;
  414.  
  415. short class_;
  416. unsigned int status_point,skill_point;
  417. int hp,max_hp,sp,max_sp;
  418. unsigned int option;
  419. short manner; // Defines how many minutes a char will be muted, each negative point is equivalent to a minute.
  420. unsigned char karma;
  421. short hair,hair_color,clothes_color;
  422. int party_id,guild_id,pet_id,hom_id,mer_id,ele_id;
  423. int fame;
  424.  
  425. // Mercenary Guilds Rank
  426. int arch_faith, arch_calls;
  427. int spear_faith, spear_calls;
  428. int sword_faith, sword_calls;
  429.  
  430. short weapon; // enum weapon_type
  431. short shield; // view-id
  432. short head_top,head_mid,head_bottom;
  433. short robe;
  434.  
  435. char name[NAME_LENGTH];
  436. unsigned int base_level,job_level;
  437. short str,agi,vit,int_,dex,luk;
  438. unsigned char slot,sex;
  439.  
  440. uint32 mapip;
  441. uint16 mapport;
  442.  
  443. struct point last_point,save_point,memo_point[MAX_MEMOPOINTS];
  444. struct item inventory[MAX_INVENTORY],cart[MAX_CART];
  445. struct storage_data storage;
  446. struct s_skill skill[MAX_SKILL];
  447.  
  448. struct s_friend friends[MAX_FRIENDS]; //New friend system [Skotlex]
  449. #ifdef HOTKEY_SAVING
  450. struct hotkey hotkeys[MAX_HOTKEYS];
  451. #endif
  452. bool show_equip, allow_party;
  453. unsigned short rename;
  454. unsigned short slotchange;
  455.  
  456. time_t delete_date;
  457.  
  458. /* `account_data` modifiers */
  459. unsigned short mod_exp,mod_drop,mod_death;
  460.  
  461. unsigned char font;
  462.  
  463. unsigned short spvd_item;
  464. unsigned short spvd_ref;
  465. };
  466.  
  467. typedef enum mail_status {
  468. MAIL_NEW,
  469. MAIL_UNREAD,
  470. MAIL_READ,
  471. } mail_status;
  472.  
  473. struct mail_message {
  474. int id;
  475. int send_id;
  476. char send_name[NAME_LENGTH];
  477. int dest_id;
  478. char dest_name[NAME_LENGTH];
  479. char title[MAIL_TITLE_LENGTH];
  480. char body[MAIL_BODY_LENGTH];
  481.  
  482. mail_status status;
  483. time_t timestamp; // marks when the message was sent
  484.  
  485. int zeny;
  486. struct item item;
  487. };
  488.  
  489. struct mail_data {
  490. short amount;
  491. bool full;
  492. short unchecked, unread;
  493. struct mail_message msg[MAIL_MAX_INBOX];
  494. };
  495.  
  496. struct auction_data {
  497. unsigned int auction_id;
  498. int seller_id;
  499. char seller_name[NAME_LENGTH];
  500. int buyer_id;
  501. char buyer_name[NAME_LENGTH];
  502.  
  503. struct item item;
  504. // This data is required for searching, as itemdb is not read by char server
  505. char item_name[ITEM_NAME_LENGTH];
  506. short type;
  507.  
  508. unsigned short hours;
  509. int price, buynow;
  510. time_t timestamp; // auction's end time
  511. int auction_end_timer;
  512. };
  513.  
  514. struct party_member {
  515. int account_id;
  516. int char_id;
  517. char name[NAME_LENGTH];
  518. unsigned short class_;
  519. unsigned short map;
  520. unsigned short lv;
  521. unsigned leader : 1,
  522. online : 1;
  523. };
  524.  
  525. struct party {
  526. int party_id;
  527. char name[NAME_LENGTH];
  528. unsigned char count; //Count of online characters.
  529. unsigned exp : 1,
  530. item : 2; //&1: Party-Share (round-robin), &2: pickup style: shared.
  531. struct party_member member[MAX_PARTY];
  532. };
  533.  
  534. struct map_session_data;
  535. struct guild_member {
  536. int account_id, char_id;
  537. short hair,hair_color,gender,class_,lv;
  538. uint64 exp;
  539. int exp_payper;
  540. short online,position;
  541. char name[NAME_LENGTH];
  542. struct map_session_data *sd;
  543. unsigned char modified;
  544. };
  545.  
  546. struct guild_position {
  547. char name[NAME_LENGTH];
  548. int mode;
  549. int exp_mode;
  550. unsigned char modified;
  551. };
  552.  
  553. struct guild_alliance {
  554. int opposition;
  555. int guild_id;
  556. char name[NAME_LENGTH];
  557. };
  558.  
  559. struct guild_expulsion {
  560. char name[NAME_LENGTH];
  561. char mes[40];
  562. int account_id;
  563. };
  564.  
  565. struct guild_skill {
  566. int id,lv;
  567. };
  568.  
  569. struct hChSysCh;
  570. struct guild {
  571. int guild_id;
  572. short guild_lv, connect_member, max_member, average_lv;
  573. uint64 exp;
  574. unsigned int next_exp;
  575. int skill_point;
  576. char name[NAME_LENGTH],master[NAME_LENGTH];
  577. struct guild_member member[MAX_GUILD];
  578. struct guild_position position[MAX_GUILDPOSITION];
  579. char mes1[MAX_GUILDMES1],mes2[MAX_GUILDMES2];
  580. int emblem_len,emblem_id;
  581. char emblem_data[2048];
  582. struct guild_alliance alliance[MAX_GUILDALLIANCE];
  583. struct guild_expulsion expulsion[MAX_GUILDEXPULSION];
  584. struct guild_skill skill[MAX_GUILDSKILL];
  585.  
  586. /* used on char.c to state what kind of data is being saved/processed */
  587. unsigned short save_flag;
  588.  
  589. short *instance;
  590. unsigned short instances;
  591.  
  592. struct hChSysCh *channel;
  593.  
  594. /* HPM Custom Struct */
  595. struct HPluginData **hdata;
  596. unsigned int hdatac;
  597. };
  598.  
  599. struct guild_castle {
  600. int castle_id;
  601. int mapindex;
  602. char castle_name[NAME_LENGTH];
  603. char castle_event[NAME_LENGTH];
  604. int guild_id;
  605. int economy;
  606. int defense;
  607. int triggerE;
  608. int triggerD;
  609. int nextTime;
  610. int payTime;
  611. int createTime;
  612. int visibleC;
  613. struct {
  614. unsigned visible : 1;
  615. int id; // object id
  616. } guardian[MAX_GUARDIANS];
  617. int* temp_guardians; // ids of temporary guardians (mobs)
  618. int temp_guardians_max;
  619. };
  620.  
  621. struct fame_list {
  622. int id;
  623. int fame;
  624. char name[NAME_LENGTH];
  625. };
  626.  
  627. enum fame_list_type {
  628. RANKTYPE_BLACKSMITH = 0,
  629. RANKTYPE_ALCHEMIST = 1,
  630. RANKTYPE_TAEKWON = 2,
  631. RANKTYPE_PK = 3, //Not supported yet
  632. };
  633.  
  634. enum { //Change Guild Infos
  635. GBI_EXP =1, // Guild Experience (EXP)
  636. GBI_GUILDLV, // Guild level
  637. GBI_SKILLPOINT, // Guild skillpoints
  638. GBI_SKILLLV, // Guild skill_lv ?? seem unused
  639. };
  640.  
  641. enum { //Change Member Infos
  642. GMI_POSITION =0,
  643. GMI_EXP,
  644. GMI_HAIR,
  645. GMI_HAIR_COLOR,
  646. GMI_GENDER,
  647. GMI_CLASS,
  648. GMI_LEVEL,
  649. };
  650.  
  651. enum {
  652. GD_SKILLBASE=10000,
  653. GD_APPROVAL=10000,
  654. GD_KAFRACONTRACT=10001,
  655. GD_GUARDRESEARCH=10002,
  656. GD_GUARDUP=10003,
  657. GD_EXTENSION=10004,
  658. GD_GLORYGUILD=10005,
  659. GD_LEADERSHIP=10006,
  660. GD_GLORYWOUNDS=10007,
  661. GD_SOULCOLD=10008,
  662. GD_HAWKEYES=10009,
  663. GD_BATTLEORDER=10010,
  664. GD_REGENERATION=10011,
  665. GD_RESTORE=10012,
  666. GD_EMERGENCYCALL=10013,
  667. GD_DEVELOPMENT=10014,
  668. GD_MAX,
  669. };
  670.  
  671.  
  672. //These mark the ID of the jobs, as expected by the client. [Skotlex]
  673. enum {
  674. JOB_NOVICE,
  675. JOB_SWORDMAN,
  676. JOB_MAGE,
  677. JOB_ARCHER,
  678. JOB_ACOLYTE,
  679. JOB_MERCHANT,
  680. JOB_THIEF,
  681. JOB_KNIGHT,
  682. JOB_PRIEST,
  683. JOB_WIZARD,
  684. JOB_BLACKSMITH,
  685. JOB_HUNTER,
  686. JOB_ASSASSIN,
  687. JOB_KNIGHT2,
  688. JOB_CRUSADER,
  689. JOB_MONK,
  690. JOB_SAGE,
  691. JOB_ROGUE,
  692. JOB_ALCHEMIST,
  693. JOB_BARD,
  694. JOB_DANCER,
  695. JOB_CRUSADER2,
  696. JOB_WEDDING,
  697. JOB_SUPER_NOVICE,
  698. JOB_GUNSLINGER,
  699. JOB_NINJA,
  700. JOB_XMAS,
  701. JOB_SUMMER,
  702. JOB_MAX_BASIC,
  703.  
  704. JOB_NOVICE_HIGH = 4001,
  705. JOB_SWORDMAN_HIGH,
  706. JOB_MAGE_HIGH,
  707. JOB_ARCHER_HIGH,
  708. JOB_ACOLYTE_HIGH,
  709. JOB_MERCHANT_HIGH,
  710. JOB_THIEF_HIGH,
  711. JOB_LORD_KNIGHT,
  712. JOB_HIGH_PRIEST,
  713. JOB_HIGH_WIZARD,
  714. JOB_WHITESMITH,
  715. JOB_SNIPER,
  716. JOB_ASSASSIN_CROSS,
  717. JOB_LORD_KNIGHT2,
  718. JOB_PALADIN,
  719. JOB_CHAMPION,
  720. JOB_PROFESSOR,
  721. JOB_STALKER,
  722. JOB_CREATOR,
  723. JOB_CLOWN,
  724. JOB_GYPSY,
  725. JOB_PALADIN2,
  726.  
  727. JOB_BABY,
  728. JOB_BABY_SWORDMAN,
  729. JOB_BABY_MAGE,
  730. JOB_BABY_ARCHER,
  731. JOB_BABY_ACOLYTE,
  732. JOB_BABY_MERCHANT,
  733. JOB_BABY_THIEF,
  734. JOB_BABY_KNIGHT,
  735. JOB_BABY_PRIEST,
  736. JOB_BABY_WIZARD,
  737. JOB_BABY_BLACKSMITH,
  738. JOB_BABY_HUNTER,
  739. JOB_BABY_ASSASSIN,
  740. JOB_BABY_KNIGHT2,
  741. JOB_BABY_CRUSADER,
  742. JOB_BABY_MONK,
  743. JOB_BABY_SAGE,
  744. JOB_BABY_ROGUE,
  745. JOB_BABY_ALCHEMIST,
  746. JOB_BABY_BARD,
  747. JOB_BABY_DANCER,
  748. JOB_BABY_CRUSADER2,
  749. JOB_SUPER_BABY,
  750.  
  751. JOB_TAEKWON,
  752. JOB_STAR_GLADIATOR,
  753. JOB_STAR_GLADIATOR2,
  754. JOB_SOUL_LINKER,
  755.  
  756. JOB_GANGSI,
  757. JOB_DEATH_KNIGHT,
  758. JOB_DARK_COLLECTOR,
  759.  
  760. JOB_RUNE_KNIGHT = 4054,
  761. JOB_WARLOCK,
  762. JOB_RANGER,
  763. JOB_ARCH_BISHOP,
  764. JOB_MECHANIC,
  765. JOB_GUILLOTINE_CROSS,
  766.  
  767. JOB_RUNE_KNIGHT_T,
  768. JOB_WARLOCK_T,
  769. JOB_RANGER_T,
  770. JOB_ARCH_BISHOP_T,
  771. JOB_MECHANIC_T,
  772. JOB_GUILLOTINE_CROSS_T,
  773.  
  774. JOB_ROYAL_GUARD,
  775. JOB_SORCERER,
  776. JOB_MINSTREL,
  777. JOB_WANDERER,
  778. JOB_SURA,
  779. JOB_GENETIC,
  780. JOB_SHADOW_CHASER,
  781.  
  782. JOB_ROYAL_GUARD_T,
  783. JOB_SORCERER_T,
  784. JOB_MINSTREL_T,
  785. JOB_WANDERER_T,
  786. JOB_SURA_T,
  787. JOB_GENETIC_T,
  788. JOB_SHADOW_CHASER_T,
  789.  
  790. JOB_RUNE_KNIGHT2,
  791. JOB_RUNE_KNIGHT_T2,
  792. JOB_ROYAL_GUARD2,
  793. JOB_ROYAL_GUARD_T2,
  794. JOB_RANGER2,
  795. JOB_RANGER_T2,
  796. JOB_MECHANIC2,
  797. JOB_MECHANIC_T2,
  798.  
  799. JOB_BABY_RUNE = 4096,
  800. JOB_BABY_WARLOCK,
  801. JOB_BABY_RANGER,
  802. JOB_BABY_BISHOP,
  803. JOB_BABY_MECHANIC,
  804. JOB_BABY_CROSS,
  805.  
  806. JOB_BABY_GUARD,
  807. JOB_BABY_SORCERER,
  808. JOB_BABY_MINSTREL,
  809. JOB_BABY_WANDERER,
  810. JOB_BABY_SURA,
  811. JOB_BABY_GENETIC,
  812. JOB_BABY_CHASER,
  813.  
  814. JOB_BABY_RUNE2,
  815. JOB_BABY_GUARD2,
  816. JOB_BABY_RANGER2,
  817. JOB_BABY_MECHANIC2,
  818.  
  819. JOB_SUPER_NOVICE_E = 4190,
  820. JOB_SUPER_BABY_E,
  821.  
  822. JOB_KAGEROU = 4211,
  823. JOB_OBORO,
  824. JOB_REBELLION = 4215,
  825.  
  826. JOB_MAX,
  827. };
  828.  
  829. //Total number of classes (for data storage)
  830. #define CLASS_COUNT (JOB_MAX - JOB_NOVICE_HIGH + JOB_MAX_BASIC)
  831.  
  832. enum {
  833. SEX_FEMALE = 0,
  834. SEX_MALE,
  835. SEX_SERVER
  836. };
  837.  
  838. enum weapon_type {
  839. W_FIST, //Bare hands
  840. W_DAGGER, //1
  841. W_1HSWORD, //2
  842. W_2HSWORD, //3
  843. W_1HSPEAR, //4
  844. W_2HSPEAR, //5
  845. W_1HAXE, //6
  846. W_2HAXE, //7
  847. W_MACE, //8
  848. W_2HMACE, //9 (unused)
  849. W_STAFF, //10
  850. W_BOW, //11
  851. W_KNUCKLE, //12
  852. W_MUSICAL, //13
  853. W_WHIP, //14
  854. W_BOOK, //15
  855. W_KATAR, //16
  856. W_REVOLVER, //17
  857. W_RIFLE, //18
  858. W_GATLING, //19
  859. W_SHOTGUN, //20
  860. W_GRENADE, //21
  861. W_HUUMA, //22
  862. W_2HSTAFF, //23
  863. MAX_WEAPON_TYPE,
  864. // dual-wield constants
  865. W_DOUBLE_DD, // 2 daggers
  866. W_DOUBLE_SS, // 2 swords
  867. W_DOUBLE_AA, // 2 axes
  868. W_DOUBLE_DS, // dagger + sword
  869. W_DOUBLE_DA, // dagger + axe
  870. W_DOUBLE_SA, // sword + axe
  871. };
  872.  
  873. enum ammo_type {
  874. A_ARROW = 1,
  875. A_DAGGER, //2
  876. A_BULLET, //3
  877. A_SHELL, //4
  878. A_GRENADE, //5
  879. A_SHURIKEN, //6
  880. A_KUNAI, //7
  881. A_CANNONBALL, //8
  882. A_THROWWEAPON //9
  883. };
  884.  
  885. enum e_char_server_type {
  886. CST_NORMAL = 0,
  887. CST_MAINTENANCE = 1,
  888. CST_OVER18 = 2,
  889. CST_PAYING = 3,
  890. CST_F2P = 4,
  891. };
  892.  
  893. enum e_pc_reg_loading {
  894. PRL_NONE = 0x0,
  895. PRL_CHAR = 0x1,
  896. PRL_ACCL = 0x2,/* local */
  897. PRL_ACCG = 0x4,/* global */
  898. PRL_ALL = 0xFF,
  899. };
  900.  
  901. /* packet size constant for itemlist */
  902. #if MAX_INVENTORY > MAX_STORAGE && MAX_INVENTORY > MAX_CART
  903. #define MAX_ITEMLIST MAX_INVENTORY
  904. #elif MAX_CART > MAX_INVENTORY && MAX_CART > MAX_STORAGE
  905. #define MAX_ITEMLIST MAX_CART
  906. #else
  907. #define MAX_ITEMLIST MAX_STORAGE
  908. #endif
  909.  
  910. // sanity checks...
  911. #if MAX_ZENY > INT_MAX
  912. #error MAX_ZENY is too big
  913. #endif
  914.  
  915. #endif /* _COMMON_MMO_H_ */
Add Comment
Please, Sign In to add comment