Index: clif.c =================================================================== --- clif.c (revision 17303) +++ clif.c (working copy) @@ -3267,6 +3267,8 @@ /// Notifies the client about the result of a request to equip an item (ZC_REQ_WEAR_EQUIP_ACK). /// 00aa .W .W .B /// 00aa .W .W .W .B (PACKETVER >= 20100629) +/// 08d0 .W .W .W .B +/// 0999 .W .L .W .B /// result: /// 0 = failure /// 1 = success @@ -3274,45 +3276,71 @@ void clif_equipitemack(struct map_session_data *sd,int n,int pos,int ok) { int fd; + int header,offs=0; +#if PACKETVER < 20110824 + header = 0xaa; +#elseif PACKETVER < 20120925 + header = 0x8d0; +#else + header = 0x999; nullpo_retv(sd); fd=sd->fd; - WFIFOHEAD(fd,packet_len(0xaa)); - WFIFOW(fd,0)=0xaa; - WFIFOW(fd,2)=n+2; - WFIFOW(fd,4)=pos; + WFIFOHEAD(fd,packet_len(header)); + WFIFOW(fd,offs+0)=header; + WFIFOW(fd,offs+2)=n+2; +#if PACKETVER >= 20120925 + WFIFOL(fd,offs+4)=(long)pos; + offs+=2; +#else + WFIFOW(fd,offs+4)=pos; #if PACKETVER < 20100629 - WFIFOB(fd,6)=ok; + WFIFOB(fd,offs+6)=ok; #else if (ok && sd->inventory_data[n]->equip&EQP_VISIBLE) - WFIFOW(fd,6)=sd->inventory_data[n]->look; + WFIFOW(fd,offs+6)=sd->inventory_data[n]->look; else - WFIFOW(fd,6)=0; - WFIFOB(fd,8)=ok; + WFIFOW(fd,offs+6)=0; + WFIFOB(fd,offs+8)=ok; #endif - WFIFOSET(fd,packet_len(0xaa)); + WFIFOSET(fd,packet_len(header)); } /// Notifies the client about the result of a request to take off an item (ZC_REQ_TAKEOFF_EQUIP_ACK). /// 00ac .W .W .B +/// 08d1 .W .W .B +/// 099a .W .L .B /// result: /// 0 = failure /// 1 = success void clif_unequipitemack(struct map_session_data *sd,int n,int pos,int ok) { int fd; - + int fd,header,offs=0; +#if PACKETVER < 20110824 + header = 0xac; +#elseif PACKETVER < 20120925 + header = 0x8d1; +#else + header = 0x99a; +#endif nullpo_retv(sd); fd=sd->fd; - WFIFOHEAD(fd,packet_len(0xac)); - WFIFOW(fd,0)=0xac; - WFIFOW(fd,2)=n+2; - WFIFOW(fd,4)=pos; - WFIFOB(fd,6)=ok; - WFIFOSET(fd,packet_len(0xac)); + + WFIFOHEAD(fd,packet_len(header)); + WFIFOW(fd,offs+0)=0xac; + WFIFOW(fd,offs+2)=n+2; +#if PACKETVER >= 20120925 + WFIFOL(fd,offs+4)=(long)pos; + offs +=2; +#else + WFIFOW(fd,offs+4)=pos; +#endif + WFIFOB(fd,offs+6)=ok; + WFIFOSET(fd,packet_len(header)); } @@ -5412,6 +5440,26 @@ } } +void clif_displaymessagecolor(struct map_session_data *sd, const char* msg, unsigned long color) +{ + int fd; + unsigned short len = strlen(msg) + 1; + + nullpo_retv(sd); + + color = (color & 0x0000FF) << 16 | (color & 0x00FF00) | (color & 0xFF0000) >> 16; // RGB to BGR + + fd = sd->fd; + WFIFOHEAD(fd, len+12); + WFIFOW(fd,0) = 0x2C1; + WFIFOW(fd,2) = len+12; + WFIFOL(fd,4) = 0; + WFIFOL(fd,8) = color; + memcpy(WFIFOP(fd,12), msg, len); + WFIFOSET(fd, WFIFOW(fd,2)); +} + + /// Send broadcast message in yellow or blue without font formatting (ZC_BROADCAST). /// 009a .W .?B void clif_broadcast(struct block_list* bl, const char* mes, int len, int type, enum send_target target) @@ -5480,11 +5528,11 @@ aFree(buf); } -/* - * Display *msg from *sd to all *users in channel - */ -void clif_channel_msg(struct Channel *channel, struct map_session_data *sd, char *msg) { - DBIterator *iter; +/* + * Display *msg from *sd to all *users in channel + */ +void clif_channel_msg(struct Channel *channel, struct map_session_data *sd, char *msg) { + DBIterator *iter; struct map_session_data *user; unsigned short msg_len = strlen(msg) + 1; @@ -10183,9 +10231,15 @@ /// Request to equip an item (CZ_REQ_WEAR_EQUIP). /// 00a9 .W .W +/// 0998 .W .L void clif_parse_EquipItem(int fd,struct map_session_data *sd) { - int index; + int index, req_pos; +#if PACKETVER >= 20120925 + req_pos = RFIFOL(fd,4); +#else + req_pos = RFIFOW(fd,4); +#endif if(pc_isdead(sd)) { clif_clearunit_area(&sd->bl,CLR_DEAD); @@ -10220,7 +10274,8 @@ if(sd->inventory_data[index]->type == IT_AMMO) pc_equipitem(sd,index,EQP_AMMO); else - pc_equipitem(sd,index,RFIFOW(fd,4)); + pc_equipitem(sd,index,req_pos); + } @@ -16727,7 +16839,7 @@ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //#0x08C0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, - 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 9, 7, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //#0x0900 @@ -16742,7 +16854,7 @@ 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, //#0x0980 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, + 31, 0, 0, 0, 0, 0, 0, 0, 8, 11, 9, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0,