clif.hpp 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094
  1. // Copyright (c) rAthena Dev Teams - Licensed under GNU GPL
  2. // For more information, see LICENCE in the main folder
  3. #ifndef CLIF_HPP
  4. #define CLIF_HPP
  5. #include <stdarg.h>
  6. #include "../common/cbasetypes.hpp"
  7. #include "../common/db.hpp" //dbmap
  8. #include "../common/mmo.hpp"
  9. struct Channel;
  10. struct clan;
  11. struct item;
  12. struct s_storage;
  13. //#include "map.hpp"
  14. struct block_list;
  15. struct unit_data;
  16. struct map_session_data;
  17. struct homun_data;
  18. struct pet_data;
  19. struct mob_data;
  20. struct npc_data;
  21. struct chat_data;
  22. struct flooritem_data;
  23. struct skill_unit;
  24. struct s_vending;
  25. struct party;
  26. struct party_data;
  27. struct guild;
  28. struct battleground_data;
  29. struct quest;
  30. struct party_booking_ad_info;
  31. struct sale_item_data;
  32. struct mail_message;
  33. struct achievement;
  34. enum e_PacketDBVersion { // packet DB
  35. MIN_PACKET_DB = 0x064,
  36. MAX_PACKET_DB = 0xAFF,
  37. MAX_PACKET_POS = 20,
  38. };
  39. enum e_packet_ack : uint8_t{
  40. ZC_ACK_OPEN_BANKING = 0,
  41. ZC_ACK_CLOSE_BANKING,
  42. ZC_ACK_BANKING_DEPOSIT,
  43. ZC_ACK_BANKING_WITHDRAW,
  44. ZC_BANKING_CHECK,
  45. ZC_PERSONAL_INFOMATION,
  46. ZC_PERSONAL_INFOMATION_CHN,
  47. ZC_CLEAR_DIALOG,
  48. ZC_C_MARKERINFO,
  49. ZC_NOTIFY_BIND_ON_EQUIP,
  50. ZC_WEAR_EQUIP_ACK,
  51. ZC_MERGE_ITEM_OPEN,
  52. ZC_ACK_MERGE_ITEM,
  53. ZC_BROADCASTING_SPECIAL_ITEM_OBTAIN,
  54. //add other here
  55. MAX_ACK_FUNC //auto upd len
  56. };
  57. struct s_packet_db {
  58. short len;
  59. void (*func)(int, struct map_session_data *);
  60. short pos[MAX_PACKET_POS];
  61. };
  62. #ifdef PACKET_OBFUSCATION
  63. /// Keys based on packet versions
  64. struct s_packet_keys {
  65. unsigned int keys[3]; ///< 3-Keys
  66. };
  67. #endif
  68. enum e_CASHSHOP_ACK : uint8_t{
  69. ERROR_TYPE_NONE = 0, ///< The deal has successfully completed.
  70. ERROR_TYPE_NPC = 1, ///< The Purchase has failed because the NPC does not exist.
  71. ERROR_TYPE_SYSTEM = 2, ///< The Purchase has failed because the Kafra Shop System is not working correctly.
  72. ERROR_TYPE_INVENTORY_WEIGHT = 3, ///< You are over your Weight Limit.
  73. ERROR_TYPE_EXCHANGE = 4, ///< You cannot purchase items while you are in a trade.
  74. ERROR_TYPE_ITEM_ID = 5, ///< The Purchase has failed because the Item Information was incorrect.
  75. ERROR_TYPE_MONEY = 6, ///< You do not have enough Kafra Credit Points.
  76. ERROR_TYPE_AMOUNT = 7, ///< You can purchase up to 10 items.
  77. ERROR_TYPE_PURCHASE_FAIL = 8, ///< Some items could not be purchased.
  78. };
  79. enum e_BANKING_DEPOSIT_ACK : uint8_t {
  80. BDA_SUCCESS = 0x0,
  81. BDA_ERROR = 0x1,
  82. BDA_NO_MONEY = 0x2,
  83. BDA_OVERFLOW = 0x3,
  84. };
  85. enum e_BANKING_WITHDRAW_ACK : uint8_t {
  86. BWA_SUCCESS = 0x0,
  87. BWA_NO_MONEY = 0x1,
  88. BWA_UNKNOWN_ERROR = 0x2,
  89. };
  90. enum RECV_ROULETTE_ITEM_REQ : uint8_t {
  91. RECV_ITEM_SUCCESS = 0x0,
  92. RECV_ITEM_FAILED = 0x1,
  93. RECV_ITEM_OVERCOUNT = 0x2,
  94. RECV_ITEM_OVERWEIGHT = 0x3,
  95. };
  96. enum RECV_ROULETTE_ITEM_ACK : uint8_t {
  97. RECV_ITEM_NORMAL = 0x0,
  98. RECV_ITEM_LOSING = 0x1,
  99. };
  100. enum GENERATE_ROULETTE_ACK : uint8_t {
  101. GENERATE_ROULETTE_SUCCESS = 0x0,
  102. GENERATE_ROULETTE_FAILED = 0x1,
  103. GENERATE_ROULETTE_NO_ENOUGH_POINT = 0x2,
  104. GENERATE_ROULETTE_LOSING = 0x3,
  105. };
  106. enum OPEN_ROULETTE_ACK : uint8_t {
  107. OPEN_ROULETTE_SUCCESS = 0x0,
  108. OPEN_ROULETTE_FAILED = 0x1,
  109. };
  110. enum CLOSE_ROULETTE_ACK : uint8_t {
  111. CLOSE_ROULETTE_SUCCESS = 0x0,
  112. CLOSE_ROULETTE_FAILED = 0x1,
  113. };
  114. enum MERGE_ITEM_ACK : uint8_t {
  115. MERGE_ITEM_SUCCESS = 0x0,
  116. MERGE_ITEM_FAILED_NOT_MERGE = 0x1,
  117. MERGE_ITEM_FAILED_MAX_COUNT = 0x2,
  118. };
  119. enum BROADCASTING_SPECIAL_ITEM_OBTAIN : uint8_t {
  120. ITEMOBTAIN_TYPE_BOXITEM = 0x0,
  121. ITEMOBTAIN_TYPE_MONSTER_ITEM = 0x1,
  122. ITEMOBTAIN_TYPE_NPC = 0x2,
  123. };
  124. enum e_adopt_reply : uint8_t {
  125. ADOPT_REPLY_MORE_CHILDREN = 0,
  126. ADOPT_REPLY_LEVEL_70,
  127. ADOPT_REPLY_MARRIED,
  128. };
  129. enum e_wip_block : uint8_t {
  130. WIP_DISABLE_NONE = 0x0,
  131. WIP_DISABLE_SKILLITEM = 0x1,
  132. WIP_DISABLE_NPC = 0x2,
  133. WIP_DISABLE_ALL = 0x3,
  134. };
  135. enum e_party_invite_reply {
  136. PARTY_REPLY_JOIN_OTHER_PARTY = 0, ///< result=0 : "The Character already joined another party." -> MsgStringTable[80]
  137. PARTY_REPLY_REJECTED, ///< result=1 : "Request for party rejected." -> MsgStringTable[81]
  138. PARTY_REPLY_ACCEPTED, ///< result=2 : "Request for party accepted." -> MsgStringTable[82]
  139. PARTY_REPLY_FULL, ///< result=3 : "Party Capacity exceeded." -> MsgStringTable[83]
  140. PARTY_REPLY_DUAL, ///< result=4 : "Character in the same account already joined." -> MsgStringTable[608]
  141. PARTY_REPLY_JOINMSG_REFUSE, ///< result=5 : !TODO "The character blocked the party invitation." -> MsgStringTable[1324] (since 20070904)
  142. PARTY_REPLY_UNKNOWN_ERROR, ///< result=6 : ??
  143. PARTY_REPLY_OFFLINE, ///< result=7 : "The Character is not currently online or does not exist." -> MsgStringTable[71] (since 20070904)
  144. PARTY_REPLY_INVALID_MAPPROPERTY, ///< result=8 : !TODO "Unable to organize a party in this map" -> MsgStringTable[1388] (since 20080527)
  145. PARTY_REPLY_INVALID_MAPPROPERTY_ME, ///< return=9 : !TODO "Cannot join a party in this map" -> MsgStringTable[1871] (since 20110205)
  146. };
  147. /// Enum for Convex Mirror (SC_BOSSMAPINFO)
  148. enum e_bossmap_info {
  149. BOSS_INFO_NOT = 0,
  150. BOSS_INFO_ALIVE,
  151. BOSS_INFO_ALIVE_WITHMSG,
  152. BOSS_INFO_DEAD,
  153. };
  154. #define packet_len(cmd) packet_db[cmd].len
  155. extern struct s_packet_db packet_db[MAX_PACKET_DB+1];
  156. extern int packet_db_ack[MAX_ACK_FUNC + 1];
  157. // local define
  158. enum send_target : uint8_t {
  159. ALL_CLIENT = 0,
  160. ALL_SAMEMAP,
  161. AREA, // area
  162. AREA_WOS, // area, without self
  163. AREA_WOC, // area, without chatrooms
  164. AREA_WOSC, // area, without own chatroom
  165. AREA_CHAT_WOC, // hearable area, without chatrooms
  166. CHAT, // current chatroom
  167. CHAT_WOS, // current chatroom, without self
  168. PARTY,
  169. PARTY_WOS,
  170. PARTY_SAMEMAP,
  171. PARTY_SAMEMAP_WOS,
  172. PARTY_AREA,
  173. PARTY_AREA_WOS,
  174. GUILD,
  175. GUILD_WOS,
  176. GUILD_SAMEMAP,
  177. GUILD_SAMEMAP_WOS,
  178. GUILD_AREA,
  179. GUILD_AREA_WOS,
  180. GUILD_NOBG,
  181. DUEL,
  182. DUEL_WOS,
  183. SELF,
  184. BG, // BattleGround System
  185. BG_WOS,
  186. BG_SAMEMAP,
  187. BG_SAMEMAP_WOS,
  188. BG_AREA,
  189. BG_AREA_WOS,
  190. CLAN, // Clan System
  191. };
  192. enum broadcast_flags : uint8_t {
  193. BC_ALL = 0,
  194. BC_MAP = 1,
  195. BC_AREA = 2,
  196. BC_SELF = 3,
  197. BC_TARGET_MASK = 0x07,
  198. BC_PC = 0x00,
  199. BC_NPC = 0x08,
  200. BC_SOURCE_MASK = 0x08, // BC_PC|BC_NPC
  201. BC_YELLOW = 0x00,
  202. BC_BLUE = 0x10,
  203. BC_WOE = 0x20,
  204. BC_COLOR_MASK = 0x30, // BC_YELLOW|BC_BLUE|BC_WOE
  205. BC_DEFAULT = BC_ALL|BC_PC|BC_YELLOW
  206. };
  207. enum emotion_type {
  208. ET_SURPRISE = 0, // /!
  209. ET_QUESTION, // /?
  210. ET_DELIGHT,
  211. ET_THROB,
  212. ET_SWEAT,
  213. ET_AHA,
  214. ET_FRET,
  215. ET_ANGER,
  216. ET_MONEY, // /$
  217. ET_THINK, // /...
  218. ET_SCISSOR, // /gawi --- 10
  219. ET_ROCK, // /bawi
  220. ET_WRAP, // /bo
  221. ET_FLAG,
  222. ET_BIGTHROB,
  223. ET_THANKS,
  224. ET_KEK,
  225. ET_SORRY,
  226. ET_SMILE,
  227. ET_PROFUSELY_SWEAT,
  228. ET_SCRATCH, // --- 20
  229. ET_BEST,
  230. ET_STARE_ABOUT, // /??
  231. ET_HUK,
  232. ET_O,
  233. ET_X,
  234. ET_HELP,
  235. ET_GO,
  236. ET_CRY,
  237. ET_KIK,
  238. ET_CHUP, // --- 30
  239. ET_CHUPCHUP,
  240. ET_HNG,
  241. ET_OK,
  242. ET_CHAT_PROHIBIT, // red /... used for muted characters
  243. ET_INDONESIA_FLAG,
  244. ET_STARE, // /bzz, /stare
  245. ET_HUNGRY,
  246. ET_COOL, // /awsm, /cool
  247. ET_MERONG,
  248. ET_SHY, // --- 40
  249. ET_GOODBOY, // /pat, /goodboy
  250. ET_SPTIME, // /mp, /sptime
  251. ET_SEXY,
  252. ET_COMEON, // /com, /comeon
  253. ET_SLEEPY, // /yawn, /sleepy
  254. ET_CONGRATULATION, // /grat, /congrats
  255. ET_HPTIME, // /hp, /hptime
  256. ET_PH_FLAG,
  257. ET_MY_FLAG,
  258. ET_SI_FLAG, // --- 50
  259. ET_BR_FLAG,
  260. ET_SPARK, // /fsh
  261. ET_CONFUSE, // /spin
  262. ET_OHNO,
  263. ET_HUM, // /dum
  264. ET_BLABLA, // /crwd
  265. ET_OTL, // /otl, /desp
  266. ET_DICE1,
  267. ET_DICE2,
  268. ET_DICE3, // --- 60
  269. ET_DICE4,
  270. ET_DICE5,
  271. ET_DICE6,
  272. ET_INDIA_FLAG,
  273. ET_LUV, // /love
  274. ET_FLAG8,
  275. ET_FLAG9,
  276. ET_MOBILE,
  277. ET_MAIL,
  278. ET_ANTENNA0, // --- 70
  279. ET_ANTENNA1,
  280. ET_ANTENNA2,
  281. ET_ANTENNA3,
  282. ET_HUM2,
  283. ET_ABS,
  284. ET_OOPS,
  285. ET_SPIT,
  286. ET_ENE,
  287. ET_PANIC,
  288. ET_WHISP, // --- 80
  289. ET_YUT1,
  290. ET_YUT2,
  291. ET_YUT3,
  292. ET_YUT4,
  293. ET_YUT5,
  294. ET_YUT6,
  295. ET_YUT7,
  296. //
  297. ET_MAX
  298. };
  299. enum clr_type : uint8_t
  300. {
  301. CLR_OUTSIGHT = 0,
  302. CLR_DEAD,
  303. CLR_RESPAWN,
  304. CLR_TELEPORT,
  305. CLR_TRICKDEAD,
  306. };
  307. enum map_property : uint8_t
  308. {// clif_map_property
  309. MAPPROPERTY_NOTHING = 0,
  310. MAPPROPERTY_FREEPVPZONE = 1,
  311. MAPPROPERTY_EVENTPVPZONE = 2,
  312. MAPPROPERTY_AGITZONE = 3,
  313. MAPPROPERTY_PKSERVERZONE = 4, // message "You are in a PK area. Please beware of sudden attacks." in color 0x9B9BFF (light red)
  314. MAPPROPERTY_PVPSERVERZONE = 5,
  315. MAPPROPERTY_DENYSKILLZONE = 6,
  316. };
  317. enum map_type : uint8_t
  318. {// clif_map_type
  319. MAPTYPE_VILLAGE = 0,
  320. MAPTYPE_VILLAGE_IN = 1,
  321. MAPTYPE_FIELD = 2,
  322. MAPTYPE_DUNGEON = 3,
  323. MAPTYPE_ARENA = 4,
  324. MAPTYPE_PENALTY_FREEPKZONE = 5,
  325. MAPTYPE_NOPENALTY_FREEPKZONE = 6,
  326. MAPTYPE_EVENT_GUILDWAR = 7,
  327. MAPTYPE_AGIT = 8,
  328. MAPTYPE_DUNGEON2 = 9,
  329. MAPTYPE_DUNGEON3 = 10,
  330. MAPTYPE_PKSERVER = 11,
  331. MAPTYPE_PVPSERVER = 12,
  332. MAPTYPE_DENYSKILL = 13,
  333. MAPTYPE_TURBOTRACK = 14,
  334. MAPTYPE_JAIL = 15,
  335. MAPTYPE_MONSTERTRACK = 16,
  336. MAPTYPE_PORINGBATTLE = 17,
  337. MAPTYPE_AGIT_SIEGEV15 = 18,
  338. MAPTYPE_BATTLEFIELD = 19,
  339. MAPTYPE_PVP_TOURNAMENT = 20,
  340. //Map types 21 - 24 not used.
  341. MAPTYPE_SIEGE_LOWLEVEL = 25,
  342. //Map types 26 - 28 remains opens for future types.
  343. MAPTYPE_UNUSED = 29,
  344. };
  345. enum useskill_fail_cause : uint8_t
  346. {// clif_skill_fail
  347. USESKILL_FAIL_LEVEL = 0,
  348. USESKILL_FAIL_SP_INSUFFICIENT = 1,
  349. USESKILL_FAIL_HP_INSUFFICIENT = 2,
  350. USESKILL_FAIL_STUFF_INSUFFICIENT = 3,
  351. USESKILL_FAIL_SKILLINTERVAL = 4,
  352. USESKILL_FAIL_MONEY = 5,
  353. USESKILL_FAIL_THIS_WEAPON = 6,
  354. USESKILL_FAIL_REDJAMSTONE = 7,
  355. USESKILL_FAIL_BLUEJAMSTONE = 8,
  356. USESKILL_FAIL_WEIGHTOVER = 9,
  357. USESKILL_FAIL = 10,
  358. USESKILL_FAIL_TOTARGET = 11,
  359. USESKILL_FAIL_ANCILLA_NUMOVER = 12,
  360. USESKILL_FAIL_HOLYWATER = 13,
  361. USESKILL_FAIL_ANCILLA = 14,
  362. USESKILL_FAIL_DUPLICATE_RANGEIN = 15,
  363. USESKILL_FAIL_NEED_OTHER_SKILL = 16,
  364. USESKILL_FAIL_NEED_HELPER = 17,
  365. USESKILL_FAIL_INVALID_DIR = 18,
  366. USESKILL_FAIL_SUMMON = 19,
  367. USESKILL_FAIL_SUMMON_NONE = 20,
  368. USESKILL_FAIL_IMITATION_SKILL_NONE = 21,
  369. USESKILL_FAIL_DUPLICATE = 22,
  370. USESKILL_FAIL_CONDITION = 23,
  371. USESKILL_FAIL_PAINTBRUSH = 24,
  372. USESKILL_FAIL_DRAGON = 25,
  373. USESKILL_FAIL_POS = 26,
  374. USESKILL_FAIL_HELPER_SP_INSUFFICIENT = 27,
  375. USESKILL_FAIL_NEER_WALL = 28,
  376. USESKILL_FAIL_NEED_EXP_1PERCENT = 29,
  377. USESKILL_FAIL_CHORUS_SP_INSUFFICIENT = 30,
  378. USESKILL_FAIL_GC_WEAPONBLOCKING = 31,
  379. USESKILL_FAIL_GC_POISONINGWEAPON = 32,
  380. USESKILL_FAIL_MADOGEAR = 33,
  381. USESKILL_FAIL_NEED_EQUIPMENT_KUNAI = 34,
  382. USESKILL_FAIL_TOTARGET_PLAYER = 35,
  383. USESKILL_FAIL_SIZE = 36,
  384. USESKILL_FAIL_CANONBALL = 37,
  385. //XXX_USESKILL_FAIL_II_MADOGEAR_ACCELERATION = 38,
  386. //XXX_USESKILL_FAIL_II_MADOGEAR_HOVERING_BOOSTER = 39,
  387. USESKILL_FAIL_MADOGEAR_HOVERING = 40,
  388. //XXX_USESKILL_FAIL_II_MADOGEAR_SELFDESTRUCTION_DEVICE = 41,
  389. //XXX_USESKILL_FAIL_II_MADOGEAR_SHAPESHIFTER = 42,
  390. USESKILL_FAIL_GUILLONTINE_POISON = 43,
  391. //XXX_USESKILL_FAIL_II_MADOGEAR_COOLING_DEVICE = 44,
  392. //XXX_USESKILL_FAIL_II_MADOGEAR_MAGNETICFIELD_GENERATOR = 45,
  393. //XXX_USESKILL_FAIL_II_MADOGEAR_BARRIER_GENERATOR = 46,
  394. //XXX_USESKILL_FAIL_II_MADOGEAR_OPTICALCAMOUFLAGE_GENERATOR = 47,
  395. //XXX_USESKILL_FAIL_II_MADOGEAR_REPAIRKIT = 48,
  396. //XXX_USESKILL_FAIL_II_MONKEY_SPANNER = 49,
  397. USESKILL_FAIL_MADOGEAR_RIDE = 50,
  398. USESKILL_FAIL_SPELLBOOK = 51,
  399. USESKILL_FAIL_SPELLBOOK_DIFFICULT_SLEEP = 52,
  400. USESKILL_FAIL_SPELLBOOK_PRESERVATION_POINT = 53,
  401. USESKILL_FAIL_SPELLBOOK_READING = 54,
  402. //XXX_USESKILL_FAIL_II_FACE_PAINTS = 55,
  403. //XXX_USESKILL_FAIL_II_MAKEUP_BRUSH = 56,
  404. USESKILL_FAIL_CART = 57,
  405. //XXX_USESKILL_FAIL_II_THORNS_SEED = 58,
  406. //XXX_USESKILL_FAIL_II_BLOOD_SUCKER_SEED = 59,
  407. USESKILL_FAIL_NO_MORE_SPELL = 60,
  408. //XXX_USESKILL_FAIL_II_BOMB_MUSHROOM_SPORE = 61,
  409. //XXX_USESKILL_FAIL_II_GASOLINE_BOOMB = 62,
  410. //XXX_USESKILL_FAIL_II_OIL_BOTTLE = 63,
  411. //XXX_USESKILL_FAIL_II_EXPLOSION_POWDER = 64,
  412. //XXX_USESKILL_FAIL_II_SMOKE_POWDER = 65,
  413. //XXX_USESKILL_FAIL_II_TEAR_GAS = 66,
  414. //XXX_USESKILL_FAIL_II_HYDROCHLORIC_ACID_BOTTLE = 67,
  415. //XXX_USESKILL_FAIL_II_HELLS_PLANT_BOTTLE = 68,
  416. //XXX_USESKILL_FAIL_II_MANDRAGORA_FLOWERPOT = 69,
  417. USESKILL_FAIL_MANUAL_NOTIFY = 70,
  418. // CAUTION: client uses unidentified display name for displaying the required item. Still broken on 2017-05-31 [Lemongrass]
  419. USESKILL_FAIL_NEED_ITEM = 71,
  420. USESKILL_FAIL_NEED_EQUIPMENT = 72,
  421. USESKILL_FAIL_COMBOSKILL = 73,
  422. USESKILL_FAIL_SPIRITS = 74,
  423. USESKILL_FAIL_EXPLOSIONSPIRITS = 75,
  424. USESKILL_FAIL_HP_TOOMANY = 76,
  425. USESKILL_FAIL_NEED_ROYAL_GUARD_BANDING = 77,
  426. USESKILL_FAIL_NEED_EQUIPPED_WEAPON_CLASS = 78,
  427. USESKILL_FAIL_EL_SUMMON = 79,
  428. USESKILL_FAIL_RELATIONGRADE = 80,
  429. USESKILL_FAIL_STYLE_CHANGE_FIGHTER = 81,
  430. USESKILL_FAIL_STYLE_CHANGE_GRAPPLER = 82,
  431. USESKILL_FAIL_THERE_ARE_NPC_AROUND = 83,
  432. USESKILL_FAIL_NEED_MORE_BULLET = 84,
  433. USESKILL_FAIL_COINS = 85,
  434. USESKILL_FAIL_MAX
  435. };
  436. enum clif_messages : uint16_t {
  437. /* Constant values */
  438. // clif_cart_additem_ack flags
  439. ADDITEM_TO_CART_FAIL_WEIGHT = 0x0,
  440. ADDITEM_TO_CART_FAIL_COUNT = 0x1,
  441. // clif_equipitemack flags
  442. ITEM_EQUIP_ACK_OK = 0,
  443. ITEM_EQUIP_ACK_FAIL = 1,
  444. ITEM_EQUIP_ACK_FAILLEVEL = 2,
  445. /* -end- */
  446. //! NOTE: These values below need client version validation
  447. ITEM_CANT_OBTAIN_WEIGHT = 0x34, /* You cannot carry more items because you are overweight. */
  448. ITEM_NOUSE_SITTING = 0x297,
  449. ITEM_PARTY_MEMBER_NOT_SUMMONED = 0x4c5, ///< "The party member was not summoned because you are not the party leader."
  450. ITEM_PARTY_NO_MEMBER_IN_MAP = 0x4c6, ///< "There is no party member to summon in the current map."
  451. MERC_MSG_BASE = 0x4f2,
  452. SKILL_CANT_USE_AREA = 0x536,
  453. ITEM_CANT_USE_AREA = 0x537,
  454. VIEW_EQUIP_FAIL = 0x54d,
  455. RUNE_CANT_CREATE = 0x61b,
  456. ITEM_CANT_COMBINE = 0x623,
  457. INVENTORY_SPACE_FULL = 0x625,
  458. ITEM_PRODUCE_SUCCESS = 0x627,
  459. ITEM_PRODUCE_FAIL = 0x628,
  460. ITEM_UNIDENTIFIED = 0x62d,
  461. ITEM_REUSE_LIMIT = 0x746,
  462. WORK_IN_PROGRESS = 0x783,
  463. NEED_REINS_OF_MOUNT = 0x78c,
  464. PARTY_MASTER_CHANGE_SAME_MAP = 0x82e, ///< "It is only possible to change the party leader while on the same map."
  465. MERGE_ITEM_NOT_AVAILABLE = 0x887,
  466. GUILD_MASTER_WOE = 0xb93, /// <"Currently in WoE hours, unable to delegate Guild leader"
  467. GUILD_MASTER_DELAY = 0xb94, /// <"You have to wait for one day before delegating a new Guild leader"
  468. SKILL_NEED_GATLING = 0x9fa,
  469. SKILL_NEED_SHOTGUN = 0x9fb,
  470. SKILL_NEED_RIFLE = 0x9fc,
  471. SKILL_NEED_REVOLVER = 0x9fd,
  472. SKILL_NEED_HOLY_BULLET = 0x9fe,
  473. SKILL_NEED_GRENADE = 0xa01,
  474. MSG_ATTENDANCE_DISABLED = 0xd92,
  475. };
  476. enum e_personalinfo : uint8_t {
  477. PINFO_BASIC = 0,
  478. PINFO_PREMIUM,
  479. PINFO_SERVER,
  480. PINFO_CAFE,
  481. PINFO_MAX,
  482. };
  483. enum e_damage_type : uint8_t {
  484. DMG_NORMAL = 0, /// damage [ damage: total damage, div: amount of hits, damage2: assassin dual-wield damage ]
  485. DMG_PICKUP_ITEM, /// pick up item
  486. DMG_SIT_DOWN, /// sit down
  487. DMG_STAND_UP, /// stand up
  488. DMG_ENDURE, /// damage (endure)
  489. DMG_SPLASH, /// (splash?)
  490. DMG_SKILL, /// (skill?)
  491. DMG_REPEAT, /// (repeat damage?)
  492. DMG_MULTI_HIT, /// multi-hit damage
  493. DMG_MULTI_HIT_ENDURE, /// multi-hit damage (endure)
  494. DMG_CRITICAL, /// critical hit
  495. DMG_LUCY_DODGE, /// lucky dodge
  496. DMG_TOUCH, /// (touch skill?)
  497. };
  498. enum e_config_type : uint32 {
  499. CONFIG_OPEN_EQUIPMENT_WINDOW = 0,
  500. // Unknown
  501. CONFIG_PET_AUTOFEED = 2,
  502. CONFIG_HOMUNCULUS_AUTOFEED
  503. };
  504. int clif_setip(const char* ip);
  505. void clif_setbindip(const char* ip);
  506. void clif_setport(uint16 port);
  507. uint32 clif_getip(void);
  508. uint32 clif_refresh_ip(void);
  509. uint16 clif_getport(void);
  510. void clif_authok(struct map_session_data *sd);
  511. void clif_authrefuse(int fd, uint8 error_code);
  512. void clif_authfail_fd(int fd, int type);
  513. void clif_charselectok(int id, uint8 ok);
  514. void clif_dropflooritem(struct flooritem_data* fitem);
  515. void clif_clearflooritem(struct flooritem_data *fitem, int fd);
  516. void clif_clearunit_single(int id, clr_type type, int fd);
  517. void clif_clearunit_area(struct block_list* bl, clr_type type);
  518. void clif_clearunit_delayed(struct block_list* bl, clr_type type, unsigned int tick);
  519. int clif_spawn(struct block_list *bl); //area
  520. void clif_walkok(struct map_session_data *sd); // self
  521. void clif_move(struct unit_data *ud); //area
  522. void clif_changemap(struct map_session_data *sd, short m, int x, int y); //self
  523. void clif_changemapserver(struct map_session_data* sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port); //self
  524. void clif_blown(struct block_list *bl); // area
  525. void clif_slide(struct block_list *bl, int x, int y); // area
  526. void clif_fixpos(struct block_list *bl); // area
  527. void clif_npcbuysell(struct map_session_data* sd, int id); //self
  528. void clif_buylist(struct map_session_data *sd, struct npc_data *nd); //self
  529. void clif_selllist(struct map_session_data *sd); //self
  530. void clif_npc_market_open(struct map_session_data *sd, struct npc_data *nd);
  531. void clif_parse_NPCMarketClosed(int fd, struct map_session_data *sd);
  532. void clif_parse_NPCMarketPurchase(int fd, struct map_session_data *sd);
  533. void clif_scriptmes(struct map_session_data *sd, int npcid, const char *mes); //self
  534. void clif_scriptnext(struct map_session_data *sd,int npcid); //self
  535. void clif_scriptclose(struct map_session_data *sd, int npcid); //self
  536. void clif_scriptclear(struct map_session_data *sd, int npcid); //self
  537. void clif_scriptmenu(struct map_session_data* sd, int npcid, const char* mes); //self
  538. void clif_scriptinput(struct map_session_data *sd, int npcid); //self
  539. void clif_scriptinputstr(struct map_session_data *sd, int npcid); // self
  540. void clif_cutin(struct map_session_data* sd, const char* image, int type); //self
  541. void clif_viewpoint(struct map_session_data *sd, int npc_id, int type, int x, int y, int id, int color); //self
  542. void clif_additem(struct map_session_data *sd, int n, int amount, unsigned char fail); // self
  543. void clif_dropitem(struct map_session_data *sd,int n,int amount); //self
  544. void clif_delitem(struct map_session_data *sd,int n,int amount, short reason); //self
  545. void clif_updatestatus(struct map_session_data *sd,int type); //self
  546. void clif_changestatus(struct map_session_data* sd,int type,int val); //area
  547. int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tick, int sdelay, int ddelay, int64 sdamage, int div, enum e_damage_type type, int64 sdamage2, bool spdamage); // area
  548. void clif_takeitem(struct block_list* src, struct block_list* dst);
  549. void clif_sitting(struct block_list* bl);
  550. void clif_standing(struct block_list* bl);
  551. void clif_sprite_change(struct block_list *bl, int id, int type, int val, int val2, enum send_target target);
  552. void clif_changelook(struct block_list *bl,int type,int val); // area
  553. void clif_changetraplook(struct block_list *bl,int val); // area
  554. void clif_refreshlook(struct block_list *bl,int id,int type,int val,enum send_target target); //area specified in 'target'
  555. void clif_arrowequip(struct map_session_data *sd,int val); //self
  556. void clif_arrow_fail(struct map_session_data *sd,int type); //self
  557. void clif_arrow_create_list(struct map_session_data *sd); //self
  558. void clif_statusupack(struct map_session_data *sd,int type,int ok,int val); // self
  559. void clif_equipitemack(struct map_session_data *sd,int n,int pos,uint8 flag); // self
  560. void clif_unequipitemack(struct map_session_data *sd,int n,int pos,int ok); // self
  561. void clif_misceffect(struct block_list* bl,int type); // area
  562. void clif_changeoption(struct block_list* bl); // area
  563. void clif_changeoption2(struct block_list* bl); // area
  564. void clif_useitemack(struct map_session_data *sd,int index,int amount,bool ok); // self
  565. void clif_GlobalMessage(struct block_list* bl, const char* message,enum send_target target);
  566. void clif_createchat(struct map_session_data* sd, int flag); // self
  567. void clif_dispchat(struct chat_data* cd, int fd); // area or fd
  568. void clif_joinchatfail(struct map_session_data *sd,int flag); // self
  569. void clif_joinchatok(struct map_session_data *sd,struct chat_data* cd); // self
  570. void clif_addchat(struct chat_data* cd,struct map_session_data *sd); // chat
  571. void clif_changechatowner(struct chat_data* cd, struct map_session_data* sd); // chat
  572. void clif_clearchat(struct chat_data *cd,int fd); // area or fd
  573. void clif_leavechat(struct chat_data* cd, struct map_session_data* sd, bool flag); // chat
  574. void clif_changechatstatus(struct chat_data* cd); // chat
  575. void clif_refresh_storagewindow(struct map_session_data *sd);
  576. void clif_refresh(struct map_session_data *sd); // self
  577. void clif_emotion(struct block_list *bl,int type);
  578. void clif_talkiebox(struct block_list* bl, const char* talkie);
  579. void clif_wedding_effect(struct block_list *bl);
  580. void clif_divorced(struct map_session_data* sd, const char* name);
  581. void clif_callpartner(struct map_session_data *sd);
  582. void clif_playBGM(struct map_session_data* sd, const char* name);
  583. void clif_soundeffect(struct map_session_data* sd, struct block_list* bl, const char* name, int type);
  584. void clif_soundeffectall(struct block_list* bl, const char* name, int type, enum send_target coverage);
  585. void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type, int target_id, unsigned int tick);
  586. void clif_parse_LoadEndAck(int fd,struct map_session_data *sd);
  587. void clif_hotkeys_send(struct map_session_data *sd);
  588. // trade
  589. void clif_traderequest(struct map_session_data* sd, const char* name);
  590. void clif_tradestart(struct map_session_data* sd, uint8 type);
  591. void clif_tradeadditem(struct map_session_data* sd, struct map_session_data* tsd, int index, int amount);
  592. void clif_tradeitemok(struct map_session_data* sd, int index, int fail);
  593. void clif_tradedeal_lock(struct map_session_data* sd, int fail);
  594. void clif_tradecancelled(struct map_session_data* sd);
  595. void clif_tradecompleted(struct map_session_data* sd, int fail);
  596. void clif_tradeundo(struct map_session_data* sd);
  597. // storage
  598. void clif_storagelist(struct map_session_data* sd, struct item* items, int items_length, const char *storename);
  599. void clif_updatestorageamount(struct map_session_data* sd, int amount, int max_amount);
  600. void clif_storageitemadded(struct map_session_data* sd, struct item* i, int index, int amount);
  601. void clif_storageitemremoved(struct map_session_data* sd, int index, int amount);
  602. void clif_storageclose(struct map_session_data* sd);
  603. int clif_insight(struct block_list *bl,va_list ap); // map_forallinmovearea callback
  604. int clif_outsight(struct block_list *bl,va_list ap); // map_forallinmovearea callback
  605. void clif_class_change_target(struct block_list *bl,int class_, int type, enum send_target target, struct map_session_data *sd);
  606. #define clif_class_change(bl, class_, type) clif_class_change_target(bl, class_, type, AREA, NULL)
  607. #define clif_mob_class_change(md, class_) clif_class_change(&md->bl, class_, 1)
  608. void clif_skillinfoblock(struct map_session_data *sd);
  609. void clif_skillup(struct map_session_data *sd, uint16 skill_id, int lv, int range, int upgradable);
  610. void clif_skillinfo(struct map_session_data *sd,int skill_id, int inf);
  611. void clif_addskill(struct map_session_data *sd, int skill_id);
  612. void clif_deleteskill(struct map_session_data *sd, int skill_id);
  613. void clif_skillcasting(struct block_list* bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, int property, int casttime);
  614. void clif_skillcastcancel(struct block_list* bl);
  615. void clif_skill_fail(struct map_session_data *sd,uint16 skill_id,enum useskill_fail_cause cause,int btype);
  616. void clif_skill_cooldown(struct map_session_data *sd, uint16 skill_id, unsigned int tick);
  617. int clif_skill_damage(struct block_list *src,struct block_list *dst,unsigned int tick,int sdelay,int ddelay,int64 sdamage,int div,uint16 skill_id,uint16 skill_lv,enum e_damage_type type);
  618. //int clif_skill_damage2(struct block_list *src,struct block_list *dst,unsigned int tick,int sdelay,int ddelay,int damage,int div,uint16 skill_id,uint16 skill_lv,enum e_damage_type type);
  619. int clif_skill_nodamage(struct block_list *src,struct block_list *dst,uint16 skill_id,int heal,int fail);
  620. void clif_skill_poseffect(struct block_list *src,uint16 skill_id,int val,int x,int y,int tick);
  621. void clif_skill_estimation(struct map_session_data *sd,struct block_list *dst);
  622. void clif_skill_warppoint(struct map_session_data* sd, uint16 skill_id, uint16 skill_lv, unsigned short map1, unsigned short map2, unsigned short map3, unsigned short map4);
  623. void clif_skill_memomessage(struct map_session_data* sd, int type);
  624. void clif_skill_teleportmessage(struct map_session_data *sd, int type);
  625. void clif_skill_produce_mix_list(struct map_session_data *sd, int skill_id, int trigger);
  626. void clif_cooking_list(struct map_session_data *sd, int trigger, uint16 skill_id, int qty, int list_type);
  627. void clif_produceeffect(struct map_session_data* sd,int flag, unsigned short nameid);
  628. void clif_getareachar_skillunit(struct block_list *bl, struct skill_unit *unit, enum send_target target, bool visible);
  629. void clif_skill_delunit(struct skill_unit *unit);
  630. void clif_skillunit_update(struct block_list* bl);
  631. void clif_autospell(struct map_session_data *sd,uint16 skill_lv);
  632. void clif_devotion(struct block_list *src, struct map_session_data *tsd);
  633. void clif_spiritball(struct block_list *bl);
  634. void clif_combo_delay(struct block_list *bl,int wait);
  635. void clif_bladestop(struct block_list *src, int dst_id, int active);
  636. void clif_changemapcell(int fd, int16 m, int x, int y, int type, enum send_target target);
  637. #define clif_status_load(bl, type, flag) clif_status_change((bl), (type), (flag), 0, 0, 0, 0)
  638. void clif_status_change(struct block_list *bl, int type, int flag, int tick, int val1, int val2, int val3);
  639. void clif_efst_status_change(struct block_list *bl, int tid, enum send_target target, int type, int tick, int val1, int val2, int val3);
  640. void clif_efst_status_change_sub(struct block_list *tbl, struct block_list *bl, enum send_target target);
  641. void clif_wis_message(struct map_session_data* sd, const char* nick, const char* mes, int mes_len, int gmlvl);
  642. void clif_wis_end(int fd, int result);
  643. void clif_solved_charname(int fd, int charid, const char* name);
  644. void clif_name( struct block_list* src, struct block_list *bl, send_target target );
  645. #define clif_name_self(bl) clif_name( (bl), (bl), SELF )
  646. #define clif_name_area(bl) clif_name( (bl), (bl), AREA )
  647. void clif_use_card(struct map_session_data *sd,int idx);
  648. void clif_insert_card(struct map_session_data *sd,int idx_equip,int idx_card,int flag);
  649. void clif_inventorylist(struct map_session_data *sd);
  650. void clif_equiplist(struct map_session_data *sd);
  651. void clif_cart_additem(struct map_session_data *sd,int n,int amount,int fail);
  652. void clif_cart_additem_ack(struct map_session_data *sd, uint8 flag);
  653. void clif_cart_delitem(struct map_session_data *sd,int n,int amount);
  654. void clif_cartlist(struct map_session_data *sd);
  655. void clif_clearcart(int fd);
  656. void clif_item_identify_list(struct map_session_data *sd);
  657. void clif_item_identified(struct map_session_data *sd,int idx,int flag);
  658. void clif_item_repair_list(struct map_session_data *sd, struct map_session_data *dstsd, int lv);
  659. void clif_item_repaireffect(struct map_session_data *sd, int idx, int flag);
  660. void clif_item_damaged(struct map_session_data* sd, unsigned short position);
  661. void clif_item_refine_list(struct map_session_data *sd);
  662. void clif_hat_effects( struct map_session_data* sd, struct block_list* bl, enum send_target target );
  663. void clif_hat_effect_single( struct map_session_data* sd, uint16 effectId, bool enable );
  664. void clif_item_skill(struct map_session_data *sd,uint16 skill_id,uint16 skill_lv);
  665. void clif_mvp_effect(struct map_session_data *sd);
  666. void clif_mvp_item(struct map_session_data *sd, unsigned short nameid);
  667. void clif_mvp_exp(struct map_session_data *sd, unsigned int exp);
  668. void clif_mvp_noitem(struct map_session_data* sd);
  669. void clif_changed_dir(struct block_list *bl, enum send_target target);
  670. // vending
  671. void clif_openvendingreq(struct map_session_data* sd, int num);
  672. void clif_showvendingboard(struct block_list* bl, const char* message, int fd);
  673. void clif_closevendingboard(struct block_list* bl, int fd);
  674. void clif_vendinglist(struct map_session_data* sd, int id, struct s_vending* vending);
  675. void clif_buyvending(struct map_session_data* sd, int index, int amount, int fail);
  676. void clif_openvending(struct map_session_data* sd, int id, struct s_vending* vending);
  677. void clif_vendingreport(struct map_session_data* sd, int index, int amount, uint32 char_id, int zeny);
  678. void clif_movetoattack(struct map_session_data *sd,struct block_list *bl);
  679. // party
  680. void clif_party_created(struct map_session_data *sd,int result);
  681. void clif_party_member_info(struct party_data *p, struct map_session_data *sd);
  682. void clif_party_info(struct party_data* p, struct map_session_data *sd);
  683. void clif_party_invite(struct map_session_data *sd,struct map_session_data *tsd);
  684. void clif_party_invite_reply(struct map_session_data* sd, const char* nick, enum e_party_invite_reply reply);
  685. void clif_party_option(struct party_data *p,struct map_session_data *sd,int flag);
  686. void clif_party_withdraw(struct map_session_data *sd, uint32 account_id, const char* name, enum e_party_member_withdraw result, enum send_target target);
  687. void clif_party_message(struct party_data* p, uint32 account_id, const char* mes, int len);
  688. void clif_party_xy(struct map_session_data *sd);
  689. void clif_party_xy_single(int fd, struct map_session_data *sd);
  690. void clif_party_hp(struct map_session_data *sd);
  691. void clif_hpmeter_single(int fd, int id, unsigned int hp, unsigned int maxhp);
  692. void clif_party_job_and_level(struct map_session_data *sd);
  693. void clif_party_dead( struct map_session_data *sd );
  694. // guild
  695. void clif_guild_created(struct map_session_data *sd,int flag);
  696. void clif_guild_belonginfo(struct map_session_data *sd);
  697. void clif_guild_masterormember(struct map_session_data *sd);
  698. void clif_guild_basicinfo(struct map_session_data *sd);
  699. void clif_guild_allianceinfo(struct map_session_data *sd);
  700. void clif_guild_memberlist(struct map_session_data *sd);
  701. void clif_guild_skillinfo(struct map_session_data* sd);
  702. void clif_guild_send_onlineinfo(struct map_session_data *sd); //[LuzZza]
  703. void clif_guild_memberlogin_notice(struct guild *g,int idx,int flag);
  704. void clif_guild_invite(struct map_session_data *sd,struct guild *g);
  705. void clif_guild_inviteack(struct map_session_data *sd,int flag);
  706. void clif_guild_leave(struct map_session_data *sd,const char *name,const char *mes);
  707. void clif_guild_expulsion(struct map_session_data* sd, const char* name, const char* mes, uint32 account_id);
  708. void clif_guild_positionchanged(struct guild *g,int idx);
  709. void clif_guild_memberpositionchanged(struct guild *g,int idx);
  710. void clif_guild_emblem(struct map_session_data *sd,struct guild *g);
  711. void clif_guild_emblem_area(struct block_list* bl);
  712. void clif_guild_notice(struct map_session_data* sd);
  713. void clif_guild_message(struct guild *g,uint32 account_id,const char *mes,int len);
  714. void clif_guild_reqalliance(struct map_session_data *sd,uint32 account_id,const char *name);
  715. void clif_guild_allianceack(struct map_session_data *sd,int flag);
  716. void clif_guild_delalliance(struct map_session_data *sd,int guild_id,int flag);
  717. void clif_guild_oppositionack(struct map_session_data *sd,int flag);
  718. void clif_guild_broken(struct map_session_data *sd,int flag);
  719. void clif_guild_xy(struct map_session_data *sd);
  720. void clif_guild_xy_single(int fd, struct map_session_data *sd);
  721. void clif_guild_xy_remove(struct map_session_data *sd);
  722. // Battleground
  723. void clif_bg_hp(struct map_session_data *sd);
  724. void clif_bg_xy(struct map_session_data *sd);
  725. void clif_bg_xy_remove(struct map_session_data *sd);
  726. void clif_bg_message(struct battleground_data *bg, int src_id, const char *name, const char *mes, int len);
  727. void clif_bg_updatescore(int16 m);
  728. void clif_bg_updatescore_single(struct map_session_data *sd);
  729. void clif_sendbgemblem_area(struct map_session_data *sd);
  730. void clif_sendbgemblem_single(int fd, struct map_session_data *sd);
  731. // Instancing
  732. void clif_instance_create(unsigned short instance_id, int num);
  733. void clif_instance_changewait(unsigned short instance_id, int num);
  734. void clif_instance_status(unsigned short instance_id, unsigned int limit1, unsigned int limit2);
  735. void clif_instance_changestatus(unsigned int instance_id, int type, unsigned int limit);
  736. // Custom Fonts
  737. void clif_font(struct map_session_data *sd);
  738. // atcommand
  739. void clif_displaymessage(const int fd, const char* mes);
  740. void clif_disp_message(struct block_list* src, const char* mes, int len, enum send_target target);
  741. void clif_broadcast(struct block_list* bl, const char* mes, int len, int type, enum send_target target);
  742. void clif_broadcast2(struct block_list* bl, const char* mes, int len, unsigned long fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target);
  743. void clif_heal(int fd,int type,int val);
  744. void clif_resurrection(struct block_list *bl,int type);
  745. void clif_map_property(struct block_list *bl, enum map_property property, enum send_target t);
  746. void clif_pvpset(struct map_session_data *sd, int pvprank, int pvpnum,int type);
  747. void clif_map_property_mapall(int map, enum map_property property);
  748. void clif_refine(int fd, int fail, int index, int val);
  749. void clif_upgrademessage(int fd, int result, unsigned short item_id);
  750. //petsystem
  751. void clif_catch_process(struct map_session_data *sd);
  752. void clif_pet_roulette(struct map_session_data *sd,int data);
  753. void clif_sendegg(struct map_session_data *sd);
  754. void clif_send_petstatus(struct map_session_data *sd);
  755. void clif_send_petdata(struct map_session_data* sd, struct pet_data* pd, int type, int param);
  756. #define clif_pet_equip(sd, pd) clif_send_petdata(sd, pd, 3, (pd)->vd.head_bottom)
  757. #define clif_pet_equip_area(pd) clif_send_petdata(NULL, pd, 3, (pd)->vd.head_bottom)
  758. #define clif_pet_performance(pd, param) clif_send_petdata(NULL, pd, 4, param)
  759. void clif_pet_emotion(struct pet_data *pd,int param);
  760. void clif_pet_food(struct map_session_data *sd,int foodid,int fail);
  761. //friends list
  762. int clif_friendslist_toggle_sub(struct map_session_data *sd,va_list ap);
  763. void clif_friendslist_send(struct map_session_data *sd);
  764. void clif_friendslist_reqack(struct map_session_data *sd, struct map_session_data *f_sd, int type);
  765. void clif_weather(int16 m); // [Valaris]
  766. void clif_specialeffect(struct block_list* bl, int type, enum send_target target); // special effects [Valaris]
  767. void clif_specialeffect_single(struct block_list* bl, int type, int fd);
  768. void clif_messagecolor_target(struct block_list *bl, unsigned long color, const char *msg, bool rgb2bgr, enum send_target type, struct map_session_data *sd);
  769. #define clif_messagecolor(bl, color, msg, rgb2bgr, type) clif_messagecolor_target(bl, color, msg, rgb2bgr, type, NULL) // Mob/Npc color talk [SnakeDrak]
  770. void clif_specialeffect_value(struct block_list* bl, int effect_id, int num, send_target target);
  771. void clif_GM_kickack(struct map_session_data *sd, int id);
  772. void clif_GM_kick(struct map_session_data *sd,struct map_session_data *tsd);
  773. void clif_manner_message(struct map_session_data* sd, uint32 type);
  774. void clif_GM_silence(struct map_session_data* sd, struct map_session_data* tsd, uint8 type);
  775. void clif_disp_overhead_(struct block_list *bl, const char* mes, enum send_target flag);
  776. #define clif_disp_overhead(bl, mes) clif_disp_overhead_(bl, mes, AREA)
  777. void clif_get_weapon_view(struct map_session_data* sd, unsigned short *rhand, unsigned short *lhand);
  778. void clif_party_xy_remove(struct map_session_data *sd); //Fix for minimap [Kevin]
  779. void clif_gospel_info(struct map_session_data *sd, int type);
  780. void clif_feel_req(int fd, struct map_session_data *sd, uint16 skill_lv);
  781. void clif_starskill(struct map_session_data* sd, const char* mapname, int monster_id, unsigned char star, unsigned char result);
  782. void clif_feel_info(struct map_session_data* sd, unsigned char feel_level, unsigned char type);
  783. void clif_hate_info(struct map_session_data *sd, unsigned char hate_level,int class_, unsigned char type);
  784. void clif_mission_info(struct map_session_data *sd, int mob_id, unsigned char progress);
  785. void clif_feel_hate_reset(struct map_session_data *sd);
  786. // [blackhole89]
  787. void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag);
  788. int clif_homskillinfoblock(struct map_session_data *sd);
  789. void clif_homskillup(struct map_session_data *sd, uint16 skill_id); //[orn]
  790. int clif_hom_food(struct map_session_data *sd,int foodid,int fail); //[orn]
  791. void clif_send_homdata(struct map_session_data *sd, int state, int param); //[orn]
  792. void clif_configuration( struct map_session_data* sd, enum e_config_type type, bool enabled );
  793. void clif_partytickack(struct map_session_data* sd, bool flag);
  794. void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* tsd);
  795. void clif_equipcheckbox(struct map_session_data* sd);
  796. void clif_msg(struct map_session_data* sd, unsigned short id);
  797. void clif_msg_value(struct map_session_data* sd, unsigned short id, int value);
  798. void clif_msg_skill(struct map_session_data* sd, uint16 skill_id, int msg_id);
  799. //quest system [Kevin] [Inkfish]
  800. void clif_quest_send_list(struct map_session_data * sd);
  801. void clif_quest_send_mission(struct map_session_data * sd);
  802. void clif_quest_add(struct map_session_data * sd, struct quest * qd);
  803. void clif_quest_delete(struct map_session_data * sd, int quest_id);
  804. void clif_quest_update_status(struct map_session_data * sd, int quest_id, bool active);
  805. void clif_quest_update_objective(struct map_session_data * sd, struct quest * qd, int mobid);
  806. void clif_quest_show_event(struct map_session_data *sd, struct block_list *bl, short state, short color);
  807. void clif_displayexp(struct map_session_data *sd, unsigned int exp, char type, bool quest, bool lost);
  808. int clif_send(const uint8* buf, int len, struct block_list* bl, enum send_target type);
  809. void do_init_clif(void);
  810. void do_final_clif(void);
  811. // MAIL SYSTEM
  812. enum mail_send_result : uint8_t {
  813. WRITE_MAIL_SUCCESS = 0x0,
  814. WRITE_MAIL_FAILED = 0x1,
  815. WRITE_MAIL_FAILED_CNT = 0x2,
  816. WRITE_MAIL_FAILED_ITEM = 0x3,
  817. WRITE_MAIL_FAILED_CHECK_CHARACTER_NAME = 0x4,
  818. WRITE_MAIL_FAILED_WHISPEREXREGISTER = 0x5,
  819. };
  820. void clif_Mail_window(int fd, int flag);
  821. void clif_Mail_read(struct map_session_data *sd, int mail_id);
  822. void clif_mail_delete(struct map_session_data* sd, struct mail_message *msg, bool success);
  823. void clif_Mail_return(int fd, int mail_id, short fail);
  824. void clif_Mail_send(struct map_session_data* sd, enum mail_send_result result);
  825. void clif_Mail_new(struct map_session_data* sd, int mail_id, const char *sender, const char *title);
  826. void clif_Mail_refreshinbox(struct map_session_data *sd,enum mail_inbox_type type,int64 mailID);
  827. void clif_mail_getattachment(struct map_session_data* sd, struct mail_message *msg, uint8 result, enum mail_attachment_type type);
  828. void clif_Mail_Receiver_Ack(struct map_session_data* sd, uint32 char_id, short class_, uint32 level, const char* name);
  829. void clif_mail_removeitem(struct map_session_data* sd, bool success, int index, int amount);
  830. // AUCTION SYSTEM
  831. void clif_Auction_openwindow(struct map_session_data *sd);
  832. void clif_Auction_results(struct map_session_data *sd, short count, short pages, uint8 *buf);
  833. void clif_Auction_message(int fd, unsigned char flag);
  834. void clif_Auction_close(int fd, unsigned char flag);
  835. void clif_parse_Auction_cancelreg(int fd, struct map_session_data *sd);
  836. void clif_bossmapinfo(struct map_session_data *sd, struct mob_data *md, enum e_bossmap_info flag);
  837. void clif_cashshop_show(struct map_session_data *sd, struct npc_data *nd);
  838. // ADOPTION
  839. void clif_Adopt_reply(struct map_session_data *sd, int type);
  840. void clif_Adopt_request(struct map_session_data *sd, struct map_session_data *src, int p_id);
  841. // MERCENARIES
  842. void clif_mercenary_info(struct map_session_data *sd);
  843. void clif_mercenary_skillblock(struct map_session_data *sd);
  844. void clif_mercenary_message(struct map_session_data* sd, int message);
  845. void clif_mercenary_updatestatus(struct map_session_data *sd, int type);
  846. // RENTAL SYSTEM
  847. void clif_rental_time(int fd, unsigned short nameid, int seconds);
  848. void clif_rental_expired(int fd, int index, unsigned short nameid);
  849. // BOOK READING
  850. void clif_readbook(int fd, int book_id, int page);
  851. // Show Picker
  852. void clif_party_show_picker(struct map_session_data * sd, struct item * item_data);
  853. // Progress Bar [Inkfish]
  854. void clif_progressbar(struct map_session_data * sd, unsigned long color, unsigned int second);
  855. void clif_progressbar_abort(struct map_session_data * sd);
  856. void clif_progressbar_npc(struct npc_data *nd, struct map_session_data* sd);
  857. #define clif_progressbar_npc_area(nd) clif_progressbar_npc((nd),NULL)
  858. void clif_PartyBookingRegisterAck(struct map_session_data *sd, int flag);
  859. void clif_PartyBookingDeleteAck(struct map_session_data* sd, int flag);
  860. void clif_PartyBookingSearchAck(int fd, struct party_booking_ad_info** results, int count, bool more_result);
  861. void clif_PartyBookingUpdateNotify(struct map_session_data* sd, struct party_booking_ad_info* pb_ad);
  862. void clif_PartyBookingDeleteNotify(struct map_session_data* sd, int index);
  863. void clif_PartyBookingInsertNotify(struct map_session_data* sd, struct party_booking_ad_info* pb_ad);
  864. /* Bank System [Yommy/Hercules] */
  865. void clif_bank_deposit (struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK reason);
  866. void clif_bank_withdraw (struct map_session_data *sd,enum e_BANKING_WITHDRAW_ACK reason);
  867. void clif_parse_BankDeposit (int fd, struct map_session_data *sd);
  868. void clif_parse_BankWithdraw (int fd, struct map_session_data *sd);
  869. void clif_parse_BankCheck (int fd, struct map_session_data *sd);
  870. void clif_parse_BankOpen (int fd, struct map_session_data *sd);
  871. void clif_parse_BankClose (int fd, struct map_session_data *sd);
  872. void clif_showdigit(struct map_session_data* sd, unsigned char type, int value);
  873. /// Buying Store System
  874. void clif_buyingstore_open(struct map_session_data* sd);
  875. void clif_buyingstore_open_failed(struct map_session_data* sd, unsigned short result, unsigned int weight);
  876. void clif_buyingstore_myitemlist(struct map_session_data* sd);
  877. void clif_buyingstore_entry(struct map_session_data* sd);
  878. void clif_buyingstore_entry_single(struct map_session_data* sd, struct map_session_data* pl_sd);
  879. void clif_buyingstore_disappear_entry(struct map_session_data* sd);
  880. void clif_buyingstore_disappear_entry_single(struct map_session_data* sd, struct map_session_data* pl_sd);
  881. void clif_buyingstore_itemlist(struct map_session_data* sd, struct map_session_data* pl_sd);
  882. void clif_buyingstore_trade_failed_buyer(struct map_session_data* sd, short result);
  883. void clif_buyingstore_update_item(struct map_session_data* sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny);
  884. void clif_buyingstore_delete_item(struct map_session_data* sd, short index, unsigned short amount, int price);
  885. void clif_buyingstore_trade_failed_seller(struct map_session_data* sd, short result, unsigned short nameid);
  886. /// Search Store System
  887. void clif_search_store_info_ack(struct map_session_data* sd);
  888. void clif_search_store_info_failed(struct map_session_data* sd, unsigned char reason);
  889. void clif_open_search_store_info(struct map_session_data* sd);
  890. void clif_search_store_info_click_ack(struct map_session_data* sd, short x, short y);
  891. /// Cash Shop
  892. void clif_cashshop_result( struct map_session_data* sd, unsigned short item_id, uint16 result );
  893. void clif_cashshop_open( struct map_session_data* sd );
  894. void clif_display_pinfo(struct map_session_data *sd, int type);
  895. /// Roulette
  896. void clif_roulette_open(struct map_session_data* sd);
  897. void clif_parse_roulette_open(int fd, struct map_session_data *sd);
  898. void clif_parse_roulette_info(int fd, struct map_session_data *sd);
  899. void clif_parse_roulette_close(int fd, struct map_session_data *sd);
  900. void clif_parse_roulette_generate(int fd, struct map_session_data *sd);
  901. void clif_parse_roulette_item(int fd, struct map_session_data *sd);
  902. int clif_elementalconverter_list(struct map_session_data *sd);
  903. void clif_millenniumshield(struct block_list *bl, short shields);
  904. int clif_spellbook_list(struct map_session_data *sd);
  905. int clif_magicdecoy_list(struct map_session_data *sd, uint16 skill_lv, short x, short y);
  906. int clif_poison_list(struct map_session_data *sd, uint16 skill_lv);
  907. int clif_autoshadowspell_list(struct map_session_data *sd);
  908. int clif_skill_itemlistwindow( struct map_session_data *sd, uint16 skill_id, uint16 skill_lv );
  909. void clif_elemental_info(struct map_session_data *sd);
  910. void clif_elemental_updatestatus(struct map_session_data *sd, int type);
  911. void clif_spiritcharm(struct map_session_data *sd);
  912. void clif_snap( struct block_list *bl, short x, short y );
  913. void clif_monster_hp_bar( struct mob_data* md, int fd );
  914. // Clan System
  915. void clif_clan_basicinfo( struct map_session_data *sd );
  916. void clif_clan_message(struct clan *clan,const char *mes,int len);
  917. void clif_clan_onlinecount( struct clan* clan );
  918. void clif_clan_leave( struct map_session_data* sd );
  919. // Bargain Tool
  920. void clif_sale_start(struct sale_item_data* sale_item, struct block_list* bl, enum send_target target);
  921. void clif_sale_end(struct sale_item_data* sale_item, struct block_list* bl, enum send_target target);
  922. void clif_sale_amount(struct sale_item_data* sale_item, struct block_list* bl, enum send_target target);
  923. void clif_sale_open(struct map_session_data* sd);
  924. /**
  925. * Color Table
  926. **/
  927. enum clif_colors {
  928. COLOR_DEFAULT,
  929. COLOR_RED,
  930. COLOR_WHITE,
  931. COLOR_YELLOW,
  932. COLOR_CYAN,
  933. COLOR_LIGHT_GREEN,
  934. COLOR_MAX
  935. };
  936. extern unsigned long color_table[COLOR_MAX];
  937. void clif_channel_msg(struct Channel *channel, const char *msg, unsigned long color);
  938. #define clif_menuskill_clear(sd) (sd)->menuskill_id = (sd)->menuskill_val = (sd)->menuskill_val2 = 0;
  939. void clif_ranklist(struct map_session_data *sd, int16 rankingType);
  940. void clif_update_rankingpoint(struct map_session_data *sd, int rankingtype, int point);
  941. void clif_crimson_marker(struct map_session_data *sd, struct block_list *bl, bool remove);
  942. void clif_showscript(struct block_list* bl, const char* message, enum send_target flag);
  943. void clif_party_leaderchanged(struct map_session_data *sd, int prev_leader_aid, int new_leader_aid);
  944. void clif_account_name(int fd, uint32 account_id, const char* accname);
  945. void clif_notify_bindOnEquip(struct map_session_data *sd, int n);
  946. void clif_merge_item_open(struct map_session_data *sd);
  947. void clif_broadcast_obtain_special_item(const char *char_name, unsigned short nameid, unsigned short container, enum BROADCASTING_SPECIAL_ITEM_OBTAIN type);
  948. void clif_dressing_room(struct map_session_data *sd, int flag);
  949. void clif_navigateTo(struct map_session_data *sd, const char* mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id );
  950. void clif_SelectCart(struct map_session_data *sd);
  951. /// Achievement System
  952. void clif_achievement_list_all(struct map_session_data *sd);
  953. void clif_achievement_update(struct map_session_data *sd, struct achievement *ach, int count);
  954. void clif_achievement_reward_ack(int fd, unsigned char result, int ach_id);
  955. /// Attendance System
  956. enum in_ui_type : int8 {
  957. IN_UI_ATTENDANCE = 5
  958. };
  959. enum out_ui_type : int8 {
  960. OUT_UI_ATTENDANCE = 7
  961. };
  962. void clif_ui_open( struct map_session_data *sd, enum out_ui_type ui_type, int32 data );
  963. void clif_attendence_response( struct map_session_data *sd, int32 data );
  964. void clif_weight_limit( struct map_session_data* sd );
  965. #endif /* CLIF_HPP */