Exemple #1
0
        public static void AddContext(Mobile m, Item item, BaseAttrInfo prop, int intensity)
        {
            if (m_ContextTable.ContainsKey(m))
            {
                m_ContextTable.Remove(m);
            }

            m_ContextTable[m] = new ImbuingContext(item, prop, intensity);
        }
Exemple #2
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            switch (info.ButtonID)
            {
            default:                     // Close
            {
                from.EndAction(typeof(Imbuing));
                break;
            }

            case 301:                     // No, let me make another selection.
            {
                from.SendGump(new SelectPropGump(m_ItemToImbue));
                break;
            }

            case 302:                     // Yes, imbue this item.
            {
                Imbuing.Do(from, m_ItemToImbue, m_PropToImbue, m_PropToReplace, m_ValueToImbue, m_WTotalIntensity, m_Resources1, m_Resources2, m_Resources3, m_SuccessChance);
                ImbuingContext.AddContext(from, m_ItemToImbue, m_PropToImbue, m_IntensityStep);
                break;
            }

            case 310:                     // Min Intensity
            {
                from.SendGump(new ConfirmationGump(from, m_ItemToImbue, m_ItemProperties, m_PropToImbue, m_PropToReplace, 1, m_TotalIntensitySteps));
                break;
            }

            case 311:                     // Low Intensity 1
            {
                from.SendGump(new ConfirmationGump(from, m_ItemToImbue, m_ItemProperties, m_PropToImbue, m_PropToReplace, m_IntensityStep - 1, m_TotalIntensitySteps));
                break;
            }

            case 312:                     // Raise Intensity 1
            {
                from.SendGump(new ConfirmationGump(from, m_ItemToImbue, m_ItemProperties, m_PropToImbue, m_PropToReplace, m_IntensityStep + 1, m_TotalIntensitySteps));
                break;
            }

            case 313:                     // Max Intensity
            {
                from.SendGump(new ConfirmationGump(from, m_ItemToImbue, m_ItemProperties, m_PropToImbue, m_PropToReplace, m_TotalIntensitySteps, m_TotalIntensitySteps));
                break;
            }

            case 314:                     // Low Intensity 10
            {
                from.SendGump(new ConfirmationGump(from, m_ItemToImbue, m_ItemProperties, m_PropToImbue, m_PropToReplace, m_IntensityStep - 10, m_TotalIntensitySteps));
                break;
            }

            case 315:                     // Raise Intensity 10
            {
                from.SendGump(new ConfirmationGump(from, m_ItemToImbue, m_ItemProperties, m_PropToImbue, m_PropToReplace, m_IntensityStep + 10, m_TotalIntensitySteps));
                break;
            }
            }
        }
Exemple #3
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            switch (info.ButtonID)
            {
            default:
            case 0:                     // Cancel
            {
                from.EndAction(typeof(Imbuing));

                break;
            }

            case 1:                                 // Imbue Item
            {
                from.SendLocalizedMessage(1079589); // Target an item you wish to imbue.

                from.Target = new ImbueTarget();
                from.Target.BeginTimeout(from, TimeSpan.FromSeconds(10.0));

                break;
            }

            case 2:                                 // Unravel Item
            {
                from.SendLocalizedMessage(1080422); // Target an item you wish to magically unravel.

                from.Target = new UnravelTarget();
                from.Target.BeginTimeout(from, TimeSpan.FromSeconds(10.0));

                break;
            }

            case 3:                     // Imbue Last Item
            {
                Item item = ImbuingContext.GetLastItem(from);

                if (item == null)
                {
                    from.SendLocalizedMessage(1113572);                                       // You haven't imbued anything yet!
                    from.EndAction(typeof(Imbuing));
                }
                else if (Imbuing.Check(from, item))
                {
                    from.SendGump(new SelectPropGump(item));
                }

                break;
            }

            case 4:                     // Reimbue Last
            {
                ImbuingContext context = ImbuingContext.GetContext(from);

                if (context == null)
                {
                    from.SendLocalizedMessage(1113572);                                       // You haven't imbued anything yet!
                    from.EndAction(typeof(Imbuing));
                }
                else
                {
                    ConfirmationGump confirm = SelectPropGump.SelectProp(from, context.Item, context.Property);

                    if (confirm != null)
                    {
                        confirm.ChangeIntensity(from, context.Intensity);
                        confirm.OnResponse(sender, new RelayInfo(302, new int[0], new TextRelay[0]));
                    }
                }

                break;
            }

            case 5:                     // Imbue Last Property
            {
                BaseAttrInfo attribute = ImbuingContext.GetLastProperty(from);

                if (attribute == null)
                {
                    from.SendLocalizedMessage(1113572);                                       // You haven't imbued anything yet!
                    from.EndAction(typeof(Imbuing));
                }
                else
                {
                    from.SendLocalizedMessage(1079589);                                       // Target an item you wish to imbue.

                    from.Target = new ImbueLastPropTarget(attribute);
                    from.Target.BeginTimeout(from, TimeSpan.FromSeconds(10.0));
                }

                break;
            }

            case 6:                                 // Unravel Container
            {
                from.SendLocalizedMessage(1080422); // Target an item you wish to magically unravel.

                from.Target = new UnravelContainerTarget();
                from.Target.BeginTimeout(from, TimeSpan.FromSeconds(10.0));

                break;
            }
            }
        }
Exemple #4
0
        public static void AddContext( Mobile m, Item item, BaseAttrInfo prop, int intensity )
        {
            if ( m_ContextTable.ContainsKey( m ) )
                m_ContextTable.Remove( m );

            m_ContextTable[m] = new ImbuingContext( item, prop, intensity );
        }