Skip to content

Commit

Permalink
Merge pull request #487 from alisonrag/bugfix/fix-item-and-cart-list-v5
Browse files Browse the repository at this point in the history
fix: update item and cart list v5
  • Loading branch information
MrAntares authored Oct 8, 2024
2 parents f49f3d5 + 3cbbf08 commit 1a6782f
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Engine/MapEngine/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,8 @@ define(function( require )
Network.hookPacket( PACKET.ZC.CART_NORMAL_ITEMLIST4, onCartSetList );
Network.hookPacket( PACKET.ZC.CART_EQUIPMENT_ITEMLIST3, onCartSetList );
Network.hookPacket( PACKET.ZC.CART_EQUIPMENT_ITEMLIST4, onCartSetList );
Network.hookPacket( PACKET.ZC.NOTIFY_CARTITEM_COUNTINFO, onCartSetInfo );
Network.hookPacket( PACKET.ZC.CART_EQUIPMENT_ITEMLIST5, onCartSetList );
Network.hookPacket( PACKET.ZC.NOTIFY_CARTITEM_COUNTINFO, onCartSetInfo );
Network.hookPacket( PACKET.ZC.EQUIPMENT_ITEMLIST, onInventorySetList );
Network.hookPacket( PACKET.ZC.EQUIPMENT_ITEMLIST2, onInventorySetList );
Network.hookPacket( PACKET.ZC.EQUIPMENT_ITEMLIST3, onInventorySetList );
Expand Down
2 changes: 1 addition & 1 deletion src/Network/PacketRegister.js
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ define( ['./PacketStructure' ], function( PACKET )
0xa0a: PACKET.ZC.ADD_ITEM_TO_STORE3, //
0xa0c: PACKET.ZC.ITEM_PICKUP_ACK6, // ok (Thapakorn)
0xa0d: PACKET.ZC.EQUIPMENT_ITEMLIST5, // ok (Thapakorn)
// 0xa0f: PACKET.ZC.CART_EQUIPMENT_ITEMLIST5, // !!!!!!!!!!!!! not work
0xa0f: PACKET.ZC.CART_EQUIPMENT_ITEMLIST5, // ok
0xa10: PACKET.ZC.STORE_EQUIPMENT_ITEMLIST5, //
0xa12: PACKET.ZC.ACK_OPEN_WRITE_RODEX, // ok
0xa13: PACKET.CZ.CHECK_RECEIVE_CHARACTER_NAME, // ok
Expand Down
47 changes: 46 additions & 1 deletion src/Network/PacketStructure.js
Original file line number Diff line number Diff line change
Expand Up @@ -12905,6 +12905,51 @@ define(['Utils/BinaryWriter', './PacketVerManager', 'Utils/Struct', 'Core/Config
})();
};
PACKET.ZC.EQUIPMENT_ITEMLIST5.size = -1;

//0xa0f
PACKET.ZC.CART_EQUIPMENT_ITEMLIST5 = function PACKET_ZC_CART_EQUIPMENT_ITEMLIST5(fp, end) {
let option = new Struct(
"short index",
"short value",
"char param"
);
this.ItemInfo = (function() {
var i, count = (end - fp.tell()) / 57 | 0,
out = new Array(count);
var flag;
for (i = 0; i < count; ++i) {
out[i] = {};
out[i].index = fp.readShort();
out[i].ITID = fp.readUShort();
out[i].type = fp.readUChar();

out[i].location = fp.readULong();
out[i].WearState = fp.readULong();
out[i].RefiningLevel = fp.readUChar();
out[i].slot = {};
out[i].slot.card1 = fp.readUShort();
out[i].slot.card2 = fp.readUShort();
out[i].slot.card3 = fp.readUShort();
out[i].slot.card4 = fp.readUShort();
out[i].HireExpireDate = fp.readLong();
out[i].bindOnEquipType = fp.readUShort();
out[i].wItemSpriteNumber = fp.readUShort();
out[i].nRandomOptionCnt = fp.readChar();
out[i].Options = [];
out[i].Options[1] = fp.readStruct(option);
out[i].Options[2] = fp.readStruct(option);
out[i].Options[3] = fp.readStruct(option);
out[i].Options[4] = fp.readStruct(option);
out[i].Options[5] = fp.readStruct(option);
flag = fp.readUChar();
out[i].IsIdentified = flag & 1;
out[i].IsDamaged = flag & 2;
out[i].PlaceETCTab = flag & 4;
}
return out;
})();
};
PACKET.ZC.CART_EQUIPMENT_ITEMLIST5.size = -1;

// 0xa10
PACKET.ZC.STORE_EQUIPMENT_ITEMLIST5 = function PACKET_ZC_STORE_EQUIPMENT_ITEMLIST5(fp, end) {
Expand Down Expand Up @@ -12936,7 +12981,7 @@ define(['Utils/BinaryWriter', './PacketVerManager', 'Utils/Struct', 'Core/Config
out[i].bindOnEquipType = fp.readUShort();
out[i].wItemSpriteNumber = fp.readUShort();
out[i].isOption = fp.readChar();
out[i].Options = {};
out[i].Options = [];
out[i].Options[1] = fp.readStruct(option);
out[i].Options[2] = fp.readStruct(option);
out[i].Options[3] = fp.readStruct(option);
Expand Down

0 comments on commit 1a6782f

Please sign in to comment.