Exemple #1
0
 public static void BuyItems(EventArgs args)
 {
     if ((ObjectManager.Player.InFountain() || ObjectManager.Player.IsDead) && Environment.TickCount - _lastShop < new Random().Next(350, 450))
     {
         return;
     }
     if (!InventoryFull() && !Items.HasItem(2003) && ObjectManager.Player.Gold > 400)
     {
         ObjectManager.Player.BuyItem(ItemId.Health_Potion);
     }
     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.InShop())
     {
         var y = Queue.Dequeue();
         ObjectManager.Player.BuyItem((ItemId)y.Id);
         _lastItem   = y;
         _priceAddup = 0;
     }
     _lastShop = Environment.TickCount;
 }
Exemple #2
0
 public static void ItemSequence(HowlingAbyss.ARAMShopAI.Item item, Queue <HowlingAbyss.ARAMShopAI.Item> shopListQueue)
 {
     if (item.From == null)
     {
         shopListQueue.Enqueue(item);
     }
     else
     {
         foreach (int itemDescendant in item.From)
         {
             ItemSequence(GetItemById(itemDescendant), shopListQueue);
         }
         shopListQueue.Enqueue(item);
     }
 }
Exemple #3
0
 public static void BuyItems(EventArgs args)
 {
     if ((ObjectManager.Player.InFountain() || ObjectManager.Player.IsDead) && Environment.TickCount - _lastShop < new Random().Next(350, 450)) return;
     if (!InventoryFull() && !Items.HasItem(2003) && ObjectManager.Player.Gold > 400)
     {
         ObjectManager.Player.BuyItem(ItemId.Health_Potion);
     }
     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.InShop())
     {
         var y = Queue.Dequeue();
         ObjectManager.Player.BuyItem((ItemId)y.Id);
         _lastItem = y;
         _priceAddup = 0;
     }
     _lastShop = Environment.TickCount;
 }