clif.h 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840
  1. // Copyright (c) Athena Dev Teams - Licensed under GNU GPL
  2. // For more information, see LICENCE in the main folder
  3. #ifndef _CLIF_H_
  4. #define _CLIF_H_
  5. #include "../common/cbasetypes.h"
  6. #include "../common/db.h" //dbmap
  7. //#include "../common/mmo.h"
  8. struct Channel;
  9. struct item;
  10. struct storage_data;
  11. struct guild_storage;
  12. //#include "map.h"
  13. struct block_list;
  14. struct unit_data;
  15. struct map_session_data;
  16. struct homun_data;
  17. struct pet_data;
  18. struct mob_data;
  19. struct npc_data;
  20. struct chat_data;
  21. struct flooritem_data;
  22. struct skill_unit;
  23. struct s_vending;
  24. struct party;
  25. struct party_data;
  26. struct guild;
  27. struct battleground_data;
  28. struct quest;
  29. struct party_booking_ad_info;
  30. #include <stdarg.h>
  31. enum
  32. {// packet DB
  33. MAX_PACKET_DB = 0xf00,
  34. MAX_PACKET_VER = 45,
  35. MAX_PACKET_POS = 20,
  36. };
  37. enum e_packet_ack {
  38. ZC_ACK_OPEN_BANKING = 0,
  39. ZC_ACK_BANKING_DEPOSIT,
  40. ZC_ACK_BANKING_WITHDRAW,
  41. ZC_BANKING_CHECK,
  42. ZC_PERSONAL_INFOMATION,
  43. ZC_PERSONAL_INFOMATION_CHN,
  44. ZC_CLEAR_DIALOG,
  45. //add otehr here
  46. MAX_ACK_FUNC //auto upd len
  47. };
  48. struct s_packet_db {
  49. short len;
  50. void (*func)(int, struct map_session_data *);
  51. short pos[MAX_PACKET_POS];
  52. };
  53. enum e_BANKING_DEPOSIT_ACK {
  54. BDA_SUCCESS = 0x0,
  55. BDA_ERROR = 0x1,
  56. BDA_NO_MONEY = 0x2,
  57. BDA_OVERFLOW = 0x3,
  58. };
  59. enum e_BANKING_WITHDRAW_ACK {
  60. BWA_SUCCESS = 0x0,
  61. BWA_NO_MONEY = 0x1,
  62. BWA_UNKNOWN_ERROR = 0x2,
  63. };
  64. // packet_db[SERVER] is reserved for server use
  65. #define SERVER 0
  66. #define packet_len(cmd) packet_db[SERVER][cmd].len
  67. extern struct s_packet_db packet_db[MAX_PACKET_VER+1][MAX_PACKET_DB+1];
  68. extern int packet_db_ack[MAX_PACKET_VER + 1][MAX_ACK_FUNC + 1];
  69. // local define
  70. typedef enum send_target {
  71. ALL_CLIENT,
  72. ALL_SAMEMAP,
  73. AREA, // area
  74. AREA_WOS, // area, without self
  75. AREA_WOC, // area, without chatrooms
  76. AREA_WOSC, // area, without own chatroom
  77. AREA_CHAT_WOC, // hearable area, without chatrooms
  78. CHAT, // current chatroom
  79. CHAT_WOS, // current chatroom, without self
  80. PARTY,
  81. PARTY_WOS,
  82. PARTY_SAMEMAP,
  83. PARTY_SAMEMAP_WOS,
  84. PARTY_AREA,
  85. PARTY_AREA_WOS,
  86. GUILD,
  87. GUILD_WOS,
  88. GUILD_SAMEMAP,
  89. GUILD_SAMEMAP_WOS,
  90. GUILD_AREA,
  91. GUILD_AREA_WOS,
  92. GUILD_NOBG,
  93. DUEL,
  94. DUEL_WOS,
  95. SELF,
  96. BG, // BattleGround System
  97. BG_WOS,
  98. BG_SAMEMAP,
  99. BG_SAMEMAP_WOS,
  100. BG_AREA,
  101. BG_AREA_WOS,
  102. } send_target;
  103. typedef enum emotion_type {
  104. E_GASP = 0, // /!
  105. E_WHAT, // /?
  106. E_HO,
  107. E_LV,
  108. E_SWT,
  109. E_IC,
  110. E_AN,
  111. E_AG,
  112. E_CASH, // /$
  113. E_DOTS, // /...
  114. E_SCISSORS, // /gawi --- 10
  115. E_ROCK, // /bawi
  116. E_PAPER, // /bo
  117. E_KOREA,
  118. E_LV2,
  119. E_THX,
  120. E_WAH,
  121. E_SRY,
  122. E_HEH,
  123. E_SWT2,
  124. E_HMM, // --- 20
  125. E_NO1,
  126. E_NO, // /??
  127. E_OMG,
  128. E_OH,
  129. E_X,
  130. E_HLP,
  131. E_GO,
  132. E_SOB,
  133. E_GG,
  134. E_KIS, // --- 30
  135. E_KIS2,
  136. E_PIF,
  137. E_OK,
  138. E_MUTE, // red /... used for muted characters
  139. E_INDONESIA,
  140. E_BZZ, // /bzz, /stare
  141. E_RICE,
  142. E_AWSM, // /awsm, /cool
  143. E_MEH,
  144. E_SHY, // --- 40
  145. E_PAT, // /pat, /goodboy
  146. E_MP, // /mp, /sptime
  147. E_SLUR,
  148. E_COM, // /com, /comeon
  149. E_YAWN, // /yawn, /sleepy
  150. E_GRAT, // /grat, /congrats
  151. E_HP, // /hp, /hptime
  152. E_PHILIPPINES,
  153. E_MALAYSIA,
  154. E_SINGAPORE, // --- 50
  155. E_BRAZIL,
  156. E_FLASH, // /fsh
  157. E_SPIN, // /spin
  158. E_SIGH,
  159. E_DUM, // /dum
  160. E_LOUD, // /crwd
  161. E_OTL, // /otl, /desp
  162. E_DICE1,
  163. E_DICE2,
  164. E_DICE3, // --- 60
  165. E_DICE4,
  166. E_DICE5,
  167. E_DICE6,
  168. E_INDIA,
  169. E_LUV, // /love
  170. E_RUSSIA,
  171. E_VIRGIN,
  172. E_MOBILE,
  173. E_MAIL,
  174. E_CHINESE, // --- 70
  175. E_ANTENNA1,
  176. E_ANTENNA2,
  177. E_ANTENNA3,
  178. E_HUM,
  179. E_ABS,
  180. E_OOPS,
  181. E_SPIT,
  182. E_ENE,
  183. E_PANIC,
  184. E_WHISP, // --- 80
  185. E_YUT1,
  186. E_YUT2,
  187. E_YUT3,
  188. E_YUT4,
  189. E_YUT5,
  190. E_YUT6,
  191. E_YUT7,
  192. //
  193. E_MAX
  194. } emotion_type;
  195. typedef enum clr_type
  196. {
  197. CLR_OUTSIGHT = 0,
  198. CLR_DEAD,
  199. CLR_RESPAWN,
  200. CLR_TELEPORT,
  201. CLR_TRICKDEAD,
  202. } clr_type;
  203. enum map_property
  204. {// clif_map_property
  205. MAPPROPERTY_NOTHING = 0,
  206. MAPPROPERTY_FREEPVPZONE = 1,
  207. MAPPROPERTY_EVENTPVPZONE = 2,
  208. MAPPROPERTY_AGITZONE = 3,
  209. MAPPROPERTY_PKSERVERZONE = 4, // message "You are in a PK area. Please beware of sudden attacks." in color 0x9B9BFF (light red)
  210. MAPPROPERTY_PVPSERVERZONE = 5,
  211. MAPPROPERTY_DENYSKILLZONE = 6,
  212. };
  213. enum map_type
  214. {// clif_map_type
  215. MAPTYPE_VILLAGE = 0,
  216. MAPTYPE_VILLAGE_IN = 1,
  217. MAPTYPE_FIELD = 2,
  218. MAPTYPE_DUNGEON = 3,
  219. MAPTYPE_ARENA = 4,
  220. MAPTYPE_PENALTY_FREEPKZONE = 5,
  221. MAPTYPE_NOPENALTY_FREEPKZONE = 6,
  222. MAPTYPE_EVENT_GUILDWAR = 7,
  223. MAPTYPE_AGIT = 8,
  224. MAPTYPE_DUNGEON2 = 9,
  225. MAPTYPE_DUNGEON3 = 10,
  226. MAPTYPE_PKSERVER = 11,
  227. MAPTYPE_PVPSERVER = 12,
  228. MAPTYPE_DENYSKILL = 13,
  229. MAPTYPE_TURBOTRACK = 14,
  230. MAPTYPE_JAIL = 15,
  231. MAPTYPE_MONSTERTRACK = 16,
  232. MAPTYPE_PORINGBATTLE = 17,
  233. MAPTYPE_AGIT_SIEGEV15 = 18,
  234. MAPTYPE_BATTLEFIELD = 19,
  235. MAPTYPE_PVP_TOURNAMENT = 20,
  236. //Map types 21 - 24 not used.
  237. MAPTYPE_SIEGE_LOWLEVEL = 25,
  238. //Map types 26 - 28 remains opens for future types.
  239. MAPTYPE_UNUSED = 29,
  240. };
  241. enum useskill_fail_cause
  242. {// clif_skill_fail
  243. USESKILL_FAIL_LEVEL = 0,
  244. USESKILL_FAIL_SP_INSUFFICIENT = 1,
  245. USESKILL_FAIL_HP_INSUFFICIENT = 2,
  246. USESKILL_FAIL_STUFF_INSUFFICIENT = 3,
  247. USESKILL_FAIL_SKILLINTERVAL = 4,
  248. USESKILL_FAIL_MONEY = 5,
  249. USESKILL_FAIL_THIS_WEAPON = 6,
  250. USESKILL_FAIL_REDJAMSTONE = 7,
  251. USESKILL_FAIL_BLUEJAMSTONE = 8,
  252. USESKILL_FAIL_WEIGHTOVER = 9,
  253. USESKILL_FAIL = 10,
  254. USESKILL_FAIL_TOTARGET = 11,
  255. USESKILL_FAIL_ANCILLA_NUMOVER = 12,
  256. USESKILL_FAIL_HOLYWATER = 13,
  257. USESKILL_FAIL_ANCILLA = 14,
  258. USESKILL_FAIL_DUPLICATE_RANGEIN = 15,
  259. USESKILL_FAIL_NEED_OTHER_SKILL = 16,
  260. USESKILL_FAIL_NEED_HELPER = 17,
  261. USESKILL_FAIL_INVALID_DIR = 18,
  262. USESKILL_FAIL_SUMMON = 19,
  263. USESKILL_FAIL_SUMMON_NONE = 20,
  264. USESKILL_FAIL_IMITATION_SKILL_NONE = 21,
  265. USESKILL_FAIL_DUPLICATE = 22,
  266. USESKILL_FAIL_CONDITION = 23,
  267. USESKILL_FAIL_PAINTBRUSH = 24,
  268. USESKILL_FAIL_DRAGON = 25,
  269. USESKILL_FAIL_POS = 26,
  270. USESKILL_FAIL_HELPER_SP_INSUFFICIENT = 27,
  271. USESKILL_FAIL_NEER_WALL = 28,
  272. USESKILL_FAIL_NEED_EXP_1PERCENT = 29,
  273. USESKILL_FAIL_CHORUS_SP_INSUFFICIENT = 30,
  274. USESKILL_FAIL_GC_WEAPONBLOCKING = 31,
  275. USESKILL_FAIL_GC_POISONINGWEAPON = 32,
  276. USESKILL_FAIL_MADOGEAR = 33,
  277. USESKILL_FAIL_NEED_EQUIPMENT_KUNAI = 34,
  278. USESKILL_FAIL_TOTARGET_PLAYER = 35,
  279. USESKILL_FAIL_SIZE = 36,
  280. USESKILL_FAIL_CANONBALL = 37,
  281. //XXX_USESKILL_FAIL_II_MADOGEAR_ACCELERATION = 38,
  282. //XXX_USESKILL_FAIL_II_MADOGEAR_HOVERING_BOOSTER = 39,
  283. USESKILL_FAIL_MADOGEAR_HOVERING = 40,
  284. //XXX_USESKILL_FAIL_II_MADOGEAR_SELFDESTRUCTION_DEVICE = 41,
  285. //XXX_USESKILL_FAIL_II_MADOGEAR_SHAPESHIFTER = 42,
  286. USESKILL_FAIL_GUILLONTINE_POISON = 43,
  287. //XXX_USESKILL_FAIL_II_MADOGEAR_COOLING_DEVICE = 44,
  288. //XXX_USESKILL_FAIL_II_MADOGEAR_MAGNETICFIELD_GENERATOR = 45,
  289. //XXX_USESKILL_FAIL_II_MADOGEAR_BARRIER_GENERATOR = 46,
  290. //XXX_USESKILL_FAIL_II_MADOGEAR_OPTICALCAMOUFLAGE_GENERATOR = 47,
  291. //XXX_USESKILL_FAIL_II_MADOGEAR_REPAIRKIT = 48,
  292. //XXX_USESKILL_FAIL_II_MONKEY_SPANNER = 49,
  293. USESKILL_FAIL_MADOGEAR_RIDE = 50,
  294. USESKILL_FAIL_SPELLBOOK = 51,
  295. USESKILL_FAIL_SPELLBOOK_DIFFICULT_SLEEP = 52,
  296. USESKILL_FAIL_SPELLBOOK_PRESERVATION_POINT = 53,
  297. USESKILL_FAIL_SPELLBOOK_READING = 54,
  298. //XXX_USESKILL_FAIL_II_FACE_PAINTS = 55,
  299. //XXX_USESKILL_FAIL_II_MAKEUP_BRUSH = 56,
  300. USESKILL_FAIL_CART = 57,
  301. //XXX_USESKILL_FAIL_II_THORNS_SEED = 58,
  302. //XXX_USESKILL_FAIL_II_BLOOD_SUCKER_SEED = 59,
  303. USESKILL_FAIL_NO_MORE_SPELL = 60,
  304. //XXX_USESKILL_FAIL_II_BOMB_MUSHROOM_SPORE = 61,
  305. //XXX_USESKILL_FAIL_II_GASOLINE_BOOMB = 62,
  306. //XXX_USESKILL_FAIL_II_OIL_BOTTLE = 63,
  307. //XXX_USESKILL_FAIL_II_EXPLOSION_POWDER = 64,
  308. //XXX_USESKILL_FAIL_II_SMOKE_POWDER = 65,
  309. //XXX_USESKILL_FAIL_II_TEAR_GAS = 66,
  310. //XXX_USESKILL_FAIL_II_HYDROCHLORIC_ACID_BOTTLE = 67,
  311. //XXX_USESKILL_FAIL_II_HELLS_PLANT_BOTTLE = 68,
  312. //XXX_USESKILL_FAIL_II_MANDRAGORA_FLOWERPOT = 69,
  313. USESKILL_FAIL_MANUAL_NOTIFY = 70,
  314. USESKILL_FAIL_NEED_ITEM = 71,
  315. USESKILL_FAIL_NEED_EQUIPMENT = 72,
  316. USESKILL_FAIL_COMBOSKILL = 73,
  317. USESKILL_FAIL_SPIRITS = 74,
  318. USESKILL_FAIL_EXPLOSIONSPIRITS = 75,
  319. USESKILL_FAIL_HP_TOOMANY = 76,
  320. USESKILL_FAIL_NEED_ROYAL_GUARD_BANDING = 77,
  321. USESKILL_FAIL_NEED_EQUIPPED_WEAPON_CLASS = 78,
  322. USESKILL_FAIL_EL_SUMMON = 79,
  323. USESKILL_FAIL_RELATIONGRADE = 80,
  324. USESKILL_FAIL_STYLE_CHANGE_FIGHTER = 81,
  325. USESKILL_FAIL_STYLE_CHANGE_GRAPPLER = 82,
  326. USESKILL_FAIL_THERE_ARE_NPC_AROUND = 83,
  327. //USESKILL_FAIL_NEED_MORE_BULLET = 84,
  328. };
  329. enum clif_messages {
  330. MERC_MSG_BASE = 1266, //0x4f2
  331. SKILL_CANT_USE_AREA = 0x536,
  332. VIEW_EQUIP_FAIL = 0x54d,
  333. USAGE_FAIL = 0x783,
  334. ADDITEM_TO_CART_FAIL_WEIGHT = 0x0,
  335. ADDITEM_TO_CART_FAIL_COUNT = 0x1,
  336. };
  337. enum e_personalinfo {
  338. PINFO_BASIC = 0,
  339. PINFO_PREMIUM,
  340. PINFO_SERVER,
  341. PINFO_CAFE,
  342. PINFO_MAX,
  343. };
  344. int clif_setip(const char* ip);
  345. void clif_setbindip(const char* ip);
  346. void clif_setport(uint16 port);
  347. uint32 clif_getip(void);
  348. uint32 clif_refresh_ip(void);
  349. uint16 clif_getport(void);
  350. void packetdb_readdb(void);
  351. void clif_authok(struct map_session_data *sd);
  352. void clif_authrefuse(int fd, uint8 error_code);
  353. void clif_authfail_fd(int fd, int type);
  354. void clif_charselectok(int id, uint8 ok);
  355. void clif_dropflooritem(struct flooritem_data* fitem);
  356. void clif_clearflooritem(struct flooritem_data *fitem, int fd);
  357. void clif_clearunit_single(int id, clr_type type, int fd);
  358. void clif_clearunit_area(struct block_list* bl, clr_type type);
  359. void clif_clearunit_delayed(struct block_list* bl, clr_type type, unsigned int tick);
  360. int clif_spawn(struct block_list *bl); //area
  361. void clif_walkok(struct map_session_data *sd); // self
  362. void clif_move(struct unit_data *ud); //area
  363. void clif_changemap(struct map_session_data *sd, short m, int x, int y); //self
  364. void clif_changemapserver(struct map_session_data* sd, unsigned short map_index, int x, int y, uint32 ip, uint16 port); //self
  365. void clif_blown(struct block_list *bl); // area
  366. void clif_slide(struct block_list *bl, int x, int y); // area
  367. void clif_fixpos(struct block_list *bl); // area
  368. void clif_npcbuysell(struct map_session_data* sd, int id); //self
  369. void clif_buylist(struct map_session_data *sd, struct npc_data *nd); //self
  370. void clif_selllist(struct map_session_data *sd); //self
  371. void clif_scriptmes(struct map_session_data *sd, int npcid, const char *mes); //self
  372. void clif_scriptnext(struct map_session_data *sd,int npcid); //self
  373. void clif_scriptclose(struct map_session_data *sd, int npcid); //self
  374. void clif_scriptclear(struct map_session_data *sd, int npcid); //self
  375. void clif_scriptmenu(struct map_session_data* sd, int npcid, const char* mes); //self
  376. void clif_scriptinput(struct map_session_data *sd, int npcid); //self
  377. void clif_scriptinputstr(struct map_session_data *sd, int npcid); // self
  378. void clif_cutin(struct map_session_data* sd, const char* image, int type); //self
  379. void clif_viewpoint(struct map_session_data *sd, int npc_id, int type, int x, int y, int id, int color); //self
  380. void clif_additem(struct map_session_data *sd, int n, int amount, int fail); // self
  381. void clif_dropitem(struct map_session_data *sd,int n,int amount); //self
  382. void clif_delitem(struct map_session_data *sd,int n,int amount, short reason); //self
  383. void clif_updatestatus(struct map_session_data *sd,int type); //self
  384. void clif_changestatus(struct map_session_data* sd,int type,int val); //area
  385. int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tick, int sdelay, int ddelay, int64 sdamage, int div, int type, int64 sdamage2); // area
  386. void clif_takeitem(struct block_list* src, struct block_list* dst);
  387. void clif_sitting(struct block_list* bl);
  388. void clif_standing(struct block_list* bl);
  389. void clif_changelook(struct block_list *bl,int type,int val); // area
  390. void clif_changetraplook(struct block_list *bl,int val); // area
  391. void clif_refreshlook(struct block_list *bl,int id,int type,int val,enum send_target target); //area specified in 'target'
  392. void clif_arrowequip(struct map_session_data *sd,int val); //self
  393. void clif_arrow_fail(struct map_session_data *sd,int type); //self
  394. void clif_arrow_create_list(struct map_session_data *sd); //self
  395. void clif_statusupack(struct map_session_data *sd,int type,int ok,int val); // self
  396. void clif_equipitemack(struct map_session_data *sd,int n,int pos,int ok); // self
  397. void clif_unequipitemack(struct map_session_data *sd,int n,int pos,int ok); // self
  398. void clif_misceffect(struct block_list* bl,int type); // area
  399. void clif_changeoption(struct block_list* bl); // area
  400. void clif_changeoption2(struct block_list* bl); // area
  401. void clif_useitemack(struct map_session_data *sd,int index,int amount,bool ok); // self
  402. void clif_GlobalMessage(struct block_list* bl, const char* message,enum send_target target);
  403. void clif_createchat(struct map_session_data* sd, int flag); // self
  404. void clif_dispchat(struct chat_data* cd, int fd); // area or fd
  405. void clif_joinchatfail(struct map_session_data *sd,int flag); // self
  406. void clif_joinchatok(struct map_session_data *sd,struct chat_data* cd); // self
  407. void clif_addchat(struct chat_data* cd,struct map_session_data *sd); // chat
  408. void clif_changechatowner(struct chat_data* cd, struct map_session_data* sd); // chat
  409. void clif_clearchat(struct chat_data *cd,int fd); // area or fd
  410. void clif_leavechat(struct chat_data* cd, struct map_session_data* sd, bool flag); // chat
  411. void clif_changechatstatus(struct chat_data* cd); // chat
  412. void clif_refresh(struct map_session_data *sd); // self
  413. void clif_fame_blacksmith(struct map_session_data *sd, int points);
  414. void clif_fame_alchemist(struct map_session_data *sd, int points);
  415. void clif_fame_taekwon(struct map_session_data *sd, int points);
  416. void clif_emotion(struct block_list *bl,int type);
  417. void clif_talkiebox(struct block_list* bl, const char* talkie);
  418. void clif_wedding_effect(struct block_list *bl);
  419. void clif_divorced(struct map_session_data* sd, const char* name);
  420. void clif_callpartner(struct map_session_data *sd);
  421. void clif_playBGM(struct map_session_data* sd, const char* name);
  422. void clif_soundeffect(struct map_session_data* sd, struct block_list* bl, const char* name, int type);
  423. void clif_soundeffectall(struct block_list* bl, const char* name, int type, enum send_target coverage);
  424. void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type, int target_id, unsigned int tick);
  425. void clif_parse_LoadEndAck(int fd,struct map_session_data *sd);
  426. void clif_hotkeys_send(struct map_session_data *sd);
  427. // trade
  428. void clif_traderequest(struct map_session_data* sd, const char* name);
  429. void clif_tradestart(struct map_session_data* sd, uint8 type);
  430. void clif_tradeadditem(struct map_session_data* sd, struct map_session_data* tsd, int index, int amount);
  431. void clif_tradeitemok(struct map_session_data* sd, int index, int fail);
  432. void clif_tradedeal_lock(struct map_session_data* sd, int fail);
  433. void clif_tradecancelled(struct map_session_data* sd);
  434. void clif_tradecompleted(struct map_session_data* sd, int fail);
  435. void clif_tradeundo(struct map_session_data* sd);
  436. // storage
  437. void clif_storagelist(struct map_session_data* sd, struct item* items, int items_length);
  438. void clif_updatestorageamount(struct map_session_data* sd, int amount, int max_amount);
  439. void clif_storageitemadded(struct map_session_data* sd, struct item* i, int index, int amount);
  440. void clif_storageitemremoved(struct map_session_data* sd, int index, int amount);
  441. void clif_storageclose(struct map_session_data* sd);
  442. int clif_insight(struct block_list *bl,va_list ap); // map_forallinmovearea callback
  443. int clif_outsight(struct block_list *bl,va_list ap); // map_forallinmovearea callback
  444. void clif_class_change(struct block_list *bl,int class_,int type);
  445. #define clif_mob_class_change(md, class_) clif_class_change(&md->bl, class_, 1)
  446. void clif_skillinfoblock(struct map_session_data *sd);
  447. void clif_skillup(struct map_session_data *sd, uint16 skill_id, int lv, int range, int upgradable);
  448. void clif_skillinfo(struct map_session_data *sd,int skill, int inf);
  449. void clif_addskill(struct map_session_data *sd, int id);
  450. void clif_deleteskill(struct map_session_data *sd, int id);
  451. 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);
  452. void clif_skillcastcancel(struct block_list* bl);
  453. void clif_skill_fail(struct map_session_data *sd,uint16 skill_id,enum useskill_fail_cause cause,int btype);
  454. void clif_skill_cooldown(struct map_session_data *sd, uint16 skill_id, unsigned int tick);
  455. 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,int type);
  456. //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,int type);
  457. int clif_skill_nodamage(struct block_list *src,struct block_list *dst,uint16 skill_id,int heal,int fail);
  458. void clif_skill_poseffect(struct block_list *src,uint16 skill_id,int val,int x,int y,int tick);
  459. void clif_skill_estimation(struct map_session_data *sd,struct block_list *dst);
  460. 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);
  461. void clif_skill_memomessage(struct map_session_data* sd, int type);
  462. void clif_skill_teleportmessage(struct map_session_data *sd, int type);
  463. void clif_skill_produce_mix_list(struct map_session_data *sd, int skill_id, int trigger);
  464. void clif_cooking_list(struct map_session_data *sd, int trigger, uint16 skill_id, int qty, int list_type);
  465. void clif_produceeffect(struct map_session_data* sd,int flag,int nameid);
  466. void clif_skill_setunit(struct skill_unit *unit);
  467. void clif_skill_delunit(struct skill_unit *unit);
  468. void clif_skillunit_update(struct block_list* bl);
  469. void clif_autospell(struct map_session_data *sd,uint16 skill_lv);
  470. void clif_devotion(struct block_list *src, struct map_session_data *tsd);
  471. void clif_spiritball(struct block_list *bl);
  472. void clif_combo_delay(struct block_list *bl,int wait);
  473. void clif_bladestop(struct block_list *src, int dst_id, int active);
  474. void clif_changemapcell(int fd, int16 m, int x, int y, int type, enum send_target target);
  475. #define clif_status_load(bl, type, flag) clif_status_change((bl), (type), (flag), 0, 0, 0, 0)
  476. void clif_status_change(struct block_list *bl,int type,int flag,int tick,int val1, int val2, int val3);
  477. void clif_wis_message(int fd, const char* nick, const char* mes, int mes_len);
  478. void clif_wis_end(int fd, int flag);
  479. void clif_solved_charname(int fd, int charid, const char* name);
  480. void clif_charnameack(int fd, struct block_list *bl);
  481. void clif_charnameupdate(struct map_session_data *ssd);
  482. void clif_use_card(struct map_session_data *sd,int idx);
  483. void clif_insert_card(struct map_session_data *sd,int idx_equip,int idx_card,int flag);
  484. void clif_inventorylist(struct map_session_data *sd);
  485. void clif_equiplist(struct map_session_data *sd);
  486. void clif_cart_additem(struct map_session_data *sd,int n,int amount,int fail);
  487. void clif_cart_additem_ack(struct map_session_data *sd, uint8 flag);
  488. void clif_cart_delitem(struct map_session_data *sd,int n,int amount);
  489. void clif_cartlist(struct map_session_data *sd);
  490. void clif_clearcart(int fd);
  491. void clif_item_identify_list(struct map_session_data *sd);
  492. void clif_item_identified(struct map_session_data *sd,int idx,int flag);
  493. void clif_item_repair_list(struct map_session_data *sd, struct map_session_data *dstsd, int lv);
  494. void clif_item_repaireffect(struct map_session_data *sd, int idx, int flag);
  495. void clif_item_damaged(struct map_session_data* sd, unsigned short position);
  496. void clif_item_refine_list(struct map_session_data *sd);
  497. void clif_item_skill(struct map_session_data *sd,uint16 skill_id,uint16 skill_lv);
  498. void clif_mvp_effect(struct map_session_data *sd);
  499. void clif_mvp_item(struct map_session_data *sd,int nameid);
  500. void clif_mvp_exp(struct map_session_data *sd, unsigned int exp);
  501. void clif_mvp_noitem(struct map_session_data* sd);
  502. void clif_changed_dir(struct block_list *bl, enum send_target target);
  503. // vending
  504. void clif_openvendingreq(struct map_session_data* sd, int num);
  505. void clif_showvendingboard(struct block_list* bl, const char* message, int fd);
  506. void clif_closevendingboard(struct block_list* bl, int fd);
  507. void clif_vendinglist(struct map_session_data* sd, int id, struct s_vending* vending);
  508. void clif_buyvending(struct map_session_data* sd, int index, int amount, int fail);
  509. void clif_openvending(struct map_session_data* sd, int id, struct s_vending* vending);
  510. void clif_vendingreport(struct map_session_data* sd, int index, int amount);
  511. void clif_movetoattack(struct map_session_data *sd,struct block_list *bl);
  512. // party
  513. void clif_party_created(struct map_session_data *sd,int result);
  514. void clif_party_member_info(struct party_data *p, struct map_session_data *sd);
  515. void clif_party_info(struct party_data* p, struct map_session_data *sd);
  516. void clif_party_invite(struct map_session_data *sd,struct map_session_data *tsd);
  517. void clif_party_inviteack(struct map_session_data* sd, const char* nick, int result);
  518. void clif_party_option(struct party_data *p,struct map_session_data *sd,int flag);
  519. void clif_party_withdraw(struct party_data* p, struct map_session_data* sd, int account_id, const char* name, int flag);
  520. void clif_party_message(struct party_data* p, int account_id, const char* mes, int len);
  521. void clif_party_xy(struct map_session_data *sd);
  522. void clif_party_xy_single(int fd, struct map_session_data *sd);
  523. void clif_party_hp(struct map_session_data *sd);
  524. void clif_hpmeter_single(int fd, int id, unsigned int hp, unsigned int maxhp);
  525. // guild
  526. void clif_guild_created(struct map_session_data *sd,int flag);
  527. void clif_guild_belonginfo(struct map_session_data *sd, struct guild *g);
  528. void clif_guild_masterormember(struct map_session_data *sd);
  529. void clif_guild_basicinfo(struct map_session_data *sd);
  530. void clif_guild_allianceinfo(struct map_session_data *sd);
  531. void clif_guild_memberlist(struct map_session_data *sd);
  532. void clif_guild_skillinfo(struct map_session_data* sd);
  533. void clif_guild_send_onlineinfo(struct map_session_data *sd); //[LuzZza]
  534. void clif_guild_memberlogin_notice(struct guild *g,int idx,int flag);
  535. void clif_guild_invite(struct map_session_data *sd,struct guild *g);
  536. void clif_guild_inviteack(struct map_session_data *sd,int flag);
  537. void clif_guild_leave(struct map_session_data *sd,const char *name,const char *mes);
  538. void clif_guild_expulsion(struct map_session_data* sd, const char* name, const char* mes, int account_id);
  539. void clif_guild_positionchanged(struct guild *g,int idx);
  540. void clif_guild_memberpositionchanged(struct guild *g,int idx);
  541. void clif_guild_emblem(struct map_session_data *sd,struct guild *g);
  542. void clif_guild_emblem_area(struct block_list* bl);
  543. void clif_guild_notice(struct map_session_data* sd, struct guild* g);
  544. void clif_guild_message(struct guild *g,int account_id,const char *mes,int len);
  545. void clif_guild_reqalliance(struct map_session_data *sd,int account_id,const char *name);
  546. void clif_guild_allianceack(struct map_session_data *sd,int flag);
  547. void clif_guild_delalliance(struct map_session_data *sd,int guild_id,int flag);
  548. void clif_guild_oppositionack(struct map_session_data *sd,int flag);
  549. void clif_guild_broken(struct map_session_data *sd,int flag);
  550. void clif_guild_xy(struct map_session_data *sd);
  551. void clif_guild_xy_single(int fd, struct map_session_data *sd);
  552. void clif_guild_xy_remove(struct map_session_data *sd);
  553. // Battleground
  554. void clif_bg_hp(struct map_session_data *sd);
  555. void clif_bg_xy(struct map_session_data *sd);
  556. void clif_bg_xy_remove(struct map_session_data *sd);
  557. void clif_bg_message(struct battleground_data *bg, int src_id, const char *name, const char *mes, int len);
  558. void clif_bg_updatescore(int16 m);
  559. void clif_bg_updatescore_single(struct map_session_data *sd);
  560. void clif_sendbgemblem_area(struct map_session_data *sd);
  561. void clif_sendbgemblem_single(int fd, struct map_session_data *sd);
  562. // Instancing
  563. void clif_instance_create(struct map_session_data *sd, const char *name, int num, int flag);
  564. void clif_instance_changewait(struct map_session_data *sd, int num, int flag);
  565. void clif_instance_status(struct map_session_data *sd, const char *name, unsigned int limit1, unsigned int limit2, int flag);
  566. void clif_instance_changestatus(struct map_session_data *sd, int type, unsigned int limit, int flag);
  567. // Custom Fonts
  568. void clif_font(struct map_session_data *sd);
  569. // atcommand
  570. void clif_displaymessage(const int fd, const char* mes);
  571. void clif_disp_onlyself(struct map_session_data *sd, const char *mes, int len);
  572. void clif_disp_message(struct block_list* src, const char* mes, int len, enum send_target target);
  573. void clif_broadcast(struct block_list* bl, const char* mes, int len, int type, enum send_target target);
  574. 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);
  575. void clif_heal(int fd,int type,int val);
  576. void clif_resurrection(struct block_list *bl,int type);
  577. void clif_map_property(struct map_session_data* sd, enum map_property property);
  578. void clif_maptypeproperty2(struct block_list *bl,enum send_target t);
  579. void clif_pvpset(struct map_session_data *sd, int pvprank, int pvpnum,int type);
  580. void clif_map_property_mapall(int map, enum map_property property);
  581. void clif_refine(int fd, int fail, int index, int val);
  582. void clif_upgrademessage(int fd, int result, int item_id);
  583. //petsystem
  584. void clif_catch_process(struct map_session_data *sd);
  585. void clif_pet_roulette(struct map_session_data *sd,int data);
  586. void clif_sendegg(struct map_session_data *sd);
  587. void clif_send_petstatus(struct map_session_data *sd);
  588. void clif_send_petdata(struct map_session_data* sd, struct pet_data* pd, int type, int param);
  589. #define clif_pet_equip(sd, pd) clif_send_petdata(sd, pd, 3, (pd)->vd.head_bottom)
  590. #define clif_pet_equip_area(pd) clif_send_petdata(NULL, pd, 3, (pd)->vd.head_bottom)
  591. #define clif_pet_performance(pd, param) clif_send_petdata(NULL, pd, 4, param)
  592. void clif_pet_emotion(struct pet_data *pd,int param);
  593. void clif_pet_food(struct map_session_data *sd,int foodid,int fail);
  594. //friends list
  595. int clif_friendslist_toggle_sub(struct map_session_data *sd,va_list ap);
  596. void clif_friendslist_send(struct map_session_data *sd);
  597. void clif_friendslist_reqack(struct map_session_data *sd, struct map_session_data *f_sd, int type);
  598. void clif_weather(int16 m); // [Valaris]
  599. void clif_specialeffect(struct block_list* bl, int type, enum send_target target); // special effects [Valaris]
  600. void clif_specialeffect_single(struct block_list* bl, int type, int fd);
  601. void clif_messagecolor(struct block_list* bl, unsigned long color, const char* msg); // Mob/Npc color talk [SnakeDrak]
  602. void clif_specialeffect_value(struct block_list* bl, int effect_id, int num, send_target target);
  603. void clif_GM_kickack(struct map_session_data *sd, int id);
  604. void clif_GM_kick(struct map_session_data *sd,struct map_session_data *tsd);
  605. void clif_manner_message(struct map_session_data* sd, uint32 type);
  606. void clif_GM_silence(struct map_session_data* sd, struct map_session_data* tsd, uint8 type);
  607. void clif_disp_overhead(struct block_list *bl, const char* mes);
  608. void clif_get_weapon_view(struct map_session_data* sd, unsigned short *rhand, unsigned short *lhand);
  609. void clif_party_xy_remove(struct map_session_data *sd); //Fix for minimap [Kevin]
  610. void clif_gospel_info(struct map_session_data *sd, int type);
  611. void clif_feel_req(int fd, struct map_session_data *sd, uint16 skill_lv);
  612. void clif_starskill(struct map_session_data* sd, const char* mapname, int monster_id, unsigned char star, unsigned char result);
  613. void clif_feel_info(struct map_session_data* sd, unsigned char feel_level, unsigned char type);
  614. void clif_hate_info(struct map_session_data *sd, unsigned char hate_level,int class_, unsigned char type);
  615. void clif_mission_info(struct map_session_data *sd, int mob_id, unsigned char progress);
  616. void clif_feel_hate_reset(struct map_session_data *sd);
  617. // [blackhole89]
  618. void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag);
  619. int clif_homskillinfoblock(struct map_session_data *sd);
  620. void clif_homskillup(struct map_session_data *sd, uint16 skill_id); //[orn]
  621. int clif_hom_food(struct map_session_data *sd,int foodid,int fail); //[orn]
  622. void clif_send_homdata(struct map_session_data *sd, int state, int param); //[orn]
  623. void clif_equiptickack(struct map_session_data* sd, int flag);
  624. void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* tsd);
  625. void clif_equipcheckbox(struct map_session_data* sd);
  626. void clif_msg(struct map_session_data* sd, unsigned short id);
  627. void clif_msg_value(struct map_session_data* sd, unsigned short id, int value);
  628. void clif_msg_skill(struct map_session_data* sd, uint16 skill_id, int msg_id);
  629. //quest system [Kevin] [Inkfish]
  630. void clif_quest_send_list(struct map_session_data * sd);
  631. void clif_quest_send_mission(struct map_session_data * sd);
  632. void clif_quest_add(struct map_session_data * sd, struct quest * qd, int index);
  633. void clif_quest_delete(struct map_session_data * sd, int quest_id);
  634. void clif_quest_update_status(struct map_session_data * sd, int quest_id, bool active);
  635. void clif_quest_update_objective(struct map_session_data * sd, struct quest * qd, int index);
  636. void clif_quest_show_event(struct map_session_data *sd, struct block_list *bl, short state, short color);
  637. void clif_displayexp(struct map_session_data *sd, unsigned int exp, char type, bool quest);
  638. int clif_send(const uint8* buf, int len, struct block_list* bl, enum send_target type);
  639. int do_init_clif(void);
  640. void do_final_clif(void);
  641. // MAIL SYSTEM
  642. void clif_Mail_window(int fd, int flag);
  643. void clif_Mail_read(struct map_session_data *sd, int mail_id);
  644. void clif_Mail_delete(int fd, int mail_id, short fail);
  645. void clif_Mail_return(int fd, int mail_id, short fail);
  646. void clif_Mail_send(int fd, bool fail);
  647. void clif_Mail_new(int fd, int mail_id, const char *sender, const char *title);
  648. void clif_Mail_refreshinbox(struct map_session_data *sd);
  649. void clif_Mail_getattachment(int fd, uint8 flag);
  650. // AUCTION SYSTEM
  651. void clif_Auction_openwindow(struct map_session_data *sd);
  652. void clif_Auction_results(struct map_session_data *sd, short count, short pages, uint8 *buf);
  653. void clif_Auction_message(int fd, unsigned char flag);
  654. void clif_Auction_close(int fd, unsigned char flag);
  655. void clif_parse_Auction_cancelreg(int fd, struct map_session_data *sd);
  656. void clif_bossmapinfo(int fd, struct mob_data *md, short flag);
  657. void clif_cashshop_show(struct map_session_data *sd, struct npc_data *nd);
  658. // ADOPTION
  659. void clif_Adopt_reply(struct map_session_data *sd, int type);
  660. // MERCENARIES
  661. void clif_mercenary_info(struct map_session_data *sd);
  662. void clif_mercenary_skillblock(struct map_session_data *sd);
  663. void clif_mercenary_message(struct map_session_data* sd, int message);
  664. void clif_mercenary_updatestatus(struct map_session_data *sd, int type);
  665. // RENTAL SYSTEM
  666. void clif_rental_time(int fd, int nameid, int seconds);
  667. void clif_rental_expired(int fd, int index, int nameid);
  668. // BOOK READING
  669. void clif_readbook(int fd, int book_id, int page);
  670. // Show Picker
  671. void clif_party_show_picker(struct map_session_data * sd, struct item * item_data);
  672. // Progress Bar [Inkfish]
  673. void clif_progressbar(struct map_session_data * sd, unsigned long color, unsigned int second);
  674. void clif_progressbar_abort(struct map_session_data * sd);
  675. void clif_PartyBookingRegisterAck(struct map_session_data *sd, int flag);
  676. void clif_PartyBookingDeleteAck(struct map_session_data* sd, int flag);
  677. void clif_PartyBookingSearchAck(int fd, struct party_booking_ad_info** results, int count, bool more_result);
  678. void clif_PartyBookingUpdateNotify(struct map_session_data* sd, struct party_booking_ad_info* pb_ad);
  679. void clif_PartyBookingDeleteNotify(struct map_session_data* sd, int index);
  680. void clif_PartyBookingInsertNotify(struct map_session_data* sd, struct party_booking_ad_info* pb_ad);
  681. /* Bank System [Yommy/Hercules] */
  682. void clif_bank_deposit (struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK reason);
  683. void clif_bank_withdraw (struct map_session_data *sd,enum e_BANKING_WITHDRAW_ACK reason);
  684. void clif_parse_BankDeposit (int fd, struct map_session_data *sd);
  685. void clif_parse_BankWithdraw (int fd, struct map_session_data *sd);
  686. void clif_parse_BankCheck (int fd, struct map_session_data *sd);
  687. void clif_parse_BankOpen (int fd, struct map_session_data *sd);
  688. void clif_parse_BankClose (int fd, struct map_session_data *sd);
  689. void clif_showdigit(struct map_session_data* sd, unsigned char type, int value);
  690. /// Buying Store System
  691. void clif_buyingstore_open(struct map_session_data* sd);
  692. void clif_buyingstore_open_failed(struct map_session_data* sd, unsigned short result, unsigned int weight);
  693. void clif_buyingstore_myitemlist(struct map_session_data* sd);
  694. void clif_buyingstore_entry(struct map_session_data* sd);
  695. void clif_buyingstore_entry_single(struct map_session_data* sd, struct map_session_data* pl_sd);
  696. void clif_buyingstore_disappear_entry(struct map_session_data* sd);
  697. void clif_buyingstore_disappear_entry_single(struct map_session_data* sd, struct map_session_data* pl_sd);
  698. void clif_buyingstore_itemlist(struct map_session_data* sd, struct map_session_data* pl_sd);
  699. void clif_buyingstore_trade_failed_buyer(struct map_session_data* sd, short result);
  700. void clif_buyingstore_update_item(struct map_session_data* sd, unsigned short nameid, unsigned short amount);
  701. void clif_buyingstore_delete_item(struct map_session_data* sd, short index, unsigned short amount, int price);
  702. void clif_buyingstore_trade_failed_seller(struct map_session_data* sd, short result, unsigned short nameid);
  703. /// Search Store System
  704. void clif_search_store_info_ack(struct map_session_data* sd);
  705. void clif_search_store_info_failed(struct map_session_data* sd, unsigned char reason);
  706. void clif_open_search_store_info(struct map_session_data* sd);
  707. void clif_search_store_info_click_ack(struct map_session_data* sd, short x, short y);
  708. /// Cash Shop
  709. void clif_cashshop_result( struct map_session_data* sd, uint16 item_id, uint16 result );
  710. void clif_cashshop_open( struct map_session_data* sd );
  711. void clif_display_pinfo(struct map_session_data *sd, int type);
  712. /**
  713. * 3CeAM
  714. **/
  715. void clif_msgtable(int fd, int line);
  716. void clif_msgtable_num(int fd, int line, int num);
  717. int clif_elementalconverter_list(struct map_session_data *sd);
  718. void clif_millenniumshield(struct map_session_data *sd, short shields );
  719. int clif_spellbook_list(struct map_session_data *sd);
  720. int clif_magicdecoy_list(struct map_session_data *sd, uint16 skill_lv, short x, short y);
  721. int clif_poison_list(struct map_session_data *sd, uint16 skill_lv);
  722. int clif_autoshadowspell_list(struct map_session_data *sd);
  723. int clif_status_load_notick(struct block_list *bl,int type,int flag,int val1, int val2, int val3);
  724. int clif_status_load_single(int fd, int id,int type,int flag,int val1, int val2, int val3);
  725. int clif_skill_itemlistwindow( struct map_session_data *sd, uint16 skill_id, uint16 skill_lv );
  726. void clif_elemental_info(struct map_session_data *sd);
  727. void clif_elemental_updatestatus(struct map_session_data *sd, int type);
  728. void clif_talisman(struct map_session_data *sd, short type);
  729. void clif_snap( struct block_list *bl, short x, short y );
  730. void clif_monster_hp_bar( struct mob_data* md, int fd );
  731. /**
  732. * Color Table
  733. **/
  734. enum clif_colors {
  735. COLOR_RED,
  736. COLOR_MAX
  737. };
  738. unsigned long color_table[COLOR_MAX];
  739. int clif_colormes(struct map_session_data * sd, unsigned long color, const char* msg);
  740. void clif_channel_msg(struct Channel *channel, struct map_session_data *sd, char *msg, short color);
  741. #define clif_menuskill_clear(sd) (sd)->menuskill_id = (sd)->menuskill_val = (sd)->menuskill_val2 = 0;
  742. void clif_ranklist(struct map_session_data *sd, int16 rankingType);
  743. void clif_update_rankingpoint(struct map_session_data *sd, int rankingtype, int point);
  744. #endif /* _CLIF_H_ */