diff options
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 76 |
1 files changed, 60 insertions, 16 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 827f57c45..1cd18b68d 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1010,7 +1010,7 @@ void clif_set_unit_idle(struct block_list* bl, struct map_session_data *tsd, enu #endif #if PACKETVER >= 20131223 p.AID = bl->id; - p.GID = (sd) ? sd->status.char_id : 0; // CCODE + p.GID = (sd) ? sd->status.char_id : 0; // CCODE #else p.GID = bl->id; #endif @@ -1151,7 +1151,7 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) { #endif #if PACKETVER >= 20131223 p.AID = bl->id; - p.GID = (sd) ? sd->status.char_id : 0; // CCODE + p.GID = (sd) ? sd->status.char_id : 0; // CCODE #else p.GID = bl->id; #endif @@ -1246,7 +1246,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd, #endif #if PACKETVER >= 20131223 p.AID = bl->id; - p.GID = (tsd) ? tsd->status.char_id : 0; // CCODE + p.GID = (tsd) ? tsd->status.char_id : 0; // CCODE #else p.GID = bl->id; #endif @@ -2333,9 +2333,9 @@ void clif_add_random_options(unsigned char* buf, struct item* item) int i; nullpo_retv(buf); for (i = 0; i < 5; i++){ - WBUFW(buf,i*5+0) = 0; // OptIndex - WBUFW(buf,i*5+2) = 0; // Value - WBUFB(buf,i*5+4) = 0; // Param1 + WBUFW(buf,i*5+0) = 0; // OptIndex + WBUFW(buf,i*5+2) = 0; // Value + WBUFB(buf,i*5+4) = 0; // Param1 } } @@ -4330,7 +4330,7 @@ int clif_damage(struct block_list* src, struct block_list* dst, int sdelay, int p.leftDamage = damage2; } #if PACKETVER >= 20131223 - p.is_sp_damaged = 0; // [ToDo] IsSPDamage - Displays blue digits. + p.is_sp_damaged = 0; // TODO: IsSPDamage - Displays blue digits. #endif if(disguised(dst)) { @@ -5078,7 +5078,7 @@ int clif_skill_damage(struct block_list *src, struct block_list *dst, int64 tick // type 6 (ACTION_SKILL) skills. So we have to do a small // hack to set all type 6 to be sent as type 8 ACTION_ATTACK_MULTIPLE #if PACKETVER < 20131223 - WBUFB(buf, 32) = type; + WBUFB(buf, 32) = type; #else WBUFB(buf, 32) = (type == BDT_SKILL) ? BDT_MULTIHIT : type; #endif @@ -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 @@ -17547,18 +17566,18 @@ void clif_maptypeproperty2(struct block_list *bl,enum send_target t) { p.PacketType = maptypeproperty2Type; p.type = 0x28; - p.flag.party = map->list[bl->m].flag.pvp ? 1 : 0; //PARTY - p.flag.guild = (map->list[bl->m].flag.battleground || map_flag_gvg(bl->m)) ? 1 : 0; // GUILD - p.flag.siege = (map->list[bl->m].flag.battleground || map_flag_gvg2(bl->m)) ? 1: 0; // SIEGE - p.flag.mineffect = map_flag_gvg(bl->m) ? 1 : ( (sd && sd->state.lesseffect) ? 1 : 0); // USE_SIMPLE_EFFECT - Forcing /mineffect in castles during WoE (probably redundant? I'm not sure) + p.flag.party = map->list[bl->m].flag.pvp ? 1 : 0; //PARTY + p.flag.guild = (map->list[bl->m].flag.battleground || map_flag_gvg(bl->m)) ? 1 : 0; // GUILD + p.flag.siege = (map->list[bl->m].flag.battleground || map_flag_gvg2(bl->m)) ? 1: 0; // SIEGE + p.flag.mineffect = map_flag_gvg(bl->m) ? 1 : ( (sd && sd->state.lesseffect) ? 1 : 0); // USE_SIMPLE_EFFECT - Forcing /mineffect in castles during WoE (probably redundant? I'm not sure) p.flag.nolockon = 0; // DISABLE_LOCKON - TODO - p.flag.countpk = map->list[bl->m].flag.pvp ? 1 : 0; // COUNT_PK - p.flag.nopartyformation = map->list[bl->m].flag.partylock ? 1 : 0; // NO_PARTY_FORMATION - p.flag.bg = map->list[bl->m].flag.battleground ? 1 : 0; // BATTLEFIELD + p.flag.countpk = map->list[bl->m].flag.pvp ? 1 : 0; // COUNT_PK + p.flag.nopartyformation = map->list[bl->m].flag.partylock ? 1 : 0; // NO_PARTY_FORMATION + p.flag.bg = map->list[bl->m].flag.battleground ? 1 : 0; // BATTLEFIELD p.flag.nocostume = (map->list[bl->m].flag.noviewid & EQP_COSTUME) ? 1 : 0; // DISABLE_COSTUMEITEM - Disables Costume Sprite p.flag.usecart = 1; // USECART - TODO p.flag.summonstarmiracle = 0; // SUNMOONSTAR_MIRACLE - TODO - p.flag.SpareBits = 0; // UNUSED + p.flag.SpareBits = 0; // UNUSED clif->send(&p,sizeof(p),bl,t); #endif @@ -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_CARTDECORATION_CARTS); + WFIFOW(fd, 0) = 0x97f; + WFIFOW(fd, 2) = 8 + MAX_CARTDECORATION_CARTS; + WFIFOL(fd, 4) = sd->status.account_id; + + for (i = 0; i < MAX_CARTDECORATION_CARTS; i++) { + WFIFOB(fd, 8 + i) = MAX_BASE_CARTS + 1 + i; + } + + WFIFOSET(fd, 8 + MAX_CARTDECORATION_CARTS); +#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; |