예제 #1
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();
                    }
                });
            }
        }
예제 #2
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;
            }
            }
        }
예제 #3
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();
                    }
                });
            }
        }
예제 #4
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
            }
        }
예제 #5
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
        }
예제 #6
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
             */
        }