Exemple #1
1
		public BOBSmallEntry( GenericReader reader )
		{
			int version = reader.ReadEncodedInt();

			switch ( version )
			{
				case 0:
				{
					string type = reader.ReadString();

					if ( type != null )
						m_ItemType = ScriptCompiler.FindTypeByFullName( type );

					m_RequireExceptional = reader.ReadBool();

					m_DeedType = (BODType)reader.ReadEncodedInt();

					m_Material = (BulkMaterialType)reader.ReadEncodedInt();
					m_AmountCur = reader.ReadEncodedInt();
					m_AmountMax = reader.ReadEncodedInt();
					m_Number = reader.ReadEncodedInt();
					m_Graphic = reader.ReadEncodedInt();
					m_Price = reader.ReadEncodedInt();

					break;
				}
			}
		}
Exemple #2
0
        public BOBLargeEntry(GenericReader reader)
        {
            int version = reader.ReadEncodedInt();

            switch ( version )
            {
                case 0:
                    {
                        this.m_RequireExceptional = reader.ReadBool();

                        this.m_DeedType = (BODType)reader.ReadEncodedInt();

                        this.m_Material = (BulkMaterialType)reader.ReadEncodedInt();
                        this.m_AmountMax = reader.ReadEncodedInt();
                        this.m_Price = reader.ReadEncodedInt();

                        this.m_Entries = new BOBLargeSubEntry[reader.ReadEncodedInt()];

                        for (int i = 0; i < this.m_Entries.Length; ++i)
                            this.m_Entries[i] = new BOBLargeSubEntry(reader);

                        break;
                    }
            }
        }
		public LargeTailorBOD( int amountMax, bool reqExceptional, BulkMaterialType mat, LargeBulkEntry[] entries )
		{
			Hue = 0x483;
			AmountMax = amountMax;
			Entries = entries;
			RequireExceptional = reqExceptional;
			Material = mat;
		}
Exemple #4
0
		public LargeSmithBOD( int amountMax, bool reqExceptional, BulkMaterialType mat, LargeBulkEntry[] entries )
		{
			this.Hue = 0x44E;
			this.AmountMax = amountMax;
			this.Entries = entries;
			this.RequireExceptional = reqExceptional;
			this.Material = mat;
		}
		public bool CheckFilter( BulkMaterialType mat, int amountMax, bool isLarge, bool reqExc, BODType deedType, Type itemType )
		{
			BOBFilter f = ( m_From.UseOwnFilter ? m_From.BOBFilter : m_Book.Filter );

			if ( f.IsDefault )
				return true;

			if ( f.Quality == 1 && reqExc )
				return false;
			else if ( f.Quality == 2 && !reqExc )
				return false;

			if ( f.Quantity == 1 && amountMax != 10 )
				return false;
			else if ( f.Quantity == 2 && amountMax != 15 )
				return false;
			else if ( f.Quantity == 3 && amountMax != 20 )
				return false;

			if ( f.Type == 1 && isLarge )
				return false;
			else if ( f.Type == 2 && !isLarge )
				return false;

			switch ( f.Material )
			{
				default:
				case  0: return true;
				case  1: return ( deedType == BODType.Smith );
				case  2: return ( deedType == BODType.Tailor );

				case  3: return ( mat == BulkMaterialType.None && BGTClassifier.Classify( deedType, itemType ) == BulkGenericType.Iron );
				case  4: return ( mat == BulkMaterialType.DullCopper );
				case  5: return ( mat == BulkMaterialType.ShadowIron );
				case  6: return ( mat == BulkMaterialType.Copper );
				case  7: return ( mat == BulkMaterialType.Bronze );
				case  8: return ( mat == BulkMaterialType.Gold );
				case  9: return ( mat == BulkMaterialType.Agapite );
				case 10: return ( mat == BulkMaterialType.Verite );
				case 11: return ( mat == BulkMaterialType.Valorite );
				case 12: return ( mat == BulkMaterialType.Silver );
				//case 13: return ( mat == BulkMaterialType.Platinum );
				//case 14: return ( mat == BulkMaterialType.Mythril );
				//case 15: return ( mat == BulkMaterialType.Obsidian );
				case 13: return ( mat == BulkMaterialType.Jade );
				case 14: return ( mat == BulkMaterialType.Moonstone );
				case 15: return ( mat == BulkMaterialType.Sunstone );
				//case 19: return ( mat == BulkMaterialType.Bloodstone );

				case 16: return ( mat == BulkMaterialType.None && BGTClassifier.Classify( deedType, itemType ) == BulkGenericType.Cloth );
				case 17: return ( mat == BulkMaterialType.None && BGTClassifier.Classify( deedType, itemType ) == BulkGenericType.Leather );
				case 18: return ( mat == BulkMaterialType.Spined );
				case 19: return ( mat == BulkMaterialType.Horned );
				case 20: return ( mat == BulkMaterialType.Barbed );
				case 21: return ( mat == BulkMaterialType.DragonL );
				case 22: return ( mat == BulkMaterialType.Daemon );
			}
		}
        public static int GetMaterialNumberFor( BulkMaterialType material )
        {
            if ( material >= BulkMaterialType.Copper && material <= BulkMaterialType.Steel )
                return 1045142 + (int)(material - BulkMaterialType.Copper);
            else if ( material >= BulkMaterialType.Thick && material <= BulkMaterialType.Scaled )
                return 1049348 + (int)(material - BulkMaterialType.Thick);

            return 0;
        }
Exemple #7
0
        public static int GetMaterialNumberFor(BulkMaterialType material)
        {
            if (material >= BulkMaterialType.DullCopper && material <= BulkMaterialType.Valorite)
                return 1045142 + (int)(material - BulkMaterialType.DullCopper);
            else if (material >= BulkMaterialType.Spined && material <= BulkMaterialType.Barbed)
                return 1049348 + (int)(material - BulkMaterialType.Spined);

            return 0;
        }
		//clone constructor
		public SmallBODListEntry( SmallBODListEntry entry ) : base( entry )
		{
			_AmountCur = entry.AmountCur;
			_AmountMax = entry.AmountMax;
			_BODFillType = entry.BODFillType;
			_Number = entry.Number;
			_Graphic = entry.Graphic;
			_RequireExceptional = entry.RequireExceptional;
			_Material = entry.Material;			
		}
Exemple #9
0
 private SmallTailorBOD(SmallBulkEntry entry, BulkMaterialType material, int amountMax, bool reqExceptional)
 {
     this.Hue = 0x483;
     this.AmountMax = amountMax;
     this.Type = entry.Type;
     this.Number = entry.Number;
     this.Graphic = entry.Graphic;
     this.RequireExceptional = reqExceptional;
     this.Material = material;
 }
Exemple #10
0
		public override int LabelNumber{ get{ return 1045151; } } // a bulk order deed

		public LargeBOD( int hue, int amountMax, bool requireExeptional, BulkMaterialType material, LargeBulkEntry[] entries ) : base( Core.AOS ? 0x2258 : 0x14EF )
		{
			Weight = 1.0;
			Hue = hue; // Blacksmith: 0x44E; Tailoring: 0x483
			LootType = LootType.Blessed;

			m_AmountMax = amountMax;
			m_RequireExceptional = requireExeptional;
			m_Material = material;
			m_Entries = entries;
		}
Exemple #11
0
 public SmallTailorBOD(int amountCur, int amountMax, Type type, int number, int graphic, bool reqExceptional, BulkMaterialType mat)
 {
     this.Hue = 0x483;
     this.AmountMax = amountMax;
     this.AmountCur = amountCur;
     this.Type = type;
     this.Number = number;
     this.Graphic = graphic;
     this.RequireExceptional = reqExceptional;
     this.Material = mat;
 }
 public SmallSmithBOD( int amountCur, int amountMax, Type type, int number, int graphic, bool reqExceptional, BulkMaterialType mat, Mobile m )
 {
     this.Mobile = m;
     this.Hue = 0x44E;
     this.AmountMax = amountMax;
     this.AmountCur = amountCur;
     this.Type = type;
     this.Number = number;
     this.Graphic = graphic;
     this.RequireExceptional = reqExceptional;
     this.Material = mat;
 }
		//master constructor
		public SmallBODListEntry( Item item ) : base ( item )
		{
			SmallBOD bod = (SmallBOD)item;
			
			_AmountCur = bod.AmountCur;
			_AmountMax = bod.AmountMax;
			_BODFillType = bod.Type;
			_Number = bod.Number;
			_Graphic = bod.Graphic;
			_RequireExceptional = bod.RequireExceptional;
			_Material = bod.Material;			
		}
		public SmallBOD( int hue, int amountMax, Type type, int number, int graphic, bool requireExeptional, BulkMaterialType material ) : base( Core.AOS ? 0x2258 : 0x14EF )
		{
			Weight = 1.0;
			Hue = hue; // Blacksmith: 0x44E; Tailoring: 0x483
			LootType = LootType.Blessed;

			m_AmountMax = amountMax;
			m_Type = type;
			m_Number = number;
			m_Graphic = graphic;
			m_RequireExceptional = requireExeptional;
			m_Material = material;
		}
Exemple #15
0
		public static BulkMaterialType GetRandomMaterial( BulkMaterialType start, double[] chances )
		{
			double random = Utility.RandomDouble();

			for ( int i = 0; i < chances.Length; ++i )
			{
				if ( random < chances[i] )
					return ( i == 0 ? BulkMaterialType.None : start + (i - 1) );

				random -= chances[i];
			}

			return BulkMaterialType.None;
		}
Exemple #16
0
		public BOBSmallEntry( SmallBOD bod )
		{
			m_ItemType = bod.Type;
			m_RequireExceptional = bod.RequireExceptional;

			if ( bod is SmallTailorBOD )
				m_DeedType = BODType.Tailor;
			else if ( bod is SmallSmithBOD )
				m_DeedType = BODType.Smith;

			m_Material = bod.Material;
			m_AmountCur = bod.AmountCur;
			m_AmountMax = bod.AmountMax;
			m_Number = bod.Number;
			m_Graphic = bod.Graphic;
		}
Exemple #17
0
        public BOBLargeEntry(LargeBOD bod)
        {
            this.m_RequireExceptional = bod.RequireExceptional;

            if (bod is LargeTailorBOD)
                this.m_DeedType = BODType.Tailor;
            else if (bod is LargeSmithBOD)
                this.m_DeedType = BODType.Smith;

            this.m_Material = bod.Material;
            this.m_AmountMax = bod.AmountMax;

            this.m_Entries = new BOBLargeSubEntry[bod.Entries.Length];

            for (int i = 0; i < this.m_Entries.Length; ++i)
                this.m_Entries[i] = new BOBLargeSubEntry(bod.Entries[i]);
        }
Exemple #18
0
 public SmallSmithBOD(
     int amountCur, int amountMax, Type type, int number, int graphic, bool reqExceptional,
     BulkMaterialType mat
     ) : base(0x44E, amountCur, amountMax, type, number, graphic, reqExceptional, mat)
 {
 }
Exemple #19
0
        public static BulkMaterialType GetRandomMaterial( BulkMaterialType start, double[] chances, double bonus )
        {
            double random = Utility.RandomDouble();

            for ( int i = 0; i < chances.Length; ++i )
            {
                double chance = ( i == 0 ? chances[i] - ( chances[i] * bonus ) : chances[i] + ( chances[i] * bonus ) );

                if ( random < chance )
                    return ( i == 0 ? BulkMaterialType.None : start + ( i - 1 ) );

                random -= chance;
            }

            return BulkMaterialType.None;
        }
Exemple #20
0
 public SmallSmithBOD(int amountCur, int amountMax, Type type, int number, int graphic, bool reqExceptional, BulkMaterialType mat, int hue)
 {
     this.Hue                = 0x44E;
     this.AmountMax          = amountMax;
     this.AmountCur          = amountCur;
     this.Type               = type;
     this.Number             = number;
     this.Graphic            = graphic;
     this.RequireExceptional = reqExceptional;
     this.Material           = mat;
     this.GraphicHue         = hue;
 }
Exemple #21
0
        public void EndCombine(Mobile from, object o)
        {
            if (o is Item && ((Item)o).IsChildOf(from.Backpack))
            {
                Type objectType = o.GetType();
                Item item       = o as Item;

                if (m_AmountCur >= m_AmountMax)
                {
                    from.SendLocalizedMessage(1045166); // The maximum amount of requested items have already been combined to this deed.
                }
                else if (!CheckType((Item)o))
                {
                    from.SendLocalizedMessage(1045169); // The item is not in the request.
                }
                else
                {
                    BulkMaterialType material = BulkMaterialType.None;

                    if (o is IResource)
                    {
                        material = GetMaterial(((IResource)o).Resource);
                    }

                    if (material != m_Material && m_Material != BulkMaterialType.None)
                    {
                        from.SendLocalizedMessage(1157310); // The item is not made from the requested resource.
                    }
                    else
                    {
                        bool isExceptional = false;

                        if (o is IQuality)
                        {
                            isExceptional = (((IQuality)o).Quality == ItemQuality.Exceptional);
                        }

                        if (m_RequireExceptional && !isExceptional)
                        {
                            from.SendLocalizedMessage(1045167); // The item must be exceptional.
                        }
                        else
                        {
                            if (item.Amount > 1)
                            {
                                if (AmountCur + item.Amount > AmountMax)
                                {
                                    from.SendLocalizedMessage(1157222); // You have provided more than which has been requested by this deed.
                                    return;
                                }
                                else
                                {
                                    AmountCur += item.Amount;
                                    item.Delete();
                                }
                            }
                            else
                            {
                                item.Delete();
                                ++AmountCur;
                            }

                            from.SendLocalizedMessage(1045170); // The item has been combined with the deed.

                            from.SendGump(new SmallBODGump(from, this));

                            if (m_AmountCur < m_AmountMax)
                            {
                                BeginCombine(from);
                            }
                        }
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(1045158); // You must have the item in your backpack to target it.
            }
        }
Exemple #22
0
        public bool CheckFilter(BulkMaterialType mat, int amountMax, bool isLarge, bool reqExc, BODType deedType, Type itemType)
        {
            BOBFilter f = (m_From.UseOwnFilter ? m_From.BOBFilter : m_Book.Filter);

            if (f.IsDefault)
            {
                return(true);
            }

            if (f.Quality == 1 && reqExc)
            {
                return(false);
            }
            else if (f.Quality == 2 && !reqExc)
            {
                return(false);
            }

            if (f.Quantity == 1 && amountMax != 10)
            {
                return(false);
            }
            else if (f.Quantity == 2 && amountMax != 15)
            {
                return(false);
            }
            else if (f.Quantity == 3 && amountMax != 20)
            {
                return(false);
            }

            if (f.Type == 1 && isLarge)
            {
                return(false);
            }
            else if (f.Type == 2 && !isLarge)
            {
                return(false);
            }

            if (BulkOrderSystem.NewSystemEnabled)
            {
                switch (f.Material)
                {
                default:
                case 0:
                    return(true);

                case 1:
                    return(deedType == BODType.Smith);

                case 2:
                    return(deedType == BODType.Tailor);

                case 3:
                    return(deedType == BODType.Tinkering);

                case 4:
                    return(deedType == BODType.Carpentry);

                case 5:
                    return(deedType == BODType.Fletching);

                case 6:
                    return(deedType == BODType.Alchemy);

                case 7:
                    return(deedType == BODType.Inscription);

                case 8:
                    return(deedType == BODType.Cooking);

                case 9:
                    return(mat == BulkMaterialType.None && deedType == BODType.Smith);

                case 10:
                    return(mat == BulkMaterialType.DullCopper && deedType == BODType.Smith);

                case 11:
                    return(mat == BulkMaterialType.ShadowIron && deedType == BODType.Smith);

                case 12:
                    return(mat == BulkMaterialType.Copper && deedType == BODType.Smith);

                case 13:
                    return(mat == BulkMaterialType.Bronze && deedType == BODType.Smith);

                case 14:
                    return(mat == BulkMaterialType.Gold && deedType == BODType.Smith);

                case 15:
                    return(mat == BulkMaterialType.Agapite && deedType == BODType.Smith);

                case 16:
                    return(mat == BulkMaterialType.Verite && deedType == BODType.Smith);

                case 17:
                    return(mat == BulkMaterialType.Valorite && deedType == BODType.Smith);

                case 18:
                    return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Cloth);

                case 19:
                    return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Leather);

                case 20:
                    return(mat == BulkMaterialType.Spined && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Leather);

                case 21:
                    return(mat == BulkMaterialType.Horned && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Leather);

                case 22:
                    return(mat == BulkMaterialType.Barbed && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Leather);

                case 23:     // Tinkering
                    return(mat == BulkMaterialType.None && deedType == BODType.Tinkering);

                case 24:
                    return(mat == BulkMaterialType.DullCopper && deedType == BODType.Tinkering);

                case 25:
                    return(mat == BulkMaterialType.ShadowIron && deedType == BODType.Tinkering);

                case 26:
                    return(mat == BulkMaterialType.Copper && deedType == BODType.Tinkering);

                case 27:
                    return(mat == BulkMaterialType.Bronze && deedType == BODType.Tinkering);

                case 28:
                    return(mat == BulkMaterialType.Gold && deedType == BODType.Tinkering);

                case 29:
                    return(mat == BulkMaterialType.Agapite && deedType == BODType.Tinkering);

                case 30:
                    return(mat == BulkMaterialType.Verite && deedType == BODType.Tinkering);

                case 31:
                    return(mat == BulkMaterialType.Valorite && deedType == BODType.Tinkering);

                case 32:     // Carpentry
                    return(mat == BulkMaterialType.None && deedType == BODType.Carpentry);

                case 33:
                    return(mat == BulkMaterialType.OakWood && deedType == BODType.Carpentry);

                case 34:
                    return(mat == BulkMaterialType.AshWood && deedType == BODType.Carpentry);

                case 35:
                    return(mat == BulkMaterialType.YewWood && deedType == BODType.Carpentry);

                case 36:
                    return(mat == BulkMaterialType.Bloodwood && deedType == BODType.Carpentry);

                case 37:
                    return(mat == BulkMaterialType.Heartwood && deedType == BODType.Carpentry);

                case 38:
                    return(mat == BulkMaterialType.Frostwood && deedType == BODType.Carpentry);

                case 39:     // Fletching
                    return(mat == BulkMaterialType.None && deedType == BODType.Fletching);

                case 40:
                    return(mat == BulkMaterialType.OakWood && deedType == BODType.Fletching);

                case 41:
                    return(mat == BulkMaterialType.AshWood && deedType == BODType.Fletching);

                case 42:
                    return(mat == BulkMaterialType.YewWood && deedType == BODType.Fletching);

                case 43:
                    return(mat == BulkMaterialType.Bloodwood && deedType == BODType.Fletching);

                case 44:
                    return(mat == BulkMaterialType.Heartwood && deedType == BODType.Fletching);

                case 45:
                    return(mat == BulkMaterialType.Frostwood && deedType == BODType.Fletching);
                }
            }
            else
            {
                switch (f.Material)
                {
                default:
                case 0: return(true);

                case 1: return(deedType == BODType.Smith);

                case 2: return(deedType == BODType.Tailor);

                case 3: return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Iron);

                case 4: return(mat == BulkMaterialType.DullCopper);

                case 5: return(mat == BulkMaterialType.ShadowIron);

                case 6: return(mat == BulkMaterialType.Copper);

                case 7: return(mat == BulkMaterialType.Bronze);

                case 8: return(mat == BulkMaterialType.Gold);

                case 9: return(mat == BulkMaterialType.Agapite);

                case 10: return(mat == BulkMaterialType.Verite);

                case 11: return(mat == BulkMaterialType.Valorite);

                case 12: return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Cloth);

                case 13: return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Leather);

                case 14: return(mat == BulkMaterialType.Spined);

                case 15: return(mat == BulkMaterialType.Horned);

                case 16: return(mat == BulkMaterialType.Barbed);
                }
            }
        }
Exemple #23
0
        public SmallBOD(int hue, int amountMax, Type type, int number, int graphic, bool requireExeptional, BulkMaterialType material)
            : base(0x2258)
        {
            Weight   = 1.0;
            Hue      = hue;        // Blacksmith: 0x44E; Tailoring: 0x483
            LootType = LootType.Blessed;

            m_AmountMax          = amountMax;
            m_Type               = type;
            m_Number             = number;
            m_Graphic            = graphic;
            m_RequireExceptional = requireExeptional;
            m_Material           = material;
        }
Exemple #24
0
 public SmallCarpentryBOD(int amountCur, int amountMax, Type type, int number, int graphic, bool reqExceptional, BulkMaterialType mat, int hue)
 {
     Hue                = 1512;
     AmountMax          = amountMax;
     AmountCur          = amountCur;
     Type               = type;
     Number             = number;
     Graphic            = graphic;
     RequireExceptional = reqExceptional;
     Material           = mat;
     GraphicHue         = hue;
 }
Exemple #25
0
        public static SmallCarpentryBOD CreateRandomFor(Mobile m)
        {
            SmallBulkEntry[] entries;
            bool             useMaterials = Utility.RandomBool();

            double theirSkill = BulkOrderSystem.GetBODSkill(m, SkillName.Carpentry);

            entries = SmallBulkEntry.CarpentrySmalls;

            if (entries.Length > 0)
            {
                int amountMax;

                if (theirSkill >= 70.1)
                {
                    amountMax = Utility.RandomList(10, 15, 20, 20);
                }
                else if (theirSkill >= 50.1)
                {
                    amountMax = Utility.RandomList(10, 15, 15, 20);
                }
                else
                {
                    amountMax = Utility.RandomList(10, 10, 15, 20);
                }

                BulkMaterialType material = BulkMaterialType.None;

                if (useMaterials && theirSkill >= 70.1)
                {
                    for (int i = 0; i < 20; ++i)
                    {
                        BulkMaterialType check    = GetRandomMaterial(BulkMaterialType.OakWood, m_CarpentryMaterialChances);
                        double           skillReq = GetRequiredSkill(check);

                        if (theirSkill >= skillReq)
                        {
                            material = check;
                            break;
                        }
                    }
                }

                double excChance = 0.0;

                if (theirSkill >= 70.1)
                {
                    excChance = (theirSkill + 80.0) / 200.0;
                }

                bool reqExceptional = (excChance > Utility.RandomDouble());

                CraftSystem system = DefCarpentry.CraftSystem;

                List <SmallBulkEntry> validEntries = new List <SmallBulkEntry>();

                for (int i = 0; i < entries.Length; ++i)
                {
                    CraftItem item = system.CraftItems.SearchFor(entries[i].Type);

                    if (item != null)
                    {
                        bool   allRequiredSkills = true;
                        double chance            = item.GetSuccessChance(m, null, system, false, ref allRequiredSkills);

                        if (allRequiredSkills && chance >= 0.0)
                        {
                            if (reqExceptional)
                            {
                                chance = item.GetExceptionalChance(system, chance, m);
                            }

                            if (chance > 0.0)
                            {
                                validEntries.Add(entries[i]);
                            }
                        }
                    }
                }

                if (validEntries.Count > 0)
                {
                    SmallBulkEntry entry = validEntries[Utility.Random(validEntries.Count)];
                    return(new SmallCarpentryBOD(entry, material, amountMax, reqExceptional));
                }
            }

            return(null);
        }
Exemple #26
0
 public SmallTailorBOD(int amountCur, int amountMax, Type type, int number, int graphic, bool reqExceptional, BulkMaterialType mat)
 {
     this.Hue                = 0x483;
     this.AmountMax          = amountMax;
     this.AmountCur          = amountCur;
     this.Type               = type;
     this.Number             = number;
     this.Graphic            = graphic;
     this.RequireExceptional = reqExceptional;
     this.Material           = mat;
 }
Exemple #27
0
        public static SmallTailorBOD CreateRandomFor(Mobile m)
        {
            SmallBulkEntry[] entries;
            bool             useMaterials;

            if (useMaterials = Utility.RandomBool())
            {
                entries = SmallBulkEntry.TailorLeather;
            }
            else
            {
                entries = SmallBulkEntry.TailorCloth;
            }

            if (entries.Length > 0)
            {
                double theirSkill = m.Skills[SkillName.Tailoring].Base;
                int    amountMax;

                if (theirSkill >= 70.1)
                {
                    amountMax = Utility.RandomList(10, 15, 20, 20);
                }
                else if (theirSkill >= 50.1)
                {
                    amountMax = Utility.RandomList(10, 15, 15, 20);
                }
                else
                {
                    amountMax = Utility.RandomList(10, 10, 15, 20);
                }

                BulkMaterialType material = BulkMaterialType.None;

                if (useMaterials && theirSkill >= 70.1)
                {
                    for (int i = 0; i < 20; ++i)
                    {
                        BulkMaterialType check    = GetRandomMaterial(BulkMaterialType.Spined, m_TailoringMaterialChances);
                        double           skillReq = 0.0;

                        switch (check)
                        {
                        case BulkMaterialType.DullCopper: skillReq = 65.0; break;

                        case BulkMaterialType.Bronze: skillReq = 80.0; break;

                        case BulkMaterialType.Gold: skillReq = 85.0; break;

                        case BulkMaterialType.Agapite: skillReq = 90.0; break;

                        case BulkMaterialType.Verite: skillReq = 95.0; break;

                        case BulkMaterialType.Valorite: skillReq = 100.0; break;

                        case BulkMaterialType.Spined: skillReq = 65.0; break;

                        case BulkMaterialType.Horned: skillReq = 80.0; break;

                        case BulkMaterialType.Barbed: skillReq = 99.0; break;
                        }

                        if (theirSkill >= skillReq)
                        {
                            material = check;
                            break;
                        }
                    }
                }

                double excChance = 0.0;

                if (theirSkill >= 70.1)
                {
                    excChance = (theirSkill + 80.0) / 200.0;
                }

                bool reqExceptional = (excChance > Utility.RandomDouble());

                SmallBulkEntry entry = null;

//				CraftSystem system = DefTailoring.CraftSystem;
                CraftSystem system = new DefTailoring();
                system.CustomSystem(m);

                for (int i = 0; i < 150; ++i)
                {
                    SmallBulkEntry check = entries[Utility.Random(entries.Length)];

                    CraftItem item = system.CraftItems.SearchFor(check.Type);

                    if (item != null)
                    {
                        bool   allRequiredSkills = true;
                        double chance            = item.GetSuccessChance(m, null, system, false, ref allRequiredSkills);

                        if (allRequiredSkills && chance >= 0.0)
                        {
                            if (reqExceptional)
                            {
                                chance = item.GetExceptionalChance(system, chance, m);
                            }

                            if (chance > 0.0)
                            {
                                entry = check;
                                break;
                            }
                        }
                    }
                }

                if (entry != null)
                {
                    return(new SmallTailorBOD(entry, material, amountMax, reqExceptional));
                }
            }

            return(null);
        }
Exemple #28
0
        public bool CheckFilter(BulkMaterialType mat, int amountMax, bool isLarge, bool reqExc, BODType deedType, Type itemType)
        {
            BOBFilter f = (m_From.UseOwnFilter ? m_From.BOBFilter : m_Book.Filter);

            if (f.IsDefault)
            {
                return(true);
            }

            if (f.Quality == 1 && reqExc)
            {
                return(false);
            }
            else if (f.Quality == 2 && !reqExc)
            {
                return(false);
            }

            if (f.Quantity == 1 && amountMax != 10)
            {
                return(false);
            }
            else if (f.Quantity == 2 && amountMax != 15)
            {
                return(false);
            }
            else if (f.Quantity == 3 && amountMax != 20)
            {
                return(false);
            }

            if (f.Type == 1 && isLarge)
            {
                return(false);
            }
            else if (f.Type == 2 && !isLarge)
            {
                return(false);
            }

            switch (f.Material)
            {
            default:
            case  0: return(true);

            case  1: return(deedType == BODType.Smith);

            case  2: return(deedType == BODType.Tailor);

            case  3: return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Iron);

            case  4: return(mat == BulkMaterialType.Cuivre);

            case  5: return(mat == BulkMaterialType.Bronze);

            case  6: return(mat == BulkMaterialType.Acier);

            case  7: return(mat == BulkMaterialType.Argent);

            case  8: return(mat == BulkMaterialType.Or);

            case  9: return(mat == BulkMaterialType.Mytheril);

            case 10: return(mat == BulkMaterialType.Obscurium);

            case 11: return(mat == BulkMaterialType.Luminium);

            case 12: return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Cloth);

            case 13: return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Leather);

            case 14: return(mat == BulkMaterialType.Spined);

            case 15: return(mat == BulkMaterialType.Horned);

            case 16: return(mat == BulkMaterialType.Barbed);
            }
        }
        public static SmallTailorBOD CreateRandomFor(Mobile m)
        {
            SmallBulkEntry[] entries;
            bool             useMaterials = Utility.RandomBool();

            double theirSkill = m.Skills[SkillName.Tailoring].Base;

            if (useMaterials = Utility.RandomBool() && theirSkill >= 6.2)              // Ugly, but the easiest leather BOD is Leather Cap which requires at least 6.2 skill.
            {
                entries = SmallBulkEntry.TailorLeather;
            }
            else
            {
                entries = SmallBulkEntry.TailorCloth;
            }

            if (entries.Length > 0)
            {
                int amountMax;

                if (theirSkill >= 70.1)
                {
                    amountMax = Utility.RandomList(10, 15, 20, 20);
                }
                else if (theirSkill >= 50.1)
                {
                    amountMax = Utility.RandomList(10, 15, 15, 20);
                }
                else
                {
                    amountMax = Utility.RandomList(10, 10, 15, 20);
                }

                BulkMaterialType material = BulkMaterialType.None;

                if (useMaterials && theirSkill >= 70.1)
                {
                    for (int i = 0; i < 20; ++i)
                    {
                        BulkMaterialType check    = GetRandomMaterial(BulkMaterialType.Spined, m_TailoringMaterialChances);
                        double           skillReq = 0.0;

                        switch (check)
                        {
                        //daat99 OWLTR start - custom resources
                        case BulkMaterialType.DullCopper:       skillReq = 52.0; break;

                        case BulkMaterialType.ShadowIron:       skillReq = 56.0; break;

                        case BulkMaterialType.Copper:           skillReq = 60.0; break;

                        case BulkMaterialType.Bronze:           skillReq = 64.0; break;

                        case BulkMaterialType.Gold:                     skillReq = 68.0; break;

                        case BulkMaterialType.Agapite:          skillReq = 72.0; break;

                        case BulkMaterialType.Verite:           skillReq = 76.0; break;

                        case BulkMaterialType.Valorite:         skillReq = 80.0; break;

                        case BulkMaterialType.Blaze:            skillReq = 84.0; break;

                        case BulkMaterialType.Ice:                      skillReq = 88.0; break;

                        case BulkMaterialType.Toxic:            skillReq = 92.0; break;

                        case BulkMaterialType.Electrum:         skillReq = 96.0; break;

                        case BulkMaterialType.Platinum:         skillReq = 100.0; break;

                        case BulkMaterialType.Spined:           skillReq = 64.0; break;

                        case BulkMaterialType.Horned:           skillReq = 68.0; break;

                        case BulkMaterialType.Barbed:           skillReq = 72.0; break;

                        case BulkMaterialType.Polar:            skillReq = 76.0; break;

                        case BulkMaterialType.Synthetic:        skillReq = 80.0; break;

                        case BulkMaterialType.BlazeL:           skillReq = 84.0; break;

                        case BulkMaterialType.Daemonic:         skillReq = 88.0; break;

                        case BulkMaterialType.Shadow:           skillReq = 92.0; break;

                        case BulkMaterialType.Frost:            skillReq = 96.0; break;

                        case BulkMaterialType.Ethereal:         skillReq = 100.0; break;

                        case BulkMaterialType.Heartwood:        skillReq = 60.0; break;

                        case BulkMaterialType.Bloodwood:        skillReq = 64.0; break;

                        case BulkMaterialType.Frostwood:        skillReq = 68.0; break;

                        case BulkMaterialType.OakWood:          skillReq = 72.0; break;

                        case BulkMaterialType.AshWood:          skillReq = 76.0; break;

                        case BulkMaterialType.YewWood:          skillReq = 80.0; break;

                        case BulkMaterialType.Ebony:            skillReq = 84.0; break;

                        case BulkMaterialType.Bamboo:           skillReq = 88.0; break;

                        case BulkMaterialType.PurpleHeart:      skillReq = 92.0; break;

                        case BulkMaterialType.Redwood:          skillReq = 96.0; break;

                        case BulkMaterialType.Petrified:        skillReq = 100.0; break;
                            //daat99 OWLTR end - custom resources
                        }

                        if (theirSkill >= skillReq)
                        {
                            material = check;
                            break;
                        }
                    }
                }

                double excChance = 0.0;

                if (theirSkill >= 70.1)
                {
                    excChance = (theirSkill + 80.0) / 200.0;
                }

                bool reqExceptional = (excChance > Utility.RandomDouble());


                CraftSystem system = DefTailoring.CraftSystem;

                List <SmallBulkEntry> validEntries = new List <SmallBulkEntry>();

                for (int i = 0; i < entries.Length; ++i)
                {
                    CraftItem item = system.CraftItems.SearchFor(entries[i].Type);

                    if (item != null)
                    {
                        bool   allRequiredSkills = true;
                        double chance            = item.GetSuccessChance(m, null, system, false, ref allRequiredSkills);

                        if (allRequiredSkills && chance >= 0.0)
                        {
                            if (reqExceptional)
                            {
                                chance = item.GetExceptionalChance(system, chance, m);
                            }

                            if (chance > 0.0)
                            {
                                validEntries.Add(entries[i]);
                            }
                        }
                    }
                }

                if (validEntries.Count > 0)
                {
                    SmallBulkEntry entry = validEntries[Utility.Random(validEntries.Count)];
                    return(new SmallTailorBOD(entry, material, amountMax, reqExceptional));
                }
            }

            return(null);
        }
Exemple #30
0
 public LargeSmithBOD(int amountMax, bool reqExceptional, BulkMaterialType mat, LargeBulkEntry[] entries)
     : base(0x44E, amountMax, reqExceptional, mat, entries)
 {
 }
Exemple #31
0
		public abstract int ComputeGold( int quantity, bool exceptional, BulkMaterialType material, int itemCount, Type type );
Exemple #32
0
 public abstract int ComputePoints(int quantity, bool exceptional, BulkMaterialType material, int itemCount, Type type);
Exemple #33
0
		public override int ComputeGold( int quantity, bool exceptional, BulkMaterialType material, int itemCount, Type type )
		{
			int[][][] goldTable = m_GoldTable;

			int typeIndex = ComputeType( type, itemCount );
			int quanIndex = ( quantity == 20 ? 2 : quantity == 15 ? 1 : 0 );
			int mtrlIndex = ( material >= BulkMaterialType.DullCopper && material <= BulkMaterialType.Valorite ) ? 1 + (int)(material - BulkMaterialType.DullCopper) : 0;

			if ( exceptional )
				typeIndex++;

			int gold = goldTable[typeIndex][quanIndex][mtrlIndex];

			int min = (gold * 9) / 10;
			int max = (gold * 10) / 9;

			return Utility.RandomMinMax( min, max );
		}
Exemple #34
0
 public static BulkMaterialType GetRandomMaterial(BulkMaterialType start, double[] chances)
 {
     return(GetRandomMaterial(start, chances, 0.0));
 }
		public static int GetMaterialNumberFor( BulkMaterialType material )
		{
			if ( material >= BulkMaterialType.DullCopper && material <= BulkMaterialType.Sunstone )
				return 1045142 + (int)(material - BulkMaterialType.DullCopper);
			else if ( material >= BulkMaterialType.Spined && material <= BulkMaterialType.Daemon )
				return 1049348 + (int)(material - BulkMaterialType.Spined);
			else if ( material >= BulkMaterialType.Pine && material <= BulkMaterialType.Oak )
				return 1049348 + (int)(material - BulkMaterialType.Pine);

			return 0;
		}
Exemple #36
0
 public SmallSmithBOD(int amountCur, int amountMax, Type type, int number, int graphic, bool reqExceptional, BulkMaterialType mat)
 {
     Hue                = 0x44E;
     AmountMax          = amountMax;
     AmountCur          = amountCur;
     Type               = type;
     Number             = number;
     Graphic            = graphic;
     RequireExceptional = reqExceptional;
     Material           = mat;
 }
Exemple #37
0
        public object GetMaterialName(BulkMaterialType mat, BODType type, Type itemType)
        {
            switch (type)
            {
            case BODType.Tinkering:
            case BODType.Smith:
            {
                if (type == BODType.Tinkering && mat == BulkMaterialType.None && BGTClassifier.Classify(type, itemType) == BulkGenericType.Wood)
                {
                    return(1079435);
                }
                else
                {
                    switch (mat)
                    {
                    case BulkMaterialType.None:
                        return(1062226);

                    case BulkMaterialType.DullCopper:
                        return(1018332);

                    case BulkMaterialType.ShadowIron:
                        return(1018333);

                    case BulkMaterialType.Copper:
                        return(1018334);

                    case BulkMaterialType.Bronze:
                        return(1018335);

                    case BulkMaterialType.Gold:
                        return(1018336);

                    case BulkMaterialType.Agapite:
                        return(1018337);

                    case BulkMaterialType.Verite:
                        return(1018338);

                    case BulkMaterialType.Valorite:
                        return(1018339);
                    }
                }

                break;
            }

            case BODType.Tailor:
            {
                switch (mat)
                {
                case BulkMaterialType.None:
                {
                    if (itemType.IsSubclassOf(typeof(BaseArmor)) || itemType.IsSubclassOf(typeof(BaseShoes)))
                    {
                        return(1062235);
                    }

                    return(1044286);
                }

                case BulkMaterialType.Spined:
                    return(1062236);

                case BulkMaterialType.Horned:
                    return(1062237);

                case BulkMaterialType.Barbed:
                    return(1062238);
                }

                break;
            }

            case BODType.Carpentry:
            case BODType.Fletching:
            {
                if (mat == BulkMaterialType.None)
                {
                    return(1079435);
                }

                switch (mat)
                {
                default:
                case BulkMaterialType.OakWood: return(1071428);

                case BulkMaterialType.AshWood: return(1071429);

                case BulkMaterialType.YewWood: return(1071430);

                case BulkMaterialType.Heartwood: return(1071432);

                case BulkMaterialType.Bloodwood: return(1071431);

                case BulkMaterialType.Frostwood: return(1071433);
                }
            }
            }

            return("");
        }
Exemple #38
0
        public object GetMaterialName(BulkMaterialType mat, BODType type, Type itemType)
        {
            switch (type)
            {
            case BODType.Tinkering:
            case BODType.Smith:
            {
                if (type == BODType.Tinkering && mat == BulkMaterialType.None && BGTClassifier.Classify(type, itemType) == BulkGenericType.Wood)
                {
                    return(1079435);
                }
                else
                {
                    switch (mat)
                    {
                    case BulkMaterialType.None:
                        return(1062226);

                    case BulkMaterialType.DullCopper:
                        return(1018332);

                    case BulkMaterialType.ShadowIron:
                        return(1018333);

                    case BulkMaterialType.Copper:
                        return(1018334);

                    case BulkMaterialType.Bronze:
                        return(1018335);

                    case BulkMaterialType.Gold:
                        return(1018336);

                    case BulkMaterialType.Agapite:
                        return(1018337);

                    case BulkMaterialType.Verite:
                        return(1018338);

                    case BulkMaterialType.Valorite:
                        return(1018339);

                    //daat9 OWLTR start - custom resources
                    case BulkMaterialType.Blaze:
                        return("Blaze");

                    case BulkMaterialType.Ice:
                        return("Ice");

                    case BulkMaterialType.Toxic:
                        return("Toxic");

                    case BulkMaterialType.Electrum:
                        return("Electrum");

                    case BulkMaterialType.Platinum:
                        return("Platinum");
                        //daat9 OWLTR end - custom resources
                    }
                }

                break;
            }

            case BODType.Tailor:
            {
                switch (mat)
                {
                case BulkMaterialType.None:
                {
                    if (itemType.IsSubclassOf(typeof(BaseArmor)) || itemType.IsSubclassOf(typeof(BaseShoes)))
                    {
                        return(1062235);
                    }

                    return(1044286);
                }

                case BulkMaterialType.Spined:
                    return(1062236);

                case BulkMaterialType.Horned:
                    return(1062237);

                case BulkMaterialType.Barbed:
                    return(1062238);

                //daat9 OWLTR start - custom resources
                case BulkMaterialType.Polar:
                    return("Polar");

                case BulkMaterialType.Synthetic:
                    return("Synthetic");

                case BulkMaterialType.BlazeL:
                    return("Blaze");

                case BulkMaterialType.Daemonic:
                    return("Daemonic");

                case BulkMaterialType.Shadow:
                    return("Shadow");

                case BulkMaterialType.Frost:
                    return("Frost");

                case BulkMaterialType.Ethereal:
                    return("Ethereal");
                    //daat9 OWLTR end - custom resources
                }

                break;
            }

            case BODType.Carpentry:
            case BODType.Fletching:
            {
                if (mat == BulkMaterialType.None)
                {
                    return(1079435);
                }

                switch (mat)
                {
                default:
                case BulkMaterialType.OakWood: return(1071428);

                case BulkMaterialType.AshWood: return(1071429);

                case BulkMaterialType.YewWood: return(1071430);

                case BulkMaterialType.Heartwood: return(1071432);

                case BulkMaterialType.Bloodwood: return(1071431);

                case BulkMaterialType.Frostwood: return(1071433);
                }
            }
            }

            return("");
        }
Exemple #39
0
        public static double GetRequiredSkill(BulkMaterialType type)
        {
            double skillReq = 0.0;

            switch (type)
            {
            case BulkMaterialType.DullCopper:
                skillReq = 65.0;
                break;

            case BulkMaterialType.ShadowIron:
                skillReq = 70.0;
                break;

            case BulkMaterialType.Copper:
                skillReq = 75.0;
                break;

            case BulkMaterialType.Bronze:
                skillReq = 80.0;
                break;

            case BulkMaterialType.Gold:
                skillReq = 85.0;
                break;

            case BulkMaterialType.Agapite:
                skillReq = 90.0;
                break;

            case BulkMaterialType.Verite:
                skillReq = 95.0;
                break;

            case BulkMaterialType.Valorite:
                skillReq = 100.0;
                break;

            case BulkMaterialType.Spined:
                skillReq = 65.0;
                break;

            case BulkMaterialType.Horned:
                skillReq = 80.0;
                break;

            case BulkMaterialType.Barbed:
                skillReq = 99.0;
                break;

            case BulkMaterialType.OakWood:
                skillReq = 65.0;
                break;

            case BulkMaterialType.AshWood:
                skillReq = 75.0;
                break;

            case BulkMaterialType.YewWood:
                skillReq = 85.0;
                break;

            case BulkMaterialType.Heartwood:
            case BulkMaterialType.Bloodwood:
            case BulkMaterialType.Frostwood:
                skillReq = 95.0;
                break;
            }

            return(skillReq);
        }
Exemple #40
0
        public static SmallTailorBOD CreateRandomFor(Mobile m)
        {
            SmallBulkEntry[] entries;
            bool             useMaterials = false;

            double theirSkill = m.Skills[SkillName.Tailoring].Base;

            if (useMaterials = Utility.RandomBool() && theirSkill >= 6.2)               // Ugly, but the easiest leather BOD is Leather Cap which requires at least 6.2 skill.
            {
                entries = SmallBulkEntry.TailorLeather;
            }
            else
            {
                entries = SmallBulkEntry.TailorCloth;
            }

            if (entries.Length > 0)
            {
                int amountMax;

                if (theirSkill >= 70.1)
                {
                    amountMax = Utility.RandomList(10, 15, 20, 20);
                }
                else if (theirSkill >= 50.1)
                {
                    amountMax = Utility.RandomList(10, 15, 15, 20);
                }
                else
                {
                    amountMax = Utility.RandomList(10, 10, 15, 20);
                }

                BulkMaterialType material = BulkMaterialType.None;

                if (useMaterials && theirSkill >= 70.1)
                {
                    for (int i = 0; i < 20; ++i)
                    {
                        BulkMaterialType check    = GetRandomMaterial(BulkMaterialType.Spined, m_TailoringMaterialChances);
                        double           skillReq = 0.0;

                        switch (check)
                        {
                        case BulkMaterialType.DullCopper:
                            skillReq = 65.0;
                            break;

                        case BulkMaterialType.Bronze:
                            skillReq = 80.0;
                            break;

                        case BulkMaterialType.Gold:
                            skillReq = 85.0;
                            break;

                        case BulkMaterialType.Agapite:
                            skillReq = 90.0;
                            break;

                        case BulkMaterialType.Verite:
                            skillReq = 95.0;
                            break;

                        case BulkMaterialType.Valorite:
                            skillReq = 100.0;
                            break;

                        case BulkMaterialType.Spined:
                            skillReq = 65.0;
                            break;

                        case BulkMaterialType.Horned:
                            skillReq = 80.0;
                            break;

                        case BulkMaterialType.Barbed:
                            skillReq = 99.0;
                            break;
                        }

                        if (theirSkill >= skillReq)
                        {
                            material = check;
                            break;
                        }
                    }
                }

                double excChance = 0.0;

                if (theirSkill >= 70.1)
                {
                    excChance = (theirSkill + 80.0) / 200.0;
                }

                bool reqExceptional = (excChance > Utility.RandomDouble());

                CraftSystem system = DefTailoring.CraftSystem;

                List <SmallBulkEntry> validEntries = new List <SmallBulkEntry>();

                for (int i = 0; i < entries.Length; ++i)
                {
                    CraftItem item = system.CraftItems.SearchFor(entries[i].Type);

                    if (item != null)
                    {
                        bool   allRequiredSkills = true;
                        double chance            = item.GetSuccessChance(m, null, system, false, ref allRequiredSkills);

                        chance += item.GetTalismanBonus(m, system);

                        if (allRequiredSkills && chance >= 0.0)
                        {
                            if (reqExceptional)
                            {
                                chance = item.GetExceptionalChance(system, chance, m);
                            }

                            if (chance > 0.0)
                            {
                                validEntries.Add(entries[i]);
                            }
                        }
                    }
                }

                if (validEntries.Count > 0)
                {
                    SmallBulkEntry entry = validEntries[Utility.Random(validEntries.Count)];
                    return(new SmallTailorBOD(entry, material, amountMax, reqExceptional));
                }
            }

            return(null);
        }
        public SmallBOD(int hue, int amountMax, Type type, int number, int graphic, bool requireExeptional, BulkMaterialType material, int graphichue = 0)
            : base(Core.AOS ? 0x2258 : 0x14EF)
        {
            this.Weight   = 1.0;
            this.Hue      = hue; // Blacksmith: 0x44E; Tailoring: 0x483
            this.LootType = LootType.Blessed;

            this.m_AmountMax          = amountMax;
            this.m_Type               = type;
            this.m_Number             = number;
            this.m_Graphic            = graphic;
            this.m_GraphicHue         = graphichue;
            this.m_RequireExceptional = requireExeptional;
            this.m_Material           = material;
        }
Exemple #42
0
		public override int ComputeGold( int quantity, bool exceptional, BulkMaterialType material, int itemCount, Type type )
		{
			int[][][] goldTable = ( Core.AOS ? m_AosGoldTable : m_OldGoldTable );

			int typeIndex = (( itemCount == 6 ? 3 : itemCount == 5 ? 2 : itemCount == 4 ? 1 : 0 ) * 2) + (exceptional ? 1 : 0);
			int quanIndex = ( quantity == 20 ? 2 : quantity == 15 ? 1 : 0 );
			int mtrlIndex = ( material == BulkMaterialType.Barbed ? 3 : material == BulkMaterialType.Horned ? 2 : material == BulkMaterialType.Spined ? 1 : 0 );

			int gold = goldTable[typeIndex][quanIndex][mtrlIndex];

			int min = (gold * 9) / 10;
			int max = (gold * 10) / 9;

			return Utility.RandomMinMax( min, max );
		}
Exemple #43
0
 public static BulkMaterialType GetRandomMaterial( BulkMaterialType start, double[] chances )
 {
     return GetRandomMaterial( start, chances, 0.0 );
 }
        public static SmallFletcherBOD CreateRandomFor(Mobile m)
        {
            SmallBulkEntry[] entries;
            bool             useMaterials;

            if (useMaterials = Utility.RandomBool())
            {
                entries = SmallBulkEntry.FletcherAllBow;
            }
            else
            {
                entries = SmallBulkEntry.FletcherAllBow;
            }

            if (entries.Length > 0)
            {
                double theirSkill = m.Skills[SkillName.Fletching].Base;
                int    amountMax;

                if (theirSkill >= 70.1)
                {
                    amountMax = Utility.RandomList(10, 15, 20, 20);
                }
                else if (theirSkill >= 50.1)
                {
                    amountMax = Utility.RandomList(10, 15, 15, 20);
                }
                else
                {
                    amountMax = Utility.RandomList(10, 10, 15, 20);
                }

                BulkMaterialType material = BulkMaterialType.None;

                if (useMaterials && theirSkill >= 70.1)
                {
                    for (int i = 0; i < 20; ++i)
                    {
                        BulkMaterialType check    = GetRandomMaterial(BulkMaterialType.OakWood, m_FletchingMaterialChances);
                        double           skillReq = 0.0;

                        switch (check)
                        {
                        case BulkMaterialType.DullCopper:       skillReq = 52.0; break;

                        case BulkMaterialType.ShadowIron:       skillReq = 56.0; break;

                        case BulkMaterialType.Copper:           skillReq = 60.0; break;

                        case BulkMaterialType.Bronze:           skillReq = 64.0; break;

                        case BulkMaterialType.Gold:                     skillReq = 68.0; break;

                        case BulkMaterialType.Agapite:          skillReq = 72.0; break;

                        case BulkMaterialType.Verite:           skillReq = 76.0; break;

                        case BulkMaterialType.Valorite:         skillReq = 80.0; break;

                        case BulkMaterialType.Blaze:            skillReq = 84.0; break;

                        case BulkMaterialType.Ice:                      skillReq = 88.0; break;

                        case BulkMaterialType.Toxic:            skillReq = 92.0; break;

                        case BulkMaterialType.Electrum:         skillReq = 96.0; break;

                        case BulkMaterialType.Platinum:         skillReq = 100.0; break;

                        case BulkMaterialType.Spined:           skillReq = 64.0; break;

                        case BulkMaterialType.Horned:           skillReq = 68.0; break;

                        case BulkMaterialType.Barbed:           skillReq = 72.0; break;

                        case BulkMaterialType.Polar:            skillReq = 76.0; break;

                        case BulkMaterialType.Synthetic:        skillReq = 80.0; break;

                        case BulkMaterialType.BlazeL:           skillReq = 84.0; break;

                        case BulkMaterialType.Daemonic:         skillReq = 88.0; break;

                        case BulkMaterialType.Shadow:           skillReq = 92.0; break;

                        case BulkMaterialType.Frost:            skillReq = 96.0; break;

                        case BulkMaterialType.Ethereal:         skillReq = 100.0; break;

                        case BulkMaterialType.OakWood: skillReq = 60.0; break;

                        case BulkMaterialType.AshWood: skillReq = 64.0; break;

                        case BulkMaterialType.YewWood: skillReq = 68.0; break;

                        case BulkMaterialType.Heartwood: skillReq = 72.0; break;

                        case BulkMaterialType.Bloodwood: skillReq = 76.0; break;

                        case BulkMaterialType.Frostwood: skillReq = 80.0; break;

                        case BulkMaterialType.Ebony:            skillReq = 84.0; break;

                        case BulkMaterialType.Bamboo:           skillReq = 88.0; break;

                        case BulkMaterialType.PurpleHeart:      skillReq = 92.0; break;

                        case BulkMaterialType.Redwood:          skillReq = 96.0; break;

                        case BulkMaterialType.Petrified:        skillReq = 100.0; break;
                        }

                        if (theirSkill >= skillReq)
                        {
                            material = check;
                            break;
                        }
                    }
                }

                double excChance = 0.0;

                if (theirSkill >= 70.1)
                {
                    excChance = (theirSkill + 80.0) / 200.0;
                }

                bool reqExceptional = (excChance > Utility.RandomDouble());

                SmallBulkEntry entry = null;

                CraftSystem system = DefBowFletching.CraftSystem;

                for (int i = 0; i < 150; ++i)
                {
                    SmallBulkEntry check = entries[Utility.Random(entries.Length)];

                    CraftItem item = system.CraftItems.SearchFor(check.Type);

                    if (item != null)
                    {
                        bool   allRequiredSkills = true;
                        double chance            = item.GetSuccessChance(m, null, system, false, ref allRequiredSkills);

                        if (allRequiredSkills && chance >= 0.0)
                        {
                            if (reqExceptional)
                            {
                                chance = item.GetExceptionalChance(system, chance, m);
                            }

                            if (chance > 0.0)
                            {
                                entry = check;
                                break;
                            }
                        }
                    }
                }

                if (entry != null)
                {
                    return(new SmallFletcherBOD(entry, material, amountMax, reqExceptional));
                }
            }

            return(null);
        }
Exemple #45
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                {
                    m_AmountMax = reader.ReadInt();
                    m_RequireExceptional = reader.ReadBool();
                    m_Material = (BulkMaterialType)reader.ReadInt();

                    m_Entries = new LargeBulkEntry[reader.ReadInt()];

                    for ( int i = 0; i < m_Entries.Length; ++i )
                        m_Entries[i] = new LargeBulkEntry( this, reader );

                    break;
                }
            }

            if ( Weight == 0.0 )
                Weight = 1.0;

            if ( Core.AOS && ItemID == 0x14EF )
                ItemID = 0x2258;

            if ( Parent == null && Map == Map.Internal && Location == Point3D.Zero )
                Delete();
        }
Exemple #46
0
        private static void DocumentTailorBOD( StreamWriter html, ArrayList items, string amt, BulkMaterialType material, Type type )
        {
            bool[] rewards = new bool[20];

            for ( int i = 0; i < items.Count; ++i )
            {
                Item item = (Item)items[i];

                if ( item is Sandals )
                    rewards[5] = true;
                else if ( item is SmallStretchedHideEastDeed || item is SmallStretchedHideSouthDeed )
                    rewards[10] = rewards[11] = true;
                else if ( item is MediumStretchedHideEastDeed || item is MediumStretchedHideSouthDeed )
                    rewards[10] = rewards[11] = true;
                else if ( item is LightFlowerTapestryEastDeed || item is LightFlowerTapestrySouthDeed )
                    rewards[12] = rewards[13] = true;
                else if ( item is DarkFlowerTapestryEastDeed || item is DarkFlowerTapestrySouthDeed )
                    rewards[12] = rewards[13] = true;
                else if ( item is BrownBearRugEastDeed || item is BrownBearRugSouthDeed )
                    rewards[14] = rewards[15] = true;
                else if ( item is PolarBearRugEastDeed || item is PolarBearRugSouthDeed )
                    rewards[14] = rewards[15] = true;
                else if ( item is ClothingBlessDeed )
                    rewards[16] = true;
                else if ( item is PowerScroll )
                {
                    PowerScroll ps = (PowerScroll)item;

                    if ( ps.Value == 105.0 )
                        rewards[6] = true;
                    else if ( ps.Value == 110.0 )
                        rewards[7] = true;
                    else if ( ps.Value == 115.0 )
                        rewards[8] = true;
                    else if ( ps.Value == 120.0 )
                        rewards[9] = true;
                }
                else if ( item is UncutCloth )
                {
                    if ( item.Hue == 0x483 || item.Hue == 0x48C || item.Hue == 0x488 || item.Hue == 0x48A )
                        rewards[0] = true;
                    else if ( item.Hue == 0x495 || item.Hue == 0x48B || item.Hue == 0x486 || item.Hue == 0x485 )
                        rewards[1] = true;
                    else if ( item.Hue == 0x48D || item.Hue == 0x490 || item.Hue == 0x48E || item.Hue == 0x491 )
                        rewards[2] = true;
                    else if ( item.Hue == 0x48F || item.Hue == 0x494 || item.Hue == 0x484 || item.Hue == 0x497 )
                        rewards[3] = true;
                    else
                        rewards[4] = true;
                }
                else if ( item is RunicSewingKit )
                {
                    RunicSewingKit rkit = (RunicSewingKit)item;

                    rewards[16 + CraftResources.GetIndex( rkit.Resource )] = true;
                }

                item.Delete();
            }

            string style = null;
            string name = null;

            switch ( material )
            {
                case BulkMaterialType.None:
                {
                    if ( type.IsSubclassOf( typeof( BaseArmor ) ) || type.IsSubclassOf( typeof( BaseShoes ) ) )
                    {
                        style = "pl";
                        name = "Plain";
                    }
                    else
                    {
                        style = "cl";
                        name = "Cloth";
                    }

                    break;
                }
                case BulkMaterialType.Spined: style = "sp"; name = "Spined"; break;
                case BulkMaterialType.Horned: style = "ho"; name = "Horned"; break;
                case BulkMaterialType.Barbed: style = "ba"; name = "Barbed"; break;
            }

            html.WriteLine( "         <tr>" );
            html.WriteLine( "            <td width=\"250\" class=\"entry\">&nbsp;- {0} <font size=\"1pt\">{1}</font></td>", name, amt );

            int index = 0;

            while ( index < 20 )
            {
                if ( rewards[index] )
                {
                    html.WriteLine( "            <td width=\"25\" class=\"{0}\"><center><b>X</b></center></td>", style );
                    ++index;
                }
                else
                {
                    int count = 0;

                    while ( index < 20 && !rewards[index] )
                    {
                        ++count;
                        ++index;

                        if ( index == 5 || index == 6 || index == 10 || index == 17 )
                            break;
                    }

                    html.WriteLine( "            <td width=\"{0}\"{1} class=\"entry\">&nbsp;</td>", count*25, count==1?"":String.Format( " colspan=\"{0}\"", count ) );
                }
            }

            html.WriteLine( "         </tr>" );
        }
Exemple #47
0
 private SmallSmithBOD(SmallBulkEntry entry, BulkMaterialType mat, int amountMax, bool reqExceptional)
     : base(0x44E, 0, amountMax, entry.Type, entry.Number, entry.Graphic, reqExceptional, mat)
 {
 }
Exemple #48
0
        public object GetMaterialName(BulkMaterialType mat, BODType type, Type itemType)
        {
            switch (type)
            {
            case BODType.Smith:
            {
                switch (mat)
                {
                case BulkMaterialType.None:
                    return(1062226);

                case BulkMaterialType.DullCopper:
                    return(1018332);

                case BulkMaterialType.ShadowIron:
                    return(1018333);

                case BulkMaterialType.Copper:
                    return(1018334);

                case BulkMaterialType.Bronze:
                    return(1018335);

                case BulkMaterialType.Gold:
                    return(1018336);

                case BulkMaterialType.Agapite:
                    return(1018337);

                case BulkMaterialType.Verite:
                    return(1018338);

                case BulkMaterialType.Valorite:
                    return(1018339);
                }

                break;
            }

            case BODType.Tailor:
            {
                switch (mat)
                {
                case BulkMaterialType.None:
                {
                    if (itemType.IsSubclassOf(typeof(BaseArmor)) || itemType.IsSubclassOf(typeof(BaseShoes)))
                    {
                        return(1062235);
                    }

                    return(1044286);
                }

                case BulkMaterialType.Spined:
                    return(1062236);

                case BulkMaterialType.Horned:
                    return(1062237);

                case BulkMaterialType.Barbed:
                    return(1062238);
                }

                break;
            }
            }

            return("Invalid");
        }
Exemple #49
0
		public override int ComputePoints( int quantity, bool exceptional, BulkMaterialType material, int itemCount, Type type )
		{
			int points = 0;

			if ( quantity == 10 )
				points += 10;
			else if ( quantity == 15 )
				points += 25;
			else if ( quantity == 20 )
				points += 50;

			if ( exceptional )
				points += 200;

			if ( itemCount > 1 )
				points += LookupTypePoints( m_Types, type );

			if ( material >= BulkMaterialType.DullCopper && material <= BulkMaterialType.Valorite )
				points += 200 + (50 * (material - BulkMaterialType.DullCopper));

			return points;
		}
 private SmallSmithBOD( SmallBulkEntry entry, BulkMaterialType material, int amountMax, bool reqExceptional, Mobile m )
 {
     this.Mobile = m; //Added by Blady
     this.Hue = 0x44E;
     this.AmountMax = amountMax;
     this.Type = entry.Type;
     this.Number = entry.Number;
     this.Graphic = entry.Graphic;
     this.RequireExceptional = reqExceptional;
     this.Material = material;
 }
Exemple #51
0
		public override int ComputePoints( int quantity, bool exceptional, BulkMaterialType material, int itemCount, Type type )
		{
			int points = 0;

			if ( quantity == 10 )
				points += 10;
			else if ( quantity == 15 )
				points += 25;
			else if ( quantity == 20 )
				points += 50;

			if ( exceptional )
				points += 100;

			if ( itemCount == 4 )
				points += 300;
			else if ( itemCount == 5 )
				points += 400;
			else if ( itemCount == 6 )
				points += 500;

			if ( material == BulkMaterialType.Spined )
				points += 50;
			else if ( material == BulkMaterialType.Horned )
				points += 100;
			else if ( material == BulkMaterialType.Barbed )
				points += 150;

			return points;
		}
Exemple #52
0
        public void EndCombine(Mobile from, object o)
        {
            PlayerMobile pm = from as PlayerMobile;

            Type objectType = o.GetType();

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

                if (!item.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1045158);                       // You must have the item in your backpack to target it.
                }
                else if (m_AmountCur >= m_AmountMax)
                {
                    from.SendLocalizedMessage(1045166);                       // The maximum amount of requested items have already been combined to this deed.
                }
                else if (m_Type == null || (objectType != m_Type && !objectType.IsSubclassOf(m_Type)) || (!(o is BaseWeapon) && !(o is BaseArmor) && !(o is BaseClothing)))
                {
                    from.SendLocalizedMessage(1045169);                       // The item is not in the request.
                }
                else
                {
                    BulkMaterialType material = BulkMaterialType.None;

                    if (o is BaseArmor)
                    {
                        material = GetMaterial(((BaseArmor)o).Resource);
                    }
                    else if (o is BaseClothing)
                    {
                        material = GetMaterial(((BaseClothing)o).Resource);
                    }

                    if (m_Material >= BulkMaterialType.DullCopper && m_Material <= BulkMaterialType.Valorite && material != m_Material)
                    {
                        from.SendLocalizedMessage(1045168);                           // The item is not made from the requested ore.
                    }
                    else if (m_Material >= BulkMaterialType.Spined && m_Material <= BulkMaterialType.Barbed && material != m_Material)
                    {
                        from.SendLocalizedMessage(1049352);                           // The item is not made from the requested leather type.
                    }
                    else
                    {
                        bool isExceptional = false;

                        if (o is BaseWeapon)
                        {
                            isExceptional = ((BaseWeapon)o).Exceptional;
                        }
                        else if (o is BaseArmor)
                        {
                            isExceptional = ((BaseArmor)o).Exceptional;
                        }
                        else if (o is BaseClothing)
                        {
                            isExceptional = ((BaseClothing)o).Exceptional;
                        }

                        if (m_RequireExceptional && !isExceptional)
                        {
                            from.SendLocalizedMessage(1045167);                               // The item must be exceptional.
                        }
                        else
                        {
                            item.Delete();
                            ++AmountCur;

                            from.SendLocalizedMessage(1045170);                               // The item has been combined with the deed.

                            pm.CloseGump <SmallBODGump>();

                            from.SendGump(new SmallBODGump(from, this));

                            if (m_AmountCur < m_AmountMax)
                            {
                                BeginCombine(from);
                            }
                        }
                    }
                }
            }
        }
Exemple #53
0
        private static void DocumentSmithBOD( StreamWriter html, ArrayList items, string amt, BulkMaterialType material )
        {
            bool[] rewards = new bool[24];

            for ( int i = 0; i < items.Count; ++i )
            {
                Item item = (Item)items[i];

                if ( item is SturdyPickaxe || item is SturdyShovel )
                    rewards[0] = true;
                else if ( item is LeatherGlovesOfMining )
                    rewards[1] = true;
                else if ( item is StuddedGlovesOfMining )
                    rewards[2] = true;
                else if ( item is RingmailGlovesOfMining )
                    rewards[3] = true;
                else if ( item is GargoylesPickaxe )
                    rewards[4] = true;
                else if ( item is ProspectorsTool )
                    rewards[5] = true;
                else if ( item is PowderOfTemperament )
                    rewards[6] = true;
                else if ( item is ColoredAnvil )
                    rewards[7] = true;
                else if ( item is PowerScroll )
                {
                    PowerScroll ps = (PowerScroll)item;

                    if ( ps.Value == 105.0 )
                        rewards[8] = true;
                    else if ( ps.Value == 110.0 )
                        rewards[9] = true;
                    else if ( ps.Value == 115.0 )
                        rewards[10] = true;
                    else if ( ps.Value == 120.0 )
                        rewards[11] = true;
                }
                else if ( item is RunicHammer )
                {
                    RunicHammer rh = (RunicHammer)item;

                    rewards[11 + CraftResources.GetIndex( rh.Resource )] = true;
                }
                else if ( item is AncientSmithyHammer )
                {
                    AncientSmithyHammer ash = (AncientSmithyHammer)item;

                    if ( ash.Bonus == 10 )
                        rewards[20] = true;
                    else if ( ash.Bonus == 15 )
                        rewards[21] = true;
                    else if ( ash.Bonus == 30 )
                        rewards[22] = true;
                    else if ( ash.Bonus == 60 )
                        rewards[23] = true;
                }

                item.Delete();
            }

            string style = null;
            string name = null;

            switch ( material )
            {
                case BulkMaterialType.None: style = "ir"; name = "Iron"; break;
                case BulkMaterialType.DullCopper: style = "du"; name = "Dull Copper"; break;
                case BulkMaterialType.ShadowIron: style = "sh"; name = "Shadow Iron"; break;
                case BulkMaterialType.Copper: style = "co"; name = "Copper"; break;
                case BulkMaterialType.Bronze: style = "br"; name = "Bronze"; break;
                case BulkMaterialType.Gold: style = "go"; name = "Gold"; break;
                case BulkMaterialType.Agapite: style = "ag"; name = "Agapite"; break;
                case BulkMaterialType.Verite: style = "ve"; name = "Verite"; break;
                case BulkMaterialType.Valorite: style = "va"; name = "Valorite"; break;
            }

            html.WriteLine( "         <tr>" );
            html.WriteLine( "            <td width=\"250\" class=\"entry\">{0} <font size=\"1pt\">{1}</font></td>", name, amt );

            int index = 0;

            while ( index < 24 )
            {
                if ( rewards[index] )
                {
                    html.WriteLine( "            <td width=\"25\" class=\"{0}\"><center><b>X</b></center></td>", style );
                    ++index;
                }
                else
                {
                    int count = 0;

                    while ( index < 24 && !rewards[index] )
                    {
                        ++count;
                        ++index;

                        if ( index == 4 || index == 8 || index == 12 || index == 20 )
                            break;
                    }

                    html.WriteLine( "            <td width=\"{0}\"{1} class=\"entry\">&nbsp;</td>", count*25, count==1?"":String.Format( " colspan=\"{0}\"", count ) );
                }
            }

            html.WriteLine( "         </tr>" );
        }
Exemple #54
0
        public static SmallSmithBOD CreateRandomFor(Mobile m)
        {
            SmallBulkEntry[] entries;
            bool             useMaterials;

            if (useMaterials = Utility.RandomBool())
            {
                entries = SmallBulkEntry.BlacksmithArmor;
            }
            else
            {
                entries = SmallBulkEntry.BlacksmithWeapons;
            }

            if (entries.Length > 0)
            {
                double theirSkill = m.Skills[SkillName.Blacksmith].Base;
                int    amountMax;

                if (theirSkill >= 70.1)
                {
                    amountMax = Utility.RandomList(10, 15, 20, 20);
                }
                else if (theirSkill >= 50.1)
                {
                    amountMax = Utility.RandomList(10, 15, 15, 20);
                }
                else
                {
                    amountMax = Utility.RandomList(10, 10, 15, 20);
                }

                BulkMaterialType material = BulkMaterialType.None;

                if (useMaterials && theirSkill >= 70.1)
                {
                    for (int i = 0; i < 20; ++i)
                    {
                        BulkMaterialType check    = GetRandomMaterial(BulkMaterialType.DullCopper, m_BlacksmithMaterialChances);
                        double           skillReq = 0.0;

                        switch (check)
                        {
                        case BulkMaterialType.DullCopper: skillReq = 65.0; break;

                        case BulkMaterialType.ShadowIron: skillReq = 70.0; break;

                        case BulkMaterialType.Copper: skillReq = 75.0; break;

                        case BulkMaterialType.Bronze: skillReq = 80.0; break;

                        case BulkMaterialType.Gold: skillReq = 85.0; break;

                        case BulkMaterialType.Agapite: skillReq = 90.0; break;

                        case BulkMaterialType.Verite: skillReq = 95.0; break;

                        case BulkMaterialType.Valorite: skillReq = 100.0; break;

                        case BulkMaterialType.Spined: skillReq = 65.0; break;

                        case BulkMaterialType.Horned: skillReq = 80.0; break;

                        case BulkMaterialType.Barbed: skillReq = 99.0; break;
                        }

                        if (theirSkill >= skillReq)
                        {
                            material = check;
                            break;
                        }
                    }
                }

                double excChance = 0.0;

                if (theirSkill >= 70.1)
                {
                    excChance = (theirSkill + 80.0) / 200.0;
                }

                bool reqExceptional = (excChance > Utility.RandomDouble());

                CraftSystem system = DefBlacksmithy.CraftSystem;

                List <SmallBulkEntry> validEntries = new();

                for (int i = 0; i < entries.Length; ++i)
                {
                    CraftItem item = system.CraftItems.SearchFor(entries[i].Type);

                    if (item != null)
                    {
                        bool   allRequiredSkills = true;
                        double chance            = item.GetSuccessChance(m, null, system, false, ref allRequiredSkills);

                        if (allRequiredSkills && chance >= 0.0)
                        {
                            if (reqExceptional)
                            {
                                chance = item.GetExceptionalChance(system, chance, m);
                            }

                            if (chance > 0.0)
                            {
                                validEntries.Add(entries[i]);
                            }
                        }
                    }
                }

                if (validEntries.Count > 0)
                {
                    SmallBulkEntry entry = validEntries[Utility.Random(validEntries.Count)];
                    return(new SmallSmithBOD(entry, material, amountMax, reqExceptional));
                }
            }

            return(null);
        }
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                {
                    m_AmountCur = reader.ReadInt();
                    m_AmountMax = reader.ReadInt();

                    string type = reader.ReadString();

                    if ( type != null )
                        m_Type = ScriptCompiler.FindTypeByFullName( type );

                    m_Number = reader.ReadInt();
                    m_Graphic = reader.ReadInt();
                    m_RequireExceptional = reader.ReadBool();
                    m_Material = (BulkMaterialType)reader.ReadInt();

                    break;
                }
            }

            if ( Weight == 0.0 )
                Weight = 1.0;

            if ( Core.AOS && ItemID == 0x14EF )
                ItemID = 0x2258;

            if ( Parent == null && Map == Map.Internal && Location == Point3D.Zero )
                Delete();
        }
Exemple #56
0
        public void EndCombine(Mobile from, object o)
        {
            if (o is Item && ((Item)o).IsChildOf(from.Backpack))
            {
                Type objectType = o.GetType();

                if (m_AmountCur >= m_AmountMax)
                {
                    from.SendLocalizedMessage(1045166);                       // The maximum amount of requested items have already been combined to this deed.
                }
                else if (m_Type == null || (objectType != m_Type && !objectType.IsSubclassOf(m_Type)) || (!(o is BaseWeapon) && !(o is BaseArmor) && !(o is BaseClothing)))
                {
                    from.SendLocalizedMessage(1045169);                       // The item is not in the request.
                }
                else
                {
                    BulkMaterialType material = BulkMaterialType.None;

                    if (o is BaseArmor)
                    {
                        material = GetMaterial(((BaseArmor)o).Resource);
                    }
                    else if (o is BaseClothing)
                    {
                        material = GetMaterial(((BaseClothing)o).Resource);
                    }

                    if (m_Material >= BulkMaterialType.Cuivre && m_Material <= BulkMaterialType.Umbrarium && material != m_Material)
                    {
                        from.SendLocalizedMessage(1045168);                           // The item is not made from the requested ore.
                    }

                    /*else if ( m_Material >= BulkMaterialType.Spined && m_Material <= BulkMaterialType.Barbed && material != m_Material )
                     * {
                     *      from.SendLocalizedMessage( 1049352 ); // The item is not made from the requested leather type.
                     * }*/
                    else
                    {
                        bool isExceptional = false;

                        if (o is BaseWeapon)
                        {
                            isExceptional = (((BaseWeapon)o).Quality == WeaponQuality.Exceptional);
                        }
                        else if (o is BaseArmor)
                        {
                            isExceptional = (((BaseArmor)o).Quality == ArmorQuality.Exceptional);
                        }
                        else if (o is BaseClothing)
                        {
                            isExceptional = (((BaseClothing)o).Quality == ClothingQuality.Exceptional);
                        }

                        if (m_RequireExceptional && !isExceptional)
                        {
                            from.SendLocalizedMessage(1045167);                               // The item must be exceptional.
                        }
                        else
                        {
                            ((Item)o).Delete();
                            ++AmountCur;

                            from.SendLocalizedMessage(1045170);                               // The item has been combined with the deed.

                            from.SendGump(new SmallBODGump(from, this));

                            if (m_AmountCur < m_AmountMax)
                            {
                                BeginCombine(from);
                            }
                        }
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(1045158);                   // You must have the item in your backpack to target it.
            }
        }