diff options
Diffstat (limited to 'src/map/clif.h')
-rw-r--r-- | src/map/clif.h | 127 |
1 files changed, 78 insertions, 49 deletions
diff --git a/src/map/clif.h b/src/map/clif.h index d68a09393..ccb227267 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2012-2015 Hercules Dev Team + * Copyright (C) 2012-2016 Hercules Dev Team * Copyright (C) Athena Dev Teams * * Hercules is free software: you can redistribute it and/or modify @@ -40,6 +40,7 @@ struct guild; struct homun_data; struct item; struct item_data; +struct itemlist; // map/itemdb.h struct map_session_data; struct mercenary_data; struct mob_data; @@ -59,14 +60,16 @@ struct view_data; **/ #define packet_len(cmd) packet_db[cmd].len #define clif_menuskill_clear(sd) ((sd)->menuskill_id = (sd)->menuskill_val = (sd)->menuskill_val2 = 0) -#define clif_disp_onlyself(sd,mes,len) clif->disp_message( &(sd)->bl, (mes), (len), SELF ) +#define clif_disp_onlyself(sd, mes) clif->disp_message(&(sd)->bl, (mes), SELF) #define MAX_ROULETTE_LEVEL 7 /** client-defined value **/ #define MAX_ROULETTE_COLUMNS 9 /** client-defined value **/ #define RGB2BGR(c) (((c) & 0x0000FF) << 16 | ((c) & 0x00FF00) | ((c) & 0xFF0000) >> 16) +#define COLOR_CYAN 0x00ffffU #define COLOR_RED 0xff0000U #define COLOR_GREEN 0x00ff00U #define COLOR_WHITE 0xffffffU +#define COLOR_YELLOW 0xffff00U #define COLOR_DEFAULT COLOR_GREEN /** @@ -356,30 +359,32 @@ typedef enum useskill_fail_cause { // clif_skill_fail }useskill_fail_cause; enum clif_messages { - MSG_ITEM_CANT_OBTAIN_WEIGHT = 0x034, ///< You cannot carry more items because you are overweight. - MSG_ITEM_NEED_STANDING = 0x297, ///< You cannot use this item while sitting. - MSG_MERCENARY_EXPIRED = 0x4f2, ///< The mercenary contract has expired. - MSG_MERCENARY_DIED = 0x4f3, ///< The mercenary has died. - MSG_MERCENARY_RELEASED = 0x4f4, ///< You have released the mercenary. - MSG_MERCENARY_ESCAPED = 0x4f5, ///< The mercenary has run away. - MSG_SKILL_CANT_USE_AREA = 0x536, ///< This skill cannot be used within this area - MSG_ITEM_CANT_USE_AREA = 0x537, ///< This item cannot be used within this area. - MSG_EQUIP_NOT_PUBLIC = 0x54d, ///< This character's equipment information is not open to the public. - MSG_ITEM_NEED_MADO = 0x59b, ///< Item can only be used when Mado Gear is mounted. - MSG_ITEM_NEED_CART = 0x5ef, ///< Usable only when cart is put on - MSG_RUNE_STONE_MAX_AMOUNT = 0x61b, ///< Cannot create Rune stone more than the maximum amount. - MSG_SKILL_POINTS_LEFT_JOB1 = 0x61e, ///< You must consume all '%d' remaining points in your 1st Job tab. - MSG_SKILL_POINTS_LEFT_JOB2 = 0x61f, ///< You must consume all '%d' remaining points in your 2nd Job tab. 1st Tab is already done. - MSG_SKILL_ITEM_NOT_FOUND = 0x623, // FIXME[Haru]: This seems to be 0x622 in the msgstringtable files I found. - MSG_SKILL_SUCCESS = 0x627, // FIXME[Haru]: This seems to be 0x626 in the msgstringtable files I found. - MSG_SKILL_FAILURE = 0x628, // FIXME[Haru]: This seems to be 0x627 in the msgstringtable files I found. - MSG_SKILL_ITEM_NEED_IDENTIFY = 0x62d, ///< Unable to use unchecked items as materials. - MSG_ITEM_CANT_EQUIP_LVL = 0x6ed, // FIXME[Haru]: This seems to be 0x6ee in the msgstringtable files I found. - MSG_ITEM_CANT_USE_LVL = 0x6ee, // FIXME[Haru]: This seems to be 0x6ef in the msgstringtable files I found. - MSG_COOKING_LIST_FAIL = 0x625, // FIXME[Haru]: This might be a wrong message ID. Not sure what it should be. - MSG_SECONDS_UNTIL_USE = 0x746, ///< %d seconds left until you can use - MSG_NPC_WORK_IN_PROGRESS = 0x783, // FIXME[Haru]: This seems to be 0x784 in the msgstringtable files I found. - MSG_REINS_CANT_USE_MOUNTED = 0x78b, // FIXME[Haru]: This seems to be 0x785 in the msgstringtalbe files I found. + MSG_ITEM_CANT_OBTAIN_WEIGHT = 0x034, ///< You cannot carry more items because you are overweight. + MSG_ITEM_NEED_STANDING = 0x297, ///< You cannot use this item while sitting. + MSG_MERCENARY_EXPIRED = 0x4f2, ///< The mercenary contract has expired. + MSG_MERCENARY_DIED = 0x4f3, ///< The mercenary has died. + MSG_MERCENARY_RELEASED = 0x4f4, ///< You have released the mercenary. + MSG_MERCENARY_ESCAPED = 0x4f5, ///< The mercenary has run away. + MSG_PARTY_MEMBER_NOT_SUMMONED = 0x4c5, ///< The party member was not summoned because you are not the party leader. + MSG_PARTY_NO_MEMBER_IN_MAP = 0x4c6, ///< There is no party member to summon in the current map. + MSG_SKILL_CANT_USE_AREA = 0x536, ///< This skill cannot be used within this area + MSG_ITEM_CANT_USE_AREA = 0x537, ///< This item cannot be used within this area. + MSG_EQUIP_NOT_PUBLIC = 0x54d, ///< This character's equipment information is not open to the public. + MSG_ITEM_NEED_MADO = 0x59b, ///< Item can only be used when Mado Gear is mounted. + MSG_ITEM_NEED_CART = 0x5ef, ///< Usable only when cart is put on + MSG_RUNE_STONE_MAX_AMOUNT = 0x61b, ///< Cannot create Rune stone more than the maximum amount. + MSG_SKILL_POINTS_LEFT_JOB1 = 0x61e, ///< You must consume all '%d' remaining points in your 1st Job tab. + MSG_SKILL_POINTS_LEFT_JOB2 = 0x61f, ///< You must consume all '%d' remaining points in your 2nd Job tab. 1st Tab is already done. + MSG_SKILL_ITEM_NOT_FOUND = 0x623, // FIXME[Haru]: This seems to be 0x622 in the msgstringtable files I found. + MSG_SKILL_SUCCESS = 0x627, // FIXME[Haru]: This seems to be 0x626 in the msgstringtable files I found. + MSG_SKILL_FAILURE = 0x628, // FIXME[Haru]: This seems to be 0x627 in the msgstringtable files I found. + MSG_SKILL_ITEM_NEED_IDENTIFY = 0x62d, ///< Unable to use unchecked items as materials. + MSG_ITEM_CANT_EQUIP_LVL = 0x6ed, // FIXME[Haru]: This seems to be 0x6ee in the msgstringtable files I found. + MSG_ITEM_CANT_USE_LVL = 0x6ee, // FIXME[Haru]: This seems to be 0x6ef in the msgstringtable files I found. + MSG_COOKING_LIST_FAIL = 0x625, // FIXME[Haru]: This might be a wrong message ID. Not sure what it should be. + MSG_SECONDS_UNTIL_USE = 0x746, ///< %d seconds left until you can use + MSG_NPC_WORK_IN_PROGRESS = 0x783, // FIXME[Haru]: This seems to be 0x784 in the msgstringtable files I found. + MSG_REINS_CANT_USE_MOUNTED = 0x78b, // FIXME[Haru]: This seems to be 0x785 in the msgstringtalbe files I found. }; /** @@ -519,7 +524,7 @@ enum CLOSE_ROULETTE_ACK { /** * Reason for item deletion (clif->delitem) - */ + **/ enum delitem_reason { DELITEM_NORMAL = 0, /// Normal DELITEM_SKILLUSE = 1, /// Item used for a skill @@ -531,9 +536,9 @@ enum delitem_reason { DELITEM_ANALYSIS = 7, /// Consumed by Four Spirit Analysis (SO_EL_ANALYSIS) skill }; -/* -* Merge items reasons -*/ +/** + * Merge items reasons + **/ enum mergeitem_reason { MERGEITEM_SUCCESS = 0x0, @@ -542,6 +547,23 @@ enum mergeitem_reason { }; /** + * Clif Unit Type + **/ +enum clif_unittype { + CLUT_PC = 0x0, + CLUT_NPC = 0x1, + CLUT_ITEM = 0x2, + CLUT_SKILL = 0x3, + CLUT_UNKNOWN = 0x4, + CLUT_MOB = 0x5, + CLUT_EVENT = 0x6, + CLUT_PET = 0x7, + CLUT_HOMNUCLUS = 0x8, + CLUT_MERCNARY = 0x9, + CLUT_ELEMENTAL = 0xa, +}; + +/** * Structures **/ typedef void (*pFunc)(int, struct map_session_data *); //cant help but put it first @@ -562,8 +584,8 @@ struct cdelayed_damage { }; struct merge_item { - int16 position; - int16 nameid; + int16 position; + int16 nameid; }; /** @@ -653,7 +675,7 @@ struct clif_interface { void (*changetraplook) (struct block_list *bl,int val); void (*refreshlook) (struct block_list *bl,int id,int type,int val,enum send_target target); void (*sendlook) (struct block_list *bl, int id, int type, int val, int val2, enum send_target target); - void (*class_change) (struct block_list *bl,int class_,int type); + void (*class_change) (struct block_list *bl,int class_,int type, struct map_session_data *sd); void (*skill_delunit) (struct skill_unit *su); void (*skillunit_update) (struct block_list* bl); int (*clearunit_delayed_sub) (int tid, int64 tick, int id, intptr_t data); @@ -773,6 +795,7 @@ struct clif_interface { int (*autoshadowspell_list) (struct map_session_data *sd); int (*skill_itemlistwindow) ( struct map_session_data *sd, uint16 skill_id, uint16 skill_lv ); void (*sc_load) (struct block_list *bl, int tid, enum send_target target, int type, int val1, int val2, int val3); + void (*sc_continue) (struct block_list *bl, int tid, enum send_target target, int type, int val1, int val2, int val3); void (*sc_end) (struct block_list *bl, int tid, enum send_target target, int type); void (*initialstatus) (struct map_session_data *sd); void (*cooldown_list) (int fd, struct skill_cd* cd); @@ -806,7 +829,7 @@ struct clif_interface { void (*skill_poseffect) (struct block_list *src, uint16 skill_id, int val, int x, int y, int64 tick); void (*skill_estimation) (struct map_session_data *sd,struct block_list *dst); void (*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); - void (*skillcasting) (struct block_list* bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, int property, int casttime); + void (*useskill) (struct block_list* bl, int src_id, int dst_id, int dst_x, int dst_y, uint16 skill_id, uint16 skill_lv, int casttime); void (*produce_effect) (struct map_session_data* sd,int flag,int nameid); void (*devotion) (struct block_list *src, struct map_session_data *tsd); void (*spiritball) (struct block_list *bl); @@ -840,11 +863,11 @@ struct clif_interface { void (*clearchat) (struct chat_data *cd,int fd); void (*leavechat) (struct chat_data* cd, struct map_session_data* sd, bool flag); void (*changechatstatus) (struct chat_data* cd); - void (*wis_message) (int fd, const char* nick, const char* mes, size_t mes_len); + void (*wis_message) (int fd, const char *nick, const char *mes, int mes_len); void (*wis_end) (int fd, int flag); - void (*disp_message) (struct block_list* src, const char* mes, size_t len, enum send_target target); - void (*broadcast) (struct block_list* bl, const char* mes, size_t len, int type, enum send_target target); - void (*broadcast2) (struct block_list* bl, const char* mes, size_t len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target); + void (*disp_message) (struct block_list *src, const char *mes, enum send_target target); + void (*broadcast) (struct block_list *bl, const char *mes, int len, int type, enum send_target target); + void (*broadcast2) (struct block_list *bl, const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target); void (*messagecolor_self) (int fd, uint32 color, const char *msg); void (*messagecolor) (struct block_list* bl, uint32 color, const char* msg); void (*disp_overhead) (struct block_list *bl, const char* mes); @@ -855,7 +878,8 @@ struct clif_interface { void (*messageln) (const int fd, const char* mes); /* message+s(printf) */ void (*messages) (const int fd, const char *mes, ...) __attribute__((format(printf, 2, 3))); - bool (*process_message) (struct map_session_data *sd, int format, char **name_, size_t *namelen_, char **message_, size_t *messagelen_); + const char *(*process_chat_message) (struct map_session_data *sd, const struct packet_chat_message *packet, char *out_buf, int out_buflen); + bool (*process_whisper_message) (struct map_session_data *sd, const struct packet_whisper_message *packet, char *out_name, char *out_message, int out_messagelen); void (*wisexin) (struct map_session_data *sd,int type,int flag); void (*wisall) (struct map_session_data *sd,int type,int flag); void (*PMIgnoreList) (struct map_session_data* sd); @@ -876,7 +900,7 @@ struct clif_interface { void (*vendinglist) (struct map_session_data* sd, unsigned int id, struct s_vending* vending_list); void (*buyvending) (struct map_session_data* sd, int index, int amount, int fail); void (*openvending) (struct map_session_data* sd, int id, struct s_vending* vending_list); - void (*vendingreport) (struct map_session_data* sd, int index, int amount); + void (*vendingreport) (struct map_session_data* sd, int index, int amount, uint32 char_id, int zeny); /* storage handling */ void (*storagelist) (struct map_session_data* sd, struct item* items, int items_length); void (*updatestorageamount) (struct map_session_data* sd, int amount, int max_amount); @@ -941,7 +965,7 @@ struct clif_interface { void (*bg_hp) (struct map_session_data *sd); void (*bg_xy) (struct map_session_data *sd); void (*bg_xy_remove) (struct map_session_data *sd); - void (*bg_message) (struct battleground_data *bgd, int src_id, const char *name, const char *mes, size_t len); + void (*bg_message) (struct battleground_data *bgd, int src_id, const char *name, const char *mes); void (*bg_updatescore) (int16 m); void (*bg_updatescore_single) (struct map_session_data *sd); void (*sendbgemblem_area) (struct map_session_data *sd); @@ -997,7 +1021,7 @@ struct clif_interface { void (*mail_setattachment) (int fd, int index, uint8 flag); /* auction-related */ void (*auction_openwindow) (struct map_session_data *sd); - void (*auction_results) (struct map_session_data *sd, short count, short pages, uint8 *buf); + void (*auction_results) (struct map_session_data *sd, short count, short pages, const uint8 *buf); void (*auction_message) (int fd, unsigned char flag); void (*auction_close) (int fd, unsigned char flag); void (*auction_setitem) (int fd, int index, bool fail); @@ -1038,7 +1062,7 @@ struct clif_interface { void (*buyingstore_disappear_entry_single) (struct map_session_data* sd, struct map_session_data* pl_sd); void (*buyingstore_itemlist) (struct map_session_data* sd, struct map_session_data* pl_sd); void (*buyingstore_trade_failed_buyer) (struct map_session_data* sd, short result); - void (*buyingstore_update_item) (struct map_session_data* sd, unsigned short nameid, unsigned short amount); + void (*buyingstore_update_item) (struct map_session_data* sd, unsigned short nameid, unsigned short amount, uint32 char_id, int zeny); void (*buyingstore_delete_item) (struct map_session_data* sd, short index, unsigned short amount, int price); void (*buyingstore_trade_failed_seller) (struct map_session_data* sd, short result, unsigned short nameid); /* search store-related */ @@ -1051,7 +1075,7 @@ struct clif_interface { void (*elemental_updatestatus) (struct map_session_data *sd, int type); /* bgqueue */ void (*bgqueue_ack) (struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_ACK response, unsigned char arena_id); - void (*bgqueue_notice_delete) (struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED response, char *name); + void (*bgqueue_notice_delete) (struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED response, const char *name); void (*bgqueue_update_info) (struct map_session_data *sd, unsigned char arena_id, int position); void (*bgqueue_joined) (struct map_session_data *sd, int pos); void (*bgqueue_pcleft) (struct map_session_data *sd); @@ -1080,7 +1104,7 @@ struct clif_interface { int (*delay_damage_sub) (int tid, int64 tick, int id, intptr_t data); /* NPC Market */ void (*npc_market_open) (struct map_session_data *sd, struct npc_data *nd); - void (*npc_market_purchase_ack) (struct map_session_data *sd, struct packet_npc_market_purchase *req, unsigned char response); + void (*npc_market_purchase_ack) (struct map_session_data *sd, const struct itemlist *item_list, unsigned char response); /* */ bool (*parse_roulette_db) (void); void (*roulette_generate_ack) (struct map_session_data *sd, unsigned char result, short stage, short prizeIdx, short bonusItemID); @@ -1089,7 +1113,10 @@ struct clif_interface { void (*cancelmergeitem) (int fd, struct map_session_data *sd); int (*comparemergeitem) (const void *a, const void *b); void (*ackmergeitems) (int fd, struct map_session_data *sd); - + /* */ + bool (*isdisguised) (struct block_list* bl); + void (*navigate_to) (struct map_session_data *sd, const char* mapname, uint16 x, uint16 y, uint8 flag, bool hideWindow, uint16 mob_id); + unsigned char (*bl_type) (struct block_list *bl); /*------------------------ *- Parse Incoming Packet *------------------------*/ @@ -1328,13 +1355,15 @@ struct clif_interface { void (*pNPCMarketClosed) (int fd, struct map_session_data *sd); void (*pNPCMarketPurchase) (int fd, struct map_session_data *sd); /* */ - void (*add_random_options) (unsigned char* buf, struct item* item); + int (*add_item_options) (struct ItemOptions *buf, const struct item *it); void (*pHotkeyRowShift) (int fd, struct map_session_data *sd); void (*dressroom_open) (struct map_session_data *sd, int view); void (*pOneClick_ItemIdentify) (int fd,struct map_session_data *sd); /* Cart Deco */ - void(*selectcart) (struct map_session_data *sd); - void(*pSelectCart) (int fd, struct map_session_data *sd); + void (*selectcart) (struct map_session_data *sd); + void (*pSelectCart) (int fd, struct map_session_data *sd); + + const char *(*get_bl_name) (const struct block_list *bl); }; #ifdef HERCULES_CORE |