public void BundleSellItens(Session p, PacketRead r) { PacketWrite pw = new PacketWrite(); r.Int(); int m_dwDeleteCount = r.Int(); pw.Int(m_dwDeleteCount); for (int i = 0; i < m_dwDeleteCount; i += 1) { int unk = r.Int(); pw.Int(unk); uint m_dwUID = r.UInt(); pw.UInt(m_dwUID); p.PInfo.m_iGamePoint += SelectPrice(m_dwUID); RemoveItem(p.PInfo.m_strLogin, m_dwUID); } int unk2 = r.Int(); pw.Int(unk2); PacketWrite ks = new PacketWrite(); ks.Int(0);//dwOK ks.Int(p.PInfo.m_iGamePoint); ks.Long(0); ks.ArrayBytes(pw.Get_Packet()); p.SendPacket(ks, 867); }
public void BuyVC(Session p, PacketRead r) { try { r.Jump(13); uint itemid = r.UInt(); r.Jump(8); int quantity = r.Int(); uint itemuid = 0; int valuePrice = SelectPrice(itemid); if (CheckItemExists(itemid, p) && quantity != -1) { sItem currentItem = ItemExists(itemid, p); itemuid = currentItem.ItemUID; quantity += currentItem.Quantity; p.PInventory.UpdateItem(p.PInfo.m_strLogin, itemid, quantity, itemuid); p.PInventory.InventoryList.Remove(currentItem); } else { itemuid = GetUID(); p.PInventory.AddItem(p.PInfo.m_strLogin, itemid, quantity, itemuid); } PacketWrite pw = new PacketWrite(); pw.Int(BuyException(valuePrice, p)); pw.Int(1); pw.UInt(itemid); pw.Int(1); pw.UInt(itemuid); pw.Int(quantity); pw.Int(quantity); pw.Short(0);//Epic pw.HexArray("00 00 00 00 FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00"); pw.Byte(LoadItemType(itemid)); pw.HexArray("00 00 00 00 00 00 00 00 00 00 00 00 00 04 FC F7 70 04 FC FF 78 00 00 0D 00 00 00 00 00 00 00 00 00 FF FF FF 9D"); pw.Int(p.PInfo.m_iVirtualPoint); pw.HexArray("00 00 00 00 00 00 01 5E 1C 00 40 47 00 00 00 00"); p.SendPacket(pw, 396); } catch { PacketWrite pw = new PacketWrite(); pw.Int(1); pw.Int(0); p.SendPacket(pw, 396); } }
public void BuyGP(Session p, PacketRead r) { try { uint itemid = r.UInt(); int quantity = r.Int(); uint itemuid = 0; int valuePrice = SelectPrice(itemid); if (CheckItemExists(itemid, p) && quantity != -1) { sItem currentItem = ItemExists(itemid, p); itemuid = currentItem.ItemUID; quantity += currentItem.Quantity; p.PInventory.UpdateItem(p.PInfo.m_strLogin, itemid, quantity, itemuid); p.PInventory.InventoryList.Remove(currentItem); } else { itemuid = GetUID(); p.PInventory.AddItem(p.PInfo.m_strLogin, itemid, quantity, itemuid); } PacketWrite pw = new PacketWrite(); pw.Int(BuyExceptionGP(valuePrice, p)); pw.Int(p.PInfo.m_iGamePoint); pw.Int(1); pw.UInt(itemid); pw.Int(1); pw.UInt(itemuid); pw.Int(quantity); pw.Int(quantity); pw.Short(0); pw.HexArray("00 00 00 00 FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0C 0C 53 6C A5 B9 73 A2 00 40 37 CC 00 00 0B 00 00 00 00 00 00 00 00 00"); p.SendPacket(pw, 85); } catch (Exception ex) { Log.Write("\n{0}\n{1}\n", ex.Message, ex.StackTrace); PacketWrite pw = new PacketWrite(); pw.Int(1); pw.Int(0); p.SendPacket(pw, 85); } }
public void AddSlotChar(Session p, PacketRead r) { uint _slotid = r.UInt(); AddSlotNewChar(p, _slotid); }
public static void KEquipItemInfo(Session right, PacketRead rs, int m_vecCharInfo) { for (int i = 0; i < m_vecCharInfo; i += 1) { byte m_cCharIndex = rs.Byte(); int m_vecEquipInfo = rs.Int(); int m_dwCharPosition = right.PCharacters.PositionCharacter(m_cCharIndex, right); for (int x = 0; x < m_vecEquipInfo; x += 1) { int m_dwID = rs.Int(); int m_dwUnk = rs.Int(); int m_dwUID = rs.Int(); byte m_cUpgrade = rs.Byte(); byte m_cGrade = rs.Byte(); int m_dwLevel = rs.Int(); byte[] test = rs.Buffer_Array_Bytes(9); int m_dwAtrribs = rs.Int(); for (int x2 = 0; x2 < m_dwAtrribs; x2++) { rs.Jump(7); } right.PCharacters.AddEquipment(m_dwID, m_dwUID, m_dwCharPosition, right); //Log.Write("Character:{0} Equips: {1} Current Item:{2} Atribbs:{3}", m_cCharIndex, m_vecEquipInfo, m_dwID, m_dwAtrribs); } int m_vecDelInfo = rs.Int(); for (int x = 0; x < m_vecDelInfo; x += 1) { int m_dwID = rs.Int(); int m_dwUnk = rs.Int(); int m_dwUID = rs.Int(); byte m_cUpgrade = rs.Byte(); byte m_cGrade = rs.Byte(); int m_dwLevel = rs.Int(); byte[] test = rs.Buffer_Array_Bytes(9); int m_dwAtrribs = rs.Int(); for (int x2 = 0; x2 < m_dwAtrribs; x2++) { rs.Jump(7); } right.PCharacters.RemoveEquipment(m_dwID, m_dwCharPosition, right); } int m_dwPetIsNew = rs.Int(); int m_dwPetUID = rs.Int(); int m_dwPetID = rs.Int(); string m_strPetName = rs.String(); int m_mapInitExp = rs.Int(); for (int x = 0; x < m_mapInitExp; x++) { rs.Byte(); rs.Int(); } uint m_dwExp = rs.UInt(); int m_iLevel = rs.Int(); byte m_cPromotion = rs.Byte(); int m_nHatchingID = rs.Int(); int m_iInitSatiation = rs.Int(); int m_iSatiation = rs.Int(); uint m_vecEquipItem = rs.UInt(); right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].Slot1.Clear(); for (uint x = 0; x < m_vecEquipItem; x++) { uint m_dwPetAtkId = rs.UInt(); rs.Jump(4); uint m_dwPetAtkUID = rs.UInt(); rs.Byte(); right.PCharacters.AddAtkPetSlot1((int)m_dwPetAtkId, m_dwPetAtkUID, m_dwCharPosition, right); } uint m_vecEquipItem2 = rs.UInt(); right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].Slot2.Clear(); for (uint x = 0; x < m_vecEquipItem2; x++) { uint m_dwPetAtkId = rs.UInt(); rs.Jump(4); uint m_dwPetAtkUID = rs.UInt(); rs.Byte(); right.PCharacters.AddAtkPetSlot2((int)m_dwPetAtkId, m_dwPetAtkUID, m_dwCharPosition, right); } byte[] restantPet = rs.Buffer_Array_Bytes(14); right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_dwUID = m_dwPetUID; right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_dwID = m_dwPetID; right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_strName = m_strPetName; right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_cPromotion = m_cPromotion; right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_dwEXP = m_dwExp; right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_iInitSatiation = m_iInitSatiation; right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_iLevel = m_iLevel; right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_iSatiation = m_iSatiation; right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_mapInitExp = m_mapInitExp; right.PCharacters.CharInfo[m_dwCharPosition].Pets[0].m_nHatchingID = m_nHatchingID; //Log.Write("Character:{0} PetID: {1} PetName:{2} Equips:{3}", m_cCharIndex, m_dwPetID, m_strPetName, m_vecEquipItem); rs.Jump(41); } }