private static void WriteItemBundleData(this IPacketWriter p, ItemSlotBundle i) { p.WriteByte(2); p.WriteItemBase(i); p.WriteShort(i.Number); p.WriteString(i.Title); p.WriteShort(i.Attribute); if ((i.TemplateID / 10000) == 207 || (i.TemplateID / 10000) == 233) // TODO: constants, recharge items { p.WriteLong(0); } }
public static void Encode(this ItemSlotBundle i, IPacket p) { p.Encode <byte>(2); i.EncodeBase(p); p.Encode <short>(i.Number); p.Encode <string>(i.Title); p.Encode <short>(i.Attribute); if (ItemConstants.IsRechargeableItem(i.TemplateID)) { p.Encode <long>(0); } }
public static void Encode(this ItemSlotBundle i, OutPacket p) { p.Encode <byte>(2); (i as ItemSlot).Encode(p); p.Encode <short>(i.Number); p.Encode <string>(i.Title); p.Encode <short>(i.Attribute); if (ItemInfo.IsRechargeableItem(i.TemplateID)) { p.Encode <long>(0); } }
public ItemSlotBundle Take(short slot, short count = 1) { var bundle = (ItemSlotBundle)_inventory.Items[slot]; var result = new ItemSlotBundle { TemplateID = bundle.TemplateID, Number = count, Attribute = bundle.Attribute, Title = bundle.Title, DateExpire = bundle.DateExpire, CashItemSN = bundle.CashItemSN }; Remove(bundle, count); return(result); }
private void UpdateQuantity(ItemSlotBundle item) => UpdateQuantity(_inventory.Items.First(i => i.Value == item).Key, item.Number);
public ItemSlotBundle Take(ItemSlotBundle bundle, short count = 1) => Take(_inventory.Items.First(i => i.Value.Equals(bundle)).Key, count);
public ItemSlotBundle Take(ItemSlotBundle bundle, short count = 1) => _inventories[(ItemInventoryType) (bundle.TemplateID / 1000000)].Take(bundle, count);