/// Use for ?
/// 0905 <packet len>.W (ZC_STORE_ITEMLIST_EQUIP)
/// 0976 <packet len>.W <store name>.24B (ZC_STORE_ITEMLIST_EQUIP_V2)
/// 0996 <packet len>.W <store name>.24B (ZC_STORE_ITEMLIST_EQUIP_V5)
void clif_storeitemlistequip (struct map_session_data* sd){
// start use of this packet : 20111122
int header,fd;
nullpo_retv(sd);
fd = sd->fd;
#if PACKETVER < 20120221
header=0x905;
#elif PACKETVER < 20120925
header=0x976;
#else
header=0x996;
#endif
WFIFOHEAD(fd,packet_len(header));
WFIFOW(fd,0)=header;
WFIFOW(fd,2)=packet_len(header);
#if PACKETVER >= 20120221
safestrncpy((char*)WFIFOP(fd,4), sd->status.name, NAME_LENGHT); //[0x18](24) StoreName
#endif
WFIFOSET(fd,packet_len(header));
}
/// Use for ?
/// 0904 <packet len>.W (ZC_STORE_ITEMLIST_NORMAL)
/// 0975 <packet len>.W <store name>.24B (ZC_STORE_ITEMLIST_NORMAL_V2)
/// 0995 <packet len>.W <store name>.24B (ZC_STORE_ITEMLIST_NORMAL_V5)
void clif_storeitemlistnormal (struct map_session_data* sd){
// start use of this packet : 20111122
int header,fd;
nullpo_retv(sd);
fd = sd->fd;
#if PACKETVER < 20120221
header=0x904;
#elif PACKETVER < 20120925
header=0x975;
#else
header=0x995;
#endif
WFIFOHEAD(fd,packet_len(header));
WFIFOW(fd,0)=header;
WFIFOW(fd,2)=packet_len(header);
#if PACKETVER >= 20120221
safestrncpy((char*)WFIFOP(fd,4), sd->status.name, NAME_LENGHT); //[0x18](24) StoreName
#endif
WFIFOSET(fd,packet_len(header));
}
/// Use for ?
/// 0903 <packet len>.W (ZC_CART_ITEMLIST_EQUIP)
/// 0994 <packet len>.W (ZC_CART_ITEMLIST_EQUIP_V5)
void clif_cartitemlistequip (struct map_session_data* sd){
// start use of this packet : 20111122
int header,fd;
nullpo_retv(sd);
fd = sd->fd;
#if PACKETVER < 20120925
header=0x903;
#else
header=0x996;
#endif
WFIFOHEAD(fd,packet_len(header));
WFIFOW(fd,0)=header;
WFIFOW(fd,2)=packet_len(header);
WFIFOSET(fd,packet_len(header));
}
/// Use for ?
/// 0902 <packet len>.W (ZC_CART_ITEMLIST_NORMAL)
/// 0993 <packet len>.W (ZC_CART_ITEMLIST_NORMAL_V5)
void clif_cartitemlistnormal (struct map_session_data* sd){
// start use of this packet : 20111122
int header,fd;
nullpo_retv(sd);
fd = sd->fd;
#if PACKETVER < 20120925
header=0x902;
#else
header=0x993;
#endif
WFIFOHEAD(fd,packet_len(header));
WFIFOW(fd,0)=header;
WFIFOW(fd,2)=packet_len(header);
WFIFOSET(fd,packet_len(header));
}
/// Use for ?
/// 0901 <packet len>.W (ZC_INVENTORY_ITEMLIST_EQUIP)
/// 0992 <packet len>.W (ZC_INVENTORY_ITEMLIST_EQUIP_V5)
void clif_inventoryitemlistequip (struct map_session_data* sd){
// start use of this packet : 20111122
int header,fd;
nullpo_retv(sd);
fd = sd->fd;
#if PACKETVER < 20120925
header=0x901;
#else
header=0x992;
#endif
WFIFOHEAD(fd,packet_len(header));
WFIFOW(fd,0)=header;
WFIFOW(fd,2)=packet_len(header);
WFIFOSET(fd,packet_len(header));
}
/// Use for ?
/// 0900 <packet len>.W (ZC_INVENTORY_ITEMLIST_NORMAL)
/// 0991 <packet len>.W (ZC_INVENTORY_ITEMLIST_NORMAL_V5)
void clif_inventoryitemlistnormal (struct map_session_data* sd){
// start use of this packet : 20111122
int header,fd;
nullpo_retv(sd);
fd = sd->fd;
#if PACKETVER < 20120925
header=0x900;
#else
header=0x991;
#endif
WFIFOHEAD(fd,packet_len(header));
WFIFOW(fd,0)=header;
WFIFOW(fd,2)=packet_len(header);
WFIFOSET(fd,packet_len(header));
}
/// Clan chat notify (ZC_NOTIFY_CLAN_CHAT)
/// 098e <packet len>.W <char name>.24B
void clif_notifyclanchat(struct map_session_data* sd)
{
int fd;
nullpo_retv(sd);
fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x98e));
WFIFOW(fd,0)=0x98e;
WFIFOW(fd,2)=packet_len(0x98e);
safestrncpy((char*)WFIFOP(fd,4), sd->status.name, NAME_LENGHT); //[0x18](24) StoreName
WFIFOSET(fd,packet_len(0x98e));
}
/// Clan chat message (CZ_CLAN_CHAT)
/// 098d <packet len>.W
void clif_notifyclanchat()
{
//CZ ?
}
/// Clan info (CZ_CLANINFO)
/// 098a <packet len>.W <emblem num>.L <clan name>.24B <master name>.24B <manage map>.16B <num allyclan>.B <num hostileclan>.B
void clif_claninfo(struct map_session_data* sd)
{
int fd;
struct clan *c; // Struct must be create
nullpo_retv(sd);
fd = sd->fd;
if( (c = sd->clan) == NULL )
return;
WFIFOHEAD(fd,packet_len(0x98a));
WFIFOW(fd,0)=0x98a;
WFIFOW(fd,2)=packet_len(0x98a);
WFIFOL(fd,4)=c->emblem_id; // EmblemNum
memcpy(WFIFOP(fd,8),c->name, NAME_LENGTH); // Clan name
memcpy(WFIFOP(fd,32),c->master, NAME_LENGTH); // Master name
// Manage map (???) (fd,56)
// Num ally clan (Id of ally clan) (fd,72)
// Num hostile clan (Id of hostile clan) (fd,72)
WFIFOSET(fd,packet_len(0x98a));
}
/// Clan leave (ZC_ACK_CLAN_LEAVE)
/// 0989 -> Call a fonction to leave the clan ?
void clif_clanleave(struct map_session_data* sd)
{
int fd;
nullpo_retv(sd);
fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x989));
WFIFOW(fd,0)=0x989;
WFIFOSET(fd,packet_len(0x989));
}
/// Clan connect info (ZC_NOTIFY_CLAN_CONNECTINFO)
/// 0988 <num connect>.W <num total>.W
void clif_clanconnectinfo(struct map_session_data* sd)
{
int fd;
struct clan *c; // TODO
nullpo_retv(sd);
fd = sd->fd;
if( (c = sd->clan) == NULL )
return;
WFIFOHEAD(fd,packet_len(0x989));
WFIFOW(fd,0)=0x988;
WFIFOW(fd,2)=c->connect_member; //short NumConnect
WFIFOW(fd,4)=c->max_member; //short NumTotal
WFIFOSET(fd,packet_len(0x989));
}
/// Fatigue change (Total play time -> penality ?) (ZC_FATIGUE_CHN)
/// 0982 <char level>.B <total play time>.L
void clif_fatiguechn(struct map_session_data* sd)
{
int fd;
nullpo_retv(sd);
fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x982));
WFIFOW(fd,0)=0x982;
WFIFOB(fd,2)= //char Level
WFIFOL(fd,3)= //long TotalPlayTime
WFIFOSET(fd,packet_len(0x982));
}
/// Personal information request
/// 0x8cb <packet len>.W <exp>.W <death>.W <drop>.W (ZC_PERSONAL_INFOMATION)
/// 0x97b <packet len>.W <exp>.L <death>.L <drop>.L (ZC_PERSONAL_INFOMATION2)
void clif_personalinformation(struct map_session_data* sd)
{
int fd,header;
nullpo_retv(sd);
fd = sd->fd;
#if PACKETVER < 20130320 //date ??
header = 0x8cb;
#else
header=0x97b;
#endif
WFIFOHEAD(fd,packet_len(header));
WFIFOW(fd,0)=header;
WFIFOW(fd,2)=packet_len(header);
#if PACKETVER < 20130320
WFIFOW(fd,4)= //exp rate
WFIFOW(fd,6)= //death exp lost
WFIFOW(fd,8)= //drop rate
#else
WFIFOL(fd,4)= //exp rate
WFIFOL(fd,8)= //death exp lost
WFIFOL(fd,12)= //drop rate
#endif
WFIFOSET(fd,packet_len(header));
}
/// Personal information change (Total play time -> penality ?)
/// 0981 <packet len>.W <exp>.W <death>.W <drop>.W <activity rate>.W (ZC_PERSONAL_INFOMATION_CHN)
void clif_personalinformationchn(struct map_session_data* sd)
{
int fd;
nullpo_retv(sd);
fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x981));
WFIFOW(fd,0)=0x981;
WFIFOW(fd,2)=packet_len(0x981);
WFIFOW(fd,4)= //exp rate
WFIFOW(fd,6)= //death exp lost
WFIFOW(fd,8)= //drop rate
WFIFOW(fd,10)= //activity rate
WFIFOSET(fd,packet_len(0x981));
}
/// Select cart (ZC_SELECTCART)
/// 097f <packet len>.W <identity>.W
void clif_zc_selectcart(struct map_session_data* sd)
{
int fd;
nullpo_retv(sd);
fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x97f));
WFIFOW(fd,0)=0x97f;
WFIFOW(fd,2)=packet_len(0x97f);
WFIFOW(fd,4)= //identity
WFIFOSET(fd,packet_len(0x97f));
}
/// Select cart (CZ_SELECTCART)
/// 0980 <identity>.L <type>.B
void clif_cz_selectcart()
{
// CZ?
}
/// Update ranking point (ZC_UPDATE_RANKING_POINT)
/// 097e <ranking type>.W <point>.L <total point>.L
void clif_updaterankingpoint(struct map_session_data* sd)
{
int fd;
nullpo_retv(sd);
fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x97f));
WFIFOW(fd,0)=0x97f;
WFIFOW(fd,2)= //Ranking type
WFIFOL(fd,4)= //Point
WFIFOL(fd,8)=sd->status.point //TotalPoint TODO
WFIFOSET(fd,packet_len(0x97f));
}
/// Ask ranking ladder (PACKET_ZC_ACK_RANKING)
/// 097d <ranking type>.W { <char name>.18B }*10 { <point>.W }*10 <my point>.W
void clif_ackranking(short rankingtype, struct map_session_data* sd)
{
int fd,i;
const char* name;
nullpo_retv(sd);
fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x97d));
WFIFOW(fd,0)=0x97d;
WFIFOW(fd,2)=rankingtype; //Ranking type
//Packet size limits this list to 10 elements.
for (i = 0; i < 10 && i < MAX_FAME_LIST; i++) { //Here this define can be use for rank (10)
if (rank_list[i].id > 0) { // TODO rank_list
if (strcmp(rank_list[i].name, "-") == 0 &&
(name = map_charid2nick(rank_list[i].id)) != NULL)
{
strncpy((char *)(WFIFOP(fd, 4 + 24 * i)), name, NAME_LENGTH);
} else
strncpy((char *)(WFIFOP(fd, 4 + 24 * i)), rank_list[i].name, NAME_LENGTH);
} else
strncpy((char *)(WFIFOP(fd, 4 + 24 * i)), "None", 5);
WFIFOL(fd, 244 + i * 4) = rank_list[i].fame;
}
for(;i < 10; i++) { //In case the MAX is less than 10.
strncpy((char *)(WFIFOP(fd, 4 + 24 * i)), "Unavailable", 12);
WFIFOL(fd, 244 + i * 4) = 0;
}
WFIFOL(fd,284)= // myPoint
WFIFOSET(fd,packet_len(0x97d));
}
/// req ranking (CZ_REQ_RANKING)
/// 097c <ranking type>.W
void clif_reqranking(struct map_session_data *sd)
{
// TODO receive short ranking type
clif_ackranking(rankingtype,sd);
}
/// req world info (CZ_REQ_BEFORE_WORLD_INFO)
/// 0978 <ranking type>.W
void clif_reqworldinfo(struct map_session_data *sd)
{
// TODO receive short AID
clif_ackworldinfo(aid,sd);
}
/// Ack world info (ZC_ACK_BEFORE_WORLD_INFO)
/// 0979 <world name>.18B <char name>.18B
void clif_ackworldinfo(struct map_session_data* sd)
{
int fd;
nullpo_retv(sd);
fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x979));
WFIFOW(fd,0)=0x979;
//AID -> world name ?
safestrncpy((char*)WFIFOP(fd,2), /* World name */, 24);
safestrncpy((char*)WFIFOP(fd,26), sd->status.name, NAME_LENGHT);
WFIFOSET(fd,packet_len(0x979));
}
/// req cancel merge item (CZ_CANCEL_MERGE_ITEM)
/// 0974
void clif_cancelmergeitem(struct map_session_data *sd)
{
// Call function to cancel merge item
}
/// Ack world info (ZC_PARTY_RECRUIT_REFUSE_VOLUNTEER_TO_PM)
/// 0971 <pm aid>.L
void clif_partyrefusetopm(struct map_session_data* sd)
{
int fd;
nullpo_retv(sd);
fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x971));
WFIFOW(fd,0)=0x971;
//PM AID ?? Long
WFIFOSET(fd,packet_len(0x971));
}