public Item(Client cl, int id, int count, ItemLocation loc, string name) { client = cl; m_id = id; m_count = count; m_loc = loc; }
public static ItemLocation FromSlot(Constants.SlotNumber slot) { ItemLocation loc = new ItemLocation(); loc.Type = Constants.ItemLocationType.Slot; loc.Slot = slot; return(loc); }
public static ItemLocation FromLocation(Location location, byte stack) { ItemLocation loc = new ItemLocation(); loc.Type = Constants.ItemLocationType.Ground; loc.GroundLocation = location; loc.StackOrder = stack; return(loc); }
public static ItemLocation FromContainer(byte container, byte position) { ItemLocation loc = new ItemLocation(); loc.Type = Constants.ItemLocationType.Container; loc.ContainerId = container; loc.ContainerSlot = position; loc.StackOrder = position; return(loc); }
public IEnumerable <Item> GetItems() { uint Adr = Adreess + client.Addresses.Container.DistanceItemStart; Adr = client.Memory.ReadUInt32(Adr); for (uint i = 0; i < Ammount; i++) { uint iAdr = Adr + i * client.Addresses.Container.StepContainerSlot; int Count = client.Memory.ReadInt32(iAdr + client.Addresses.Container.DistanceItemCount); int ItemId = client.Memory.ReadInt32(iAdr + client.Addresses.Container.DistanceItemId); yield return(new Item(client, ItemId, Count, ItemLocation.FromContainer((byte)Number, (byte)i))); } }
public static ItemLocation FromItemLocation(ItemLocation location) { switch (location.Type) { case Constants.ItemLocationType.Container: return(ItemLocation.FromContainer(location.ContainerId, location.ContainerSlot)); case Constants.ItemLocationType.Ground: return(ItemLocation.FromLocation(location.GroundLocation, location.StackOrder)); case Constants.ItemLocationType.Slot: return(ItemLocation.FromSlot(location.Slot)); default: return(null); } }
public Item(Client cl, int id, int count, ItemLocation loc) : this(cl, id, count, loc, "") { }
public void UseItemOnCreature(uint id, byte stack, int creatureId) { Packets.OutGoing.ItemUseOnCreature.Send(client, ItemLocation.FromHotkey().ToLocation(), (ushort)id, stack, (uint)creatureId); }
public void UseItemOnTile(uint id, Tile onTile) { Packets.OutGoing.ItemUseOn.Send(client, ItemLocation.FromHotkey().ToLocation(), (ushort)id, 0, onTile.Location, (ushort)onTile.Ground.Id, 0); }