clif.hpp 51 KB

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