Beispiel #1
0
 public static void BuyItems(EventArgs args)
 {
     //if (!Program.Config.Item("autosharp.shop").GetValue<bool>()) return;
     if ((ObjectManager.Player.InFountain() || ObjectManager.Player.IsDead) && Environment.TickCount - _lastShop < 350)
     {
         return;
     }
     if ((Queue.Peek() != null && InventoryFull()) &&
         (Queue.Peek().From == null ||
          (Queue.Peek().From != null && !Queue.Peek().From.Contains(_lastItem.Id))))
     {
         var y = Queue.Dequeue();
         _priceAddup += y.Goldbase;
     }
     if (Queue.Peek().Goldbase <= ObjectManager.Player.Gold - _priceAddup && Queue.Count > 0 &&
         ObjectManager.Player.IsInShopRange())
     {
         var y = Queue.Dequeue();
         //y.Id
         (new Item((ItemId)y.Id)).Buy();
         _lastItem   = y;
         _priceAddup = 0;
     }
     _lastShop = Environment.TickCount;
 }
Beispiel #2
0
 public static void ItemSequence(AramItem item, Queue<AramItem> shopListQueue)
 {
     if (item.From == null)
         shopListQueue.Enqueue(item);
     else
     {
         foreach (int itemDescendant in item.From)
             ItemSequence(GetItemById(itemDescendant), shopListQueue);
         shopListQueue.Enqueue(item);
     }
 }
Beispiel #3
0
 public static void ItemSequence(AramItem item, Queue <AramItem> shopListQueue)
 {
     if (item.From == null)
     {
         shopListQueue.Enqueue(item);
     }
     else
     {
         foreach (int itemDescendant in item.From)
         {
             ItemSequence(GetItemById(itemDescendant), shopListQueue);
         }
         shopListQueue.Enqueue(item);
     }
 }
Beispiel #4
0
 public static void BuyItems(EventArgs args)
 {
     //if (!Program.Config.Item("autosharp.shop").GetValue<bool>()) return;
     if ((ObjectManager.Player.InFountain() || ObjectManager.Player.IsDead) && Environment.TickCount - _lastShop < 350) return;
     if ((Queue.Peek() != null && InventoryFull()) &&
            (Queue.Peek().From == null ||
             (Queue.Peek().From != null && !Queue.Peek().From.Contains(_lastItem.Id))))
     {
         var y = Queue.Dequeue();
         _priceAddup += y.Goldbase;
     }
     if (Queue.Peek().Goldbase <= ObjectManager.Player.Gold - _priceAddup && Queue.Count > 0 &&
            ObjectManager.Player.IsInShopRange())
     {
         var y = Queue.Dequeue();
         //y.Id
         (new Item((ItemId) y.Id)).Buy();
         _lastItem = y;
         _priceAddup = 0;
     }
     _lastShop = Environment.TickCount;
 }