diff options
Diffstat (limited to 'src/map/clif.h')
-rw-r--r-- | src/map/clif.h | 187 |
1 files changed, 138 insertions, 49 deletions
diff --git a/src/map/clif.h b/src/map/clif.h index a7573b56e..25ac65af5 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -2,8 +2,8 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2012-2018 Hercules Dev Team - * Copyright (C) Athena Dev Teams + * Copyright (C) 2012-2020 Hercules Dev Team + * Copyright (C) Athena Dev Teams * * Hercules is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -55,7 +55,11 @@ struct skill_unit; struct unit_data; struct view_data; struct achievement_data; // map/achievement.h +struct s_refine_requirement; +struct PACKET_ZC_ACK_RANKING_sub; +struct SKILLDATA; +enum battle_dmg_type; enum clif_messages; enum rodex_add_item; enum rodex_get_zeny; @@ -71,10 +75,6 @@ enum rodex_get_items; #define MAX_ROULETTE_COLUMNS 9 /** client-defined value **/ #define RGB2BGR(c) (((c) & 0x0000FF) << 16 | ((c) & 0x00FF00) | ((c) & 0xFF0000) >> 16) -#ifndef MAX_STYLIST_TYPE -#define MAX_STYLIST_TYPE LOOK_MAX -#endif - #define COLOR_CYAN 0x00ffffU #define COLOR_RED 0xff0000U #define COLOR_GREEN 0x00ff00U @@ -82,6 +82,11 @@ enum rodex_get_items; #define COLOR_YELLOW 0xffff00U #define COLOR_DEFAULT COLOR_GREEN +#define MAX_STORAGE_ITEM_PACKET_NORMAL ((INT16_MAX - (sizeof(struct ZC_STORE_ITEMLIST_NORMAL) - (sizeof(struct NORMALITEM_INFO) * MAX_ITEMLIST))) / sizeof(struct NORMALITEM_INFO)) +#define MAX_STORAGE_ITEM_PACKET_EQUIP ((INT16_MAX - (sizeof(struct ZC_STORE_ITEMLIST_EQUIP) - (sizeof(struct EQUIPITEM_INFO) * MAX_ITEMLIST))) / sizeof(struct EQUIPITEM_INFO)) +STATIC_ASSERT(MAX_STORAGE_ITEM_PACKET_NORMAL > 0, "Max items per storage item packet for normal items is less than 1, it's most likely to be a bug and shall not be ignored."); +STATIC_ASSERT(MAX_STORAGE_ITEM_PACKET_EQUIP > 0, "Max items per storage item packet for equip items is less than 1, it's most likely to be a bug and shall not be ignored."); + /** * Enumerations **/ @@ -409,23 +414,26 @@ enum CASH_SHOP_BUY_RESULT { CSBR_RUNE_OVERCOUNT = 0x9, CSBR_EACHITEM_OVERCOUNT = 0xa, CSBR_UNKNOWN = 0xb, + CSBR_BUSY = 0xc, }; enum BATTLEGROUNDS_QUEUE_ACK { - BGQA_SUCCESS = 1, - BGQA_FAIL_QUEUING_FINISHED, - BGQA_FAIL_BGNAME_INVALID, - BGQA_FAIL_TYPE_INVALID, - BGQA_FAIL_PPL_OVERAMOUNT, - BGQA_FAIL_LEVEL_INCORRECT, - BGQA_DUPLICATE_REQUEST, - BGQA_PLEASE_RELOGIN, - BGQA_NOT_PARTY_GUILD_LEADER, - BGQA_FAIL_CLASS_INVALID, + BGQA_SUCCESS = 1, + BGQA_FAIL_QUEUING_FINISHED = 2, + BGQA_FAIL_BGNAME_INVALID = 3, + BGQA_FAIL_TYPE_INVALID = 4, + BGQA_FAIL_PPL_OVERAMOUNT = 5, + BGQA_FAIL_LEVEL_INCORRECT = 6, + BGQA_DUPLICATE_REQUEST = 7, + BGQA_PLEASE_RELOGIN = 8, + BGQA_NOT_PARTY_GUILD_LEADER = 9, + BGQA_FAIL_CLASS_INVALID = 10, /* not official way to respond (gotta find packet?) */ - BGQA_FAIL_DESERTER, - BGQA_FAIL_COOLDOWN, - BGQA_FAIL_TEAM_COUNT, + BGQA_FAIL_DESERTER = 11, + BGQA_FAIL_COOLDOWN = 12, + BGQA_FAIL_TEAM_COUNT = 13, + // official continue + BGQA_FAIL_TEAM_IN_BG_ALREADY = 15 }; enum BATTLEGROUNDS_QUEUE_NOTICE_DELETED { @@ -558,7 +566,7 @@ enum clif_unittype { **/ enum CZ_CONFIG { CZ_CONFIG_OPEN_EQUIPMENT_WINDOW = 0, - // Unknown = 1, + CZ_CONFIG_CALL = 1, CZ_CONFIG_PET_AUTOFEEDING = 2, CZ_CONFIG_HOMUNCULUS_AUTOFEEDING = 3, }; @@ -625,6 +633,13 @@ enum inventory_type { INVTYPE_GUILD_STORAGE = 3, }; +/** Guild Teleport Results */ +enum siege_teleport_result { + SIEGE_TP_SUCCESS = 0x0, + SIEGE_TP_NOT_ENOUGH_ZENY = 0x1, + SIEGE_TP_INVALID_MODE = 0x2 +}; + /** * Structures **/ @@ -655,16 +670,6 @@ struct attendance_entry { int qty; }; -/* Stylist data [Asheraf/Hercules]*/ -struct stylist_data_entry { - int16 id; - int32 zeny; - int itemid; - int boxid; - bool allow_doram; -}; -VECTOR_DECL(struct stylist_data_entry) stylist_data[MAX_STYLIST_TYPE]; - struct barter_itemlist_entry { int addId; int addAmount; @@ -702,6 +707,42 @@ enum expand_inventory_result { EXPAND_INVENTORY_RESULT_MAX_SIZE = 4 }; +#if PACKETVER_RE_NUM >= 20190807 || PACKETVER_ZERO_NUM >= 20190814 +enum market_buy_result { + MARKET_BUY_RESULT_ERROR = 0xffff, // -1 + MARKET_BUY_RESULT_SUCCESS = 0, + MARKET_BUY_RESULT_NO_ZENY = 1, + MARKET_BUY_RESULT_OVER_WEIGHT = 2, + MARKET_BUY_RESULT_OUT_OF_SPACE = 3, + MARKET_BUY_RESULT_AMOUNT_TOO_BIG = 9 +}; +#else +enum market_buy_result { + MARKET_BUY_RESULT_ERROR = 0, + MARKET_BUY_RESULT_SUCCESS = 1, + MARKET_BUY_RESULT_NO_ZENY = 0, + MARKET_BUY_RESULT_OVER_WEIGHT = 0, + MARKET_BUY_RESULT_OUT_OF_SPACE = 0, + MARKET_BUY_RESULT_AMOUNT_TOO_BIG = 0 +}; +#endif + +enum lapineddukddak_result { + LAPINEDDKUKDDAK_SUCCESS = 0, + LAPINEDDKUKDDAK_INSUFFICIENT_AMOUNT = 5, + LAPINEDDKUKDDAK_INVALID_ITEM = 7, +}; + +enum removeGear_flag { + REMOVE_MOUNT_0 = 0, // unused + REMOVE_MOUNT_DRAGON = 1, + REMOVE_MOUNT_2 = 2, // unused + REMOVE_MOUNT_MADO = 3, + REMOVE_MOUNT_PECO = 4, + REMOVE_MOUNT_FALCON = 5, + REMOVE_MOUNT_CART = 6, +}; + /** * Clif.c Interface **/ @@ -844,7 +885,7 @@ struct clif_interface { void (*scriptclear) (struct map_session_data *sd, int npcid); /* client-user-interface-related */ void (*viewpoint) (struct map_session_data *sd, int npc_id, int type, int x, int y, int id, int color); - int (*damage) (struct block_list* src, struct block_list* dst, int sdelay, int ddelay, int64 damage, short div, unsigned char type, int64 damage2); + int (*damage) (struct block_list* src, struct block_list* dst, int sdelay, int ddelay, int64 damage, short div, enum battle_dmg_type type, int64 damage2); void (*sitting) (struct block_list* bl); void (*standing) (struct block_list* bl); void (*arrow_create_list) (struct map_session_data *sd); @@ -854,9 +895,12 @@ struct clif_interface { void (*fame_alchemist) (struct map_session_data *sd, int points); void (*fame_taekwon) (struct map_session_data *sd, int points); void (*ranklist) (struct map_session_data *sd, enum fame_list_type type); + void (*ranklist_sub) (struct PACKET_ZC_ACK_RANKING_sub *ranks, enum fame_list_type type); + void (*ranklist_sub2) (uint32 *chars, uint32 *points, enum fame_list_type type); void (*update_rankingpoint) (struct map_session_data *sd, enum fame_list_type type, int points); void (*pRanklist) (int fd, struct map_session_data *sd); - void (*hotkeys) (struct map_session_data *sd); + void (*hotkeys) (struct map_session_data *sd, int tab); + void (*hotkeysAll) (struct map_session_data *sd); int (*insight) (struct block_list *bl,va_list ap); int (*outsight) (struct block_list *bl,va_list ap); void (*skillcastcancel) (struct block_list* bl); @@ -868,7 +912,8 @@ struct clif_interface { void (*cooking_list) (struct map_session_data *sd, int trigger, uint16 skill_id, int qty, int list_type); void (*autospell) (struct map_session_data *sd,uint16 skill_lv); void (*combo_delay) (struct block_list *bl,int wait); - void (*status_change) (struct block_list *bl,int type,int flag,int tick,int val1, int val2, int val3); + void (*status_change) (struct block_list *bl, int relevant_bl, int type, int flag, int total_tick, int val1, int val2, int val3); + void (*status_change_sub) (struct block_list *bl, int type, int relevant_bl, int flag, int tick, int total_tick, int val1, int val2, int val3); void (*insert_card) (struct map_session_data *sd,int idx_equip,int idx_card,int flag); void (*inventoryList) (struct map_session_data *sd); void (*inventoryItems) (struct map_session_data *sd, enum inventory_type type); @@ -895,7 +940,19 @@ struct clif_interface { void (*mvp_exp) (struct map_session_data *sd, unsigned int exp); void (*mvp_noitem) (struct map_session_data* sd); void (*changed_dir) (struct block_list *bl, enum send_target target); - void (*charnameack) (int fd, struct block_list *bl); + void (*blname_ack) (int fd, struct block_list *bl); + void (*pcname_ack) (int fd, struct block_list *bl); + void (*homname_ack) (int fd, struct block_list *bl); + void (*mername_ack) (int fd, struct block_list *bl); + void (*petname_ack) (int fd, struct block_list *bl); + void (*npcname_ack) (int fd, struct block_list *bl); + void (*mobname_ack) (int fd, struct block_list *bl); + void (*mobname_guardian_ack) (int fd, struct block_list *bl); + void (*mobname_additional_ack) (int fd, struct block_list *bl); + void (*mobname_normal_ack) (int fd, struct block_list *bl); + void (*chatname_ack) (int fd, struct block_list *bl); + void (*elemname_ack) (int fd, struct block_list *bl); + void (*unknownname_ack) (int fd, struct block_list *bl); void (*monster_hp_bar) ( struct mob_data* md, struct map_session_data *sd ); int (*hpmeter) (struct map_session_data *sd); void (*hpmeter_single) (int fd, int id, unsigned int hp, unsigned int maxhp); @@ -949,13 +1006,14 @@ struct clif_interface { /* visual effects client-side */ void (*misceffect) (struct block_list* bl,int type); void (*changeoption) (struct block_list* bl); + void (*changeoption_target) (struct block_list *bl, struct block_list *target_bl, enum send_target target); void (*changeoption2) (struct block_list* bl); void (*emotion) (struct block_list *bl,int type); void (*talkiebox) (struct block_list* bl, const char* talkie); void (*wedding_effect) (struct block_list *bl); void (*divorced) (struct map_session_data* sd, const char* name); void (*callpartner) (struct map_session_data *sd); - int (*skill_damage) (struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int64 damage, int div, uint16 skill_id, uint16 skill_lv, int type); + int (*skill_damage) (struct block_list *src, struct block_list *dst, int64 tick, int sdelay, int ddelay, int64 damage, int div, uint16 skill_id, uint16 skill_lv, enum battle_dmg_type type); int (*skill_nodamage) (struct block_list *src,struct block_list *dst,uint16 skill_id,int heal,int fail); 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); @@ -973,7 +1031,8 @@ struct clif_interface { void (*weather) (int16 m); void (*specialeffect) (struct block_list* bl, int type, enum send_target target); void (*specialeffect_single) (struct block_list* bl, int type, int fd); - void (*specialeffect_value) (struct block_list* bl, int effect_id, int num, send_target target); + void (*specialeffect_value) (struct block_list* bl, int effect_id, uint64 num, send_target target); + void (*specialeffect_value_single) (struct block_list *bl, int effect_id, uint64 num, int fd); void (*removeSpecialEffect) (struct block_list *bl, int effectId, enum send_target target); void (*removeSpecialEffect_single) (struct block_list *bl, int effectId, struct block_list *targetBl); void (*millenniumshield) (struct block_list *bl, short shields ); @@ -993,6 +1052,7 @@ struct clif_interface { void (*joinchatok) (struct map_session_data *sd,struct chat_data* cd); void (*addchat) (struct chat_data* cd,struct map_session_data *sd); void (*changechatowner) (struct chat_data* cd, struct map_session_data* sd); + void (*chatRoleChange) (struct chat_data *cd, struct map_session_data *sd, struct block_list* bl, int isNotOwner); 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); @@ -1021,7 +1081,7 @@ struct clif_interface { 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); - void (*ShowScript) (struct block_list* bl, const char* message); + void (*ShowScript) (struct block_list* bl, const char* message, enum send_target target); /* trade handling */ void (*traderequest) (struct map_session_data* sd, const char* name); void (*tradestart) (struct map_session_data* sd, uint8 type); @@ -1056,6 +1116,7 @@ struct clif_interface { void (*skillinfo) (struct map_session_data *sd,int skill_id, int inf); void (*addskill) (struct map_session_data *sd, int id); void (*deleteskill) (struct map_session_data *sd, int id); + void (*playerSkillToPacket) (struct map_session_data *sd, struct SKILLDATA *skillData, int skillId, int idx, bool newSkill); /* party-specific */ void (*party_created) (struct map_session_data *sd,int result); void (*party_member_info) (struct party_data *p, struct map_session_data *sd); @@ -1079,6 +1140,8 @@ struct clif_interface { void (*guild_masterormember) (struct map_session_data *sd); void (*guild_basicinfo) (struct map_session_data *sd); void (*guild_allianceinfo) (struct map_session_data *sd); + void (*guild_castlelist) (struct map_session_data *sd); + void (*guild_castleinfo) (struct map_session_data *sd, struct guild_castle *gc); void (*guild_memberlist) (struct map_session_data *sd); void (*guild_skillinfo) (struct map_session_data* sd); void (*guild_send_onlineinfo) (struct map_session_data *sd); //[LuzZza] @@ -1248,19 +1311,21 @@ struct clif_interface { /* */ void (*notify_bounditem) (struct map_session_data *sd, unsigned short index); /* */ - int (*delay_damage) (int64 tick, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 in_damage, short div, unsigned char type); + int (*delay_damage) (int64 tick, struct block_list *src, struct block_list *dst, int sdelay, int ddelay, int64 in_damage, short div, enum battle_dmg_type type); 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, const struct itemlist *item_list, unsigned char response); + void (*npc_market_purchase_ack) (struct map_session_data *sd, const struct itemlist *item_list, enum market_buy_result response); /* */ bool (*parse_roulette_db) (void); void (*roulette_generate_ack) (struct map_session_data *sd, enum GENERATE_ROULETTE_ACK result, short stage, short prizeIdx, int bonusItemID); + void (*roulette_close) (struct map_session_data *sd); /* Merge Items */ void (*openmergeitem) (int fd, struct map_session_data *sd); 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); + void (*mergeitems) (int fd, struct map_session_data *sd, int index, int amount, enum mergeitem_reason reason); /* */ 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); @@ -1278,7 +1343,8 @@ struct clif_interface { void (*pWantToConnection) (int fd, struct map_session_data *sd); void (*pLoadEndAck) (int fd,struct map_session_data *sd); void (*pTickSend) (int fd, struct map_session_data *sd); - void (*pHotkey) (int fd, struct map_session_data *sd); + void (*pHotkey1) (int fd, struct map_session_data *sd); + void (*pHotkey2) (int fd, struct map_session_data *sd); void (*pProgressbar) (int fd, struct map_session_data * sd); void (*pWalkToXY) (int fd, struct map_session_data *sd); void (*pQuitGame) (int fd, struct map_session_data *sd); @@ -1483,13 +1549,17 @@ struct clif_interface { void (*pBGQueueRevokeReq) (int fd, struct map_session_data *sd); void (*pBGQueueBattleBeginAck) (int fd, struct map_session_data *sd); /* RagExe Cash Shop [Ind/Hercules] */ - void (*pCashShopOpen) (int fd, struct map_session_data *sd); + void (*pCashShopOpen1) (int fd, struct map_session_data *sd); + void (*pCashShopOpen2) (int fd, struct map_session_data *sd); + void (*pCashShopLimitedReq) (int fd, struct map_session_data *sd); void (*pCashShopClose) (int fd, struct map_session_data *sd); void (*pCashShopReqTab) (int fd, struct map_session_data *sd); void (*pCashShopSchedule) (int fd, struct map_session_data *sd); void (*pCashShopBuy) (int fd, struct map_session_data *sd); void (*pPartyTick) (int fd, struct map_session_data *sd); void (*pGuildInvite2) (int fd, struct map_session_data *sd); + void (*cashShopBuyAck) (int fd, struct map_session_data *sd, int itemId, enum CASH_SHOP_BUY_RESULT result); + void (*cashShopOpen) (int fd, struct map_session_data *sd, int tab); /* Group Search System Update */ void (*pPartyBookingAddFilter) (int fd, struct map_session_data *sd); void (*pPartyBookingSubFilter) (int fd, struct map_session_data *sd); @@ -1515,7 +1585,8 @@ struct clif_interface { void (*pNPCMarketPurchase) (int fd, struct map_session_data *sd); /* */ int (*add_item_options) (struct ItemOptions *buf, const struct item *it); - void (*pHotkeyRowShift) (int fd, struct map_session_data *sd); + void (*pHotkeyRowShift1) (int fd, struct map_session_data *sd); + void (*pHotkeyRowShift2) (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 */ @@ -1576,15 +1647,9 @@ struct clif_interface { void (*pPrivateAirshipRequest) (int fd, struct map_session_data *sd); void (*PrivateAirshipResponse) (struct map_session_data *sd, uint32 flag); - void (*stylist_vector_init) (void); - void (*stylist_vector_clear) (void); - bool (*stylist_read_db_libconfig) (void); - bool (*stylist_read_db_libconfig_sub) (struct config_setting_t *it, int idx, const char *source); - bool (*style_change_validate_requirements) (struct map_session_data *sd, int type, int16 idx); - void (*stylist_send_rodexitem) (struct map_session_data *sd, int itemid); void (*pReqStyleChange) (int fd, struct map_session_data *sd); void (*pReqStyleChange2) (int fd, struct map_session_data *sd); - void (*cz_req_style_change_sub) (struct map_session_data *sd, int type, int16 idx, bool isitem); + void (*pStyleClose) (int fd, struct map_session_data *sd); void (*style_change_response) (struct map_session_data *sd, enum stylist_shop flag); void (*pPetEvolution) (int fd, struct map_session_data *sd); void (*petEvolutionResult) (int fd, enum pet_evolution_result result); @@ -1599,7 +1664,31 @@ struct clif_interface { void (*npc_barter_open) (struct map_session_data *sd, struct npc_data *nd); void (*pNPCBarterClosed) (int fd, struct map_session_data *sd); void (*pNPCBarterPurchase) (int fd, struct map_session_data *sd); + void (*pNPCExpandedBarterClosed) (int fd, struct map_session_data *sd); + void (*pNPCExpandedBarterPurchase) (int fd, struct map_session_data *sd); + void (*npc_expanded_barter_open) (struct map_session_data *sd, struct npc_data *nd); void (*pClientVersion) (int fd, struct map_session_data *sd); + void (*pPing) (int fd, struct map_session_data *sd); + void (*ping) (struct map_session_data *sd); + int (*pingTimer) (int tid, int64 tick, int id, intptr_t data); + int (*pingTimerSub) (struct map_session_data *sd, va_list ap); + void (*pResetCooldown) (int fd, struct map_session_data *sd); + void (*loadConfirm) (struct map_session_data *sd); + void (*send_selforarea) (int fd, struct block_list *bl, const void *buf, int len); + void (*OpenRefineryUI) (struct map_session_data *sd); + void (*pAddItemRefineryUI) (int fd, struct map_session_data *sd); + void (*AddItemRefineryUIAck) (struct map_session_data *sd, int item_index, struct s_refine_requirement *req); + void (*pRefineryUIClose) (int fd, struct map_session_data *sd); + void (*pRefineryUIRefine) (int fd, struct map_session_data *sd); + void (*announce_refine_status) (struct map_session_data *sd, int item_id, int refine_level, bool success, enum send_target target); + void (*pGuildCastleTeleportRequest) (int fd, struct map_session_data *sd); + void (*pGuildCastleInfoRequest) (int fd, struct map_session_data *sd); + void (*guild_castleteleport_res) (struct map_session_data *sd, enum siege_teleport_result result); + bool (*lapineDdukDdak_open) (struct map_session_data *sd, int item_id); + bool (*lapineDdukDdak_result) (struct map_session_data *sd, enum lapineddukddak_result result); + void (*plapineDdukDdak_ack) (int fd, struct map_session_data *sd); + void (*plapineDdukDdak_close) (int fd, struct map_session_data *sd); + void (*pReqGearOff) (int fd, struct map_session_data *sd); }; #ifdef HERCULES_CORE |