예제 #1
0
파일: Exposer.cs 프로젝트: uotools/PlayUO
        public void AutoUse()
        {
            ArrayList autoUse = World.CharData.AutoUse;

            if (autoUse.Count <= 0)
            {
                Engine.AddTextMessage("There are no items in your use-once list.");
            }
            else
            {
                Mobile player = World.Player;
                if (player != null)
                {
                    Item backpack = player.Backpack;
                    if (backpack != null)
                    {
                        for (int i = 0; i < autoUse.Count; i++)
                        {
                            Engine.m_AutoUseIndex++;
                            Engine.m_AutoUseIndex = Engine.m_AutoUseIndex % autoUse.Count;
                            Item check = (Item)autoUse[Engine.m_AutoUseIndex];
                            if (backpack.ContainsItem(check) || (check.IsEquip && (check.EquipParent == player)))
                            {
                                check.Use();
                                return;
                            }
                        }
                        Engine.AddTextMessage("No use-once items were found on your person.");
                    }
                }
            }
        }
예제 #2
0
 public static void Transfer(Item stock, Item pouch, int amount)
 {
     if (stock.Items.Count == 0)
     {
         Engine.AddTextMessage("Content of reagent stock unknown. Opening...");
         stock.Use();
         m_QueueStock = stock;
         m_QueuePouch = pouch;
         m_QueueAmount = amount;
         m_QueueTime = DateTime.Now;
     }
     else if (pouch.Items.Count == 0)
     {
         Engine.AddTextMessage("Content of reagent pouch unknown. Opening...");
         pouch.Use();
         m_QueueStock = stock;
         m_QueuePouch = pouch;
         m_QueueAmount = amount;
         m_QueueTime = DateTime.Now;
     }
     else
     {
         m_QueueStock = null;
         m_QueuePouch = null;
         m_QueueAmount = 0;
         m_QueueTime = DateTime.MinValue;
         int[] list = ReagentValidator.Validator.List;
         for (int i = 0; i < list.Length; i++)
         {
             Transfer(stock, pouch, amount, list[i]);
         }
         Engine.PrintQAM();
     }
 }
예제 #3
0
파일: Exposer.cs 프로젝트: uotools/PlayUO
        public void UseItemByType(int[] itemIDs)
        {
            Mobile player = World.Player;

            if (player != null)
            {
                Item backpack = player.Backpack;
                if (backpack != null)
                {
                    Item item2 = backpack.FindItem(new ItemIDValidator(itemIDs));
                    if (item2 != null)
                    {
                        item2.Use();
                    }
                }
            }
        }