示例#1
0
        public override int OnCraft(int mark, double quality, bool makersMark, Mobile from, CraftSystem craftSystem,
                                    Type typeRes, BaseTool tool,
                                    CraftItem craftItem, int resHue)
        {
            if (from.CheckSkill(SkillName.Tinkering, -5.0, 15.0))
            {
                from.SendSuccessMessage(500636); // Your tinker skill was sufficient to make the item lockable.

                var key = new Key(KeyType.Copper, Key.RandomValue());

                KeyValue = key.KeyValue;
                DropItem(key);

                var tinkering = from.Skills[SkillName.Tinkering].Value;
                var level     = (int)(tinkering * 0.8);

                RequiredSkill = level - 4;
                LockLevel     = level - 14;
                MaxLockLevel  = level + 35;

                if (LockLevel == 0)
                {
                    LockLevel = -1;
                }
                else if (LockLevel > 95)
                {
                    LockLevel = 95;
                }

                if (RequiredSkill > 95)
                {
                    RequiredSkill = 95;
                }

                if (MaxLockLevel > 95)
                {
                    MaxLockLevel = 95;
                }
            }
            else
            {
                from.SendFailureMessage(500637); // Your tinker skill was insufficient to make the item lockable.
            }

            Mark = (MarkQuality)mark;

            if (makersMark)
            {
                Crafter = from;
            }

            var resourceType = typeRes;

            if (resourceType == null)
            {
                resourceType = craftItem.Resources[0].ItemType;
            }

            Resource = CraftResources.GetFromType(resourceType);

            PlayerConstructed = true;

            var context = craftSystem.GetContext(from);

            if (context != null && context.DoNotColor)
            {
                Hue = 0;
            }

            return(base.OnCraft(mark, quality, makersMark, from, craftSystem, typeRes, tool, craftItem, resHue));
        }
示例#2
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
        {
            Quality = (ItemQuality)quality;

            if (makersMark)
            {
                Crafter = from;
            }

            if (!craftItem.ForceNonExceptional)
            {
                if (typeRes == null)
                {
                    typeRes = craftItem.Resources.GetAt(0).ItemType;
                }

                Resource = CraftResources.GetFromType(typeRes);
            }

            if (from.CheckSkill(SkillName.Tinkering, -5.0, 15.0))
            {
                from.SendLocalizedMessage(500636); // Your tinker skill was sufficient to make the item lockable.

                Key key = new Key(KeyType.Copper, Key.RandomValue());

                KeyValue = key.KeyValue;
                DropItem(key);

                double tinkering = from.Skills[SkillName.Tinkering].Value;
                int    level     = (int)(tinkering * 0.8);

                RequiredSkill = level - 4;
                LockLevel     = level - 14;
                MaxLockLevel  = level + 35;

                if (LockLevel == 0)
                {
                    LockLevel = -1;
                }
                else if (LockLevel > 95)
                {
                    LockLevel = 95;
                }

                if (RequiredSkill > 95)
                {
                    RequiredSkill = 95;
                }

                if (MaxLockLevel > 95)
                {
                    MaxLockLevel = 95;
                }
            }
            else
            {
                from.SendLocalizedMessage(500637); // Your tinker skill was insufficient to make the item lockable.
            }

            return(quality);
        }
示例#3
0
 public RunicDovetailSaw(CraftResource resource, int uses) : base(resource, uses, 0x1028)
 {
     Weight = 2.0;
     Hue    = CraftResources.GetHue(resource);
 }
示例#4
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                Item item = targeted as Item;

                if (item != null)
                {
                    bool valid = (item is IDyable || item is BaseTalisman ||
                                  item is BaseBook || item is BaseClothing ||
                                  item is BaseJewel || item is BaseStatuette ||
                                  item is BaseWeapon || item is Runebook ||
                                  item is Spellbook || item is DecorativePlant ||
                                  item.IsArtifact || BasePigmentsOfTokuno.IsValidItem(item));

                    if (item is HoodedShroudOfShadows || item is MonkRobe)
                    {
                        from.SendLocalizedMessage(1042083);                         // You cannot dye that.
                        return;
                    }

                    if (!valid && FurnitureAttribute.Check(item))
                    {
                        if (!from.InRange(m_Item.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446); // That is too far away.
                            return;
                        }
                        else
                        {
                            BaseHouse house = BaseHouse.FindHouseAt(item);

                            if (house == null || (!house.IsLockedDown(item) && !house.IsSecure(item)))
                            {
                                from.SendLocalizedMessage(501022); // Furniture must be locked down to paint it.
                                return;
                            }
                            else if (!house.IsCoOwner(from))
                            {
                                from.SendLocalizedMessage(501023); // You must be the owner to use this item.
                                return;
                            }
                            else
                            {
                                valid = true;
                            }
                        }
                    }
                    else if (!item.IsChildOf(from.Backpack))
                    {
                        from.SendLocalizedMessage(1060640); // The item must be in your backpack to use it.
                        return;
                    }

                    if (!valid && item is BaseArmor)
                    {
                        CraftResourceType restype = CraftResources.GetType(((BaseArmor)item).Resource);
                        if ((CraftResourceType.Leather == restype || CraftResourceType.Metal == restype) &&
                            ArmorMaterialType.Bone != ((BaseArmor)item).MaterialType)
                        {
                            valid = true;
                        }
                    }

                    // need to add any bags, chests, boxes, crates not IDyable but dyable by natural dyes

                    if (valid)
                    {
                        item.Hue = PlantPigmentHueInfo.GetInfo(m_Item.PigmentHue).Hue;
                        from.PlaySound(0x23E);

                        if (--m_Item.UsesRemaining > 0)
                        {
                            m_Item.InvalidateProperties();
                        }
                        else
                        {
                            m_Item.Delete();
                        }

                        return;
                    }
                }

                from.SendLocalizedMessage(1042083); // You cannot dye that.
            }
            protected override void OnTarget(Mobile from, object target)
            {
                if (m_HuePlating.Deleted || m_HuePlating.RootParent != from)
                {
                    if (from == null)
                    {
                        return;
                    }
                }

                CraftResourceInfo resourceInfo = CraftResources.GetInfo(m_HuePlating.ResourceType);

                if (target is Item)
                {
                    Item item = target as Item;

                    if (!item.IsChildOf(from.Backpack))
                    {
                        from.SendMessage("You must target a metal-based weapon or armor in your backpack.");
                        return;
                    }

                    if (item is BaseWeapon || item is BaseArmor)
                    {
                        if (item.Aspect != AspectEnum.None)
                        {
                            from.SendMessage("Aspect armor may not be hued with this item.");
                            return;
                        }

                        if (item.LootType == LootType.Newbied || item.LootType == LootType.Blessed)
                        {
                            from.SendMessage("Newbied or blessed items may not be hued with this item.");
                            return;
                        }

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

                            if (weapon is BaseStaff || weapon is BaseRanged || weapon is Club)
                            {
                                from.SendMessage("Only metal-based weapons may be hued with this item.");
                                return;
                            }
                        }

                        if (item is BaseArmor)
                        {
                            BaseArmor armor = item as BaseArmor;

                            if (!(armor.MaterialType == ArmorMaterialType.Ringmail || armor.MaterialType == ArmorMaterialType.Chainmail || armor.MaterialType == ArmorMaterialType.Plate))
                            {
                                from.SendMessage("Only metal-based armor may be hued with this item.");
                                return;
                            }
                        }

                        if (item is BaseShield)
                        {
                            BaseShield shield = item as BaseShield;

                            if (shield is WoodenShield)
                            {
                                from.SendMessage("Only metal-based shields may be hued with this item.");
                                return;
                            }
                        }

                        if (item.Hue == resourceInfo.Hue)
                        {
                            from.SendMessage("That item is already that hue.");
                            return;
                        }

                        else
                        {
                            item.Hue = resourceInfo.Hue;
                            from.PlaySound(0x23E);

                            from.SendMessage("You alter the hue of the item.");

                            m_HuePlating.Delete();
                        }
                    }

                    else
                    {
                        from.SendMessage("You must target a metal-based weapon or piece or armor in your backpack.");
                        return;
                    }
                }

                else
                {
                    from.SendMessage("You must target a metal-based weapon or piece or armor in your backpack.");
                    return;
                }
            }
示例#6
0
 public RunicSewingKit(CraftResource resource)
     : base(resource, 0xF9D)
 {
     Weight = 2.0;
     Hue    = CraftResources.GetHue(resource);
 }
示例#7
0
        public static bool IsValidItem(Item i)
        {
            if (i is BasePigmentsOfTokuno)
            {
                return(false);
            }

            Type t = i.GetType();

            CraftResource resource = CraftResource.None;

            if (i is BaseWeapon)
            {
                resource = ((BaseWeapon)i).Resource;
            }
            else if (i is BaseArmor)
            {
                resource = ((BaseArmor)i).Resource;
            }
            else if (i is BaseClothing)
            {
                resource = ((BaseClothing)i).Resource;
            }

            if (!CraftResources.IsStandard(resource))
            {
                return(true);
            }

            if (i is ITokunoDyable)
            {
                return(true);
            }

            if (Server.Engines.Blackthorn.BlackthornRewards.IsTokunoDyable(t))
            {
                return(true);
            }

            if (i.IsArtifact)
            {
                return(true);
            }

            return(
                IsInTypeList(t, TreasuresOfTokuno.LesserArtifactsTotal) ||
                IsInTypeList(t, TreasuresOfTokuno.GreaterArtifacts) ||
                #region Mondain's Legacy
                IsInTypeList(t, MondainsLegacy.PigmentList) ||
                #endregion
                #region TOL
                IsInTypeList(t, TimeOfLegends.PigmentList) ||
                #endregion
                IsInTypeList(t, DemonKnight.DoomArtifact) ||
                IsInTypeList(t, MondainsLegacy.Artifacts) ||
                IsInTypeList(t, StealableArtifactsSpawner.TypesOfEntires) ||
                IsInTypeList(t, Paragon.Artifacts) ||
                IsInTypeList(t, Leviathan.Artifacts) ||
                IsInTypeList(t, TreasureMapChest.Artifacts) ||
                IsInTypeList(t, m_Replicas) ||
                IsInTypeList(t, m_DyableHeritageItems) ||
                IsInTypeList(t, m_Glasses));
        }
示例#8
0
 public override void AddNameProperty(ObjectPropertyList list)
 {
     list.Add(1152599, string.Format("#{0}\t#1152606", CraftResources.GetLocalizationNumber(_Resource))); // ~1_RES~ ~2_TYPE~ Talisman
 }
示例#9
0
        public virtual bool Scissor(Mobile from, Scissors scissors)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(502437);                   // Items you wish to cut must be in your backpack.
                return(false);
            }

            if (Ethics.Ethic.IsImbued(this))
            {
                from.SendLocalizedMessage(502440);                   // Scissors can not be used on that to produce anything.
                return(false);
            }

            if (TestCenter.Enabled && !String.IsNullOrEmpty(Name) && Name.ToLower().IndexOf("beta") > -1)
            {
                from.SendMessage("This item is too special to be cut.");
                return(false);
            }

            CraftSystem system = DefTailoring.CraftSystem;

            CraftItem item = system.CraftItems.SearchFor(GetType());

            if (item != null && item.Resources.Count == 1 && item.Resources.GetAt(0).Amount >= 2)
            {
                try
                {
                    Type resourceType = null;

                    CraftResourceInfo info = CraftResources.GetInfo(m_Resource);

                    if (info != null && info.ResourceTypes.Length > 0)
                    {
                        resourceType = info.ResourceTypes[0];
                    }

                    if (resourceType == null)
                    {
                        resourceType = item.Resources.GetAt(0).ItemType;
                    }

                    Item res = (Item)Activator.CreateInstance(resourceType);

                    ScissorHelper(from, res, m_PlayerConstructed ? (item.Resources.GetAt(0).Amount / 2) : 1, !resourceType.IsSubclassOf(typeof(BaseLeather)));

                    if (this is BaseShoes)
                    {
                        switch (((BaseShoes)this).Resource)
                        {
                        case CraftResource.RegularLeather: { res.Hue = 0; break; }

                        case CraftResource.SpinedLeather: { res.Hue = 643; break; }

                        case CraftResource.HornedLeather: { res.Hue = 551; break; }

                        case CraftResource.BarbedLeather: { res.Hue = 449; break; }
                        }
                    }

                    //Cutting up items with special hues only gives 1 cloth
                    if (res.Amount >= 1 && res.Hue >= 1000)
                    {
                        from.SendMessage("The corrosive dye destroyed most of the cloth, yielding very little usable material.");
                        res.Amount = 1;
                    }

                    res.LootType = LootType.Regular;

                    return(true);
                }
                catch
                {
                }
            }

            from.SendLocalizedMessage(502440);               // Scissors can not be used on that to produce anything.
            return(false);
        }
示例#10
0
        public virtual bool TryRepair(Mobile from)
        {
            if (from.Backpack != null && IsChildOf(from.Backpack))
            {
                Type res = RepairResource;

                if (_Automaton == null || _Automaton.ControlMaster != from)
                {
                    from.SendLocalizedMessage(1157051); // You must be the owner of that pet to have it repair.
                }
                else if (from.Backpack.GetAmount(res) < RepairAmount)
                {
                    if (res == typeof(CrystallineBlackrock))
                    {
                        from.SendLocalizedMessage(1157179, String.Format("\t{0}", _Automaton.Name));
                    }
                    else
                    {
                        from.SendLocalizedMessage(1157050, String.Format("#{0}\t{1}", CraftResources.GetLocalizationNumber(_Automaton.Resource).ToString(), _Automaton.Name)); // You need 75 ~1_MATERIAL~ ingots to repair the ~2_CREATURE~.
                    }
                }
                else
                {
                    from.Backpack.ConsumeTotal(res, RepairAmount);

                    return(RetrieveAutomaton(from));
                }
            }

            return(false);
        }
示例#11
0
        private bool Resmelt(Mobile from, Item item, CraftResource resource)
        {
            try
            {
                if (CraftResources.GetType(resource) != CraftResourceType.Metal)
                {
                    return(false);
                }

                CraftResourceInfo info = CraftResources.GetInfo(resource);

                if (info == null || info.ResourceTypes.Length == 0)
                {
                    return(false);
                }

                CraftItem craftItem = DefBlacksmithy.CraftSystem.CraftItems.SearchFor(item.GetType());

                if (craftItem == null || craftItem.Resources.Count == 0)
                {
                    return(false);
                }

                CraftRes craftResource = craftItem.Resources.GetAt(0);

                if (craftResource.Amount < 2)
                {
                    return(false); // Not enough metal to resmelt
                }
                double difficulty = 0.0;

                switch (resource)
                {
                case CraftResource.DullCopper:
                    difficulty = 65.0;
                    break;

                case CraftResource.ShadowIron:
                    difficulty = 70.0;
                    break;

                case CraftResource.Copper:
                    difficulty = 75.0;
                    break;

                case CraftResource.Bronze:
                    difficulty = 80.0;
                    break;

                case CraftResource.Gold:
                    difficulty = 85.0;
                    break;

                case CraftResource.Agapite:
                    difficulty = 90.0;
                    break;

                case CraftResource.Verite:
                    difficulty = 95.0;
                    break;

                case CraftResource.Valorite:
                    difficulty = 99.0;
                    break;
                }

                Type resourceType = info.ResourceTypes[0];
                Item ingot        = (Item)Activator.CreateInstance(resourceType);

                double skill = Math.Max(from.Skills[SkillName.Mining].Value, from.Skills[SkillName.Blacksmith].Value);

                if (item is DragonBardingDeed || item is BaseArmor armor && armor.PlayerConstructed || item is BaseWeapon weapon && weapon.PlayerConstructed || item is BaseClothing clothing && clothing.PlayerConstructed)
                {
                    if (skill > 100.0)
                    {
                        skill = 100.0;
                    }

                    double amount = (((4 + skill) * craftResource.Amount - 4) * 0.0068);

                    if (amount < 2)
                    {
                        ingot.Amount = 2;
                    }
                    else
                    {
                        ingot.Amount = (int)amount;
                    }
                }
                else
                {
                    ingot.Amount = 2;
                }

                if (difficulty > skill)
                {
                    m_Failure = true;
                    ingot.Delete();
                }
                else
                {
                    item.Delete();
                }

                from.AddToBackpack(ingot);

                from.PlaySound(0x2A);
                from.PlaySound(0x240);

                return(true);
            }
示例#12
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                IPoint3D p   = targeted as IPoint3D;
                Map      map = from.Map;

                if (p == null || map == null || m_Deed.Deleted)
                {
                    return;
                }

                if (m_Deed.IsChildOf(from.Backpack))
                {
                    BaseAddon addon = m_Deed.Addon;

                    Server.Spells.SpellHelper.GetSurfaceTop(ref p);

                    BaseHouse   house   = null;
                    BaseGalleon galleon = CheckGalleonPlacement(from, addon, new Point3D(p), map);

                    AddonFitResult res = galleon != null ? AddonFitResult.Valid : addon.CouldFit(p, map, from, ref house);

                    if (res == AddonFitResult.Valid)
                    {
                        addon.Resource = m_Deed.Resource;

                        if (!m_Deed.ExcludeDeedHue)
                        {
                            if (addon.RetainDeedHue || (m_Deed.Hue != 0 && CraftResources.GetHue(m_Deed.Resource) != m_Deed.Hue))
                            {
                                addon.Hue = m_Deed.Hue;
                            }
                        }

                        addon.MoveToWorld(new Point3D(p), map);

                        if (house != null)
                        {
                            house.Addons[addon] = from;
                        }

                        if (galleon != null)
                        {
                            galleon.AddAddon(addon);
                        }

                        m_Deed.DeleteDeed();
                    }
                    else if (res == AddonFitResult.Blocked)
                    {
                        from.SendLocalizedMessage(500269); // You cannot build that there.
                    }
                    else if (res == AddonFitResult.NotInHouse)
                    {
                        from.SendLocalizedMessage(500274); // You can only place this in a house that you own!
                    }
                    else if (res == AddonFitResult.DoorTooClose)
                    {
                        from.SendLocalizedMessage(500271); // You cannot build near the door.
                    }
                    else if (res == AddonFitResult.NoWall)
                    {
                        from.SendLocalizedMessage(500268); // This object needs to be mounted on something.
                    }
                    if (res != AddonFitResult.Valid)
                    {
                        addon.Delete();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                }
            }
示例#13
0
        public SpyglassGump(Spyglass spyglass, PlayerMobile player, Spyglass.SearchModeType searchModeType, Spyglass.SearchLengthType searchLengthType) : base(10, 10)
        {
            if (spyglass == null || player == null)
            {
                return;
            }
            if (spyglass.Deleted)
            {
                return;
            }

            m_Spyglass = spyglass;
            m_Player   = player;

            m_SearchModeType   = searchModeType;
            m_SearchLengthType = searchLengthType;

            Closable   = true;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            int WhiteTextHue = 2655;

            AddImage(3, 3, 1248);

            string spyglassName = "Spyglass";

            if (spyglass.Resource != CraftResource.None)
            {
                spyglassName = CraftResources.GetCraftResourceName(spyglass.Resource) + " Spyglass";
            }

            string usesText    = spyglass.Charges.ToString() + " Uses Remaining";
            int    spyglassHue = spyglass.Hue;

            double spyglassQualityRangeBonus    = 0;
            double spyglassQualityAccuracyBonus = 0;

            double trackingSkillRangeBonus    = 0;
            double trackingSkillAccuracyBonus = 0;

            double cartographySkillRangeBonus    = 0;
            double cartographySkillAccuracyBonus = 0;

            double searchLengthRangeBonus    = 0;
            double searchLengthAccuracyBonus = 0;

            double totalRangeModifiers    = 0;
            double totalAccuracyModifiers = 0;

            if (spyglass.Quality == Quality.Exceptional)
            {
                spyglassQualityRangeBonus    += .05;
                spyglassQualityAccuracyBonus += .05;
            }

            switch (spyglass.Resource)
            {
            case CraftResource.DullCopper:
                spyglassQualityRangeBonus    += .05;
                spyglassQualityAccuracyBonus += .05;
                break;

            case CraftResource.ShadowIron:
                spyglassQualityRangeBonus    += .10;
                spyglassQualityAccuracyBonus += .10;
                break;

            case CraftResource.Copper:
                spyglassQualityRangeBonus    += .15;
                spyglassQualityAccuracyBonus += .15;
                break;

            case CraftResource.Bronze:
                spyglassQualityRangeBonus    += .20;
                spyglassQualityAccuracyBonus += .20;
                break;

            case CraftResource.Gold:
                spyglassQualityRangeBonus    += .25;
                spyglassQualityAccuracyBonus += .25;
                break;

            case CraftResource.Agapite:
                spyglassQualityRangeBonus    += .30;
                spyglassQualityAccuracyBonus += .30;
                break;

            case CraftResource.Verite:
                spyglassQualityRangeBonus    += .35;
                spyglassQualityAccuracyBonus += .35;
                break;

            case CraftResource.Valorite:
                spyglassQualityRangeBonus    += .40;
                spyglassQualityAccuracyBonus += .40;
                break;

            case CraftResource.Lunite:
                spyglassQualityRangeBonus    += .45;
                spyglassQualityAccuracyBonus += .45;
                break;
            }

            trackingSkillRangeBonus    = (player.Skills[SkillName.Tracking].Value / 100) * .25;
            trackingSkillAccuracyBonus = (player.Skills[SkillName.Tracking].Value / 100) * .25;

            cartographySkillRangeBonus    = (player.Skills[SkillName.Cartography].Value / 100) * .25;
            cartographySkillAccuracyBonus = (player.Skills[SkillName.Cartography].Value / 100) * .25;

            switch (searchLengthType)
            {
            case Spyglass.SearchLengthType.Short:
                searchLengthRangeBonus    = 0;
                searchLengthAccuracyBonus = -.25;
                break;

            case Spyglass.SearchLengthType.Medium:
                searchLengthRangeBonus    = .25;
                searchLengthAccuracyBonus = -.50;
                break;

            case Spyglass.SearchLengthType.Long:
                searchLengthRangeBonus    = .50;
                searchLengthAccuracyBonus = -.75;
                break;
            }

            //Guide
            AddButton(14, 9, 2094, 2095, 1, GumpButtonType.Reply, 0);
            AddLabel(40, 11, 149, "Guide");

            AddLabel(Utility.CenteredTextOffset(165, spyglassName), 15, spyglassHue, spyglassName);
            AddLabel(Utility.CenteredTextOffset(165, usesText), 40, WhiteTextHue, usesText);

            //Search Type
            string searchText = "";

            int iconItemId  = 0;
            int iconHue     = 0;
            int iconOffsetX = 0;
            int iconOffsetY = 0;

            //Search Type
            switch (m_SearchModeType)
            {
            case Spyglass.SearchModeType.Ships:
                searchText = "Search for Ships";

                iconItemId  = 5363;
                iconHue     = 0;
                iconOffsetX = -8;
                iconOffsetY = 7;
                break;

            case Spyglass.SearchModeType.Shipwrecks:
                searchText = "Search for Shipwrecks";

                iconItemId  = 5367;
                iconHue     = 0;
                iconOffsetX = 0;
                iconOffsetY = 0;
                break;

            case Spyglass.SearchModeType.SchoolsOfFish:
                searchText = "Search for Schools of Fish";

                iconItemId  = 3544;
                iconHue     = 0;
                iconOffsetX = -30;
                iconOffsetY = 0;
                break;
            }

            AddLabel(Utility.CenteredTextOffset(165, searchText), 70, 2550, searchText);
            AddButton(70, 105, 4014, 4016, 2, GumpButtonType.Reply, 0);
            AddItem(145 + iconOffsetX, 95 + iconOffsetY, iconItemId, iconHue);
            AddButton(210, 105, 4005, 4007, 3, GumpButtonType.Reply, 0);

            //Search Variable
            AddButton(95, 185, 2223, 2223, 4, GumpButtonType.Reply, 0);

            string lengthText = "";

            switch (searchLengthType)
            {
            case Spyglass.SearchLengthType.Short:
                lengthText = "Short Search";

                AddLabel(Utility.CenteredTextOffset(160, lengthText), 157, 2599, lengthText);

                AddItem(130, 182, 5365);
                break;

            case Spyglass.SearchLengthType.Medium:
                lengthText = "Medium Search";

                AddLabel(Utility.CenteredTextOffset(160, lengthText), 157, 2599, lengthText);

                AddItem(122, 182, 5365);
                AddItem(137, 182, 5365);
                break;

            case Spyglass.SearchLengthType.Long:
                lengthText = "Large Search";

                AddLabel(Utility.CenteredTextOffset(160, lengthText), 157, 2599, lengthText);

                AddItem(115, 182, 5365);
                AddItem(130, 182, 5365);
                AddItem(145, 182, 5365);
                break;
            }

            AddButton(195, 185, 2224, 2224, 5, GumpButtonType.Reply, 0);

            //Modifiers Text
            AddLabel(41, 230, 149, "Spyglass Quality");
            AddLabel(58, 250, 149, "Tracking Skill");
            AddLabel(34, 270, 149, "Cartography Skill");
            AddLabel(51, 290, 149, "Search Length");
            AddLabel(45, 310, 52, "Total Modifiers");

            AddLabel(169, 210, 2114, "Range");
            AddLabel(225, 210, 2577, "Accuracy");

            totalRangeModifiers    = spyglassQualityRangeBonus + trackingSkillRangeBonus + cartographySkillRangeBonus + searchLengthRangeBonus;
            totalAccuracyModifiers = spyglassQualityAccuracyBonus + trackingSkillAccuracyBonus + cartographySkillAccuracyBonus + searchLengthAccuracyBonus;

            string spyglassQualityRangeBonusText = "";

            if (spyglassQualityRangeBonus >= 0)
            {
                spyglassQualityRangeBonusText = "+";
            }
            spyglassQualityRangeBonusText += Utility.CreateDecimalPercentageString(spyglassQualityRangeBonus, 1);

            string spyglassQualityAccuracyBonusText = "";

            if (spyglassQualityAccuracyBonus >= 0)
            {
                spyglassQualityAccuracyBonusText = "+";
            }
            spyglassQualityAccuracyBonusText += Utility.CreateDecimalPercentageString(spyglassQualityAccuracyBonus, 1);

            string trackingSkillRangeBonusText = "";

            if (trackingSkillRangeBonus >= 0)
            {
                trackingSkillRangeBonusText = "+";
            }
            trackingSkillRangeBonusText += Utility.CreateDecimalPercentageString(trackingSkillRangeBonus, 1);

            string trackingSkillAccuracyBonusText = "";

            if (trackingSkillAccuracyBonus >= 0)
            {
                trackingSkillAccuracyBonusText = "+";
            }
            trackingSkillAccuracyBonusText += Utility.CreateDecimalPercentageString(trackingSkillAccuracyBonus, 1);

            string cartographySkillRangeBonusText = "";

            if (cartographySkillRangeBonus >= 0)
            {
                cartographySkillRangeBonusText = "+";
            }
            cartographySkillRangeBonusText += Utility.CreateDecimalPercentageString(cartographySkillRangeBonus, 1);

            string cartographySkillAccuracyBonusText = "";

            if (cartographySkillAccuracyBonus >= 0)
            {
                cartographySkillAccuracyBonusText = "+";
            }
            cartographySkillAccuracyBonusText += Utility.CreateDecimalPercentageString(cartographySkillAccuracyBonus, 1);

            string searchLengthRangeBonusText = "";

            if (searchLengthRangeBonus >= 0)
            {
                searchLengthRangeBonusText = "+";
            }
            searchLengthRangeBonusText += Utility.CreateDecimalPercentageString(searchLengthRangeBonus, 1);

            string searchLengthAccuracyBonusText = "";

            if (searchLengthAccuracyBonus >= 0)
            {
                searchLengthAccuracyBonusText = "+";
            }
            searchLengthAccuracyBonusText += Utility.CreateDecimalPercentageString(searchLengthAccuracyBonus, 1);

            //Total
            string totalRangeModifiersText = "";

            if (totalRangeModifiers >= 0)
            {
                totalRangeModifiersText = "+";
            }
            totalRangeModifiersText += Utility.CreateDecimalPercentageString(totalRangeModifiers, 1);

            string totalAccuracyModifiersText = "";

            if (totalAccuracyModifiers >= 0)
            {
                totalAccuracyModifiersText = "+";
            }
            totalAccuracyModifiersText += Utility.CreateDecimalPercentageString(totalAccuracyModifiers, 1);

            AddLabel(168, 230, WhiteTextHue, spyglassQualityRangeBonusText);
            AddLabel(233, 230, WhiteTextHue, spyglassQualityAccuracyBonusText);

            AddLabel(168, 250, WhiteTextHue, trackingSkillRangeBonusText);
            AddLabel(233, 250, WhiteTextHue, trackingSkillAccuracyBonusText);

            AddLabel(168, 270, WhiteTextHue, cartographySkillRangeBonusText);
            AddLabel(233, 270, WhiteTextHue, cartographySkillAccuracyBonusText);

            AddLabel(168, 290, WhiteTextHue, searchLengthRangeBonusText);
            AddLabel(233, 290, WhiteTextHue, searchLengthAccuracyBonusText);

            AddLabel(168, 310, 52, totalRangeModifiersText);
            AddLabel(233, 310, 52, totalAccuracyModifiersText);

            //Begin Search
            AddLabel(115, 344, 169, "Begin Search");
            AddItem(101, 371, 5365, 0);
            AddButton(140, 366, 2151, 2151, 6, GumpButtonType.Reply, 0);
        }
示例#14
0
 public RunicSewingKit(CraftResource resource, int uses)
     : base(resource, uses, 0xF9D)
 {
     this.Weight = 2.0;
     this.Hue    = CraftResources.GetHue(resource);
 }
示例#15
0
            public override void GetProperties(ObjectPropertyList list)
            {
                base.GetProperties(list);

                if (Addon == null || !(Addon is CauldronOfTransmutation))
                {
                    return;
                }

                int left = 0;

                if (DateTime.UtcNow < ((CauldronOfTransmutation)Addon).Expires)
                {
                    left = (int)(((CauldronOfTransmutation)Addon).Expires - DateTime.UtcNow).TotalSeconds;
                }

                list.Add(1072517, left.ToString()); // Lifespan: ~1_val~ seconds

                CraftResource res  = Addon.Resource;
                CraftResource res2 = (CraftResource)(int)res + 1;

                list.Add(1152630, String.Format("#{0}\t#{1}", CraftResources.GetLocalizationNumber(Addon.Resource), CraftResources.GetLocalizationNumber(res2))); // transmutes ~1_SOURCE~ to ~2_DEST~
                list.Add(1152631, String.Format("3\t1"));                                                                                                         // ratio ~1_INPUT~ to ~2_OUTPUT~
                list.Add(1060584, ((CauldronOfTransmutation)Addon).Charges.ToString());                                                                           // uses remaining: ~1_val~
            }
示例#16
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                Item item  = targeted as Item;
                bool valid = false;

                if (item != null)
                {
                    if (m_Item.BooksOnly && !(item is Spellbook))
                    {
                        valid = false;
                    }
                    else
                    {
                        valid = (item is IDyable ||
                                 item is BaseBook || item is BaseClothing ||
                                 item is BaseJewel || item is BaseStatuette ||
                                 item is BaseWeapon || item is Runebook ||
                                 item is BaseTalisman || item is Spellbook ||
                                 item.IsArtifact || BasePigmentsOfTokuno.IsValidItem(item));

                        if (!valid && item is BaseArmor)
                        {
                            CraftResourceType restype = CraftResources.GetType(((BaseArmor)item).Resource);
                            if ((CraftResourceType.Leather == restype || CraftResourceType.Metal == restype) &&
                                ArmorMaterialType.Bone != ((BaseArmor)item).MaterialType)
                            {
                                valid = true;
                            }
                        }

                        if (!valid && FurnitureAttribute.Check(item))
                        {
                            if (!from.InRange(m_Item.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                            {
                                from.SendLocalizedMessage(500446); // That is too far away.
                                return;
                            }
                            else
                            {
                                BaseHouse house = BaseHouse.FindHouseAt(item);

                                if (house == null || (!house.IsLockedDown(item) && !house.IsSecure(item)))
                                {
                                    from.SendLocalizedMessage(501022); // Furniture must be locked down to paint it.
                                    return;
                                }
                                else if (!house.IsCoOwner(from))
                                {
                                    from.SendLocalizedMessage(501023); // You must be the owner to use this item.
                                    return;
                                }
                                else
                                {
                                    valid = true;
                                }
                            }
                        }
                    }

                    if (valid)
                    {
                        item.Hue = m_Item.Hue;
                        from.PlaySound(0x23E);

                        if (--m_Item.UsesRemaining > 0)
                        {
                            m_Item.InvalidateProperties();
                        }
                        else
                        {
                            m_Item.Delete();
                        }

                        return;
                    }
                }

                from.SendLocalizedMessage(1042083); // You cannot dye that.
            }
示例#17
0
 public override void AddNameProperty(ObjectPropertyList list)
 {
     list.Add(1152600, String.Format("#{0}", CraftResources.GetLocalizationNumber(Resource))); // ~1_RES~ Cauldron of Transmutation
 }
示例#18
0
 public RunicDovetailSaw(CraftResource resource)
     : base(resource, 0x1028)
 {
     this.Weight = 2.0;
     this.Hue    = CraftResources.GetHue(resource);
 }
示例#19
0
 public RunicFletcherTools(CraftResource resource, int uses) : base(resource, uses, 0x1022)
 {
     Weight = 2.0;
     Hue    = CraftResources.GetHue(resource);
 }
示例#20
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            Type resourceType = typeRes;

            if (resourceType == null)
            {
                resourceType = craftItem.Resources.GetAt(0).ItemType;
            }

            if (!craftItem.ForceNonExceptional)
            {
                this.Resource = CraftResources.GetFromType(resourceType);
            }

            CraftContext context = craftSystem.GetContext(from);

            if (context != null && context.DoNotColor)
            {
                this.Hue = 0;
            }

            if (1 < craftItem.Resources.Count)
            {
                resourceType = craftItem.Resources.GetAt(1).ItemType;

                if (resourceType == typeof(StarSapphire))
                {
                    this.GemType = GemType.StarSapphire;
                }
                else if (resourceType == typeof(Emerald))
                {
                    this.GemType = GemType.Emerald;
                }
                else if (resourceType == typeof(Sapphire))
                {
                    this.GemType = GemType.Sapphire;
                }
                else if (resourceType == typeof(Ruby))
                {
                    this.GemType = GemType.Ruby;
                }
                else if (resourceType == typeof(Citrine))
                {
                    this.GemType = GemType.Citrine;
                }
                else if (resourceType == typeof(Amethyst))
                {
                    this.GemType = GemType.Amethyst;
                }
                else if (resourceType == typeof(Tourmaline))
                {
                    this.GemType = GemType.Tourmaline;
                }
                else if (resourceType == typeof(Amber))
                {
                    this.GemType = GemType.Amber;
                }
                else if (resourceType == typeof(Diamond))
                {
                    this.GemType = GemType.Diamond;
                }
            }

            #region Mondain's Legacy
            this.m_Quality = (ArmorQuality)quality;

            if (makersMark)
            {
                this.m_Crafter = from;
            }
            #endregion

            return(1);
        }
示例#21
0
 public BaseMarble(CraftResource resource) : base(0x00DF)
 {
     Weight     = 10.0;
     Hue        = CraftResources.GetHue(resource);
     m_Resource = resource;
 }
示例#22
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            Type resourceType = typeRes;

            if (resourceType == null)
            {
                resourceType = craftItem.Ressources.GetAt(0).ItemType;
            }

            Resource = CraftResources.GetFromType(resourceType);

            CraftContext context = craftSystem.GetContext(from);

            if (context != null && context.DoNotColor)
            {
                Hue = 0;
            }

            if (1 < craftItem.Ressources.Count)
            {
                resourceType = craftItem.Ressources.GetAt(1).ItemType;

                if (resourceType == typeof(StarSapphire))
                {
                    GemType = GemType.StarSapphire;
                }
                else if (resourceType == typeof(Emerald))
                {
                    GemType = GemType.Emerald;
                }
                else if (resourceType == typeof(Sapphire))
                {
                    GemType = GemType.Sapphire;
                }
                else if (resourceType == typeof(Ruby))
                {
                    GemType = GemType.Ruby;
                }
                else if (resourceType == typeof(Citrine))
                {
                    GemType = GemType.Citrine;
                }
                else if (resourceType == typeof(Amethyst))
                {
                    GemType = GemType.Amethyst;
                }
                else if (resourceType == typeof(Tourmaline))
                {
                    GemType = GemType.Tourmaline;
                }
                else if (resourceType == typeof(Amber))
                {
                    GemType = GemType.Amber;
                }
                else if (resourceType == typeof(Diamond))
                {
                    GemType = GemType.Diamond;
                }
            }

            return(1);
        }
示例#23
0
 //daat99 OWLTR start - custom resource
 public ColoredAnvil() : this(CraftResources.GetHue((CraftResource)Utility.RandomMinMax((int)CraftResource.DullCopper, (int)CraftResource.Platinum)))
     //daat99 OWLTR end - custom resource
 {
 }
示例#24
0
 public ColoredAnvil()
     : this(CraftResources.GetHue((CraftResource)Utility.RandomMinMax((int)CraftResource.DullCopper, (int)CraftResource.Valorite)))
 {
 }
示例#25
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
        {
            PlayerConstructed = true;

            Type resourceType = typeRes;

            if (resourceType == null)
            {
                resourceType = craftItem.Resources.GetAt(0).ItemType;
            }

            if (!craftItem.ForceNonExceptional)
            {
                Resource = CraftResources.GetFromType(resourceType);
            }

            if (1 < craftItem.Resources.Count)
            {
                resourceType = craftItem.Resources.GetAt(1).ItemType;

                if (resourceType == typeof(StarSapphire))
                {
                    GemType = GemType.StarSapphire;
                }
                else if (resourceType == typeof(Emerald))
                {
                    GemType = GemType.Emerald;
                }
                else if (resourceType == typeof(Sapphire))
                {
                    GemType = GemType.Sapphire;
                }
                else if (resourceType == typeof(Ruby))
                {
                    GemType = GemType.Ruby;
                }
                else if (resourceType == typeof(Citrine))
                {
                    GemType = GemType.Citrine;
                }
                else if (resourceType == typeof(Amethyst))
                {
                    GemType = GemType.Amethyst;
                }
                else if (resourceType == typeof(Tourmaline))
                {
                    GemType = GemType.Tourmaline;
                }
                else if (resourceType == typeof(Amber))
                {
                    GemType = GemType.Amber;
                }
                else if (resourceType == typeof(Diamond))
                {
                    GemType = GemType.Diamond;
                }
            }

            #region Mondain's Legacy
            m_Quality = (ItemQuality)quality;

            if (makersMark)
            {
                m_Crafter = from;
            }
            #endregion

            return(1);
        }
示例#26
0
        public BaseGlovesOfMining(int bonus, int itemID) : base(itemID)
        {
            m_Bonus = bonus;

            this.Hue = CraftResources.GetHue((CraftResource)Utility.RandomMinMax((int)CraftResource.DullCopper, (int)CraftResource.Valorite));
        }
示例#27
0
 public override void AddNameProperty(ObjectPropertyList list)
 {
     list.Add(1157022, string.Format("#{0}", CraftResources.GetLocalizationNumber(_Resource))); // Rebuilt ~1_MATTYPE~ Automaton Head
 }
示例#28
0
        public bool TryTransmutate(Mobile from, Item dropped)
        {
            BaseHouse house = BaseHouse.FindHouseAt(from);

            if (house != null && house.IsOwner(from))
            {
                CraftResource res = CraftResources.GetFromType(dropped.GetType());

                if (res == Resource)
                {
                    if (dropped.Amount < 3)
                    {
                        from.SendLocalizedMessage(1152634); // There is not enough to transmute
                    }
                    else if (Charges <= 0)
                    {
                        from.SendLocalizedMessage(1152635); // The cauldron's magic is exhausted
                    }
                    else
                    {
                        CraftResourceInfo info = CraftResources.GetInfo(Resource + 1);

                        if (info != null && info.ResourceTypes.Length > 0)
                        {
                            int           toDrop = Math.Min(Charges * 3, dropped.Amount);
                            CraftResource newRes = (CraftResource)(int)res + 1;

                            while (toDrop % 3 != 0)
                            {
                                toDrop--;
                            }

                            int newAmount = toDrop / 3;

                            if (toDrop < dropped.Amount)
                            {
                                dropped.Amount -= toDrop;
                            }
                            else
                            {
                                dropped.Delete();
                            }

                            Item item = Loot.Construct(info.ResourceTypes[0]);

                            if (item != null)
                            {
                                item.Amount = newAmount;
                                from.AddToBackpack(item);

                                from.SendLocalizedMessage(1152636); // The cauldron transmutes the material

                                from.PlaySound(Utility.RandomList(0x22, 0x23));

                                Charges -= newAmount;
                                Components.ForEach(c => c.InvalidateProperties());

                                return(true);
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(1152633); // The cauldron cannot transmute that
                        }
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(1152632); // That is not yours!
            }
            return(false);
        }
示例#29
0
 public RunicHammer(CraftResource resource) : base(resource, 0x13E3)
 {
     Weight = 8.0;
     Layer  = Layer.OneHanded;
     Hue    = CraftResources.GetHue(resource);
 }
示例#30
0
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            if (m_AosAttributes.Brittle != 0)
            {
                list.Add(1116209); // Brittle
            }
            if (m_AosSkillBonuses != null)
            {
                m_AosSkillBonuses.GetProperties(list);
            }

            base.AddResistanceProperties(list);

            int prop = 0;

            if ((prop = (m_AosAttributes.WeaponDamage)) != 0)
            {
                list.Add(1060401, prop.ToString()); // damage increase ~1_val~%
            }
            if ((prop = m_AosAttributes.DefendChance) != 0)
            {
                list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~%
            }
            if ((prop = m_AosAttributes.EnhancePotions) != 0)
            {
                list.Add(1060411, prop.ToString()); // enhance potions ~1_val~%
            }
            if ((prop = m_AosAttributes.CastRecovery) != 0)
            {
                list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~
            }
            if ((prop = m_AosAttributes.CastSpeed) != 0)
            {
                list.Add(1060413, prop.ToString()); // faster casting ~1_val~
            }
            if ((prop = (m_AosAttributes.AttackChance)) != 0)
            {
                list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~%
            }
            if ((prop = m_AosAttributes.BonusDex) != 0)
            {
                list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~
            }
            if ((prop = m_AosAttributes.BonusHits) != 0)
            {
                list.Add(1060431, prop.ToString()); // hit point increase ~1_val~
            }
            if ((prop = m_AosAttributes.BonusInt) != 0)
            {
                list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~
            }
            if ((prop = m_AosAttributes.LowerManaCost) != 0)
            {
                list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~%
            }
            if ((prop = m_AosAttributes.LowerRegCost) != 0)
            {
                list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~%
            }
            if ((prop = m_LowerStatReq) != 0)
            {
                list.Add(1060435, m_LowerStatReq.ToString()); // lower requirements ~1_val~%
            }
            if ((prop = m_AosAttributes.SpellChanneling) != 0)
            {
                list.Add(1060482); // spell channeling
            }
            if (!CraftResources.IsStandard(m_Resource))
            {
                list.Add(CraftResources.GetName(m_Resource));
            }

            if ((prop = (GetLuckBonus() + m_AosAttributes.Luck)) != 0)
            {
                list.Add(1060436, prop.ToString()); // luck ~1_val~
            }
            if ((prop = m_AosAttributes.BonusMana) != 0)
            {
                list.Add(1060439, prop.ToString()); // mana increase ~1_val~
            }
            if ((prop = m_AosAttributes.RegenMana) != 0)
            {
                list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~
            }
            if ((prop = m_AosAttributes.NightSight) != 0)
            {
                list.Add(1060441); // night sight
            }
            if ((prop = m_AosAttributes.ReflectPhysical) != 0)
            {
                list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~%
            }
            if ((prop = m_AosAttributes.RegenStam) != 0)
            {
                list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~
            }
            if ((prop = m_AosAttributes.RegenHits) != 0)
            {
                list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~
            }
            if ((prop = m_AosAttributes.SpellDamage) != 0)
            {
                list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~%
            }
            if ((prop = m_AosAttributes.BonusStam) != 0)
            {
                list.Add(1060484, prop.ToString()); // stamina increase ~1_val~
            }
            if ((prop = m_AosAttributes.BonusStr) != 0)
            {
                list.Add(1060485, prop.ToString()); // strength bonus ~1_val~
            }
            //if ( (prop = m_AosAttributes.WeaponSpeed) != 0 )
            //	list.Add( 1060486, prop.ToString() ); // swing speed increase ~1_val~%

            int hookCliloc = BaseFishingHook.GetHookType(m_HookType);

            if (m_HookType > HookType.None && hookCliloc > 0)
            {
                list.Add(1150885, String.Format("#{0}", hookCliloc));                               //special hook: ~1_token~
                list.Add(1150889, String.Format("#{0}", BaseFishingHook.GetCondition(m_HookUses))); //Hook condition: ~1_val~
            }

            if (m_BaitType != null)
            {
                object label = FishInfo.GetFishLabel(m_BaitType);
                if (label is int)
                {
                    list.Add(1116468, String.Format("#{0}", (int)label)); //baited to attract: ~1_val~
                }
                else if (label is string)
                {
                    list.Add(1116468, (string)label);
                }

                list.Add(1116466, m_BaitUses.ToString()); // amount: ~1_val~
            }

            list.Add(1061170, GetStrRequirement().ToString()); // strength requirement ~1_val~
        }