Наследование: Server.BaseItem, IUsesRemaining
Пример #1
1
        public override int CanCraft( Mobile from, BaseTool tool, Type typeItem )
        {
            if ( tool.Deleted || tool.UsesRemaining < 0 )
                return 1044038; // You have worn out your tool!
            else if ( !BaseTool.CheckAccessible( tool, from ) )
                return 1044263; // The tool must be on your person to use.

            if ( typeItem != null )
            {
                object o = Activator.CreateInstance( typeItem );

                if ( o is SpellScroll )
                {
                    SpellScroll scroll = (SpellScroll)o;
                    Spellbook book = Spellbook.Find( from, scroll.SpellID );

                    bool hasSpell = ( book != null && book.HasSpell( scroll.SpellID ) );

                    scroll.Delete();

                    return ( hasSpell ? 0 : 1042404 ); // null : You don't have that spell!
                }
                else if ( o is Item )
                {
                    ((Item)o).Delete();
                }
            }

            return 0;
        }
Пример #2
0
 public override bool Begin( Mobile from, BaseTool tool )
 {
     if ( tool is MortarPestle )
         return base.Begin(from, tool);
     else
         return false;
 }
Пример #3
0
        public QueryMakersMarkGump(int quality, Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool)
            : base(100, 200)
        {
            from.CloseGump(typeof(QueryMakersMarkGump));

            this.m_Quality = quality;
            this.m_From = from;
            this.m_CraftItem = craftItem;
            this.m_CraftSystem = craftSystem;
            this.m_TypeRes = typeRes;
            this.m_Tool = tool;

            this.AddPage(0);

            this.AddBackground(0, 0, 220, 170, 5054);
            this.AddBackground(10, 10, 200, 150, 3000);

            this.AddHtmlLocalized(20, 20, 180, 80, 1018317, false, false); // Do you wish to place your maker's mark on this item?

            this.AddHtmlLocalized(55, 100, 140, 25, 1011011, false, false); // CONTINUE
            this.AddButton(20, 100, 4005, 4007, 1, GumpButtonType.Reply, 0);

            this.AddHtmlLocalized(55, 125, 140, 25, 1011012, false, false); // CANCEL
            this.AddButton(20, 125, 4005, 4007, 0, GumpButtonType.Reply, 0);
        }
Пример #4
0
		public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
		{
			if ( tool.Deleted || tool.UsesRemaining < 0 )
				return 1044038; // You have worn out your tool!

			return 0;
		}
Пример #5
0
 public MakeNumberCraftPrompt(Mobile from, CraftSystem system, CraftItem item, BaseTool tool)
 {
     m_From = from;
     m_CraftSystem = system;
     m_CraftItem = item;
     m_Tool = tool;
 }
Пример #6
0
        //private string m_PieceName = "None";
        //private int m_PiecePage = 1;
        //private BaseIngot m_Ingot;
        public BStartGump(PlayerMobile crafter, BlackSmithingCraftState craftstate, BaseTool tool, BStartContext context)
            : base(0, 0)
        {
            m_CraftState = craftstate;
            m_Crafter = crafter;
            m_Tool = tool;

            if (context == null)
                m_Context = new BStartContext();
            else
                m_Context = context;

            this.Closable = true;
            this.Disposable = false;
            this.Dragable = true;
            this.Resizable = false;
            this.AddPage(0);

            InitialSetUp();

            if (m_Context.Ingot != null)
                AddResourceImage(m_Context.Ingot);

            switch (m_Context.Page)
            {
                case 1: InitialPiecePage(); break;
                case 2: ArmorPiecePage(); break;
                case 3: WeaponPiecePage(); break;
                case 4: AttackPiecePage(); break;
                case 5: HiltsPage(); break;
                //case 6: EmbellishmentsPage(); break;
            }
        }
Пример #7
0
 public BrewingState( Mobile brewer, BaseTool tool )
 {
     m_Brewer = brewer;
     m_Tool = tool;
     m_Type = PotionType.Drink; // default potion type
     m_Bottle = 3626;
 }
Пример #8
0
        public QueryMakersMarkGump( bool exceptional, Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool, bool questItem )
            : base(100, 200)
        {
            from.CloseGump( typeof( QueryMakersMarkGump ) );

            m_Exceptional = exceptional;
            m_From = from;
            m_CraftItem = craftItem;
            m_CraftSystem = craftSystem;
            m_TypeRes = typeRes;
            m_Tool = tool;
            m_QuestItem = questItem;

            AddPage( 0 );

            AddBackground( 0, 0, 220, 170, 5054 );
            AddBackground( 10, 10, 200, 150, 3000 );

            AddHtmlLocalized( 20, 20, 180, 80, 1018317, false, false ); // Do you wish to place your maker's mark on this item?

            AddHtmlLocalized( 55, 100, 140, 25, 1011036, false, false ); // OKAY
            AddButton( 20, 100, 4005, 4007, 2, GumpButtonType.Reply, 0 );

            AddHtmlLocalized( 55, 125, 140, 25, 1011012, false, false ); // CANCEL
            AddButton( 20, 125, 4005, 4007, 1, GumpButtonType.Reply, 0 );
        }
Пример #9
0
		public override int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
		{
			double magery = from.Skills.Magery.Value - 100;
			
			if ( magery < 0 )
				magery = 0;
					
			int count = (int) Math.Round( magery * Utility.RandomDouble() / 5 );
			
			if ( count > 2 )
				count = 2;
				
			if ( Utility.RandomDouble() < 0.5 )
				count = 0;
			else
				BaseRunicTool.ApplyAttributesTo( this, false, 0, count, 70, 80 );
				
			Attributes.SpellDamage = 25;
			Attributes.LowerManaCost = 10;
			Attributes.CastSpeed = 1;
			Attributes.CastRecovery = 1;
			
			if ( makersMark )
				Crafter = from;
				
			return quality;
		}
Пример #10
0
        public static void Craft( Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem )
        {
            if ( from.Backpack == null )
            {
                from.EndAction( typeof( CraftSystem ) );
                return;
            }

            Timer.DelayCall( TimeSpan.FromSeconds( craftSystem.Delay ), new TimerCallback(
                delegate
                {
                    if ( from.Backpack.GetAmount( typeof( Bottle ) ) < 1 || from.Backpack.GetAmount( typeof( PlantClippings ) ) < 1 )
                    {
                        from.EndAction( typeof( CraftSystem ) );

                        // You don't have the components needed to make that.
                        from.SendGump( new CraftGump( from, craftSystem, tool, 1044253 ) );
                    }
                    else if ( ShouldChooseHue( from ) )
                    {
                        from.SendLocalizedMessage( 1074794 ); // Target the material to use:
                        from.Target = new ClippingsTarget( craftSystem, typeRes, tool, craftItem );
                    }
                    else
                    {
                        from.EndAction( typeof( CraftSystem ) );
                        DoCraft( from, craftSystem, typeRes, tool, craftItem, from.Backpack.FindItemByType<PlantClippings>() );
                    }
                }
            ) );
        }
Пример #11
0
        public override bool Begin( Mobile from, BaseTool tool )
        {
            if ( from.Deleted || !from.Alive || m_Wood == null || m_Wood.Deleted )
                return false;

            if ( !base.Begin( from, tool ) )
                return false;

            if ( m_Wood.IsChildOf( from ) )
            {
                if ( ShowMenu( m_WoodMenu ) )
                {
                    return true;
                }
                else
                {
                    End();
                    return false;
                }
            }
            else
            {
                from.SendAsciiMessage( "That wood belongs to someone else." );
                End();
                return false;
            }
        }
Пример #12
0
        public AutoCraftTimer(Mobile from, CraftSystem system, CraftItem item, BaseTool tool, int amount, TimeSpan delay, TimeSpan interval)
            : base(delay, interval)
        {
            m_From = from;
            m_CraftSystem = system;
            m_CraftItem = item;
            m_Tool = tool;
            m_Amount = amount;
            m_Ticks = 0;
            m_Success = 0;

            CraftContext context = m_CraftSystem.GetContext(m_From);

            if (context != null)
            {
                CraftSubResCol res = (m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes);
                int resIndex = (m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);

                if (resIndex > -1)
                    m_TypeRes = res.GetAt(resIndex).ItemType;
            }

            m_AutoCraftTable[from] = this;

            this.Start();
        }
Пример #13
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            this.ItemID = 0x14F0;
            this.Faction = Faction.Find(from);

            return 1;
        }
Пример #14
0
        public override bool OnCraft( bool exceptional, bool makersMark, Mobile from, Server.Engines.Craft.CraftSystem craftSystem, Type typeRes, BaseTool tool, Server.Engines.Craft.CraftItem craftItem, int resHue )
        {
            if ( exceptional )
                ArmorAttributes.MageArmor = 1;

            return base.OnCraft( exceptional, makersMark, from, craftSystem, typeRes, tool, craftItem, resHue );
        }
Пример #15
0
 public InternalTarget( CraftSystem craftSystem, double skill_level, Item contract )
     : base(2, false, TargetFlags.None)
 {
     m_CraftSystem = craftSystem;
     m_Tool = null;
     m_SkillLevel = skill_level;
     m_Contract = contract;
 }
Пример #16
0
 public CartographyMenu(Mobile m, ItemListEntry[] entries, string Is, BaseTool tool)
     : base("Attempt what scale of map?", entries)
 {
     m_Mobile = m;
     IsFrom = Is;
     m_Tool = tool;
     m_Entries = entries;
 }
Пример #17
0
 public AlchemyMenu(Mobile m, ItemListEntry[] entries, string Is, BaseTool tool)
     : base("Choose a formula.", entries)
 {
     m_Mobile = m;
     IsFrom = Is;
     m_Tool = tool;
     m_Entries = entries;
 }
Пример #18
0
		public override int CanCraft( Mobile from, BaseTool tool, Type itemType ) {
			if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
				return 1044038; // You have worn out your tool!
			else if( !BaseTool.CheckAccessible( tool, from ) )
				return 1044263; // The tool must be on your person to use.

			return 0;
		}
Пример #19
0
 public BlacksmithMenu(Mobile m, ItemListEntry[] entries, string Is, BaseTool tool)
     : base("What would you like to make?", entries)
 {
     m_Mobile = m;
     IsFrom = Is;
     m_Tool = tool;
     m_Entries = entries;
 }
Пример #20
0
 public TinkeringMenu(Mobile m, ItemListEntry[] entries, string Is, BaseTool tool)
     : base("Choose an item.", entries)
 {
     m_Mobile = m;
     IsFrom = Is;
     m_Tool = tool;
     m_Entries = entries;
 }
Пример #21
0
 public CraftState( Mobile crafter, BaseTool tool, int componentAmount )
 {
     m_Crafter = crafter;
     m_Tool = tool;
     m_GumpComponents = new GumpComponent[componentAmount];
     for ( int i = 0; i < componentAmount; i++ )
         m_GumpComponents[i] = new GumpComponent();
 }
Пример #22
0
        public CraftGumpItem( Mobile from, CraftSystem craftSystem, CraftItem craftItem, BaseTool tool )
            : base(40, 40)
        {
            m_From = from;
            m_CraftSystem = craftSystem;
            m_CraftItem = craftItem;
            m_Tool = tool;

            from.CloseGump( typeof( CraftGump ) );
            from.CloseGump( typeof( CraftGumpItem ) );

            AddPage( 0 );
            AddBackground( 0, 0, 530, 417, 5054 );
            AddImageTiled( 10, 10, 510, 22, 2624 );
            AddImageTiled( 10, 37, 150, 148, 2624 );
            AddImageTiled( 165, 37, 355, 90, 2624 );
            AddImageTiled( 10, 190, 155, 22, 2624 );
            AddImageTiled( 10, 217, 150, 53, 2624 );
            AddImageTiled( 165, 132, 355, 80, 2624 );
            AddImageTiled( 10, 275, 155, 22, 2624 );
            AddImageTiled( 10, 302, 150, 53, 2624 );
            AddImageTiled( 165, 217, 355, 80, 2624 );
            AddImageTiled( 10, 360, 155, 22, 2624 );
            AddImageTiled( 165, 302, 355, 80, 2624 );
            AddImageTiled( 10, 387, 510, 22, 2624 );
            AddAlphaRegion( 10, 10, 510, 399 );

            AddHtmlLocalized( 170, 40, 150, 20, 1044053, LabelColor, false, false ); // ITEM
            AddHtmlLocalized( 10, 192, 150, 22, 1044054, LabelColor, false, false ); // <CENTER>SKILLS</CENTER>
            AddHtmlLocalized( 10, 277, 150, 22, 1044055, LabelColor, false, false ); // <CENTER>MATERIALS</CENTER>
            AddHtmlLocalized( 10, 362, 150, 22, 1044056, LabelColor, false, false ); // <CENTER>OTHER</CENTER>

            if ( craftSystem.GumpTitleNumber > 0 )
                AddHtmlLocalized( 10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false );
            else
                AddHtml( 10, 12, 510, 20, craftSystem.GumpTitleString, false, false );

            AddButton( 15, 387, 4014, 4016, 0, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 50, 390, 150, 18, 1044150, LabelColor, false, false ); // BACK

            AddButton( 270, 387, 4005, 4007, 1, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 305, 390, 150, 18, 1044151, LabelColor, false, false ); // MAKE NOW

            if ( craftItem.NameNumber > 0 )
                AddHtmlLocalized( 330, 40, 180, 18, craftItem.NameNumber, LabelColor, false, false );
            else
                AddLabel( 330, 40, LabelHue, craftItem.NameString );

            if ( craftItem.UseAllRes )
                AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1048176, LabelColor, false, false ); // Makes as many as possible at once

            DrawItem();
            DrawSkill();
            DrawRessource();

            if( craftItem.RequiresSE )
                AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1063363, LabelColor, false, false ); //* Requires the "Samurai Empire" expansion
        }
Пример #23
0
		public virtual int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
		{
			if ( makersMark )
				Crafter = from;

			m_Quality = (RuneQuality)quality;

			return quality;
		}
Пример #24
0
		public CustomCraft( Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool, bool exceptional )
		{
			m_From = from;
			m_CraftItem = craftItem;
			m_CraftSystem = craftSystem;
			m_TypeRes = typeRes;
			m_Tool = tool;
			m_Exceptional = exceptional;
		}
Пример #25
0
		public override int CanCraft( Mobile from, BaseTool tool, Type typeItem )
		{
			if ( tool.Deleted || tool.UsesRemaining < 0 )
				return 1044038; // You have worn out your tool!
			else if ( !BaseTool.CheckAccessible( tool, from ) )
				return 1044263; // The tool must be on your person to use.

			if ( typeItem != null )
			{
				object o = Activator.CreateInstance( typeItem );

				if ( o is SpellScroll )
				{
					SpellScroll scroll = (SpellScroll)o;
					Spellbook book = Spellbook.Find( from, scroll.SpellID );

					bool hasSpell = ( book != null && book.HasSpell( scroll.SpellID ) );

					scroll.Delete();

					//return ( hasSpell ? 0 : 1042404 ); // null : You don't have that spell!
					if( hasSpell )
					{
						//GetCastSkills
						Server.Spells.Spell spell = Server.Spells.SpellRegistry.NewSpell( scroll.SpellID, from, null );
						if( spell == null )
						{
							return 0;
						}
						else
						{
							double minmagery = 0.0;
							double maxmagery = 0.0;
							spell.GetCastSkills( out minmagery, out maxmagery );
							if( minmagery > from.Skills.Magery.Value )
							{
								return 1044153; // You don't have the required skills to attempt this item.
							}
							else
							{
								return 0;
							}
						}
					}
					else
					{
						return 1042404; // You don't have that spell!
					}
				}
				else if ( o is Item )
				{
					((Item)o).Delete();
				}
			}

			return 0;
		}
Пример #26
0
		public override int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
		{
			Quality = (ClothingQuality)quality;

			if( Quality == ClothingQuality.Exceptional )
				DistributeBonuses( (tool is BaseRunicTool ? 6 : (Core.SE ? 15 : 14)) );	//BLAME OSI. (We can't confirm it's an OSI bug yet.)

			return base.OnCraft( quality, makersMark, from, craftSystem, typeRes, tool, craftItem, resHue );
		}
Пример #27
0
 public CustomCraft(Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool, int quality)
 {
     this.m_From = from;
     this.m_CraftItem = craftItem;
     this.m_CraftSystem = craftSystem;
     this.m_TypeRes = typeRes;
     this.m_Tool = tool;
     this.m_Quality = quality;
 }
Пример #28
0
        public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
        {
            if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
                return 1044038; // You have worn out your tool!
            else if ( !(from is PlayerMobile && ((PlayerMobile)from).Feats.GetFeatLevel(FeatList.Painter) > 0 ) )
                return 1063492; // You lack the required feat.

            return 0;
        }
Пример #29
0
        public override string CanCraft( Mobile from, BaseTool tool, Type itemType )
        {
            if ( tool.Deleted || tool.UsesRemaining < 0 )
                return "You have worn out your tool!";
            else if ( !BaseTool.CheckAccessible( tool, from ) )
                return "The tool must be on your person to use.";

            return "";
        }
		public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
		{
			if ( tool.Deleted || tool.UsesRemaining < 0 )
				return 1044038; // You have worn out your tool!
			else if ( !BaseTool.CheckAccessible( tool, from ) )
				return 1044263; // The tool must be on your person to use.
			else if ( itemType != null && ( itemType.IsSubclassOf( typeof( BaseFactionTrapDeed ) ) || itemType == typeof( FactionTrapRemovalKit ) ) && Faction.Find( from ) == null )
				return 1044573; // You have to be in a faction to do that.

			return 0;
		}
Пример #31
0
        public override int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            Quality = (ItemQuality)quality;

            if (makersMark)
            {
                Crafter = from;
            }

            Type resourceType = typeRes;

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

            Resource = CraftResources.GetFromType(resourceType);

            PlayerConstructed = true;

            CraftContext context = craftSystem.GetContext(from);

            Hue = CraftResources.GetHue(Resource);

            return(quality);
        }
Пример #32
0
        public override bool OnCraft(bool exceptional, 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;
            }

            var resource = CraftResources.GetFromType(resourceType);

            Hue = CraftResources.GetHue(resource);

            return(base.OnCraft(exceptional, makersMark, from, craftSystem, null, tool, craftItem, resHue));
        }
Пример #33
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            if (quality == 2)
            {
                UsesRemaining *= 2;
            }

            return(quality);
        }
		public int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
		{

			//STARTMOD: Teiravon chestmod

			Type resourceType = typeRes;

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

			Resource = CraftResources.GetFromType( resourceType );

			//ENDMOD: Teiravon chestmod


			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 1;
		}
Пример #35
0
        public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            if (quality >= 2)
            {
                m_Exceptional = true;

                if (makersMark)
                {
                    m_Crafter = from;
                }
            }

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

            CraftResource resource = CraftResources.GetFromType(typeRes);

            Hue = CraftResources.GetHue(resource);

            return(quality);
        }
Пример #36
0
        public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            if (makersMark)
            {
                Crafter = from;
            }

            m_Quality = (BookQuality)(quality - 1);

            return(quality);
        }
Пример #37
0
 public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
 {
     CraftInit(from);
     return(1);
 }
Пример #38
0
        public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            Quality = (FouetQuality)quality;

            Crafter = from;

            Type resourceType = typeRes;

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

            Resource          = CraftResources.GetFromType(resourceType);
            PlayerConstructed = true;

            CraftContext context = craftSystem.GetContext(from);

            RareteInit.InitItem(this, quality, Crafter);

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

            return(quality);
        }
Пример #39
0
        public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool 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);
            }

            return(quality);
        }
Пример #40
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            if (craftSystem is DefAlchemy)
            {
                Container pack = from.Backpack;

                if (pack != null)
                {
                    // Genova: suporte ao UO:ML.
                    #region Mondain's Legacy
                    if ((int)PotionEffect >= (int)PotionEffect.Invisibility)
                    {
                        return(1);
                    }
                    #endregion

                    List <PotionKeg> kegs = pack.FindItemsByType <PotionKeg>();

                    for (int i = 0; i < kegs.Count; ++i)
                    {
                        PotionKeg keg = kegs[i];

                        if (keg == null)
                        {
                            continue;
                        }

                        if (keg.Held <= 0 || keg.Held >= 100)
                        {
                            continue;
                        }

                        if (keg.Type != PotionEffect)
                        {
                            continue;
                        }

                        ++keg.Held;

                        Consume();
                        from.AddToBackpack(new Bottle());

                        return(-1);                        // signal placed in keg
                    }
                }
            }

            return(1);
        }
Пример #41
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            Quality = (ToolQuality)quality;

            if (makersMark)
            {
                Crafter = from;
            }

            return(quality);
        }
Пример #42
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;
            }

            Resource = CraftResources.GetFromType(resourceType);

            CraftContext context = craftSystem.GetContext(from);

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

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

            return(1);
        }
Пример #43
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            int charges = 5 + quality + (int)(from.Skills[SkillName.Inscribe].Value / 30);

            if (charges > 10)
            {
                charges = 10;
            }

            MaxCharges = charges;

            if (makersMark)
            {
                Crafter = from;
            }

            m_Quality = (BookQuality)(quality - 1);

            return(quality);
        }
        public override int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            if (resHue > 0)
            {
                Hue = resHue;
            }

            Type resourceType = typeRes;

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

            Resource = CraftResources.GetFromType(resourceType);

            switch (Resource)
            {
            case CraftResource.Bloodwood: Attributes.RegenHits = 2; break;

            case CraftResource.Heartwood: Attributes.Luck = 40; break;

            case CraftResource.YewWood: Attributes.RegenHits = 1; break;
            }

            return(0);
        }
Пример #45
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool 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);
            }

            CraftContext context = craftSystem.GetContext(from);

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

            //daat99 OWLTR start - runic jewels
            if (Core.AOS && tool is BaseRunicTool && OWLTROptionsManager.IsEnabled(OWLTROptionsManager.OPTIONS_ENUM.RECIPE_CRAFT))
            {
                ((BaseRunicTool)tool).ApplyAttributesTo(this);
            }
            //daat99 OWLTR end - reunic jewels

            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);
        }
Пример #46
0
        public override int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            Quality = (ClothingQuality)quality;

            if (Quality == ClothingQuality.Exceptional)
            {
                DistributeBonuses((tool is BaseRunicTool ? 6 : (Core.SE ? 15 : 14)));                   //BLAME OSI. (We can't confirm it's an OSI bug yet.)
            }
            return(base.OnCraft(quality, makersMark, from, craftSystem, typeRes, tool, craftItem, resHue));
        }
Пример #47
0
        public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            Quality = (ClothingQuality)quality;

            if (makersMark)
            {
                Crafter = from;
            }

            if (DefaultResource != CraftResource.None)
            {
                Type resourceType = typeRes;

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

                Resource = CraftResources.GetFromType(resourceType);
            }
            else
            {
                Hue = resHue;
            }

            PlayerConstructed = true;

            CraftContext context = craftSystem.GetContext(from);

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

            return(quality);
        }
Пример #48
0
        public int OnCraft(int 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.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(1);
        }
Пример #49
0
        public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            int magery = from.Skills.Magery.BaseFixedPoint;

            if (magery >= 800)
            {
                int[] propertyCounts;
                int   minIntensity;
                int   maxIntensity;

                if (magery >= 1000)
                {
                    if (magery >= 1200)
                    {
                        propertyCounts = m_LegendPropertyCounts;
                    }
                    else if (magery >= 1100)
                    {
                        propertyCounts = m_ElderPropertyCounts;
                    }
                    else
                    {
                        propertyCounts = m_GrandPropertyCounts;
                    }

                    minIntensity = 55;
                    maxIntensity = 75;
                }
                else if (magery >= 900)
                {
                    propertyCounts = m_MasterPropertyCounts;
                    minIntensity   = 25;
                    maxIntensity   = 45;
                }
                else
                {
                    propertyCounts = m_AdeptPropertyCounts;
                    minIntensity   = 0;
                    maxIntensity   = 15;
                }

                int propertyCount = propertyCounts[Utility.Random(propertyCounts.Length)];

                BaseRunicTool.ApplyAttributesTo(this, true, 0, propertyCount, minIntensity, maxIntensity);
            }

            if (makersMark)
            {
                Crafter = from;
            }

            #region Mondain's Legacy
            m_Quality = (BookQuality)(quality - 1);
            #endregion

            return(quality);
        }
Пример #50
0
        public bool OnCraft(bool exceptional, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            Exceptional = exceptional;

            if (makersMark)
            {
                Crafter = from;
            }

            PlayerConstructed = true;

            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(exceptional);
        }
Пример #51
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            Quality = (MeadQuality)quality;

            if (makersMark)
            {
                Crafter = from;
            }

            Item[] items = from.Backpack.FindItemsByType(typeof(BreweryLabelMaker));

            if (items.Length != 0)
            {
                foreach (BreweryLabelMaker lm in items)
                {
                    if (lm.BreweryName != null)
                    {
                        this.Name = lm.BreweryName;
                        break;
                    }
                }
            }

            Type resourceType = typeRes;

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

            Variety = BrewingResources.GetFromType(resourceType);

            CraftContext context = craftSystem.GetContext(from);

            Hue = 0;

            return(quality);
        }
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            if (Core.ML)
            {
                Quality = (CraftQuality)quality;

                Type resourceType = typeRes;

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

                Resource = CraftResources.GetFromType(resourceType);

                CraftContext context = craftSystem.GetContext(from);

                if (context != null && context.DoNotColor)
                {
                    Resource = DefaultResource;
                }

                if (makersMark)
                {
                    Crafter = from;
                }
            }

            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);
        }
Пример #53
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            if (craftSystem is DefAlchemy)
            {
                Container pack = from.Backpack;

                if (pack != null)
                {
                    Item[] kegs = pack.FindItemsByType(typeof(PotionKeg), true);

                    for (int i = 0; i < kegs.Length; ++i)
                    {
                        PotionKeg keg = kegs[i] as PotionKeg;

                        if (keg == null)
                        {
                            continue;
                        }

                        if (keg.Held <= 0 || keg.Held >= 100)
                        {
                            continue;
                        }

                        if (keg.Type != PotionEffect)
                        {
                            continue;
                        }

                        ++keg.Held;

                        Delete();
                        from.AddToBackpack(new Bottle());

                        return(-1);                        // signal placed in keg
                    }
                }
            }

            return(1);
        }
Пример #54
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            Exceptional = (quality >= 2);

            if (makersMark)
            {
                Crafter = from;
            }

            Type resourceType = typeRes;

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

            Resource = CraftResources.GetFromType(resourceType);

            CraftContext context = craftSystem.GetContext(from);

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

            return(quality);
        }
Пример #55
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            int charges = 5 + quality + (int)(from.Skills[SkillName.Inscribe].Value / 30);

            if (charges > 10)
            {
                charges = 10;
            }

            MaxCharges = (Core.SE ? charges * 2 : charges);

            return(quality);
        }
Пример #56
0
        public virtual 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;
            }

            this.Resource = CraftResources.GetFromType(resourceType);

            CraftContext context = craftSystem.GetContext(from);

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

            return(quality);
        }
Пример #57
0
        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            if (craftSystem is DefAlchemy)
            {
                Container pack = from.Backpack;

                if (pack != null)
                {
                    if ((int)PotionEffect >= (int)PotionEffect.Invisibility)
                    {
                        return(1);
                    }

                    List <PotionKeg> kegs = pack.FindItemsByType <PotionKeg>();

                    foreach (var keg in kegs)
                    {
                        if (keg == null)
                        {
                            continue;
                        }

                        if (keg.Held <= 0 || keg.Held >= 100)
                        {
                            continue;
                        }

                        if (keg.Type != PotionEffect)
                        {
                            continue;
                        }

                        ++keg.Held;

                        Consume();
                        @from.AddToBackpack(new Bottle());

                        return(-1); // signal placed in keg
                    }
                }
            }

            return(1);
        }
Пример #58
0
        public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            this.Quality = (ClothingQuality)quality;

            if (makersMark)
            {
                this.Crafter = from;
            }

            return(quality);
        }
Пример #59
0
        public virtual int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            Quality = (ItemQuality)quality;

            return(quality);
        }
Пример #60
0
        public override bool OnCraft(bool exceptional, bool makersMark, Mobile from, Server.Engines.Craft.CraftSystem craftSystem, Type typeRes, BaseTool tool, Server.Engines.Craft.CraftItem craftItem, int resHue)
        {
            if (exceptional)
            {
                ArmorAttributes.MageArmor = 1;
            }

            return(base.OnCraft(exceptional, makersMark, from, craftSystem, typeRes, tool, craftItem, resHue));
        }