예제 #1
0
        public override void OnConfirmed(CollectionItem citem, int index)
        {
            BODCollectionItem item = citem as BODCollectionItem;

            if (item != null && GetPoints(User) >= item.Points && item.Constructor != null)
            {
                Item i = item.Constructor(item.RewardType);

                if (User.Backpack == null || !User.Backpack.TryDropItem(User, i, false))
                {
                    User.SendLocalizedMessage(1074361); // The reward could not be given.  Make sure you have room in your pack.
                    i.Delete();

                    User.SendGump(new RewardsGump(Owner, User, this.BODType, (int)Points));
                }
                else
                {
                    User.SendLocalizedMessage(1073621); // Your reward has been placed in your backpack.
                    User.PlaySound(0x5A7);

                    if (UsingBanked)
                    {
                        BulkOrderSystem.DeductPoints(User, this.BODType, item.Points);
                    }
                    else
                    {
                        BulkOrderSystem.RemovePending(User, this.BODType);
                    }
                }
            }
        }
예제 #2
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_Deed.Deleted || !m_Deed.IsChildOf(m_From.Backpack))
            {
                return;
            }

            if (info.ButtonID == 2) // Combine
            {
                m_From.SendGump(new LargeBODGump(m_From, m_Deed));
                m_Deed.BeginCombine(m_From);
            }
            else if (info.ButtonID == 3) // bank button
            {
                BODContext c = BulkOrderSystem.GetContext(m_From);

                if (c != null)
                {
                    switch (c.PointsMode)
                    {
                    case PointsMode.Enabled: c.PointsMode = PointsMode.Disabled; break;

                    case PointsMode.Disabled: c.PointsMode = PointsMode.Automatic; break;

                    case PointsMode.Automatic: c.PointsMode = PointsMode.Enabled; break;
                    }
                }

                m_From.SendGump(new LargeBODGump(m_From, m_Deed));
            }
            else if (info.ButtonID == 4) // combine from container
            {
                m_From.BeginTarget(-1, false, Targeting.TargetFlags.None, (m, targeted) =>
                {
                    if (!m_Deed.Deleted && targeted is Container container)
                    {
                        List <SmallBOD> list = new List <SmallBOD>();

                        for (var index = 0; index < container.Items.Count; index++)
                        {
                            Item item = container.Items[index];

                            if (item is SmallBOD bod)
                            {
                                list.Add(bod);
                            }
                        }

                        for (var index = 0; index < list.Count; index++)
                        {
                            SmallBOD item = list[index];

                            m_Deed.EndCombine(m_From, item);
                        }

                        list.Clear();
                    }
                });
            }
        }
예제 #3
0
        public override double GetPoints(Mobile m)
        {
            if (Points > 0)
            {
                return(Points);
            }

            return(BulkOrderSystem.GetPoints(m, this.BODType));
        }
예제 #4
0
        public static SmallInscriptionBOD CreateRandomFor(Mobile m)
        {
            SmallBulkEntry[] entries;

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

            entries = SmallBulkEntry.InscriptionSmalls;

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

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

                CraftSystem system = DefInscription.CraftSystem;

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

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

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

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

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

            return(null);
        }
예제 #5
0
        private static void OnSave(Mobile m, object state)
        {
            object[] ohs = (object[])state;

            BulkOrderSystem.SetPoints(m, (BODType)ohs[2], (double)ohs[1]);
            BulkOrderSystem.RemovePending(m, (BODType)ohs[2]);

            if (m is PlayerMobile)
                m.SendGump(new RewardsGump((Mobile)ohs[3], (PlayerMobile)m, (BODType)ohs[2]));
        }
예제 #6
0
        public RewardsGump(Mobile owner, PlayerMobile user, BODType type, int points = 0)
            : base(owner, user, BulkOrderSystem.GetRewardCollection(type), 1157082, points == 0 ? BulkOrderSystem.GetPoints(user, type) : points)
        {
            BODType = type;

            var entry = new GumpLabel(230, 65, 0x64, GetPoints(user).ToString("0.000000"));

            entry.Parent = this;

            Entries.Insert(10, entry);
        }
예제 #7
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_Deed.Deleted || !m_Deed.IsChildOf(m_From.Backpack))
            {
                return;
            }

            switch (info.ButtonID)
            {
            case 2:     // Combine
            {
                m_From.SendGump(new SmallBODGump(m_From, m_Deed));
                m_Deed.BeginCombine(m_From);
                break;
            }

            case 3:     // points mode
            {
                BODContext c = BulkOrderSystem.GetContext(m_From);

                if (c != null)
                {
                    switch (c.PointsMode)
                    {
                    case PointsMode.Enabled: c.PointsMode = PointsMode.Disabled; break;

                    case PointsMode.Disabled: c.PointsMode = PointsMode.Automatic; break;

                    case PointsMode.Automatic: c.PointsMode = PointsMode.Enabled; break;
                    }
                }

                m_From.SendGump(new SmallBODGump(m_From, m_Deed));
                break;
            }

            case 4:     // combine from container
            {
                m_From.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, (m, targeted) =>
                    {
                        if (!m_Deed.Deleted && targeted is Container)
                        {
                            List <Item> list = new List <Item>(((Container)targeted).Items);

                            foreach (Item item in list)
                            {
                                m_Deed.EndCombine(m_From, item);
                            }
                        }
                    });
                break;
            }
            }
        }
예제 #8
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_Deed.Deleted || !m_Deed.IsChildOf(m_From.Backpack))
            {
                return;
            }

            if (info.ButtonID == 2) // Combine
            {
                m_From.SendGump(new LargeBODGump(m_From, m_Deed));
                m_Deed.BeginCombine(m_From);
            }
            else if (info.ButtonID == 3) // bank button
            {
                BODContext c = BulkOrderSystem.GetContext(m_From);

                if (c != null)
                {
                    switch (c.PointsMode)
                    {
                    case PointsMode.Enabled: c.PointsMode = PointsMode.Disabled; break;

                    case PointsMode.Disabled: c.PointsMode = PointsMode.Automatic; break;

                    case PointsMode.Automatic: c.PointsMode = PointsMode.Enabled; break;
                    }
                }

                m_From.SendGump(new LargeBODGump(m_From, m_Deed));
            }
            else if (info.ButtonID == 4) // combine from container
            {
                m_From.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, (m, targeted) =>
                {
                    if (!m_Deed.Deleted && targeted is Container)
                    {
                        List <SmallBOD> list = ((Container)targeted).Items.OfType <SmallBOD>().ToList();

                        foreach (SmallBOD item in list)
                        {
                            m_Deed.EndCombine(m_From, item);
                        }

                        list.Clear();
                    }
                });
            }
        }
예제 #9
0
        public static SmallSmithBOD CreateRandomFor(Mobile m)
        {
            SmallBulkEntry[] entries;
            bool             useMaterials;

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

            if (entries.Length > 0)
            {
                double theirSkill = BulkOrderSystem.GetBODSkill(m, SkillName.Blacksmith);
                int    amountMax;

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

                BulkMaterialType material = BulkMaterialType.None;

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

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

                double excChance = 0.0;

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

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

                CraftSystem system = DefBlacksmithy.CraftSystem;

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

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

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

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

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

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

            return(null);
        }
예제 #10
0
 static BulkOrderSystem()
 {
     Instance = new BulkOrderSystem();
 }
예제 #11
0
        public static SmallCookingBOD CreateRandomFor(Mobile m)
        {
            SmallBulkEntry[] entries;

            double theirSkill     = BulkOrderSystem.GetBODSkill(m, SkillName.Cooking);
            bool   nonexceptional = false;

            if (0.20 > Utility.RandomDouble())
            {
                nonexceptional = true;
                entries        = SmallBulkEntry.CookingSmallsRegular;
            }
            else
            {
                entries = SmallBulkEntry.CookingSmalls;
            }

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

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

                double excChance = 0.0;

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

                bool reqExceptional = !nonexceptional && excChance > Utility.RandomDouble();

                CraftSystem system = DefCooking.CraftSystem;

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

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

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

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

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

            return(null);
        }
예제 #12
0
        public LargeBODGump(Mobile from, LargeBOD deed)
            : base(25, 25)
        {
            m_From = from;
            m_Deed = deed;

            m_From.CloseGump(typeof(LargeBODGump));
            m_From.CloseGump(typeof(SmallBODGump));

            LargeBulkEntry[] entries = deed.Entries;

            AddPage(0);

            int height = 0;

            if (BulkOrderSystem.NewSystemEnabled)
            {
                if (deed.RequireExceptional || deed.Material != BulkMaterialType.None)
                {
                    height += 24;
                }

                if (deed.RequireExceptional)
                {
                    height += 24;
                }

                if (deed.Material != BulkMaterialType.None)
                {
                    height += 24;
                }
            }

            AddBackground(50, 10, 455, 218 + height + (entries.Length * 24), 5054);

            AddImageTiled(58, 20, 438, 200 + height + (entries.Length * 24), 2624);
            AddAlphaRegion(58, 20, 438, 200 + height + (entries.Length * 24));

            AddImage(45, 5, 10460);
            AddImage(480, 5, 10460);
            AddImage(45, 203 + height + (entries.Length * 24), 10460);
            AddImage(480, 203 + height + (entries.Length * 24), 10460);

            AddHtmlLocalized(225, 25, 120, 20, 1045134, 0x7FFF, false, false); // A large bulk order

            AddHtmlLocalized(75, 48, 250, 20, 1045138, 0x7FFF, false, false);  // Amount to make:
            AddLabel(275, 48, 1152, deed.AmountMax.ToString());

            AddHtmlLocalized(75, 72, 120, 20, 1045137, 0x7FFF, false, false);  // Items requested:
            AddHtmlLocalized(275, 76, 200, 20, 1045153, 0x7FFF, false, false); // Amount finished:

            int y = 96;

            for (int i = 0; i < entries.Length; ++i)
            {
                LargeBulkEntry entry   = entries[i];
                SmallBulkEntry details = entry.Details;

                AddHtmlLocalized(75, y, 210, 20, details.Number, 0x7FFF, false, false);
                AddLabel(275, y, 0x480, entry.Amount.ToString());

                y += 24;
            }

            if (deed.RequireExceptional || deed.Material != BulkMaterialType.None)
            {
                AddHtmlLocalized(75, y, 200, 20, 1045140, 0x7FFF, false, false); // Special requirements to meet:
                y += 24;
            }

            if (deed.RequireExceptional)
            {
                AddHtmlLocalized(75, y, 300, 20, 1045141, 0x7FFF, false, false); // All items must be exceptional.
                y += 24;
            }

            if (deed.Material != BulkMaterialType.None)
            {
                AddHtmlLocalized(75, y, 300, 20, SmallBODGump.GetMaterialNumberFor(deed.Material), 0x7FFF, false, false); // All items must be made with x material.
                y += 24;
            }

            if (BulkOrderSystem.NewSystemEnabled)
            {
                BODContext c = BulkOrderSystem.GetContext((PlayerMobile)from);

                int    points = 0;
                double banked = 0.0;

                BulkOrderSystem.ComputePoints(deed, out points, out banked);

                AddHtmlLocalized(75, y, 300, 20, 1157301, string.Format("{0}\t{1}", points, banked.ToString("0.000000")), 0x7FFF, false, false); // Worth ~1_POINTS~ turn in points and ~2_POINTS~ bank points.
                y += 24;

                AddButton(125, y, 4005, 4007, 3, GumpButtonType.Reply, 0);
                AddHtmlLocalized(160, y, 300, 20, c.PointsMode == PointsMode.Enabled ? 1157302 : c.PointsMode == PointsMode.Disabled ? 1157303 : 1157309, 0x7FFF, false, false); // Banking Points Enabled/Disabled/Automatic
                y += 24;

                AddButton(125, y, 4005, 4007, 2, GumpButtonType.Reply, 0);
                AddHtmlLocalized(160, y, 300, 20, 1045154, 0x7FFF, false, false); // Combine this deed with the item requested.
                y += 24;

                AddButton(125, y, 4005, 4007, 4, GumpButtonType.Reply, 0);
                AddHtmlLocalized(160, y, 300, 20, 1157304, 0x7FFF, false, false); // Combine this deed with contained items.
                y += 24;

                AddButton(125, y, 4005, 4007, 1, GumpButtonType.Reply, 0);
                AddHtmlLocalized(160, y, 120, 20, 1011441, 0x7FFF, false, false); // EXIT
            }
            else
            {
                AddButton(125, 168 + (entries.Length * 24), 4005, 4007, 2, GumpButtonType.Reply, 0);
                AddHtmlLocalized(160, 168 + (entries.Length * 24), 300, 20, 1045155, 0x7FFF, false, false); // Combine this deed with another deed.

                AddButton(125, 192 + (entries.Length * 24), 4005, 4007, 1, GumpButtonType.Reply, 0);
                AddHtmlLocalized(160, 192 + (entries.Length * 24), 120, 20, 1011441, 0x7FFF, false, false); // EXIT
            }
        }
예제 #13
0
        public static SmallTinkerBOD CreateRandomFor(Mobile m)
        {
            SmallBulkEntry[] entries;
            bool             useMaterials;

            if (useMaterials = 0.75 > Utility.RandomDouble())
            {
                entries = SmallBulkEntry.TinkeringSmalls;
            }
            else
            {
                entries = SmallBulkEntry.TinkeringSmallsRegular;
            }

            if (entries.Length > 0)
            {
                double theirSkill = BulkOrderSystem.GetBODSkill(m, SkillName.Tinkering);
                int    amountMax;

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

                BulkMaterialType material = BulkMaterialType.None;

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

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

                double excChance = 0.0;

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

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

                CraftSystem system = DefTinkering.CraftSystem;

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

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

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

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

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

                if (validEntries.Count > 0)
                {
                    SmallBulkEntry entry = validEntries[Utility.Random(validEntries.Count)];

                    if (material != BulkMaterialType.None && CannotAssignMaterial(entry.Type))
                    {
                        material = BulkMaterialType.None;
                    }

                    SmallTinkerBOD bod = new SmallTinkerBOD(entry, material, amountMax, reqExceptional);

                    if (entry.Type.IsSubclassOf(typeof(BaseJewel)))
                    {
                        bod.AssignGemType(entry.Type);
                    }

                    return(bod);
                }
            }

            return(null);
        }
예제 #14
0
        public static SmallTailorBOD CreateRandomFor(Mobile m)
        {
            SmallBulkEntry[] entries;
            bool             useMaterials = Utility.RandomBool();

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

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

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

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

                BulkMaterialType material = BulkMaterialType.None;

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

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

                double excChance = 0.0;

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

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

                CraftSystem system = DefTailoring.CraftSystem;

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

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

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

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

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

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

            return(null);
        }
예제 #15
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (this.m_Deed.Deleted || !this.m_Deed.IsChildOf(this.m_From.Backpack))
            {
                return;
            }

            if (info.ButtonID == 2) // Combine
            {
                this.m_From.SendGump(new LargeBODGump(this.m_From, this.m_Deed));
                this.m_Deed.BeginCombine(this.m_From);
            }
            else if (info.ButtonID == 3) // bank button
            {
                BODContext c = BulkOrderSystem.GetContext(m_From);

                if (c != null)
                {
                    switch (c.PointsMode)
                    {
                    case PointsMode.Enabled: c.PointsMode = PointsMode.Disabled; break;

                    case PointsMode.Disabled: c.PointsMode = PointsMode.Automatic; break;

                    case PointsMode.Automatic: c.PointsMode = PointsMode.Enabled; break;
                    }
                }

                this.m_From.SendGump(new LargeBODGump(this.m_From, this.m_Deed));
            }
            else if (info.ButtonID == 4) // combine from container
            {
                m_From.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, (m, targeted) =>
                {
                    if (!m_Deed.Deleted && targeted is Container)
                    {
                        List <SmallBOD> list = ((Container)targeted).Items.OfType <SmallBOD>().ToList();

                        foreach (SmallBOD item in list)
                        {
                            m_Deed.EndCombine(m_From, item);
                        }

                        list.Clear();
                    }
                });
            }
            //
            // NOT SURE HOW TO IMPLEMENT WITH NEWER SYSTEM YET ~ ZERODOWNED
            //

            /*
             * //daat99 OWLTR start - custom bods
             * else if (info.ButtonID >= 3)
             * {
             * bool IsFound = false;
             * IPooledEnumerable eable = m_From.GetMobilesInRange(6);
             * foreach (Mobile vendor in eable)
             * {
             * switch (info.ButtonID)
             * {
             * case 3: IsFound = (vendor is Blacksmith || vendor is Weaponsmith || vendor is Armorer); break;
             * case 4: IsFound = (vendor is Tailor || vendor is Weaver); break;
             * case 5: IsFound = (vendor is Carpenter); break;
             * case 6: IsFound = (vendor is Bowyer); break;
             * }
             * if (IsFound == true)
             * break;
             * }
             * if (IsFound == false)
             * switch (info.ButtonID)
             * {
             * case 3: m_From.SendMessage("You must be near a Blacksmith, Weaponsmith or Armorer to claim that."); break;
             * case 4: m_From.SendMessage("You must be near a Tailor or Weaver to claim that."); break;
             * case 5: m_From.SendMessage("You must be near a Carpenter to claim that."); break;
             * case 6: m_From.SendMessage("You must be near a Bowyer to claim that."); break;
             * }
             * else
             * daat99.daat99.ClaimBods(m_From, m_Deed);
             *
             * }
             * //daat99 OWLTR end - custom bods
             */
        }
예제 #16
0
        public ConfirmBankPointsGump(PlayerMobile user, Mobile owner, BODType type, int points, double banked)
            : base(user, 1157076, 1157077, new object[] { points, banked, type, owner }, String.Format("{0}\t{1}", banked.ToString("0.000000"), points.ToString()), OnSave, OnClaim)
        {
            Closable = false;
            user.CloseGump(typeof(ConfirmBankPointsGump));

            Points       = points;
            Banked       = banked;
            this.BODType = type;

            Owner = owner;

            Rectangle2D rec = ItemBounds.Table[0x2258];

            AddItem(115 + rec.Width / 2 - rec.X, 110 + rec.Height / 2 - rec.Y, 0x2258, BulkOrderSystem.GetBodHue(this.BODType));

            #region Level System Mod
            Configured c = new Configured();
            if (c.GainExpFromBods == true)
            {
                LevelHandler.BodGainEXP(user, (int)points);
            }
            #endregion
        }
예제 #17
0
        public SmallBODGump(Mobile from, SmallBOD deed)
            : base(25, 25)
        {
            m_From = from;
            m_Deed = deed;

            m_From.CloseGump(typeof(LargeBODGump));
            m_From.CloseGump(typeof(SmallBODGump));

            AddPage(0);

            int height = 0;

            if (BulkOrderSystem.NewSystemEnabled)
            {
                if (deed.RequireExceptional || deed.Material != BulkMaterialType.None)
                {
                    height += 24;
                }

                if (deed.RequireExceptional)
                {
                    height += 24;
                }

                if (deed.Material != BulkMaterialType.None)
                {
                    height += 24;
                }
            }

            AddBackground(50, 10, 455, 245 + height, 5054);
            AddImageTiled(58, 20, 438, 226 + height, 2624);
            AddAlphaRegion(58, 20, 438, 226 + height);

            AddImage(45, 5, 10460);
            AddImage(480, 5, 10460);
            AddImage(45, 230 + height, 10460);
            AddImage(480, 230 + height, 10460);

            AddHtmlLocalized(225, 25, 120, 20, 1045133, 0x7FFF, false, false); // A bulk order

            AddHtmlLocalized(75, 48, 250, 20, 1045138, 0x7FFF, false, false);  // Amount to make:
            AddLabel(275, 48, 1152, deed.AmountMax.ToString());

            AddHtmlLocalized(275, 76, 200, 20, 1045153, 0x7FFF, false, false); // Amount finished:
            AddHtmlLocalized(75, 72, 120, 20, 1045136, 0x7FFF, false, false);  // Item requested:

            AddItem(410, 72, deed.Graphic, deed.GraphicHue);

            AddHtmlLocalized(75, 96, 210, 20, deed.Number, 0x7FFF, false, false);
            AddLabel(275, 96, 0x480, deed.AmountCur.ToString());

            int y = 120;

            if (deed.RequireExceptional || deed.Material != BulkMaterialType.None)
            {
                AddHtmlLocalized(75, y, 200, 20, 1045140, 0x7FFF, false, false); // Special requirements to meet:
                y += 24;
            }

            if (deed.RequireExceptional)
            {
                AddHtmlLocalized(75, y, 300, 20, 1045141, 0x7FFF, false, false); // All items must be exceptional.
                y += 24;
            }

            if (deed.Material != BulkMaterialType.None)
            {
                AddHtmlLocalized(75, y, 300, 20, GetMaterialNumberFor(deed.Material), 0x7FFF, false, false); // All items must be made with x material.
                y += 24;
            }

            if (from is PlayerMobile && BulkOrderSystem.NewSystemEnabled)
            {
                BODContext c = BulkOrderSystem.GetContext((PlayerMobile)from);

                int    points = 0;
                double banked = 0.0;

                BulkOrderSystem.ComputePoints(deed, out points, out banked);

                AddHtmlLocalized(75, y, 300, 20, 1157301, string.Format("{0}\t{1}", points, banked.ToString("0.000000")), 0x7FFF, false, false); // Worth ~1_POINTS~ turn in points and ~2_POINTS~ bank points.
                y += 24;

                AddButton(125, y, 4005, 4007, 3, GumpButtonType.Reply, 0);
                AddHtmlLocalized(160, y, 300, 20, c.PointsMode == PointsMode.Enabled ? 1157302 : c.PointsMode == PointsMode.Disabled ? 1157303 : 1157309, 0x7FFF, false, false); // Banking Points Enabled/Disabled/Automatic
                y += 24;

                AddButton(125, y, 4005, 4007, 2, GumpButtonType.Reply, 0);
                AddHtmlLocalized(160, y, 300, 20, 1045154, 0x7FFF, false, false); // Combine this deed with the item requested.
                y += 24;

                AddButton(125, y, 4005, 4007, 4, GumpButtonType.Reply, 0);
                AddHtmlLocalized(160, y, 300, 20, 1157304, 0x7FFF, false, false); // Combine this deed with contained items.
                y += 24;
            }
            else
            {
                AddButton(125, y, 4005, 4007, 2, GumpButtonType.Reply, 0);
                AddHtmlLocalized(160, y, 300, 20, 1045154, 0x7FFF, false, false); // Combine this deed with the item requested.
                y += 24;
            }

            AddButton(125, y, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(160, y, 120, 20, 1011441, 0x7FFF, false, false); // EXIT
        }
예제 #18
0
        public ConfirmBankPointsGump(PlayerMobile user, Mobile owner, BODType type, int points, double banked)
            : base(user, 1157076, 1157077, new object[] { points, banked, type, owner }, string.Format("{0}\t{1}", banked.ToString("0.000000"), points.ToString()), OnSave, OnClaim)
        {
            Closable = false;
            user.CloseGump(typeof(ConfirmBankPointsGump));

            Points  = points;
            Banked  = banked;
            BODType = type;

            Owner = owner;

            Rectangle2D rec = ItemBounds.Table[0x2258];

            AddItem(115 + rec.Width / 2 - rec.X, 110 + rec.Height / 2 - rec.Y, 0x2258, BulkOrderSystem.GetBodHue(BODType));
        }