|
|
|
@ -945,6 +945,7 @@ static int clif_set_unit_idle(struct block_list* bl, unsigned char* buffer, bool
|
|
|
|
|
struct map_session_data* sd;
|
|
|
|
|
struct status_change* sc = status_get_sc(bl);
|
|
|
|
|
struct view_data* vd = status_get_viewdata(bl);
|
|
|
|
|
struct status_data *status = NULL;
|
|
|
|
|
unsigned char *buf = WBUFP(buffer, 0);
|
|
|
|
|
#if PACKETVER < 20091103
|
|
|
|
|
bool type = !pcdb_checkid(vd->class_);
|
|
|
|
@ -970,16 +971,27 @@ static int clif_set_unit_idle(struct block_list* bl, unsigned char* buffer, bool
|
|
|
|
|
WBUFW(buf,0) = spawn ? 0x2ed : 0x2ee;
|
|
|
|
|
#elif PACKETVER < 20101124
|
|
|
|
|
WBUFW(buf,0) = spawn ? 0x7f8 : 0x7f9;
|
|
|
|
|
#else
|
|
|
|
|
#elif PACKETVER < 20131223
|
|
|
|
|
WBUFW(buf,0) = spawn ? 0x858 : 0x857;
|
|
|
|
|
#elif PACKETVER < 20150513
|
|
|
|
|
WBUFW(buf,0) = spawn ? 0x9dc : 0x9dd;
|
|
|
|
|
#else
|
|
|
|
|
WBUFW(buf,0) = spawn ? 0x9fe : 0x9ff;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if PACKETVER >= 20091103
|
|
|
|
|
name = status_get_name(bl);
|
|
|
|
|
#if PACKETVER >= 20131223
|
|
|
|
|
status = status_get_status_data(bl);
|
|
|
|
|
#if PACKETVER < 20110111
|
|
|
|
|
WBUFW(buf,2) = (spawn ? 62 : 63)+strlen(name);
|
|
|
|
|
#else
|
|
|
|
|
#elif PACKETVER < 20131223
|
|
|
|
|
WBUFW(buf,2) = (spawn ? 64 : 65)+strlen(name);
|
|
|
|
|
#elif PACKETVER < 20150513
|
|
|
|
|
WBUFW(buf,2) = (spawn ? 77 : 78)+strlen(name);
|
|
|
|
|
#else
|
|
|
|
|
WBUFW(buf,2) = (spawn ? 79 : 80)+strlen(name);
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
WBUFB(buf,4) = clif_bl_type(bl);
|
|
|
|
|
offset+=3;
|
|
|
|
@ -992,6 +1004,11 @@ static int clif_set_unit_idle(struct block_list* bl, unsigned char* buffer, bool
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
WBUFL(buf, 2) = bl->id;
|
|
|
|
|
#if PACKETVER >= 20131223
|
|
|
|
|
WBUFL(buf,6) = (sd) ? sd->status.char_id : 0; // GID/CCODE
|
|
|
|
|
offset+=4;
|
|
|
|
|
buf = WBUFP(buffer,offset);
|
|
|
|
|
#endif
|
|
|
|
|
WBUFW(buf, 6) = status_get_speed(bl);
|
|
|
|
|
WBUFW(buf, 8) = (sc)? sc->opt1 : 0;
|
|
|
|
|
WBUFW(buf,10) = (sc)? sc->opt2 : 0;
|
|
|
|
@ -1095,8 +1112,24 @@ static int clif_set_unit_idle(struct block_list* bl, unsigned char* buffer, bool
|
|
|
|
|
#if PACKETVER >= 20080102
|
|
|
|
|
WBUFW(buf,53) = (sd ? sd->status.font : 0);
|
|
|
|
|
#endif
|
|
|
|
|
#if PACKETVER >= 20131223
|
|
|
|
|
if ( battle_config.monster_hp_bars_info && bl->type == BL_MOB && status_get_hp(bl) < status_get_max_hp(bl) ) {
|
|
|
|
|
WBUFL(buf,55) = status_get_max_hp(bl); // maxHP
|
|
|
|
|
WBUFL(buf,59) = status_get_hp(bl); // HP
|
|
|
|
|
WBUFB(buf,63) = (status->mode&MD_BOSS) ? 1 : 0; // isBoss
|
|
|
|
|
} else {
|
|
|
|
|
WBUFL(buf,55) = -1; // maxHP
|
|
|
|
|
WBUFL(buf,59) = -1; // HP
|
|
|
|
|
WBUFB(buf,63) = 0; // isBoss
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
#if PACKETVER >= 20150513
|
|
|
|
|
WBUFW(buf,64) = 0; // body
|
|
|
|
|
offset+= 2;
|
|
|
|
|
buf = WBUFP(buffer,offset);
|
|
|
|
|
#endif
|
|
|
|
|
#if PACKETVER >= 20091103
|
|
|
|
|
memcpy((char*)WBUFP(buf,55), name, NAME_LENGTH);
|
|
|
|
|
memcpy((char*)WBUFP(buf,64), name, NAME_LENGTH);
|
|
|
|
|
return WBUFW(buffer,2);
|
|
|
|
|
#else
|
|
|
|
|
return packet_len(WBUFW(buffer,0));
|
|
|
|
@ -1111,6 +1144,7 @@ static int clif_set_unit_walking(struct block_list* bl, struct unit_data* ud, un
|
|
|
|
|
struct map_session_data* sd;
|
|
|
|
|
struct status_change* sc = status_get_sc(bl);
|
|
|
|
|
struct view_data* vd = status_get_viewdata(bl);
|
|
|
|
|
struct status_data *status = NULL;
|
|
|
|
|
unsigned char* buf = WBUFP(buffer,0);
|
|
|
|
|
#if PACKETVER >= 7
|
|
|
|
|
unsigned short offset = 0;
|
|
|
|
@ -1131,16 +1165,27 @@ static int clif_set_unit_walking(struct block_list* bl, struct unit_data* ud, un
|
|
|
|
|
WBUFW(buf, 0) = 0x2ec;
|
|
|
|
|
#elif PACKETVER < 20101124
|
|
|
|
|
WBUFW(buf, 0) = 0x7f7;
|
|
|
|
|
#else
|
|
|
|
|
#elif PACKETVER < 20131223
|
|
|
|
|
WBUFW(buf, 0) = 0x856;
|
|
|
|
|
#elif PACKETVER < 20150513
|
|
|
|
|
WBUFW(buf, 0) = 0x9db;
|
|
|
|
|
#else
|
|
|
|
|
WBUFW(buf, 0) = 0x9fd;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if PACKETVER >= 20091103
|
|
|
|
|
name = status_get_name(bl);
|
|
|
|
|
#if PACKETVER >= 20131223
|
|
|
|
|
status = status_get_status_data(bl);
|
|
|
|
|
#if PACKETVER < 20110111
|
|
|
|
|
WBUFW(buf, 2) = 69+strlen(name);
|
|
|
|
|
#else
|
|
|
|
|
#elif PACKETVER < 20131223
|
|
|
|
|
WBUFW(buf, 2) = 71+strlen(name);
|
|
|
|
|
#elif PACKETVER < 20150513
|
|
|
|
|
WBUFW(buf, 2) = 84+strlen(name);
|
|
|
|
|
#else
|
|
|
|
|
WBUFW(buf, 2) = 86+strlen(name);
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
offset+=2;
|
|
|
|
|
buf = WBUFP(buffer,offset);
|
|
|
|
@ -1151,6 +1196,11 @@ static int clif_set_unit_walking(struct block_list* bl, struct unit_data* ud, un
|
|
|
|
|
buf = WBUFP(buffer,offset);
|
|
|
|
|
#endif
|
|
|
|
|
WBUFL(buf, 2) = bl->id;
|
|
|
|
|
#if PACKETVER >= 20131223
|
|
|
|
|
WBUFL(buf,6) = (sd) ? sd->status.char_id : 0; // GID/CCODE
|
|
|
|
|
offset+=4;
|
|
|
|
|
buf = WBUFP(buffer,offset);
|
|
|
|
|
#endif
|
|
|
|
|
WBUFW(buf, 6) = status_get_speed(bl);
|
|
|
|
|
WBUFW(buf, 8) = (sc)? sc->opt1 : 0;
|
|
|
|
|
WBUFW(buf,10) = (sc)? sc->opt2 : 0;
|
|
|
|
@ -1202,8 +1252,24 @@ static int clif_set_unit_walking(struct block_list* bl, struct unit_data* ud, un
|
|
|
|
|
#if PACKETVER >= 20080102
|
|
|
|
|
WBUFW(buf,60) = (sd ? sd->status.font : 0);
|
|
|
|
|
#endif
|
|
|
|
|
#if PACKETVER >= 20131223
|
|
|
|
|
if ( battle_config.monster_hp_bars_info && bl->type == BL_MOB && status_get_hp(bl) < status_get_max_hp(bl) ) {
|
|
|
|
|
WBUFL(buf,62) = status_get_max_hp(bl); // maxHP
|
|
|
|
|
WBUFL(buf,66) = status_get_hp(bl); // HP
|
|
|
|
|
WBUFB(buf,70) = (status->mode&MD_BOSS) ? 1 : 0; // isBoss
|
|
|
|
|
} else {
|
|
|
|
|
WBUFL(buf,62) = -1; // maxHP
|
|
|
|
|
WBUFL(buf,66) = -1; // HP
|
|
|
|
|
WBUFB(buf,70) = 0; // isBoss
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
#if PACKETVER >= 20150513
|
|
|
|
|
WBUFW(buf,71) = 0; // body
|
|
|
|
|
offset+= 2;
|
|
|
|
|
buf = WBUFP(buffer,offset);
|
|
|
|
|
#endif
|
|
|
|
|
#if PACKETVER >= 20091103
|
|
|
|
|
memcpy((char*)WBUFP(buf,62), name, NAME_LENGTH);
|
|
|
|
|
memcpy((char*)WBUFP(buf,71), name, NAME_LENGTH);
|
|
|
|
|
return WBUFW(buffer,2);
|
|
|
|
|
#else
|
|
|
|
|
return packet_len(WBUFW(buffer,0));
|
|
|
|
@ -1404,23 +1470,32 @@ int clif_spawn(struct block_list *bl)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Sends information about owned homunculus to the client (ZC_PROPERTY_HOMUN). [orn]
|
|
|
|
|
/// 022e <name>.24B <modified>.B <level>.W <hunger>.W <intimacy>.W <equip id>.W <atk>.W <matk>.W <hit>.W <crit>.W <def>.W <mdef>.W <flee>.W <aspd>.W <hp>.W <max hp>.W <sp>.W <max sp>.W <exp>.L <max exp>.L <skill points>.W <atk range>.W
|
|
|
|
|
/// Sends information about owned homunculus to the client . [orn]
|
|
|
|
|
/// 022e <name>.24B <modified>.B <level>.W <hunger>.W <intimacy>.W <equip id>.W <atk>.W <matk>.W <hit>.W <crit>.W <def>.W <mdef>.W <flee>.W <aspd>.W <hp>.W <max hp>.W <sp>.W <max sp>.W <exp>.L <max exp>.L <skill points>.W <atk range>.W (ZC_PROPERTY_HOMUN)
|
|
|
|
|
/// 09f7 <name>.24B <modified>.B <level>.W <hunger>.W <intimacy>.W <equip id>.W <atk>.W <matk>.W <hit>.W <crit>.W <def>.W <mdef>.W <flee>.W <aspd>.W <hp>.W <max hp>.W <sp>.W <max sp>.W <exp>.L <max exp>.L <skill points>.W <atk range>.W (ZC_PROPERTY_HOMUN_2)
|
|
|
|
|
void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag)
|
|
|
|
|
{
|
|
|
|
|
struct status_data *status;
|
|
|
|
|
unsigned char buf[128];
|
|
|
|
|
#if PACKETVER < 20131223
|
|
|
|
|
const int cmd = 0x22e;
|
|
|
|
|
int offset = 0;
|
|
|
|
|
#else
|
|
|
|
|
const int cmd = 0x9f7;
|
|
|
|
|
int offset = 2;
|
|
|
|
|
#endif
|
|
|
|
|
int htype;
|
|
|
|
|
|
|
|
|
|
nullpo_retv(hd);
|
|
|
|
|
|
|
|
|
|
if (!clif_session_isValid(sd))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
status = &hd->battle_status;
|
|
|
|
|
htype = hom_class2type(hd->homunculus.class_);
|
|
|
|
|
|
|
|
|
|
memset(buf,0,packet_len(0x22e));
|
|
|
|
|
WBUFW(buf,0)=0x22e;
|
|
|
|
|
memset(buf,0,packet_len(cmd));
|
|
|
|
|
WBUFW(buf,0) = cmd;
|
|
|
|
|
memcpy(WBUFP(buf,2), hd->homunculus.name, NAME_LENGTH);
|
|
|
|
|
// Bit field, bit 0 : rename_flag (1 = already renamed), bit 1 : homunc vaporized (1 = true), bit 2 : homunc dead (1 = true)
|
|
|
|
|
WBUFB(buf,26) = (battle_config.hom_rename ? 0 : hd->homunculus.rename_flag) | (hd->homunculus.vaporize << 1) | (hd->homunculus.hp ? 0 : 4);
|
|
|
|
@ -1450,34 +1525,37 @@ void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag)
|
|
|
|
|
WBUFW(buf,49) = (flag) ? 0 : status->amotion;
|
|
|
|
|
if (status->max_hp > INT16_MAX) {
|
|
|
|
|
WBUFW(buf,51) = status->hp/(status->max_hp/100);
|
|
|
|
|
WBUFW(buf,53) = 100;
|
|
|
|
|
WBUFW(buf,53+offset) = 100;
|
|
|
|
|
} else {
|
|
|
|
|
WBUFW(buf,51) = status->hp;
|
|
|
|
|
WBUFW(buf,53)=status->max_hp;
|
|
|
|
|
WBUFW(buf,53+offset) = status->max_hp;
|
|
|
|
|
}
|
|
|
|
|
#if PACKETVER >= 20131223
|
|
|
|
|
offset += 2;
|
|
|
|
|
#endif
|
|
|
|
|
if (status->max_sp > INT16_MAX) {
|
|
|
|
|
WBUFW(buf,55) = status->sp/(status->max_sp/100);
|
|
|
|
|
WBUFW(buf,57) = 100;
|
|
|
|
|
WBUFW(buf,55+offset) = status->sp/(status->max_sp/100);
|
|
|
|
|
WBUFW(buf,57+offset) = 100;
|
|
|
|
|
} else {
|
|
|
|
|
WBUFW(buf,55)=status->sp;
|
|
|
|
|
WBUFW(buf,57)=status->max_sp;
|
|
|
|
|
WBUFW(buf,55+offset) = status->sp;
|
|
|
|
|
WBUFW(buf,57+offset) = status->max_sp;
|
|
|
|
|
}
|
|
|
|
|
WBUFL(buf,59)=hd->homunculus.exp;
|
|
|
|
|
WBUFL(buf,63)=hd->exp_next;
|
|
|
|
|
WBUFL(buf,59+offset) = hd->homunculus.exp;
|
|
|
|
|
WBUFL(buf,63+offset) = hd->exp_next;
|
|
|
|
|
switch( htype ) {
|
|
|
|
|
case HT_REG:
|
|
|
|
|
case HT_EVO:
|
|
|
|
|
if( hd->homunculus.level >= battle_config.hom_max_level )
|
|
|
|
|
WBUFL(buf,63)=0;
|
|
|
|
|
WBUFL(buf,63+offset) = 0;
|
|
|
|
|
break;
|
|
|
|
|
case HT_S:
|
|
|
|
|
if( hd->homunculus.level >= battle_config.hom_S_max_level )
|
|
|
|
|
WBUFL(buf,63)=0;
|
|
|
|
|
WBUFL(buf,63+offset) = 0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
WBUFW(buf,67)=hd->homunculus.skillpts;
|
|
|
|
|
WBUFW(buf,69)=status_get_range(&hd->bl);
|
|
|
|
|
clif_send(buf,packet_len(0x22e),&sd->bl,SELF);
|
|
|
|
|
WBUFW(buf,67+offset) = hd->homunculus.skillpts;
|
|
|
|
|
WBUFW(buf,69+offset) = status_get_range(&hd->bl);
|
|
|
|
|
clif_send(buf,packet_len(cmd),&sd->bl,SELF);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2331,12 +2409,25 @@ static void clif_addcards(unsigned char* buf, struct item* item)
|
|
|
|
|
WBUFW(buf,6) = item->card[i];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Fills in part of the item buffers that calls for variable bonuses data. [Rytech]
|
|
|
|
|
static void clif_add_random_options(unsigned char* buf, struct item* item)
|
|
|
|
|
{
|
|
|
|
|
// Dummy data used since this feature isnt supported yet (ITEM_RDM_OPT).
|
|
|
|
|
// A max of 5 random options can be supported.
|
|
|
|
|
int i;
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Notifies the client, about a received inventory item or the result of a pick-up request.
|
|
|
|
|
/// 00a0 <index>.W <amount>.W <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W <equip location>.W <item type>.B <result>.B (ZC_ITEM_PICKUP_ACK)
|
|
|
|
|
/// 029a <index>.W <amount>.W <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W <equip location>.W <item type>.B <result>.B <expire time>.L (ZC_ITEM_PICKUP_ACK2)
|
|
|
|
|
/// 02d4 <index>.W <amount>.W <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W <equip location>.W <item type>.B <result>.B <expire time>.L <bindOnEquipType>.W (ZC_ITEM_PICKUP_ACK3)
|
|
|
|
|
/// 0990 <index>.W <amount>.W <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W <equip location>.L <item type>.B <result>.B <expire time>.L <bindOnEquipType>.W (ZC_ITEM_PICKUP_ACK_V5)
|
|
|
|
|
/// 0a0c <index>.W <amount>.W <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W <equip location>.L <item type>.B <result>.B <expire time>.L <bindOnEquipType>.W (ZC_ITEM_PICKUP_ACK_V6)
|
|
|
|
|
void clif_additem(struct map_session_data *sd, int n, int amount, unsigned char fail)
|
|
|
|
|
{
|
|
|
|
|
int fd, header, offs=0;
|
|
|
|
@ -2346,8 +2437,10 @@ void clif_additem(struct map_session_data *sd, int n, int amount, unsigned char
|
|
|
|
|
header = 0x29a;
|
|
|
|
|
#elif PACKETVER < 20120925
|
|
|
|
|
header = 0x2d4;
|
|
|
|
|
#else
|
|
|
|
|
#elif PACKETVER < 20150226
|
|
|
|
|
header = 0x990;
|
|
|
|
|
#else
|
|
|
|
|
header = 0xa0c;
|
|
|
|
|
#endif
|
|
|
|
|
nullpo_retv(sd);
|
|
|
|
|
|
|
|
|
@ -2382,6 +2475,9 @@ void clif_additem(struct map_session_data *sd, int n, int amount, unsigned char
|
|
|
|
|
#endif
|
|
|
|
|
#if PACKETVER >= 20071002
|
|
|
|
|
WFIFOW(fd,offs+27) = 0; // HireExpireDate
|
|
|
|
|
#if PACKETVER >= 20150226
|
|
|
|
|
clif_add_random_options(WFIFOP(fd,offs+31), &sd->status.inventory[n]);
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -2414,6 +2510,9 @@ void clif_additem(struct map_session_data *sd, int n, int amount, unsigned char
|
|
|
|
|
#if PACKETVER >= 20071002
|
|
|
|
|
/* Yellow color only for non-stackable item */
|
|
|
|
|
WFIFOW(fd,offs+27) = (sd->status.inventory[n].bound && !itemdb_isstackable(sd->status.inventory[n].nameid)) ? BOUND_DISPYELLOW : sd->inventory_data[n]->flag.bindOnEquip ? BOUND_ONEQUIP : 0;
|
|
|
|
|
#endif
|
|
|
|
|
#if PACKETVER >= 20150226
|
|
|
|
|
clif_add_random_options(WFIFOP(fd,31), &sd->status.inventory[n]);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2471,6 +2570,7 @@ void clif_delitem(struct map_session_data *sd,int n,int amount, short reason)
|
|
|
|
|
|
|
|
|
|
void clif_item_sub_v5(unsigned char *buf, int n, int idx, struct item *it, struct item_data *id, int equip) {
|
|
|
|
|
char normal = (equip < 0);
|
|
|
|
|
int offset = 0;
|
|
|
|
|
|
|
|
|
|
WBUFW(buf,n) = idx; //index
|
|
|
|
|
WBUFW(buf,n+2) = (id->view_id > 0) ? id->view_id : it->nameid;
|
|
|
|
@ -2484,10 +2584,16 @@ void clif_item_sub_v5(unsigned char *buf, int n, int idx, struct item *it, struc
|
|
|
|
|
WBUFL(buf,n+22) = it->expire_time;
|
|
|
|
|
WBUFW(buf,n+26) = it->bound ? BOUND_DISPYELLOW : id->flag.bindOnEquip ? BOUND_ONEQUIP : 0; //bindOnEquipType
|
|
|
|
|
WBUFW(buf,n+28) = (id->equip&EQP_VISIBLE) ? id->look : 0;
|
|
|
|
|
#if PACKETVER >= 20150226
|
|
|
|
|
//V6_ITEM_Option
|
|
|
|
|
WBUFB(buf,n+30) = 0; // nRandomOptionCnt
|
|
|
|
|
clif_add_random_options(WBUFP(buf, n+31), it);// optionData
|
|
|
|
|
offset += 26;
|
|
|
|
|
#endif
|
|
|
|
|
//V5_ITEM_flag
|
|
|
|
|
WBUFB(buf,n+30) = it->identify; //0x1 IsIdentified
|
|
|
|
|
WBUFB(buf,n+30) |= (it->attribute) ? 0x2 : 0; //0x2 IsDamaged
|
|
|
|
|
WBUFB(buf,n+30) |= (it->favorite) ? 0x4 : 0; //0x4 PlaceETCTab
|
|
|
|
|
WBUFB(buf,n+30+offset) = it->identify; //0x1 IsIdentified
|
|
|
|
|
WBUFB(buf,n+30+offset) |= (it->attribute) ? 0x2 : 0; //0x2 IsDamaged
|
|
|
|
|
WBUFB(buf,n+30+offset) |= (it->favorite) ? 0x4 : 0; //0x4 PlaceETCTab
|
|
|
|
|
}
|
|
|
|
|
else { //normal 24B
|
|
|
|
|
WBUFW(buf,n+5) = it->amount;
|
|
|
|
@ -2559,8 +2665,10 @@ void clif_inventorylist(struct map_session_data *sd) {
|
|
|
|
|
const int se = 26;
|
|
|
|
|
#elif PACKETVER < 20120925
|
|
|
|
|
const int se = 28;
|
|
|
|
|
#else
|
|
|
|
|
#elif PACKETVER < 20150226
|
|
|
|
|
const int se = 31;
|
|
|
|
|
#else
|
|
|
|
|
const int se = 57;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
buf = (unsigned char*)aMalloc(MAX_INVENTORY * s + 4);
|
|
|
|
@ -2605,8 +2713,10 @@ void clif_inventorylist(struct map_session_data *sd) {
|
|
|
|
|
WBUFW(bufe,0)=0xa4;
|
|
|
|
|
#elif PACKETVER < 20120925
|
|
|
|
|
WBUFW(bufe,0)=0x2d0;
|
|
|
|
|
#else
|
|
|
|
|
#elif PACKETVER < 20150226
|
|
|
|
|
WBUFW(bufe,0)=0x992;
|
|
|
|
|
#else
|
|
|
|
|
WBUFW(bufe,0)=0xa0d;
|
|
|
|
|
#endif
|
|
|
|
|
WBUFW(bufe,2)=4+ne*se;
|
|
|
|
|
clif_send(bufe, WBUFW(bufe,2), &sd->bl, SELF);
|
|
|
|
@ -2635,8 +2745,10 @@ void clif_equiplist(struct map_session_data *sd)
|
|
|
|
|
const int cmd = 26;
|
|
|
|
|
#elif PACKETVER < 20120925
|
|
|
|
|
const int cmd = 28;
|
|
|
|
|
#else
|
|
|
|
|
#elif PACKETVER < 20150226
|
|
|
|
|
const int cmd = 31;
|
|
|
|
|
#else
|
|
|
|
|
const int cmd = 57;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
WFIFOHEAD(fd, MAX_INVENTORY * cmd + 4);
|
|
|
|
@ -2657,8 +2769,10 @@ void clif_equiplist(struct map_session_data *sd)
|
|
|
|
|
WBUFW(buf,0)=0xa4;
|
|
|
|
|
#elif PACKETVER < 20120925
|
|
|
|
|
WBUFW(buf,0)=0x2d0;
|
|
|
|
|
#else
|
|
|
|
|
#elif PACKETVER < 20150226
|
|
|
|
|
WBUFW(buf,0)=0x992;
|
|
|
|
|
#else
|
|
|
|
|
WBUFW(buf,0)=0xa0d;
|
|
|
|
|
#endif
|
|
|
|
|
WBUFW(buf,2)=4+n*cmd;
|
|
|
|
|
WFIFOSET(fd,WFIFOW(fd,2));
|
|
|
|
@ -2701,10 +2815,14 @@ void clif_storagelist(struct map_session_data* sd, struct item* items, int items
|
|
|
|
|
const int se = 28;
|
|
|
|
|
const int sidxe = 4;
|
|
|
|
|
const int cmde = 0x2d1;
|
|
|
|
|
#else
|
|
|
|
|
#elif PACKETVER < 20150226
|
|
|
|
|
const int se = 31;
|
|
|
|
|
const int sidxe = 4+24;
|
|
|
|
|
const int cmde = 0x996;
|
|
|
|
|
#else
|
|
|
|
|
const int se = 57;
|
|
|
|
|
const int sidxe = 4+24;
|
|
|
|
|
const int cmde = 0xa10;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
buf = (unsigned char*)aMalloc(items_length * s + sidx);
|
|
|
|
@ -2774,8 +2892,10 @@ void clif_cartlist(struct map_session_data *sd)
|
|
|
|
|
const int cmd = 26;
|
|
|
|
|
#elif PACKETVER < 20120925
|
|
|
|
|
const int cmd = 28;
|
|
|
|
|
#else
|
|
|
|
|
#elif PACKETVER < 20150226
|
|
|
|
|
const int cmd = 31;
|
|
|
|
|
#else
|
|
|
|
|
const int cmd = 57;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
buf = (unsigned char*)aMalloc(MAX_CART * s + 4);
|
|
|
|
@ -2815,8 +2935,10 @@ void clif_cartlist(struct map_session_data *sd)
|
|
|
|
|
WBUFW(bufe,0)=0x122;
|
|
|
|
|
#elif PACKETVER < 20120925
|
|
|
|
|
WBUFW(bufe,0)=0x2d2;
|
|
|
|
|
#else
|
|
|
|
|
#elif PACKETVER < 20150226
|
|
|
|
|
WBUFW(bufe,0)=0x994;
|
|
|
|
|
#else
|
|
|
|
|
WBUFW(bufe,0)=0xa0f;
|
|
|
|
|
#endif
|
|
|
|
|
WBUFW(bufe,2)=4+ne*cmd;
|
|
|
|
|
clif_send(bufe, WBUFW(bufe,2), &sd->bl, SELF);
|
|
|
|
@ -4071,14 +4193,17 @@ void clif_tradestart(struct map_session_data* sd, uint8 type)
|
|
|
|
|
/// Notifies the client about an item from other player in current trade.
|
|
|
|
|
/// 00e9 <amount>.L <nameid>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W (ZC_ADD_EXCHANGE_ITEM)
|
|
|
|
|
/// 080f <nameid>.W <item type>.B <amount>.L <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W (ZC_ADD_EXCHANGE_ITEM2)
|
|
|
|
|
/// 0a09 <nameid>.W <item type>.B <amount>.L <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W (ZC_ADD_EXCHANGE_ITEM3)
|
|
|
|
|
void clif_tradeadditem(struct map_session_data* sd, struct map_session_data* tsd, int index, int amount)
|
|
|
|
|
{
|
|
|
|
|
int fd;
|
|
|
|
|
unsigned char *buf;
|
|
|
|
|
#if PACKETVER < 20100223
|
|
|
|
|
const int cmd = 0xe9;
|
|
|
|
|
#else
|
|
|
|
|
#elif PACKETVER < 20150226
|
|
|
|
|
const int cmd = 0x80f;
|
|
|
|
|
#else
|
|
|
|
|
const int cmd = 0xa09;
|
|
|
|
|
#endif
|
|
|
|
|
nullpo_retv(sd);
|
|
|
|
|
nullpo_retv(tsd);
|
|
|
|
@ -4105,6 +4230,9 @@ void clif_tradeadditem(struct map_session_data* sd, struct map_session_data* tsd
|
|
|
|
|
WBUFW(buf,13)= 0; //card (4w)
|
|
|
|
|
WBUFW(buf,15)= 0; //card (4w)
|
|
|
|
|
WBUFW(buf,17)= 0; //card (4w)
|
|
|
|
|
#if PACKETVER >= 20150226
|
|
|
|
|
clif_add_random_options(WBUFP(buf, 19), &sd->status.inventory[index]);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -4128,6 +4256,9 @@ void clif_tradeadditem(struct map_session_data* sd, struct map_session_data* tsd
|
|
|
|
|
WBUFB(buf,9) = sd->status.inventory[index].attribute; // attribute
|
|
|
|
|
WBUFB(buf,10)= sd->status.inventory[index].refine; //refine
|
|
|
|
|
clif_addcards(WBUFP(buf, 11), &sd->status.inventory[index]);
|
|
|
|
|
#if PACKETVER >= 20150226
|
|
|
|
|
clif_add_random_options(WBUFP(buf, 19), &sd->status.inventory[index]);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
WFIFOSET(fd,packet_len(cmd));
|
|
|
|
|
}
|
|
|
|
@ -4237,39 +4368,41 @@ void clif_updatestorageamount(struct map_session_data* sd, int amount, int max_a
|
|
|
|
|
/// Notifies the client of an item being added to the storage.
|
|
|
|
|
/// 00f4 <index>.W <amount>.L <nameid>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W (ZC_ADD_ITEM_TO_STORE)
|
|
|
|
|
/// 01c4 <index>.W <amount>.L <nameid>.W <type>.B <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W (ZC_ADD_ITEM_TO_STORE2)
|
|
|
|
|
/// 0a0a <index>.W <amount>.L <nameid>.W <type>.B <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W (ZC_ADD_ITEM_TO_STORE3)
|
|
|
|
|
void clif_storageitemadded(struct map_session_data* sd, struct item* i, int index, int amount)
|
|
|
|
|
{
|
|
|
|
|
#if PACKETVER < 5
|
|
|
|
|
const int cmd = 0xf4;
|
|
|
|
|
#elif PACKETVER < 20150226
|
|
|
|
|
const int cmd = 0x1c4;
|
|
|
|
|
#else
|
|
|
|
|
const int cmd = 0xa0a;
|
|
|
|
|
#endif
|
|
|
|
|
int view,fd;
|
|
|
|
|
int offset = 0;
|
|
|
|
|
|
|
|
|
|
nullpo_retv(sd);
|
|
|
|
|
nullpo_retv(i);
|
|
|
|
|
fd=sd->fd;
|
|
|
|
|
view = itemdb_viewid(i->nameid);
|
|
|
|
|
|
|
|
|
|
#if PACKETVER < 5
|
|
|
|
|
WFIFOHEAD(fd,packet_len(0xf4));
|
|
|
|
|
WFIFOW(fd, 0) = 0xf4; // Storage item added
|
|
|
|
|
WFIFOW(fd, 2) = index+1; // index
|
|
|
|
|
WFIFOL(fd, 4) = amount; // amount
|
|
|
|
|
WFIFOW(fd, 8) = ( view > 0 ) ? view : i->nameid; // id
|
|
|
|
|
WFIFOB(fd,10) = i->identify; //identify flag
|
|
|
|
|
WFIFOB(fd,11) = i->attribute; // attribute
|
|
|
|
|
WFIFOB(fd,12) = i->refine; //refine
|
|
|
|
|
clif_addcards(WFIFOP(fd,13), i);
|
|
|
|
|
WFIFOSET(fd,packet_len(0xf4));
|
|
|
|
|
#else
|
|
|
|
|
WFIFOHEAD(fd,packet_len(0x1c4));
|
|
|
|
|
WFIFOW(fd, 0) = 0x1c4; // Storage item added
|
|
|
|
|
WFIFOHEAD(fd,packet_len(cmd));
|
|
|
|
|
WFIFOW(fd, 0) = cmd; // Storage item added
|
|
|
|
|
WFIFOW(fd, 2) = index+1; // index
|
|
|
|
|
WFIFOL(fd, 4) = amount; // amount
|
|
|
|
|
WFIFOW(fd, 8) = ( view > 0 ) ? view : i->nameid; // id
|
|
|
|
|
#if PACKETVER >= 5
|
|
|
|
|
WFIFOB(fd,10) = itemdb_type(i->nameid); //type
|
|
|
|
|
WFIFOB(fd,11) = i->identify; //identify flag
|
|
|
|
|
WFIFOB(fd,12) = i->attribute; // attribute
|
|
|
|
|
WFIFOB(fd,13) = i->refine; //refine
|
|
|
|
|
clif_addcards(WFIFOP(fd,14), i);
|
|
|
|
|
WFIFOSET(fd,packet_len(0x1c4));
|
|
|
|
|
offset += 1;
|
|
|
|
|
#endif
|
|
|
|
|
WFIFOB(fd,10+offset) = i->identify; //identify flag
|
|
|
|
|
WFIFOB(fd,11+offset) = i->attribute; // attribute
|
|
|
|
|
WFIFOB(fd,12+offset) = i->refine; //refine
|
|
|
|
|
clif_addcards(WFIFOP(fd,13+offset), i);
|
|
|
|
|
#if PACKETVER >= 20150226
|
|
|
|
|
clif_add_random_options(WFIFOP(fd,21+offset), i);
|
|
|
|
|
#endif
|
|
|
|
|
WFIFOSET(fd,packet_len(cmd));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -4429,7 +4562,7 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
|
|
|
|
|
else if(md->special_state.size==SZ_MEDIUM)
|
|
|
|
|
clif_specialeffect_single(bl,421,sd->fd);
|
|
|
|
|
#if PACKETVER >= 20120404
|
|
|
|
|
if( !(md->status.mode&MD_BOSS) ){
|
|
|
|
|
if( !(md->status.mode&MD_BOSS) && battle_config.monster_hp_bars_info){
|
|
|
|
|
int i;
|
|
|
|
|
for(i = 0; i < DAMAGELOG_SIZE; i++)// must show hp bar to all char who already hit the mob.
|
|
|
|
|
if( md->dmglog[i].id == sd->status.char_id )
|
|
|
|
@ -4477,7 +4610,7 @@ static int clif_calc_walkdelay(struct block_list *bl,int delay, char type, int64
|
|
|
|
|
/// Sends a 'damage' packet (src performs action on dst)
|
|
|
|
|
/// 008a <src ID>.L <dst ID>.L <server tick>.L <src speed>.L <dst speed>.L <damage>.W <div>.W <type>.B <damage2>.W (ZC_NOTIFY_ACT)
|
|
|
|
|
/// 02e1 <src ID>.L <dst ID>.L <server tick>.L <src speed>.L <dst speed>.L <damage>.L <div>.W <type>.B <damage2>.L (ZC_NOTIFY_ACT2)
|
|
|
|
|
/// 08c8 <src ID>.L <dst ID>.L <server tick>.L <src speed>.L <dst speed>.L <damage>.L <IsSPDamage>.B <div>.W <type>.B <damage2>.L (ZC_NOTIFY_ACT3) //! TODO
|
|
|
|
|
/// 08c8 <src ID>.L <dst ID>.L <server tick>.L <src speed>.L <dst speed>.L <damage>.L <IsSPDamage>.B <div>.W <type>.B <damage2>.L (ZC_NOTIFY_ACT3)
|
|
|
|
|
/// type:
|
|
|
|
|
/// 0 = damage [ damage: total damage, div: amount of hits, damage2: assassin dual-wield damage ]
|
|
|
|
|
/// 1 = pick up item
|
|
|
|
@ -4494,14 +4627,19 @@ static int clif_calc_walkdelay(struct block_list *bl,int delay, char type, int64
|
|
|
|
|
/// 12 = (touch skill?)
|
|
|
|
|
int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tick, int sdelay, int ddelay, int64 sdamage, int div, enum e_damage_type type, int64 sdamage2)
|
|
|
|
|
{
|
|
|
|
|
unsigned char buf[33];
|
|
|
|
|
unsigned char buf[34];
|
|
|
|
|
struct status_change *sc;
|
|
|
|
|
int damage = (int)cap_value(sdamage,INT_MIN,INT_MAX);
|
|
|
|
|
int damage2 = (int)cap_value(sdamage2,INT_MIN,INT_MAX);
|
|
|
|
|
#if PACKETVER < 20071113
|
|
|
|
|
const int cmd = 0x8a;
|
|
|
|
|
#else
|
|
|
|
|
int offset = 0;
|
|
|
|
|
#elif PACKETVER < 20131223
|
|
|
|
|
const int cmd = 0x2e1;
|
|
|
|
|
int offset = 2;
|
|
|
|
|
#else
|
|
|
|
|
const int cmd = 0x8c8;
|
|
|
|
|
int offset = 3;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
nullpo_ret(src);
|
|
|
|
@ -4522,27 +4660,24 @@ int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tic
|
|
|
|
|
WBUFL(buf,10) = tick;
|
|
|
|
|
WBUFL(buf,14) = sdelay;
|
|
|
|
|
WBUFL(buf,18) = ddelay;
|
|
|
|
|
#if PACKETVER < 20071113
|
|
|
|
|
if (battle_config.hide_woe_damage && map_flag_gvg(src->m)) {
|
|
|
|
|
WBUFW(buf,22) = damage ? div : 0;
|
|
|
|
|
WBUFW(buf,27)=damage2?div:0;
|
|
|
|
|
WBUFW(buf,27+offset) = damage2 ? div : 0;
|
|
|
|
|
} else {
|
|
|
|
|
#if PACKETVER < 20071113
|
|
|
|
|
WBUFW(buf,22) = min(damage, INT16_MAX);
|
|
|
|
|
WBUFW(buf,27)=damage2;
|
|
|
|
|
}
|
|
|
|
|
WBUFW(buf,24)=div;
|
|
|
|
|
WBUFB(buf,26)=type;
|
|
|
|
|
WBUFW(buf,27+offset) = damage2;
|
|
|
|
|
#else
|
|
|
|
|
if (battle_config.hide_woe_damage && map_flag_gvg(src->m)) {
|
|
|
|
|
WBUFL(buf,22)=damage?div:0;
|
|
|
|
|
WBUFL(buf,29)=damage2?div:0;
|
|
|
|
|
} else {
|
|
|
|
|
WBUFL(buf,22) = damage;
|
|
|
|
|
WBUFL(buf,29)=damage2;
|
|
|
|
|
}
|
|
|
|
|
WBUFW(buf,26)=div;
|
|
|
|
|
WBUFB(buf,28)=type;
|
|
|
|
|
WBUFL(buf,27+offset) = damage2;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
#if PACKETVER >= 20131223
|
|
|
|
|
WBUFB(buf,26) = 0; // IsSPDamage - Displays blue digits. Need a way to handle this. [Rytech]
|
|
|
|
|
#endif
|
|
|
|
|
WBUFW(buf,24+offset) = div;
|
|
|
|
|
WBUFB(buf,26+offset) = type;
|
|
|
|
|
|
|
|
|
|
if(disguised(dst)) {
|
|
|
|
|
clif_send(buf, packet_len(cmd), dst, AREA_WOS);
|
|
|
|
|
WBUFL(buf,6) = -dst->id;
|
|
|
|
@ -4559,7 +4694,7 @@ int clif_damage(struct block_list* src, struct block_list* dst, unsigned int tic
|
|
|
|
|
if(damage2 > 0) WBUFW(buf,27) = -1;
|
|
|
|
|
#else
|
|
|
|
|
if(damage > 0) WBUFL(buf,22) = -1;
|
|
|
|
|
if(damage2 > 0) WBUFL(buf,29) = -1;
|
|
|
|
|
if(damage2 > 0) WBUFL(buf,27+offset) = -1;
|
|
|
|
|
#endif
|
|
|
|
|
clif_send(buf,packet_len(cmd),src,SELF);
|
|
|
|
|
}
|
|
|
|
@ -5268,11 +5403,6 @@ int clif_skill_damage(struct block_list *src,struct block_list *dst,unsigned int
|
|
|
|
|
|
|
|
|
|
type = clif_calc_delay(type,div,damage,ddelay);
|
|
|
|
|
|
|
|
|
|
#if PACKETVER >= 20131223
|
|
|
|
|
if ( type == DMG_SKILL )
|
|
|
|
|
type = DMG_MULTI_HIT; /* Temporary Fix */
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if( ( sc = status_get_sc(dst) ) && sc->count ) {
|
|
|
|
|
if(sc->data[SC_HALLUCINATION] && damage)
|
|
|
|
|
damage = damage*(sc->data[SC_HALLUCINATION]->val2) + rnd()%100;
|
|
|
|
@ -5324,7 +5454,15 @@ int clif_skill_damage(struct block_list *src,struct block_list *dst,unsigned int
|
|
|
|
|
}
|
|
|
|
|
WBUFW(buf,28)=skill_lv;
|
|
|
|
|
WBUFW(buf,30)=div;
|
|
|
|
|
// For some reason, late 2013 and newer clients have
|
|
|
|
|
// a issue that causes players and monsters to endure
|
|
|
|
|
// 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;
|
|
|
|
|
#else
|
|
|
|
|
WBUFB(buf,32)=( type == DMG_SKILL ) ? DMG_MULTI_HIT : type;
|
|
|
|
|
#endif
|
|
|
|
|
if (disguised(dst)) {
|
|
|
|
|
clif_send(buf,packet_len(0x1de),dst,AREA_WOS);
|
|
|
|
|
WBUFL(buf,8)=-dst->id;
|
|
|
|
@ -6407,10 +6545,19 @@ void clif_item_skill(struct map_session_data *sd,uint16 skill_id,uint16 skill_lv
|
|
|
|
|
/// Adds an item to character's cart.
|
|
|
|
|
/// 0124 <index>.W <amount>.L <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W (ZC_ADD_ITEM_TO_CART)
|
|
|
|
|
/// 01c5 <index>.W <amount>.L <name id>.W <type>.B <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W (ZC_ADD_ITEM_TO_CART2)
|
|
|
|
|
/// 0a0b <index>.W <amount>.L <name id>.W <type>.B <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W (ZC_ADD_ITEM_TO_CART3)
|
|
|
|
|
void clif_cart_additem(struct map_session_data *sd,int n,int amount,int fail)
|
|
|
|
|
{
|
|
|
|
|
#if PACKETVER < 5
|
|
|
|
|
const int cmd = 0x124;
|
|
|
|
|
#elif PACKETVER < 20150226
|
|
|
|
|
const int cmd = 0x1c5;
|
|
|
|
|
#else
|
|
|
|
|
const int cmd = 0xa0b;
|
|
|
|
|
#endif
|
|
|
|
|
int view,fd;
|
|
|
|
|
unsigned char *buf;
|
|
|
|
|
int offset = 0;
|
|
|
|
|
|
|
|
|
|
nullpo_retv(sd);
|
|
|
|
|
|
|
|
|
@ -6418,38 +6565,27 @@ void clif_cart_additem(struct map_session_data *sd,int n,int amount,int fail)
|
|
|
|
|
if(n<0 || n>=MAX_CART || sd->status.cart[n].nameid<=0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
#if PACKETVER < 5
|
|
|
|
|
WFIFOHEAD(fd,packet_len(0x124));
|
|
|
|
|
WFIFOHEAD(fd,packet_len(cmd));
|
|
|
|
|
buf=WFIFOP(fd,0);
|
|
|
|
|
WBUFW(buf,0)=0x124;
|
|
|
|
|
WBUFW(buf,2)=n+2;
|
|
|
|
|
WBUFL(buf,4)=amount;
|
|
|
|
|
if((view = itemdb_viewid(sd->status.cart[n].nameid)) > 0)
|
|
|
|
|
WBUFW(buf,8)=view;
|
|
|
|
|
else
|
|
|
|
|
WBUFW(buf,8)=sd->status.cart[n].nameid;
|
|
|
|
|
WBUFB(buf,10)=sd->status.cart[n].identify;
|
|
|
|
|
WBUFB(buf,11)=sd->status.cart[n].attribute;
|
|
|
|
|
WBUFB(buf,12)=sd->status.cart[n].refine;
|
|
|
|
|
clif_addcards(WBUFP(buf,13), &sd->status.cart[n]);
|
|
|
|
|
WFIFOSET(fd,packet_len(0x124));
|
|
|
|
|
#else
|
|
|
|
|
WFIFOHEAD(fd,packet_len(0x1c5));
|
|
|
|
|
buf=WFIFOP(fd,0);
|
|
|
|
|
WBUFW(buf,0)=0x1c5;
|
|
|
|
|
WBUFW(buf,0)=cmd;
|
|
|
|
|
WBUFW(buf,2)=n+2;
|
|
|
|
|
WBUFL(buf,4)=amount;
|
|
|
|
|
if((view = itemdb_viewid(sd->status.cart[n].nameid)) > 0)
|
|
|
|
|
WBUFW(buf,8)=view;
|
|
|
|
|
else
|
|
|
|
|
WBUFW(buf,8)=sd->status.cart[n].nameid;
|
|
|
|
|
#if PACKETVER >= 5
|
|
|
|
|
WBUFB(buf,10)=itemdb_type(sd->status.cart[n].nameid);
|
|
|
|
|
WBUFB(buf,11)=sd->status.cart[n].identify;
|
|
|
|
|
WBUFB(buf,12)=sd->status.cart[n].attribute;
|
|
|
|
|
WBUFB(buf,13)=sd->status.cart[n].refine;
|
|
|
|
|
clif_addcards(WBUFP(buf,14), &sd->status.cart[n]);
|
|
|
|
|
WFIFOSET(fd,packet_len(0x1c5));
|
|
|
|
|
offset += 1;
|
|
|
|
|
#endif
|
|
|
|
|
WBUFB(buf,10+offset)=sd->status.cart[n].identify;
|
|
|
|
|
WBUFB(buf,11+offset)=sd->status.cart[n].attribute;
|
|
|
|
|
WBUFB(buf,12+offset)=sd->status.cart[n].refine;
|
|
|
|
|
clif_addcards(WBUFP(buf,13+offset), &sd->status.cart[n]);
|
|
|
|
|
#if PACKETVER >= 20150226
|
|
|
|
|
clif_add_random_options(WBUFP(buf,21+offset), &sd->status.cart[n]);
|
|
|
|
|
#endif
|
|
|
|
|
WFIFOSET(fd,packet_len(cmd));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// [Ind/Hercules] - Data Thanks to Yommy (ZC_ACK_ADDITEM_TO_CART)
|
|
|
|
@ -6776,6 +6912,12 @@ void clif_vendinglist(struct map_session_data* sd, int id, struct s_vending* ven
|
|
|
|
|
const int offset = 12;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if PACKETVER < 20150226
|
|
|
|
|
const int item_length = 22;
|
|
|
|
|
#else
|
|
|
|
|
const int item_length = 47;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
nullpo_retv(sd);
|
|
|
|
|
nullpo_retv(vending);
|
|
|
|
|
nullpo_retv(vsd=map_id2sd(id));
|
|
|
|
@ -6783,9 +6925,9 @@ void clif_vendinglist(struct map_session_data* sd, int id, struct s_vending* ven
|
|
|
|
|
fd = sd->fd;
|
|
|
|
|
count = vsd->vend_num;
|
|
|
|
|
|
|
|
|
|
WFIFOHEAD(fd, offset+count*22);
|
|
|
|
|
WFIFOHEAD(fd, offset+count*item_length);
|
|
|
|
|
WFIFOW(fd,0) = cmd;
|
|
|
|
|
WFIFOW(fd,2) = offset+count*22;
|
|
|
|
|
WFIFOW(fd,2) = offset+count*item_length;
|
|
|
|
|
WFIFOL(fd,4) = id;
|
|
|
|
|
#if PACKETVER >= 20100105
|
|
|
|
|
WFIFOL(fd,8) = vsd->vender_id;
|
|
|
|
@ -6795,15 +6937,18 @@ void clif_vendinglist(struct map_session_data* sd, int id, struct s_vending* ven
|
|
|
|
|
{
|
|
|
|
|
int index = vending[i].index;
|
|
|
|
|
struct item_data* data = itemdb_search(vsd->status.cart[index].nameid);
|
|
|
|
|
WFIFOL(fd,offset+ 0+i*22) = vending[i].value;
|
|
|
|
|
WFIFOW(fd,offset+ 4+i*22) = vending[i].amount;
|
|
|
|
|
WFIFOW(fd,offset+ 6+i*22) = vending[i].index + 2;
|
|
|
|
|
WFIFOB(fd,offset+ 8+i*22) = itemtype(data->nameid);
|
|
|
|
|
WFIFOW(fd,offset+ 9+i*22) = ( data->view_id > 0 ) ? data->view_id : vsd->status.cart[index].nameid;
|
|
|
|
|
WFIFOB(fd,offset+11+i*22) = vsd->status.cart[index].identify;
|
|
|
|
|
WFIFOB(fd,offset+12+i*22) = vsd->status.cart[index].attribute;
|
|
|
|
|
WFIFOB(fd,offset+13+i*22) = vsd->status.cart[index].refine;
|
|
|
|
|
clif_addcards(WFIFOP(fd,offset+14+i*22), &vsd->status.cart[index]);
|
|
|
|
|
WFIFOL(fd,offset+ 0+i*item_length) = vending[i].value;
|
|
|
|
|
WFIFOW(fd,offset+ 4+i*item_length) = vending[i].amount;
|
|
|
|
|
WFIFOW(fd,offset+ 6+i*item_length) = vending[i].index + 2;
|
|
|
|
|
WFIFOB(fd,offset+ 8+i*item_length) = itemtype(data->nameid);
|
|
|
|
|
WFIFOW(fd,offset+ 9+i*item_length) = ( data->view_id > 0 ) ? data->view_id : vsd->status.cart[index].nameid;
|
|
|
|
|
WFIFOB(fd,offset+11+i*item_length) = vsd->status.cart[index].identify;
|
|
|
|
|
WFIFOB(fd,offset+12+i*item_length) = vsd->status.cart[index].attribute;
|
|
|
|
|
WFIFOB(fd,offset+13+i*item_length) = vsd->status.cart[index].refine;
|
|
|
|
|
clif_addcards(WFIFOP(fd,offset+14+i*item_length), &vsd->status.cart[index]);
|
|
|
|
|
#if PACKETVER >= 20150226
|
|
|
|
|
clif_add_random_options(WFIFOP(fd,offset+22+i*item_length), &vsd->status.cart[index]);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
WFIFOSET(fd,WFIFOW(fd,2));
|
|
|
|
|
}
|
|
|
|
@ -6834,6 +6979,23 @@ void clif_buyvending(struct map_session_data* sd, int index, int amount, int fai
|
|
|
|
|
WFIFOSET(fd,packet_len(0x135));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Show's vending player its list of items for sale (ZC_ACK_OPENSTORE2).
|
|
|
|
|
/// 0a28 <Result>.B
|
|
|
|
|
/// result:
|
|
|
|
|
/// 0 = Successed
|
|
|
|
|
/// 1 = Failed
|
|
|
|
|
void clif_openvending_ack(struct map_session_data* sd, int result)
|
|
|
|
|
{
|
|
|
|
|
int fd;
|
|
|
|
|
|
|
|
|
|
nullpo_retv(sd);
|
|
|
|
|
|
|
|
|
|
fd = sd->fd;
|
|
|
|
|
WFIFOHEAD(fd, 3);
|
|
|
|
|
WFIFOW(fd,0) = 0xa28;
|
|
|
|
|
WFIFOB(fd,2) = result;
|
|
|
|
|
WFIFOSET(fd, 3);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Shop creation success (ZC_PC_PURCHASE_MYITEMLIST).
|
|
|
|
|
/// 0136 <packet len>.W <owner id>.L { <price>.L <index>.W <amount>.W <type>.B <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W }*
|
|
|
|
@ -6842,36 +7004,43 @@ void clif_openvending(struct map_session_data* sd, int id, struct s_vending* ven
|
|
|
|
|
int i,fd;
|
|
|
|
|
int count;
|
|
|
|
|
|
|
|
|
|
#if PACKETVER < 20150226
|
|
|
|
|
const int item_length = 22;
|
|
|
|
|
#else
|
|
|
|
|
const int item_length = 47;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
nullpo_retv(sd);
|
|
|
|
|
|
|
|
|
|
fd = sd->fd;
|
|
|
|
|
count = sd->vend_num;
|
|
|
|
|
|
|
|
|
|
WFIFOHEAD(fd, 8+count*22);
|
|
|
|
|
WFIFOHEAD(fd, 8+count*item_length);
|
|
|
|
|
WFIFOW(fd,0) = 0x136;
|
|
|
|
|
WFIFOW(fd,2) = 8+count*22;
|
|
|
|
|
WFIFOW(fd,2) = 8+count*item_length;
|
|
|
|
|
WFIFOL(fd,4) = id;
|
|
|
|
|
for( i = 0; i < count; i++ ) {
|
|
|
|
|
int index = vending[i].index;
|
|
|
|
|
struct item_data* data = itemdb_search(sd->status.cart[index].nameid);
|
|
|
|
|
WFIFOL(fd, 8+i*22) = vending[i].value;
|
|
|
|
|
WFIFOW(fd,12+i*22) = vending[i].index + 2;
|
|
|
|
|
WFIFOW(fd,14+i*22) = vending[i].amount;
|
|
|
|
|
WFIFOB(fd,16+i*22) = itemtype(data->nameid);
|
|
|
|
|
WFIFOW(fd,17+i*22) = ( data->view_id > 0 ) ? data->view_id : sd->status.cart[index].nameid;
|
|
|
|
|
WFIFOB(fd,19+i*22) = sd->status.cart[index].identify;
|
|
|
|
|
WFIFOB(fd,20+i*22) = sd->status.cart[index].attribute;
|
|
|
|
|
WFIFOB(fd,21+i*22) = sd->status.cart[index].refine;
|
|
|
|
|
clif_addcards(WFIFOP(fd,22+i*22), &sd->status.cart[index]);
|
|
|
|
|
WFIFOL(fd, 8+i*item_length) = vending[i].value;
|
|
|
|
|
WFIFOW(fd,12+i*item_length) = vending[i].index + 2;
|
|
|
|
|
WFIFOW(fd,14+i*item_length) = vending[i].amount;
|
|
|
|
|
WFIFOB(fd,16+i*item_length) = itemtype(data->nameid);
|
|
|
|
|
WFIFOW(fd,17+i*item_length) = ( data->view_id > 0 ) ? data->view_id : sd->status.cart[index].nameid;
|
|
|
|
|
WFIFOB(fd,19+i*item_length) = sd->status.cart[index].identify;
|
|
|
|
|
WFIFOB(fd,20+i*item_length) = sd->status.cart[index].attribute;
|
|
|
|
|
WFIFOB(fd,21+i*item_length) = sd->status.cart[index].refine;
|
|
|
|
|
clif_addcards(WFIFOP(fd,22+i*item_length), &sd->status.cart[index]);
|
|
|
|
|
#if PACKETVER >= 20150226
|
|
|
|
|
clif_add_random_options(WFIFOP(fd,30+i*item_length), &sd->status.cart[index]);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
WFIFOSET(fd,WFIFOW(fd,2));
|
|
|
|
|
|
|
|
|
|
#if PACKETVER >= 20141022
|
|
|
|
|
// Should go elsewhere perhaps? It has to be bundled with this however.
|
|
|
|
|
WFIFOHEAD(fd, 3);
|
|
|
|
|
WFIFOW(fd, 0) = 0xa28;
|
|
|
|
|
WFIFOB(fd, 2) = 0; // 1 is failure. Our current responses to failure are working so not yet implemented.
|
|
|
|
|
WFIFOSET(fd, 3);
|
|
|
|
|
/// 0 = Successed
|
|
|
|
|
/// 1 = Failed
|
|
|
|
|
clif_openvending_ack(sd, 0);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -9391,6 +9560,7 @@ void clif_equipcheckbox(struct map_session_data* sd)
|
|
|
|
|
/// 0859 <packet len>.W <name>.24B <class>.W <hairstyle>.W <bottom-viewid>.W <mid-viewid>.W <up-viewid>.W <haircolor>.W <cloth-dye>.W <gender>.B {equip item}.28B* (ZC_EQUIPWIN_MICROSCOPE2, PACKETVER >= 20101124)
|
|
|
|
|
/// 0859 <packet len>.W <name>.24B <class>.W <hairstyle>.W <bottom-viewid>.W <mid-viewid>.W <up-viewid>.W <robe>.W <haircolor>.W <cloth-dye>.W <gender>.B {equip item}.28B* (ZC_EQUIPWIN_MICROSCOPE2, PACKETVER >= 20110111)
|
|
|
|
|
/// 0997 <packet len>.W <name>.24B <class>.W <hairstyle>.W <bottom-viewid>.W <mid-viewid>.W <up-viewid>.W <robe>.W <haircolor>.W <cloth-dye>.W <gender>.B {equip item}.31B* (ZC_EQUIPWIN_MICROSCOPE_V5, PACKETVER >= 20120925)
|
|
|
|
|
/// 0a2d <packet len>.W <name>.24B <class>.W <hairstyle>.W <bottom-viewid>.W <mid-viewid>.W <up-viewid>.W <robe>.W <haircolor>.W <cloth-dye>.W <gender>.B {equip item}.57B* (ZC_EQUIPWIN_MICROSCOPE_V6, PACKETVER >= 20150226)
|
|
|
|
|
void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* tsd)
|
|
|
|
|
{
|
|
|
|
|
uint8* buf;
|
|
|
|
@ -9399,8 +9569,10 @@ void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* ts
|
|
|
|
|
const int s = 26;
|
|
|
|
|
#elif PACKETVER < 20120925
|
|
|
|
|
const int s = 28;
|
|
|
|
|
#else
|
|
|
|
|
#elif PACKETVER < 20150226
|
|
|
|
|
const int s = 31;
|
|
|
|
|
#else
|
|
|
|
|
const int s = 57;
|
|
|
|
|
#endif
|
|
|
|
|
nullpo_retv(sd);
|
|
|
|
|
nullpo_retv(tsd);
|
|
|
|
@ -9413,8 +9585,10 @@ void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* ts
|
|
|
|
|
WBUFW(buf, 0) = 0x2d7;
|
|
|
|
|
#elif PACKETVER < 20120925
|
|
|
|
|
WBUFW(buf, 0) = 0x859;
|
|
|
|
|
#else
|
|
|
|
|
#elif PACKETVER < 20150226
|
|
|
|
|
WBUFW(buf, 0) = 0x997;
|
|
|
|
|
#else
|
|
|
|
|
WBUFW(buf, 0) = 0xa2d;
|
|
|
|
|
#endif
|
|
|
|
|
safestrncpy((char*)WBUFP(buf, 4), tsd->status.name, NAME_LENGTH);
|
|
|
|
|
WBUFW(buf,28) = tsd->status.class_;
|
|
|
|
@ -9537,6 +9711,11 @@ static bool clif_process_message(struct map_session_data* sd, int format, char**
|
|
|
|
|
|
|
|
|
|
message = name + namelen + 3;
|
|
|
|
|
messagelen = textlen - namelen - 3; // this should be the message length (w/ zero byte included)
|
|
|
|
|
|
|
|
|
|
#if PACKETVER >= 20150900
|
|
|
|
|
message[messagelen] = '\0';
|
|
|
|
|
messagelen++;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{// name has fixed width
|
|
|
|
@ -15623,7 +15802,8 @@ static void clif_quest_len(int def_len, int info_len, int avail_quests, int *lim
|
|
|
|
|
|
|
|
|
|
/// Sends list of all quest states (ZC_ALL_QUEST_LIST).
|
|
|
|
|
/// 02b1 <packet len>.W <num>.L { <quest id>.L <active>.B }*num
|
|
|
|
|
/// 097a <packet len>.W <num>.L { <quest id>.L <active>.B <remaining time>.L <time>.L <count>.W { <mob_id>.L <killed>.W <total>.W <mob name>.24B }*count }*num
|
|
|
|
|
/// 097a <packet len>.W <num>.L { <quest id>.L <active>.B <remaining time>.L <time>.L <count>.W { <mob_id>.L <killed>.W <total>.W <mob name>.24B }*count }*num (ZC_ALL_QUEST_LIST2)
|
|
|
|
|
/// 09f8 <packet len>.W <num>.L { <quest id>.L <active>.B <remaining time>.L <time>.L <count>.W { <mob_id>.L <killed>.W <total>.W <mob name>.24B }*count }*num (ZC_ALL_QUEST_LIST3) // TODO!
|
|
|
|
|
void clif_quest_send_list(struct map_session_data *sd)
|
|
|
|
|
{
|
|
|
|
|
int fd = sd->fd;
|
|
|
|
@ -18308,6 +18488,19 @@ void clif_broadcast_obtain_special_item(const char *char_name, unsigned short na
|
|
|
|
|
clif_send(buf, WBUFW(buf, 2), NULL, ALL_CLIENT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void clif_dressing_room(struct map_session_data *sd, int view)
|
|
|
|
|
{
|
|
|
|
|
int fd;
|
|
|
|
|
|
|
|
|
|
nullpo_retv(sd);
|
|
|
|
|
|
|
|
|
|
fd = sd->fd;
|
|
|
|
|
WFIFOHEAD(fd, packet_len(0xa02));
|
|
|
|
|
WFIFOW(fd,0) = 0xa02;
|
|
|
|
|
WFIFOW(fd,2) = view;
|
|
|
|
|
WFIFOSET(fd, packet_len(0xa02));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*==========================================
|
|
|
|
|
* Main client packet processing function
|
|
|
|
|
*------------------------------------------*/
|
|
|
|
@ -18677,7 +18870,7 @@ void packetdb_readdb(bool reload)
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
//#0x08C0
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 10,
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 20, 34, 0, 0, 0, 0, 0, 0, 10,
|
|
|
|
|
9, 7, 10, 0, 0, 0, 6, 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,
|
|
|
|
@ -18690,7 +18883,7 @@ void packetdb_readdb(bool reload)
|
|
|
|
|
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, -1, -1, 7,
|
|
|
|
|
0, 0, 0, 0, 2, 0, 0, 14, 6, 50, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
0, 0, 0, 0, 2, 0, 0, 14, 6, 50, -1, 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, -1, 8, 11, 9, 8, 0, 0, 0, 22,
|
|
|
|
@ -18698,17 +18891,17 @@ void packetdb_readdb(bool reload)
|
|
|
|
|
0, 0, 0, 0, 0, 0, 6, 4, 6, 4, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
//#0x09C0
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0,102, 0,
|
|
|
|
|
0, 0, 0, 0, 2, 0, -1, -1, 2, 0, 0, 0, 0, 0, 0, 7,
|
|
|
|
|
0, 0, 0, 0, 2, 0, -1, -1, 2, 0, 0, -1, -1, -1, 0, 7,
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 3, 11, 0, 11, -1, 0, 3, 11, 0,
|
|
|
|
|
0, 11, 12, 11, 0, 0, 0, 0, 0,143, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
//#0x0a00
|
|
|
|
|
0, 11, 12, 11, 0, 0, 0, 75, -1,143, 0, 0, 0, -1, -1, -1,
|
|
|
|
|
//#0x0A00
|
|
|
|
|
#if PACKETVER >= 20141022
|
|
|
|
|
269, 3, 0, 2, 6, 49, 6, 9, 26, 45, 47, 47, 56, -1, 0, 0,
|
|
|
|
|
269, 3, 4, 2, 6, 49, 6, 9, 26, 45, 47, 47, 56, -1, 0, -1,
|
|
|
|
|
#else
|
|
|
|
|
269, 0, 0, 2, 6, 48, 6, 9, 26, 45, 47, 47, 56, -1, 0, 0,
|
|
|
|
|
#endif
|
|
|
|
|
0, 0, 0, 26, 0, 0, 0, 0, 14, 2, 23, 2, -1, 2, 3, 2,
|
|
|
|
|
21, 3, 5, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
-1, 0, 0, 26, 0, 0, 0, 0, 14, 2, 23, 2, -1, 2, 3, 2,
|
|
|
|
|
21, 3, 5, 0, 66, 0, 0, 0, 3, 0, 0, 0, 0, -1, 0, 0,
|
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
|
};
|
|
|
|
|
struct {
|
|
|
|
|