Пример #1
0
 public void Use()
 {
     if (World.Player == null)
     {
         return;
     }
     for (int index = 0; index < this.m_Items.Count; ++index)
     {
         PlayUO.Item onPlayer = this.m_Items[(this.m_Index + index) % this.m_Items.Count].FindOnPlayer();
         if (onPlayer != null)
         {
             this.m_Index += index;
             onPlayer.Use();
             ++this.m_Index;
             this.m_Index %= this.m_Items.Count;
             return;
         }
     }
     if (this.m_Items.Count == 0)
     {
         Engine.AddTextMessage("There are no items in your use-once list.");
     }
     else
     {
         Engine.AddTextMessage("No use-once items were found on your person.");
     }
 }
Пример #2
0
 public bool IsValid(PlayUO.Item check)
 {
   if (this.Reagents && ReagentValidator.Validator.IsValid(check) || this.Bolas && check.ID == 9900 || this.Munitions && (check.ID == 3903 || check.ID == 7163) || this.Artifacts && ArtifactValidator.Default.IsValid(check))
     return true;
   foreach (ItemRef mItem in this.m_Items)
   {
     if (mItem.ItemID == check.ID && (mItem.Serial == 0 || mItem.Serial == check.Serial))
       return true;
   }
   return false;
 }
Пример #3
0
 public ItemRef this[PlayUO.Item item]
 {
   get
   {
     if (item != null)
     {
       foreach (ItemRef mItem in this.m_Items)
       {
         if (mItem.Serial == item.Serial)
           return mItem;
       }
     }
     return (ItemRef) null;
   }
 }
Пример #4
0
 public RunebookInfo this[PlayUO.Item runebook]
 {
     get
     {
         for (int index = 0; index < this.m_Runebooks.Count; ++index)
         {
             RunebookInfo runebookInfo = this.m_Runebooks[index];
             if (runebookInfo.Serial == runebook.Serial)
             {
                 return(runebookInfo);
             }
         }
         RunebookInfo runebookInfo1;
         this.m_Runebooks.Add(runebookInfo1 = new RunebookInfo(runebook));
         return(runebookInfo1);
     }
 }
Пример #5
0
 public void Scavenge(bool isManual)
 {
   Mobile player = World.Player;
   if (player == null)
     return;
   PlayUO.Item[] items = World.FindItems((IItemValidator) new PlayerDistanceValidator((IItemValidator) new PickupValidator((IItemValidator) this), 2));
   if (items.Length == 0)
     return;
   Array.Sort((Array) items, (IComparer) this);
   bool clickFirst = false;
   for (int index = 0; index < items.Length; ++index)
   {
     PlayUO.Item pickUp = items[index];
     if (!Engine.Multis.RunUO_IsInside(pickUp.X, pickUp.Y, pickUp.Z) && new MoveContext(pickUp, pickUp.Amount, (IEntity) player, clickFirst).Enqueue())
     {
       int Amount = Math.Max(pickUp.Amount, 1);
       Engine.AddTextMessage(string.Format("Scavenging {0:N0} {1}", (object) Amount, (object) Map.ReplaceAmount(Map.GetTileName(pickUp.ID + 16384), Amount)), Engine.DefaultFont, Hues.Load(53));
     }
   }
 }
Пример #6
0
 public int Compare(object x, object y)
 {
   PlayUO.Item obj = x as PlayUO.Item;
   return this.GetWorth(y as PlayUO.Item) - this.GetWorth(obj);
 }
Пример #7
0
 private int GetWorth(PlayUO.Item item)
 {
   return ReagentValidator.Validator.IsValid(item) ? 4 : 10;
 }