Пример #1
0
        public static Item Find(WandEffect effect)
        {
            Mobile player = World.Player;

            if (player == null)
            {
                return((Item)null);
            }
            Item            equip = player.FindEquip(Layer.OneHanded);
            WandInformation wandInformation;

            if (equip != null && WandRepository.Retrieve(equip, out wandInformation) && (wandInformation.Effect == effect && wandInformation.Charges > 0))
            {
                equip.Look();
                return(equip);
            }
            foreach (KeyValuePair <Item, WandInformation> keyValuePair in WandRepository.table)
            {
                if (keyValuePair.Value.Effect == effect && (keyValuePair.Value.Charges > 0 && keyValuePair.Key.IsChildOf((Agent)player)))
                {
                    keyValuePair.Key.Look();
                    return(keyValuePair.Key);
                }
            }
            return((Item)null);
        }
Пример #2
0
 public static void Set(Item item, WandInformation?value)
 {
     if (value.HasValue)
     {
         WandRepository.Store(item, value.Value);
     }
     else
     {
         WandRepository.Delete(item);
     }
 }