Converted ZC_REQ_TAKEOFF_EQUIP_ACK to struct (#8580)
--------- Co-authored-by: Lemongrass3110 <lemongrass@kstp.at> Co-authored-by: Atemo <Atemo@users.noreply.github.com>
This commit is contained in:
parent
1f25ebc90a
commit
00c88167ce
@ -4247,35 +4247,22 @@ void clif_equipitemack( map_session_data& sd, uint8 flag, int index, int pos ){
|
||||
/// 00ac <index>.W <equip location>.W <result>.B (ZC_REQ_TAKEOFF_EQUIP_ACK)
|
||||
/// 08d1 <index>.W <equip location>.W <result>.B (ZC_REQ_TAKEOFF_EQUIP_ACK2)
|
||||
/// 099a <index>.W <equip location>.L <result>.B (ZC_ACK_TAKEOFF_EQUIP_V5)
|
||||
/// @ok : //inversed for v2 v5
|
||||
/// @success : //inversed for v2 v5
|
||||
/// 0 = failure
|
||||
/// 1 = success
|
||||
void clif_unequipitemack(map_session_data *sd,int n,int pos,int ok)
|
||||
{
|
||||
int fd, header, offs = 0;
|
||||
#if PACKETVER >= 20130000
|
||||
header = 0x99a;
|
||||
ok = ok ? 0 : 1;
|
||||
#elif PACKETVER >= 20110824
|
||||
header = 0x8d1;
|
||||
ok = ok ? 0 : 1;
|
||||
#else
|
||||
header = 0xac;
|
||||
void clif_unequipitemack( map_session_data& sd, uint16 server_index, int32 pos, bool success ){
|
||||
#if PACKETVER >= 20110824
|
||||
success = !success;
|
||||
#endif
|
||||
nullpo_retv(sd);
|
||||
|
||||
fd=sd->fd;
|
||||
WFIFOHEAD(fd, packet_len(header));
|
||||
WFIFOW(fd,offs+0) = header;
|
||||
WFIFOW(fd,offs+2) = n+2;
|
||||
#if PACKETVER >= 20130000
|
||||
WFIFOL(fd,offs+4) = pos;
|
||||
offs += 2;
|
||||
#else
|
||||
WFIFOW(fd,offs+4) = pos;
|
||||
#endif
|
||||
WFIFOB(fd,offs+6) = ok;
|
||||
WFIFOSET(fd, packet_len(header));
|
||||
PACKET_ZC_REQ_TAKEOFF_EQUIP_ACK p{};
|
||||
|
||||
p.packetType = HEADER_ZC_REQ_TAKEOFF_EQUIP_ACK;
|
||||
p.index = client_index(server_index);
|
||||
p.wearLocation = static_cast<decltype(p.wearLocation)>(pos);
|
||||
p.flag = success;
|
||||
|
||||
clif_send(&p,sizeof(p),&sd.bl,SELF);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -874,7 +874,7 @@ void clif_arrow_fail( map_session_data& sd, e_action_failure type );
|
||||
void clif_arrow_create_list( map_session_data& sd );
|
||||
void clif_statusupack( map_session_data& sd, int32 type, bool success, int32 val = 0 );
|
||||
void clif_equipitemack( map_session_data& sd, uint8 flag, int index, int pos = 0 ); // self
|
||||
void clif_unequipitemack(map_session_data *sd,int n,int pos,int ok); // self
|
||||
void clif_unequipitemack( map_session_data& sd, uint16 server_index, int32 pos, bool success );
|
||||
void clif_misceffect( block_list& bl, e_notify_effect type );
|
||||
void clif_changeoption_target(struct block_list* bl, struct block_list* target);
|
||||
#define clif_changeoption(bl) clif_changeoption_target(bl, nullptr) // area
|
||||
|
||||
@ -60,7 +60,6 @@
|
||||
packet( useItemAckType, sizeof( struct PACKET_ZC_USE_ITEM_ACK ) );
|
||||
parseable_packet(0x00a9,6,clif_parse_EquipItem,2,4);
|
||||
parseable_packet(0x00ab,4,clif_parse_UnequipItem,2);
|
||||
packet(0x00ac,7);
|
||||
packet(0x00ae,-1);
|
||||
parseable_packet(0x00b2,3,clif_parse_Restart,2);
|
||||
parseable_packet(0x00b8,7,clif_parse_NpcSelectMenu,2,6);
|
||||
@ -1501,7 +1500,6 @@
|
||||
parseable_packet(0x0838,6,clif_parse_SolveCharName,2);
|
||||
parseable_packet(0x0439,8,clif_parse_UseItem,2,4);
|
||||
packet(0x08d2,10);
|
||||
packet(0x08d1,7);
|
||||
#endif
|
||||
|
||||
// 2011-11-02aRagexe
|
||||
@ -1734,7 +1732,6 @@
|
||||
parseable_packet(0x0978,6,clif_parse_reqworldinfo,2);
|
||||
packet(0x0979,50); //ackworldinfo
|
||||
parseable_packet(0x0998,8,clif_parse_EquipItem,2,4); // CZ_REQ_WEAR_EQUIP_V5
|
||||
packet(0x099a,9); // take_off_equipv5
|
||||
packet(0x099b,8); //maptypeproperty2
|
||||
// New Packets
|
||||
packet(0x08ff,24); // ZC_EFST_SET_ENTER
|
||||
|
||||
@ -852,6 +852,32 @@ struct PACKET_ZC_EQUIP_ARROW {
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_EQUIP_ARROW, 0x13c)
|
||||
|
||||
#if PACKETVER >= 20130000
|
||||
struct PACKET_ZC_REQ_TAKEOFF_EQUIP_ACK{
|
||||
uint16 packetType;
|
||||
uint16 index;
|
||||
uint32 wearLocation;
|
||||
uint8 flag;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_REQ_TAKEOFF_EQUIP_ACK, 0x99a)
|
||||
#elif PACKETVER >= 20110824
|
||||
struct PACKET_ZC_REQ_TAKEOFF_EQUIP_ACK{
|
||||
uint16 packetType;
|
||||
uint16 index;
|
||||
uint16 wearLocation;
|
||||
uint8 flag;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_REQ_TAKEOFF_EQUIP_ACK, 0x8d1)
|
||||
#else
|
||||
struct PACKET_ZC_REQ_TAKEOFF_EQUIP_ACK{
|
||||
uint16 packetType;
|
||||
uint16 index;
|
||||
uint16 wearLocation;
|
||||
bool flag;
|
||||
} __attribute__((packed));
|
||||
DEFINE_PACKET_HEADER(ZC_REQ_TAKEOFF_EQUIP_ACK, 0xac)
|
||||
#endif
|
||||
|
||||
struct PACKET_ZC_CLOSE_STORE {
|
||||
int16 packetType;
|
||||
} __attribute__((packed));
|
||||
|
||||
@ -12262,18 +12262,18 @@ bool pc_unequipitem(map_session_data *sd, int n, int flag) {
|
||||
nullpo_retr(false,sd);
|
||||
|
||||
if (n < 0 || n >= MAX_INVENTORY) {
|
||||
clif_unequipitemack(sd,0,0,0);
|
||||
clif_unequipitemack(*sd,0,0,false);
|
||||
return false;
|
||||
}
|
||||
if (!(pos = sd->inventory.u.items_inventory[n].equip)) {
|
||||
clif_unequipitemack(sd,n,0,0);
|
||||
clif_unequipitemack(*sd,n,0,false);
|
||||
return false; //Nothing to unequip
|
||||
}
|
||||
// status change that makes player cannot unequip equipment
|
||||
if (!(flag&2) && sd->sc.count &&( sd->sc.cant.unequip ||
|
||||
(sd->sc.getSCE(SC_PYROCLASTIC) && sd->inventory_data[n]->type == IT_WEAPON))) // can't switch weapon
|
||||
{
|
||||
clif_unequipitemack(sd,n,0,0);
|
||||
clif_unequipitemack(*sd,n,0,false);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -12312,7 +12312,7 @@ bool pc_unequipitem(map_session_data *sd, int n, int flag) {
|
||||
if(pos & EQP_SHOES)
|
||||
clif_changelook(&sd->bl,LOOK_SHOES,0);
|
||||
|
||||
clif_unequipitemack(sd,n,pos,1);
|
||||
clif_unequipitemack(*sd,n,pos,true);
|
||||
pc_set_costume_view(sd);
|
||||
|
||||
status_db.removeByStatusFlag(&sd->bl, { SCF_REMOVEONUNEQUIP });
|
||||
@ -12333,7 +12333,7 @@ bool pc_unequipitem(map_session_data *sd, int n, int flag) {
|
||||
|
||||
if (idx >= 0) {
|
||||
sd->equip_index[EQI_AMMO] = -1;
|
||||
clif_unequipitemack(sd, idx, sd->inventory.u.items_inventory[idx].equip, 1);
|
||||
clif_unequipitemack(*sd, idx, sd->inventory.u.items_inventory[idx].equip, true);
|
||||
pc_unequipitem_sub(sd, idx, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user