Ejemplo n.º 1
0
        public ItemLocation LootToIndex(Item item, byte index)
        {
            Objects.Container c = Core.client.Inventory.GetContainer(index);

            ItemLocation loc;

            if (c.Ammount < c.Volume)
            {
                if (c.Ammount == 0)
                {
                    loc = ItemLocation.FromContainer((byte)c.Number, 0);
                    return(loc);
                }
                Item LootItem = c.GetItems().FirstOrDefault((Item j) => j.Id == item.Id & j.Count < 100);
                if (LootItem != null)
                {
                    loc = LootItem.Location;
                    return(loc);
                }
                else
                {
                    loc = ItemLocation.FromContainer((byte)c.Number, (byte)c.Ammount);
                    return(loc);
                }
            }
            else
            {
                if (item.ItemData.IsStackable)
                {
                    foreach (Item o in c.GetItems())
                    {
                        if (o.Id == item.Id && o.Count < 100)
                        {
                            loc = o.Location;
                            return(loc);
                        }
                    }
                }


                //this means the bp is full lets see if we find a bp insde
                if (Core.Global.OpenNextBp)
                {
                    foreach (Item o in c.GetItems())
                    {
                        if (o.ItemData.IsContainer)
                        {
                            o.Use(index);
                            Core.SleepRandom();
                            return(LootToIndex(item, index));
                        }
                    }
                }
            }
            return(null);
        }
Ejemplo n.º 2
0
 private static void AddItemsToDepot(Container TCont, params int[] list)
 {
     foreach (Container c in Core.client.Inventory.GetContainers())
     {
         List <Item> Items = c.GetItems().ToList();
         Items.Reverse();
         if (c.Number != TCont.Number)
         {
             foreach (Item i in Items)
             {
                 i.Move(ItemLocation.FromContainer((byte)TCont.Number, (byte)(TCont.Ammount + 1)));
                 Core.SleepRandom();
             }
         }
     }
     Core.SleepRandom();
     TCont.Close();
 }
Ejemplo n.º 3
0
        public ItemLocation LootTo(Item item)
        {
            ItemLocation loc = default(ItemLocation);

            for (int i = 0; i <= Core.LastCorpse - 1; i++)
            {
                Objects.Container c = Core.client.Inventory.GetContainer(Convert.ToByte(i));
                if (c.Ammount < c.Volume)
                {
                    if (c.Ammount == 0)
                    {
                        loc = ItemLocation.FromContainer((byte)c.Number, 0);
                        break;
                    }
                    Item LootItem = c.GetItems().FirstOrDefault((Item j) => j.Id == item.Id & j.Count < 100);
                    if (LootItem != null)
                    {
                        loc = LootItem.Location;
                        break;
                    }
                    else
                    {
                        loc = ItemLocation.FromContainer((byte)c.Number, (byte)c.Ammount);
                        break;
                    }
                }
                else
                {
                    foreach (Item o in c.GetItems())
                    {
                        if (o.Id == item.Id && o.Count < 100)
                        {
                            loc = o.Location;
                            break;
                        }
                    }
                }
            }
            return(loc);
        }