ItemIDOf() 공개 정적인 메소드

public static ItemIDOf ( Type type ) : int
type System.Type
리턴 int
        public void DrawItem()
        {
#if old
            Item item = Activator.CreateInstance(m_CraftItem.ItemType) as Item;

            if (item != null)
            {
                AddItem(20, 50, item.ItemID);

                if (item is DragonBardingDeed || item is BaseArmor || item is BaseWeapon || item is BaseClothing ||
                    item is BaseInstrument || item is BaseTool || item is BaseHarvestTool || item is Runebook ||
                    item is BaseJewel || item is Bola)
                {
                    AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 310, 18, 1044059, LabelColor, false, false);                      // This item may hold its maker's mark
                    m_ShowExceptionalChance = true;
                }
                item.Delete();
            }
#else
            Type type = m_CraftItem.ItemType;

            AddItem(20, 50, CraftItem.ItemIDOf(type));

            if (m_CraftItem.IsMarkable(type))
            {
                AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 310, 18, 1044059, LabelColor, false, false);                    // This item may hold its maker's mark
                m_ShowExceptionalChance = true;
            }
#endif
        }
예제 #2
0
        public void DrawItem()
        {
            Type type = m_CraftItem.ItemType;

            int itemID      = CraftItem.ItemIDOf(type);
            int originalHue = 0;

            Item itemCopy = null;

            try { itemCopy = Activator.CreateInstance(type) as Item; }
            catch { }

            if (itemCopy != null)
            {
                originalHue = itemCopy.Hue;
                itemCopy.Delete();
            }

            int itemHue = originalHue;

            if (CraftItem.RetainsColor(type))
            {
                CraftContext context = m_CraftSystem.GetContext(m_From);

                if (context != null)
                {
                    CraftSubResCol craftSubRes = (m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes);

                    int resIndex = -1;

                    resIndex = (m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);

                    if (resIndex == -1)
                    {
                        resIndex = 0;
                    }

                    CraftSubRes resource = craftSubRes.GetAt(resIndex);

                    //Apply Different Material Color
                    if (resIndex > 0)
                    {
                        itemHue = CraftItem.BaseHueOf(resource.ItemType);
                    }
                }
            }

            AddItem(20, 50, itemID, itemHue);

            if (m_CraftItem.IsMarkable(type))
            {
                AddHtmlLocalized(20, 335 + (m_OtherCount++ *20), 310, 18, 1044059, LabelColor, false, false);                    // This item may hold its maker's mark
                m_ShowExceptionalChance = true;
            }
        }
예제 #3
0
		private void AddNecroSpell( int spell, int mana, double minSkill, Type type, params Type[] regs )
		{
			int index = AddCraft( type, 1061677, 1060509 + spell, minSkill, minSkill + 1.0, regs[0], 1020000 + CraftItem.ItemIDOf( regs[0] ), 1, 501627 );	//Yes, on OSI it's only 1.0 skill diff'.  Don't blame me, blame OSI.

			for ( int i = 1; i < regs.Length; ++i )
				AddRes( index, regs[i], 1020000 + CraftItem.ItemIDOf( regs[i] ), 1, 501627 );

			AddRes( index, typeof( BlankScroll ), 1044377, 1, 1044378 );

			SetManaReq( index, mana );
		}
예제 #4
0
        private void AddNecroSpell(int spell, int mana, double minSkill, Type type, params Type[] regs)
        {
            int id = CraftItem.ItemIDOf(regs[0]);

            int index = AddCraft(type, 1061677, 1060509 + spell, minSkill, minSkill + 1.0, regs[0], id < 0x4000 ? 1020000 + id : 1078872 + id, 1, 501627);              //Yes, on OSI it's only 1.0 skill diff'.  Don't blame me, blame OSI.

            for (int i = 1; i < regs.Length; ++i)
            {
                id = CraftItem.ItemIDOf(regs[i]);
                AddRes(index, regs[i], id < 0x4000 ? 1020000 + id : 1078872 + id, 1, 501627);
            }
        }
예제 #5
0
        public void DrawItem()
        {
            Type type = m_CraftItem.ItemType;

            AddItem(20, 50, CraftItem.ItemIDOf(type));

            if (m_CraftItem.IsMarkable(type))
            {
                AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 310, 18, 1044059, LabelColor, false, false);                    // This item may hold its maker's mark
                m_ShowExceptionalChance = true;
            }
        }
예제 #6
0
        private void AddMysticSpell(string spell, int mana, double minSkill, Type type, params Type[] regs)
        {
            int index = this.AddCraft(type, "Spells of Mysticism", spell, minSkill, minSkill + 1.0, regs[0], 1020000 + CraftItem.ItemIDOf(regs[0]), 1, 501627);

            for (int i = 1; i < regs.Length; ++i)
            {
                this.AddRes(index, regs[i], 1020000 + CraftItem.ItemIDOf(regs[i]), 1, 501627);
            }

            this.AddRes(index, typeof(Bloodspawn), 1023964, 1, "You do not have enough Bloodspawn to Etch this spell.");

            this.SetManaReq(index, mana);
        }
예제 #7
0
        private void AddSpellWeavingSpell(string spell, int mana, double minSkill, Type type, params Type[] regs)
        {
            int index = this.AddCraft(type, "Spells Weaving", spell, minSkill, minSkill + 1.0, regs[0], 1020000 + CraftItem.ItemIDOf(regs[0]), 1, 501627);

            for (int i = 1; i < regs.Length; ++i)
            {
                this.AddRes(index, regs[i], 1020000 + CraftItem.ItemIDOf(regs[i]), 1, 501627);
            }

            this.AddRes(index, typeof(Pumice), 1023979, 1, "You do not have enough Pumice to Etch this spell.");

            this.SetManaReq(index, mana);
        }
예제 #8
0
        private void AddPaladinSpell(string spell, int mana, double minSkill, Type type, params Type[] regs)
        {
            int index = this.AddCraft(type, "Paladin Abilities", spell, minSkill, minSkill + 1.0, regs[0], 1020000 + CraftItem.ItemIDOf(regs[0]), 1, 501627);

            for (int i = 1; i < regs.Length; ++i)
            {
                this.AddRes(index, regs[i], 1020000 + CraftItem.ItemIDOf(regs[i]), 1, 501627);
            }

            this.AddRes(index, typeof(WyrmsHeart), 1023985, 1, "You do not have enough Wyrm's Heart to Etch this spell.");

            this.SetManaReq(index, mana);
        }
예제 #9
0
        private void AddMysticSpell(string spell, int mana, double minSkill, Type type, params Type[] regs)
        {
            int index = this.AddCraft(type, "Spells of Mysticism", spell, minSkill, minSkill + 1.0, regs[0], 1020000 + CraftItem.ItemIDOf(regs[0]), 1, 501627); //Yes, on OSI it's only 1.0 skill diff'.  Don't blame me, blame OSI.

            for (int i = 1; i < regs.Length; ++i)
            {
                this.AddRes(index, regs[i], 1020000 + CraftItem.ItemIDOf(regs[i]), 1, 501627);
            }

            this.AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378);

            this.SetManaReq(index, mana);
        }
예제 #10
0
        public void DrawItem()
        {
            Type        type = m_CraftItem.ItemType;
            int         id   = CraftItem.ItemIDOf(type);
            Rectangle2D b    = ItemBounds.Table[id];

            AddItem(90 - b.Width / 2 - b.X, 110 - b.Height / 2 - b.Y, id, m_CraftItem.ItemHue);

            if (m_CraftItem.IsMarkable(type))
            {
                AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 310, 18, 1044059, LabelColor, false, false);  // This item may hold its maker's mark
                m_ShowExceptionalChance = true;
            }
        }
예제 #11
0
        public override bool RetainsColorFrom(CraftItem item, Type type)
        {
            if ((item.ItemType.IsDefined(typeof(FurnitureAttribute), false)) &&
                ((TileData.ItemTable[CraftItem.ItemIDOf(item.ItemType)].Flags & TileFlag.PartialHue) == 0))
            {
                return(true);
            }

            if ((type == typeof(BarrelStaves)) || (item.ItemType == typeof(BarrelStaves)))
            {
                return(true);
            }

            return(false);
        }
예제 #12
0
        private void AddChivSpell(int spell, string spellName, int mana, double minSkill, Type type, RecipeName rec, params Type[] regs)
        {
            int id    = CraftItem.ItemIDOf(regs[0]);
            int index = AddCraft(type, 1061677, spellName, minSkill, minSkill + 30, regs[0], id < 0x4000 ? 1020000 + id : 1078872 + id, 1);

            AddRecipe(index, (int)rec);
            for (int i = 1; i < regs.Length; ++i)
            {
                id = CraftItem.ItemIDOf(regs[i]);
                AddRes(index, regs[i], id < 0x4000 ? 1020000 + id : 1078872 + id, 5, 501627);
            }

            AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378);

            SetManaReq(index, mana);
        }
예제 #13
0
        private void AddNecroSpell(int spell, int mana, double minSkill, Type type, params Type[] regs)
        {
            int id = CraftItem.ItemIDOf(regs[0]);

            int index = AddCraft(1, type, 1061677, 1060509 + spell, minSkill, minSkill + 1.0, regs[0], id < 0x4000 ? 1020000 + id : 1078872 + id, 1, 501627);

            for (int i = 1; i < regs.Length; ++i)
            {
                id = CraftItem.ItemIDOf(regs[i]);
                AddRes(index, regs[i], id < 0x4000 ? 1020000 + id : 1078872 + id, 1, 501627);
            }

            AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378);

            SetManaReq(index, mana);
        }
예제 #14
0
        private void AddNecroSpell(int spell, int mana, double minSkill, Type type, params Type[] regs)
        {
            int id = CraftItem.ItemIDOf(regs[0]);

            int index = this.AddCraft(type, 1061677, 1060509 + spell, minSkill, minSkill + 1.0, regs[0], id < 0x4000 ? 1020000 + id : 1078872 + id, 1, 501627); //Yes, on OSI it's only 1.0 skill diff'.  Don't blame me, blame OSI.

            for (int i = 1; i < regs.Length; ++i)
            {
                id = CraftItem.ItemIDOf(regs[i]);
                this.AddRes(index, regs[i], id < 0x4000 ? 1020000 + id : 1078872 + id, 1, 501627);
            }

            this.AddRes(index, typeof(Obsidian), 1023977, 1, "You do not have enough Obsidian to Etch this spell.");

            this.SetManaReq(index, mana);
        }
예제 #15
0
        public void DrawItem()
        {
            Type type = m_CraftItem.ItemType;

            int itemID = m_CraftItem.ForceGumpItemID ? m_CraftItem.GumpItemID : CraftItem.ItemIDOf(type);

            if (!type.IsSubclassOf(typeof(BaseAddonDeed)) || type.IsDefined(typeof(CraftItemIDAttribute), true))
            {
                AddItem(20, 50, itemID);
            }

            if (m_CraftItem.IsMarkable(type))
            {
                AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 310, 18, 1044059, LabelColor, false, false);                    // This item may hold its maker's mark
                m_ShowExceptionalChance = true;
            }
        }
예제 #16
0
        private void AddNecroSpell(int spell, int mana, double minSkill, Type type, RecipeName rec, params Type[] regs)
        {
            int id = CraftItem.ItemIDOf(regs[0]);

            int index = AddCraft(type, 1061677, 1060509 + spell, minSkill, minSkill + 30.0, regs[0], id < 0x4000 ? 1020000 + id : 1078872 + id, 1, 501627);             //Yes, on OSI it's only 1.0 skill diff'.  Don't blame me, blame OSI.

            AddRecipe(index, (int)rec);
            for (int i = 1; i < regs.Length; ++i)
            {
                id = CraftItem.ItemIDOf(regs[i]);
                AddRes(index, regs[i], id < 0x4000 ? 1020000 + id : 1078872 + id, 5, 501627);
            }

            AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378);

            SetManaReq(index, mana);
        }
예제 #17
0
        public void DrawItem()
        {
            Type type = m_CraftItem.ItemType;
            int  hue  = m_CraftItem.ItemHue;

            if (m_Context.LastResourceIndex > 0)
            {
                var info = CraftResources.GetFromType(m_CraftItem.Resources.GetAt(0).ItemType);
                hue = CraftResources.GetHue(info);
            }
            AddItem(20, 50, CraftItem.ItemIDOf(type), hue);

            if (m_CraftItem.IsMarkable(type))
            {
                AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 310, 18, 1044059, LabelColor, false, false);                    // This item may hold its maker's mark
                m_ShowExceptionalChance = true;
            }
        }
예제 #18
0
        public void DrawItem()
        {
            try
            {
                Type type = m_CraftItem.ItemType;

                AddItem(20, 50, CraftItem.ItemIDOf(type));

                if (m_CraftItem.IsMarkable(type))
                {
                    AddHtml(170, 302 + (m_OtherCount++ *20), 300, 20, "<h3><basefont color=#FFFFFF><center>Cet objet prendra la marque de son createur.</center><basefont></h3>", false, false);
                }
            }
            catch (Exception e)
            {
                Misc.ExceptionLogging.WriteLine(e);
            }
        }
예제 #19
0
        public CraftGumpItem(Mobile from, CraftSystem craftSystem, CraftItem craftItem, BaseTool tool)
            : base(50, 50)
        {
            m_From        = from;
            m_CraftSystem = craftSystem;
            m_CraftItem   = craftItem;
            m_Tool        = tool;

            from.CloseGump <CraftGump>();
            from.CloseGump <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, 237, 155, 53, 2624);
            AddImageTiled(165, 132, 355, 80, 2624);
            AddImageTiled(10, 275, 155, 22, 2624);
            AddImageTiled(10, 322, 155, 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, 397);

            AddHtmlLocalized(170, 40, 150, 20, 1044053, LabelColor, false, false);               // ITEM
            AddHtmlLocalized(10, 215, 150, 22, 1044055, LabelColor, false, false);               // <CENTER>MATERIALS</CENTER>
            AddHtmlLocalized(10, 300, 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, 9999, GumpButtonType.Reply, 0);
            AddHtmlLocalized(50, 390, 150, 18, 1044150, LabelColor, false, false);               // BACK

            // Draw Item
            Type type = m_CraftItem.ItemType;

            if (m_CraftItem.IsMarkable(type))
            {
                AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 310, 18, 1044059, LabelColor, false, false);                      // This item may hold its maker's mark
                m_ShowExceptionalChance = true;
            }

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

            AddItem(20, 50, CraftItem.ItemIDOf(type));
            // ***********************************

            // Draw Skills
            for (int i = 0; i < m_CraftItem.Skills.Count; i++)
            {
                CraftSkill skill    = m_CraftItem.Skills.GetAt(i);
                double     minSkill = skill.MinSkill;

                if (minSkill < 0)
                {
                    minSkill = 0;
                }

                AddHtmlLocalized(170, 132 + (i * 20), 200, 18, 1044060 + (int)skill.SkillToMake, LabelColor, false, false);
                AddLabel(430, 132 + (i * 20), LabelHue, String.Format("{0:F1}", minSkill).Replace(",", "."));
            }
            // ***********************************

            // Draw Ressource
            bool retainedColor = false;

            CraftContext context = m_CraftSystem.GetContext(m_From);

            CraftSubResCol res      = (m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes);
            int            resIndex = -1;

            if (context != null)
            {
                resIndex = (m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);
            }

            bool cropScroll = (m_CraftItem.Ressources.Count > 1) && m_CraftItem.Ressources.GetAt(m_CraftItem.Ressources.Count - 1).ItemType == typeofBlankScroll && typeofSpellScroll.IsAssignableFrom(m_CraftItem.ItemType);

            for (int i = 0; i < m_CraftItem.Ressources.Count - (cropScroll ? 1 : 0) && i < 4; i++)
            {
                Type   _type;
                string nameString;
                int    nameNumber;

                CraftRes craftResource = m_CraftItem.Ressources.GetAt(i);

                _type      = craftResource.ItemType;
                nameString = craftResource.NameString;
                nameNumber = craftResource.NameNumber;
                int amount = craftResource.Amount;

                // Resource Mutation
                if (_type == res.ResType && resIndex > -1)
                {
                    CraftSubRes subResource = res.GetAt(resIndex);

                    _type = subResource.ItemType;

                    nameString = subResource.NameString;
                    nameNumber = subResource.GenericNameNumber;

                    if (nameNumber <= 0)
                    {
                        nameNumber = subResource.NameNumber;
                    }
                }
                // ******************

                if (m_CraftItem.NameNumber == 1044458)                   // cut-up cloth
                {
                    amount = 0;

                    AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 360, 18, 1044460, LabelColor, false, false);                          // Cut bolts of cloth into pieces of ready cloth.
                    AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 310, 18, 1048176, LabelColor, false, false);                          // Makes as many as possible at once
                }

                if (m_CraftItem.NameNumber == 1044459)                   //combine cloth
                {
                    amount = 0;

                    AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 360, 18, 1044461, LabelColor, false, false);                          // Combine available cloth into piles by color.
                    AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 310, 18, 1048176, LabelColor, false, false);                          // Makes as many as possible at once
                }

                if (!retainedColor && m_CraftItem.RetainsColorFrom(m_CraftSystem, _type))
                {
                    retainedColor = true;
                    AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 310, 18, 1044152, LabelColor, false, false);                          // * The item retains the color of this material
                    AddLabel(500, 219 + (i * 20), LabelHue, "*");
                }

                if (nameNumber > 0)
                {
                    AddHtmlLocalized(170, 219 + (i * 20), 310, 18, nameNumber, LabelColor, false, false);
                }
                else
                {
                    AddLabel(170, 219 + (i * 20), LabelHue, nameString);
                }

                AddHtml(430, 219 + (i * 20), 40, 20, String.Format("<basefont color=#FFFFFF><div align=right>{0}</basefont></div>", amount.ToString()), false, false);
            }

            if (m_CraftItem.NameNumber == 1041267)               // runebook
            {
                AddHtmlLocalized(170, 219 + (m_CraftItem.Ressources.Count * 20), 310, 18, 1044447, LabelColor, false, false);
                AddHtml(430, 219 + (m_CraftItem.Ressources.Count * 20), 40, 20, String.Format("<basefont color=#FFFFFF><div align=right>{0}</basefont></div>", "1"), false, false);
            }
            // ***********************************

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

            if (craftItem.RequiresSE)
            {
                // * Requires the "Samurai Empire" expansion
                AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 310, 18, 1063363, LabelColor, false, false);
            }

            if (craftItem.RequiresML)
            {
                // * Requires the "Mondain's Legacy" expansion
                AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 310, 18, 1072651, LabelColor, false, false);
            }

            if (craftItem.RequiresSA)
            {
                // * Requires the "Stygian Abyss" expansion
                AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 310, 18, 1094732, LabelColor, false, false);
            }

            if (craftItem.RequiresHS)
            {
                // * Requires the "High Seas" booster
                AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 310, 18, 1116296, LabelColor, false, false);
            }

            bool needsRecipe = (craftItem.Recipe != null && from is PlayerMobile && !((PlayerMobile)from).HasRecipe(craftItem.Recipe));

            if (needsRecipe)
            {
                // You have not learned this recipe.
                AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 310, 18, 1073620, RedLabelColor, false, false);
            }

            if (cropScroll)
            {
                // Inscribing scrolls also requires a blank scroll and mana.
                AddHtmlLocalized(170, 302 + (m_OtherCount++ *20), 360, 18, 1044379, LabelColor, false, false);
            }

            if (needsRecipe)
            {
                AddButton(135, 387, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 0);
                AddHtmlLocalized(180, 390, 150, 18, 1112624, 0x3DEF, false, false);                   // MAKE MAX

                AddButton(255, 387, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 0);
                AddHtmlLocalized(300, 390, 150, 18, 1112623, 0x3DEF, false, false);                   // MAKE NUMBER

                AddButton(405, 387, 4005, 4007, 0, GumpButtonType.Page, 0);
                AddHtmlLocalized(450, 390, 150, 18, 1044151, GreyLabelColor, false, false);                   // MAKE NOW
            }
            else
            {
                AddButton(135, 387, 0xFAE, 0xFB0, craftItem.CraftId + 11000, GumpButtonType.Reply, 0);
                AddHtmlLocalized(180, 390, 150, 18, 1112624, 0x7FFF, false, false);                   // MAKE MAX

                AddButton(255, 387, 0xFAE, 0xFB0, craftItem.CraftId + 10000, GumpButtonType.Reply, 0);
                AddHtmlLocalized(300, 390, 150, 18, 1112623, 0x7FFF, false, false);                   // MAKE NUMBER

                AddButton(405, 387, 4005, 4007, craftItem.CraftId, GumpButtonType.Reply, 0);
                AddHtmlLocalized(450, 390, 150, 18, 1044151, LabelColor, false, false);                   // MAKE NOW
            }

            // Draw Chances
            DrawChances();
            // ***********************************
        }