Converted some packets to structs (#8353)
Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
parent
b4ae40d401
commit
cc60c46e5f
389
src/map/clif.cpp
389
src/map/clif.cpp
@ -5562,32 +5562,28 @@ static void clif_clearchar_skillunit(struct skill_unit *unit, int fd)
|
||||
}
|
||||
|
||||
|
||||
/// Removes a skill unit (ZC_SKILL_DISAPPEAR).
|
||||
/// 0120 <id>.L
|
||||
void clif_skill_delunit(struct skill_unit *unit)
|
||||
{
|
||||
unsigned char buf[16];
|
||||
/// Removes a skill unit.
|
||||
/// 0120 <id>.L (ZC_SKILL_DISAPPEAR)
|
||||
void clif_skill_delunit( skill_unit& unit ){
|
||||
PACKET_ZC_SKILL_DISAPPEAR packet{};
|
||||
|
||||
nullpo_retv(unit);
|
||||
packet.packetType = HEADER_ZC_SKILL_DISAPPEAR;
|
||||
packet.GID = unit.bl.id;
|
||||
|
||||
WBUFW(buf, 0)=0x120;
|
||||
WBUFL(buf, 2)=unit->bl.id;
|
||||
clif_send(buf,packet_len(0x120),&unit->bl,AREA);
|
||||
clif_send( &packet, sizeof( packet ), &unit.bl, AREA );
|
||||
}
|
||||
|
||||
|
||||
/// Sent when an object gets ankle-snared (ZC_SKILL_UPDATE).
|
||||
/// 01ac <id>.L
|
||||
/// Sent when an object gets ankle-snared.
|
||||
/// 01ac <id>.L (ZC_SKILL_UPDATE)
|
||||
/// Only affects units with class [139,153] client-side.
|
||||
void clif_skillunit_update(struct block_list* bl)
|
||||
{
|
||||
unsigned char buf[6];
|
||||
nullpo_retv(bl);
|
||||
void clif_skillunit_update( block_list& bl ){
|
||||
PACKET_ZC_SKILL_UPDATE packet{};
|
||||
|
||||
WBUFW(buf,0) = 0x1ac;
|
||||
WBUFL(buf,2) = bl->id;
|
||||
packet.packetType = HEADER_ZC_SKILL_UPDATE;
|
||||
packet.GID = bl.id;
|
||||
|
||||
clif_send(buf,packet_len(0x1ac),bl,AREA);
|
||||
clif_send( &packet, sizeof( packet ), &bl, AREA );
|
||||
}
|
||||
|
||||
|
||||
@ -6856,22 +6852,14 @@ void clif_channel_msg(struct Channel *channel, const char *msg, unsigned long co
|
||||
/// 5 = HP (SP_HP)
|
||||
/// 7 = SP (SP_SP)
|
||||
/// ? = ignored
|
||||
void clif_heal(int fd,int type,int val) {
|
||||
#if PACKETVER < 20141022
|
||||
const int cmd = 0x13d;
|
||||
#else
|
||||
const int cmd = 0xa27;
|
||||
#endif
|
||||
void clif_heal( map_session_data& sd, int32 type, uint32 val ) {
|
||||
PACKET_ZC_RECOVERY packet{};
|
||||
|
||||
WFIFOHEAD(fd, packet_len(cmd));
|
||||
WFIFOW(fd,0) = cmd;
|
||||
WFIFOW(fd,2) = type;
|
||||
#if PACKETVER < 20141022
|
||||
WFIFOW(fd,4) = min(val, INT16_MAX);
|
||||
#else
|
||||
WFIFOL(fd,4) = min(val, INT32_MAX);
|
||||
#endif
|
||||
WFIFOSET(fd, packet_len(cmd));
|
||||
packet.packetType = HEADER_ZC_RECOVERY;
|
||||
packet.type = static_cast<decltype(packet.type)>(type);
|
||||
packet.amount = std::min( static_cast<decltype(packet.amount)>( val ), std::numeric_limits<decltype(packet.amount)>::max() );
|
||||
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
@ -7061,31 +7049,22 @@ void clif_wis_message(map_session_data* sd, const char* nick, const char* mes, s
|
||||
|
||||
/// Inform the player about the result of his whisper action
|
||||
/// 0098 <result>.B (ZC_ACK_WHISPER).
|
||||
/// 09df <result>.B <GID>.L (ZC_ACK_WHISPER02).
|
||||
/// 09df <result>.B <CID>.L (ZC_ACK_WHISPER02).
|
||||
/// result:
|
||||
/// 0 = success to send wisper
|
||||
/// 0 = success to send whisper
|
||||
/// 1 = target character is not loged in
|
||||
/// 2 = ignored by target
|
||||
/// 3 = everyone ignored by target
|
||||
void clif_wis_end(int fd, int result)
|
||||
{
|
||||
map_session_data *sd = (session_isActive(fd) ? (map_session_data *)session[fd]->session_data : nullptr);
|
||||
#if PACKETVER < 20131223
|
||||
const int cmd = 0x98;
|
||||
#else
|
||||
const int cmd = 0x9df;
|
||||
#endif
|
||||
void clif_wis_end( map_session_data& sd, e_ack_whisper result ){
|
||||
PACKET_ZC_ACK_WHISPER packet{};
|
||||
|
||||
if (!sd)
|
||||
return;
|
||||
|
||||
WFIFOHEAD(fd,packet_len(cmd));
|
||||
WFIFOW(fd,0) = cmd;
|
||||
WFIFOB(fd,2) = (char)result;
|
||||
packet.packetType = HEADER_ZC_ACK_WHISPER;
|
||||
packet.result = static_cast<decltype(packet.result)>(result);
|
||||
#if PACKETVER >= 20131223
|
||||
WFIFOL(fd,3) = sd->status.char_id; // GID/CCODE
|
||||
packet.CID = sd.status.char_id;
|
||||
#endif
|
||||
WFIFOSET(fd,packet_len(cmd));
|
||||
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
@ -7169,24 +7148,20 @@ void clif_use_card(map_session_data *sd,int idx)
|
||||
}
|
||||
|
||||
|
||||
/// Notifies the client about the result of item carding/composition (ZC_ACK_ITEMCOMPOSITION).
|
||||
/// 017d <equip index>.W <card index>.W <result>.B
|
||||
/// Notifies the client about the result of item carding/composition.
|
||||
/// 017d <equip index>.W <card index>.W <result>.B (ZC_ACK_ITEMCOMPOSITION)
|
||||
/// result:
|
||||
/// 0 = success
|
||||
/// 1 = failure
|
||||
void clif_insert_card(map_session_data *sd,int idx_equip,int idx_card,int flag)
|
||||
{
|
||||
int fd;
|
||||
void clif_insert_card( map_session_data& sd, int32 idx_equip, int32 idx_card, bool failure ){
|
||||
PACKET_ZC_ACK_ITEMCOMPOSITION packet{};
|
||||
|
||||
nullpo_retv(sd);
|
||||
packet.packetType = HEADER_ZC_ACK_ITEMCOMPOSITION;
|
||||
packet.equipIndex = client_index( idx_equip );
|
||||
packet.cardIndex = client_index( idx_card );
|
||||
packet.result = failure;
|
||||
|
||||
fd=sd->fd;
|
||||
WFIFOHEAD(fd,packet_len(0x17d));
|
||||
WFIFOW(fd,0)=0x17d;
|
||||
WFIFOW(fd,2)=idx_equip+2;
|
||||
WFIFOW(fd,4)=idx_card+2;
|
||||
WFIFOB(fd,6)=flag;
|
||||
WFIFOSET(fd,packet_len(0x17d));
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
@ -7219,20 +7194,19 @@ void clif_item_identify_list(map_session_data *sd)
|
||||
}
|
||||
|
||||
|
||||
/// Notifies the client about the result of a item identify request (ZC_ACK_ITEMIDENTIFY).
|
||||
/// 0179 <index>.W <result>.B
|
||||
void clif_item_identified(map_session_data *sd,int idx,int flag)
|
||||
{
|
||||
int fd;
|
||||
/// Notifies the client about the result of a item identify request.
|
||||
/// 0179 <index>.W <result>.B (ZC_ACK_ITEMIDENTIFY)
|
||||
/// result:
|
||||
/// 0 = success
|
||||
/// 1 = failure
|
||||
void clif_item_identified( map_session_data& sd, int32 idx, bool failure ){
|
||||
PACKET_ZC_ACK_ITEMIDENTIFY packet{};
|
||||
|
||||
nullpo_retv(sd);
|
||||
packet.packetType = HEADER_ZC_ACK_ITEMIDENTIFY;
|
||||
packet.index = client_index( idx );
|
||||
packet.result = failure;
|
||||
|
||||
fd=sd->fd;
|
||||
WFIFOHEAD(fd,packet_len(0x179));
|
||||
WFIFOW(fd, 0)=0x179;
|
||||
WFIFOW(fd, 2)=idx+2;
|
||||
WFIFOB(fd, 4)=flag;
|
||||
WFIFOSET(fd,packet_len(0x179));
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
@ -7269,41 +7243,35 @@ void clif_item_repair_list( map_session_data& sd, map_session_data& dstsd, uint1
|
||||
}
|
||||
|
||||
|
||||
/// Notifies the client about the result of a item repair request (ZC_ACK_ITEMREPAIR).
|
||||
/// 01fe <index>.W <result>.B
|
||||
/// Notifies the client about the result of a item repair request.
|
||||
/// 01fe <index>.W <result>.B (ZC_ACK_ITEMREPAIR)
|
||||
/// index:
|
||||
/// ignored (inventory index)
|
||||
/// result:
|
||||
/// 0 = Item repair success.
|
||||
/// 1 = Item repair failure.
|
||||
void clif_item_repaireffect(map_session_data *sd,int idx,int flag)
|
||||
{
|
||||
int fd;
|
||||
void clif_item_repaireffect( map_session_data& sd, int32 idx, bool failure ){
|
||||
PACKET_ZC_ACK_ITEMREPAIR packet{};
|
||||
|
||||
nullpo_retv(sd);
|
||||
|
||||
fd = sd->fd;
|
||||
|
||||
WFIFOHEAD(fd,packet_len(0x1fe));
|
||||
WFIFOW(fd, 0)=0x1fe;
|
||||
WFIFOW(fd, 2)=idx+2;
|
||||
WFIFOB(fd, 4)=flag;
|
||||
WFIFOSET(fd,packet_len(0x1fe));
|
||||
packet.packetType = HEADER_ZC_ACK_ITEMREPAIR;
|
||||
packet.index = client_index( idx );
|
||||
packet.result = failure;
|
||||
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
/// Displays a message, that an equipment got damaged (ZC_EQUIPITEM_DAMAGED).
|
||||
/// 02bb <equip location>.W <account id>.L
|
||||
void clif_item_damaged(map_session_data* sd, unsigned short position)
|
||||
{
|
||||
int fd = sd->fd;
|
||||
/// Displays a message, that an equipment got damaged.
|
||||
/// 02bb <equip location>.W <account id>.L (ZC_EQUIPITEM_DAMAGED)
|
||||
void clif_item_damaged( map_session_data& sd, uint16 position ){
|
||||
PACKET_ZC_EQUIPITEM_DAMAGED packet{};
|
||||
|
||||
WFIFOHEAD(fd,packet_len(0x2bb));
|
||||
WFIFOW(fd,0) = 0x2bb;
|
||||
WFIFOW(fd,2) = position;
|
||||
WFIFOL(fd,4) = sd->bl.id; // TODO: the packet seems to be sent to other people as well, probably party and/or guild.
|
||||
WFIFOSET(fd,packet_len(0x2bb));
|
||||
packet.packetType = HEADER_ZC_EQUIPITEM_DAMAGED;
|
||||
packet.equipLocation = position;
|
||||
packet.GID = sd.bl.id;
|
||||
|
||||
// TODO: the packet seems to be sent to other people as well, probably party and/or guild.
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
@ -7413,24 +7381,18 @@ void clif_cart_additem( map_session_data *sd, int n, int amount ){
|
||||
clif_send( &p, sizeof( p ), &sd->bl, SELF );
|
||||
}
|
||||
|
||||
// [Ind/Hercules] - Data Thanks to Yommy (ZC_ACK_ADDITEM_TO_CART)
|
||||
/* Acknowledge an item have been added to cart
|
||||
* 012c <result>B
|
||||
* result :
|
||||
* 0 = ADDITEM_TO_CART_FAIL_WEIGHT
|
||||
* 1 = ADDITEM_TO_CART_FAIL_COUNT
|
||||
*/
|
||||
void clif_cart_additem_ack(map_session_data *sd, uint8 flag)
|
||||
{
|
||||
int fd;
|
||||
unsigned char *buf;
|
||||
nullpo_retv(sd);
|
||||
/// Acknowledge an item have been added to cart
|
||||
/// 012c <result>.B (ZC_ACK_ADDITEM_TO_CART)
|
||||
/// result:
|
||||
/// 0 = ADDITEM_TO_CART_FAIL_WEIGHT
|
||||
/// 1 = ADDITEM_TO_CART_FAIL_COUNT
|
||||
void clif_cart_additem_ack( map_session_data& sd, e_ack_additem_to_cart flag ){
|
||||
PACKET_ZC_ACK_ADDITEM_TO_CART packet{};
|
||||
|
||||
fd = sd->fd;
|
||||
buf = WFIFOP(fd,0);
|
||||
WBUFW(buf,0) = 0x12c;
|
||||
WBUFB(buf,2) = flag;
|
||||
clif_send(buf,packet_len(0x12c),&sd->bl,SELF);
|
||||
packet.packetType = HEADER_ZC_ACK_ADDITEM_TO_CART;
|
||||
packet.result = static_cast<decltype(packet.result)>(flag);
|
||||
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
// 09B7 <unknow data> (ZC_ACK_OPEN_BANKING)
|
||||
@ -7636,39 +7598,30 @@ void clif_parse_BankWithdraw(int fd, map_session_data* sd) {
|
||||
#endif
|
||||
}
|
||||
|
||||
/// Deletes an item from character's cart (ZC_DELETE_ITEM_FROM_CART).
|
||||
/// 0125 <index>.W <amount>.L
|
||||
void clif_cart_delitem(map_session_data *sd,int n,int amount)
|
||||
{
|
||||
int fd;
|
||||
/// Deletes an item from character's cart.
|
||||
/// 0125 <index>.W <amount>.L (ZC_DELETE_ITEM_FROM_CART)
|
||||
void clif_cart_delitem( map_session_data& sd, int32 index, int32 amount ){
|
||||
PACKET_ZC_DELETE_ITEM_FROM_CART packet{};
|
||||
|
||||
nullpo_retv(sd);
|
||||
packet.packetType = HEADER_ZC_DELETE_ITEM_FROM_CART;
|
||||
packet.index = client_index( index );
|
||||
packet.amount = amount;
|
||||
|
||||
fd=sd->fd;
|
||||
|
||||
WFIFOHEAD(fd,packet_len(0x125));
|
||||
WFIFOW(fd,0)=0x125;
|
||||
WFIFOW(fd,2)=n+2;
|
||||
WFIFOL(fd,4)=amount;
|
||||
WFIFOSET(fd,packet_len(0x125));
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
/// Opens the shop creation menu (ZC_OPENSTORE).
|
||||
/// 012d <num>.W
|
||||
/// Opens the shop creation menu.
|
||||
/// 012d <num>.W (ZC_OPENSTORE)
|
||||
/// num:
|
||||
/// number of allowed item slots
|
||||
void clif_openvendingreq(map_session_data* sd, int num)
|
||||
{
|
||||
int fd;
|
||||
void clif_openvendingreq( map_session_data& sd, uint16 num ){
|
||||
PACKET_ZC_OPENSTORE packet{};
|
||||
|
||||
nullpo_retv(sd);
|
||||
packet.packetType = HEADER_ZC_OPENSTORE;
|
||||
packet.num = num;
|
||||
|
||||
fd = sd->fd;
|
||||
WFIFOHEAD(fd,packet_len(0x12d));
|
||||
WFIFOW(fd,0) = 0x12d;
|
||||
WFIFOW(fd,2) = num;
|
||||
WFIFOSET(fd,packet_len(0x12d));
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
@ -7766,8 +7719,8 @@ void clif_vendinglist( map_session_data* sd, map_session_data* vsd ){
|
||||
}
|
||||
|
||||
|
||||
/// Shop purchase failure (ZC_PC_PURCHASE_RESULT_FROMMC).
|
||||
/// 0135 <index>.W <amount>.W <result>.B
|
||||
/// Shop purchase failure.
|
||||
/// 0135 <index>.W <amount>.W <result>.B (ZC_PC_PURCHASE_RESULT_FROMMC)
|
||||
/// result:
|
||||
/// 0 = success
|
||||
/// 1 = not enough zeny
|
||||
@ -7776,37 +7729,32 @@ void clif_vendinglist( map_session_data* sd, map_session_data* vsd ){
|
||||
/// 5 = "cannot use an npc shop while in a trade"
|
||||
/// 6 = Because the store information was incorrect the item was not purchased.
|
||||
/// 7 = No sales information.
|
||||
void clif_buyvending(map_session_data* sd, int index, int amount, int fail)
|
||||
{
|
||||
int fd;
|
||||
void clif_buyvending( map_session_data& sd, uint16 index, uint16 amount, e_pc_purchase_result_frommc result ){
|
||||
PACKET_ZC_PC_PURCHASE_RESULT_FROMMC packet{};
|
||||
|
||||
nullpo_retv(sd);
|
||||
packet.packetType = HEADER_ZC_PC_PURCHASE_RESULT_FROMMC;
|
||||
packet.index = client_index( index );
|
||||
packet.amount = amount;
|
||||
packet.result = static_cast<decltype(packet.result)>(result);
|
||||
|
||||
fd = sd->fd;
|
||||
WFIFOHEAD(fd,packet_len(0x135));
|
||||
WFIFOW(fd,0) = 0x135;
|
||||
WFIFOW(fd,2) = index+2;
|
||||
WFIFOW(fd,4) = amount;
|
||||
WFIFOB(fd,6) = fail;
|
||||
WFIFOSET(fd,packet_len(0x135));
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
/// Show's vending player its list of items for sale (ZC_ACK_OPENSTORE2).
|
||||
/// 0a28 <Result>.B
|
||||
|
||||
/// Show's vending player its list of items for sale.
|
||||
/// 0a28 <result>.B (ZC_ACK_OPENSTORE2)
|
||||
/// result:
|
||||
/// 0 = Successed
|
||||
/// 0 = Success
|
||||
/// 1 = Failed
|
||||
void clif_openvending_ack(map_session_data* sd, int result)
|
||||
{
|
||||
int fd;
|
||||
void clif_openvending_ack( map_session_data& sd, bool failure ){
|
||||
#if PACKETVER >= 20141022
|
||||
PACKET_ZC_ACK_OPENSTORE2 packet{};
|
||||
|
||||
nullpo_retv(sd);
|
||||
packet.packetType = HEADER_ZC_ACK_OPENSTORE2;
|
||||
packet.result = failure;
|
||||
|
||||
fd = sd->fd;
|
||||
WFIFOHEAD(fd, 3);
|
||||
WFIFOW(fd,0) = 0xa28;
|
||||
WFIFOB(fd,2) = result;
|
||||
WFIFOSET(fd, 3);
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
#endif
|
||||
}
|
||||
|
||||
/// Shop creation success.
|
||||
@ -7853,37 +7801,28 @@ void clif_openvending( map_session_data* sd, int id, struct s_vending* vending )
|
||||
|
||||
WFIFOSET( fd, len );
|
||||
|
||||
#if PACKETVER >= 20141022
|
||||
/// 0 = Successed
|
||||
/// 1 = Failed
|
||||
clif_openvending_ack( sd, 0 );
|
||||
#endif
|
||||
clif_openvending_ack( *sd, false );
|
||||
}
|
||||
|
||||
|
||||
/// Inform merchant that someone has bought an item.
|
||||
/// 0137 <index>.W <amount>.W (ZC_DELETEITEM_FROM_MCSTORE).
|
||||
/// 09e5 <index>.W <amount>.W <GID>.L <Date>.L <zeny>.L (ZC_DELETEITEM_FROM_MCSTORE2).
|
||||
void clif_vendingreport(map_session_data* sd, int index, int amount, uint32 char_id, int zeny) {
|
||||
#if PACKETVER < 20141016 // TODO : not sure for client date [Napster]
|
||||
const int cmd = 0x137;
|
||||
#else
|
||||
const int cmd = 0x9e5;
|
||||
#endif
|
||||
int fd = sd->fd;
|
||||
/// 0137 <index>.W <amount>.W (ZC_DELETEITEM_FROM_MCSTORE)
|
||||
/// 09e5 <index>.W <amount>.W <GID>.L <Date>.L <zeny>.L (ZC_DELETEITEM_FROM_MCSTORE2)
|
||||
void clif_vendingreport( map_session_data& sd, uint16 index, uint16 amount, uint32 char_id, int32 zeny ){
|
||||
PACKET_ZC_DELETEITEM_FROM_MCSTORE packet{};
|
||||
|
||||
nullpo_retv(sd);
|
||||
packet.packetType = HEADER_ZC_DELETEITEM_FROM_MCSTORE;
|
||||
packet.index = client_index( index );
|
||||
packet.amount = amount;
|
||||
|
||||
WFIFOHEAD(fd,packet_len(cmd));
|
||||
WFIFOW(fd,0) = cmd;
|
||||
WFIFOW(fd,2) = index+2;
|
||||
WFIFOW(fd,4) = amount;
|
||||
// TODO : not sure for client date [Napster]
|
||||
#if PACKETVER >= 20141016
|
||||
WFIFOL(fd,6) = char_id; // GID
|
||||
WFIFOL(fd,10) = (int)time(nullptr); // Date
|
||||
WFIFOL(fd,14) = zeny; // zeny
|
||||
packet.buyerCID = char_id;
|
||||
packet.date = client_tick( time(nullptr) );
|
||||
packet.zeny = zeny;
|
||||
#endif
|
||||
WFIFOSET(fd,packet_len(cmd));
|
||||
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
@ -8271,25 +8210,21 @@ void clif_hpmeter_single( map_session_data& sd, uint32 id, uint32 hp, uint32 max
|
||||
clif_send( &p, sizeof( p ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
/// Notifies the client, that it's attack target is too far (ZC_ATTACK_FAILURE_FOR_DISTANCE).
|
||||
/// 0139 <target id>.L <target x>.W <target y>.W <x>.W <y>.W <atk range>.W
|
||||
void clif_movetoattack(map_session_data *sd,struct block_list *bl)
|
||||
{
|
||||
int fd;
|
||||
|
||||
nullpo_retv(sd);
|
||||
nullpo_retv(bl);
|
||||
/// Notifies the client, that it's attack target is too far.
|
||||
/// 0139 <target id>.L <target x>.W <target y>.W <x>.W <y>.W <atk range>.W (ZC_ATTACK_FAILURE_FOR_DISTANCE)
|
||||
void clif_movetoattack( map_session_data& sd, block_list& bl ){
|
||||
PACKET_ZC_ATTACK_FAILURE_FOR_DISTANCE packet{};
|
||||
|
||||
fd=sd->fd;
|
||||
WFIFOHEAD(fd,packet_len(0x139));
|
||||
WFIFOW(fd, 0)=0x139;
|
||||
WFIFOL(fd, 2)=bl->id;
|
||||
WFIFOW(fd, 6)=bl->x;
|
||||
WFIFOW(fd, 8)=bl->y;
|
||||
WFIFOW(fd,10)=sd->bl.x;
|
||||
WFIFOW(fd,12)=sd->bl.y;
|
||||
WFIFOW(fd,14)=sd->battle_status.rhw.range;
|
||||
WFIFOSET(fd,packet_len(0x139));
|
||||
packet.PacketType = HEADER_ZC_ATTACK_FAILURE_FOR_DISTANCE;
|
||||
packet.targetAID = bl.id;
|
||||
packet.targetXPos = bl.x;
|
||||
packet.targetYPos = bl.y;
|
||||
packet.xPos = sd.bl.x;
|
||||
packet.yPos = sd.bl.y;
|
||||
packet.currentAttRange = sd.battle_status.rhw.range;
|
||||
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
@ -8315,36 +8250,28 @@ void clif_produceeffect(map_session_data* sd,int flag, t_itemid nameid){
|
||||
}
|
||||
|
||||
|
||||
/// Initiates the pet taming process (ZC_START_CAPTURE).
|
||||
/// 019e
|
||||
void clif_catch_process(map_session_data *sd)
|
||||
{
|
||||
int fd;
|
||||
/// Initiates the pet taming process.
|
||||
/// 019e (ZC_START_CAPTURE)
|
||||
void clif_catch_process( map_session_data& sd ){
|
||||
PACKET_ZC_START_CAPTURE packet{};
|
||||
|
||||
nullpo_retv(sd);
|
||||
packet.PacketType = HEADER_ZC_START_CAPTURE;
|
||||
|
||||
fd=sd->fd;
|
||||
WFIFOHEAD(fd,packet_len(0x19e));
|
||||
WFIFOW(fd,0)=0x19e;
|
||||
WFIFOSET(fd,packet_len(0x19e));
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
/// Displays the result of a pet taming attempt (ZC_TRYCAPTURE_MONSTER).
|
||||
/// 01a0 <result>.B
|
||||
/// Displays the result of a pet taming attempt.
|
||||
/// 01a0 <result>.B (ZC_TRYCAPTURE_MONSTER)
|
||||
/// 0 = failure
|
||||
/// 1 = success
|
||||
void clif_pet_roulette(map_session_data *sd,int data)
|
||||
{
|
||||
int fd;
|
||||
void clif_pet_roulette( map_session_data& sd, bool success ){
|
||||
PACKET_ZC_TRYCAPTURE_MONSTER packet{};
|
||||
|
||||
nullpo_retv(sd);
|
||||
packet.PacketType = HEADER_ZC_TRYCAPTURE_MONSTER;
|
||||
packet.result = success;
|
||||
|
||||
fd=sd->fd;
|
||||
WFIFOHEAD(fd,packet_len(0x1a0));
|
||||
WFIFOW(fd,0)=0x1a0;
|
||||
WFIFOB(fd,2)=data;
|
||||
WFIFOSET(fd,packet_len(0x1a0));
|
||||
clif_send( &packet, sizeof( packet ), &sd.bl, SELF );
|
||||
}
|
||||
|
||||
|
||||
@ -11979,9 +11906,9 @@ void clif_parse_WisMessage(int fd, map_session_data* sd)
|
||||
// if player ignores everyone
|
||||
if (dstsd->state.ignoreAll && pc_get_group_level(sd) <= pc_get_group_level(dstsd)) {
|
||||
if (pc_isinvisible(dstsd) && pc_get_group_level(sd) < pc_get_group_level(dstsd))
|
||||
clif_wis_end(fd, 1); // 1: target character is not logged in
|
||||
clif_wis_end( *sd, ACKWHISPER_TARGET_OFFLINE );
|
||||
else
|
||||
clif_wis_end(fd, 3); // 3: everyone ignored by target
|
||||
clif_wis_end( *sd, ACKWHISPER_ALL_IGNORED );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -11996,13 +11923,13 @@ void clif_parse_WisMessage(int fd, map_session_data* sd)
|
||||
// if player ignores the source character
|
||||
ARR_FIND(0, MAX_IGNORE_LIST, i, dstsd->ignore[i].name[0] == '\0' || strcmp(dstsd->ignore[i].name, sd->status.name) == 0);
|
||||
if(i < MAX_IGNORE_LIST && dstsd->ignore[i].name[0] != '\0') { // source char present in ignore list
|
||||
clif_wis_end(fd, 2); // 2: ignored by target
|
||||
clif_wis_end( *sd, ACKWHISPER_IGNORED );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// notify sender of success
|
||||
clif_wis_end(fd, 0); // 0: success to send wisper
|
||||
clif_wis_end( *sd, ACKWHISPER_SUCCESS );
|
||||
|
||||
// Normal message
|
||||
clif_wis_message(dstsd, sd->status.name, message, strlen(message)+1, 0);
|
||||
|
@ -492,10 +492,6 @@ enum useskill_fail_cause : uint8_t
|
||||
|
||||
enum clif_messages : uint16_t {
|
||||
/* Constant values */
|
||||
// clif_cart_additem_ack flags
|
||||
ADDITEM_TO_CART_FAIL_WEIGHT = 0x0,
|
||||
ADDITEM_TO_CART_FAIL_COUNT = 0x1,
|
||||
|
||||
// clif_equipitemack flags
|
||||
#if PACKETVER_MAIN_NUM >= 20121205 || PACKETVER_RE_NUM >= 20121107 || defined(PACKETVER_ZERO)
|
||||
ITEM_EQUIP_ACK_OK = 0,
|
||||
@ -675,6 +671,28 @@ enum e_notify_effect : uint8 {
|
||||
NOTIFYEFFECT_TAEKWON_BASE_LEVEL_UP = 9,
|
||||
};
|
||||
|
||||
enum e_pc_purchase_result_frommc : uint8 {
|
||||
PURCHASEMC_SUCCESS = 0,
|
||||
PURCHASEMC_NO_ZENY = 1,
|
||||
PURCHASEMC_OVERWEIGHT = 2,
|
||||
PURCHASEMC_OUT_OF_STOCK = 4,
|
||||
PURCHASEMC_TRADING = 5,
|
||||
PURCHASEMC_STORE_INCORRECT = 6,
|
||||
PURCHASEMC_NO_SALES_INFO = 7,
|
||||
};
|
||||
|
||||
enum e_ack_whisper : uint8 {
|
||||
ACKWHISPER_SUCCESS = 0,
|
||||
ACKWHISPER_TARGET_OFFLINE = 1,
|
||||
ACKWHISPER_IGNORED = 2,
|
||||
ACKWHISPER_ALL_IGNORED = 3
|
||||
};
|
||||
|
||||
enum e_ack_additem_to_cart : uint8 {
|
||||
ADDITEM_TO_CART_FAIL_WEIGHT = 0,
|
||||
ADDITEM_TO_CART_FAIL_COUNT = 1
|
||||
};
|
||||
|
||||
int clif_setip(const char* ip);
|
||||
void clif_setbindip(const char* ip);
|
||||
void clif_setport(uint16 port);
|
||||
@ -813,8 +831,8 @@ void clif_cooking_list(map_session_data *sd, int trigger, uint16 skill_id, int q
|
||||
void clif_produceeffect(map_session_data* sd,int flag, t_itemid nameid);
|
||||
|
||||
void clif_getareachar_skillunit(struct block_list *bl, struct skill_unit *unit, enum send_target target, bool visible);
|
||||
void clif_skill_delunit(struct skill_unit *unit);
|
||||
void clif_skillunit_update(struct block_list* bl);
|
||||
void clif_skill_delunit( skill_unit& unit );
|
||||
void clif_skillunit_update( block_list& bl);
|
||||
|
||||
void clif_skill_unit_test(struct block_list *bl, short x, short y, int unit_id, short range, short skill_lv);
|
||||
|
||||
@ -834,7 +852,7 @@ void clif_efst_status_change(struct block_list *bl, int tid, enum send_target ta
|
||||
void clif_efst_status_change_sub(struct block_list *tbl, struct block_list *bl, enum send_target target);
|
||||
|
||||
void clif_wis_message(map_session_data* sd, const char* nick, const char* mes, size_t mes_len, int gmlvl);
|
||||
void clif_wis_end(int fd, int result);
|
||||
void clif_wis_end( map_session_data& sd, e_ack_whisper result );
|
||||
|
||||
void clif_solved_charname(int fd, int charid, const char* name);
|
||||
void clif_name( struct block_list* src, struct block_list *bl, send_target target );
|
||||
@ -842,22 +860,22 @@ void clif_name( struct block_list* src, struct block_list *bl, send_target targe
|
||||
#define clif_name_area(bl) clif_name( (bl), (bl), AREA )
|
||||
|
||||
void clif_use_card(map_session_data *sd,int idx);
|
||||
void clif_insert_card(map_session_data *sd,int idx_equip,int idx_card,int flag);
|
||||
void clif_insert_card( map_session_data& sd, int32 idx_equip, int32 idx_card, bool failure );
|
||||
|
||||
void clif_inventorylist(map_session_data *sd);
|
||||
void clif_equiplist(map_session_data *sd);
|
||||
|
||||
void clif_cart_additem(map_session_data *sd,int n,int amount);
|
||||
void clif_cart_additem_ack(map_session_data *sd, uint8 flag);
|
||||
void clif_cart_delitem(map_session_data *sd,int n,int amount);
|
||||
void clif_cart_additem_ack( map_session_data& sd, e_ack_additem_to_cart flag );
|
||||
void clif_cart_delitem( map_session_data& sd, int32 index, int32 amount );
|
||||
void clif_cartlist(map_session_data *sd);
|
||||
void clif_clearcart(int fd);
|
||||
|
||||
void clif_item_identify_list(map_session_data *sd);
|
||||
void clif_item_identified(map_session_data *sd,int idx,int flag);
|
||||
void clif_item_identified( map_session_data& sd, int32 idx, bool failure );
|
||||
void clif_item_repair_list( map_session_data& sd, map_session_data& dstsd, uint16 lv );
|
||||
void clif_item_repaireffect(map_session_data *sd, int idx, int flag);
|
||||
void clif_item_damaged(map_session_data* sd, unsigned short position);
|
||||
void clif_item_repaireffect( map_session_data& sd, int32 idx, bool failure );
|
||||
void clif_item_damaged( map_session_data& sd, uint16 position );
|
||||
void clif_item_refine_list(map_session_data *sd);
|
||||
void clif_hat_effects( map_session_data* sd, struct block_list* bl, enum send_target target );
|
||||
void clif_hat_effect_single( map_session_data* sd, uint16 effectId, bool enable );
|
||||
@ -871,15 +889,15 @@ void clif_mvp_noitem(map_session_data* sd);
|
||||
void clif_changed_dir(struct block_list *bl, enum send_target target);
|
||||
|
||||
// vending
|
||||
void clif_openvendingreq(map_session_data* sd, int num);
|
||||
void clif_openvendingreq( map_session_data& sd, uint16 num );
|
||||
void clif_showvendingboard( map_session_data& sd, enum send_target target = AREA_WOS, struct block_list* tbl = nullptr );
|
||||
void clif_closevendingboard(struct block_list* bl, int fd);
|
||||
void clif_vendinglist( map_session_data* sd, map_session_data* vsd );
|
||||
void clif_buyvending(map_session_data* sd, int index, int amount, int fail);
|
||||
void clif_buyvending( map_session_data& sd, uint16 index, uint16 amount, e_pc_purchase_result_frommc result );
|
||||
void clif_openvending(map_session_data* sd, int id, struct s_vending* vending);
|
||||
void clif_vendingreport(map_session_data* sd, int index, int amount, uint32 char_id, int zeny);
|
||||
void clif_vendingreport( map_session_data& sd, uint16 index, uint16 amount, uint32 char_id, int32 zeny );
|
||||
|
||||
void clif_movetoattack(map_session_data *sd,struct block_list *bl);
|
||||
void clif_movetoattack( map_session_data& sd, block_list& bl );
|
||||
|
||||
// party
|
||||
void clif_party_created( map_session_data& sd, int result );
|
||||
@ -962,7 +980,7 @@ void clif_displaymessage(const int fd, const char* mes);
|
||||
void clif_disp_message(struct block_list* src, const char* mes, size_t len, enum send_target target);
|
||||
void clif_broadcast(struct block_list* bl, const char* mes, size_t len, int type, enum send_target target);
|
||||
void clif_broadcast2(struct block_list* bl, const char* mes, size_t len, unsigned long fontColor, short fontType, short fontSize, short fontAlign, short fontY, enum send_target target);
|
||||
void clif_heal(int fd,int type,int val);
|
||||
void clif_heal( map_session_data& sd, int32 type, uint32 val );
|
||||
void clif_resurrection( block_list& bl );
|
||||
void clif_map_property(struct block_list *bl, enum map_property property, enum send_target t);
|
||||
void clif_pvpset(map_session_data *sd, int pvprank, int pvpnum,int type);
|
||||
@ -971,8 +989,8 @@ void clif_refine( map_session_data& sd, uint16 index, e_ack_itemrefining result
|
||||
void clif_upgrademessage( map_session_data* sd, int result, t_itemid item_id );
|
||||
|
||||
//petsystem
|
||||
void clif_catch_process(map_session_data *sd);
|
||||
void clif_pet_roulette(map_session_data *sd,int data);
|
||||
void clif_catch_process( map_session_data& sd );
|
||||
void clif_pet_roulette( map_session_data& sd, bool success );
|
||||
void clif_sendegg(map_session_data *sd);
|
||||
void clif_send_petstatus(map_session_data *sd);
|
||||
void clif_send_petdata(map_session_data* sd, struct pet_data* pd, int type, int param);
|
||||
|
@ -47,7 +47,6 @@
|
||||
packet(0x0093,2);
|
||||
parseable_packet(0x0094,6,clif_parse_GetCharNameRequest,2);
|
||||
parseable_packet(0x0096,-1,clif_parse_WisMessage,2,4,28);
|
||||
packet(0x0098,3);
|
||||
parseable_packet(0x0099,-1,clif_parse_Broadcast,2,4);
|
||||
packet(0x009a,-1);
|
||||
parseable_packet(0x009b,5,clif_parse_ChangeDir,2,4);
|
||||
@ -150,27 +149,19 @@
|
||||
packet(0x011c,68);
|
||||
parseable_packet(0x011d,2,clif_parse_RequestMemo,0);
|
||||
packet(0x011f,16);
|
||||
packet(0x0120,6);
|
||||
packet( cartlistequipType, -1 );
|
||||
packet( cartlistnormalType, -1 );
|
||||
packet(0x0125,8);
|
||||
parseable_packet( HEADER_CZ_MOVE_ITEM_FROM_BODY_TO_CART, sizeof( PACKET_CZ_MOVE_ITEM_FROM_BODY_TO_CART ), clif_parse_PutItemToCart, 0 );
|
||||
parseable_packet(0x0127,8,clif_parse_GetItemFromCart,2,4);
|
||||
parseable_packet(0x0128,8,clif_parse_MoveFromKafraToCart,2,4);
|
||||
parseable_packet(0x0129,8,clif_parse_MoveToKafraFromCart,2,4);
|
||||
parseable_packet(0x012a,2,clif_parse_RemoveOption,0);
|
||||
packet(0x012c,3);
|
||||
packet(0x012d,4);
|
||||
parseable_packet(0x012e,2,clif_parse_CloseVending,0);
|
||||
parseable_packet(0x012f,-1,clif_parse_OpenVending,2,4,0,84);
|
||||
parseable_packet(0x0130,6,clif_parse_VendingListReq,2);
|
||||
packet(0x0132,6);
|
||||
parseable_packet( HEADER_CZ_PC_PURCHASE_ITEMLIST_FROMMC, -1, clif_parse_PurchaseReq, 0 );
|
||||
packet(0x0135,7);
|
||||
packet(0x0137,6);
|
||||
packet(0x0138,3);
|
||||
packet(0x0139,16);
|
||||
packet(0x013d,6);
|
||||
packet(0x013e,24);
|
||||
parseable_packet(0x013f,26,clif_parse_GM_Item_Monster,2);
|
||||
parseable_packet(0x0140,22,clif_parse_MapMove,2,18,20);
|
||||
@ -226,11 +217,9 @@
|
||||
packet(0x0176,106);
|
||||
packet(0x0177,-1);
|
||||
parseable_packet(0x0178,4,clif_parse_ItemIdentify,2);
|
||||
packet(0x0179,5);
|
||||
parseable_packet(0x017a,4,clif_parse_UseCard,2);
|
||||
packet(0x017b,-1);
|
||||
parseable_packet(0x017c,6,clif_parse_InsertCard,2,4);
|
||||
packet(0x017d,7);
|
||||
parseable_packet(0x017e,-1,clif_parse_GuildMessage,2,4);
|
||||
packet(0x017f,-1);
|
||||
parseable_packet(0x0180,6,clif_parse_GuildOpposition,2);
|
||||
@ -260,9 +249,7 @@
|
||||
packet(0x019a,14);
|
||||
parseable_packet(0x019c,-1,clif_parse_LocalBroadcast,2,4);
|
||||
parseable_packet(0x019d,6,clif_parse_GMHide,2);
|
||||
packet(0x019e,2);
|
||||
parseable_packet(0x019f,6,clif_parse_CatchPet,2);
|
||||
packet(0x01a0,3);
|
||||
parseable_packet(0x01a1,3,clif_parse_PetMenu,2);
|
||||
packet(0x01a2,35);
|
||||
packet(0x01a3,5);
|
||||
@ -342,7 +329,6 @@
|
||||
packet(0x01fb,56);
|
||||
packet(0x01fc,-1);
|
||||
parseable_packet( HEADER_CZ_REQ_ITEMREPAIR1, sizeof( struct PACKET_CZ_REQ_ITEMREPAIR1 ), clif_parse_RepairItem, 0 );
|
||||
packet(0x01fe,5);
|
||||
packet(0x01ff,10);
|
||||
packet(0x0200,26);
|
||||
packet(0x0201,-1);
|
||||
@ -1005,7 +991,6 @@
|
||||
packet( HEADER_ZC_ITEM_PICKUP_PARTY, sizeof( struct PACKET_ZC_ITEM_PICKUP_PARTY ) );
|
||||
packet(0x02b9,191);
|
||||
parseable_packet(0x02ba,11,clif_parse_Hotkey,2,4,5,9);
|
||||
packet(0x02bb,8);
|
||||
packet(0x02bc,6);
|
||||
packet(0x02bf,10);
|
||||
packet(0x02c0,2);
|
||||
@ -2028,7 +2013,6 @@
|
||||
packet(0x09DB,-1); // ZC_NOTIFY_MOVEENTRY10
|
||||
packet(0x09DC,-1); // ZC_NOTIFY_NEWENTRY10
|
||||
packet(0x09DD,-1); // ZC_NOTIFY_STANDENTRY10
|
||||
packet(0x09DF,7); // ZC_ACK_WHISPER02
|
||||
#endif
|
||||
|
||||
// 2014-02-05bRagexeRE
|
||||
@ -2044,14 +2028,12 @@
|
||||
|
||||
// 2014-10-16Ragexe
|
||||
#if PACKETVER >= 20141016
|
||||
packet(0x09DF,7);
|
||||
// New packet
|
||||
packet(0x0A00,269); // ZC_SHORTCUT_KEY_LIST_V3
|
||||
parseable_packet(0x0A01,3,clif_parse_HotkeyRowShift,2); // CZ_SHORTCUTKEYBAR_ROTATE
|
||||
packet(0x0A02,4); // ZC_DRESSROOM_OPEN
|
||||
packet(0x0A0E,14); // ZC_BATTLEFIELD_NOTIFY_HP2
|
||||
packet(0x09F7,75); // ZC_PROPERTY_HOMUN_2
|
||||
packet(0x09E5,18); // ZC_DELETEITEM_FROM_MCSTORE2
|
||||
packet(0x09E6,22); // ZC_UPDATE_ITEM_FROM_BUYING_STORE2
|
||||
// Roulette System [Yommy]
|
||||
parseable_packet(0x0A19,2,clif_parse_roulette_open,0); // CZ_REQ_OPEN_ROULETTE
|
||||
@ -2071,8 +2053,6 @@
|
||||
packet(0x006d,149);
|
||||
packet(0x08e3,149);
|
||||
// New Packet
|
||||
packet(0x0A27,8);
|
||||
packet(0x0A28,3); // ZC_ACK_OPENSTORE2
|
||||
packet(0x09FD,-1); // ZC_NOTIFY_MOVEENTRY11
|
||||
packet(0x09FE,-1); // ZC_NOTIFY_NEWENTRY11
|
||||
packet(0x09FF,-1); // ZC_NOTIFY_STANDENTRY11
|
||||
|
@ -320,7 +320,7 @@ int intif_wis_message(map_session_data *sd, char *nick, char *mes, size_t mes_le
|
||||
|
||||
if (other_mapserver_count < 1)
|
||||
{ //Character not found.
|
||||
clif_wis_end(sd->fd, 1);
|
||||
clif_wis_end( *sd, ACKWHISPER_TARGET_OFFLINE );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1323,13 +1323,17 @@ int intif_parse_WisMessage(int fd)
|
||||
*/
|
||||
int intif_parse_WisEnd(int fd)
|
||||
{
|
||||
map_session_data* sd;
|
||||
|
||||
if (battle_config.etc_log)
|
||||
ShowInfo("intif_parse_wisend: player: %s, flag: %d\n", RFIFOP(fd,2), RFIFOB(fd,26)); // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target
|
||||
sd = (map_session_data *)map_nick2sd(RFIFOCP(fd,2),false);
|
||||
if (sd != nullptr)
|
||||
clif_wis_end(sd->fd, RFIFOB(fd,26));
|
||||
|
||||
map_session_data* sd = map_nick2sd( RFIFOCP( fd, 2 ), false );
|
||||
|
||||
if (sd != nullptr) {
|
||||
uint8 result = RFIFOB( fd, 26 );
|
||||
|
||||
if ( result >= ACKWHISPER_SUCCESS && result <= ACKWHISPER_ALL_IGNORED )
|
||||
clif_wis_end( *sd, static_cast<e_ack_whisper>(result) );
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -3518,7 +3522,7 @@ static bool intif_parse_StorageReceived(int fd)
|
||||
clif_cartlist(sd);
|
||||
// Only open the vending UI, if it has not been opened already
|
||||
if (sd->state.pending_vending_ui) {
|
||||
clif_openvendingreq(sd, sd->vend_skill_lv + 2);
|
||||
clif_openvendingreq( *sd, sd->vend_skill_lv + 2 );
|
||||
sd->state.pending_vending_ui = false;
|
||||
}
|
||||
}
|
||||
|
@ -929,6 +929,131 @@ struct PACKET_ZC_NOTIFY_EFFECT {
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_NOTIFY_EFFECT, 0x19b);
|
||||
|
||||
struct PACKET_ZC_ACK_ITEMCOMPOSITION {
|
||||
int16 packetType;
|
||||
uint16 equipIndex;
|
||||
uint16 cardIndex;
|
||||
uint8 result;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_ACK_ITEMCOMPOSITION, 0x17d);
|
||||
|
||||
struct PACKET_ZC_ACK_ITEMIDENTIFY {
|
||||
int16 packetType;
|
||||
uint16 index;
|
||||
uint8 result;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_ACK_ITEMIDENTIFY, 0x179);
|
||||
|
||||
struct PACKET_ZC_ACK_ITEMREPAIR {
|
||||
int16 packetType;
|
||||
uint16 index;
|
||||
uint8 result;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_ACK_ITEMREPAIR, 0x1fe);
|
||||
|
||||
struct PACKET_ZC_EQUIPITEM_DAMAGED {
|
||||
int16 packetType;
|
||||
uint16 equipLocation;
|
||||
uint32 GID;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_EQUIPITEM_DAMAGED, 0x2bb);
|
||||
|
||||
struct PACKET_ZC_DELETE_ITEM_FROM_CART {
|
||||
int16 packetType;
|
||||
uint16 index;
|
||||
int32 amount;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_DELETE_ITEM_FROM_CART, 0x125);
|
||||
|
||||
struct PACKET_ZC_OPENSTORE {
|
||||
int16 packetType;
|
||||
uint16 num;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_OPENSTORE, 0x12d);
|
||||
|
||||
struct PACKET_ZC_PC_PURCHASE_RESULT_FROMMC {
|
||||
int16 packetType;
|
||||
uint16 index;
|
||||
uint16 amount;
|
||||
uint8 result;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_PC_PURCHASE_RESULT_FROMMC, 0x135);
|
||||
|
||||
struct PACKET_ZC_ACK_OPENSTORE2 {
|
||||
int16 packetType;
|
||||
uint8 result;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_ACK_OPENSTORE2, 0xa28 );
|
||||
|
||||
struct PACKET_ZC_SKILL_DISAPPEAR {
|
||||
int16 packetType;
|
||||
uint32 GID;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_SKILL_DISAPPEAR, 0x120);
|
||||
|
||||
struct PACKET_ZC_SKILL_UPDATE {
|
||||
int16 packetType;
|
||||
uint32 GID;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_SKILL_UPDATE, 0x1ac);
|
||||
|
||||
#if PACKETVER >= 20141022
|
||||
struct PACKET_ZC_RECOVERY {
|
||||
int16 packetType;
|
||||
uint16 type;
|
||||
int32 amount;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_RECOVERY, 0xa27);
|
||||
#else
|
||||
struct PACKET_ZC_RECOVERY {
|
||||
int16 packetType;
|
||||
uint16 type;
|
||||
int16 amount;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_RECOVERY, 0x13d);
|
||||
#endif
|
||||
|
||||
#if PACKETVER >= 20131223
|
||||
struct PACKET_ZC_ACK_WHISPER {
|
||||
int16 packetType;
|
||||
uint8 result;
|
||||
uint32 CID;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_ACK_WHISPER, 0x9df);
|
||||
#else
|
||||
struct PACKET_ZC_ACK_WHISPER {
|
||||
int16 packetType;
|
||||
uint8 result;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_ACK_WHISPER, 0x98);
|
||||
#endif
|
||||
|
||||
struct PACKET_ZC_ACK_ADDITEM_TO_CART {
|
||||
int16 packetType;
|
||||
uint8 result;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_ACK_ADDITEM_TO_CART, 0x12c);
|
||||
|
||||
// TODO : not sure for client date [Napster]
|
||||
#if PACKETVER >= 20141016
|
||||
struct PACKET_ZC_DELETEITEM_FROM_MCSTORE {
|
||||
int16 packetType;
|
||||
uint16 index;
|
||||
uint16 amount;
|
||||
uint32 buyerCID;
|
||||
uint32 date;
|
||||
int32 zeny;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_DELETEITEM_FROM_MCSTORE, 0x9e5);
|
||||
#else
|
||||
struct PACKET_ZC_DELETEITEM_FROM_MCSTORE {
|
||||
int16 packetType;
|
||||
uint16 index;
|
||||
uint16 amount;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_DELETEITEM_FROM_MCSTORE, 0x137);
|
||||
#endif
|
||||
|
||||
// NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute
|
||||
#if !defined( sun ) && ( !defined( __NETBSD__ ) || __NetBSD_Version__ >= 600000000 )
|
||||
#pragma pack( pop )
|
||||
|
@ -5527,14 +5527,14 @@ int pc_insert_card(map_session_data* sd, int idx_card, int idx_equip)
|
||||
|
||||
if( pc_delitem(sd,idx_card,1,1,0,LOG_TYPE_OTHER) == 1 )
|
||||
{// failed
|
||||
clif_insert_card(sd,idx_equip,idx_card,1);
|
||||
clif_insert_card( *sd, idx_equip, idx_card, true );
|
||||
}
|
||||
else
|
||||
{// success
|
||||
log_pick_pc(sd, LOG_TYPE_OTHER, -1, &sd->inventory.u.items_inventory[idx_equip]);
|
||||
sd->inventory.u.items_inventory[idx_equip].card[i] = nameid;
|
||||
log_pick_pc(sd, LOG_TYPE_OTHER, 1, &sd->inventory.u.items_inventory[idx_equip]);
|
||||
clif_insert_card(sd,idx_equip,idx_card,0);
|
||||
clif_insert_card( *sd, idx_equip, idx_card, false );
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -5554,7 +5554,7 @@ int pc_identifyall(map_session_data *sd, bool identify_item)
|
||||
if (sd->inventory.u.items_inventory[i].nameid > 0 && sd->inventory.u.items_inventory[i].identify != 1) {
|
||||
if (identify_item == true) {
|
||||
sd->inventory.u.items_inventory[i].identify = 1;
|
||||
clif_item_identified(sd,i,0);
|
||||
clif_item_identified( *sd, i, false );
|
||||
}
|
||||
unidentified_count++;
|
||||
}
|
||||
@ -6510,7 +6510,7 @@ void pc_cart_delitem(map_session_data *sd,int n,int amount,int type,e_log_pick_t
|
||||
sd->cart_num--;
|
||||
}
|
||||
if(!type) {
|
||||
clif_cart_delitem(sd,n,amount);
|
||||
clif_cart_delitem( *sd, n, amount );
|
||||
clif_updatestatus(*sd,SP_CARTINFO);
|
||||
}
|
||||
}
|
||||
@ -6540,7 +6540,10 @@ void pc_putitemtocart(map_session_data *sd,int idx,int amount)
|
||||
if (flag == ADDITEM_SUCCESS)
|
||||
pc_delitem(sd,idx,amount,0,5,LOG_TYPE_NONE);
|
||||
else {
|
||||
clif_cart_additem_ack(sd, (flag == ADDITEM_OVERAMOUNT) ? ADDITEM_TO_CART_FAIL_COUNT : ADDITEM_TO_CART_FAIL_WEIGHT);
|
||||
if (flag == ADDITEM_OVERAMOUNT)
|
||||
clif_cart_additem_ack( *sd, ADDITEM_TO_CART_FAIL_COUNT );
|
||||
else
|
||||
clif_cart_additem_ack( *sd, ADDITEM_TO_CART_FAIL_WEIGHT );
|
||||
clif_additem(sd, idx, amount, 0);
|
||||
clif_delitem( *sd, idx, amount, 0 );
|
||||
}
|
||||
@ -6585,7 +6588,7 @@ bool pc_getitemfromcart(map_session_data *sd,int idx,int amount)
|
||||
if (flag == ADDITEM_SUCCESS)
|
||||
pc_cart_delitem(sd, idx, amount, 0, LOG_TYPE_NONE);
|
||||
else {
|
||||
clif_cart_delitem(sd, idx, amount);
|
||||
clif_cart_delitem( *sd, idx, amount );
|
||||
clif_additem(sd, idx, amount, flag);
|
||||
clif_cart_additem(sd, idx, amount);
|
||||
}
|
||||
@ -10472,13 +10475,13 @@ void pc_heal(map_session_data *sd,unsigned int hp,unsigned int sp, unsigned int
|
||||
|
||||
if (type&2) {
|
||||
if (hp || type&4) {
|
||||
clif_heal(sd->fd,SP_HP,hp);
|
||||
clif_heal( *sd, SP_HP, hp );
|
||||
clif_update_hp(*sd);
|
||||
}
|
||||
if (sp)
|
||||
clif_heal(sd->fd,SP_SP,sp);
|
||||
clif_heal( *sd, SP_SP, sp );
|
||||
if (ap)
|
||||
clif_heal(sd->fd,SP_AP,ap);
|
||||
clif_heal( *sd, SP_AP, ap );
|
||||
} else {
|
||||
if(hp)
|
||||
clif_updatestatus(*sd,SP_HP);
|
||||
|
@ -1226,7 +1226,7 @@ int pet_catch_process1(map_session_data *sd,int target_class)
|
||||
}
|
||||
|
||||
sd->catch_target_class = target_class;
|
||||
clif_catch_process(sd);
|
||||
clif_catch_process( *sd );
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1247,7 +1247,7 @@ int pet_catch_process2(map_session_data* sd, int target_id)
|
||||
md = (struct mob_data*)map_id2bl(target_id);
|
||||
|
||||
if(!md || md->bl.type != BL_MOB || md->bl.prev == nullptr) { // Invalid inputs/state, abort capture.
|
||||
clif_pet_roulette(sd,0);
|
||||
clif_pet_roulette( *sd, false );
|
||||
sd->catch_target_class = PET_CATCH_FAIL;
|
||||
sd->itemid = 0;
|
||||
sd->itemindex = -1;
|
||||
@ -1255,7 +1255,7 @@ int pet_catch_process2(map_session_data* sd, int target_id)
|
||||
}
|
||||
|
||||
if (map_getmapflag(sd->bl.m, MF_NOPETCAPTURE)) {
|
||||
clif_pet_roulette(sd, 0);
|
||||
clif_pet_roulette( *sd, false );
|
||||
sd->catch_target_class = PET_CATCH_FAIL;
|
||||
sd->itemid = 0;
|
||||
sd->itemindex = -1;
|
||||
@ -1280,14 +1280,14 @@ int pet_catch_process2(map_session_data* sd, int target_id)
|
||||
|
||||
if(sd->catch_target_class != md->mob_id || !pet) {
|
||||
clif_emotion(&md->bl, ET_ANGER); //mob will do /ag if wrong lure is used on them.
|
||||
clif_pet_roulette(sd,0);
|
||||
clif_pet_roulette( *sd, false );
|
||||
sd->catch_target_class = PET_CATCH_FAIL;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
if( battle_config.pet_distance_check && distance_bl( &sd->bl, &md->bl ) > battle_config.pet_distance_check ){
|
||||
clif_pet_roulette( sd, 0 );
|
||||
clif_pet_roulette( *sd, false );
|
||||
sd->catch_target_class = PET_CATCH_FAIL;
|
||||
|
||||
return 1;
|
||||
@ -1296,7 +1296,7 @@ int pet_catch_process2(map_session_data* sd, int target_id)
|
||||
status_change* tsc = status_get_sc( &md->bl );
|
||||
|
||||
if( battle_config.pet_hide_check && tsc && ( tsc->getSCE(SC_HIDING) || tsc->getSCE(SC_CLOAKING) || tsc->getSCE(SC_CAMOUFLAGE) || tsc->getSCE(SC_NEWMOON) || tsc->getSCE(SC_CLOAKINGEXCEED) ) ){
|
||||
clif_pet_roulette( sd, 0 );
|
||||
clif_pet_roulette( *sd, false );
|
||||
sd->catch_target_class = PET_CATCH_FAIL;
|
||||
|
||||
return 1;
|
||||
@ -1318,13 +1318,13 @@ int pet_catch_process2(map_session_data* sd, int target_id)
|
||||
achievement_update_objective(sd, AG_TAMING, 1, md->mob_id);
|
||||
unit_remove_map(&md->bl,CLR_OUTSIGHT);
|
||||
status_kill(&md->bl);
|
||||
clif_pet_roulette(sd,1);
|
||||
clif_pet_roulette( *sd, true );
|
||||
|
||||
std::shared_ptr<s_mob_db> mdb = mob_db.find(pet->class_);
|
||||
|
||||
intif_create_pet(sd->status.account_id, sd->status.char_id, pet->class_, mdb->lv, pet->EggID, 0, pet->intimate, 100, 0, 1, mdb->jname.c_str());
|
||||
} else {
|
||||
clif_pet_roulette(sd,0);
|
||||
clif_pet_roulette( *sd, false );
|
||||
sd->catch_target_class = PET_CATCH_FAIL;
|
||||
}
|
||||
|
||||
|
@ -9305,7 +9305,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|
||||
else{
|
||||
// Instantly open the vending UI
|
||||
sd->state.pending_vending_ui = false;
|
||||
clif_openvendingreq(sd,2+skill_lv);
|
||||
clif_openvendingreq( *sd, 2+skill_lv );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -16228,7 +16228,7 @@ int skill_unit_onplace_timer(struct skill_unit *unit, struct block_list *bl, t_t
|
||||
} else
|
||||
sec = 3000; //Couldn't trap it?
|
||||
if (sg->unit_id == UNT_ANKLESNARE) {
|
||||
clif_skillunit_update(&unit->bl);
|
||||
clif_skillunit_update( unit->bl );
|
||||
/**
|
||||
* If you're snared from a trap that was invisible this makes the trap be
|
||||
* visible again -- being you stepped on it (w/o this the trap remains invisible and you go "WTF WHY I CANT MOVE")
|
||||
@ -19593,7 +19593,7 @@ void skill_repairweapon( map_session_data& sd, int idx ){
|
||||
return;
|
||||
|
||||
if (sd.status.char_id != target_sd->status.char_id && !battle_check_range(&sd.bl, &target_sd->bl, skill_get_range2(&sd.bl, sd.menuskill_id, sd.menuskill_val2, true))) {
|
||||
clif_item_repaireffect(&sd, idx, 1);
|
||||
clif_item_repaireffect( sd, idx, true );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -19616,10 +19616,10 @@ void skill_repairweapon( map_session_data& sd, int idx ){
|
||||
|
||||
pc_delitem(&sd,pc_search_inventory(&sd,material),1,0,0,LOG_TYPE_CONSUME);
|
||||
|
||||
clif_item_repaireffect(&sd,idx,0);
|
||||
clif_item_repaireffect( sd, idx, false );
|
||||
|
||||
if( sd.status.char_id != target_sd->status.char_id )
|
||||
clif_item_repaireffect(target_sd,idx,0);
|
||||
clif_item_repaireffect( *target_sd, idx, false );
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
@ -19627,7 +19627,7 @@ void skill_repairweapon( map_session_data& sd, int idx ){
|
||||
*------------------------------------------*/
|
||||
void skill_identify(map_session_data *sd, int idx)
|
||||
{
|
||||
int flag=1;
|
||||
bool failure = true;
|
||||
|
||||
nullpo_retv(sd);
|
||||
|
||||
@ -19635,11 +19635,11 @@ void skill_identify(map_session_data *sd, int idx)
|
||||
|
||||
if(idx >= 0 && idx < MAX_INVENTORY) {
|
||||
if(sd->inventory.u.items_inventory[idx].nameid > 0 && sd->inventory.u.items_inventory[idx].identify == 0 ){
|
||||
flag=0;
|
||||
failure = false;
|
||||
sd->inventory.u.items_inventory[idx].identify = 1;
|
||||
}
|
||||
}
|
||||
clif_item_identified(sd,idx,flag);
|
||||
clif_item_identified( *sd, idx, failure );
|
||||
}
|
||||
|
||||
/*==========================================
|
||||
@ -20873,7 +20873,7 @@ int skill_delunit(struct skill_unit* unit)
|
||||
break;
|
||||
}
|
||||
|
||||
clif_skill_delunit(unit);
|
||||
clif_skill_delunit( *unit );
|
||||
|
||||
unit->group=nullptr;
|
||||
map_delblock(&unit->bl); // don't free yet
|
||||
|
@ -447,7 +447,10 @@ void storage_storagegettocart(map_session_data* sd, struct s_storage *stor, int
|
||||
storage_delitem(sd,stor,index,amount);
|
||||
else {
|
||||
clif_storageitemremoved( *sd, index, 0 );
|
||||
clif_cart_additem_ack(sd,(flag==1)?ADDITEM_TO_CART_FAIL_WEIGHT:ADDITEM_TO_CART_FAIL_COUNT);
|
||||
if (flag == ADDITEM_INVALID)
|
||||
clif_cart_additem_ack( *sd, ADDITEM_TO_CART_FAIL_WEIGHT );
|
||||
else
|
||||
clif_cart_additem_ack( *sd, ADDITEM_TO_CART_FAIL_COUNT );
|
||||
}
|
||||
}
|
||||
|
||||
@ -1008,7 +1011,10 @@ void storage_guild_storagegettocart(map_session_data* sd, int index, int amount)
|
||||
storage_guild_delitem(sd,stor,index,amount);
|
||||
else {
|
||||
clif_storageitemremoved( *sd, index, 0 );
|
||||
clif_cart_additem_ack(sd,(flag == 1) ? ADDITEM_TO_CART_FAIL_WEIGHT:ADDITEM_TO_CART_FAIL_COUNT);
|
||||
if (flag == ADDITEM_INVALID)
|
||||
clif_cart_additem_ack( *sd, ADDITEM_TO_CART_FAIL_WEIGHT );
|
||||
else
|
||||
clif_cart_additem_ack( *sd, ADDITEM_TO_CART_FAIL_COUNT );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2784,7 +2784,7 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, t_tick tick)
|
||||
|
||||
if(sd && !check_distance_client_bl(src,target,range)) {
|
||||
// Player tries to attack but target is too far, notify client
|
||||
clif_movetoattack(sd,target);
|
||||
clif_movetoattack( *sd, *target );
|
||||
return 1;
|
||||
} else if(md && !check_distance_bl(src,target,range)) {
|
||||
// Monster: Chase if required
|
||||
|
@ -132,7 +132,7 @@ void vending_purchasereq(map_session_data* sd, int aid, int uid, const uint8* da
|
||||
return; // invalid shop
|
||||
|
||||
if( vsd->vender_id != uid ) { // shop has changed
|
||||
clif_buyvending(sd, 0, 0, 6); // store information was incorrect
|
||||
clif_buyvending( *sd, 0, 0, PURCHASEMC_STORE_INCORRECT ); // store information was incorrect
|
||||
return;
|
||||
}
|
||||
|
||||
@ -172,17 +172,17 @@ void vending_purchasereq(map_session_data* sd, int aid, int uid, const uint8* da
|
||||
|
||||
z += ((double)vsd->vending[j].value * (double)amount);
|
||||
if( z > (double)sd->status.zeny || z < 0. || z > (double)MAX_ZENY ) {
|
||||
clif_buyvending(sd, idx, amount, 1); // you don't have enough zeny
|
||||
clif_buyvending( *sd, idx, amount, PURCHASEMC_NO_ZENY ); // you don't have enough zeny
|
||||
return;
|
||||
}
|
||||
if( z + (double)vsd->status.zeny > (double)MAX_ZENY && !battle_config.vending_over_max ) {
|
||||
clif_buyvending(sd, idx, vsd->vending[j].amount, 4); // too much zeny = overflow
|
||||
clif_buyvending( *sd, idx, vsd->vending[j].amount, PURCHASEMC_OUT_OF_STOCK ); // too much zeny = overflow
|
||||
return;
|
||||
|
||||
}
|
||||
w += itemdb_weight(vsd->cart.u.items_cart[idx].nameid) * amount;
|
||||
if( w + sd->weight > sd->max_weight ) {
|
||||
clif_buyvending(sd, idx, amount, 2); // you can not buy, because overweight
|
||||
clif_buyvending( *sd, idx, amount, PURCHASEMC_OVERWEIGHT );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ void vending_purchasereq(map_session_data* sd, int aid, int uid, const uint8* da
|
||||
// here, we check cumulative amounts
|
||||
if( vending[j].amount < amount ) {
|
||||
// send more quantity is not a hack (an other player can have buy items just before)
|
||||
clif_buyvending(sd, idx, vsd->vending[j].amount, 4); // not enough quantity
|
||||
clif_buyvending( *sd, idx, vsd->vending[j].amount, PURCHASEMC_OUT_OF_STOCK );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -241,7 +241,7 @@ void vending_purchasereq(map_session_data* sd, int aid, int uid, const uint8* da
|
||||
|
||||
pc_cart_delitem(vsd, idx, amount, 0, LOG_TYPE_VENDING);
|
||||
z = vending_calc_tax(sd, z);
|
||||
clif_vendingreport(vsd, idx, amount, sd->status.char_id, (int)z);
|
||||
clif_vendingreport( *vsd, idx, amount, sd->status.char_id, (int)z );
|
||||
|
||||
//print buyer's name
|
||||
if( battle_config.buyer_name ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user