Exemplo n.º 1
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;
            }
            }
        }
Exemplo n.º 2
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);
                }
            }
Exemplo n.º 3
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;
            }
            }
        }
Exemplo n.º 4
0
        public override void AddGumpLayout()
        {
            // SoulForge Check
            if (!Imbuing.CheckSoulForge(User, 2))
            {
                return;
            }

            ImbuingContext context = Imbuing.GetContext(User);

            context.LastImbued = m_Item;

            var  itemType  = ItemPropertyInfo.GetItemType(m_Item);
            bool twoHanded = m_Item.Layer == Layer.TwoHanded;

            AddPage(0);
            AddBackground(0, 0, 520, 520, 5054);
            AddImageTiled(10, 10, 500, 500, 2624);
            AddImageTiled(10, 30, 500, 10, 5058);
            AddImageTiled(230, 40, 10, 440, 5058);
            AddImageTiled(10, 480, 500, 10, 5058);

            AddAlphaRegion(10, 10, 520, 500);

            AddHtmlLocalized(10, 12, 520, 20, 1079588, LabelColor, false, false); //IMBING MENU
            int yOffset = 0;

            // ===== Attribute Catagories ========================================
            AddHtmlLocalized(10, 60, 220, 20, 1044010, LabelColor, false, false);  // <CENTER>CATEGORIES</CENTER>
            AddHtmlLocalized(240, 60, 270, 20, 1044011, LabelColor, false, false); // <CENTER>SELECTIONS</CENTER>

            AddButton(15, 90 + (yOffset * 25), 4005, 4007, 10001, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 90 + (yOffset * 25), 150, 18, 1114248, LabelColor, false, false);       //Casting
            yOffset += 1;

            int itemRef = (int)itemType;

            if (itemRef == 1 || itemRef == 2 || itemRef == 4 || itemRef == 6)
            {
                AddButton(15, 90 + (yOffset * 25), 4005, 4007, 10002, GumpButtonType.Reply, 0);
                AddHtmlLocalized(50, 90 + (yOffset * 25), 150, 18, 1114249, LabelColor, false, false);   //Combat
                yOffset += 1;
            }

            if (itemRef == 1 || itemRef == 2)
            {
                AddButton(15, 90 + (yOffset * 25), 4005, 4007, 10006, GumpButtonType.Reply, 0);
                AddHtmlLocalized(50, 90 + (yOffset * 25), 150, 18, 1114250, LabelColor, false, false);   //Hit Area Effects
                yOffset += 1;

                AddButton(15, 90 + (yOffset * 25), 4005, 4007, 10007, GumpButtonType.Reply, 0);
                AddHtmlLocalized(50, 90 + (yOffset * 25), 150, 18, 1114251, LabelColor, false, false);   //Hit Effects
                yOffset += 1;
            }

            AddButton(15, 90 + (yOffset * 25), 4005, 4007, 10003, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 90 + (yOffset * 25), 150, 18, 1114252, LabelColor, false, false);       //Misc.
            yOffset += 1;

            if (itemRef == 2)
            {
                AddButton(15, 90 + (yOffset * 25), 4005, 4007, 10015, GumpButtonType.Reply, 0);
                AddHtmlLocalized(50, 90 + (yOffset * 25), 150, 18, 1114253, LabelColor, false, false);   //Ranged
                yOffset += 1;
            }

            if (itemRef == 1 || itemRef == 2 || itemRef == 3 || itemRef == 5 || itemRef == 6)
            {
                AddButton(15, 90 + (yOffset * 25), 4005, 4007, 10004, GumpButtonType.Reply, 0);
                AddHtmlLocalized(50, 90 + (yOffset * 25), 150, 18, 1114254, LabelColor, false, false);   //Resists
                yOffset += 1;
            }

            if (itemRef == 1 || itemRef == 2)
            {
                AddButton(15, 90 + (yOffset * 25), 4005, 4007, 10008, GumpButtonType.Reply, 0);
                AddHtmlLocalized(50, 90 + (yOffset * 25), 150, 18, 1114263, LabelColor, false, false);   //Slayers
                yOffset += 1;

                AddButton(15, 90 + (yOffset * 25), 4005, 4007, 10009, GumpButtonType.Reply, 0);
                AddHtmlLocalized(50, 90 + (yOffset * 25), 150, 18, 1114264, LabelColor, false, false);   //Super Slayers
                yOffset += 1;
            }

            if (itemRef == 6)
            {
                for (int i = 0; i < 5; i++)
                {
                    AddButton(15, 90 + (yOffset * 25), 4005, 4007, 10010 + i, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(50, 90 + (yOffset * 25), 150, 18, 1114255 + i, LabelColor, false, false);       //Skill Group 1
                    yOffset += 1;
                }
            }

            if (itemRef == 3 || itemRef == 5 || itemRef == 6)
            {
                AddButton(15, 90 + (yOffset * 25), 4005, 4007, 10005, GumpButtonType.Reply, 0);
                AddHtmlLocalized(50, 90 + (yOffset * 25), 150, 18, 1114262, LabelColor, false, false);   //Stats
                yOffset += 1;
            }

            // ===== Attribute Catagories ========================================
            yOffset = 0;
            int menuCat = context.ImbMenu_Cat;

            if (menuCat == 1) // == CASTING ==
            {
                if (itemRef == 1 || itemRef == 2)
                {
                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10122, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079766, LabelColor, false, false);       //Spell Channeling
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10141, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079759, LabelColor, false, false);       //Mage Weapon
                    yOffset += 1;

                    if (m_Item is BaseWeapon && (((BaseWeapon)m_Item).Attributes.SpellChanneling == 0 || ((BaseWeapon)m_Item).Attributes.CastSpeed < 0))
                    {
                        AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10116, GumpButtonType.Reply, 0);
                        AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075617, LabelColor, false, false);       //Faster Casting
                        yOffset += 1;
                    }
                }
                else if (itemRef == 3 || itemRef == 5)
                {
                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10118, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075625, LabelColor, false, false);       //Lower Reg Cost
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10117, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075621, LabelColor, false, false);       //Lower Mana Cost
                    yOffset += 1;
                }
                else if (itemRef == 4)
                {
                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10122, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079766, LabelColor, false, false);       //Spell Channeling
                    yOffset += 1;

                    if (m_Item is BaseShield && (((BaseShield)m_Item).Attributes.SpellChanneling == 0 || ((BaseShield)m_Item).Attributes.CastSpeed < 0))
                    {
                        AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10116, GumpButtonType.Reply, 0);
                        AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075617, LabelColor, false, false);       //Faster Casting
                        yOffset += 1;
                    }
                }
                else if (itemRef == 6)
                {
                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10114, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075628, LabelColor, false, false);       //Spell Damage Increase
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10118, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075625, LabelColor, false, false);       //Lower Reg Cost
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10117, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075621, LabelColor, false, false);       //Lower Mana Cost
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10116, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075617, LabelColor, false, false);       //Faster Casting
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10115, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075618, LabelColor, false, false);       //Faster Cast Recovery
                    yOffset += 1;
                }
            }
            else if (menuCat == 2) // == COMBAT ==
            {
                if (itemRef == 1)
                {
                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10112, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079399, LabelColor, false, false);       //Damage Increase
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10113, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075629, LabelColor, false, false);       //Swing Speed Increase
                    yOffset += 1;

                    if (twoHanded)
                    {
                        AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10161, GumpButtonType.Reply, 0);
                        AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1072792, LabelColor, false, false);   //Balanced
                        yOffset += 1;
                    }

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10102, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075616, LabelColor, false, false);       //Hit Chance Increase
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10101, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075620, LabelColor, false, false);       //Defense Chance Increase
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10140, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079592, LabelColor, false, false);       //Use Best Weapon Skill
                    yOffset += 1;
                }
                else if (itemRef == 2)
                {
                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10112, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079399, LabelColor, false, false);       //Damage Increase
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10113, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075629, LabelColor, false, false);       //Swing Speed Increase
                    yOffset += 1;
                }
                else if (itemRef == 4)
                {
                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10101, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075620, LabelColor, false, false);       //Defense Chance Increase
                    yOffset += 1;
                }
                else if (itemRef == 6)
                {
                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10112, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079399, LabelColor, false, false);       //Damage Increase
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10102, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075616, LabelColor, false, false);       //Hit Chance Increase
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10101, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075620, LabelColor, false, false);       //Defense Chance Increase
                    yOffset += 1;
                }
            }
            else if (menuCat == 3)  // == MISC ==
            {
                if (itemRef == 1 || itemRef == 2)
                {
                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10121, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1061153, LabelColor, false, false);       //Luck
                    yOffset += 1;
                }
                else if (itemRef == 3 || itemRef == 5)
                {
                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10119, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075626, LabelColor, false, false);       //Reflect Physical Damage
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10123, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1015168, LabelColor, false, false);       //Night Sight
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10121, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1061153, LabelColor, false, false);       //Luck
                    yOffset += 1;
                }
                else if (itemRef == 4)
                {
                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10119, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075626, LabelColor, false, false);       //Reflect Physical Damage
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10124, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079757, LabelColor, false, false);       //Lower Requirements
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10142, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1017323, LabelColor, false, false);       //Durability
                    yOffset += 1;
                }
                else if (itemRef == 6)
                {
                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10123, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1015168, LabelColor, false, false);       //Night Sight
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10121, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1061153, LabelColor, false, false);       //Luck
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10120, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075624, LabelColor, false, false);       //Enhance Potions
                    yOffset += 1;
                }
            }
            else if (menuCat == 15)  // == Ranged ==
            {
                if (itemRef == 2)
                {
                    if (twoHanded)
                    {
                        AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10160, GumpButtonType.Reply, 0);
                        AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1080416, LabelColor, false, false);         //Velocity
                        yOffset += 1;
                    }

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10102, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075616, LabelColor, false, false);       //Hit Chance Increase
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10101, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075620, LabelColor, false, false);       //Defense Chance Increase
                    yOffset += 1;

                    if (twoHanded)
                    {
                        AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10161, GumpButtonType.Reply, 0);
                        AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1072792, LabelColor, false, false);   //Balanced
                        yOffset += 1;
                    }
                }
            }
            else if (menuCat == 4) // == RESISTS ==
            {
                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10154, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1061161, LabelColor, false, false);           //Poison Resist
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10151, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1061158, LabelColor, false, false);           //Physcial Resist
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10152, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1061159, LabelColor, false, false);           //Fire Resist
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10155, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1061162, LabelColor, false, false);           //Energy Resist
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10153, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1061160, LabelColor, false, false);           //Cold Resist
                yOffset += 1;
            }

            else if (menuCat == 5)  // == STATS ==
            {
                if (itemRef == 3 || itemRef == 5)
                {
                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10110, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075632, LabelColor, false, false);       //Stamina Increase
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10103, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075627, LabelColor, false, false);       //Hit Points Regeneration
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10104, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079411, LabelColor, false, false);       //Stamina Regeneration
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10105, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079410, LabelColor, false, false);       //Mana Regeneration
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10111, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075631, LabelColor, false, false);       //Mana Increaase
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10109, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1075630, LabelColor, false, false);       //Hit Point Increase
                    yOffset += 1;
                }
                else if (itemRef == 6)
                {
                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10106, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079767, LabelColor, false, false);       //Strength Bonus
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10108, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079756, LabelColor, false, false);       //Intelligence Bonus
                    yOffset += 1;

                    AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10107, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079732, LabelColor, false, false);       //Dexterity Bonus
                    yOffset += 1;
                }
            }
            else if (menuCat == 6)  // == HIT AREA EFFECTS ==
            {
                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10133, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079697, LabelColor, false, false);           //Hit Poison Area
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10130, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079696, LabelColor, false, false);           //Hit Physical Area
                yOffset += 1;
                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10131, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079695, LabelColor, false, false);           //Hit Fire Area
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10134, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079694, LabelColor, false, false);           //Hit Energy Area
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10132, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079693, LabelColor, false, false);           //Hit Cold Area
                yOffset += 1;
            }
            else if (menuCat == 7)  // == ON HIT EFFECTS ==
            {
                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10126, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079707, LabelColor, false, false);            // Hit Stam Leech
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10127, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079701, LabelColor, false, false);           //Hit Mana Leech
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10135, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079706, LabelColor, false, false);           //Hit Magic Arrow
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10129, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079700, LabelColor, false, false);           //Hit Lower Defense
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10128, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079699, LabelColor, false, false);           //Hit Lower Attack
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10138, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079705, LabelColor, false, false);           //Hit Lightning
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10125, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079698, LabelColor, false, false);           //Hit Life Leeach
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10136, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079704, LabelColor, false, false);           //Hit Harm
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10137, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079703, LabelColor, false, false);           //Hit Fireball
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10139, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079702, LabelColor, false, false);           //Hit Dispel
                yOffset += 1;
            }
            else if (menuCat == 8)  // == SLAYERS ==
            {
                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10215, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079755, LabelColor, false, false);           //Water Elemental Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10202, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079754, LabelColor, false, false);           //Troll Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10205, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079753, LabelColor, false, false);           //Terathan Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10212, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079746, LabelColor, false, false);           //Spider Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10220, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079745, LabelColor, false, false);           //Snow Elemental Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10206, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079744, LabelColor, false, false);           //Snake Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10213, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079743, LabelColor, false, false);           //Scorpion Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10217, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079742, LabelColor, false, false);           //Poison Elemental Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10201, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079741, LabelColor, false, false);           //Orc Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10211, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079740, LabelColor, false, false);           //Ophidian Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10203, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079739, LabelColor, false, false);           //Ogre Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10207, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079738, LabelColor, false, false);           //Lizardman Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10208, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079737, LabelColor, false, false);           //Gargoyle Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10214, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079736, LabelColor, false, false);           //Fire Elemental Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10218, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079735, LabelColor, false, false);           //Earth Elemental Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10204, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1061284, LabelColor, false, false);           //Dragon Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10219, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079734, LabelColor, false, false);           //Blood Elemental Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10216, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079733, LabelColor, false, false);           //Air Elemental Slayer
                yOffset += 1;
            }
            else if (menuCat == 9)  // == SUPER SLAYERS ==
            {
                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10221, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079752, LabelColor, false, false);           //Undead Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10223, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079751, LabelColor, false, false);           //Reptile Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10222, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079750, LabelColor, false, false);           //Repond Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10227, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1154652, LabelColor, false, false);           //Fey Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10226, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079749, LabelColor, false, false);           //Elemental Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10224, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079748, LabelColor, false, false);           //Demon Slayer
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10225, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1079747, LabelColor, false, false);           //Arachnid Slayer
                yOffset += 1;
            }
            else if (menuCat == 10)  // == SKILL GROUP 1 ==
            {
                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10251, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044102, LabelColor, false, false);           //Fencing
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10252, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044101, LabelColor, false, false);           //Mace Fighting
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10253, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044100, LabelColor, false, false);           //Swordsmanship
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10254, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044089, LabelColor, false, false);           //Musicianship
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10255, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044085, LabelColor, false, false);           //Magery
                yOffset += 1;
            }
            else if (menuCat == 11)  // == SKILL GROUP 2 ==
            {
                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10256, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044103, LabelColor, false, false);           //Wrestling
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10257, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044095, LabelColor, false, false);           //Animal Taming
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10258, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044092, LabelColor, false, false);           //Spirit Speak
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10259, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044087, LabelColor, false, false);           //Tactics
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10260, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044082, LabelColor, false, false);           //Provocation
                yOffset += 1;
            }
            else if (menuCat == 12)  // == SKILL GROUP 3 ==
            {
                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10261, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044110, LabelColor, false, false);           //Focus
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10262, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044065, LabelColor, false, false);           //Parrying
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10263, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044107, LabelColor, false, false);           //Stealth
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10264, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044106, LabelColor, false, false);           //Meditation
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10265, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044062, LabelColor, false, false);           //Animal Lore
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10266, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044075, LabelColor, false, false);           //Discordance
                yOffset += 1;
            }
            else if (menuCat == 13)  // == SKILL GROUP 4 ==
            {
                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10267, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044115, LabelColor, false, false);           //Mysticism
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10268, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044112, LabelColor, false, false);           //Bushido
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10269, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044109, LabelColor, false, false);           //Necromancy
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10270, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044099, LabelColor, false, false);           //Veterinary
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10271, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044093, LabelColor, false, false);           //Stealing
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10272, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044076, LabelColor, false, false);           //Eval Intelligence
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10273, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044061, LabelColor, false, false);           //Anatomy
                yOffset += 1;
            }
            else if (menuCat == 14)  // == SKILL GROUP 5 ==
            {
                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10274, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044069, LabelColor, false, false);           //Peacemaking
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10280, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044117, LabelColor, false, false);          //Throwing
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10275, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044113, LabelColor, false, false);           //Ninjitsu
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10276, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044111, LabelColor, false, false);           //Chivalary
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10277, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044091, LabelColor, false, false);           //Archery
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10278, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044086, LabelColor, false, false);           //Resist Spells
                yOffset += 1;

                AddButton(250, 90 + (yOffset * 20), 4005, 4007, 10279, GumpButtonType.Reply, 0);
                AddHtmlLocalized(295, 90 + (yOffset * 20), 150, 18, 1044077, LabelColor, false, false);          //Healing
                yOffset += 1;
            }

            AddButton(15, 490, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 490, 150, 20, 1011012, LabelColor, false, false); //Cancel
        }
Exemplo n.º 5
0
        // =========== Check if Choosen Attribute Replaces Another =================
        public static TextDefinition WhatReplacesWhat(int id, Item item)
        {
            if (Imbuing.GetValueForID(item, id) > 0)
            {
                return(ItemPropertyInfo.GetAttributeName(id));
            }

            if (item is BaseWeapon)
            {
                BaseWeapon i = item as BaseWeapon;

                // Slayers replace Slayers
                if (id >= 101 && id <= 127)
                {
                    if (i.Slayer != SlayerName.None)
                    {
                        return(GetNameForAttribute(i.Slayer));
                    }

                    if (i.Slayer2 != SlayerName.None)
                    {
                        return(GetNameForAttribute(i.Slayer2));
                    }
                }
                // OnHitEffect replace OnHitEffect
                if (id >= 35 && id <= 39)
                {
                    if (i.WeaponAttributes.HitMagicArrow > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitMagicArrow));
                    }
                    else if (i.WeaponAttributes.HitHarm > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitHarm));
                    }
                    else if (i.WeaponAttributes.HitFireball > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitFireball));
                    }
                    else if (i.WeaponAttributes.HitLightning > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitLightning));
                    }
                    else if (i.WeaponAttributes.HitDispel > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitDispel));
                    }
                }
                // OnHitArea replace OnHitArea
                if (id >= 30 && id <= 34)
                {
                    if (i.WeaponAttributes.HitPhysicalArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitPhysicalArea));
                    }
                    else if (i.WeaponAttributes.HitColdArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitFireArea));
                    }
                    else if (i.WeaponAttributes.HitFireArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitColdArea));
                    }
                    else if (i.WeaponAttributes.HitPoisonArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitPoisonArea));
                    }
                    else if (i.WeaponAttributes.HitEnergyArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitEnergyArea));
                    }
                }
            }
            if (item is BaseJewel)
            {
                BaseJewel i = item as BaseJewel;

                // SkillGroup1 replace SkillGroup1
                if (id >= 151 && id <= 155)
                {
                    if (i.SkillBonuses.GetBonus(0) > 0)
                    {
                        foreach (SkillName sk in Imbuing.PossibleSkills)
                        {
                            if (i.SkillBonuses.GetSkill(0) == sk)
                            {
                                return(GetNameForAttribute(sk));
                            }
                        }
                    }
                }
                // SkillGroup2 replace SkillGroup2
                if (id >= 156 && id <= 160)
                {
                    if (i.SkillBonuses.GetBonus(1) > 0)
                    {
                        foreach (SkillName sk in Imbuing.PossibleSkills)
                        {
                            if (i.SkillBonuses.GetSkill(1) == sk)
                            {
                                return(GetNameForAttribute(sk));
                            }
                        }
                    }
                }
                // SkillGroup3 replace SkillGroup3
                if (id >= 161 && id <= 166)
                {
                    if (i.SkillBonuses.GetBonus(2) > 0)
                    {
                        foreach (SkillName sk in Imbuing.PossibleSkills)
                        {
                            if (i.SkillBonuses.GetSkill(2) == sk)
                            {
                                return(GetNameForAttribute(sk));
                            }
                        }
                    }
                }
                // SkillGroup4 replace SkillGroup4
                if (id >= 167 && id <= 172)
                {
                    if (i.SkillBonuses.GetBonus(3) > 0)
                    {
                        foreach (SkillName sk in Imbuing.PossibleSkills)
                        {
                            if (i.SkillBonuses.GetSkill(3) == sk)
                            {
                                return(GetNameForAttribute(sk));
                            }
                        }
                    }
                }
                // SkillGroup5 replace SkillGroup5
                if (id >= 173 && id <= 178)
                {
                    if (i.SkillBonuses.GetBonus(4) > 0)
                    {
                        foreach (SkillName sk in Imbuing.PossibleSkills)
                        {
                            if (i.SkillBonuses.GetSkill(4) == sk)
                            {
                                return(GetNameForAttribute(sk));
                            }
                        }
                    }
                }
            }

            return(null);
        }
Exemplo n.º 6
0
        public static int GetPointsForEquipment(Item item)
        {
            if (item is IEpiphanyArmor)
            {
                return(1000);
            }

            foreach (CraftSystem system in CraftSystem.Systems)
            {
                CraftItem crItem = null;

                if (system != null && system.CraftItems != null)
                {
                    Type type = item.GetType();

                    if (type == typeof(SilverRing))
                    {
                        type = typeof(GoldRing);
                    }
                    else if (type == typeof(SilverBracelet))
                    {
                        type = typeof(GoldBracelet);
                    }

                    crItem = system.CraftItems.SearchFor(type);

                    if (crItem != null && crItem.Resources != null)
                    {
                        CraftRes craftRes = crItem.Resources.GetAt(0);
                        double   amount   = 1;

                        if (craftRes != null)
                        {
                            amount = craftRes.Amount;
                        }

                        double award = 1;

                        if (item is IResource)
                        {
                            switch (((IResource)item).Resource)
                            {
                            default: award = amount * .1; break;

                            case CraftResource.DullCopper: award = amount * .47; break;

                            case CraftResource.ShadowIron: award = amount * .73; break;

                            case CraftResource.Copper: award = amount * 1.0; break;

                            case CraftResource.Bronze: award = amount * 1.47; break;

                            case CraftResource.Gold: award = amount * 2.5; break;

                            case CraftResource.Agapite: award = amount * 5.0; break;

                            case CraftResource.Verite: award = amount * 8.5; break;

                            case CraftResource.Valorite: award = amount * 10; break;

                            case CraftResource.SpinedLeather: award = amount * 0.5; break;

                            case CraftResource.HornedLeather: award = amount * 1.0; break;

                            case CraftResource.BarbedLeather: award = amount * 2.0; break;

                            case CraftResource.OakWood: award = amount * .17; break;

                            case CraftResource.AshWood: award = amount * .33; break;

                            case CraftResource.YewWood: award = amount * .67; break;

                            case CraftResource.Heartwood: award = amount * 1.0; break;

                            case CraftResource.Bloodwood: award = amount * 2.17; break;

                            case CraftResource.Frostwood: award = amount * 3.17; break;
                            }
                        }

                        int weight = item is BaseWeapon && !((BaseWeapon)item).DImodded ? Imbuing.GetTotalWeight(item, 12, false, true) : Imbuing.GetTotalWeight(item, -1, false, true);

                        if (weight > 0)
                        {
                            award += weight / 30;
                        }

                        return((int)award);
                    }
                }
            }

            return(0);
        }
Exemplo n.º 7
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile         from    = state.Mobile;
            PlayerMobile   pm      = from as PlayerMobile;
            ImbuingContext context = Imbuing.GetContext(from);

            m_Item = context.LastImbued;

            int buttonNum  = 0;
            int buttonRNum = 0;

            if ((info.ButtonID > 0 && info.ButtonID < 10000) || info.ButtonID == 10099)
            {
                buttonNum = 0;
            }
            else if (info.ButtonID > 20004)
            {
                buttonNum = 30000;
            }
            else if ((info.ButtonID > 10100) && (info.ButtonID < 10300))
            {
                buttonNum  = 10101;
                buttonRNum = info.ButtonID - 10100;
            }
            else
            {
                buttonNum = info.ButtonID;
            }

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

            case 10001:
            {
                context.ImbMenu_Cat = 1;
                from.CloseGump(typeof(ImbuingGumpB));
                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10002:
            {
                context.ImbMenu_Cat = 2;
                from.CloseGump(typeof(ImbuingGumpB));
                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10003:
            {
                context.ImbMenu_Cat = 3;
                from.CloseGump(typeof(ImbuingGumpB));
                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10004:
            {
                context.ImbMenu_Cat = 4;
                from.CloseGump(typeof(ImbuingGumpB));
                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10005:
            {
                context.ImbMenu_Cat = 5;
                from.CloseGump(typeof(ImbuingGumpB));
                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10006:
            {
                context.ImbMenu_Cat = 6;
                from.CloseGump(typeof(ImbuingGumpB));
                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10007:
            {
                context.ImbMenu_Cat = 7;
                from.CloseGump(typeof(ImbuingGumpB));
                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10008:
            {
                context.ImbMenu_Cat = 8;
                from.CloseGump(typeof(ImbuingGumpB));
                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10009:
            {
                context.ImbMenu_Cat = 9;
                from.CloseGump(typeof(ImbuingGumpB));
                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10010:
            {
                context.ImbMenu_Cat = 10;
                from.CloseGump(typeof(ImbuingGumpB));
                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10011:
            {
                context.ImbMenu_Cat = 11;
                from.CloseGump(typeof(ImbuingGumpB));
                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10012:
            {
                context.ImbMenu_Cat = 12;
                from.CloseGump(typeof(ImbuingGumpB));
                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10013:
            {
                context.ImbMenu_Cat = 13;
                from.CloseGump(typeof(ImbuingGumpB));
                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10014:
            {
                context.ImbMenu_Cat = 14;
                from.CloseGump(typeof(ImbuingGumpB));
                from.SendGump(new ImbuingGumpB(from, context.LastImbued));
                break;
            }

            case 10099:                      // = Cancel
            {
                break;
            }

            case 10101:      // = Proceed to Attribute Intensity Menu [ImbuingC.cs]
            {
                context.Imbue_Mod = buttonRNum;
                from.CloseGump(typeof(ImbuingGumpB));
                from.SendGump(new ImbuingGumpC(from, context.LastImbued, buttonRNum, 1));
                break;
            }
            }
            return;
        }
Exemplo n.º 8
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;
            }
            }
        }
Exemplo n.º 9
0
            protected override void OnTarget(Mobile from, object o)
            {
                Item   item = o as Item;
                Mobile m    = o as Mobile;

                if (item == null && m == null)
                {
                    from.SendLocalizedMessage(500353); // You are not certain...
                    return;
                }

                if (!from.CheckTargetSkill(SkillName.ItemID, o, 0, 100))
                {
                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1041352, from.NetState); // You have no idea how much it might be worth.
                    return;
                }

                if (m != null)
                {
                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1041349, AffixType.Append, "  " + m.Name, "", from.NetState); // It appears to be:
                    return;
                }

                if (item.Name != null)
                {
                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, false, item.Name, from.NetState);
                    item.PrivateOverheadMessage(MessageType.Label, 0x3B2, false, item.Name, from.NetState);
                }
                else
                {
                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, item.LabelNumber, from.NetState);
                    item.PrivateOverheadMessage(MessageType.Label, 0x3B2, item.LabelNumber, from.NetState);
                }

                if (Core.AOS)
                {
                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1041351, AffixType.Append, "  " + GetPriceFor(item).ToString(), "", from.NetState); // You guess the value of that item at:

                    if (item is BaseWeapon || item is BaseArmor || item is BaseJewel || item is BaseHat)
                    {
                        if (Imbuing.TimesImbued(item) > 0)
                        {
                            from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1111877, from.NetState); // You conclude that item cannot be magically unraveled. The magic in that item has been weakened due to either low durability or the imbuing process.
                        }
                        else
                        {
                            int    weight    = Imbuing.GetTotalWeight(item);
                            string imbIngred = null;
                            double skill     = from.Skills[SkillName.Imbuing].Base;
                            bool   badSkill  = false;

                            if (!Imbuing.CanUnravelItem(from, item, false))
                            {
                                weight = 0;
                            }

                            if (weight > 0 && weight <= 200)
                            {
                                imbIngred = "Magical Residue";
                            }
                            else if (weight > 200 && weight < 480)
                            {
                                imbIngred = "Enchanted Essence";

                                if (skill < 45.0)
                                {
                                    badSkill = true;
                                }
                            }
                            else if (weight >= 480)
                            {
                                imbIngred = "Relic Fragment";

                                if (skill < 95.0)
                                {
                                    badSkill = true;
                                }
                            }

                            if (imbIngred != null)
                            {
                                if (badSkill)
                                {
                                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1111875, from.NetState); // Your Imbuing skill is not high enough to identify the imbuing ingredient.
                                }
                                else
                                {
                                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1111874, imbIngred, from.NetState); //You conclude that item will magically unravel into: ~1_ingredient~
                                }
                            }
                            else  // Cannot be Unravelled
                            {
                                from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1111876, from.NetState); //You conclude that item cannot be magically unraveled. It appears to possess little to no magic.
                            }
                        }
                    }
                    else
                    {
                        from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1111878); //You conclude that item cannot be magically unraveled.
                    }
                }
                else if (o is Item)
                {
                    if (from.CheckTargetSkill(SkillName.ItemID, o, 0, 100))
                    {
                        if (o is BaseWeapon)
                        {
                            ((BaseWeapon)o).Identified = true;
                        }
                        else if (o is BaseArmor)
                        {
                            ((BaseArmor)o).Identified = true;
                        }

                        if (!Core.AOS)
                        {
                            ((Item)o).OnSingleClick(from);
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500353); // You are not certain...
                    }
                }
                else if (o is Mobile)
                {
                    ((Mobile)o).OnSingleClick(from);
                }
                else
                {
                    from.SendLocalizedMessage(500353); // You are not certain...
                }

                Server.Engines.XmlSpawner2.XmlAttach.RevealAttachments(from, o);
            }
Exemplo n.º 10
0
        private const int FontColor  = 0xFFFFFF; //string

        public ImbuingGumpB(Mobile from, Item item) : base(520, 340)
        {
            from.CloseGump(typeof(ImbuingGump));
            from.CloseGump(typeof(ImbuingGumpC));

            Mobile       m  = from;
            PlayerMobile pm = from as PlayerMobile;

            ImbuingContext context = Imbuing.GetContext(m);

            m_Item = context.LastImbued;

            int  itemRef = ImbuingGump.GetItemRef(m_Item);
            bool ranged  = item is BaseRanged;

            AddPage(0);
            AddBackground(0, 0, 540, 580, 5054);
            AddImageTiled(10, 10, 520, 560, 2624);
            AddImageTiled(10, 35, 520, 10, 5058);
            AddImageTiled(245, 45, 15, 490, 5058);
            AddImageTiled(10, 535, 520, 10, 5058);

            AddAlphaRegion(10, 10, 520, 560);

            AddHtmlLocalized(10, 13, 520, 20, 1079588, LabelColor, false, false); //IMBING MENU
            int yOffset = 0;

            // ===== Attribute Catagories ========================================
            AddLabel(87, 50, 1359, "CATAGORIES");

            AddButton(22, 85 + (yOffset * 25), 4005, 4007, 10001, GumpButtonType.Reply, 0);
            AddHtmlLocalized(63, 87 + (yOffset * 25), 150, 18, 1114248, LabelColor, false, false);       //Casting
            yOffset += 1;

            if (itemRef == 1 || itemRef == 2 || itemRef == 4 || itemRef == 6)
            {
                AddButton(22, 85 + (yOffset * 25), 4005, 4007, 10002, GumpButtonType.Reply, 0);
                AddHtmlLocalized(63, 87 + (yOffset * 25), 150, 18, 1114249, LabelColor, false, false);   //Combat
                yOffset += 1;
            }

            if (itemRef == 1 || itemRef == 2)
            {
                AddButton(22, 85 + (yOffset * 25), 4005, 4007, 10006, GumpButtonType.Reply, 0);
                AddHtmlLocalized(63, 87 + (yOffset * 25), 150, 18, 1114250, LabelColor, false, false);   //Hit Area Effects
                yOffset += 1;

                AddButton(22, 85 + (yOffset * 25), 4005, 4007, 10007, GumpButtonType.Reply, 0);
                AddHtmlLocalized(63, 87 + (yOffset * 25), 150, 18, 1114251, LabelColor, false, false);   //Hit Effects
                yOffset += 1;
            }

            AddButton(22, 85 + (yOffset * 25), 4005, 4007, 10003, GumpButtonType.Reply, 0);
            AddHtmlLocalized(63, 87 + (yOffset * 25), 150, 18, 1114252, LabelColor, false, false);       //Misc.
            yOffset += 1;

            if (itemRef == 1 || itemRef == 2 || itemRef == 3 || itemRef == 5 || itemRef == 6)
            {
                AddButton(22, 85 + (yOffset * 25), 4005, 4007, 10004, GumpButtonType.Reply, 0);
                AddHtmlLocalized(63, 87 + (yOffset * 25), 150, 18, 1114254, LabelColor, false, false);   //Resistns
                yOffset += 1;
            }

            if (itemRef == 2 || itemRef == 3 || itemRef == 5 || itemRef == 6)
            {
                AddButton(22, 85 + (yOffset * 25), 4005, 4007, 10005, GumpButtonType.Reply, 0);
                AddHtmlLocalized(63, 87 + (yOffset * 25), 150, 18, 1114262, LabelColor, false, false);   //Stats
                yOffset += 1;
            }

            if (itemRef == 1 || itemRef == 2)
            {
                AddButton(22, 85 + (yOffset * 25), 4005, 4007, 10008, GumpButtonType.Reply, 0);
                AddHtmlLocalized(63, 87 + (yOffset * 25), 150, 18, 1114263, LabelColor, false, false);   //Slayers
                yOffset += 1;

                AddButton(22, 85 + (yOffset * 25), 4005, 4007, 10009, GumpButtonType.Reply, 0);
                AddHtmlLocalized(63, 87 + (yOffset * 25), 150, 18, 1114264, LabelColor, false, false);   //Super Slayers
                yOffset += 1;
            }

            if (itemRef == 6)
            {
                for (int i = 0; i < 5; i++)
                {
                    AddButton(22, 85 + (yOffset * 25), 4005, 4007, 10010 + i, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(63, 87 + (yOffset * 25), 150, 18, 1114255 + i, LabelColor, false, false);       //Skill Group 1
                    yOffset += 1;
                }
            }

            // ===== Attribute Catagories ========================================
            yOffset = 0;
            int menuCat = context.ImbMenu_Cat;

            AddLabel(347, 50, 1359, "SELECTIONS");

            if (menuCat == 1) // == CASTING ==
            {
                if (itemRef == 1)
                {
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10122, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079766, LabelColor, false, false);       //Spell Channeling
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10141, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079759, LabelColor, false, false);       //Mage Weapon
                    yOffset += 1;

                    if (item is BaseWeapon && (((BaseWeapon)item).Attributes.SpellChanneling == 0 || ((BaseWeapon)item).Attributes.CastSpeed < 0))
                    {
                        AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10116, GumpButtonType.Reply, 0);
                        AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075617, LabelColor, false, false);       //Faster Casting
                        yOffset += 1;
                    }
                }
                else if (itemRef == 2)
                {
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10122, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079766, LabelColor, false, false);       //Spell Channeling
                    yOffset += 1;

                    if (item is BaseWeapon && (((BaseWeapon)item).Attributes.SpellChanneling == 0 || ((BaseWeapon)item).Attributes.CastSpeed < 0))
                    {
                        AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10116, GumpButtonType.Reply, 0);
                        AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075617, LabelColor, false, false);       //Faster Casting
                    }
                    yOffset += 1;
                }
                else if (itemRef == 3)
                {
                    BaseArmor Ar = m_Item as BaseArmor;
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10117, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075621, LabelColor, false, false);       //Lower Mana Cost
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10118, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075625, LabelColor, false, false);       //Lower Reg Cost
                    yOffset += 1;
                }
                else if (itemRef == 4)
                {
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10122, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079766, LabelColor, false, false);       //Spell Channeling
                    yOffset += 1;

                    if (item is BaseShield && (((BaseShield)item).Attributes.SpellChanneling == 0 || ((BaseShield)item).Attributes.CastSpeed < 0))
                    {
                        AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10116, GumpButtonType.Reply, 0);
                        AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075617, LabelColor, false, false);       //Faster Casting
                        yOffset += 1;
                    }
                }
                else if (itemRef == 5)
                {
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10117, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075621, LabelColor, false, false);       //Lower Mana Cost
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10118, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075625, LabelColor, false, false);       //Lower Reg Cost
                    yOffset += 1;
                }
                else if (itemRef == 6)
                {
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10117, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075621, LabelColor, false, false);       //Lower Mana Cost
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10118, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075625, LabelColor, false, false);       //Lower Reg Cost
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10114, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075628, LabelColor, false, false);       //Spell Damage Increase
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10116, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075617, LabelColor, false, false);       //Faster Casting
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10115, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075618, LabelColor, false, false);       //Faster Cast Recovery
                    yOffset += 1;
                }
            }
            else if (menuCat == 2) // == COMBAT ==
            {
                if (itemRef == 1 || itemRef == 2)
                {
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10112, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075619, LabelColor, false, false);       //Weapon Damage Increase
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10101, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075620, LabelColor, false, false);       //Defense Chance Increase
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10102, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075616, LabelColor, false, false);       //Hit Chance Increase
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10113, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075629, LabelColor, false, false);       //Swing Speed Increase
                    yOffset += 1;

                    if (itemRef == 1)
                    {
                        AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10140, GumpButtonType.Reply, 0);
                        AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079592, LabelColor, false, false);   //Use Best Weapon Skill
                        yOffset += 1;
                    }
                    if (itemRef == 2)
                    {
                        AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10160, GumpButtonType.Reply, 0);
                        AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1080416, LabelColor, false, false);   //Velocity
                        yOffset += 1;
                    }

                    if (ranged)
                    {
                        AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10161, GumpButtonType.Reply, 0);
                        AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1072792, LabelColor, false, false);   //Balanced
                        yOffset += 1;
                    }
                }
                else if (itemRef == 4)
                {
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10101, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075620, LabelColor, false, false);       //Defense Chance Increase
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10102, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075616, LabelColor, false, false);       //Hit Chance Increase
                    yOffset += 1;
                }
                else if (itemRef == 6)
                {
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10112, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075619, LabelColor, false, false);       //Weapon Damage Increase
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10101, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075620, LabelColor, false, false);       //Defense Chance Increase
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10102, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075616, LabelColor, false, false);       //Hit Chance Increase
                    yOffset += 1;
                }
            }
            else if (menuCat == 3)  // == MISC ==
            {
                if (itemRef == 1 || itemRef == 2)
                {
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10121, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1061153, LabelColor, false, false);       //Luck
                    yOffset += 1;
                }
                else if (itemRef == 3)
                {
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10119, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075626, LabelColor, false, false);       //Reflect Physical Damage
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10121, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1061153, LabelColor, false, false);       //Luck
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10123, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1015168, LabelColor, false, false);       //Night Sight
                    yOffset += 1;
                }
                else if (itemRef == 4)
                {
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10119, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075626, LabelColor, false, false);       //Reflect Physical Damage
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10121, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079757, LabelColor, false, false);       //Lower Requirements
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10142, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1017323, LabelColor, false, false);       //Durability
                    yOffset += 1;
                }
                else if (itemRef == 5)
                {
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10119, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075626, LabelColor, false, false);       //Reflect Physical Damage
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10121, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1061153, LabelColor, false, false);       //Luck
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10123, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1015168, LabelColor, false, false);       //Night Sight
                    yOffset += 1;
                }
                else if (itemRef == 6)
                {
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10121, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1061153, LabelColor, false, false);       //Luck
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10123, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1015168, LabelColor, false, false);       //Night Sight
                    yOffset += 1;

                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10120, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075624, LabelColor, false, false);       //Enhance Potions
                    yOffset += 1;
                }
            }
            else if (menuCat == 4) // == RESISTS ==
            {
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10151, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1061158, LabelColor, false, false);           //Physcial Resist
                yOffset += 1;

                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10152, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1061159, LabelColor, false, false);           //Fire Resist
                yOffset += 1;

                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10153, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1061160, LabelColor, false, false);           //Cold Resist
                yOffset += 1;

                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10154, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1061161, LabelColor, false, false);           //Poison Resist
                yOffset += 1;

                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10155, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1061162, LabelColor, false, false);           //Energy Resist
                yOffset += 1;
            }
            else if (menuCat == 5)  // == STATS ==
            {
                if (itemRef == 3)
                {
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10109, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075630, LabelColor, false, false);       //Hit Point Increase
                    yOffset += 1;
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10110, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075632, LabelColor, false, false);       //Stamina Increase
                    yOffset += 1;
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10111, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075631, LabelColor, false, false);       //Mana Increaase
                    yOffset += 1;
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10103, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075627, LabelColor, false, false);       //Hit Points Regeneration
                    yOffset += 1;
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10104, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079411, LabelColor, false, false);       //Stamina Regeneration
                    yOffset += 1;
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10105, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079410, LabelColor, false, false);       //Mana Regeneration
                    yOffset += 1;
                }
                else if (itemRef == 5)
                {
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10109, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075630, LabelColor, false, false);       //Hit Point Increase
                    yOffset += 1;
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10110, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075632, LabelColor, false, false);       //Stamina Increase
                    yOffset += 1;
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10111, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075631, LabelColor, false, false);       //Mana Increaase
                    yOffset += 1;
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10103, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1075627, LabelColor, false, false);                   //Hit Points Regeneration
                    yOffset += 1;
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10104, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079411, LabelColor, false, false);       //Stamina Regeneration
                    yOffset += 1;
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10105, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079410, LabelColor, false, false);       //Mana Regeneration
                    yOffset += 1;
                }
                else if (itemRef == 6)
                {
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10106, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079767, LabelColor, false, false);       //Strength Bonus
                    yOffset += 1;
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10107, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079732, LabelColor, false, false);       //Dexterity Bonus
                    yOffset += 1;
                    AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10108, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079756, LabelColor, false, false);       //Intelligence Bonus
                    yOffset += 1;
                }
            }
            else if (menuCat == 6)  // == HIT AREA EFFECTS ==
            {
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10130, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079696, LabelColor, false, false);           //Hit Physical Area
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10131, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079695, LabelColor, false, false);           //Hit Fire Area
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10132, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079693, LabelColor, false, false);           //Hit Cold Area
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10133, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079697, LabelColor, false, false);           //Hit Poison Area
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10134, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079694, LabelColor, false, false);           //Hit Energy Area
                yOffset += 1;
            }
            else if (menuCat == 7)  // == ON HIT EFFECTS ==
            {
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10135, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079706, LabelColor, false, false);           //Hit Magic Arrow
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10136, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079704, LabelColor, false, false);           //Hit Harm
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10137, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079703, LabelColor, false, false);           //Hit Fireball
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10138, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079705, LabelColor, false, false);           //Hit Lightning
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10139, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079702, LabelColor, false, false);           //Hit Dispel
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10128, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079699, LabelColor, false, false);           //Hit Lower Attack
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10129, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079700, LabelColor, false, false);           //Hit Lower Defense
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10125, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079698, LabelColor, false, false);           //Hit Life Leeach
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10126, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079707, LabelColor, false, false);            // Hit Stam Leech
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10127, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1079701, LabelColor, false, false);           //Hit Mana Leech
                yOffset += 1;
            }
            else if (menuCat == 8)  // == SLAYERS ==
            {
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10201, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060470, LabelColor, false, false);           //Orc Slaying
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10202, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060480, LabelColor, false, false);           //Troll Slaughter
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10203, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060468, LabelColor, false, false);           //Ogre Thrashing
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10204, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060462, LabelColor, false, false);           //Dragon Slaying
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10205, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060478, LabelColor, false, false);           //Terathean
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10206, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060475, LabelColor, false, false);           //Snakes Bane
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10207, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060467, LabelColor, false, false);           //Lizardman Slaughter
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10208, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060466, LabelColor, false, false);           //Gargoyles Foe
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10211, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060469, LabelColor, false, false);           //Ophidian
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10212, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060477, LabelColor, false, false);           //Spiders Death
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10213, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060474, LabelColor, false, false);           //Scorpians Bane
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10214, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060465, LabelColor, false, false);           //Flame Dousing
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10215, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060481, LabelColor, false, false);           //Water Dissipation
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10216, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060457, LabelColor, false, false);           //Vacuum
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10217, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060471, LabelColor, false, false);           //Elemental Health
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10218, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060463, LabelColor, false, false);           //Earth Shatter
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10219, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060459, LabelColor, false, false);           //Blood Drinking
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10220, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060476, LabelColor, false, false);           //Summer Wind
                yOffset += 1;
            }
            else if (menuCat == 9)  // == SUPER SLAYERS ==
            {
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10221, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060479, LabelColor, false, false);           //Silver
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10222, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060472, LabelColor, false, false);           //Repond
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10223, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060473, LabelColor, false, false);           //Reptilian Death
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10224, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060460, LabelColor, false, false);           //Exorcism
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10225, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060458, LabelColor, false, false);           //Arachnid Doom
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10226, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1060464, LabelColor, false, false);           //Elemental Ban
                yOffset += 1;
            }
            else if (menuCat == 10)  // == SKILL GROUP 1 ==
            {
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10251, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044102, LabelColor, false, false);           //Fencing
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10252, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044101, LabelColor, false, false);           //Mace Fighting
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10253, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044100, LabelColor, false, false);           //Swordsmanship
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10254, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044089, LabelColor, false, false);           //Musicianship
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10255, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044085, LabelColor, false, false);           //Magery
                yOffset += 1;
            }
            else if (menuCat == 11)  // == SKILL GROUP 2 ==
            {
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10256, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044103, LabelColor, false, false);           //Wrestling
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10257, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044095, LabelColor, false, false);           //Animal Taming
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10258, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044092, LabelColor, false, false);           //Spirit Speak
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10259, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044087, LabelColor, false, false);           //Tactics
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10260, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044082, LabelColor, false, false);           //Provocation
                yOffset += 1;
            }
            else if (menuCat == 12)  // == SKILL GROUP 3 ==
            {
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10261, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044110, LabelColor, false, false);           //Focus
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10262, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044065, LabelColor, false, false);           //Parrying
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10263, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044107, LabelColor, false, false);           //Stealth
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10264, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044106, LabelColor, false, false);           //Meditation
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10265, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044062, LabelColor, false, false);           //Animal Lore
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10266, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044075, LabelColor, false, false);           //Discordance
                yOffset += 1;
            }
            else if (menuCat == 13)  // == SKILL GROUP 4 ==
            {
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10267, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044115, LabelColor, false, false);           //Mysticism
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10268, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044112, LabelColor, false, false);           //Bushido
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10269, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044109, LabelColor, false, false);           //Necromancy
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10270, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044099, LabelColor, false, false);           //Veterinary
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10271, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044093, LabelColor, false, false);           //Stealing
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10272, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044076, LabelColor, false, false);           //Eval Intelligence
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10273, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044061, LabelColor, false, false);           //Anatomy
                yOffset += 1;
            }
            else if (menuCat == 14)  // == SKILL GROUP 5 ==
            {
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10274, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044069, LabelColor, false, false);           //Peacemaking
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10275, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044113, LabelColor, false, false);           //Ninjitsu
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10276, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044111, LabelColor, false, false);           //Chivalary
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10277, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044091, LabelColor, false, false);           //Archery
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10278, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044086, LabelColor, false, false);           //Resist Spells
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10279, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044077, LabelColor, false, false);          //Healing
                yOffset += 1;
                AddButton(258, 85 + (yOffset * 25), 4005, 4007, 10280, GumpButtonType.Reply, 0);
                AddHtmlLocalized(299, 87 + (yOffset * 25), 150, 18, 1044117, LabelColor, false, false);          //Throwing
                yOffset += 1;
            }

            AddButton(19, 550, 4005, 4007, 10099, GumpButtonType.Reply, 0);
            AddHtmlLocalized(58, 551, 150, 20, 1011012, LabelColor, false, false); //Cancel
        }
Exemplo n.º 11
0
        // =========== Check if Choosen Attribute Replaces Another =================
        public static TextDefinition WhatReplacesWhat(int id, Item item)
        {
            if (Imbuing.GetValueForID(item, id) > 0)
            {
                return(ItemPropertyInfo.GetAttributeName(id));
            }

            if (item is BaseWeapon)
            {
                BaseWeapon i = item as BaseWeapon;

                // Slayers replace Slayers
                if (id >= 101 && id <= 127)
                {
                    if (i.Slayer != SlayerName.None)
                    {
                        return(GetNameForAttribute(i.Slayer));
                    }

                    if (i.Slayer2 != SlayerName.None)
                    {
                        return(GetNameForAttribute(i.Slayer2));
                    }
                }
                // OnHitEffect replace OnHitEffect
                if (id >= 35 && id <= 39)
                {
                    if (i.WeaponAttributes.HitMagicArrow > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitMagicArrow));
                    }
                    else if (i.WeaponAttributes.HitHarm > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitHarm));
                    }
                    else if (i.WeaponAttributes.HitFireball > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitFireball));
                    }
                    else if (i.WeaponAttributes.HitLightning > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitLightning));
                    }
                    else if (i.WeaponAttributes.HitDispel > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitDispel));
                    }
                }
                // OnHitArea replace OnHitArea
                if (id >= 30 && id <= 34)
                {
                    if (i.WeaponAttributes.HitPhysicalArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitPhysicalArea));
                    }
                    else if (i.WeaponAttributes.HitColdArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitFireArea));
                    }
                    else if (i.WeaponAttributes.HitFireArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitColdArea));
                    }
                    else if (i.WeaponAttributes.HitPoisonArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitPoisonArea));
                    }
                    else if (i.WeaponAttributes.HitEnergyArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitEnergyArea));
                    }
                }
            }
            if (item is BaseJewel)
            {
                BaseJewel jewel = item as BaseJewel;

                if (id >= 151 && id <= 183)
                {
                    AosSkillBonuses bonuses = jewel.SkillBonuses;
                    SkillName[]     group   = Imbuing.GetSkillGroup((SkillName)ItemPropertyInfo.GetAttribute(id));

                    for (int i = 0; i < 5; i++)
                    {
                        if (bonuses.GetBonus(i) > 0 && group.Any(sk => sk == bonuses.GetSkill(i)))
                        {
                            return(GetNameForAttribute(bonuses.GetSkill(i)));
                        }
                    }
                }

                // SkillGroup1 replace SkillGroup1

                /*if (id >= 151 && id <= 155)
                 * {
                 *  if (i.SkillBonuses.GetBonus(0) > 0)
                 *  {
                 *      foreach (SkillName sk in Imbuing.PossibleSkills)
                 *      {
                 *          if (i.SkillBonuses.GetSkill(0) == sk)
                 *              return GetNameForAttribute(sk);
                 *      }
                 *  }
                 * }
                 * // SkillGroup2 replace SkillGroup2
                 * if (id >= 156 && id <= 160)
                 * {
                 *  if (i.SkillBonuses.GetBonus(1) > 0)
                 *  {
                 *      foreach (SkillName sk in Imbuing.PossibleSkills)
                 *      {
                 *          if (i.SkillBonuses.GetSkill(1) == sk)
                 *              return GetNameForAttribute(sk);
                 *      }
                 *  }
                 * }
                 * // SkillGroup3 replace SkillGroup3
                 * if (id >= 161 && id <= 166)
                 * {
                 *  if (i.SkillBonuses.GetBonus(2) > 0)
                 *  {
                 *      foreach (SkillName sk in Imbuing.PossibleSkills)
                 *      {
                 *          if (i.SkillBonuses.GetSkill(2) == sk)
                 *              return GetNameForAttribute(sk);
                 *      }
                 *  }
                 * }
                 * // SkillGroup4 replace SkillGroup4
                 * if (id >= 167 && id <= 172)
                 * {
                 *  if (i.SkillBonuses.GetBonus(3) > 0)
                 *  {
                 *      foreach (SkillName sk in Imbuing.PossibleSkills)
                 *      {
                 *          if (i.SkillBonuses.GetSkill(3) == sk)
                 *              return GetNameForAttribute(sk);
                 *      }
                 *  }
                 * }
                 * // SkillGroup5 replace SkillGroup5
                 * if (id >= 173 && id <= 178)
                 * {
                 *  if (i.SkillBonuses.GetBonus(4) > 0)
                 *  {
                 *      foreach (SkillName sk in Imbuing.PossibleSkills)
                 *      {
                 *          if (i.SkillBonuses.GetSkill(4) == sk)
                 *              return GetNameForAttribute(sk);
                 *      }
                 *  }
                 * }*/
            }

            return(null);
        }
Exemplo n.º 12
0
        public ImbuingGumpC(Mobile from, Item item, int mod, int value) : base(520, 340)
        {
            PlayerMobile m = from as PlayerMobile;

            from.CloseGump(typeof(ImbuingGump));
            from.CloseGump(typeof(ImbuingGumpB));
            from.CloseGump(typeof(RunicReforgingGump));

            // SoulForge Check
            if (!Imbuing.CheckSoulForge(from, 1))
            {
                return;
            }

            ImbuingContext context = Imbuing.GetContext(m);

            // = Check Type of Ingredients Needed
            if (!Imbuing.Table.ContainsKey(mod))
            {
                return;
            }

            m_Definition = Imbuing.Table[mod];

            if (value == -1)
            {
                value = m_Definition.IncAmount;
            }

            m_Item  = item;
            m_Mod   = mod;
            m_Value = value;

            int maxInt = Imbuing.GetMaxIntensity(item, m_Definition);
            int inc    = m_Definition.IncAmount;
            int weight = m_Definition.Weight;

            if (m_Item is BaseJewel && m_Mod == 12)
            {
                maxInt /= 2;
            }

            if (m_Value < inc)
            {
                m_Value = inc;
            }
            if (m_Value > maxInt)
            {
                m_Value = maxInt;
            }

            if (m_Value <= 0)
            {
                m_Value = 1;
            }

            double currentIntensity = Math.Floor((m_Value / (double)maxInt) * 100);

            //Set context
            context.LastImbued     = item;
            context.Imbue_Mod      = mod;
            context.Imbue_ModVal   = weight;
            context.ImbMenu_ModInc = inc;
            context.Imbue_ModInt   = value;

            // - Current Mod Weight
            m_TotalItemWeight = Imbuing.GetTotalWeight(m_Item, m_Mod);
            m_TotalProps      = Imbuing.GetTotalMods(m_Item, m_Mod);

            if (maxInt <= 1)
            {
                currentIntensity = 100;
            }

            m_PropWeight = (int)Math.Floor(((double)weight / (double)maxInt) * m_Value);

            // - Maximum allowed Property Weight & Item Mod Count
            m_MaxWeight = Imbuing.GetMaxWeight(m_Item);

            // = Times Item has been Imbued
            int timesImbued = 0;

            if (m_Item is BaseWeapon)
            {
                timesImbued = ((BaseWeapon)m_Item).TimesImbued;
            }
            if (m_Item is BaseArmor)
            {
                timesImbued = ((BaseArmor)m_Item).TimesImbued;
            }
            if (m_Item is BaseJewel)
            {
                timesImbued = ((BaseJewel)m_Item).TimesImbued;
            }
            if (m_Item is BaseHat)
            {
                timesImbued = ((BaseHat)m_Item).TimesImbued;
            }

            // = Check Ingredients needed at the current Intensity
            m_GemAmount     = Imbuing.GetGemAmount(m_Item, m_Mod, m_Value);
            m_PrimResAmount = Imbuing.GetPrimaryAmount(m_Item, m_Mod, m_Value);
            m_SpecResAmount = Imbuing.GetSpecialAmount(m_Item, m_Mod, m_Value);

            // ------------------------------ Gump Menu -------------------------------------------------------------
            AddPage(0);
            AddBackground(0, 0, 540, 450, 5054);
            AddImageTiled(10, 10, 520, 430, 2624);

            AddImageTiled(10, 35, 520, 10, 5058);
            AddImageTiled(260, 45, 15, 290, 5058);
            AddImageTiled(10, 185, 520, 10, 5058);
            AddImageTiled(10, 335, 520, 10, 5058);
            AddImageTiled(10, 405, 520, 10, 5058);

            AddAlphaRegion(10, 10, 520, 430);

            AddHtmlLocalized(10, 13, 520, 18, 1079717, LabelColor, false, false); //<CENTER>IMBUING CONFIRMATION</CENTER>
            AddHtmlLocalized(57, 49, 200, 18, 1114269, LabelColor, false, false); //PROPERTY INFORMATION

            // - Attribute to Imbue
            AddHtmlLocalized(30, 80, 80, 17, 1114270, LabelColor, false, false);  //Property:
            AddHtmlLocalized(100, 80, 150, 17, m_Definition.AttributeName, LabelColor, false, false);

            // - Weight Modifier
            AddHtmlLocalized(30, 120, 80, 17, 1114272, 0xFFFFFF, false, false);   //Weight:

            double w = (double)m_Definition.Weight / 100.0;

            AddHtml(90, 120, 80, 17, String.Format("<BASEFONT COLOR=#CCCCFF> {0}x", w), false, false);

            AddHtmlLocalized(30, 140, 80, 17, 1114273, LabelColor, false, false);   //Intensity:
            AddHtml(90, 140, 80, 17, String.Format("<BASEFONT COLOR=#CCCCFF> {0}%", currentIntensity), false, false);

            // - Materials needed
            AddHtmlLocalized(10, 199, 255, 18, 1044055, LabelColor, false, false); //<CENTER>MATERIALS</CENTER>
            AddHtmlLocalized(40, 230, 180, 17, m_Definition.PrimaryName, LabelColor, false, false);
            AddHtml(210, 230, 40, 17, String.Format("<BASEFONT COLOR=#CCCCFF> {0}", m_PrimResAmount.ToString()), false, false);
            AddHtmlLocalized(40, 255, 180, 17, m_Definition.GemName, LabelColor, false, false);
            AddHtml(210, 255, 40, 17, String.Format("<BASEFONT COLOR=#CCCCFF> {0}", m_GemAmount.ToString()), false, false);
            if (m_SpecResAmount > 0)
            {
                AddHtmlLocalized(40, 280, 180, 17, m_Definition.SpecialName, LabelColor, false, false);
                AddHtml(210, 280, 40, 17, String.Format("<BASEFONT COLOR=#CCCCFF> {0}", m_SpecResAmount.ToString()), false, false);
            }

            // - Mod Description
            AddHtmlLocalized(290, 65, 215, 110, m_Definition.Description, LabelColor, false, false);

            AddHtmlLocalized(365, 199, 150, 18, 1113650, LabelColor, false, false); //RESULTS

            AddHtmlLocalized(288, 220, 150, 17, 1113645, LabelColor, false, false); //Properties:
            AddHtml(443, 220, 80, 17, String.Format("<BASEFONT COLOR=#CCFFCC> {0}/5", m_TotalProps + 1), false, false);
            AddHtmlLocalized(288, 240, 150, 17, 1113646, LabelColor, false, false); //Total Property Weight:
            AddHtml(443, 240, 80, 17, String.Format("<BASEFONT COLOR=#CCFFCC> {0}/{1}", m_TotalItemWeight + (int)m_PropWeight, m_MaxWeight), false, false);

            // - Times Imbued
            AddHtmlLocalized(288, 260, 150, 17, 1113647, LabelColor, false, false);                                   //Times Imbued:
            AddHtml(443, 260, 80, 17, String.Format("<BASEFONT COLOR=#CCFFCC> {0}/20", timesImbued + 1), false, false);

            // - Name of Attribute to be Replaced
            int replace = WhatReplacesWhat(m_Mod, m_Item);

            AddHtmlLocalized(30, 100, 80, 17, 1114271, LabelColor, false, false);
            if (replace <= 0)
            {
                replace = m_Definition.AttributeName;
            }

            AddHtmlLocalized(100, 100, 150, 17, replace, LabelColor, false, false);

            // ===== CALCULATE DIFFICULTY =====
            double dif;
            double suc = Imbuing.GetSuccessChance(from, item, m_TotalItemWeight, m_PropWeight, out dif);

            int    Succ = Convert.ToInt32(suc);
            string color;

            // = Imbuing Success Chance %
            AddHtmlLocalized(305, 300, 150, 17, 1044057, 0xFFFFFF, false, false);
            if (Succ <= 1)
            {
                color = "#FF5511";
            }
            else if (Succ > 1 && Succ < 10)
            {
                color = "#EE6611";
            }
            else if (Succ >= 10 && Succ < 20)
            {
                color = "#DD7711";
            }
            else if (Succ >= 20 && Succ < 30)
            {
                color = "#CC8811";
            }
            else if (Succ >= 30 && Succ < 40)
            {
                color = "#BB9911";
            }
            else if (Succ >= 40 && Succ < 50)
            {
                color = "#AAAA11";
            }
            else if (Succ >= 50 && Succ < 60)
            {
                color = "#99BB11";
            }
            else if (Succ >= 60 && Succ < 70)
            {
                color = "#88CC11";
            }
            else if (Succ >= 70 && Succ < 80)
            {
                color = "#77DD11";
            }
            else if (Succ >= 80 && Succ < 90)
            {
                color = "#66EE11";
            }
            else if (Succ >= 90 && Succ < 100)
            {
                color = "#55FF11";
            }
            else if (Succ >= 100)
            {
                color = "#01FF01";
            }
            else
            {
                color = "#FFFFFF";
            }

            if (suc > 100)
            {
                suc = 100;
            }
            if (suc < 0)
            {
                suc = 0;
            }

            AddHtml(430, 300, 80, 17, String.Format("<BASEFONT COLOR={0}>\t{1}%", color, suc), false, false);

            // - Attribute Level
            if (maxInt > 1)
            {
                // - Set Intesity to Minimum
                if (m_Value <= 0)
                {
                    m_Value = 1;
                }

                // = New Value:
                AddHtmlLocalized(245, 350, 100, 17, 1062300, LabelColor, false, false);
                // - Mage Weapon Value ( i.e [Mage Weapon -25] )
                if (m_Mod == 41)
                {
                    AddHtml(254, 374, 50, 17, String.Format("<BASEFONT COLOR=#CCCCFF> -{0}", 30 - m_Value), false, false);
                }
                // - Show Property Value as % ( i.e [Hit Fireball 25%] )
                else if (maxInt <= 8 || m_Mod == 21 || m_Mod == 17)
                {
                    AddHtml(254, 374, 50, 17, String.Format("<BASEFONT COLOR=#CCCCFF> {0}", m_Value), false, false);
                }
                // - Show Property Value as just Number ( i.e [Mana Regen 2] )
                else
                {
                    AddHtml(254, 374, 50, 17, String.Format("<BASEFONT COLOR=#CCCCFF> {0}%", m_Value), false, false);
                }

                // == Buttons ==
                //0x1467???
                AddButton(192, 376, 5230, 5230, 10053, GumpButtonType.Reply, 0); // To Minimum Value
                AddButton(211, 376, 5230, 5230, 10052, GumpButtonType.Reply, 0); // Dec Value by %
                AddButton(230, 376, 5230, 5230, 10051, GumpButtonType.Reply, 0); // dec value by 1

                AddButton(331, 376, 5230, 5230, 10056, GumpButtonType.Reply, 0); //To Maximum Value
                AddButton(312, 376, 5230, 5230, 10055, GumpButtonType.Reply, 0); // Inc Value by %
                AddButton(293, 376, 5230, 5230, 10054, GumpButtonType.Reply, 0); // inc Value by 1

                AddLabel(341, 374, 0, ">");
                AddLabel(337, 374, 0, ">");
                AddLabel(333, 374, 0, ">");

                AddLabel(320, 374, 0, ">");
                AddLabel(316, 374, 0, ">");

                AddLabel(298, 374, 0, ">");

                AddLabel(235, 374, 0, "<");

                AddLabel(216, 374, 0, "<");
                AddLabel(212, 374, 0, "<");

                AddLabel(199, 374, 0, "<");
                AddLabel(195, 374, 0, "<");
                AddLabel(191, 374, 0, "<");
            }

            AddButton(19, 416, 4005, 4007, 10099, GumpButtonType.Reply, 0);
            AddHtmlLocalized(58, 417, 100, 18, 1114268, LabelColor, false, false);            //Back

            AddButton(400, 416, 4005, 4007, 10100, GumpButtonType.Reply, 0);
            AddHtmlLocalized(439, 417, 120, 18, 1114267, LabelColor, false, false);         //Imbue Item
        }
Exemplo n.º 13
0
        protected override void OnTarget(Mobile from, object o)
        {
            int number = -1;

            Item      origItem = o as Item;
            SkillName skill    = m_System.MainSkill;
            double    value    = from.Skills[skill].Value;

            AlterableAttribute alterInfo = GetAlterableAttribute(o, false);

            if (alterInfo == null)
            {
                alterInfo = GetAlterableAttribute(o, true);
            }

            if (origItem == null || !origItem.IsChildOf(from.Backpack))
            {
                number = 1094729; // The item must be in your backpack for you to alter it.
            }
            else if (origItem is BlankScroll)
            {
                if (m_Contract == null)
                {
                    if (value >= 100.0)
                    {
                        Item contract = null;

                        if (skill == SkillName.Blacksmith)
                        {
                            contract = new AlterContract(RepairSkillType.Smithing, from);
                        }
                        else if (skill == SkillName.Carpentry)
                        {
                            contract = new AlterContract(RepairSkillType.Carpentry, from);
                        }
                        else if (skill == SkillName.Tailoring)
                        {
                            contract = new AlterContract(RepairSkillType.Tailoring, from);
                        }
                        else if (skill == SkillName.Tinkering)
                        {
                            contract = new AlterContract(RepairSkillType.Tinkering, from);
                        }

                        if (contract != null)
                        {
                            from.AddToBackpack(contract);

                            number = 1044154; // You create the item.

                            // Consume a blank scroll
                            origItem.Consume();
                        }
                    }
                    else
                    {
                        number = 1111869; // You must be at least grandmaster level to create an alter service contract.
                    }
                }
                else
                {
                    number = 1094728; // You may not alter that item.
                }
            }
            else if (alterInfo == null)
            {
                number = 1094728; // You may not alter that item.
            }
            else if (!IsAlterable(origItem))
            {
                number = 1094728; // You may not alter that item.
            }
            else if (alterInfo.CraftSystem != m_System.GetType())
            {
                if (m_Tool != null)
                {
                    // You may not alter that item.
                    number = 1094728;
                }
                else
                {
                    // You cannot alter that item with this type of alter contract.
                    number = 1094793;
                }
            }
            else if (!Imbuing.CheckSoulForge(from, 2, false, false))
            {
                number = 1111867; // You must be near a soulforge to alter an item.
            }
            else if (m_Contract == null && value < 100.0)
            {
                number = 1111870; // You must be at least grandmaster level to alter an item.
            }
            else if (origItem is BaseWeapon weapon && weapon.EnchantedWeilder != null)
            {
                number = 1111849; // You cannot alter an item that is currently enchanted.
            }
Exemplo n.º 14
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;
                }
                else
                {
                    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;
                }
                else
                {
                    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;
            }
            }

            return;
        }
Exemplo n.º 15
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);
            }
Exemplo n.º 16
0
        // =========== Check if Choosen Attribute Replaces Another =================
        public static TextDefinition WhatReplacesWhat(int id, Item item)
        {
            if (Imbuing.GetValueForID(item, id) > 0)
            {
                return(ItemPropertyInfo.GetAttributeName(id));
            }

            if (item is BaseWeapon)
            {
                BaseWeapon i = item as BaseWeapon;

                // Slayers replace Slayers
                if (id >= 101 && id <= 127)
                {
                    if (i.Slayer != SlayerName.None)
                    {
                        return(GetNameForAttribute(i.Slayer));
                    }

                    if (i.Slayer2 != SlayerName.None)
                    {
                        return(GetNameForAttribute(i.Slayer2));
                    }
                }
                // OnHitEffect replace OnHitEffect
                if (id >= 35 && id <= 39)
                {
                    if (i.WeaponAttributes.HitMagicArrow > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitMagicArrow));
                    }
                    else if (i.WeaponAttributes.HitHarm > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitHarm));
                    }
                    else if (i.WeaponAttributes.HitFireball > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitFireball));
                    }
                    else if (i.WeaponAttributes.HitLightning > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitLightning));
                    }
                    else if (i.WeaponAttributes.HitDispel > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitDispel));
                    }
                }
                // OnHitArea replace OnHitArea
                if (id >= 30 && id <= 34)
                {
                    if (i.WeaponAttributes.HitPhysicalArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitPhysicalArea));
                    }
                    else if (i.WeaponAttributes.HitColdArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitFireArea));
                    }
                    else if (i.WeaponAttributes.HitFireArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitColdArea));
                    }
                    else if (i.WeaponAttributes.HitPoisonArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitPoisonArea));
                    }
                    else if (i.WeaponAttributes.HitEnergyArea > 0)
                    {
                        return(GetNameForAttribute(AosWeaponAttribute.HitEnergyArea));
                    }
                }
            }
            if (item is BaseJewel)
            {
                BaseJewel jewel = item as BaseJewel;

                if (id >= 151 && id <= 183)
                {
                    AosSkillBonuses bonuses = jewel.SkillBonuses;
                    SkillName[]     group   = Imbuing.GetSkillGroup((SkillName)ItemPropertyInfo.GetAttribute(id));

                    for (int i = 0; i < 5; i++)
                    {
                        if (bonuses.GetBonus(i) > 0 && group.Any(sk => sk == bonuses.GetSkill(i)))
                        {
                            return(GetNameForAttribute(bonuses.GetSkill(i)));
                        }
                    }
                }
            }

            return(null);
        }
Exemplo n.º 17
0
        public ImbuingGumpC(Mobile from, Item item, int mod, int value)
            : base(50, 50)
        {
            PlayerMobile m = from as PlayerMobile;

            from.CloseGump(typeof(ImbuingGump));
            from.CloseGump(typeof(ImbuingGumpB));
            from.CloseGump(typeof(RunicReforgingGump));

            // SoulForge Check
            if (!Imbuing.CheckSoulForge(from, 2))
            {
                return;
            }

            ImbuingContext context = Imbuing.GetContext(m);

            // Check Type of Ingredients Needed
            if (!Imbuing.Table.ContainsKey(mod))
            {
                return;
            }

            m_Definition = Imbuing.Table[mod];

            if (value == -1)
            {
                value = m_Definition.IncAmount;
            }

            m_Item  = item;
            m_Mod   = mod;
            m_Value = value;

            int maxInt = Imbuing.GetMaxIntensity(item, m_Definition);
            int inc    = m_Definition.IncAmount;
            int weight = m_Definition.Weight;

            if (m_Item is BaseJewel && m_Mod == 12)
            {
                maxInt /= 2;
            }

            if (m_Value < inc)
            {
                m_Value = inc;
            }
            if (m_Value > maxInt)
            {
                m_Value = maxInt;
            }

            if (m_Value <= 0)
            {
                m_Value = 1;
            }

            double currentIntensity = Math.Floor((m_Value / (double)maxInt) * 100);

            // Set context
            context.LastImbued     = item;
            context.Imbue_Mod      = mod;
            context.Imbue_ModVal   = weight;
            context.ImbMenu_ModInc = inc;
            context.Imbue_ModInt   = value;

            // Current Mod Weight
            m_TotalItemWeight = Imbuing.GetTotalWeight(m_Item, m_Mod);
            m_TotalProps      = Imbuing.GetTotalMods(m_Item, m_Mod);

            if (maxInt <= 1)
            {
                currentIntensity = 100;
            }

            m_PropWeight = (int)Math.Floor(((double)weight / (double)maxInt) * m_Value);

            // Maximum allowed Property Weight & Item Mod Count
            m_MaxWeight = Imbuing.GetMaxWeight(m_Item);

            // Times Item has been Imbued
            int timesImbued = Imbuing.TimesImbued(m_Item);

            // Check Ingredients needed at the current Intensity
            m_GemAmount     = Imbuing.GetGemAmount(m_Item, m_Mod, m_Value);
            m_PrimResAmount = Imbuing.GetPrimaryAmount(m_Item, m_Mod, m_Value);
            m_SpecResAmount = Imbuing.GetSpecialAmount(m_Item, m_Mod, m_Value);

            // ------------------------------ Gump Menu -------------------------------------------------------------
            AddPage(0);
            AddBackground(0, 0, 520, 440, 5054);
            AddImageTiled(10, 10, 500, 420, 2624);

            AddImageTiled(10, 30, 500, 10, 5058);
            AddImageTiled(250, 40, 10, 290, 5058);
            AddImageTiled(10, 180, 500, 10, 5058);
            AddImageTiled(10, 330, 500, 10, 5058);
            AddImageTiled(10, 400, 500, 10, 5058);

            AddAlphaRegion(10, 10, 500, 420);

            AddHtmlLocalized(10, 12, 520, 20, 1079717, LabelColor, false, false); // <CENTER>IMBUING CONFIRMATION</CENTER>
            AddHtmlLocalized(50, 50, 200, 20, 1114269, LabelColor, false, false); // PROPERTY INFORMATION

            AddHtmlLocalized(25, 80, 80, 20, 1114270, LabelColor, false, false);  // Property:
            AddHtmlLocalized(95, 80, 150, 20, m_Definition.AttributeName, LabelColor, false, false);

            AddHtmlLocalized(25, 100, 80, 20, 1114271, LabelColor, false, false); // Replaces:
            int replace = WhatReplacesWhat(m_Mod, m_Item);

            if (replace > 0)
            {
                AddHtmlLocalized(95, 100, 150, 20, replace, LabelColor, false, false);
            }

            // Weight Modifier
            AddHtmlLocalized(25, 120, 80, 20, 1114272, 0xFFFFFF, false, false); // Weight:
            AddLabel(95, 120, IceHue, String.Format("{0}x", ((double)m_Definition.Weight / 100.0).ToString("0.0")));

            AddHtmlLocalized(25, 140, 80, 20, 1114273, LabelColor, false, false); // Intensity:
            AddLabel(95, 140, IceHue, String.Format("{0}%", currentIntensity));

            // Materials needed
            AddHtmlLocalized(10, 200, 245, 20, 1044055, LabelColor, false, false); // <CENTER>MATERIALS</CENTER>

            AddHtmlLocalized(40, 230, 180, 20, m_Definition.PrimaryName, LabelColor, false, false);
            AddLabel(210, 230, IceHue, m_PrimResAmount.ToString());

            AddHtmlLocalized(40, 255, 180, 20, m_Definition.GemName, LabelColor, false, false);
            AddLabel(210, 255, IceHue, m_GemAmount.ToString());

            if (m_SpecResAmount > 0)
            {
                AddHtmlLocalized(40, 280, 180, 17, m_Definition.SpecialName, LabelColor, false, false);
                AddLabel(210, 280, IceHue, m_SpecResAmount.ToString());
            }

            // Mod Description
            AddHtmlLocalized(280, 55, 200, 110, m_Definition.Description, LabelColor, false, false);

            AddHtmlLocalized(350, 200, 150, 20, 1113650, LabelColor, false, false); // RESULTS

            AddHtmlLocalized(280, 220, 150, 20, 1113645, LabelColor, false, false); // Properties:
            AddLabel(430, 220, GetColor(m_TotalProps + 1, 5), String.Format("{0}/5", m_TotalProps + 1));

            int projWeight = m_TotalItemWeight + m_PropWeight;

            AddHtmlLocalized(280, 240, 150, 20, 1113646, LabelColor, false, false); // Total Property Weight:
            AddLabel(430, 240, GetColor(projWeight, m_MaxWeight), String.Format("{0}/{1}", projWeight, m_MaxWeight));

            AddHtmlLocalized(280, 260, 150, 20, 1113647, LabelColor, false, false); // Times Imbued:
            AddLabel(430, 260, GetColor(timesImbued, 20), String.Format("{0}/20", timesImbued));

            // ===== CALCULATE DIFFICULTY =====
            double dif;
            double suc = Imbuing.GetSuccessChance(from, item, m_TotalItemWeight, m_PropWeight, out dif);

            AddHtmlLocalized(300, 300, 150, 20, 1044057, 0xFFFFFF, false, false); // Success Chance:
            AddLabel(420, 300, GetSuccessChanceHue(suc), String.Format("{0}%", suc.ToString("0.0")));

            // - Attribute Level
            if (maxInt > 1)
            {
                // - Set Intesity to Minimum
                if (m_Value <= 0)
                {
                    m_Value = 1;
                }

                AddHtmlLocalized(235, 350, 100, 17, 1062300, LabelColor, false, false); // New Value:

                if (m_Mod == 41)                                                        // - Mage Weapon Value ( i.e [Mage Weapon -25] )
                {
                    AddLabel(250, 370, IceHue, String.Format("-{0}", 30 - m_Value));
                }
                else if (maxInt <= 8 || m_Mod == 21 || m_Mod == 17)  // - Show Property Value as just Number ( i.e [Mana Regen 2] )
                {
                    AddLabel(256, 370, IceHue, String.Format("{0}", m_Value));
                }
                else                                                 // - Show Property Value as % ( i.e [Hit Fireball 25%] )
                {
                    int val = m_Value;

                    if (m_Mod >= 51 && m_Mod <= 55 && item is BaseArmor)
                    {
                        var armor = (BaseArmor)item;
                        switch (m_Mod)
                        {
                        case 51: val += armor.BasePhysicalResistance; break;

                        case 52: val += armor.BaseFireResistance; break;

                        case 53: val += armor.BaseColdResistance; break;

                        case 54: val += armor.BasePoisonResistance; break;

                        case 55: val += armor.BaseEnergyResistance; break;
                        }
                    }

                    AddLabel(256, 370, IceHue, String.Format("{0}%", val));
                }

                // Buttons \\
                AddButton(179, 372, 0x1464, 0x1464, 10053, GumpButtonType.Reply, 0);
                AddButton(187, 372, 0x1466, 0x1466, 10053, GumpButtonType.Reply, 0);

                AddButton(199, 372, 0x1464, 0x1464, 10052, GumpButtonType.Reply, 0);
                AddButton(207, 372, 0x1466, 0x1466, 10052, GumpButtonType.Reply, 0);

                AddButton(221, 372, 0x1464, 0x1464, 10051, GumpButtonType.Reply, 0);
                AddButton(229, 372, 0x1466, 0x1466, 10051, GumpButtonType.Reply, 0);

                AddButton(280, 372, 0x1464, 0x1464, 10054, GumpButtonType.Reply, 0);
                AddButton(288, 372, 0x1466, 0x1466, 10054, GumpButtonType.Reply, 0);

                AddButton(300, 372, 0x1464, 0x1464, 10055, GumpButtonType.Reply, 0);
                AddButton(308, 372, 0x1466, 0x1466, 10055, GumpButtonType.Reply, 0);

                AddButton(320, 372, 0x1464, 0x1464, 10056, GumpButtonType.Reply, 0);
                AddButton(328, 372, 0x1466, 0x1466, 10056, GumpButtonType.Reply, 0);

                AddLabel(322, 370, 0, ">");
                AddLabel(326, 370, 0, ">");
                AddLabel(330, 370, 0, ">");

                AddLabel(304, 370, 0, ">");
                AddLabel(308, 370, 0, ">");

                AddLabel(286, 370, 0, ">");

                AddLabel(226, 370, 0, "<");

                AddLabel(203, 370, 0, "<");
                AddLabel(207, 370, 0, "<");

                AddLabel(181, 370, 0, "<");
                AddLabel(185, 370, 0, "<");
                AddLabel(189, 370, 0, "<");
            }

            AddButton(15, 410, 4005, 4007, 10099, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 410, 100, 18, 1114268, LabelColor, false, false); // Back

            AddButton(390, 410, 4005, 4007, 10100, GumpButtonType.Reply, 0);
            AddHtmlLocalized(425, 410, 120, 18, 1114267, LabelColor, false, false); // Imbue Item
        }
Exemplo n.º 18
0
        public override void AddGumpLayout()
        {
            // SoulForge Check
            if (!Imbuing.CheckSoulForge(User, 2))
            {
                return;
            }

            ImbuingContext context = Imbuing.GetContext(User);

            if (!ItemPropertyInfo.Table.ContainsKey(m_ID))
            {
                return;
            }

            m_Info = ItemPropertyInfo.Table[m_ID];

            int minInt = ItemPropertyInfo.GetMinIntensity(m_Item, m_ID);
            int maxInt = ItemPropertyInfo.GetMaxIntensity(m_Item, m_ID);
            int weight = m_Info.Weight;

            if (m_Value < minInt)
            {
                m_Value = minInt;
            }

            if (m_Value > maxInt)
            {
                m_Value = maxInt;
            }

            double currentIntensity = Math.Floor((m_Value / (double)maxInt) * 100);

            // Set context
            context.LastImbued     = m_Item;
            context.Imbue_Mod      = m_ID;
            context.Imbue_ModVal   = weight;
            context.ImbMenu_ModInc = ItemPropertyInfo.GetScale(m_Item, m_ID);

            // Current Mod Weight
            m_TotalItemWeight = Imbuing.GetTotalWeight(m_Item, m_ID);
            m_TotalProps      = Imbuing.GetTotalMods(m_Item, m_ID);

            if (maxInt <= 1)
            {
                currentIntensity = 100;
            }

            var propWeight = (int)Math.Floor(((double)weight / (double)maxInt) * m_Value);

            // Maximum allowed Property Weight & Item Mod Count
            m_MaxWeight = Imbuing.GetMaxWeight(m_Item);

            // Times Item has been Imbued
            int timesImbued = Imbuing.TimesImbued(m_Item);

            // Check Ingredients needed at the current Intensity
            var gemAmount     = Imbuing.GetGemAmount(m_Item, m_ID, m_Value);
            var primResAmount = Imbuing.GetPrimaryAmount(m_Item, m_ID, m_Value);
            var specResAmount = Imbuing.GetSpecialAmount(m_Item, m_ID, m_Value);

            AddPage(0);
            AddBackground(0, 0, 520, 440, 5054);
            AddImageTiled(10, 10, 500, 420, 2624);

            AddImageTiled(10, 30, 500, 10, 5058);
            AddImageTiled(250, 40, 10, 290, 5058);
            AddImageTiled(10, 180, 500, 10, 5058);
            AddImageTiled(10, 330, 500, 10, 5058);
            AddImageTiled(10, 400, 500, 10, 5058);

            AddAlphaRegion(10, 10, 500, 420);

            AddHtmlLocalized(10, 12, 520, 20, 1079717, LabelColor, false, false); // <CENTER>IMBUING CONFIRMATION</CENTER>
            AddHtmlLocalized(50, 50, 200, 20, 1114269, LabelColor, false, false); // PROPERTY INFORMATION

            AddHtmlLocalized(25, 80, 80, 20, 1114270, LabelColor, false, false);  // Property:

            if (m_Info.AttributeName != null)
            {
                AddHtmlLocalized(95, 80, 150, 20, 1114057, m_Info.AttributeName.ToString(), LabelColor, false, false);
            }

            AddHtmlLocalized(25, 100, 80, 20, 1114271, LabelColor, false, false); // Replaces:
            var replace = WhatReplacesWhat(m_ID, m_Item);

            if (replace != null)
            {
                AddHtmlLocalized(95, 100, 150, 20, 1114057, replace.ToString(), LabelColor, false, false);
            }

            // Weight Modifier
            AddHtmlLocalized(25, 120, 80, 20, 1114272, 0xFFFFFF, false, false); // Weight:
            AddLabel(95, 120, IceHue, String.Format("{0}x", ((double)m_Info.Weight / 100.0).ToString("0.0")));

            AddHtmlLocalized(25, 140, 80, 20, 1114273, LabelColor, false, false); // Intensity:
            AddLabel(95, 140, IceHue, String.Format("{0}%", currentIntensity));

            // Materials needed
            AddHtmlLocalized(10, 200, 245, 20, 1044055, LabelColor, false, false); // <CENTER>MATERIALS</CENTER>

            AddHtmlLocalized(40, 230, 180, 20, m_Info.PrimaryName, LabelColor, false, false);
            AddLabel(210, 230, IceHue, primResAmount.ToString());

            AddHtmlLocalized(40, 255, 180, 20, m_Info.GemName, LabelColor, false, false);
            AddLabel(210, 255, IceHue, gemAmount.ToString());

            if (specResAmount > 0)
            {
                AddHtmlLocalized(40, 280, 180, 17, m_Info.SpecialName, LabelColor, false, false);
                AddLabel(210, 280, IceHue, specResAmount.ToString());
            }

            // Mod Description
            AddHtmlLocalized(280, 55, 200, 110, m_Info.Description, LabelColor, false, false);

            AddHtmlLocalized(350, 200, 150, 20, 1113650, LabelColor, false, false); // RESULTS

            AddHtmlLocalized(280, 220, 150, 20, 1113645, LabelColor, false, false); // Properties:
            AddLabel(430, 220, GetColor(m_TotalProps + 1, 5), String.Format("{0}/{1}", m_TotalProps + 1, Imbuing.GetMaxProps(m_Item)));

            int projWeight = m_TotalItemWeight + propWeight;

            AddHtmlLocalized(280, 240, 150, 20, 1113646, LabelColor, false, false); // Total Property Weight:
            AddLabel(430, 240, GetColor(projWeight, m_MaxWeight), String.Format("{0}/{1}", projWeight, m_MaxWeight));

            AddHtmlLocalized(280, 260, 150, 20, 1113647, LabelColor, false, false); // Times Imbued:
            AddLabel(430, 260, GetColor(timesImbued, 20), String.Format("{0}/20", timesImbued));

            // ===== CALCULATE DIFFICULTY =====
            var truePropWeight  = (int)(((double)propWeight / (double)weight) * 100);
            var trueTotalWeight = Imbuing.GetTotalWeight(m_Item, -1, false);

            double dif;
            double suc = Imbuing.GetSuccessChance(User, m_Item, trueTotalWeight, truePropWeight, out dif);

            AddHtmlLocalized(300, 300, 150, 20, 1044057, 0xFFFFFF, false, false); // Success Chance:
            AddLabel(420, 300, GetSuccessChanceHue(suc), String.Format("{0}%", suc.ToString("0.0")));

            // - Attribute Level
            if (maxInt > 1)
            {
                AddHtmlLocalized(235, 350, 100, 17, 1062300, LabelColor, false, false); // New Value:

                if (m_ID == 41)                                                         // - Mage Weapon Value ( i.e [Mage Weapon -25] )
                {
                    AddLabel(250, 370, IceHue, String.Format("-{0}", 30 - m_Value));
                }
                else if (maxInt <= 8 || m_ID == 21 || m_ID == 17)                 // - Show Property Value as just Number ( i.e [Mana Regen 2] )
                {
                    AddLabel(256, 370, IceHue, String.Format("{0}", m_Value));    // - Show Property Value as % ( i.e [Hit Fireball 25%] )
                }
                else
                {
                    int val = m_Value;

                    if (m_ID >= 51 && m_ID <= 55)
                    {
                        var resistances = Imbuing.GetBaseResists(m_Item);

                        switch (m_ID)
                        {
                        case 51: val += resistances[0]; break;

                        case 52: val += resistances[1]; break;

                        case 53: val += resistances[2]; break;

                        case 54: val += resistances[3]; break;

                        case 55: val += resistances[4]; break;
                        }
                    }

                    AddLabel(256, 370, IceHue, String.Format("{0}%", val));
                }

                // Buttons
                AddButton(179, 372, 0x1464, 0x1464, 10053, GumpButtonType.Reply, 0);
                AddButton(187, 372, 0x1466, 0x1466, 10053, GumpButtonType.Reply, 0);

                AddButton(199, 372, 0x1464, 0x1464, 10052, GumpButtonType.Reply, 0);
                AddButton(207, 372, 0x1466, 0x1466, 10052, GumpButtonType.Reply, 0);

                AddButton(221, 372, 0x1464, 0x1464, 10051, GumpButtonType.Reply, 0);
                AddButton(229, 372, 0x1466, 0x1466, 10051, GumpButtonType.Reply, 0);

                AddButton(280, 372, 0x1464, 0x1464, 10054, GumpButtonType.Reply, 0);
                AddButton(288, 372, 0x1466, 0x1466, 10054, GumpButtonType.Reply, 0);

                AddButton(300, 372, 0x1464, 0x1464, 10055, GumpButtonType.Reply, 0);
                AddButton(308, 372, 0x1466, 0x1466, 10055, GumpButtonType.Reply, 0);

                AddButton(320, 372, 0x1464, 0x1464, 10056, GumpButtonType.Reply, 0);
                AddButton(328, 372, 0x1466, 0x1466, 10056, GumpButtonType.Reply, 0);

                AddLabel(322, 370, 0, ">");
                AddLabel(326, 370, 0, ">");
                AddLabel(330, 370, 0, ">");

                AddLabel(304, 370, 0, ">");
                AddLabel(308, 370, 0, ">");

                AddLabel(286, 370, 0, ">");

                AddLabel(226, 370, 0, "<");

                AddLabel(203, 370, 0, "<");
                AddLabel(207, 370, 0, "<");

                AddLabel(181, 370, 0, "<");
                AddLabel(185, 370, 0, "<");
                AddLabel(189, 370, 0, "<");
            }

            AddButton(15, 410, 4005, 4007, 10099, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 410, 100, 18, 1114268, LabelColor, false, false); // Back

            AddButton(390, 410, 4005, 4007, 10100, GumpButtonType.Reply, 0);
            AddHtmlLocalized(425, 410, 120, 18, 1114267, LabelColor, false, false); // Imbue Item
        }
Exemplo n.º 19
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;
            }
Exemplo n.º 20
0
            protected override void OnTarget(Mobile from, object o)
            {
                Item   item = o as Item;
                Mobile m    = o as Mobile;

                if (item == null && m == null)
                {
                    from.SendLocalizedMessage(500353); // You are not certain...
                    return;
                }

                if (!from.CheckTargetSkill(SkillName.ItemID, o, 0, 100))
                {
                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1041352, from.NetState); // You have no idea how much it might be worth.
                    return;
                }

                if (m != null)
                {
                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1041349, AffixType.Append, "  " + m.Name, "", from.NetState); // It appears to be:
                    return;
                }

                if (item.Name != null)
                {
                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, false, item.Name, from.NetState);
                    item.PrivateOverheadMessage(MessageType.Label, 0x3B2, false, item.Name, from.NetState);
                }
                else
                {
                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, item.LabelNumber, from.NetState);
                    item.PrivateOverheadMessage(MessageType.Label, 0x3B2, item.LabelNumber, from.NetState);
                }

                if (Core.AOS)
                {
                    if (item is Meteorite)
                    {
                        if (((Meteorite)item).Polished)
                        {
                            from.SendLocalizedMessage(1158697); // The brilliance of the meteorite shimmers in the light as you rotate it in your hands! Brightly hued veins of exotic minerals reflect against the polished surface. You think to yourself you have never seen anything so full of splendor!
                        }
                        else
                        {
                            from.SendLocalizedMessage(1158696); // The rock seems to be otherwordly. Judging by the pitting and charring, it appears to have crash landed here from the sky! The rock feels surprisingly dense given its size. Perhaps if you polished it with an oil cloth you may discover what is inside...
                        }

                        return;
                    }

                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1041351, AffixType.Append, "  " + GetPriceFor(item).ToString(), "", from.NetState); // You guess the value of that item at:

                    if (item is BaseWeapon || item is BaseArmor || item is BaseJewel || item is BaseHat)
                    {
                        if (Imbuing.TimesImbued(item) > 0)
                        {
                            from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1111877, from.NetState); // You conclude that item cannot be magically unraveled. The magic in that item has been weakened due to either low durability or the imbuing process.
                        }
                        else
                        {
                            int    weight    = Imbuing.GetTotalWeight(item);
                            string imbIngred = null;
                            double skill     = from.Skills[SkillName.Imbuing].Base;
                            bool   badSkill  = false;

                            if (!Imbuing.CanUnravelItem(from, item, false))
                            {
                                weight = 0;
                            }

                            if (weight > 0 && weight <= 200)
                            {
                                imbIngred = "Magical Residue";
                            }
                            else if (weight > 200 && weight < 480)
                            {
                                imbIngred = "Enchanted Essence";

                                if (skill < 45.0)
                                {
                                    badSkill = true;
                                }
                            }
                            else if (weight >= 480)
                            {
                                imbIngred = "Relic Fragment";

                                if (skill < 95.0)
                                {
                                    badSkill = true;
                                }
                            }

                            if (imbIngred != null)
                            {
                                if (badSkill)
                                {
                                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1111875, from.NetState); // Your Imbuing skill is not high enough to identify the imbuing ingredient.
                                }
                                else
                                {
                                    from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1111874, imbIngred, from.NetState); //You conclude that item will magically unravel into: ~1_ingredient~
                                }
                            }
                            else  // Cannot be Unravelled
                            {
                                from.PrivateOverheadMessage(MessageType.Emote, 0x3B2, 1111876, from.NetState); //You conclude that item cannot be magically unraveled. It appears to possess little to no magic.
                            }
                        }
                    }
                    else
                    {
                        from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1111878); //You conclude that item cannot be magically unraveled.
                    }
                }
                else if (o is Item)
                {
                    if (from.CheckTargetSkill(SkillName.ItemID, o, 0, 100))
                    {
                        if (o is BaseWeapon)
                        {
                            ((BaseWeapon)o).Identified = true;
                        }
                        else if (o is BaseArmor)
                        {
                            ((BaseArmor)o).Identified = true;
                        }

                        if (!Core.AOS)
                        {
                            ((Item)o).OnSingleClick(from);
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500353); // You are not certain...
                    }
                }
                else if (o is Mobile)
                {
                    ((Mobile)o).OnSingleClick(from);
                }
                else
                {
                    from.SendLocalizedMessage(500353); // You are not certain...
                }

                Server.Engines.XmlSpawner2.XmlAttach.RevealAttachments(from, o);
            }
Exemplo n.º 21
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
            {
                from.CloseGump(typeof(ImbuingGump));

                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;

                from.CloseGump(typeof(ImbuingGump));

                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;

                from.CloseGump(typeof(ImbuingGump));

                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;
                }

                from.CloseGump(typeof(ImbuingGump));

                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
            {
                from.CloseGump(typeof(ImbuingGump));

                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
            {
                from.CloseGump(typeof(ImbuingGump));

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

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

                from.Target = new UnravelContainerTarget();
                break;
            }
            }
            return;
        }
Exemplo n.º 22
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 = 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 = 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, MaxProps, m_TotalItemWeight, m_MaxWeight))
                {
                    Imbuing.ImbueItem(from, m_Item, m_Mod, m_Value);
                    SendGumpDelayed(from);
                }

                break;
            }
            }
        }
Exemplo n.º 23
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);
            }