Beispiel #1
0
 public Item(Client cl, int id, int count, ItemLocation loc, string name)
 {
     client  = cl;
     m_id    = id;
     m_count = count;
     m_loc   = loc;
 }
Beispiel #2
0
        public static ItemLocation FromSlot(Constants.SlotNumber slot)
        {
            ItemLocation loc = new ItemLocation();

            loc.Type = Constants.ItemLocationType.Slot;
            loc.Slot = slot;
            return(loc);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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)));
            }
        }
Beispiel #6
0
        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);
            }
        }
Beispiel #7
0
 public Item(Client cl, int id, int count, ItemLocation loc)
     : this(cl, id, count, loc, "")
 {
 }
Beispiel #8
0
 public void UseItemOnCreature(uint id, byte stack, int creatureId)
 {
     Packets.OutGoing.ItemUseOnCreature.Send(client, ItemLocation.FromHotkey().ToLocation(), (ushort)id, stack, (uint)creatureId);
 }
Beispiel #9
0
 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);
 }