summaryrefslogtreecommitdiff
path: root/src/map/clif.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/clif.h')
-rw-r--r--src/map/clif.h201
1 files changed, 146 insertions, 55 deletions
diff --git a/src/map/clif.h b/src/map/clif.h
index e3b2a90d3..19c321ed3 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -55,6 +55,7 @@ struct skill_unit;
struct unit_data;
struct view_data;
struct achievement_data; // map/achievement.h
+struct s_refine_requirement;
enum clif_messages;
enum rodex_add_item;
@@ -64,17 +65,13 @@ enum rodex_get_items;
/**
* Defines
**/
-#define packet_len(cmd) packet_db[cmd].len
+#define packet_len(cmd) packets->db[cmd]
#define clif_menuskill_clear(sd) ((sd)->menuskill_id = (sd)->menuskill_val = (sd)->menuskill_val2 = 0)
#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)
-#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 +79,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
**/
@@ -237,13 +239,13 @@ typedef enum emotion_type {
E_MAX
} emotion_type;
-typedef enum clr_type {
+enum clr_type {
CLR_OUTSIGHT = 0,
CLR_DEAD,
CLR_RESPAWN,
CLR_TELEPORT,
CLR_TRICKDEAD,
-} clr_type;
+};
enum map_property { // clif_map_property
MAPPROPERTY_NOTHING = 0,
@@ -409,23 +411,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 {
@@ -493,13 +498,17 @@ enum RECV_ROULETTE_ITEM_ACK {
};
enum GENERATE_ROULETTE_ACK {
- GENERATE_ROULETTE_SUCCESS = 0x0,
- GENERATE_ROULETTE_FAILED = 0x1,
- GENERATE_ROULETTE_NO_ENOUGH_POINT = 0x2,
- GENERATE_ROULETTE_LOSING = 0x3,
+ GENERATE_ROULETTE_SUCCESS = 0x0,
+ GENERATE_ROULETTE_FAILED = 0x1,
+ GENERATE_ROULETTE_NO_ENOUGH_POINT = 0x2,
+ GENERATE_ROULETTE_LOSING = 0x3,
+ GENERATE_ROULETTE_NO_ENOUGH_INVENTORY_SPACE = 0x4,
+#if PACKETVER >= 20141001
+ GENERATE_ROULETTE_CANT_PLAY = 0x5,
+#endif
};
-enum OPEN_ROULETTE_ACK{
+enum OPEN_ROULETTE_ACK {
OPEN_ROULETTE_SUCCESS = 0x0,
OPEN_ROULETTE_FAILED = 0x1,
};
@@ -554,7 +563,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,
};
@@ -583,8 +592,8 @@ enum zc_ui_types {
**/
enum cz_ui_types {
CZ_STYLIST_UI = 1,
- //unknown = 2,
- //unknown = 3,
+ CZ_MACRO_REGISTER_UI = 2,
+ CZ_MACRO_DETECTOR_UI = 3,
CZ_ATTENDANCE_UI = 5
};
@@ -612,11 +621,20 @@ enum pet_evolution_result {
};
/**
+ * Inventory type for clients 2018-09-12 RE +
+ **/
+enum inventory_type {
+ INVTYPE_INVENTORY = 0,
+ INVTYPE_CART = 1,
+ INVTYPE_STORAGE = 2,
+ INVTYPE_GUILD_STORAGE = 3,
+};
+
+/**
* Structures
**/
typedef void (*pFunc)(int, struct map_session_data *); //cant help but put it first
struct s_packet_db {
- short len;
pFunc func;
short pos[MAX_PACKET_POS];
};
@@ -642,15 +660,14 @@ struct attendance_entry {
int qty;
};
-/* Stylist data [Asheraf/Hercules]*/
-struct stylist_data_entry {
- int16 id;
- int32 zeny;
- int itemid;
- int boxid;
- bool allow_doram;
+struct barter_itemlist_entry {
+ int addId;
+ int addAmount;
+ int removeIndex;
+ int shopIndex;
};
-VECTOR_DECL(struct stylist_data_entry) stylist_data[MAX_STYLIST_TYPE];
+
+VECTOR_STRUCT_DECL(barteritemlist, struct barter_itemlist_entry);
/**
* Stylist Shop Responds
@@ -660,6 +677,26 @@ enum stylist_shop {
STYLIST_SHOP_FAILURE
};
+enum memorial_dungeon_command {
+ COMMAND_MEMORIALDUNGEON_DESTROY_FORCE = 0x3,
+};
+
+enum expand_inventory {
+ EXPAND_INVENTORY_ASK_CONFIRMATION = 0,
+ EXPAND_INVENTORY_FAILED = 1,
+ EXPAND_INVENTORY_OTHER_WORK = 2,
+ EXPAND_INVENTORY_MISSING_ITEM = 3,
+ EXPAND_INVENTORY_MAX_SIZE = 4
+};
+
+enum expand_inventory_result {
+ EXPAND_INVENTORY_RESULT_SUCCESS = 0,
+ EXPAND_INVENTORY_RESULT_FAILED = 1,
+ EXPAND_INVENTORY_RESULT_OTHER_WORK = 2,
+ EXPAND_INVENTORY_RESULT_MISSING_ITEM = 3,
+ EXPAND_INVENTORY_RESULT_MAX_SIZE = 4
+};
+
/**
* Clif.c Interface
**/
@@ -670,6 +707,7 @@ struct clif_interface {
uint16 map_port;
char map_ip_str[128];
int map_fd;
+ int cmd;
/* for clif_clearunit_delayed */
struct eri *delay_clearunit_ers;
/* Cash Shop [Ind/Hercules] */
@@ -738,9 +776,9 @@ struct clif_interface {
void (*package_announce) (struct map_session_data *sd, int nameid, int containerid);
void (*item_drop_announce) (struct map_session_data *sd, int nameid, char *monsterName);
/* unit-related */
- void (*clearunit_single) (int id, clr_type type, int fd);
- void (*clearunit_area) (struct block_list* bl, clr_type type);
- void (*clearunit_delayed) (struct block_list* bl, clr_type type, int64 tick);
+ void (*clearunit_single) (int id, enum clr_type type, int fd);
+ void (*clearunit_area) (struct block_list* bl, enum clr_type type);
+ void (*clearunit_delayed) (struct block_list* bl, enum clr_type type, int64 tick);
void (*walkok) (struct map_session_data *sd);
void (*move) (struct unit_data *ud);
void (*move2) (struct block_list *bl, struct view_data *vd, struct unit_data *ud);
@@ -827,9 +865,18 @@ struct clif_interface {
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 (*insert_card) (struct map_session_data *sd,int idx_equip,int idx_card,int flag);
- void (*inventorylist) (struct map_session_data *sd);
- void (*equiplist) (struct map_session_data *sd);
- void (*cartlist) (struct map_session_data *sd);
+ void (*inventoryList) (struct map_session_data *sd);
+ void (*inventoryItems) (struct map_session_data *sd, enum inventory_type type);
+ void (*equipList) (struct map_session_data *sd);
+ void (*equipItems) (struct map_session_data *sd, enum inventory_type type);
+ void (*cartList) (struct map_session_data *sd);
+ void (*cartItems) (struct map_session_data *sd, enum inventory_type type);
+ void (*inventoryExpansionInfo) (struct map_session_data *sd);
+ void (*inventoryExpandAck) (struct map_session_data *sd, enum expand_inventory result, int itemId);
+ void (*inventoryExpandResult) (struct map_session_data *sd, enum expand_inventory_result result);
+ void (*pInventoryExpansion) (int fd, struct map_session_data *sd);
+ void (*pInventoryExpansionConfirmed) (int fd, struct map_session_data *sd);
+ void (*pInventoryExpansionRejected) (int fd, struct map_session_data *sd);
void (*favorite_item) (struct map_session_data* sd, unsigned short index);
void (*clearcart) (int fd);
void (*item_identify_list) (struct map_session_data *sd);
@@ -843,7 +890,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);
@@ -922,6 +981,8 @@ struct clif_interface {
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 (*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 );
void (*spiritcharm) (struct map_session_data *sd);
void (*charm_single) (int fd, struct map_session_data *sd);
@@ -939,6 +1000,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);
@@ -949,6 +1011,7 @@ struct clif_interface {
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 (*serviceMessageColor) (struct map_session_data *sd, uint32 color, const char *msg);
void (*disp_overhead) (struct block_list *bl, const char *mes, enum send_target target, struct block_list *target_bl);
void (*notify_playerchat) (struct block_list *bl, const char *mes);
void (*msgtable) (struct map_session_data* sd, enum clif_messages msg_id);
@@ -966,7 +1029,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);
@@ -986,7 +1049,11 @@ struct clif_interface {
void (*openvendingAck) (int fd, int result);
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 (*storageList) (struct map_session_data* sd, struct item* items, int items_length);
+ void (*guildStorageList) (struct map_session_data* sd, struct item* items, int items_length);
+ void (*storageItems) (struct map_session_data* sd, enum inventory_type type, struct item* items, int items_length);
+ void (*inventoryStart) (struct map_session_data* sd, enum inventory_type type, const char* name);
+ void (*inventoryEnd) (struct map_session_data* sd, enum inventory_type type);
void (*updatestorageamount) (struct map_session_data* sd, int amount, int max_amount);
void (*storageitemadded) (struct map_session_data* sd, struct item* i, int index, int amount);
void (*storageitemremoved) (struct map_session_data* sd, int index, int amount);
@@ -1196,12 +1263,14 @@ struct clif_interface {
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, int bonusItemID);
+ 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);
@@ -1262,7 +1331,10 @@ struct clif_interface {
void (*pChangeCart) (int fd,struct map_session_data *sd);
void (*pStatusUp) (int fd,struct map_session_data *sd);
void (*pSkillUp) (int fd,struct map_session_data *sd);
+ void (*useSkillToIdReal) (int fd, struct map_session_data *sd, int skill_id, int skill_lv, int target_id);
void (*pUseSkillToId) (int fd, struct map_session_data *sd);
+ void (*pStartUseSkillToId) (int fd, struct map_session_data *sd);
+ void (*pStopUseSkillToId) (int fd, struct map_session_data *sd);
void (*pUseSkillToId_homun) (struct homun_data *hd, struct map_session_data *sd, int64 tick, uint16 skill_id, uint16 skill_lv, int target_id);
void (*pUseSkillToId_mercenary) (struct mercenary_data *md, struct map_session_data *sd, int64 tick, uint16 skill_id, uint16 skill_lv, int target_id);
void (*pUseSkillToPos) (int fd, struct map_session_data *sd);
@@ -1428,6 +1500,7 @@ struct clif_interface {
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);
/* Group Search System Update */
void (*pPartyBookingAddFilter) (int fd, struct map_session_data *sd);
void (*pPartyBookingSubFilter) (int fd, struct map_session_data *sd);
@@ -1481,7 +1554,7 @@ struct clif_interface {
void (*pRodexCancelWriteMail) (int fd, struct map_session_data *sd);
void (*pRodexOpenMailbox) (int fd, struct map_session_data *sd);
void (*pRodexCheckName) (int fd, struct map_session_data *sd);
- void (*rodex_checkname_result) (struct map_session_data *sd, int char_id, short class_, int base_level, const char *name);
+ void (*rodex_checkname_result) (struct map_session_data *sd, int char_id, int class_, int base_level, const char *name);
void (*pRodexDeleteMail) (int fd, struct map_session_data *sd);
void (*rodex_delete_mail) (struct map_session_data *sd, int8 opentype, int64 mail_id);
void (*pRodexRefreshMaillist) (int fd, struct map_session_data *sd);
@@ -1514,19 +1587,37 @@ 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);
void (*party_dead_notification) (struct map_session_data *sd);
+ void (*pMemorialDungeonCommand) (int fd, struct map_session_data *sd);
+ void (*camera_showWindow) (struct map_session_data *sd);
+ void (*camera_change) (struct map_session_data *sd, float range, float rotation, float latitude, enum send_target target);
+ void (*pCameraInfo) (int fd, struct map_session_data *sd);
+ void (*item_preview) (struct map_session_data *sd, int n);
+ bool (*enchant_equipment) (struct map_session_data *sd, enum equip_pos pos, int cardSlot, int cardId);
+ void (*pReqRemainTime) (int fd, struct map_session_data *sd);
+ 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 (*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);
};
#ifdef HERCULES_CORE