diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/mmo.h | 16 | ||||
-rw-r--r-- | src/map/clif.c | 44 | ||||
-rw-r--r-- | src/map/clif.h | 3 | ||||
-rw-r--r-- | src/map/packets.h | 5 | ||||
-rw-r--r-- | src/map/skill.c | 9 |
5 files changed, 71 insertions, 6 deletions
diff --git a/src/common/mmo.h b/src/common/mmo.h index eb1d7cc8e..17e6078fc 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -98,13 +98,19 @@ #endif // 20090603 #endif // 20070227 -/* Feb 1st 2012 */ -#if PACKETVER >= 20120201 -# define NEW_CARTS -# define MAX_CARTS 9 +#if PACKETVER >= 20150805 /* Cart Decoration */ + #define CART_DECORATION + #define MAX_CARTDECORATION_CARTS 3 // Currently there are 3 Carts available in kRO. [Frost] #else -# define MAX_CARTS 5 + #define MAX_CARTDECORATION_CARTS 0 #endif +#if PACKETVER >= 20120201 /* New Geneticist Carts */ + #define NEW_CARTS + #define MAX_BASE_CARTS 9 +#else + #define MAX_BASE_CARTS 5 +#endif +#define MAX_CARTS (MAX_BASE_CARTS + MAX_CARTDECORATION_CARTS) #define MAX_INVENTORY 100 //Max number of characters per account. Note that changing this setting alone is not enough if the client is not hexed to support more characters as well. diff --git a/src/map/clif.c b/src/map/clif.c index 827f57c45..b9c7afa2f 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10874,6 +10874,25 @@ void clif_parse_ChangeCart(int fd,struct map_session_data *sd) pc->setcart(sd,type); } +/// Request to select cart's visual look for new cart design (CZ_SELECTCART). +/// 0980 <identity>.L <type>.B +void clif_parse_SelectCart(int fd, struct map_session_data *sd) +{ +#if PACKETVER >= 20150805 // RagexeRE + int type; + + if (!sd || !pc->checkskill(sd, MC_CARTDECORATE) || RFIFOL(fd, 2) != sd->status.account_id) + return; + + type = (int)RFIFOB(fd, 6); + + if (type <= MAX_BASE_CARTS || type > MAX_CARTS) + return; + + pc->setcart(sd, type); +#endif +} + void clif_parse_StatusUp(int fd,struct map_session_data *sd) __attribute__((nonnull (2))); /// Request to increase status (CZ_STATUS_CHANGE). /// 00bb <status id>.W <amount>.B @@ -18607,6 +18626,28 @@ void clif_dressroom_open(struct map_session_data *sd, int view) WFIFOSET(fd,packet_len(0xa02)); } +/// Request to select cart's visual look for new cart design (ZC_SELECTCART). +/// 097f <Length>.W <identity>.L <type>.B +void clif_selectcart(struct map_session_data *sd) +{ +#if PACKETVER >= 20150805 + int i = 0, fd; + + fd = sd->fd; + + WFIFOHEAD(fd, 8 + MAX_CART_DECORATION); + WFIFOW(fd, 0) = 0x97f; + WFIFOW(fd, 2) = 8 + MAX_CART_DECORATION; + WFIFOL(fd, 4) = sd->status.account_id; + + for (i = 0; i < MAX_CART_DECORATION; i++) { + WFIFOB(fd, 8 + i) = MAX_BASE_CARTS + 1 + i; + } + + WFIFOSET(fd, 8 + MAX_CART_DECORATION); +#endif +} + /* */ unsigned short clif_decrypt_cmd( int cmd, struct map_session_data *sd ) { if( sd ) { @@ -19419,6 +19460,8 @@ void clif_defaults(void) { clif->cancelmergeitem = clif_cancelmergeitem; clif->comparemergeitem = clif_comparemergeitem; clif->ackmergeitems = clif_ackmergeitems; + /* Cart Deco */ + clif->selectcart = clif_selectcart; /*------------------------ *- Parse Incoming Packet @@ -19467,6 +19510,7 @@ void clif_defaults(void) { clif->pGetItemFromCart = clif_parse_GetItemFromCart; clif->pRemoveOption = clif_parse_RemoveOption; clif->pChangeCart = clif_parse_ChangeCart; + clif->pSelectCart = clif_parse_SelectCart; clif->pStatusUp = clif_parse_StatusUp; clif->pSkillUp = clif_parse_SkillUp; clif->pUseSkillToId = clif_parse_UseSkillToId; diff --git a/src/map/clif.h b/src/map/clif.h index 5a6b01d31..7567e507b 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -1338,6 +1338,9 @@ struct clif_interface { void (*add_random_options) (unsigned char* buf, struct item* item); void (*pHotkeyRowShift) (int fd, struct map_session_data *sd); void (*dressroom_open) (struct map_session_data *sd, int view); + /* Cart Deco */ + void(*selectcart) (struct map_session_data *sd); + void(*pSelectCart) (int fd, struct map_session_data *sd); }; #ifdef HERCULES_CORE diff --git a/src/map/packets.h b/src/map/packets.h index 9b9c7945f..f468cd3df 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -2915,6 +2915,11 @@ packet(0x96e,-1,clif->ackmergeitems); packet(0x0a02,4); // ZC_DRESSROOM_OPEN #endif +#if PACKETVER >= 20150805 // RagexeRE + packet(0x097f,-1); // ZC_SELECTCART + packet(0x0980,7,clif->pSelectCart); // CZ_SELECTCART +#endif + /* PacketKeys: http://herc.ws/board/topic/1105-hercules-wpe-free-june-14th-patch/ */ #if PACKETVER >= 20110817 packetKeys(0x053D5CED,0x3DED6DED,0x6DED6DED); /* Thanks to Shakto */ diff --git a/src/map/skill.c b/src/map/skill.c index b3c264e43..d9ced959a 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -6047,7 +6047,14 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin break; case MC_CHANGECART: - clif->skill_nodamage(src,bl,skill_id,skill_lv,1); + clif->skill_nodamage(src, bl, skill_id, skill_lv, 1); + break; + + case MC_CARTDECORATE: + if (sd) { + clif->skill_nodamage(src, bl, skill_id, skill_lv, 1); + clif->selectcart(sd); + } break; case TK_MISSION: |