示例#1
0
            protected override void OnTarget(Mobile m, object o)
            {
                Item item = o as Item;

                if (item == null || !(m is PlayerMobile))
                {
                    m.SendLocalizedMessage(1079576); // You cannot imbue this item.
                    return;
                }

                ImbuingContext context = Imbuing.GetContext(m);

                int mod    = context.Imbue_Mod;
                int modInt = context.Imbue_ModInt;

                if (!Imbuing.CanImbueItem(m, item) || !Imbuing.OnBeforeImbue(m, item, mod, modInt) || !Imbuing.CanImbueProperty(m, item, mod))
                {
                    ImbueGump.SendGumpDelayed((PlayerMobile)m);
                }
                else
                {
                    Imbuing.TryImbueItem(m, item, mod, modInt);
                    ImbueGump.SendGumpDelayed((PlayerMobile)m);
                }
            }
示例#2
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (!(o is Item))
                {
                    return;
                }

                PlayerMobile   pm      = from as PlayerMobile;
                ImbuingContext context = Imbuing.GetContext(pm);

                int mod    = context.Imbue_Mod;
                int modInt = context.Imbue_ModInt;

                Item it = o as Item;

                if (!Imbuing.CanImbueItem(pm, it) || !Imbuing.OnBeforeImbue(from, it, mod, modInt) || !Imbuing.CanImbueProperty(from, it, mod))
                {
                    from.SendGump(new ImbuingGump(from));
                    return;
                }

                Imbuing.ImbueItem(from, it, mod, modInt);
                ImbuingGumpC.SendGumpDelayed(from);
            }
示例#3
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (!(o is Item))
                {
                    from.SendLocalizedMessage(1079576); // You cannot imbue this item.
                    return;
                }

                ImbuingContext context = Imbuing.GetContext(from);

                int mod    = context.Imbue_Mod;
                int modInt = context.Imbue_ModInt;

                Item it = o as Item;

                if (!Imbuing.CanImbueItem(from, it) || !Imbuing.OnBeforeImbue(from, it, mod, modInt) || !Imbuing.CanImbueProperty(from, it, mod))
                {
                    from.SendGump(new ImbuingGump(from));
                    return;
                }

                Imbuing.ImbueItem(from, it, mod, modInt);
                ImbuingGumpC.SendGumpDelayed(from);
            }
示例#4
0
        public override void OnResponse(RelayInfo info)
        {
            ImbuingContext context = Imbuing.GetContext(User);

            switch (info.ButtonID)
            {
            case 0:     // Close/Cancel
            case 1:
            {
                User.EndAction(typeof(Imbuing));
                break;
            }

            case 10001:
            {
                context.ImbMenu_Cat = 1;

                Refresh();
                break;
            }

            case 10002:
            {
                context.ImbMenu_Cat = 2;

                Refresh();
                break;
            }

            case 10003:
            {
                context.ImbMenu_Cat = 3;

                Refresh();
                break;
            }

            case 10004:
            {
                context.ImbMenu_Cat = 4;

                Refresh();
                break;
            }

            case 10005:
            {
                context.ImbMenu_Cat = 5;

                Refresh();
                break;
            }

            case 10006:
            {
                context.ImbMenu_Cat = 6;

                Refresh();
                break;
            }

            case 10007:
            {
                context.ImbMenu_Cat = 7;

                Refresh();
                break;
            }

            case 10008:
            {
                context.ImbMenu_Cat = 8;

                Refresh();
                break;
            }

            case 10009:
            {
                context.ImbMenu_Cat = 9;

                Refresh();
                break;
            }

            case 10010:
            {
                context.ImbMenu_Cat = 10;

                Refresh();
                break;
            }

            case 10011:
            {
                context.ImbMenu_Cat = 11;

                Refresh();
                break;
            }

            case 10012:
            {
                context.ImbMenu_Cat = 12;

                Refresh();
                break;
            }

            case 10013:
            {
                context.ImbMenu_Cat = 13;

                Refresh();
                break;
            }

            case 10014:
            {
                context.ImbMenu_Cat = 14;

                Refresh();
                break;
            }

            case 10015:
            {
                context.ImbMenu_Cat = 15;

                Refresh();
                break;
            }

            default:      // = Proceed to Attribute Intensity Menu [ImbuingC.cs]
            {
                int id = info.ButtonID - 10100;

                // Converts AosElementalAttribute (used as elemental damage on weapons) to WeaponAttributes Elemental resists
                if (m_Item is BaseWeapon && id >= 51 && id <= 55)
                {
                    id += 182;
                }

                context.Imbue_Mod = id;

                if (Imbuing.OnBeforeImbue(User, context.LastImbued, id, -1))
                {
                    BaseGump.SendGump(new ImbueGump(User, context.LastImbued, id, -1));
                }

                break;
            }
            }
        }
示例#5
0
        public override void OnResponse(RelayInfo info)
        {
            ImbuingContext context = Imbuing.GetContext(User);

            switch (info.ButtonID)
            {
            case 0:     // Close
            case 1:
            {
                User.EndAction(typeof(Imbuing));

                break;
            }

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

                User.Target = new ImbueItemTarget();
                User.Target.BeginTimeout(User, TimeSpan.FromSeconds(10.0));

                break;
            }

            case 10006:      // Reimbue Last
            {
                Item item   = context.LastImbued;
                int  mod    = context.Imbue_Mod;
                int  modint = context.Imbue_ModInt;

                if (item == null || mod < 0 || modint == 0)
                {
                    User.SendLocalizedMessage(1113572);         // You haven't imbued anything yet!
                    User.EndAction(typeof(Imbuing));
                    break;
                }

                if (Imbuing.CanImbueItem(User, item) && Imbuing.OnBeforeImbue(User, item, mod, modint))
                {
                    Imbuing.TryImbueItem(User, item, mod, modint);
                    ImbueGump.SendGumpDelayed(User);
                }
                break;
            }

            case 10007:      // Imbue Last Item
            {
                Item item   = context.LastImbued;
                int  mod    = context.Imbue_Mod;
                int  modint = context.Imbue_ModInt;

                if (context.LastImbued == null)
                {
                    User.SendLocalizedMessage(1113572);         // You haven't imbued anything yet!
                    User.EndAction(typeof(Imbuing));
                    break;
                }

                ImbueStep1(User, item);
                break;
            }

            case 10008:      // Imbue Last Property
            {
                context.LastImbued = null;
                int mod    = context.Imbue_Mod;
                int modint = context.Imbue_ModInt;

                if (modint < 0)
                {
                    modint = 0;
                }

                if (mod < 0)
                {
                    User.SendLocalizedMessage(1113572);         // You haven't imbued anything yet!
                    User.EndAction(typeof(Imbuing));
                    break;
                }

                ImbueLastProp(User, mod, modint);

                break;
            }

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

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

                break;
            }

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

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

                break;
            }
            }
        }
示例#6
0
文件: ImbuingC.cs 项目: Brrm1/New-One
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile       from = state.Mobile;
            PlayerMobile pm   = from as PlayerMobile;

            ImbuingContext context = Imbuing.GetContext(pm);

            int buttonNum = 0;

            if (info.ButtonID > 0 && info.ButtonID < 10000)
            {
                buttonNum = 0;
            }
            else if (info.ButtonID > 20004)
            {
                buttonNum = 30000;
            }
            else
            {
                buttonNum = info.ButtonID;
            }

            switch (buttonNum)
            {
            case 0:
            {
                //Close
                break;
            }

            case 10051:     // = Decrease Mod Value [<]
            {
                if (context.Imbue_ModInt > m_Definition.IncAmount)
                {
                    context.Imbue_ModInt -= m_Definition.IncAmount;
                }

                from.SendGump(new ImbuingGumpC(from, m_Item, context.Imbue_Mod, context.Imbue_ModInt));
                break;
            }

            case 10052:    // = Decrease Mod Value [<<]
            {
                if ((m_Mod == 42 || m_Mod == 24) && context.Imbue_ModInt > 20)
                {
                    context.Imbue_ModInt -= 20;
                }
                if ((m_Mod == 13 || m_Mod == 20 || m_Mod == 21) && context.Imbue_ModInt > 10)
                {
                    context.Imbue_ModInt -= 10;
                }
                else if (context.Imbue_ModInt > 5)
                {
                    context.Imbue_ModInt -= 5;
                }

                from.SendGump(new ImbuingGumpC(from, context.LastImbued, context.Imbue_Mod, context.Imbue_ModInt));
                break;
            }

            case 10053:    // = Minimum Mod Value [<<<]
            {
                context.Imbue_ModInt = 1;
                from.SendGump(new ImbuingGumpC(from, context.LastImbued, context.Imbue_Mod, context.Imbue_ModInt));
                break;
            }

            case 10054:     // = Increase Mod Value [>]
            {
                int max = GetMaxIntensity(m_Item, m_Definition);

                if (m_Mod == 12 && context.LastImbued is BaseJewel)
                {
                    max /= 2;
                }

                if (context.Imbue_ModInt + m_Definition.IncAmount <= max)
                {
                    context.Imbue_ModInt += m_Definition.IncAmount;
                }

                from.SendGump(new ImbuingGumpC(from, context.LastImbued, context.Imbue_Mod, context.Imbue_ModInt));
                break;
            }

            case 10055:     // = Increase Mod Value [>>]
            {
                int max = GetMaxIntensity(m_Item, m_Definition);

                if (m_Mod == 12 && context.LastImbued is BaseJewel)
                {
                    max /= 2;
                }

                if (m_Mod == 42 || m_Mod == 24)
                {
                    if (context.Imbue_ModInt + 20 <= max)
                    {
                        context.Imbue_ModInt += 20;
                    }
                    else
                    {
                        context.Imbue_ModInt = max;
                    }
                }
                if (m_Mod == 13 || m_Mod == 20 || m_Mod == 21)
                {
                    if (context.Imbue_ModInt + 10 <= max)
                    {
                        context.Imbue_ModInt += 10;
                    }
                    else
                    {
                        context.Imbue_ModInt = max;
                    }
                }
                else if (context.Imbue_ModInt + 5 <= max)
                {
                    context.Imbue_ModInt += 5;
                }
                else
                {
                    context.Imbue_ModInt = GetMaxIntensity(m_Item, m_Definition);
                }

                from.SendGump(new ImbuingGumpC(from, context.LastImbued, context.Imbue_Mod, context.Imbue_ModInt));
                break;
            }

            case 10056:     // = Maximum Mod Value [>>>]
            {
                int max = GetMaxIntensity(m_Item, m_Definition);

                if (m_Mod == 12 && context.LastImbued is BaseJewel)
                {
                    max /= 2;
                }

                context.Imbue_ModInt = max;
                from.SendGump(new ImbuingGumpC(from, context.LastImbued, context.Imbue_Mod, context.Imbue_ModInt));
                break;
            }

            case 10099:     // - Back
            {
                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10100:      // = Imbue the Item
            {
                context.Imbue_IWmax = m_MaxWeight;

                if (Imbuing.OnBeforeImbue(from, m_Item, m_Mod, m_Value, m_TotalProps, MaxProps, m_TotalItemWeight, m_MaxWeight))
                {
                    Imbuing.ImbueItem(from, m_Item, m_Mod, m_Value);
                    SendGumpDelayed(from);
                }

                break;
            }
            }
        }
示例#7
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile       from = state.Mobile;
            PlayerMobile pm   = from as PlayerMobile;

            ImbuingContext context = Imbuing.GetContext(pm);

            int buttonNum = 0;

            if (info.ButtonID > 0 && info.ButtonID < 10000)
            {
                buttonNum = 1;
            }
            else if (info.ButtonID > 20004)
            {
                buttonNum = 30000;
            }
            else
            {
                buttonNum = info.ButtonID;
            }

            switch (buttonNum)
            {
            case 0:
            {
                //Close
                break;
            }

            case 1:
            {
                break;
            }

            case 10002:      // = Cancel button
            {
                break;
            }

            case 10005:      // = Imbue Item
            {
                if (!Imbuing.CheckSoulForge(from, 1))
                {
                    break;
                }

                from.SendLocalizedMessage(1079589);          //Target an item you wish to imbue.
                from.Target = new ImbueItemTarget();

                break;
            }

            case 10006:      // = ReImbue Last ( Mod & Item )
            {
                Item it     = context.LastImbued;
                int  mod    = context.Imbue_Mod;
                int  modint = context.Imbue_ModInt;

                if (!Imbuing.CheckSoulForge(from, 1))
                {
                    break;
                }

                if (it == null || mod < 0 || modint == 0)
                {
                    from.SendLocalizedMessage(1113572);         // You haven't imbued anything yet!
                    break;
                }

                if (Imbuing.CanImbueItem(pm, it) && Imbuing.OnBeforeImbue(from, it, mod, modint))
                {
                    Imbuing.ImbueItem(from, it, mod, modint);
                    from.SendGump(new ImbuingGump(from));
                }
                break;
            }

            case 10007:      // = Imbue Last ( Select Last imbued Item )
            {
                Item item   = context.LastImbued;
                int  mod    = context.Imbue_Mod;
                int  modint = context.Imbue_ModInt;

                if (!Imbuing.CheckSoulForge(from, 1))
                {
                    break;
                }

                if (context.LastImbued == null)
                {
                    from.SendLocalizedMessage(1113572);         // You haven't imbued anything yet!
                    break;
                }
                else
                {
                    ImbueStep1(from, item);
                }
                break;
            }

            case 10008:      // = Imbue Last Mod( To target Item )
            {
                context.LastImbued = null;
                int mod    = context.Imbue_Mod;
                int modint = context.Imbue_ModInt;

                if (modint < 0)
                {
                    modint = 0;
                }

                if (!Imbuing.CheckSoulForge(from, 1))
                {
                    break;
                }

                if (mod < 0)
                {
                    from.SendLocalizedMessage(1113572);         // You haven't imbued anything yet!
                    break;
                }
                else
                {
                    ImbuingGump.ImbueLastProp(from, mod, modint);
                }

                break;
            }

            case 10010:      // = Unravel Item
            {
                if (!Imbuing.CheckSoulForge(from, 1))
                {
                    break;
                }

                from.SendLocalizedMessage(1080422);         // What item do you wish to unravel?
                from.Target = new UnravelTarget();
                break;
            }

            case 10011:      // = Unravel Container
            {
                if (!Imbuing.CheckSoulForge(from, 1))
                {
                    break;
                }

                from.SendMessage("Which Container do you wish to unravel the contents of?");

                from.Target = new UnravelContainerTarget();
                break;
            }
            }
            return;
        }
示例#8
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (!(o is Item))
                {
                    return;
                }

                PlayerMobile   pm      = from as PlayerMobile;
                ImbuingContext context = Imbuing.GetContext(pm);

                int Imod    = context.Imbue_Mod;
                int ImodInt = context.Imbue_ModInt;

                Item it = o as Item;

                if (!Imbuing.CanImbueItem(pm, it) || !Imbuing.OnBeforeImbue(from, it, Imod, ImodInt))
                {
                    return;
                }

                // = Check Last Mod can be applied to Targeted Item Type
                if (o is BaseMeleeWeapon)
                {
                    if (Imod == 1 || Imod == 2 || Imod == 12 || Imod == 13 || Imod == 16 || Imod == 21 || Imod == 22 || (Imod >= 25 && Imod <= 41) || Imod >= 101)
                    {
                        Imbuing.ImbueItem(from, it, Imod, ImodInt);
                        from.SendGump(new ImbuingGump(from));
                        return;
                    }
                    else
                    {
                        from.SendMessage("The selected item cannot be Imbued with the last Property..");
                    }
                }
                else if (o is BaseRanged)
                {
                    if (Imod == 1 || Imod == 2 || Imod == 12 || Imod == 13 || Imod == 16 || Imod == 21 || Imod == 22 || Imod == 60 || Imod == 61 || (Imod >= 25 && Imod <= 41) || Imod >= 101)
                    {
                        Imbuing.ImbueItem(from, it, Imod, ImodInt);
                        from.SendGump(new ImbuingGump(from));
                        return;
                    }
                    else
                    {
                        from.SendMessage("The selected item cannot be Imbued with the last Property..");
                    }
                }
                else if (o is BaseShield)
                {
                    if (Imod == 1 || Imod == 2 || Imod == 19 || Imod == 16 || Imod == 22 || Imod == 24 || Imod == 42)
                    {
                        Imbuing.ImbueItem(from, it, Imod, ImodInt);
                        from.SendGump(new ImbuingGump(from));
                        return;
                    }
                    else
                    {
                        from.SendMessage("The selected item cannot be Imbued with the last Property..");
                    }
                }
                else if (o is BaseArmor)
                {
                    if (Imod == 3 || Imod == 4 || Imod == 5 || Imod == 9 || Imod == 10 || Imod == 11 || Imod == 21 || Imod == 23 || (Imod >= 17 && Imod <= 19))
                    {
                        Imbuing.ImbueItem(from, it, Imod, ImodInt);
                        from.SendGump(new ImbuingGump(from));
                        return;
                    }
                    else
                    {
                        from.SendMessage("The selected item cannot be Imbued with the last Property..");
                    }
                }
                else if (o is BaseHat)
                {
                    if (Imod == 3 || Imod == 4 || Imod == 5 || Imod == 9 || Imod == 10 || Imod == 11 || Imod == 21 || Imod == 23 || (Imod >= 17 && Imod <= 19))
                    {
                        Imbuing.ImbueItem(from, it, Imod, ImodInt);
                        from.SendGump(new ImbuingGump(from));
                        return;
                    }
                    else
                    {
                        from.SendMessage("The selected item cannot be Imbued with the last Property..");
                    }
                }
                else if (o is BaseJewel)
                {
                    if (Imod == 1 || Imod == 2 || Imod == 6 || Imod == 7 || Imod == 8 || Imod == 12 || Imod == 10 || Imod == 11 || Imod == 20 || Imod == 21 || Imod == 23 || Imod == 21 || (Imod >= 14 && Imod <= 18) || (Imod >= 51 && Imod <= 55) || Imod >= 151)
                    {
                        Imbuing.ImbueItem(from, it, Imod, ImodInt);
                        from.SendGump(new ImbuingGump(from));
                        return;
                    }
                    else
                    {
                        from.SendMessage("The selected item cannot be Imbued with the last Property..");
                    }
                }
                else
                {
                    from.SendMessage("The selected item cannot be Imbued with the last Property..");
                }

                return;
            }
示例#9
0
        public override void OnResponse(RelayInfo info)
        {
            ImbuingContext context = Imbuing.GetContext(User);

            switch (info.ButtonID)
            {
            case 0:     //Close
            {
                User.EndAction(typeof(Imbuing));
                break;
            }

            case 10051:     // Decrease Mod Value [<]
            {
                m_Value = Math.Max(ItemPropertyInfo.GetMinIntensity(m_Item, m_Info.ID), m_Value - 1);
                Refresh();

                break;
            }

            case 10052:    // Decrease Mod Value [<<]
            {
                m_Value = Math.Max(ItemPropertyInfo.GetMinIntensity(m_Item, m_Info.ID), m_Value - 10);
                Refresh();

                break;
            }

            case 10053:    // Minimum Mod Value [<<<]
            {
                m_Value = ItemPropertyInfo.GetMinIntensity(m_Item, m_Info.ID);
                Refresh();

                break;
            }

            case 10054:     // Increase Mod Value [>]
            {
                m_Value = Math.Min(ItemPropertyInfo.GetMaxIntensity(m_Item, m_Info.ID), m_Value + 1);
                Refresh();

                break;
            }

            case 10055:     // Increase Mod Value [>>]
            {
                m_Value = Math.Min(ItemPropertyInfo.GetMaxIntensity(m_Item, m_Info.ID), m_Value + 10);
                Refresh();

                break;
            }

            case 10056:     // Maximum Mod Value [>>>]
            {
                m_Value = ItemPropertyInfo.GetMaxIntensity(m_Item, m_Info.ID);
                Refresh();

                break;
            }

            case 10099:     // Back
            {
                BaseGump.SendGump(new ImbueSelectGump(User, context.LastImbued));
                break;
            }

            case 10100:      // Imbue the Item
            {
                context.Imbue_IWmax = m_MaxWeight;

                if (Imbuing.OnBeforeImbue(User, m_Item, m_ID, m_Value, m_TotalProps, Imbuing.GetMaxProps(m_Item), m_TotalItemWeight, m_MaxWeight))
                {
                    Imbuing.TryImbueItem(User, m_Item, m_ID, m_Value);
                    SendGumpDelayed(User);
                }

                break;
            }
            }
        }
示例#10
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile         from    = state.Mobile;
            ImbuingContext context = Imbuing.GetContext(from);

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

            case 10051:     // Decrease Mod Value [<]
            {
                if (context.Imbue_ModInt > m_Definition.IncAmount)
                {
                    context.Imbue_ModInt -= m_Definition.IncAmount;
                }

                from.SendGump(new ImbuingGumpC(from, m_Item, context.Imbue_Mod, context.Imbue_ModInt));
                break;
            }

            case 10052:    // Decrease Mod Value [<<]
            {
                if ((m_Mod == 42 || m_Mod == 24) && context.Imbue_ModInt > 20)
                {
                    context.Imbue_ModInt -= 20;
                }
                if ((m_Mod == 13 || m_Mod == 20 || m_Mod == 21) && context.Imbue_ModInt > 10)
                {
                    context.Imbue_ModInt -= 10;
                }
                else if (context.Imbue_ModInt > 5)
                {
                    context.Imbue_ModInt -= 5;
                }

                from.SendGump(new ImbuingGumpC(from, context.LastImbued, context.Imbue_Mod, context.Imbue_ModInt));
                break;
            }

            case 10053:    // Minimum Mod Value [<<<]
            {
                context.Imbue_ModInt = 1;
                from.SendGump(new ImbuingGumpC(from, context.LastImbued, context.Imbue_Mod, context.Imbue_ModInt));
                break;
            }

            case 10054:     // Increase Mod Value [>]
            {
                int max = Imbuing.GetMaxIntensity(m_Item, m_Definition);

                if (m_Mod == 12 && context.LastImbued is BaseJewel)
                {
                    max /= 2;
                }

                if (context.Imbue_ModInt + m_Definition.IncAmount <= max)
                {
                    context.Imbue_ModInt += m_Definition.IncAmount;
                }

                from.SendGump(new ImbuingGumpC(from, context.LastImbued, context.Imbue_Mod, context.Imbue_ModInt));
                break;
            }

            case 10055:     // Increase Mod Value [>>]
            {
                int max = Imbuing.GetMaxIntensity(m_Item, m_Definition);

                if (m_Mod == 12 && context.LastImbued is BaseJewel)
                {
                    max /= 2;
                }

                if (m_Mod == 42 || m_Mod == 24)
                {
                    if (context.Imbue_ModInt + 20 <= max)
                    {
                        context.Imbue_ModInt += 20;
                    }
                    else
                    {
                        context.Imbue_ModInt = max;
                    }
                }
                if (m_Mod == 13 || m_Mod == 20 || m_Mod == 21)
                {
                    if (context.Imbue_ModInt + 10 <= max)
                    {
                        context.Imbue_ModInt += 10;
                    }
                    else
                    {
                        context.Imbue_ModInt = max;
                    }
                }
                else if (context.Imbue_ModInt + 5 <= max)
                {
                    context.Imbue_ModInt += 5;
                }
                else
                {
                    context.Imbue_ModInt = Imbuing.GetMaxIntensity(m_Item, m_Definition);
                }

                from.SendGump(new ImbuingGumpC(from, context.LastImbued, context.Imbue_Mod, context.Imbue_ModInt));
                break;
            }

            case 10056:     // Maximum Mod Value [>>>]
            {
                int max = Imbuing.GetMaxIntensity(m_Item, m_Definition);

                if (m_Mod == 12 && context.LastImbued is BaseJewel)
                {
                    max /= 2;
                }

                context.Imbue_ModInt = max;
                from.SendGump(new ImbuingGumpC(from, context.LastImbued, context.Imbue_Mod, context.Imbue_ModInt));
                break;
            }

            case 10099:     // Back
            {
                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10100:      // Imbue the Item
            {
                context.Imbue_IWmax = m_MaxWeight;

                if (Imbuing.OnBeforeImbue(from, m_Item, m_Mod, m_Value, m_TotalProps, Imbuing.GetMaxProps(m_Item), m_TotalItemWeight, m_MaxWeight))
                {
                    Imbuing.TryImbueItem(from, m_Item, m_Mod, m_Value);
                    SendGumpDelayed(from);
                }

                break;
            }
            }
        }
示例#11
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile         from    = state.Mobile;
            ImbuingContext context = Imbuing.GetContext(from);

            m_Item = context.LastImbued;

            switch (info.ButtonID)
            {
            case 0:     // Close/Cancel
            case 1:
            {
                from.EndAction(typeof(Imbuing));
                break;
            }

            case 10001:
            {
                context.ImbMenu_Cat = 1;

                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10002:
            {
                context.ImbMenu_Cat = 2;

                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10003:
            {
                context.ImbMenu_Cat = 3;

                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10004:
            {
                context.ImbMenu_Cat = 4;

                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10005:
            {
                context.ImbMenu_Cat = 5;

                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10006:
            {
                context.ImbMenu_Cat = 6;

                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10007:
            {
                context.ImbMenu_Cat = 7;

                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10008:
            {
                context.ImbMenu_Cat = 8;

                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10009:
            {
                context.ImbMenu_Cat = 9;

                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10010:
            {
                context.ImbMenu_Cat = 10;

                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10011:
            {
                context.ImbMenu_Cat = 11;

                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10012:
            {
                context.ImbMenu_Cat = 12;

                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10013:
            {
                context.ImbMenu_Cat = 13;

                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10014:
            {
                context.ImbMenu_Cat = 14;

                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10015:
            {
                context.ImbMenu_Cat = 15;

                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            default:      // = Proceed to Attribute Intensity Menu [ImbuingC.cs]
            {
                int buttonNum = info.ButtonID - 10100;
                context.Imbue_Mod = buttonNum;

                if (Imbuing.OnBeforeImbue(from, context.LastImbued, buttonNum, -1))
                {
                    from.SendGump(new ImbuingGumpC(from, context.LastImbued, buttonNum, -1));
                }

                break;
            }
            }
        }
示例#12
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            ImbuingContext context = Imbuing.GetContext(from);

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

                break;
            }

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

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

                break;
            }

            case 10006:      // Reimbue Last
            {
                Item it     = context.LastImbued;
                int  mod    = context.Imbue_Mod;
                int  modint = context.Imbue_ModInt;

                if (it == null || mod < 0 || modint == 0)
                {
                    from.SendLocalizedMessage(1113572);         // You haven't imbued anything yet!
                    from.EndAction(typeof(Imbuing));
                    break;
                }

                if (Imbuing.CanImbueItem(from, it) && Imbuing.OnBeforeImbue(from, it, mod, modint))
                {
                    Imbuing.ImbueItem(from, it, mod, modint);
                    from.SendGump(new ImbuingGump(from));
                }
                break;
            }

            case 10007:      // Imbue Last Item
            {
                Item item   = context.LastImbued;
                int  mod    = context.Imbue_Mod;
                int  modint = context.Imbue_ModInt;

                if (context.LastImbued == null)
                {
                    from.SendLocalizedMessage(1113572);         // You haven't imbued anything yet!
                    from.EndAction(typeof(Imbuing));
                    break;
                }
                else
                {
                    ImbueStep1(from, item);
                }
                break;
            }

            case 10008:      // Imbue Last Property
            {
                context.LastImbued = null;
                int mod    = context.Imbue_Mod;
                int modint = context.Imbue_ModInt;

                if (modint < 0)
                {
                    modint = 0;
                }

                if (mod < 0)
                {
                    from.SendLocalizedMessage(1113572);         // You haven't imbued anything yet!
                    from.EndAction(typeof(Imbuing));
                    break;
                }
                else
                {
                    ImbuingGump.ImbueLastProp(from, mod, modint);
                }

                break;
            }

            case 10010:                             // 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 10011:                             // 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;
            }
            }

            return;
        }