コード例 #1
0
        public static bool GenerateSetItem(Item item)
        {
            if (item.info.setItems.Count == 0)
            {
                return(false);
            }

            SetItem setItem = SelectSetItem(item);

            if (setItem == null)
            {
                return(false);
            }

            item.name     = setItem.name;
            item.setItem  = setItem;
            item.levelReq = setItem.levelReq;

            foreach (var mod in setItem.props)
            {
                if (mod.prop == null)
                {
                    break;
                }

                var prop = new Item.Property();
                prop.info  = ItemPropertyInfo.Find(mod.prop);
                prop.param = mod.param;
                prop.value = Random.Range(mod.min, mod.max + 1);
                prop.min   = mod.min;
                prop.max   = mod.max;
                item.properties.Add(prop);
            }

            for (int i = 0; i < setItem.additionalProps.Length; ++i)
            {
                var mod = setItem.additionalProps[i];
                if (mod.prop == null)
                {
                    continue;
                }

                var prop = new Item.Property();
                prop.info  = ItemPropertyInfo.Find(mod.prop);
                prop.param = mod.param;
                prop.value = Random.Range(mod.min, mod.max + 1);
                prop.min   = mod.min;
                prop.max   = mod.max;
                if (setItem.addFunc == 0)
                {
                    item.properties.Add(prop);
                }
                else
                {
                    int blockSize  = 2;
                    int blockIndex = i / blockSize;
                    while (blockIndex >= item.setItemProperties.Count)
                    {
                        item.setItemProperties.Add(new List <Item.Property>());
                    }
                    item.setItemProperties[blockIndex].Add(prop);
                }
            }

            return(true);
        }
コード例 #2
0
ファイル: ImbueSelectGump.cs プロジェクト: Tauriella/ServUO-1
        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, 10145, 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
        }
コード例 #3
0
ファイル: ItemPropertiesGump.cs プロジェクト: ygtkms/ServUO
        public override void OnResponse(RelayInfo info)
        {
            if (info.ButtonID == 0)
            {
                return;
            }
            else if (info.ButtonID == 1)
            {
                if (Filter == PropFilter.Other)
                {
                    Filter = PropFilter.All;
                }
                else
                {
                    Filter++;
                }

                TypeFilter = ItemType.Invalid;
                Refresh();
            }
            else if (info.ButtonID < 10)
            {
                switch (info.ButtonID)
                {
                case 2:
                    TypeFilter = ItemType.Melee;
                    break;

                case 3:
                    TypeFilter = ItemType.Ranged;
                    break;

                case 4:
                    TypeFilter = ItemType.Armor;
                    break;

                case 5:
                    TypeFilter = ItemType.Shield;
                    break;

                case 6:
                    TypeFilter = ItemType.Hat;
                    break;

                case 7:
                    TypeFilter = ItemType.Jewel;
                    break;
                }

                Refresh();
            }
            else
            {
                Refresh();

                int id = info.ButtonID - 10;

                if (id >= 0 && id < Infos.Count)
                {
                    ItemPropertyInfo propInfo = Infos[id];

                    BaseGump.SendGump(new InfoSpecificGump(User, propInfo, TypeFilter));
                }
            }
        }
コード例 #4
0
ファイル: ItemPropertiesGump.cs プロジェクト: ygtkms/ServUO
        public override void AddGumpLayout()
        {
            AddBackground(0, 0, 900, 600, 0x2454);
            AddPage(0);

            AddHtml(0, 5, 900, 20, String.Format("Item Properties: {0}", Filter.ToString()), false, false);
            AddHtml(275, 15, 625, 20, Center("Item Description: (Imbuing/Runic Cap) - (Loot Cap) [Scale]"), false, false);

            AddButton(5, 550, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddHtml(40, 550, 200, 20, String.Format("Filter: {0}", Filter.ToString()), false, false);

            //
            AddButton(105, 575, TypeFilter == ItemType.Melee ? 4006 : 4005, 4007, 2, GumpButtonType.Reply, 0);
            AddHtml(140, 575, 200, 20, "Melee", false, false);

            AddButton(205, 575, TypeFilter == ItemType.Ranged ? 4006 : 4005, 4007, 3, GumpButtonType.Reply, 0);
            AddHtml(240, 575, 200, 20, "Ranged", false, false);

            AddButton(305, 575, TypeFilter == ItemType.Armor ? 4006 : 4005, 4007, 4, GumpButtonType.Reply, 0);
            AddHtml(340, 575, 200, 20, "Armor", false, false);

            AddButton(405, 575, TypeFilter == ItemType.Shield ? 4006 : 4005, 4007, 5, GumpButtonType.Reply, 0);
            AddHtml(440, 575, 200, 20, "Shields", false, false);

            AddButton(505, 575, TypeFilter == ItemType.Hat ? 4006 : 4005, 4007, 6, GumpButtonType.Reply, 0);
            AddHtml(540, 575, 200, 20, "Hats", false, false);

            AddButton(605, 575, TypeFilter == ItemType.Jewel ? 4006 : 4005, 4007, 7, GumpButtonType.Reply, 0);
            AddHtml(640, 575, 200, 20, "Jewels", false, false);

            AddLabel(5, 30, 0, "Property");
            AddLabel(125, 30, 0, "Max");
            AddLabel(175, 30, 0, "Start");
            AddLabel(225, 30, 0, "Scale");
            AddLabel(275, 30, 0, "Melee");
            AddLabel(375, 30, 0, "Ranged");
            AddLabel(475, 30, 0, "Armor");
            AddLabel(575, 30, 0, "Shields");
            AddLabel(675, 30, 0, "Hats");
            AddLabel(775, 30, 0, "Jewels");

            Infos = CompileList().ToList();
            int index   = 0;
            int page    = 1;
            int y       = 50;
            int perPage = 25;

            AddPage(page);

            for (int i = 0; i < Infos.Count; i++)
            {
                ItemPropertyInfo info = Infos[i];
                int scale             = info.Scale;

                //AddLabel(5, y, 0, info.Attribute.ToString());
                AddHtmlLocalized(5, y, 120, 20, 1114057, info.AttributeName.ToString(), 0x1, false, false);
                AddLabel(125, y, 0, info.MaxIntensity.ToString());
                AddLabel(175, y, 0, info.Start.ToString());
                AddLabel(225, y, 0, scale.ToString());

                LoadTypeInfo(ItemType.Melee, info, scale, 275, y);
                LoadTypeInfo(ItemType.Ranged, info, scale, 375, y);
                LoadTypeInfo(ItemType.Armor, info, scale, 475, y);
                LoadTypeInfo(ItemType.Shield, info, scale, 575, y);
                LoadTypeInfo(ItemType.Hat, info, scale, 675, y);
                LoadTypeInfo(ItemType.Jewel, info, scale, 775, y);

                AddButton(868, y, 4011, 4012, 10 + i, GumpButtonType.Reply, 0);

                if (++index % perPage == 0)
                {
                    y = 50;
                    AddButton(868, 0, 4005, 4007, 0, GumpButtonType.Page, page + 1);
                    AddPage(++page);
                    AddButton(838, 0, 4014, 4016, 0, GumpButtonType.Page, page - 1);
                }
                else
                {
                    y += 20;
                }
            }
        }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GreaterOrEqualFilter&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="propertyInfo">The property info.</param>
 /// <param name="compareTo">The compare to initial value.</param>
 public GreaterOrEqualFilter(ItemPropertyInfo propertyInfo, T compareTo)
     : this(propertyInfo) {
     base.CompareTo = compareTo;
 }
コード例 #6
0
        /// <summary>
        ///     Returns a query that returns the unique item property values in the ItemsSource collection..
        /// </summary>
        public static IEnumerable GetAvailableValuesQuery(FilterPresenter filterPresenter, ItemPropertyInfo propInfo)
        {
            var source = filterPresenter.CollectionView.SourceCollection;

            if (source == null)
            {
                return(new object[0]);
            }
            var propertyDescriptor = propInfo.Descriptor as PropertyDescriptor;
            var sourceQuery        = source.OfType <object>().Select(item => propertyDescriptor.GetValue(item));
            var propType           = propertyDescriptor.PropertyType;

            if (typeof(IComparable).IsAssignableFrom(propType))
            {
                sourceQuery = sourceQuery.OrderBy(item => item);
            }
            else
            {
                sourceQuery = sourceQuery.OrderBy(item => item == null ? "" : item.ToString());
            }
            sourceQuery = sourceQuery.Distinct();
            return(sourceQuery);
        }
コード例 #7
0
ファイル: GreaterOrEqualFilter.cs プロジェクト: TataDvd/Git
 /// <summary>
 /// Initializes a new instance of the <see cref="GreaterOrEqualFilter"/> class.
 /// </summary>
 /// <param name="getter">Func that return from item IComparable value to compare.</param>
 public GreaterOrEqualFilter(ItemPropertyInfo propertyInfo)
     : base(propertyInfo)
 {
     base.Name = "Greater or equal:";
 }
コード例 #8
0
 /// <summary>
 /// Create new instance of EnumFilter.
 /// </summary>
 /// <param name="propertyInfo">propertyInfo, used to access a property of the collection item</param>
 public EnumFilter(ItemPropertyInfo propertyInfo)
     : base(propertyInfo)
 {
     Debug.Assert(propertyInfo.PropertyType == typeof(T), "Invalid property type, the return type is not matching the class generic type.");
 }
コード例 #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GreaterOrEqualFilter"/> class.
 /// </summary>
 /// <param name="getter">Func that return from item IComparable value to compare.</param>
 public GreaterOrEqualFilter(ItemPropertyInfo propertyInfo)
     : base(propertyInfo)
 {
     base.Name = ItemsFilter.Resources.Strings.GreaterOrEqualText;
 }
コード例 #10
0
 public object GetByIndex(object collection, int index)
 {
     return(ItemPropertyInfo.GetValue(collection, new object[] { index }));
 }
コード例 #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);
        }
コード例 #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RangeFilter&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="propertyInfo">The property info.</param>
 /// <param name="CompareFrom">Minimum value.</param>
 /// <param name="CompareTo">Maximum value.</param>
 public RangeFilter(ItemPropertyInfo propertyInfo, T CompareFrom, T CompareTo)
     : this(propertyInfo) {
     _compareTo   = CompareTo;
     _compareFrom = CompareFrom;
     RefreshIsActive();
 }
コード例 #13
0
 static string \u206E‎‫‮‌‮‫‫‮‎‍‍‫‬‎‫​​‭‎‭‭‮‭‍‮([In] ItemPropertyInfo obj0)
 {
     return(obj0.Name);
 }
コード例 #14
0
ファイル: BaseRunicTool.cs プロジェクト: Evad-lab/ServUOX
        public static void ApplyAttributesTo(BaseWeapon weapon, bool playerMade, int luckChance, int attributeCount, int min, int max)
        {
            int delta;

            if (min > max)
            {
                delta = min;
                min   = max;
                max   = delta;
            }

            if (!playerMade && RandomItemGenerator.Enabled)
            {
                RandomItemGenerator.GenerateRandomItem(weapon, luckChance, attributeCount, min, max);
                return;
            }

            m_PlayerMade = playerMade;
            m_LuckChance = luckChance;

            AosAttributes       primary   = weapon.Attributes;
            AosWeaponAttributes secondary = weapon.WeaponAttributes;

            m_Props.SetAll(false);

            if (weapon is BaseRanged)
            {
                m_Props.Set(2, true); // ranged weapons cannot be ubws or mageweapon
            }
            else
            {
                m_Props.Set(25, true); // Only bows can be Balanced
                m_Props.Set(26, true); // Only bows have Velocity
            }

            for (int i = 0; i < attributeCount; ++i)
            {
                int random = GetUniqueRandom(27);

                if (random == -1)
                {
                    break;
                }

                switch (random)
                {
                case 0:
                {
                    switch (Utility.Random(5))
                    {
                    case 0:
                        ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitPhysicalArea, 2, 50, 2);
                        break;

                    case 1:
                        ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitFireArea, 2, 50, 2);
                        break;

                    case 2:
                        ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitColdArea, 2, 50, 2);
                        break;

                    case 3:
                        ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitPoisonArea, 2, 50, 2);
                        break;

                    case 4:
                        ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitEnergyArea, 2, 50, 2);
                        break;
                    }

                    break;
                }

                case 1:
                {
                    switch (Utility.Random(4))
                    {
                    case 0:
                        ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitMagicArrow, 2, 50, 2);
                        break;

                    case 1:
                        ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitHarm, 2, 50, 2);
                        break;

                    case 2:
                        ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitFireball, 2, 50, 2);
                        break;

                    case 3:
                        ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLightning, 2, 50, 2);
                        break;
                    }

                    break;
                }

                case 2:
                {
                    switch (Utility.Random(2))
                    {
                    case 0:
                        ApplyAttribute(secondary, min, max, AosWeaponAttribute.UseBestSkill, 1, 1);
                        break;

                    case 1:
                        ApplyAttribute(secondary, min, max, AosWeaponAttribute.MageWeapon, 1, 10);
                        break;
                    }

                    break;
                }

                case 3:
                    int dmgMin = primary.WeaponDamage;
                    int dmgMax = Math.Max(dmgMin, 50);
                    primary.WeaponDamage = 0;
                    ApplyAttribute(primary, min, max, AosAttribute.WeaponDamage, dmgMin, dmgMax);
                    break;

                case 4:
                    ApplyAttribute(primary, min, max, AosAttribute.DefendChance, 1, 15);
                    break;

                case 5:
                    ApplyAttribute(primary, min, max, AosAttribute.CastSpeed, 1, 1);
                    break;

                case 6:
                    ApplyAttribute(primary, min, max, AosAttribute.AttackChance, 1, 15);
                    break;

                case 7:
                    ApplyAttribute(primary, min, max, AosAttribute.Luck, 1, 100);
                    break;

                case 8:
                    ApplyAttribute(primary, min, max, AosAttribute.WeaponSpeed, 5, 30, 5);
                    break;

                case 9:
                    ApplyAttribute(primary, min, max, AosAttribute.SpellChanneling, 1, 1);
                    break;

                case 10:
                    ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitDispel, 2, 50, 2);
                    break;

                case 11:
                    ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLeechHits, 2, ItemPropertyInfo.GetMaxIntensity(weapon, AosWeaponAttribute.HitLeechHits), 2);
                    break;

                case 12:
                    ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLowerAttack, 2, 50, 2);
                    break;

                case 13:
                    ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLowerDefend, 2, 50, 2);
                    break;

                case 14:
                    ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLeechMana, 2, ItemPropertyInfo.GetMaxIntensity(weapon, AosWeaponAttribute.HitLeechMana), 2);
                    break;

                case 15:
                    ApplyAttribute(secondary, min, max, AosWeaponAttribute.HitLeechStam, 2, 50, 2);
                    break;

                case 16:
                    ApplyAttribute(secondary, min, max, AosWeaponAttribute.LowerStatReq, 10, 100, 10);
                    break;

                case 17:
                    ApplyAttribute(secondary, min, max, AosWeaponAttribute.ResistPhysicalBonus, 1, 15);
                    break;

                case 18:
                    ApplyAttribute(secondary, min, max, AosWeaponAttribute.ResistFireBonus, 1, 15);
                    break;

                case 19:
                    ApplyAttribute(secondary, min, max, AosWeaponAttribute.ResistColdBonus, 1, 15);
                    break;

                case 20:
                    ApplyAttribute(secondary, min, max, AosWeaponAttribute.ResistPoisonBonus, 1, 15);
                    break;

                case 21:
                    ApplyAttribute(secondary, min, max, AosWeaponAttribute.ResistEnergyBonus, 1, 15);
                    break;

                case 22:
                    ApplyAttribute(secondary, min, max, AosWeaponAttribute.DurabilityBonus, 10, 100, 10);
                    break;

                case 23:
                    weapon.Slayer = GetRandomSlayer();
                    break;

                case 24:
                    ApplyElementalDamage(weapon, min, max);
                    break;

                case 25:
                    ((BaseRanged)weapon).Balanced = true;
                    break;

                case 26:
                    ApplyVelocityAttribute((BaseRanged)weapon, min, max, 2, 50, 2);
                    break;
                }
            }
        }
コード例 #15
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="StringFilter" /> class.
 /// </summary>
 /// <param name="propertyInfo">The property info.</param>
 /// <param name="filterMode">The filter mode.</param>
 /// <param name="value">The value.</param>
 public StringFilter(ItemPropertyInfo propertyInfo, StringFilterMode filterMode, string value)
     : this(propertyInfo, filterMode)
 {
     _value   = value;
     IsActive = !string.IsNullOrEmpty(value);
 }
コード例 #16
0
 internal DataGridAutoGeneratingColumnEventArgs(DataGridColumn column, ItemPropertyInfo itemPropertyInfo) :
     this(column, itemPropertyInfo.Name, itemPropertyInfo.PropertyType, itemPropertyInfo.Descriptor)
 {
 }
コード例 #17
0
        public void OnLoad(DockPanel summaryRow)
        {
            if (summaryRow == null)
            {
                return;
            }

            this.summaryRow = summaryRow;

            this.sourceCollectionView = this.AssociatedObject.ItemsSource as ICollectionView;
            if (this.sourceCollectionView == null)
            {
                this.sourceCollectionView = CollectionViewSource.GetDefaultView(this.AssociatedObject.ItemsSource);
            }

            if (this.sourceCollectionView == null)
            {
                return;
            }

            this.sourceCollectionView.CollectionChanged += OnNotifyCollectionChanged;
            ReadOnlyCollection <ItemPropertyInfo> itemProperties = ((IItemProperties)sourceCollectionView).ItemProperties;

            foreach (DataGridColumn column in this.AssociatedObject.Columns)
            {
                DockPanel stackPanel = new DockPanel();
                stackPanel.HorizontalAlignment = HorizontalAlignment.Left;
                TextBlock pipe = new TextBlock();
                pipe.Text = "|";

                stackPanel.Children.Add(pipe);
                TextBlock element = new TextBlock();
                element.Padding       = new Thickness(0, 0, 2, 0);
                element.TextAlignment = TextAlignment.Right;

                stackPanel.Children.Add(element);

                stackPanel.Background = Brushes.Bisque;

                Binding widthBinding = new Binding("ActualWidth");
                widthBinding.Mode   = BindingMode.OneWay;
                widthBinding.Source = column;
                BindingOperations.SetBinding(stackPanel, StackPanel.WidthProperty, widthBinding);

                summaryRow.Children.Add(stackPanel);

                if (column is DataGridBoundColumn && column is DataGridNumericColumn)
                {
                    DataGridNumericColumn numericColumn = (DataGridNumericColumn)column;
                    if (numericColumn.IsTotaled)
                    {
                        ItemPropertyInfo       propertyInfo = itemProperties.FirstOrDefault(item => item.Name == (string)column.Header);
                        Func <object, object>  getterItem   = ((PropertyDescriptor)(propertyInfo.Descriptor)).GetValue;
                        Func <object, decimal> getter       = row => ((decimal)getterItem(row));
                        numericColumn.Getter = getter;

                        Binding binding = new Binding("Total");
                        binding.Mode         = BindingMode.OneWay;
                        binding.StringFormat = numericColumn.Binding.StringFormat;
                        binding.Source       = column;

                        element.SetBinding(TextBlock.TextProperty, binding);
                    }
                }
            }
        }
コード例 #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GreaterOrEqualFilter"/> class.
 /// </summary>
 /// <param name="getter">Func that return from item IComparable value to compare.</param>
 public GreaterOrEqualFilter(ItemPropertyInfo propertyInfo)
     : base(propertyInfo)
 {
     base.Name = TMP.Wpf.CommonControls.ItemsFilter.Resources.Strings.GreaterOrEqualText;
 }
コード例 #19
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);
        }
コード例 #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LessOrEqualFilter&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="propertyInfo">The property info.</param>
 /// <param name="compareTo">The compare to.</param>
 public LessOrEqualFilter(ItemPropertyInfo propertyInfo, T compareTo)
     : this(propertyInfo)
 {
     this.compareTo = compareTo;
     this.RefreshIsActive();
 }
コード例 #21
0
ファイル: ImbueGump.cs プロジェクト: tuita520/ServUO
        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;
            }
            }
        }
コード例 #22
0
ファイル: ItemPropertiesGump.cs プロジェクト: ygtkms/ServUO
        private IEnumerable <ItemPropertyInfo> CompileList()
        {
            if (TypeFilter > ItemType.Invalid)
            {
                foreach (int i in ItemPropertyInfo.LootTable[TypeFilter])
                {
                    yield return(ItemPropertyInfo.GetInfo(i));
                }

                yield break;
            }

            foreach (ItemPropertyInfo info in ItemPropertyInfo.Table.Values)
            {
                switch (Filter)
                {
                case PropFilter.All:
                    yield return(info);

                    break;

                case PropFilter.AosAttributes:
                    if (info.Attribute is AosAttribute)
                    {
                        yield return(info);
                    }
                    break;

                case PropFilter.AosWeaponAttributes:
                    if (info.Attribute is AosWeaponAttribute)
                    {
                        yield return(info);
                    }
                    break;

                case PropFilter.AosArmorAttributes:
                    if (info.Attribute is AosArmorAttribute)
                    {
                        yield return(info);
                    }
                    break;

                case PropFilter.Slayer:
                    if (info.Attribute is SlayerName)
                    {
                        yield return(info);
                    }
                    break;

                case PropFilter.AosElemental:
                    if (info.Attribute is AosElementAttribute)
                    {
                        yield return(info);
                    }
                    break;

                case PropFilter.SkillName:
                    if (info.Attribute is SkillName)
                    {
                        yield return(info);
                    }
                    break;

                case PropFilter.SAAbsorption:
                    if (info.Attribute is SAAbsorptionAttribute)
                    {
                        yield return(info);
                    }
                    break;

                case PropFilter.ExtendedWeapon:
                    if (info.Attribute is ExtendedWeaponAttribute)
                    {
                        yield return(info);
                    }
                    break;

                case PropFilter.Other:
                    if (info.Attribute is string)
                    {
                        yield return(info);
                    }
                    break;
                }
            }
        }
コード例 #23
0
ファイル: ImbueGump.cs プロジェクト: tuita520/ServUO
        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
        }
コード例 #24
0
ファイル: ItemPropertiesGump.cs プロジェクト: ygtkms/ServUO
 public InfoSpecificGump(PlayerMobile pm, ItemPropertyInfo info, ItemType type)
     : base(pm, 100, 100)
 {
     Info     = info;
     ItemType = type;
 }
コード例 #25
0
ファイル: ImbueGump.cs プロジェクト: tuita520/ServUO
        // =========== 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);
        }
コード例 #26
0
 /// <summary>
 /// Create instance of PropertyFilter for  filterPresenter and key, if it is possible.
 /// </summary>
 protected abstract PropertyFilter NewFilter(FilterPresenter filterPresenter, ItemPropertyInfo key);
コード例 #27
0
 public GridViewAutoGeneratingColumnEventArgs(ItemPropertyInfo propertyInfo)
 {
     this.ItemPropertyInfo = propertyInfo ?? throw new ArgumentNullException(nameof(propertyInfo));
 }