mmo.h 21 KB

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