...
uint refItemID = BaseData.Data.silkShopList[silkIndex].refItemID;
packet.ReadUInt8Array(5);
byte countItemsBought = packet.ReadUInt8();
for(int i = 0; i < countItemsBought; i++)
{
byte slot = packet.ReadUInt8();
int invIndex = user.Inventory.FindIndex(s => s.slot == slot);
int itemIndex = BaseData.Data.itemList.FindIndex(s => s.itemID == refItemID);
byte typeID = BaseData.Data.itemList[itemIndex].typeid;
user.Inventory[invIndex].refItemID = refItemID;
if (typeID != 1 && typeID != 2 && typeID != 7) //equip, Avatar, Cos scroll etc
user.Inventory[invIndex].optLvl = BaseData.Data.itemList[itemIndex].maxStack;
else
user.Inventory[invIndex].optLvl = 0;
if (debug)
await PacketUtility.SendMessage(user, "Item Mall to Inventory. Bought item: " + user.latestSilkItemPackage);
}
//ushort countExtraBytes = packet.ReadUInt16(); // Same as item count. Not stack. dunnow wat the shit is for since its zeros only.
//for(int i = 0; i < countExtraBytes; i++)
//{
// packet.ReadUInt8Array(4);
//}
[C -> S][7034]
18 -> 24 -> MOVE_TYPE (BYTE)
1B 04 -> 1051 -> UNKNOW(WORD)
02 -> 2 -> UNKNOW (BYTE)
01 -> 1 -> UNKNOW (BYTE)
0A -> 10 -> UNKNOW (BYTE)
2A 00 -> 42 -> ITEM_NAME_LENGTH (WORD)
50 41 43 4B 41 47 45 5F 49 54 45 4D 5F 4D 41 4C 4C 5F 52 45 54 55 52 4E 5F 53 43 52 4F 4C 4C 5F 48 49 47 48 5F 53 50 45 45 44 -> PACKAGE_ITEM_MALL_RETURN_SCROLL_HIGH_SPEED -> ITEM_NAME (STRING)
01 00 -> 1 -> UNKNOW(WORD)
00 00 00 00 00 00 00 00 -> 0 -> UNKNOW(LWORD)
FD 01 00 00 -> 509 -> UNKNOW(DWORD)
[S -> C][B034]
01 -> UNKNOW -> 1 -> BYTE
18 -> TYPE -> 24 -> BYTE
1B 04 -> UNKNOW -> 1051 -> WORD
02 -> UNKNOW -> 2 -> BYTE
01 -> UNKNOW -> 1 -> BYTE
0A -> UNKNOW -> 10 -> BYTE
01 -> UNKNOW -> 1 -> BYTE
20 -> SLOT -> 32 -> BYTE
01 00 -> UNKNOW -> 1 -> WORD
00 00 00 00 -> UNKNOW -> 0 -> DWORD
// my fixed codes
uint refItemID = BaseData.Data.silkShopList[silkIndex].refItemID;
byte r_MoveType = packet.ReadUInt8();
ushort r_Unknow1 = packet.ReadUInt16();
byte[] r_UnknowBytes = packet.ReadUInt8Array(3);
ushort r_ItemNameLength = packet.ReadUInt16();
string r_ItemName = packet.ReadString(r_ItemNameLength);
// slot is not client generating auto
byte slot = GetSlot();
int invIndex = user.Inventory.FindIndex(s => s.slot == slot);
int itemIndex = BaseData.Data.itemList.FindIndex(s => s.itemID == refItemID);
byte typeID = BaseData.Data.itemList[itemIndex].typeid; // ??? TYPEID1,TYPEID2,TYPEID3,TYPEID4 which? :D
user.Inventory[invIndex].refItemID = refItemID;
if (typeID != 1 && typeID != 2 && typeID != 7) //equip, Avatar, Cos scroll etc
user.Inventory[invIndex].optLvl = BaseData.Data.itemList[itemIndex].maxStack;
else
user.Inventory[invIndex].optLvl = 0;
if (debug)
await PacketUtility.SendMessage(user, "Item Mall to Inventory. Bought item: " + user.latestSilkItemPackage);
public byte GetSlot()
{
// Read 0xB034 packet
/*
packet.ReadUInt8Array(7);
return packet.ReadUInt8();
*/
}