Beispiel #1
0
        protected override void OnTarget(Mobile from, object targeted)
        {
            Container cont = targeted as Container;

            from.EndAction(typeof(Imbuing));

            if (!Soulforge.CheckProximity(from, 2))
            {
                from.SendLocalizedMessage(1080433);                   // You must be near a soulforge to magically unravel an item.
            }
            else if (!Soulforge.CheckQueen(from))
            {
                from.SendLocalizedMessage(1113736);                   // You must rise to the rank of noble in the eyes of the Gargoyle Queen before her majesty will allow you to use this soulforge.
            }
            else if (cont == null)
            {
                from.SendLocalizedMessage(1111814, "0\t0");                   // Unraveled: ~1_COUNT~/~2_NUM~ items
            }
            else if (!cont.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1062334);                   // This item must be in your backpack to be used.
            }
            else if (HasSpecialMaterialItem(cont))
            {
                from.BeginAction(typeof(Imbuing));
                from.SendGump(new ConfirmUnravelContainerGump(cont));
            }
            else
            {
                Unraveling.UnravelContainer(from, cont);
            }
        }
Beispiel #2
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            from.EndAction(typeof(Imbuing));

            if (info.ButtonID == 1)
            {
                if (!Soulforge.CheckProximity(from, 2))
                {
                    // You must be near a soulforge to magically unravel an item.
                    from.SendLocalizedMessage(1080433);
                }
                else if (!Soulforge.CheckQueen(from))
                {
                    // You must rise to the rank of noble in the eyes of the Gargoyle Queen before her majesty will allow you to use this soulforge.
                    from.SendLocalizedMessage(1113736);
                }
                else if (!m_Container.IsChildOf(from.Backpack))
                {
                    // This item must be in your backpack to be used.
                    from.SendLocalizedMessage(1062334);
                }
                else
                {
                    Unraveling.UnravelContainer(from, m_Container);
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// Performs the pre-imbue checks for the given Mobile and Item.
        /// </summary>
        public static bool Check(Mobile from, Item item)
        {
            IImbuable  imbuable = item as IImbuable;
            BaseWeapon weapon   = item as BaseWeapon;

            /*
             * Additional checks that OSI performs but aren't needed on X-RunUO:
             * - Focus Attack effect: 1080444 "You cannot imbue an item that is under the effects of the ninjitsu focus attack ability."
             */

            if (!Soulforge.CheckProximity(from, 2))
            {
                from.SendLocalizedMessage(1079787);                   // You must be near a soulforge to imbue an item.
            }
            else if (!Soulforge.CheckQueen(from))
            {
                from.SendLocalizedMessage(1113736);                   // You must rise to the rank of noble in the eyes of the Gargoyle Queen before her majesty will allow you to use this soulforge.
            }
            else if (item == null || !item.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1079575);                   // The item must be in your backpack to imbue it.
            }
            else if (imbuable == null || !imbuable.CanImbue || item is ISetItem || item is ICollectionItem)
            {
                from.SendLocalizedMessage(1079576);                   // You cannot imbue this item.
            }
            else if (item.LootType == LootType.Blessed)
            {
                from.SendLocalizedMessage(1080438);                   // You cannot imbue a blessed item.
            }
            else if (weapon != null && weapon.Enchanted)
            {
                from.SendLocalizedMessage(1080130);                   // You cannot imbue an item that is currently enchanted.
            }
            else
            {
                return(true);
            }

            return(false);
        }
Beispiel #4
0
        protected override void OnTarget(Mobile from, object targeted)
        {
            Item      item      = targeted as Item;
            IImbuable toUnravel = targeted as IImbuable;

            from.EndAction(typeof(Imbuing));

            if (!Soulforge.CheckProximity(from, 2))
            {
                from.SendLocalizedMessage(1080433);                   // You must be near a soulforge to magically unravel an item.
            }
            else if (!Soulforge.CheckQueen(from))
            {
                from.SendLocalizedMessage(1113736);                   // You must rise to the rank of noble in the eyes of the Gargoyle Queen before her majesty will allow you to use this soulforge.
            }
            else if (item == null || !item.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1080424);                   // The item must be in your backpack to magically unravel it.
            }
            else
            {
                Unraveling.TryUnravel(from, item, true);
            }
        }