*Add full Support 2015 client

- New EquipPackets Support v6
- add missing some old packets

Thank you to @Rytech and 3Ceam http://sourceforge.net/projects/v1-3ceam/
This commit is contained in:
icxbb-xx 2015-11-21 21:17:08 +07:00
parent ad3a74bb8f
commit d2d1fd21d3
10 changed files with 516 additions and 211 deletions

View File

@ -237,3 +237,8 @@ mob_size_influence: no
// Default (most official): mob - 220, boss - 1
mob_icewall_walk_block: 75
boss_icewall_walk_block: 0
// Should HP bars be shown for monsters?
// 2012-04-04aRagexeRE or higher client required.
monster_hp_bars_info: yes

View File

@ -1895,6 +1895,7 @@ packet_keys: 0x3F094C49,0x55F86C1E,0x58AA359A // [Shakto]
0x099b,8 //maptypeproperty2
// New Packets
0x08C8,34 // ZC_NOTIFY_ACT3
0x08ff,24 // ZC_EFST_SET_ENTER
0x0984,28 // ZC_EFST_SET_ENTER2
0x099f,22 // ZC_SKILL_ENTRY4
@ -2326,7 +2327,14 @@ packet_keys: 0x631C511C,0x111C111C,0x111C111C // [Shakto]
0x09D6,-1,npcmarketpurchase,2:4:6
0x09D7,-1
0x09D8,2,npcmarketclosed,0
0x09DF,7
// New Packet
0x097A,-1 // ZC_ALL_QUEST_LIST2
0x09F7,75 // ZC_PROPERTY_HOMUN_2
0x09DB,-1 // ZC_NOTIFY_MOVEENTRY10
0x09DC,-1 // ZC_NOTIFY_NEWENTRY10
0x09DD,-1 // ZC_NOTIFY_STANDENTRY10
0x09DF,7 // ZC_ACK_WHISPER02
//2014-10-16Ragexe
packet_ver: 50
@ -2361,20 +2369,23 @@ packet_keys: 0x2DFF467C,0x444B37EE,0x2C1B634F // [YomRawr]
0x0364,5,hommenu,2:4
0x0936,36,storagepassword,0
0x09DF,7
// New packet
0x0A00,269
0x0A01,3,hotkeyrowshift,2
0x0A02,4 // ZC_DRESSROOM_OPEN
// Roulette System [Yommy]
0x0A19,2,rouletteopen,0 // HEADER_CZ_REQ_OPEN_ROULETTE
0x0A1A,23 // HEADER_ZC_ACK_OPEN_ROULETTE
0x0A1B,2,rouletteinfo,0 // HEADER_CZ_REQ_ROULETTE_INFO
0x0A1C,-1 // HEADER_ZC_ACK_ROULETTE_INFO
0x0A1D,2,rouletteclose,0 // HEADER_CZ_REQ_CLOSE_ROULETTE
0x0A1E,3 // HEADER_ZC_ACK_CLOSE_ROULETTE
0x0A1F,2,roulettegenerate,0 // HEADER_CZ_REQ_GENERATE_ROULETTE
0x0A20,21 // HEADER_ZC_ACK_GENERATE_ROULETTE
0x0A21,3,rouletterecvitem,2 // HEADER_CZ_RECV_ROULETTE_ITEM
0x0A22,5 // HEADER_ZC_RECV_ROULETTE_ITEM
0x0A19,2,rouletteopen,0 // CZ_REQ_OPEN_ROULETTE
0x0A1A,23 // ZC_ACK_OPEN_ROULETTE
0x0A1B,2,rouletteinfo,0 // CZ_REQ_ROULETTE_INFO
0x0A1C,-1 // ZC_ACK_ROULETTE_INFO
0x0A1D,2,rouletteclose,0 // CZ_REQ_CLOSE_ROULETTE
0x0A1E,3 // ZC_ACK_CLOSE_ROULETTE
0x0A1F,2,roulettegenerate,0 // CZ_REQ_GENERATE_ROULETTE
0x0A20,21 // ZC_ACK_GENERATE_ROULETTE
0x0A21,3,rouletterecvitem,2 // CZ_RECV_ROULETTE_ITEM
0x0A22,5 // ZC_RECV_ROULETTE_ITEM
//2014-10-22bRagexe
packet_ver: 51
@ -2426,14 +2437,98 @@ packet_keys: 0x290551EA,0x2B952C75,0x2D67669B // [YomRawr]
0x0a06,6
0x0a07,9
0x0a08,26
0x0a09,45
0x0a0a,47
0x0a0b,47
0x0a0c,56
0x0a0d,-1
0x0a13,26
0x0A18,14 // HEADER_ZC_ACCEPT_ENTER3
0x0a24,66
// New Packet
0x0A18,14 // ZC_ACCEPT_ENTER3
0x0A24,66
0x0A28,3 // ZC_ACK_OPENSTORE2
0x09FD,-1 // ZC_NOTIFY_MOVEENTRY11
0x09FE,-1 // ZC_NOTIFY_NEWENTRY11
0x09FF,-1 // ZC_NOTIFY_STANDENTRY11
//0x09F8,-1 // ZC_ALL_QUEST_LIST3
//2015-05-13aRagexe
packet_ver: 52
packet_keys: 0x62C86D09,0x75944F17,0x112C133D // [YomRawr]
0x0369,7,actionrequest,2:6
0x083C,10,useskilltoid,2:4:6
0x0437,5,walktoxy,2
0x035F,6,ticksend,2
0x0924,5,changedir,2:4
0x0958,6,takeitem,2
0x0885,6,dropitem,2:4
0x0879,8,movetokafra,2:4
0x0864,8,movefromkafra,2:4
0x0438,10,useskilltopos,2:4:6:8
0x0366,90,useskilltoposinfo,2:4:6:8:10
0x096A,6,getcharnamerequest,2
0x0368,6,solvecharname,2
0x0838,12,searchstoreinfolistitemclick,2:6:10
0x0835,2,searchstoreinfonextpage,0
0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15
0x0811,-1,reqtradebuyingstore,2:4:8:12
0x0360,6,reqclickbuyingstore,2
0x022D,2,reqclosebuyingstore,0
0x0815,-1,reqopenbuyingstore,2:4:8:9:89
0x0883,18,bookingregreq,2:4:6
// 0x02C4,8 CZ_JOIN_BATTLE_FIELD
0x0960,-1, itemlistwindowselected,2:4:8:12
0x0363,19,wanttoconnection,2:6:10:14:18
0x094A,26,partyinvite2,2
// 0x0927,4 CZ_GANGSI_RANK
0x08A8,26,friendslistadd,2
0x0817,5,hommenu,2:4
0x0923,36,storagepassword,2:4:20
// RODEX Mail system
0x09E7,3 // ZC_NOTIFY_UNREADMAIL
0x09E8,11,dull,0 // CZ_OPEN_MAILBOX
0x09E9,2,dull,0 // CZ_CLOSE_MAILBOX
0x09EA,11,dull,0 // CZ_REQ_READ_MAIL
0x09EB,-1 // ZC_ACK_READ_MAIL
0x09EC,-1,dull,0 // CZ_REQ_WRITE_MAIL
0x0A2E,6,dull,0 // CZ_REQ_CHANGE_TITLE
0x09ED,3 // ZC_ACK_WRITE_MAIL
0x09EE,11,dull,0 // CZ_REQ_NEXT_MAIL_LIST
0x09EF,11,dull,0 // CZ_REQ_REFRESH_MAIL_LIST
0x09F0,-1 // ZC_ACK_MAIL_LIST
0x09F1,11,dull,0 // CZ_REQ_ZENY_FROM_MAIL
0x09F2,12 // ZC_ACK_ZENY_FROM_MAIL
0x09F3,11,dull,0 // CZ_REQ_ITEM_FROM_MAIL
0x09F4,12 // ZC_ACK_ITEM_FROM_MAIL
0x09F5,11,dull,0 // CZ_REQ_DELETE_MAIL
0x09F6,11 // ZC_ACK_DELETE_MAIL
0x0A03,2,dull,0 // CZ_REQ_CANCEL_WRITE_MAIL
0x0A04,6,dull,0 // CZ_REQ_ADD_ITEM_TO_MAIL
0x0A05,53 // ZC_ACK_ADD_ITEM_TO_MAIL
0x0A06,6,dull,0 // CZ_REQ_REMOVE_ITEM_MAIL
0x0A07,9 // ZC_ACK_REMOVE_ITEM_MAIL
0x0A08,26,dull,0 // CZ_REQ_OPEN_WRITE_MAIL
0x0A12,27 // ZC_ACK_OPEN_WRITE_MAIL
0x0A32,2 // ZC_OPEN_RODEX_THROUGH_NPC_ONLY
0x0A13,26,dull,0 // CZ_CHECK_RECEIVE_CHARACTER_NAME
0x0A14,10 // ZC_CHECK_RECEIVE_CHARACTER_NAME
// New EquipPackets Support
0x0A09,45 // ZC_ADD_EXCHANGE_ITEM3
0x0A0A,47 // ZC_ADD_ITEM_TO_STORE3
0x0A0B,47 // ZC_ADD_ITEM_TO_CART3
0x0A0C,56 // ZC_ITEM_PICKUP_ACK_V6
0x0A0D,-1 // ZC_INVENTORY_ITEMLIST_EQUIP_V6
0x0A0F,-1 // ZC_CART_ITEMLIST_EQUIP_V6
0x0A10,-1 // ZC_STORE_ITEMLIST_EQUIP_V6
0x0A2D,-1 // ZC_EQUIPWIN_MICROSCOPE_V6
// Title System
0x0A2E,6,dull,0 // CZ_REQ_CHANGE_TITLE
0x0A2F,7 // ZC_ACK_CHANGE_TITLE
0x0A30,106 // ZC_ACK_REQNAMEALL2
// Pet Evolution System
0x09FB,-1,dull,0 // CZ_PET_EVOLUTION
0x09FC,6 // ZC_PET_EVOLUTION_RESULT
//Add new packets here
//packet_ver: 52
//packet_ver: 53

View File

@ -369,11 +369,13 @@ void chclif_mmo_char_send(int fd, struct char_session_data* sd){
ShowInfo("sd->version = %d\n",sd->version);
if(sd->version >= date2version(20130000) ){
chclif_mmo_send082d(fd,sd);
chclif_charlist_notify(fd,sd);
chclif_block_character(fd,sd);
}
//@FIXME dump from kro doesn't show 6b transmission
chclif_mmo_send006b(fd,sd);
chclif_charlist_notify(fd,sd);
} else
chclif_mmo_send006b(fd,sd);
//@FIXME dump from kro doesn't show 6b transmission
if(sd->version >= date2version(20060819) )
chclif_block_character(fd,sd);
}
/*

View File

@ -382,7 +382,8 @@ uint32 date2version(int date) {
//else if(date < 20140613) return 47;
//else if(date < 20141016) return 48;
else if(date < 20141022) return 50;
else if(date >= 20141022) return 51;
else if(date < 20150513) return 51;
else if(date >= 20150513) return 52;
else return 30; //default
}

View File

@ -8175,6 +8175,7 @@ static const struct _battle_data {
{ "homunculus_evo_intimacy_reset", &battle_config.homunculus_evo_intimacy_reset, 1000, 0, INT_MAX, },
{ "monster_loot_search_type", &battle_config.monster_loot_search_type, 1, 0, 1, },
{ "feature.roulette", &battle_config.feature_roulette, 1, 0, 1, },
{ "monster_hp_bars_info", &battle_config.monster_hp_bars_info, 1, 0, 1, },
};
#ifndef STATS_OPT_OUT

View File

@ -591,6 +591,7 @@ extern struct Battle_Config
int homunculus_evo_intimacy_reset;
int monster_loot_search_type;
int feature_roulette;
int monster_hp_bars_info;
} battle_config;
void do_init_battle(void);

View File

@ -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 {

View File

@ -35,7 +35,7 @@ struct party_booking_ad_info;
enum { // packet DB
MIN_PACKET_DB = 0x064,
MAX_PACKET_DB = 0xAFF,
MAX_PACKET_VER = 51,
MAX_PACKET_VER = 52,
MAX_PACKET_POS = 20,
};
@ -968,4 +968,6 @@ void clif_merge_item_open(struct map_session_data *sd);
void clif_broadcast_obtain_special_item(const char *char_name, unsigned short nameid, unsigned short container, enum BROADCASTING_SPECIAL_ITEM_OBTAIN type, const char *srcname);
void clif_dressing_room(struct map_session_data *sd, int view);
#endif /* _CLIF_H_ */

View File

@ -514,6 +514,11 @@ int hom_levelup(struct homun_data *hd)
APPLY_HOMUN_LEVEL_STATWEIGHT();
// Needed to update skill list for mutated homunculus so unlocked skills will appear when the needed level is reached.
status_calc_homunculus(hd,0);
clif_hominfo(hd->master,hd,0);
clif_homskillinfoblock(hd->master);
if ( hd->master && battle_config.homunculus_show_growth ) {
char output[256] ;
sprintf(output,

View File

@ -2176,7 +2176,7 @@ void mob_damage(struct mob_data *md, struct block_list *src, int damage)
return;
#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.
struct map_session_data *sd = map_charid2sd(md->dmglog[i].id);
@ -2957,7 +2957,7 @@ void mob_heal(struct mob_data *md,unsigned int heal)
if (battle_config.show_mob_info&3)
clif_charnameack (0, &md->bl);
#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 ) {