diff options
-rw-r--r-- | src/map/clif.c | 16 | ||||
-rw-r--r-- | src/map/clif.h | 9 | ||||
-rw-r--r-- | src/map/packets_struct.h | 9 |
3 files changed, 34 insertions, 0 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index e1e06d890..34bdb4a2a 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -3078,6 +3078,21 @@ static void clif_inventoryExpansionInfo(struct map_session_data *sd) #endif } +static void clif_inventoryExpandAck(struct map_session_data *sd, enum expand_inventory result, int itemId) +{ +#if PACKETVER_ZERO_NUM >= 20181212 + nullpo_retv(sd); + + const int fd = sd->fd; + WFIFOHEAD(fd, sizeof(struct PACKET_ZC_ACK_INVENTORY_EXPAND)); + struct PACKET_ZC_ACK_INVENTORY_EXPAND *p = WFIFOP(fd, 0); + p->packetType = HEADER_ZC_ACK_INVENTORY_EXPAND; + p->result = result; + p->itemId = itemId; + WFIFOSET(fd, sizeof(struct PACKET_ZC_ACK_INVENTORY_EXPAND)); +#endif +} + /// Removes cart (ZC_CARTOFF). /// 012b /// Client behavior: @@ -22544,6 +22559,7 @@ void clif_defaults(void) clif->cartList = clif_cartList; clif->cartItems = clif_cartItems; clif->inventoryExpansionInfo = clif_inventoryExpansionInfo; + clif->inventoryExpandAck = clif_inventoryExpandAck; clif->favorite_item = clif_favorite_item; clif->clearcart = clif_clearcart; clif->item_identify_list = clif_item_identify_list; diff --git a/src/map/clif.h b/src/map/clif.h index de1d2b593..2c3e7499b 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -677,6 +677,14 @@ 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 +}; + /** * Clif.c Interface **/ @@ -852,6 +860,7 @@ struct clif_interface { 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 (*favorite_item) (struct map_session_data* sd, unsigned short index); void (*clearcart) (int fd); void (*item_identify_list) (struct map_session_data *sd); diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 78ed1a83b..663e6cbbf 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -2989,6 +2989,15 @@ struct PACKET_ZC_INVENTORY_EXPANSION_INFO { DEFINE_PACKET_HEADER(ZC_INVENTORY_EXPANSION_INFO, 0x0b18); #endif +#if PACKETVER_ZERO_NUM >= 20181212 +struct PACKET_ZC_ACK_INVENTORY_EXPAND { + int16 packetType; + uint8 result; + uint32 itemId; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_ACK_INVENTORY_EXPAND, 0x0b15); +#endif + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris |