Ejemplo n.º 1
0
        public static ItemListEntry[] Main(Mobile from)         // 'Main' Is The Craft Gump Menu Identifier. It Is Used To Call The Craft Gump.
        {
            ItemListEntry[] entries = new ItemListEntry[7];     // How Many Item Categories Will We Have In Our Craft Gump?

            /// <summary>
            /// The text strings in quotes below denote the category type a player can
            /// select! This text will appear at the bottom of the gump when a player
            /// hovers the mouse cursor over the object category they wish to craft.
            ///
            /// The numbers after the text strings are the item id's of each picture
            /// denoting the item category a player might choose to select. This is
            /// strictly for aesthetics, but is mandatory for this type of menu gump.
            ///
            /// Notice that their are 7 entries below if you count 'entries[0]' and that
            /// number '7' is also declared above 'ItemListEntry[7]'. If you don't have
            /// this number set correctly then your server will crash.
            /// </summary>

            /// Tested Without Scrolling Operational
            entries[0] = new ItemListEntry("Repair", 4015);     // Test Entry 1
            entries[1] = new ItemListEntry("Shields", 7026);    // Test Entry 2
            entries[2] = new ItemListEntry("Armor", 5141);      // Test Entry 3
            entries[3] = new ItemListEntry("Weapons", 5049);    // Test Entry 4
            entries[4] = new ItemListEntry("a horse", 8479);    // Test Entry 5

            /// Tested With The Scroll Bar Working
            entries[5] = new ItemListEntry("Test1", 7026); // Test Entry 6
            entries[6] = new ItemListEntry("Test2", 5141); // Test Entry 7

            return(entries);                               // Makes Sure That The Entries Above Appear On The Craft Menu Gump
        }
Ejemplo n.º 2
0
        public static ItemListEntry[] Third(Mobile from)
        {
            Type     type;
            string   name;
            Item     item;
            CraftRes craftResource;
            bool     allRequiredSkills = true;
            double   chance;
            bool     hasres  = true;
            int      missing = 0;

            ItemListEntry[] entries = new ItemListEntry[8];

            for (int i = 0; i < 8; ++i)
            {
                Type reg = null;
                type          = DefInscription.CraftSystem.CraftItems.GetAt(i + 16).ItemType;
                chance        = DefInscription.CraftSystem.CraftItems.GetAt(i + 16).GetSuccessChance(from, DefInscription.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0).ItemType, DefInscription.CraftSystem, false, ref allRequiredSkills);
                craftResource = DefInscription.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
                int size = DefInscription.CraftSystem.CraftItems.SearchFor(type).Ressources.Count;
                hasres = true;

                /*for (int j = 0; j < size; ++j)
                 * {
                 *  reg = DefInscription.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(j).ItemType;
                 *  if ((from.Backpack.GetAmount(reg) < DefInscription.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(j).Amount) && hasres)
                 *  {
                 *      hasres = false;
                 *  }
                 * }*/

                if ((chance > 0) && hasres && GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i + 16).ItemType))
                {
                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name = item.GetType().Name;
                    name = name.Replace("Scroll", "");
                    name = name.Replace("cL", "c L");
                    name = name.Replace("cU", "c U");
                    name = name.Replace("lO", "l O");
                    name = name.Replace("fS", "f S");
                    // name = name.ToLower();

                    entries[i - missing] = new ItemListEntry(String.Format("{0}", name), 8320 + i + 16, 0, i);

                    if (item != null)
                    {
                        item.Delete();
                    }
                }
                else
                {
                    missing++;//entries[i-missing]= new ItemListEntry("", -1);
                }
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return(entries);
        }
Ejemplo n.º 3
0
        public static ItemListEntry[] Eighth(Mobile from)
        {
            Type type;
            string name;
            Item item;
            CraftRes craftResource;
            bool allRequiredSkills = true;
            double chance;
            bool hasres = true;
            int missing = 0;
            ItemListEntry[] entries = new ItemListEntry[8];

            for (int i = 0; i < 8; ++i)
            {
                Type reg = null;
                type = DefInscription.CraftSystem.CraftItems.GetAt(i + 56).ItemType;
                chance = DefInscription.CraftSystem.CraftItems.GetAt(i + 56).GetSuccessChance(from, DefInscription.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0).ItemType, DefInscription.CraftSystem, false, ref allRequiredSkills);
                craftResource = DefInscription.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
                int size = DefInscription.CraftSystem.CraftItems.SearchFor(type).Ressources.Count;
                hasres = true;

                /*for (int j = 0; j < size; ++j)
                {
                    reg = DefInscription.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(j).ItemType;
                    if ((from.Backpack.GetAmount(reg) < DefInscription.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(j).Amount) && hasres)
                    {
                        hasres = false;
                    }
                }*/

                if ((chance > 0) && hasres && GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i+56).ItemType))
                {
                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name = item.GetType().Name;
                    name = name.Replace("Scroll", "");
                    name = name.Replace("yV", "y V");
                    name = name.Replace("nA", "n A");
                    name = name.Replace("nE", "n E");
                    name = name.Replace("nF", "n F");
                    name = name.Replace("nW", "n W");
                    name = name.Replace("nD", "n D");
                    name = name.Replace("rE", "r E");
                    name = name.Replace("hE", "h E");
                    name = name.Replace("eE", "e E");
                    //name = name.ToLower();

                    entries[i-missing] = new ItemListEntry(String.Format("{0}", name), 8320 + i + 56,0,i);

                    if (item != null)
                        item.Delete();
                }
                else
                    missing++;//entries[i-missing]= new ItemListEntry("", -1);
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return entries;
        }
Ejemplo n.º 4
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;
 }
Ejemplo n.º 5
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;
 }
Ejemplo n.º 6
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;
 }
Ejemplo n.º 7
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;
 }
Ejemplo n.º 8
0
        public static ItemListEntry[] Misc(Mobile from)
        {
            Type     type;
            int      itemid;
            string   name;
            Item     item;
            CraftRes craftResource;
            bool     allRequiredSkills = true;
            double   chance;
            int      ResAmount = 0;
            int      missing   = 0;

            ItemListEntry[] entries = new ItemListEntry[5];

            for (int i = 0; i < 5; ++i)
            {
                chance        = DefCarpentry.CraftSystem.CraftItems.GetAt(i + 28).GetSuccessChance(from, typeof(Board), DefCarpentry.CraftSystem, false, ref allRequiredSkills);
                type          = DefCarpentry.CraftSystem.CraftItems.GetAt(i + 28).ItemType;
                craftResource = DefCarpentry.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
                ResAmount     = from.Backpack.GetAmount(typeof(Log)) + from.Backpack.GetAmount(typeof(Board));

                if ((chance > 0) && (ResAmount >= craftResource.Amount))
                {
                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name   = item.GetType().Name;
                    name   = name.Replace("sC", "s C");
                    name   = name.Replace("rS", "r S");
                    name   = name.Replace("dS", "d S");
                    name   = name.Replace("nS", "n S");
                    name   = name.Replace("gP", "g P");
                    name   = name.ToLower();
                    itemid = item.ItemID;

                    if (i == 4)
                    {
                        entries[i - missing] = new ItemListEntry(String.Format("{0} ({1} logs, {1} cloth)", name, craftResource.Amount), itemid, 0, i);
                    }
                    else
                    {
                        entries[i - missing] = new ItemListEntry(String.Format("{0} ({1} logs)", name, craftResource.Amount), itemid, 0, i);
                    }

                    if (item != null)
                    {
                        item.Delete();
                    }
                }
                else
                {
                    missing++;//entries[i]= new ItemListEntry("", -1);
                }
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return(entries);
        }
Ejemplo n.º 9
0
        //MAIN
        public static ItemListEntry[] Main(Mobile from)
        {
            bool Shields = true;
            bool Armor = true;
            bool Weapons = true;
            int missing = 0;

            int resHue = 0;
            int maxAmount = 0;
            Object message = null;
            bool allRequiredSkills = true;
            double chance;

            //Shields
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(23).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(23).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //WoodenKiteShield
            {
                Shields = false;
            }

            //Armor
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(0).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(0).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //RingmailGloves
            {
                Armor = false;
            }

            //Weapons
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(26).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(26).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Dagger
            {
                Weapons = false;
            }

            ItemListEntry[] entries = new ItemListEntry[4];

            entries[0] = new ItemListEntry("Repair", 4015, 0, 0);

            if (Shields)
                entries[1-missing] = new ItemListEntry("Shields", 7026, 0, 1);
            else
                missing++;// entries[1] = new ItemListEntry("", -1);

            if (Armor)
                entries[2 - missing] = new ItemListEntry("Armor", 5141, 0, 2);
            else
                missing++;// entries[2] = new ItemListEntry("", -1);

            if (Weapons)
                entries[3 - missing] = new ItemListEntry("Weapons", 5049, 0, 3);
            else
                missing++;// entries[3] = new ItemListEntry("", -1);

            Array.Resize(ref entries, entries.Length - missing);
            return entries;
        }
Ejemplo n.º 10
0
        //SHEILDS
        private static ItemListEntry[] Shields(Mobile from)
        {
            Type   type;
            Item   item = null;
            int    itemid;
            string name;
            int    missing = 0;

            CraftRes craftResource;
            int      resHue    = 0;
            int      maxAmount = 0;
            Object   message   = null;

            bool   allRequiredSkills = true;
            double chance;

            ItemListEntry[] entries = new ItemListEntry[6];

            for (int i = 0; i < 6; ++i)
            {
                type          = DefBlacksmithy.CraftSystem.CraftItems.GetAt(i + 18).ItemType;
                craftResource = DefBlacksmithy.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
                chance        = DefBlacksmithy.CraftSystem.CraftItems.GetAt(i + 18).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);

                if ((from.Backpack.GetAmount(typeof(IronIngot)) >= DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(i + 18).ItemType).Ressources.GetAt(0).Amount) && (chance > 0.0))
                {
                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name   = item.GetType().Name;
                    name   = name.Replace("S", " S");
                    name   = name.Replace("K", " K");
                    name   = name.ToLower();
                    itemid = item.ItemID;
                    if (itemid == 7033)
                    {
                        itemid = 7032;
                    }

                    entries[i - missing] = new ItemListEntry(String.Format("{0} ({1} ingots)", name, craftResource.Amount), itemid, 0, i);
                }
                else
                {
                    missing++;//entries[i-missing] = new ItemListEntry("", -1);
                }

                if (item != null)
                {
                    item.Delete();
                }
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return(entries);
        }
Ejemplo n.º 11
0
        public static ItemListEntry[] Female(Mobile from)
        {
            Type     type;
            int      itemid;
            string   name;
            Item     item;
            CraftRes craftResource;
            bool     allRequiredSkills = true;
            double   chance;
            int      ResAmount;
            int      missing = 0;

            ItemListEntry[] entries = new ItemListEntry[6];

            for (int i = 0; i < 6; ++i)
            {
                chance        = DefTailoring.CraftSystem.CraftItems.GetAt(i + 31).GetSuccessChance(from, typeof(Leather), DefTailoring.CraftSystem, false, ref allRequiredSkills);
                type          = DefTailoring.CraftSystem.CraftItems.GetAt(i + 31).ItemType;
                craftResource = DefTailoring.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);

                if ((chance > 0) && ((from.Backpack.GetAmount(typeof(Leather)) >= (craftResource).Amount) || from.Backpack.GetAmount(typeof(Hides)) >= (craftResource).Amount))
                {
                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name   = item.GetType().Name;
                    name   = name.Replace("rS", "r S");
                    name   = name.Replace("rB", "r B");
                    name   = name.Replace("dB", "d B");
                    name   = name.Replace("rA", "r A");
                    name   = name.Replace("eL", "e L");
                    name   = name.Replace("eS", "e S");
                    name   = name.Replace("rC", "r C");
                    name   = name.Replace("dC", "d C");
                    name   = name.Replace("Chest", "Armor");
                    name   = name.Replace(" Arms", "");
                    name   = name.ToLower();
                    itemid = item.ItemID;

                    entries[i - missing] = new ItemListEntry(String.Format("{0} ({1} leather)", name, craftResource.Amount), itemid, 0, i);

                    if (item != null)
                    {
                        item.Delete();
                    }
                }
                else
                {
                    missing++;//entries[i-missing] = new ItemListEntry("", -1);
                }
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return(entries);
        }
Ejemplo n.º 12
0
        public static ItemListEntry[] Main(Mobile from)
        {
            Type     type;
            int      itemid;
            string   name;
            Item     item;
            CraftRes craftResource;
            bool     allRequiredSkills = true;
            double   chance;
            int      ResAmount;
            int      missing = 0;

            ItemListEntry[] entries = new ItemListEntry[DefCartography.CraftSystem.CraftItems.Count];

            for (int i = 0; i < DefCartography.CraftSystem.CraftItems.Count; ++i)
            {
                chance = DefCartography.CraftSystem.CraftItems.GetAt(i).GetSuccessChance(from, typeof(BlankMap), DefCartography.CraftSystem, false, ref allRequiredSkills);

                if (chance > 0)
                {
                    type          = DefCartography.CraftSystem.CraftItems.GetAt(i).ItemType;
                    craftResource = DefCartography.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);

                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name   = item.GetType().Name;
                    name   = name.Replace("lM", "l M");
                    name   = name.Replace("yM", "y M");
                    name   = name.Replace("aC", "a C");
                    name   = name.Replace("dM", "d M");
                    name   = name.Replace("local map", "A map of the local environs.");
                    name   = name.Replace("city map", "A map of suitable for cities.");
                    name   = name.Replace("sea chart", "A moderately sized sea chart.");
                    name   = name.Replace("world map", "A map of the world.");
                    name   = name.ToLower();
                    itemid = item.ItemID;

                    entries[i - missing] = new ItemListEntry(String.Format("{0}", name), 6511 + i, 0, i);

                    if (item != null)
                    {
                        item.Delete();
                    }
                }
                else
                {
                    missing++;//entries[i-missing] = new ItemListEntry("", -1);
                }
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return(entries);
        }
Ejemplo n.º 13
0
        public static ItemListEntry[] Chairs(Mobile from)
        {
            Type type;
            int itemid;
            string name;
            Item item;
            CraftRes craftResource;
            bool allRequiredSkills = true;
            double chance;
            int ResAmount = 0;
            int missing = 0;

            ItemListEntry[] entries = new ItemListEntry[9];

            for (int i = 0; i < 9; ++i)
            {
                chance = DefCarpentry.CraftSystem.CraftItems.GetAt(i+6).GetSuccessChance(from, typeof(Board), DefCarpentry.CraftSystem, false, ref allRequiredSkills);
                type = DefCarpentry.CraftSystem.CraftItems.GetAt(i + 6).ItemType;
                craftResource = DefCarpentry.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
                ResAmount = from.Backpack.GetAmount(typeof(Log)) + from.Backpack.GetAmount(typeof(Board));

                if ((chance > 0) && (ResAmount >= craftResource.Amount))
                {
                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name = item.GetType().Name;
                    name = name.Replace("tS", "t S");
                    name = name.Replace("oC", "o C");
                    name = name.Replace("nC", "n C");
                    name = name.Replace("nB", "n B");
                    name = name.Replace("nT", "n T");
                    name = name.ToLower();
                    if (name == "fancywooden chaircushion")
                        name = "wooden chair";
                    if (name == "wooden chaircushion")
                        name = "wooden chair";

                    itemid = item.ItemID;
                    /*if (itemid == 2903)
                        itemid--;*/

                    entries[i-missing] = new ItemListEntry(String.Format("{0} ({1} wood)", name, craftResource.Amount), itemid, 0, i);

                    if (item != null)
                        item.Delete();
                }
                else
                    missing++;//entries[i]= new ItemListEntry("", -1);
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return entries;
        }
Ejemplo n.º 14
0
        //LEATHER////////////////////////////////////////////////////////
        public static ItemListEntry[] LeatherMain(Mobile from)
        {
            Type     type;
            CraftRes craftResource;

            ItemListEntry[] entries   = new ItemListEntry[4];
            int             ResAmount = from.Backpack.GetAmount(typeof(Leather));

            ResAmount += from.Backpack.GetAmount(typeof(Hides));
            int missing = 0;

            type          = DefTailoring.CraftSystem.CraftItems.GetAt(17).ItemType;
            craftResource = DefTailoring.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
            if (ResAmount >= craftResource.Amount)
            {
                entries[0 - missing] = new ItemListEntry("Footwear", 5904, 0, 0);
            }
            else
            {
                missing++;// entries[0] = new ItemListEntry("", -1);
            }
            type          = DefTailoring.CraftSystem.CraftItems.GetAt(22).ItemType;
            craftResource = DefTailoring.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
            if (ResAmount >= craftResource.Amount)
            {
                entries[1 - missing] = new ItemListEntry("Leather Armor", 5068, 0, 1);
            }
            else
            {
                missing++;//entries[1] = new ItemListEntry("", -1);
            }
            type          = DefTailoring.CraftSystem.CraftItems.GetAt(27).ItemType;
            craftResource = DefTailoring.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
            if (ResAmount >= craftResource.Amount)
            {
                entries[2 - missing] = new ItemListEntry("Studded Armor", 5083, 0, 2);
            }
            else
            {
                missing++;//entries[2] = new ItemListEntry("", -1);
            }
            type          = DefTailoring.CraftSystem.CraftItems.GetAt(32).ItemType;
            craftResource = DefTailoring.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
            if (ResAmount >= craftResource.Amount)
            {
                entries[3 - missing] = new ItemListEntry("Female Armor", 7172, 0, 3);
            }
            else
            {
                missing++;//entries[3] = new ItemListEntry("", -1);
            }
            Array.Resize(ref entries, (entries.Length - missing));
            return(entries);
        }
Ejemplo n.º 15
0
        public static ItemListEntry[] Main(Mobile from)
        {
            ItemListEntry[] entries = new ItemListEntry[5];

            entries[0] = new ItemListEntry("Repair", 4015);
            entries[1] = new ItemListEntry("Shields", 7026);
            entries[2] = new ItemListEntry("Armor", 5141);
            entries[3] = new ItemListEntry("Weapons", 5049);
            entries[4] = new ItemListEntry("a horse", 8479);

            return(entries);
        }
Ejemplo n.º 16
0
        public static ItemListEntry[] Main(Mobile from)
        {
            Type     type;
            CraftRes craftResource;

            ItemListEntry[] entries   = new ItemListEntry[4];
            int             ResAmount = from.Backpack.GetAmount(typeof(Cloth));
            int             missing   = 0;

            type          = DefTailoring.CraftSystem.CraftItems.GetAt(12).ItemType;
            craftResource = DefTailoring.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
            if (ResAmount >= craftResource.Amount)
            {
                entries[0 - missing] = new ItemListEntry("Shirts", 0x1517, 0, 0);
            }
            else
            {
                missing++;// entries[0] = new ItemListEntry("", -1);
            }
            type          = DefTailoring.CraftSystem.CraftItems.GetAt(6).ItemType;
            craftResource = DefTailoring.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
            if (ResAmount >= craftResource.Amount)
            {
                entries[1 - missing] = new ItemListEntry("Pants", 0x1539, 0, 1);
            }
            else
            {
                missing++;// entries[1] = new ItemListEntry("", -1);
            }
            type          = DefTailoring.CraftSystem.CraftItems.GetAt(9).ItemType;
            craftResource = DefTailoring.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
            if (ResAmount >= craftResource.Amount)
            {
                entries[2 - missing] = new ItemListEntry("Miscellaneous", 0x153D, 0, 2);
            }
            else
            {
                missing++;// entries[2] = new ItemListEntry("", -1);
            }
            type          = DefTailoring.CraftSystem.CraftItems.GetAt(14).ItemType;
            craftResource = DefTailoring.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
            if (ResAmount >= craftResource.Amount)
            {
                entries[3 - missing] = new ItemListEntry("Bolt of Cloth", 0x0F95, 0, 3);
            }
            else
            {
                missing++;// entries[3] = new ItemListEntry("", -1);
            }
            Array.Resize(ref entries, (entries.Length - missing));
            return(entries);
        }
Ejemplo n.º 17
0
        public static ItemListEntry[] Main()
        {
            PolymorphCategory cat = (PolymorphCategory)Categories[0];
            ItemListEntry[] entries = new ItemListEntry[cat.Entries.Length];

            for (int i = 0; i < cat.Entries.Length; i++)
            {
                PolymorphEntry entry = (PolymorphEntry)cat.Entries[i];

                entries[i] = new ItemListEntry(entry.StringName, entry.ArtID);
            }

            return entries;
        }
Ejemplo n.º 18
0
        public static ItemListEntry[] Main(Mobile from)
        {
            Type type;
            int itemid;
            string name;
            Item item;
            CraftRes craftResource;
            bool allRequiredSkills = true;
            double chance;
            int ResAmount;
            int missing = 0;

            ItemListEntry[] entries = new ItemListEntry[DefCartography.CraftSystem.CraftItems.Count];

            for (int i = 0; i < DefCartography.CraftSystem.CraftItems.Count; ++i)
            {
                chance = DefCartography.CraftSystem.CraftItems.GetAt(i).GetSuccessChance(from, typeof(BlankMap), DefCartography.CraftSystem, false, ref allRequiredSkills);

                if (chance > 0)
                {
                    type = DefCartography.CraftSystem.CraftItems.GetAt(i).ItemType;
                    craftResource = DefCartography.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);

                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name = item.GetType().Name;
                    name = name.Replace("lM", "l M");
                    name = name.Replace("yM", "y M");
                    name = name.Replace("aC", "a C");
                    name = name.Replace("dM", "d M");
                    name = name.Replace("local map", "A map of the local environs.");
                    name = name.Replace("city map", "A map of suitable for cities.");
                    name = name.Replace("sea chart", "A moderately sized sea chart.");
                    name = name.Replace("world map", "A map of the world.");
                    name = name.ToLower();
                    itemid = item.ItemID;

                    entries[i-missing] = new ItemListEntry(String.Format("{0}", name), 6511 + i,0,i);

                    if (item != null)
                        item.Delete();
                }
                else
                    missing++;//entries[i-missing] = new ItemListEntry("", -1);
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return entries;
        }
Ejemplo n.º 19
0
        public static ItemListEntry[] Arrows(Mobile from)
        {
            Type     type;
            int      itemid;
            string   name;
            Item     item;
            CraftRes craftResource;
            bool     allRequiredSkills = true;
            double   chance;
            int      ResAmount = 0;
            int      missing   = 0;

            ItemListEntry[] entries = new ItemListEntry[DefBowFletching.CraftSystem.CraftItems.Count];
            for (int i = 0; i < DefBowFletching.CraftSystem.CraftItems.Count; ++i)
            {
                chance = DefBowFletching.CraftSystem.CraftItems.GetAt(i).GetSuccessChance(from, typeof(Log), DefBowFletching.CraftSystem, false, ref allRequiredSkills);

                if (chance > 0)
                {
                    type          = DefBowFletching.CraftSystem.CraftItems.GetAt(i).ItemType;
                    craftResource = DefBowFletching.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);

                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name   = item.GetType().Name;
                    name   = name.ToLower();
                    itemid = item.ItemID;

                    if (i == 2 || i == 3)
                    {
                        entries[i - missing] = new ItemListEntry(String.Format("{0}s", name), itemid, 0, i);
                    }
                    else
                    {
                        missing++;//entries[i-missing] = new ItemListEntry("", -1);
                    }
                    if (item != null)
                    {
                        item.Delete();
                    }
                }
                else
                {
                    missing++;//entries[i-missing] = new ItemListEntry("", -1);
                }
            }
            Array.Resize(ref entries, (DefBowFletching.CraftSystem.CraftItems.Count - missing));
            return(entries);
        }
		public ItemListMenu(string question, ItemListEntry[] entries)
		{
			m_Question = question;
			m_Entries = entries;

			do
			{
				m_Serial = m_NextSerial++;
				m_Serial &= 0x7FFFFFFF;
			}
			while (m_Serial == 0);

			m_Serial = (int)((uint)m_Serial | 0x80000000);
		}
Ejemplo n.º 21
0
        public static ItemListEntry[] Main()
        {
            PolymorphCategory cat = (PolymorphCategory)Categories[0];

            ItemListEntry[] entries = new ItemListEntry[cat.Entries.Length];

            for (int i = 0; i < cat.Entries.Length; i++)
            {
                PolymorphEntry entry = (PolymorphEntry)cat.Entries[i];

                entries[i] = new ItemListEntry(entry.StringName, entry.ArtID);
            }

            return(entries);
        }
Ejemplo n.º 22
0
        public static ItemListEntry[] Explosion(Mobile from)
        {
            Type     type;
            int      itemid;
            string   name;
            Item     item;
            CraftRes craftResource;
            bool     allRequiredSkills = true;
            double   chance;
            int      missing = 0;

            ItemListEntry[] entries = new ItemListEntry[3];

            for (int i = 0; i < 3; ++i)
            {
                chance = DefAlchemy.CraftSystem.CraftItems.GetAt(i + 17).GetSuccessChance(from, typeof(SulfurousAsh), DefAlchemy.CraftSystem, false, ref allRequiredSkills);

                if ((chance > 0) && (from.Backpack.GetAmount(typeof(SulfurousAsh)) >= DefAlchemy.CraftSystem.CraftItems.SearchFor(DefAlchemy.CraftSystem.CraftItems.GetAt(i + 17).ItemType).Ressources.GetAt(0).Amount))
                {
                    type          = DefAlchemy.CraftSystem.CraftItems.GetAt(i + 17).ItemType;
                    craftResource = DefAlchemy.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);

                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name = item.GetType().Name;
                    name = name.Replace("nP", "n P");
                    name = name.Replace("rE", "r E");
                    name = name.Replace(" Potion", "");
                    //name = name.ToLower();
                    itemid = item.ItemID;

                    entries[i - missing] = new ItemListEntry(String.Format("{0}", name, craftResource.Amount), itemid, 0, i);

                    if (item != null)
                    {
                        item.Delete();
                    }
                }
                else
                {
                    missing++;//entries[i-missing] = new ItemListEntry("", -1);
                }
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return(entries);
        }
Ejemplo n.º 23
0
        public static ItemListEntry[] Wood(Mobile from)
        {
            Type     type;
            int      itemid;
            string   name;
            Item     item;
            CraftRes craftResource;
            bool     allRequiredSkills = true;
            double   chance;
            int      ResAmount;
            int      missing = 0;

            ItemListEntry[] entries = new ItemListEntry[5];

            for (int i = 0; i < 5; ++i)
            {
                chance        = DefTinkering.CraftSystem.CraftItems.GetAt(i).GetSuccessChance(from, typeof(Log), DefTinkering.CraftSystem, false, ref allRequiredSkills);
                type          = DefTinkering.CraftSystem.CraftItems.GetAt(i).ItemType;
                craftResource = DefTinkering.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);

                if ((chance > 0) && (from.Backpack.GetAmount(typeof(Log)) >= (craftResource).Amount))
                {
                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name   = item.GetType().Name;
                    name   = name.Replace("gP", "g P");
                    name   = name.Replace("kF", "k F");
                    name   = name.ToLower();
                    itemid = item.ItemID;

                    entries[i - missing] = new ItemListEntry(String.Format("{0}", name), itemid, 0, i);

                    if (item != null)
                    {
                        item.Delete();
                    }
                }
                else
                {
                    missing++;//entries[i-missing] = new ItemListEntry("", -1);
                }
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return(entries);
        }
Ejemplo n.º 24
0
        public static ItemListEntry[] Bolt(Mobile from)
        {
            Type type;
            int itemid;
            string name;
            Item item;
            CraftRes craftResource;
            bool allRequiredSkills = true;
            double chance;
            int ResAmount;
            int missing = 0;

            ItemListEntry[] entries = new ItemListEntry[3];

            for (int i = 0; i < 3; ++i)
            {
                chance = DefTailoring.CraftSystem.CraftItems.GetAt(i + 14).GetSuccessChance(from, typeof(Cloth), DefTailoring.CraftSystem, false, ref allRequiredSkills);
                type = DefTailoring.CraftSystem.CraftItems.GetAt(i + 14).ItemType;
                craftResource = DefTailoring.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);

                if ((chance > 0) && (from.Backpack.GetAmount(typeof(Cloth)) >= (craftResource).Amount))
                {
                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name = item.GetType().Name;
                    name = name.Replace("tO", "t O");
                    name = name.Replace("fC", "f C");
                    name = name.ToLower();
                    itemid = item.ItemID;

                    entries[i-missing] = new ItemListEntry(String.Format("{0} ({1} cloth)", name, craftResource.Amount), itemid, 0, i);

                    if (item != null)
                        item.Delete();
                }
                else
                    missing++;//entries[i-missing] = new ItemListEntry("", -1);
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return entries;
        }
Ejemplo n.º 25
0
        public static ItemListEntry[] Arrows(Mobile from)
        {
            Type type;
            int itemid;
            string name;
            Item item;
            CraftRes craftResource;
            bool allRequiredSkills = true;
            double chance;
            int ResAmount = 0;
            int missing = 0;

            ItemListEntry[] entries = new ItemListEntry[DefBowFletching.CraftSystem.CraftItems.Count];
            for (int i = 0; i < DefBowFletching.CraftSystem.CraftItems.Count; ++i)
            {
                chance = DefBowFletching.CraftSystem.CraftItems.GetAt(i).GetSuccessChance(from, typeof(Log), DefBowFletching.CraftSystem, false, ref allRequiredSkills);

                if (chance > 0)
                {
                    type = DefBowFletching.CraftSystem.CraftItems.GetAt(i).ItemType;
                    craftResource = DefBowFletching.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);

                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name = item.GetType().Name;
                    name = name.ToLower();
                    itemid = item.ItemID;

                    if (i == 2 || i == 3)
                        entries[i-missing] = new ItemListEntry(String.Format("{0}s", name), itemid, 0, i);
                    else
                        missing++;//entries[i-missing] = new ItemListEntry("", -1);

                    if (item != null)
                        item.Delete();
                }
                else
                    missing++;//entries[i-missing] = new ItemListEntry("", -1);
            }
            Array.Resize(ref entries, (DefBowFletching.CraftSystem.CraftItems.Count - missing));
            return entries;
        }
Ejemplo n.º 26
0
        public static ItemListEntry[] Agility(Mobile from)
        {
            Type type;
            int itemid;
            string name;
            Item item;
            CraftRes craftResource;
            bool allRequiredSkills = true;
            double chance;
            int missing = 0;

            ItemListEntry[] entries = new ItemListEntry[2];

            for (int i = 0; i < 2; ++i)
            {
                chance = DefAlchemy.CraftSystem.CraftItems.GetAt(i + 2).GetSuccessChance(from, typeof(Bloodmoss), DefAlchemy.CraftSystem, false, ref allRequiredSkills);

                if ((chance > 0) && (from.Backpack.GetAmount(typeof(Bloodmoss)) >= DefAlchemy.CraftSystem.CraftItems.SearchFor(DefAlchemy.CraftSystem.CraftItems.GetAt(i+2).ItemType).Ressources.GetAt(0).Amount))
                {
                    type = DefAlchemy.CraftSystem.CraftItems.GetAt(i + 2).ItemType;
                    craftResource = DefAlchemy.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);

                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name = item.GetType().Name;
                    name = name.Replace("rA", "r A");
                    name = name.Replace("yP", "y P");
                    name = name.Replace(" Potion", "");
                    //name = name.ToLower();
                    itemid = item.ItemID;

                    entries[i-missing] = new ItemListEntry(String.Format("{0}", name, craftResource.Amount), itemid, 0, i);

                    if (item != null)
                        item.Delete();
                }
                else
                    missing++;//entries[i-missing] = new ItemListEntry("", -1);
            }
            Array.Resize(ref entries, (entries.Length - missing));
            return entries;
        }
Ejemplo n.º 27
0
        public static ItemListEntry[] Metal(Mobile from)
        {
            Type     type;
            int      itemid;
            string   name;
            Item     item;
            CraftRes craftResource;
            bool     allRequiredSkills = true;
            double   chance;
            int      ResAmount;
            int      missing = 0;

            ItemListEntry[] entries = new ItemListEntry[20];

            entries[0] = new ItemListEntry("Dart Trap", 4397, 0, 0);
            entries[1] = new ItemListEntry("Explosion Trap", 4344, 0, 1);
            entries[2] = new ItemListEntry("Poison Trap", 4424, 0, 2);

            /*if ((from.Backpack.GetAmount(typeof(Bolt)) > 0) && (from.Backpack.GetAmount(typeof(IronIngot)) > 0))
             *  entries[0] = new ItemListEntry("dart trap", 4397);
             * else
             *  entries[0] = new ItemListEntry("", -1);
             *
             * if ((from.Backpack.GetAmount(typeof(BaseExplosionPotion)) > 0) && (from.Backpack.GetAmount(typeof(IronIngot)) > 0))
             *  entries[1] = new ItemListEntry("explosion trap", 4344);
             * else
             *  entries[1] = new ItemListEntry("", -1);
             *
             * if ((from.Backpack.GetAmount(typeof(BasePoisonPotion)) > 0) && (from.Backpack.GetAmount(typeof(IronIngot)) > 0))
             *  entries[2] = new ItemListEntry("poison trap", 4424);
             * else
             *  entries[2] = new ItemListEntry("", -1);*/

            for (int i = 3; i < 20; ++i)
            {
                chance        = DefTinkering.CraftSystem.CraftItems.GetAt(i + 5).GetSuccessChance(from, typeof(IronIngot), DefTinkering.CraftSystem, false, ref allRequiredSkills);
                type          = DefTinkering.CraftSystem.CraftItems.GetAt(i + 5).ItemType;
                craftResource = DefTinkering.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);

                /*if ((chance > 0) && (from.Backpack.GetAmount(typeof(IronIngot)) >= (craftResource).Amount))
                 * {*/
                item = null;
                try { item = Activator.CreateInstance(type) as Item; }
                catch { }
                name   = item.GetType().Name;
                name   = name.Replace("gK", "g K");
                name   = name.Replace("kP", "k P");
                name   = name.Replace("tP", "t P");
                name   = name.Replace("wK", "w K");
                name   = name.Replace("lS", "l S");
                name   = name.Replace("rT", "r T");
                name   = name.Replace("hH", "h H");
                name   = name.Replace("eH", "e H");
                name   = name.Replace("kR", "k R");
                name   = name.ToLower();
                itemid = item.ItemID;

                if (name == "scissors")
                {
                    itemid--;
                }
                else if (name == "tongs")
                {
                    itemid++;
                }
                else if (name == "smith hammer")
                {
                    itemid++;
                }
                else if (name == "shovel")
                {
                    itemid++;
                }

                entries[i - missing] = new ItemListEntry(String.Format("{0}", name), itemid, 0, i);

                if (item != null)
                {
                    item.Delete();
                }
                //}
                //else
                //    missing++;//entries[i-missing] = new ItemListEntry("", -1);
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return(entries);
        }
Ejemplo n.º 28
0
 static InscribeSystem()
 {
     m_MainMenu = new ItemListEntry[8];
     for (int c=0;c<8;c++)
     {
         ItemListEntry[] entry = new ItemListEntry[8];
         for (int n=0;n<8;n++)
             entry[n] = new CSI_Scroll( c, n, c*8+n );
         m_MainMenu[c] = new CraftSubMenu( TileData.ItemTable[CircleIDOffset+c].Name, CircleIDOffset+c, entry );
     }
 }
Ejemplo n.º 29
0
        //ARMOR
        private static ItemListEntry[] Armor(Mobile from)
        {
            bool Platemail = true;
            bool Chainmail = true;
            bool Ringmail = true;
            bool Helmets = true;
            int missing = 0;

            CraftRes craftResource;
            int resHue = 0;
            int maxAmount = 0;
            Object message = null;
            bool allRequiredSkills = true;
            double chance;

            //Platemail
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(9).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(9).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Gorget
            {
                Platemail = false;
            }
            //Chainmail
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(5).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(5).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Legs
            {
                Chainmail = false;
            }
            //Ringmail
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(0).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(0).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Gloves
            {
                Ringmail = false;
            }
            //Helmets
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(4).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(4).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Gloves
            {
                Helmets = false;
            }

            ItemListEntry[] entries = new ItemListEntry[4];

            if (Platemail)
                entries[0-missing] = new ItemListEntry("Platemail", 5141, 0, 0);
            else
                missing++;// entries[0] = new ItemListEntry("", -1);

            if (Chainmail)
                entries[1 - missing] = new ItemListEntry("Chainmail", 5055, 0, 1);
            else
                missing++;//entries[1] = new ItemListEntry("", -1);

            if (Ringmail)
                entries[2 - missing] = new ItemListEntry("Ringmail", 5100, 0, 2);
            else
                missing++;//entries[2] = new ItemListEntry("", -1);

            if (Helmets)
                entries[3 - missing] = new ItemListEntry("Helmets", 5138, 0, 3);
            else
            {
                missing++;//entries[3] = new ItemListEntry("", -1);
            }

            Array.Resize(ref entries, entries.Length - missing);
            return entries;
        }
Ejemplo n.º 30
0
        //WEAPONS
        private static ItemListEntry[] Weapons(Mobile from)
        {
            bool Swords   = true;
            bool Axes     = true;
            bool Maces    = true;
            bool Polearms = true;
            int  missing  = 0;

            CraftRes craftResource;
            int      resHue            = 0;
            int      maxAmount         = 0;
            Object   message           = null;
            bool     allRequiredSkills = true;
            double   chance;

            //Swords
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(26).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(26).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Dagger
            {
                Swords = false;
            }
            //Axes
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(34).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(34).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Double Axe
            {
                Axes = false;
            }
            //Maces
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(45).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(45).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Mace
            {
                Maces = false;
            }
            //Polearms
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(42).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(42).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Spear
            {
                Polearms = false;
            }

            ItemListEntry[] entries = new ItemListEntry[4];

            if (Swords)
            {
                entries[0 - missing] = new ItemListEntry("Swords & Blades", 5049, 0, 0);
            }
            else
            {
                missing++;//entries[0] = new ItemListEntry("", -1);
            }
            if (Axes)
            {
                entries[1 - missing] = new ItemListEntry("Axes", 3913, 0, 1);
            }
            else
            {
                missing++;//entries[1] = new ItemListEntry("", -1);
            }
            if (Maces)
            {
                entries[2 - missing] = new ItemListEntry("Maces & Hammers", 5127, 0, 2);
            }
            else
            {
                missing++;//entries[2] = new ItemListEntry("", -1);
            }
            if (Polearms)
            {
                entries[3 - missing] = new ItemListEntry("Polearms", 3917, 0, 3);
            }
            else
            {
                missing++;//entries[3] = new ItemListEntry("", -1);
            }
            Array.Resize(ref entries, entries.Length - missing);
            return(entries);
        }
Ejemplo n.º 31
0
        //SHEILDS
        private static ItemListEntry[] Shields(Mobile from)
        {
            Type type;
            Item item = null;
            int itemid;
            string name;
            int missing = 0;

            CraftRes craftResource;
            int resHue = 0;
            int maxAmount = 0;
            Object message = null;

            bool allRequiredSkills = true;
            double chance;

            ItemListEntry[] entries = new ItemListEntry[6];

            for (int i = 0; i < 6; ++i)
            {
                type = DefBlacksmithy.CraftSystem.CraftItems.GetAt(i + 18).ItemType;
                craftResource = DefBlacksmithy.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
                chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(i + 18).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);

                if ((from.Backpack.GetAmount(typeof(IronIngot)) >= DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(i + 18).ItemType).Ressources.GetAt(0).Amount) && (chance > 0.0))
                {
                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name = item.GetType().Name;
                    name = name.Replace("S", " S");
                    name = name.Replace("K", " K");
                    name = name.ToLower();
                    itemid = item.ItemID;
                    if (itemid == 7033)
                        itemid = 7032;

                    entries[i-missing] = new ItemListEntry(String.Format("{0} ({1} ingots)", name, craftResource.Amount), itemid, 0, i);
                }
                else
                {
                    missing++;//entries[i-missing] = new ItemListEntry("", -1);
                }

                if (item != null)
                    item.Delete();
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return entries;
        }
Ejemplo n.º 32
0
        public static ItemListEntry[] Main(Mobile from)
        {
            Type     type;
            int      itemid;
            string   name;
            Item     item;
            CraftRes craftResource;
            bool     allRequiredSkills = true;
            double   chance;
            int      ResAmount = 0;
            int      missing   = 0;

            ItemListEntry[] entries = new ItemListEntry[DefBowFletching.CraftSystem.CraftItems.Count];

            for (int i = 0; i < DefBowFletching.CraftSystem.CraftItems.Count; ++i)
            {
                chance = DefBowFletching.CraftSystem.CraftItems.GetAt(i).GetSuccessChance(from, typeof(Log), DefBowFletching.CraftSystem, false, ref allRequiredSkills);

                if (chance > 0)
                {
                    type          = DefBowFletching.CraftSystem.CraftItems.GetAt(i).ItemType;
                    craftResource = DefBowFletching.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
                    ResAmount     = from.Backpack.GetAmount(typeof(Log));

                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name   = item.GetType().Name;
                    name   = name.Replace("yC", "y C");
                    name   = name.ToLower();
                    itemid = item.ItemID;

                    //shafts
                    if (i == 1)
                    {
                        if (ResAmount != 0)
                        {
                            entries[i - missing] = new ItemListEntry(String.Format("arrow shafts using all wood", name), itemid, 0, i);
                        }
                        else
                        {
                            missing++;// entries[i-missing] = new ItemListEntry("", -1);
                        }
                    }
                    //arrows bolts
                    else if (i == 2 || i == 3)
                    {
                        missing++;//entries[i-missing] = new ItemListEntry("", -1);
                    }
                    //kindling and bows
                    else
                    {
                        if ((ResAmount != 0) && (ResAmount >= craftResource.Amount))
                        {
                            if (craftResource.Amount > 1)
                            {
                                entries[i - missing] = new ItemListEntry(String.Format("{0}", name, craftResource.Amount), itemid, 0, i);
                            }
                            else
                            {
                                entries[i - missing] = new ItemListEntry(String.Format("{0}", name, craftResource.Amount), itemid, 0, i);
                            }
                        }
                        else
                        {
                            missing++;//entries[i-missing] = new ItemListEntry("", -1);
                        }
                    }

                    if (item != null)
                    {
                        item.Delete();
                    }
                }
                else
                {
                    missing++;//entries[i-missing] = new ItemListEntry("", -1);
                }
            }
            Array.Resize(ref entries, (DefBowFletching.CraftSystem.CraftItems.Count - missing));
            return(entries);
        }
Ejemplo n.º 33
0
        private ItemListEntry[] BuildMenu( ItemListEntry[] entries )
        {
            if ( m_Mobile == null || entries == null || entries.Length == 0 )
                return EmptyILE;

            ArrayList list = new ArrayList();
            for (int i=0;i<entries.Length;i++)
            {
                ItemListEntry entry = entries[i];
                if ( entry is CraftSubMenu )
                {
                    if ( BuildMenu( ((CraftSubMenu)entry).SubItems ).Length > 0 )
                        list.Add( entry );
                }
                else if ( entry is CraftSystemItem )
                {
                    CraftSystemItem item = (CraftSystemItem)entry;

                    if ( CanCraft( item ) )
                        list.Add( entry );
                }
                else
                {
                    list.Add( entry );
                }
            }
            return (ItemListEntry[])list.ToArray( typeof( ItemListEntry ) );
        }
Ejemplo n.º 34
0
 public PolymorphMenu(Mobile caster, Item scroll, ItemListEntry[] entries)
     : base("Choose a Creature", entries)
 {
     m_Caster = caster;
     m_Scroll = scroll;
 }
Ejemplo n.º 35
0
        protected static int GetResourcesFor( Type find, ItemListEntry[] entries )
        {
            for(int i=0;i<entries.Length;i++)
            {
                if ( entries[i] is CraftSystemItem )
                {
                    CraftSystemItem csi = (CraftSystemItem)entries[i];
                    if ( csi.CreateType.IsSubclassOf( find ) )
                        return csi.ResourceCost;
                }
                else if ( entries[i] is CraftSubMenu )
                {
                    int sub = GetResourcesFor( find, ((CraftSubMenu)entries[i]).SubItems );
                    if ( sub != -1 )
                        return sub;
                }
            }

            return -1;
        }
Ejemplo n.º 36
0
 public CraftMenu( CraftSystem system, ItemListEntry[] entries )
     : base("What would you like to make?", entries)
 {
     m_System = system;
 }
Ejemplo n.º 37
0
        public virtual bool ShowMenu( ItemListEntry[] entries )
        {
            if ( m_Mobile.Deleted || !m_Mobile.Alive )
                return false;

            ItemListEntry[] menu = BuildMenu( entries );
            if ( menu == null || menu.Length <= 0 )
            {
                OnNothingToMake();
                return false;
            }
            else
            {
                if ( m_Mobile.NetState != null )
                {
                    new CraftMenu( this, menu ).SendTo( m_Mobile.NetState );
                    return true;
                }
                else
                {
                    End();
                    return false;
                }
            }
        }
Ejemplo n.º 38
0
        public static ItemListEntry[] Main(Mobile from)
        {
            Type type;
            CraftRes craftResource;
            int missing = 0;

            bool Chairs = true;
            bool Tables = true;
            bool Containers = true;
            bool Misc = true;

            int resHue = 0;
            int maxAmount = 0;
            Object message = null;
            bool allRequiredSkills = true;
            double chance = 1;
            int ResAmount = 0;

            //Chairs
            type = DefCarpentry.CraftSystem.CraftItems.GetAt(6).ItemType;
            craftResource = DefCarpentry.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
            ResAmount = from.Backpack.GetAmount(typeof(Log)) + from.Backpack.GetAmount(typeof(Board));

            if ((chance > 0) && (ResAmount < craftResource.Amount))
            {
                Chairs = false;
            }

            //Tables
            type = DefCarpentry.CraftSystem.CraftItems.GetAt(15).ItemType;
            craftResource = DefCarpentry.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
            ResAmount = from.Backpack.GetAmount(typeof(Log)) + from.Backpack.GetAmount(typeof(Board));

            if ((chance > 0) && (ResAmount < craftResource.Amount))
            {
                Tables = false;
            }

            //Containers
            type = DefCarpentry.CraftSystem.CraftItems.GetAt(21).ItemType;
            craftResource = DefCarpentry.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
            ResAmount = from.Backpack.GetAmount(typeof(Log)) + from.Backpack.GetAmount(typeof(Board));

            if ((chance > 0) && (ResAmount < craftResource.Amount))
            {
                Containers = false;
            }

            //Misc
            type = DefCarpentry.CraftSystem.CraftItems.GetAt(29).ItemType;
            craftResource = DefCarpentry.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
            ResAmount = from.Backpack.GetAmount(typeof(Log)) + from.Backpack.GetAmount(typeof(Board));

            if ((chance > 0) && (ResAmount < craftResource.Amount))
            {
                Misc = false;
            }

            ItemListEntry[] entries = new ItemListEntry[3];

            if (Chairs)
                entries[0-missing] = new ItemListEntry("Chairs", 2902, 0, 0);
            else
                missing++;// entries[0] = new ItemListEntry("", -1);

            if (Tables)
                entries[1 - missing] = new ItemListEntry("Tables", 2940,0 ,1);
            else
                missing++;//entries[1] = new ItemListEntry("", -1);

            //Called Containers, labeled Misc... There is no actual Misc category
            if (Containers)
                entries[2 - missing] = new ItemListEntry("Miscellaneous", 3650, 0, 2);
            else
                missing++;//entries[2] = new ItemListEntry("", -1);

            /*if (Misc)
                entries[3] = new ItemListEntry("Miscellaneous", 7034);
            else
                entries[3] = new ItemListEntry("", -1);*/

            Array.Resize(ref entries, entries.Length - missing);
            return entries;
        }
Ejemplo n.º 39
0
        public static ItemListEntry[] Main(Mobile from)
        {
            bool allRequiredSkills = true;

            ItemListEntry[] entries   = new ItemListEntry[8];
            double          min       = 0;
            SkillName       skillname = SkillName.Magery;
            Skill           skill     = from.Skills[skillname];
            bool            hasSpell  = false;
            int             count;
            int             missing = 0;

            count = 0;
            for (int i = 0; i < 8; i++)
            {
                if (GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i).ItemType))
                {
                    count++;
                }
            }

            min = ((100.0 / 7.0) * 0) - 20;
            if ((DefInscription.CraftSystem.CraftItems.GetAt(0).GetSuccessChance(from, typeof(BlackPearl), DefInscription.CraftSystem, false, ref allRequiredSkills) > 0) && (skill.Value >= min) && (count > 0))
            {
                entries[0 - missing] = new ItemListEntry("First Circle", 8384, 0, 0);
            }
            else
            {
                missing++;// entries[0] = new ItemListEntry("", -1);
            }
            count = 0;
            for (int i = 8; i < 16; i++)
            {
                if (GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i).ItemType))
                {
                    count++;
                }
            }

            min = ((100.0 / 7.0) * 1) - 20;
            if ((DefInscription.CraftSystem.CraftItems.GetAt(8).GetSuccessChance(from, typeof(BlackPearl), DefInscription.CraftSystem, false, ref allRequiredSkills) > 0) && (skill.Value >= min) && (count > 0))
            {
                entries[1 - missing] = new ItemListEntry("Second Circle", 8385, 0, 1);
            }
            else
            {
                missing++;// entries[1] = new ItemListEntry("", -1);
            }
            count = 0;
            for (int i = 16; i < 24; i++)
            {
                if (GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i).ItemType))
                {
                    count++;
                }
            }

            min = ((100.0 / 7.0) * 2) - 20;
            if ((DefInscription.CraftSystem.CraftItems.GetAt(16).GetSuccessChance(from, typeof(BlackPearl), DefInscription.CraftSystem, false, ref allRequiredSkills) > 0) && (skill.Value >= min) && (count > 0))
            {
                entries[2 - missing] = new ItemListEntry("Third Circle", 8386, 0, 2);
            }
            else
            {
                missing++;// entries[2] = new ItemListEntry("", -1);
            }
            count = 0;
            for (int i = 24; i < 32; i++)
            {
                if (GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i).ItemType))
                {
                    count++;
                }
            }

            min = ((100.0 / 7.0) * 3) - 20;
            if ((DefInscription.CraftSystem.CraftItems.GetAt(24).GetSuccessChance(from, typeof(BlackPearl), DefInscription.CraftSystem, false, ref allRequiredSkills) > 0) && (skill.Value >= min) && (count > 0))
            {
                entries[3 - missing] = new ItemListEntry("Forth Circle", 8387, 0, 3);
            }
            else
            {
                missing++;// entries[3] = new ItemListEntry("", -1);
            }
            count = 0;
            for (int i = 32; i < 40; i++)
            {
                if (GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i).ItemType))
                {
                    count++;
                }
            }

            min = ((100.0 / 7.0) * 4) - 20;
            if ((DefInscription.CraftSystem.CraftItems.GetAt(32).GetSuccessChance(from, typeof(BlackPearl), DefInscription.CraftSystem, false, ref allRequiredSkills) > 0) && (skill.Value >= min) && (count > 0))
            {
                entries[4 - missing] = new ItemListEntry("Fifth Circle", 8388, 0, 4);
            }
            else
            {
                missing++;// entries[4] = new ItemListEntry("", -1);
            }
            count = 0;
            for (int i = 40; i < 48; i++)
            {
                if (GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i).ItemType))
                {
                    count++;
                }
            }

            min = ((100.0 / 7.0) * 5) - 20;
            if ((DefInscription.CraftSystem.CraftItems.GetAt(40).GetSuccessChance(from, typeof(BlackPearl), DefInscription.CraftSystem, false, ref allRequiredSkills) > 0) && (skill.Value >= min) && (count > 0))
            {
                entries[5 - missing] = new ItemListEntry("Sixth Circle", 8389, 0, 5);
            }
            else
            {
                missing++;// entries[5] = new ItemListEntry("", -1);
            }
            count = 0;
            for (int i = 48; i < 56; i++)
            {
                if (GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i).ItemType))
                {
                    count++;
                }
            }

            min = ((100.0 / 7.0) * 6) - 20;
            if ((DefInscription.CraftSystem.CraftItems.GetAt(48).GetSuccessChance(from, typeof(BlackPearl), DefInscription.CraftSystem, false, ref allRequiredSkills) > 0) && (skill.Value >= min) && (count > 0))
            {
                entries[6 - missing] = new ItemListEntry("Seventh Circle", 8390, 0, 6);
            }
            else
            {
                missing++;// entries[6] = new ItemListEntry("", -1);
            }
            count = 0;
            for (int i = 56; i < 64; i++)
            {
                if (GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i).ItemType))
                {
                    count++;
                }
            }

            min = ((100.0 / 7.0) * 7) - 20;
            if ((DefInscription.CraftSystem.CraftItems.GetAt(56).GetSuccessChance(from, typeof(BlackPearl), DefInscription.CraftSystem, false, ref allRequiredSkills) > 0) && (skill.Value >= min) && (count > 0))
            {
                entries[7 - missing] = new ItemListEntry("Eighth Circle", 8391, 0, 7);
            }
            else
            {
                missing++;// entries[7] = new ItemListEntry("", -1);
            }
            Array.Resize(ref entries, entries.Length - missing);
            return(entries);
        }
Ejemplo n.º 40
0
        public static ItemListEntry[] Misc(Mobile from)
        {
            Type type;
            int itemid;
            string name;
            Item item;
            CraftRes craftResource;
            bool allRequiredSkills = true;
            double chance;
            int ResAmount = 0;
            int missing = 0;

            ItemListEntry[] entries = new ItemListEntry[5];

            for (int i = 0; i < 5; ++i)
            {
                chance = DefCarpentry.CraftSystem.CraftItems.GetAt(i + 28).GetSuccessChance(from, typeof(Board), DefCarpentry.CraftSystem, false, ref allRequiredSkills);
                type = DefCarpentry.CraftSystem.CraftItems.GetAt(i + 28).ItemType;
                craftResource = DefCarpentry.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
                ResAmount = from.Backpack.GetAmount(typeof(Log)) + from.Backpack.GetAmount(typeof(Board));

                if ((chance > 0) && (ResAmount >= craftResource.Amount))
                {
                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name = item.GetType().Name;
                    name = name.Replace("sC", "s C");
                    name = name.Replace("rS", "r S");
                    name = name.Replace("dS", "d S");
                    name = name.Replace("nS", "n S");
                    name = name.Replace("gP", "g P");
                    name = name.ToLower();
                    itemid = item.ItemID;

                    if (i==4)
                        entries[i-missing] = new ItemListEntry(String.Format("{0} ({1} logs, {1} cloth)", name, craftResource.Amount), itemid, 0, i);
                    else
                        entries[i-missing] = new ItemListEntry(String.Format("{0} ({1} logs)", name, craftResource.Amount), itemid, 0, i);

                    if (item != null)
                        item.Delete();
                }
                else
                    missing++;//entries[i]= new ItemListEntry("", -1);
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return entries;
        }
Ejemplo n.º 41
0
        public static ItemListEntry[] Chairs(Mobile from)
        {
            Type     type;
            int      itemid;
            string   name;
            Item     item;
            CraftRes craftResource;
            bool     allRequiredSkills = true;
            double   chance;
            int      ResAmount = 0;
            int      missing   = 0;

            ItemListEntry[] entries = new ItemListEntry[9];

            for (int i = 0; i < 9; ++i)
            {
                chance        = DefCarpentry.CraftSystem.CraftItems.GetAt(i + 6).GetSuccessChance(from, typeof(Board), DefCarpentry.CraftSystem, false, ref allRequiredSkills);
                type          = DefCarpentry.CraftSystem.CraftItems.GetAt(i + 6).ItemType;
                craftResource = DefCarpentry.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
                ResAmount     = from.Backpack.GetAmount(typeof(Log)) + from.Backpack.GetAmount(typeof(Board));

                if ((chance > 0) && (ResAmount >= craftResource.Amount))
                {
                    item = null;
                    try { item = Activator.CreateInstance(type) as Item; }
                    catch { }
                    name = item.GetType().Name;
                    name = name.Replace("tS", "t S");
                    name = name.Replace("oC", "o C");
                    name = name.Replace("nC", "n C");
                    name = name.Replace("nB", "n B");
                    name = name.Replace("nT", "n T");
                    name = name.ToLower();
                    if (name == "fancywooden chaircushion")
                    {
                        name = "wooden chair";
                    }
                    if (name == "wooden chaircushion")
                    {
                        name = "wooden chair";
                    }

                    itemid = item.ItemID;

                    /*if (itemid == 2903)
                     *  itemid--;*/

                    entries[i - missing] = new ItemListEntry(String.Format("{0} ({1} wood)", name, craftResource.Amount), itemid, 0, i);

                    if (item != null)
                    {
                        item.Delete();
                    }
                }
                else
                {
                    missing++;//entries[i]= new ItemListEntry("", -1);
                }
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return(entries);
        }
Ejemplo n.º 42
0
        //ARMOR
        private static ItemListEntry[] Armor(Mobile from)
        {
            bool Platemail = true;
            bool Chainmail = true;
            bool Ringmail  = true;
            bool Helmets   = true;
            int  missing   = 0;

            CraftRes craftResource;
            int      resHue            = 0;
            int      maxAmount         = 0;
            Object   message           = null;
            bool     allRequiredSkills = true;
            double   chance;

            //Platemail
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(9).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(9).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Gorget
            {
                Platemail = false;
            }
            //Chainmail
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(5).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(5).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Legs
            {
                Chainmail = false;
            }
            //Ringmail
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(0).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(0).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Gloves
            {
                Ringmail = false;
            }
            //Helmets
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(4).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(4).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Gloves
            {
                Helmets = false;
            }

            ItemListEntry[] entries = new ItemListEntry[4];

            if (Platemail)
            {
                entries[0 - missing] = new ItemListEntry("Platemail", 5141, 0, 0);
            }
            else
            {
                missing++;// entries[0] = new ItemListEntry("", -1);
            }
            if (Chainmail)
            {
                entries[1 - missing] = new ItemListEntry("Chainmail", 5055, 0, 1);
            }
            else
            {
                missing++;//entries[1] = new ItemListEntry("", -1);
            }
            if (Ringmail)
            {
                entries[2 - missing] = new ItemListEntry("Ringmail", 5100, 0, 2);
            }
            else
            {
                missing++;//entries[2] = new ItemListEntry("", -1);
            }
            if (Helmets)
            {
                entries[3 - missing] = new ItemListEntry("Helmets", 5138, 0, 3);
            }
            else
            {
                missing++;//entries[3] = new ItemListEntry("", -1);
            }

            Array.Resize(ref entries, entries.Length - missing);
            return(entries);
        }
Ejemplo n.º 43
0
        public static ItemListEntry[] Main(Mobile from)
        {
            Type     type;
            CraftRes craftResource;
            int      missing = 0;

            bool Chairs     = true;
            bool Tables     = true;
            bool Containers = true;
            bool Misc       = true;

            int    resHue            = 0;
            int    maxAmount         = 0;
            Object message           = null;
            bool   allRequiredSkills = true;
            double chance            = 1;
            int    ResAmount         = 0;


            //Chairs
            type          = DefCarpentry.CraftSystem.CraftItems.GetAt(6).ItemType;
            craftResource = DefCarpentry.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
            ResAmount     = from.Backpack.GetAmount(typeof(Log)) + from.Backpack.GetAmount(typeof(Board));

            if ((chance > 0) && (ResAmount < craftResource.Amount))
            {
                Chairs = false;
            }

            //Tables
            type          = DefCarpentry.CraftSystem.CraftItems.GetAt(15).ItemType;
            craftResource = DefCarpentry.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
            ResAmount     = from.Backpack.GetAmount(typeof(Log)) + from.Backpack.GetAmount(typeof(Board));

            if ((chance > 0) && (ResAmount < craftResource.Amount))
            {
                Tables = false;
            }

            //Containers
            type          = DefCarpentry.CraftSystem.CraftItems.GetAt(21).ItemType;
            craftResource = DefCarpentry.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
            ResAmount     = from.Backpack.GetAmount(typeof(Log)) + from.Backpack.GetAmount(typeof(Board));

            if ((chance > 0) && (ResAmount < craftResource.Amount))
            {
                Containers = false;
            }

            //Misc
            type          = DefCarpentry.CraftSystem.CraftItems.GetAt(29).ItemType;
            craftResource = DefCarpentry.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);
            ResAmount     = from.Backpack.GetAmount(typeof(Log)) + from.Backpack.GetAmount(typeof(Board));

            if ((chance > 0) && (ResAmount < craftResource.Amount))
            {
                Misc = false;
            }

            ItemListEntry[] entries = new ItemListEntry[3];

            if (Chairs)
            {
                entries[0 - missing] = new ItemListEntry("Chairs", 2902, 0, 0);
            }
            else
            {
                missing++;// entries[0] = new ItemListEntry("", -1);
            }
            if (Tables)
            {
                entries[1 - missing] = new ItemListEntry("Tables", 2940, 0, 1);
            }
            else
            {
                missing++;//entries[1] = new ItemListEntry("", -1);
            }
            //Called Containers, labeled Misc... There is no actual Misc category
            if (Containers)
            {
                entries[2 - missing] = new ItemListEntry("Miscellaneous", 3650, 0, 2);
            }
            else
            {
                missing++;//entries[2] = new ItemListEntry("", -1);
            }

            /*if (Misc)
             *  entries[3] = new ItemListEntry("Miscellaneous", 7034);
             * else
             *  entries[3] = new ItemListEntry("", -1);*/

            Array.Resize(ref entries, entries.Length - missing);
            return(entries);
        }
Ejemplo n.º 44
0
        //MAIN
        public static ItemListEntry[] Main(Mobile from)
        {
            bool Shields = true;
            bool Armor   = true;
            bool Weapons = true;
            int  missing = 0;

            int    resHue            = 0;
            int    maxAmount         = 0;
            Object message           = null;
            bool   allRequiredSkills = true;
            double chance;

            //Shields
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(23).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(23).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //WoodenKiteShield
            {
                Shields = false;
            }

            //Armor
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(0).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(0).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //RingmailGloves
            {
                Armor = false;
            }

            //Weapons
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(26).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(26).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Dagger
            {
                Weapons = false;
            }

            ItemListEntry[] entries = new ItemListEntry[4];

            entries[0] = new ItemListEntry("Repair", 4015, 0, 0);

            if (Shields)
            {
                entries[1 - missing] = new ItemListEntry("Shields", 7026, 0, 1);
            }
            else
            {
                missing++;// entries[1] = new ItemListEntry("", -1);
            }
            if (Armor)
            {
                entries[2 - missing] = new ItemListEntry("Armor", 5141, 0, 2);
            }
            else
            {
                missing++;// entries[2] = new ItemListEntry("", -1);
            }
            if (Weapons)
            {
                entries[3 - missing] = new ItemListEntry("Weapons", 5049, 0, 3);
            }
            else
            {
                missing++;// entries[3] = new ItemListEntry("", -1);
            }
            Array.Resize(ref entries, entries.Length - missing);
            return(entries);
        }
Ejemplo n.º 45
0
            private static ItemListEntry[] GetEquip( Mobile m )
            {
                ItemListEntry[] entries = new ItemListEntry[m.Items.Count];

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

                    entries[i] = new ItemListEntry( String.Format( "{0}: {1}", item.Layer, item.GetType().Name ), item.ItemID, item.Hue );
                }

                return entries;
            }
Ejemplo n.º 46
0
        //WEAPONS
        private static ItemListEntry[] Weapons(Mobile from)
        {
            bool Swords = true;
            bool Axes = true;
            bool Maces = true;
            bool Polearms = true;
            int missing = 0;

            CraftRes craftResource;
            int resHue = 0;
            int maxAmount = 0;
            Object message = null;
            bool allRequiredSkills = true;
            double chance;

            //Swords
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(26).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(26).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Dagger
            {
                Swords = false;
            }
            //Axes
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(34).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(34).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Double Axe
            {
                Axes = false;
            }
            //Maces
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(45).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(45).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Mace
            {
                Maces = false;
            }
            //Polearms
            chance = DefBlacksmithy.CraftSystem.CraftItems.GetAt(42).GetSuccessChance(from, typeof(IronIngot), DefBlacksmithy.CraftSystem, false, ref allRequiredSkills);
            if ((from.Backpack.GetAmount(typeof(IronIngot)) < DefBlacksmithy.CraftSystem.CraftItems.SearchFor(DefBlacksmithy.CraftSystem.CraftItems.GetAt(42).ItemType).Ressources.GetAt(0).Amount) || (chance <= 0.0)) //Spear
            {
                Polearms = false;
            }

            ItemListEntry[] entries = new ItemListEntry[4];

            if (Swords)
                entries[0-missing] = new ItemListEntry("Swords & Blades", 5049, 0, 0);
            else
                missing++;//entries[0] = new ItemListEntry("", -1);

            if (Axes)
                entries[1 - missing] = new ItemListEntry("Axes", 3913, 0, 1);
            else
                missing++;//entries[1] = new ItemListEntry("", -1);

            if (Maces)
                entries[2 - missing] = new ItemListEntry("Maces & Hammers", 5127, 0, 2);
            else
                missing++;//entries[2] = new ItemListEntry("", -1);

            if (Polearms)
                entries[3-missing] = new ItemListEntry("Polearms", 3917, 0, 3);
            else
                missing++;//entries[3] = new ItemListEntry("", -1);

            Array.Resize(ref entries, entries.Length - missing);
            return entries;
        }
Ejemplo n.º 47
0
        public static ItemListEntry[] Main(Mobile from)
        {
            bool allRequiredSkills = true;
            ItemListEntry[] entries = new ItemListEntry[8];
            double min = 0;
            SkillName skillname = SkillName.Magery;
            Skill skill = from.Skills[skillname];
            bool hasSpell = false;
            int count;
            int missing = 0;

            count = 0;
            for (int i = 0; i < 8; i++)
                if (GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i).ItemType))
                    count++;

            min = ((100.0 / 7.0) * 0) - 20;
            if ((DefInscription.CraftSystem.CraftItems.GetAt(0).GetSuccessChance(from, typeof(BlackPearl), DefInscription.CraftSystem, false, ref allRequiredSkills) > 0) && (skill.Value >= min) && (count > 0))
                entries[0-missing] = new ItemListEntry("First Circle", 8384, 0, 0);
            else
                missing++;// entries[0] = new ItemListEntry("", -1);

            count = 0;
            for (int i = 8; i < 16; i++)
                if (GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i).ItemType))
                    count++;

            min = ((100.0 / 7.0) * 1) - 20;
            if ((DefInscription.CraftSystem.CraftItems.GetAt(8).GetSuccessChance(from, typeof(BlackPearl), DefInscription.CraftSystem, false, ref allRequiredSkills) > 0) && (skill.Value >= min) && (count > 0))
                entries[1 - missing] = new ItemListEntry("Second Circle", 8385,0,1);
            else
                missing++;// entries[1] = new ItemListEntry("", -1);

            count = 0;
            for (int i = 16; i < 24; i++)
                if (GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i).ItemType))
                    count++;

            min = ((100.0 / 7.0) * 2) - 20;
            if ((DefInscription.CraftSystem.CraftItems.GetAt(16).GetSuccessChance(from, typeof(BlackPearl), DefInscription.CraftSystem, false, ref allRequiredSkills) > 0) && (skill.Value >= min) && (count > 0))
                entries[2 - missing] = new ItemListEntry("Third Circle", 8386,0,2);
            else
                missing++;// entries[2] = new ItemListEntry("", -1);

            count = 0;
            for (int i = 24; i < 32; i++)
                if (GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i).ItemType))
                    count++;

            min = ((100.0 / 7.0) * 3) - 20;
            if ((DefInscription.CraftSystem.CraftItems.GetAt(24).GetSuccessChance(from, typeof(BlackPearl), DefInscription.CraftSystem, false, ref allRequiredSkills) > 0) && (skill.Value >= min) && (count > 0))
                entries[3 - missing] = new ItemListEntry("Forth Circle", 8387,0,3);
            else
                missing++;// entries[3] = new ItemListEntry("", -1);

            count = 0;
            for (int i = 32; i < 40; i++)
                if (GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i).ItemType))
                    count++;

            min = ((100.0 / 7.0) * 4) - 20;
            if ((DefInscription.CraftSystem.CraftItems.GetAt(32).GetSuccessChance(from, typeof(BlackPearl), DefInscription.CraftSystem, false, ref allRequiredSkills) > 0) && (skill.Value >= min) && (count > 0))
                entries[4 - missing] = new ItemListEntry("Fifth Circle", 8388,0,4);
            else
                missing++;// entries[4] = new ItemListEntry("", -1);

            count = 0;
            for (int i = 40; i < 48; i++)
                if (GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i).ItemType))
                    count++;

            min = ((100.0 / 7.0) * 5) - 20;
            if ((DefInscription.CraftSystem.CraftItems.GetAt(40).GetSuccessChance(from, typeof(BlackPearl), DefInscription.CraftSystem, false, ref allRequiredSkills) > 0) && (skill.Value >= min) && (count > 0))
                entries[5 - missing] = new ItemListEntry("Sixth Circle", 8389,0,5);
            else
                missing++;// entries[5] = new ItemListEntry("", -1);

            count = 0;
            for (int i = 48; i < 56; i++)
                if (GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i).ItemType))
                    count++;

            min = ((100.0 / 7.0) * 6) - 20;
            if ((DefInscription.CraftSystem.CraftItems.GetAt(48).GetSuccessChance(from, typeof(BlackPearl), DefInscription.CraftSystem, false, ref allRequiredSkills) > 0) && (skill.Value >= min) && (count > 0))
                entries[6 - missing] = new ItemListEntry("Seventh Circle", 8390,0,6);
            else
                missing++;// entries[6] = new ItemListEntry("", -1);

            count = 0;
            for (int i = 56; i < 64; i++)
                if (GetScroll(from, DefInscription.CraftSystem.CraftItems.GetAt(i).ItemType))
                    count++;

            min = ((100.0 / 7.0) * 7) - 20;
            if ((DefInscription.CraftSystem.CraftItems.GetAt(56).GetSuccessChance(from, typeof(BlackPearl), DefInscription.CraftSystem, false, ref allRequiredSkills) > 0) && (skill.Value >= min) && (count > 0))
                entries[7 - missing] = new ItemListEntry("Eighth Circle", 8391,0,7);
            else
                missing++;// entries[7] = new ItemListEntry("", -1);

            Array.Resize(ref entries, entries.Length - missing);
            return entries;
        }
Ejemplo n.º 48
0
        public static ItemListEntry[] Metal(Mobile from)
        {
            Type type;
            int itemid;
            string name;
            Item item;
            CraftRes craftResource;
            bool allRequiredSkills = true;
            double chance;
            int ResAmount;
            int missing = 0;

            ItemListEntry[] entries = new ItemListEntry[20];

            entries[0] = new ItemListEntry("Dart Trap", 4397, 0, 0);
            entries[1] = new ItemListEntry("Explosion Trap", 4344, 0, 1);
            entries[2] = new ItemListEntry("Poison Trap", 4424, 0, 2);

            /*if ((from.Backpack.GetAmount(typeof(Bolt)) > 0) && (from.Backpack.GetAmount(typeof(IronIngot)) > 0))
                entries[0] = new ItemListEntry("dart trap", 4397);
            else
                entries[0] = new ItemListEntry("", -1);

            if ((from.Backpack.GetAmount(typeof(BaseExplosionPotion)) > 0) && (from.Backpack.GetAmount(typeof(IronIngot)) > 0))
                entries[1] = new ItemListEntry("explosion trap", 4344);
            else
                entries[1] = new ItemListEntry("", -1);

            if ((from.Backpack.GetAmount(typeof(BasePoisonPotion)) > 0) && (from.Backpack.GetAmount(typeof(IronIngot)) > 0))
                entries[2] = new ItemListEntry("poison trap", 4424);
            else
                entries[2] = new ItemListEntry("", -1);*/

            for (int i = 3; i < 20; ++i)
            {
                chance = DefTinkering.CraftSystem.CraftItems.GetAt(i + 5).GetSuccessChance(from, typeof(IronIngot), DefTinkering.CraftSystem, false, ref allRequiredSkills);
                type = DefTinkering.CraftSystem.CraftItems.GetAt(i + 5).ItemType;
                craftResource = DefTinkering.CraftSystem.CraftItems.SearchFor(type).Ressources.GetAt(0);

                /*if ((chance > 0) && (from.Backpack.GetAmount(typeof(IronIngot)) >= (craftResource).Amount))
                {*/
                item = null;
                try { item = Activator.CreateInstance(type) as Item; }
                catch { }
                name = item.GetType().Name;
                name = name.Replace("gK", "g K");
                name = name.Replace("kP", "k P");
                name = name.Replace("tP", "t P");
                name = name.Replace("wK", "w K");
                name = name.Replace("lS", "l S");
                name = name.Replace("rT", "r T");
                name = name.Replace("hH", "h H");
                name = name.Replace("eH", "e H");
                name = name.Replace("kR", "k R");
                name = name.ToLower();
                itemid = item.ItemID;

                if (name == "scissors")
                    itemid--;
                else if (name == "tongs")
                    itemid++;
                else if (name == "smith hammer")
                    itemid++;
                else if (name == "shovel")
                    itemid++;

                entries[i-missing] = new ItemListEntry(String.Format("{0}", name), itemid, 0, i);

                if (item != null)
                    item.Delete();
                //}
                //else
                //    missing++;//entries[i-missing] = new ItemListEntry("", -1);
            }

            Array.Resize(ref entries, (entries.Length - missing));
            return entries;
        }
Ejemplo n.º 49
0
 public CraftSubMenu( string name, int itemid, int hue, ItemListEntry[] subItems )
     : base(name, itemid, hue)
 {
     m_SubItems = subItems;
 }
Ejemplo n.º 50
0
                public EquipMenu( Mobile from, Mobile m, ItemListEntry[] entries )
                    : base("Equipment", entries)
                {
                    m_Mobile = m;

                    CommandLogging.WriteLine( from, "{0} {1} viewing equipment of {2}", from.AccessLevel, CommandLogging.Format( from ), CommandLogging.Format( m ) );
                }
Ejemplo n.º 51
0
 public CraftSubMenu( string name, int itemid, ItemListEntry[] subItems )
     : this(name,itemid,0,subItems)
 {
 }