Beispiel #1
0
        public SellOptionsGump(Mobile m)
            : base(0, 0)
        {
            SellData selloptions = (SellData)XmlAttach.FindAttachment(m, typeof(SellData));

            if (selloptions == null)
            {
                selloptions = new SellData();
                XmlAttach.AttachTo(m, selloptions);
            }

            this.Closable   = true;
            this.Disposable = true;
            this.Dragable   = true;
            this.Resizable  = false;
            this.AddPage(0);
            this.AddBackground(0, 0, 368, 284, 9380);

            this.AddLabel(126, 7, 0, @"Sell Options");
//            this.AddLabel(81, 34, 0, @"Magic Items");
            this.AddLabel(81, 64, 0, @"Hides/Scales");
            this.AddLabel(81, 94, 0, @"Arrows/Bolts");
            this.AddLabel(81, 124, 0, @"All Weapons");
            this.AddLabel(81, 154, 0, @"All Armors");
            this.AddLabel(81, 184, 0, @"Reagents");

            this.AddLabel(259, 34, 0, @"Jewelry");
            this.AddLabel(259, 64, 0, @"Potions");
            this.AddLabel(259, 94, 0, @"Gems");
            this.AddLabel(259, 124, 0, @"Clothes");
            this.AddLabel(259, 154, 0, @"Food");
            this.AddLabel(259, 184, 0, @"Resources");

//            this.AddLabel(40, 210, 0, @"*Magic Items do not include clothes except hat*");

//            this.AddCheck(60, 34, 210, 211, selloptions.SellMagic, 1);
            this.AddCheck(60, 64, 210, 211, selloptions.SellHides, 2);
            this.AddCheck(60, 94, 210, 211, selloptions.SellArrows, 3);
            this.AddCheck(60, 124, 210, 211, selloptions.SellWeapons, 4);
            this.AddCheck(60, 154, 210, 211, selloptions.SellArmor, 5);
            this.AddCheck(60, 184, 210, 211, selloptions.SellRegs, 11);

            this.AddCheck(229, 34, 210, 211, selloptions.SellJewelry, 6);
            this.AddCheck(229, 64, 210, 211, selloptions.SellPotions, 7);
            this.AddCheck(229, 94, 210, 211, selloptions.SellGems, 8);
            this.AddCheck(229, 124, 210, 211, selloptions.SellClothes, 9);
            this.AddCheck(229, 154, 210, 211, selloptions.SellFood, 10);
            this.AddCheck(229, 184, 210, 211, selloptions.SellResources, 12);

            this.AddButton(67, 228, 247, 248, 1, GumpButtonType.Reply, 0);
            this.AddButton(244, 228, 241, 248, 0, GumpButtonType.Reply, 0);
        }
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {

            Mobile m = sender.Mobile;
            SellData selloptions = (SellData)XmlAttach.FindAttachment(m, typeof(SellData));
            if (selloptions == null)
            {
                selloptions = new SellData();
                XmlAttach.AttachTo(m, selloptions);
            }
            switch (info.ButtonID)
            {
                case 0: // Closed or Cancel
                    {
                        return;
                    }
                default:
                    {
                        // Make sure that the OK button was pressed
                        if (info.ButtonID == 1)
                        {
                            // see what types of stuff the user do not wants to sell and toggle the property
                            ArrayList Selections = new ArrayList(info.Switches);

//                            if (Selections.Contains(1) == true) { selloptions.SellMagic = true; }
//                            else { selloptions.SellMagic = false; }
                            if (Selections.Contains(2) == true) { selloptions.SellHides = true; }
                            else { selloptions.SellHides = false; }
                            if (Selections.Contains(3) == true) { selloptions.SellArrows = true; }
                            else { selloptions.SellArrows = false; }
                            if (Selections.Contains(4) == true) { selloptions.SellWeapons = true; }
                            else { selloptions.SellWeapons = false; }
                            if (Selections.Contains(5) == true) { selloptions.SellArmor = true; }
                            else { selloptions.SellArmor = false; }
                            if (Selections.Contains(6) == true) { selloptions.SellJewelry = true; }
                            else { selloptions.SellJewelry = false; }
                            if (Selections.Contains(7) == true) { selloptions.SellPotions = true; }
                            else { selloptions.SellPotions = false; }
                            if (Selections.Contains(8) == true) { selloptions.SellGems = true; }
                            else { selloptions.SellGems = false; }
                            if (Selections.Contains(9) == true) { selloptions.SellClothes = true; }
                            else { selloptions.SellClothes = false; }
                            if (Selections.Contains(10) == true) { selloptions.SellFood = true; }
                            else { selloptions.SellFood = false; }
                            if (Selections.Contains(11) == true) { selloptions.SellRegs = true; }
                            else { selloptions.SellRegs = false; }
                            if (Selections.Contains(12) == true) { selloptions.SellResources = true; }
                            else { selloptions.SellResources = false; }

                        }
                        break;
                    }
            }
        }
        public SellOptionsGump(Mobile m)
            : base(0, 0)
        {
            SellData selloptions = (SellData)XmlAttach.FindAttachment(m, typeof(SellData));
            if (selloptions == null)
            {
                selloptions = new SellData();
                XmlAttach.AttachTo(m, selloptions);
            }

            this.Closable = true;
            this.Disposable = true;
            this.Dragable = true;
            this.Resizable = false;
            this.AddPage(0);
            this.AddBackground(0, 0, 368, 284, 9380);

            this.AddLabel(126, 7, 0, @"Sell Options");
//            this.AddLabel(81, 34, 0, @"Magic Items");
            this.AddLabel(81, 64, 0, @"Hides/Scales");
            this.AddLabel(81, 94, 0, @"Arrows/Bolts");
            this.AddLabel(81, 124, 0, @"All Weapons");
            this.AddLabel(81, 154, 0, @"All Armors");
            this.AddLabel(81, 184, 0, @"Reagents");

            this.AddLabel(259, 34, 0, @"Jewelry");
            this.AddLabel(259, 64, 0, @"Potions");
            this.AddLabel(259, 94, 0, @"Gems");
            this.AddLabel(259, 124, 0, @"Clothes");
            this.AddLabel(259, 154, 0, @"Food");
            this.AddLabel(259, 184, 0, @"Resources");

//            this.AddLabel(40, 210, 0, @"*Magic Items do not include clothes except hat*");

//            this.AddCheck(60, 34, 210, 211, selloptions.SellMagic, 1);
            this.AddCheck(60, 64, 210, 211, selloptions.SellHides, 2);
            this.AddCheck(60, 94, 210, 211, selloptions.SellArrows, 3);
            this.AddCheck(60, 124, 210, 211, selloptions.SellWeapons, 4);
            this.AddCheck(60, 154, 210, 211, selloptions.SellArmor, 5);
            this.AddCheck(60, 184, 210, 211, selloptions.SellRegs, 11);

            this.AddCheck(229, 34, 210, 211, selloptions.SellJewelry, 6);
            this.AddCheck(229, 64, 210, 211, selloptions.SellPotions, 7);
            this.AddCheck(229, 94, 210, 211, selloptions.SellGems, 8);
            this.AddCheck(229, 124, 210, 211, selloptions.SellClothes, 9);
            this.AddCheck(229, 154, 210, 211, selloptions.SellFood, 10);
            this.AddCheck(229, 184, 210, 211, selloptions.SellResources, 12);

            this.AddButton(67, 228, 247, 248, 1, GumpButtonType.Reply, 0);
            this.AddButton(244, 228, 241, 248, 0, GumpButtonType.Reply, 0);
        }
        public static bool isSellable(SellData selloptions, Item item)
        {
//            if (item is BaseWeapon)
//            {
//                if (!selloptions.SellWeapons)
//                    return false;
//                else if (!selloptions.SellMagic && MagicPoints.GetPoints((BaseWeapon)item) > 0)
//                    return false;
//                else
//                    return true;
//            }
//            else if (item is BaseArmor)
//            {
//                if (!selloptions.SellArmor)
//                    return false;
//                else if (!selloptions.SellMagic && MagicPoints.GetPoints((BaseArmor)item) > 0)
//                    return false;
//                else
//                    return true;
//            }
//            else if (item is BaseJewel)
//            {
//                if (!selloptions.SellJewelry)
//                    return false;
//                else if (!selloptions.SellMagic && MagicPoints.GetPoints((BaseJewel)item) > 0)
//                    return false;
//                else
//                    return true;
//            }
//            else if (item is BaseHat)
//            {
//                if (!selloptions.SellClothes)
//                    return false;
//                else if (!selloptions.SellMagic && MagicPoints.GetPoints((BaseHat)item) > 0)
//                    return false;
//                else
//                    return true;
//            }
//I ADDED
            if ((item is BaseWeapon) && !selloptions.SellWeapons)
                return false;
            else if ((item is BaseArmor) && !selloptions.SellArmor)
                return false;
            else if ((item is BaseJewel) && !selloptions.SellJewelry)
                return false;
//
            else if ((item is BaseClothing || item is BaseShoes || item is BaseHat) && !selloptions.SellClothes)
                return false;
            else if ((item is Arrow || item is Bolt) && !selloptions.SellArrows)
                return false;
            else if (item is BasePotion && !selloptions.SellPotions)
                return false;
            else if (item is BaseReagent && !selloptions.SellRegs)
                return false;
            else if ((item is BaseIngot || item is Shaft || item is Board || item is BaseOre || item is Log || item is Feather) && !selloptions.SellResources)
                return false;
            else if (
                (item is Diamond ||
                 item is Amber ||
                 item is Amethyst ||
                 item is Citrine ||
                 item is Emerald ||
                 item is Ruby ||
                 item is Sapphire ||
                 item is StarSapphire ||
                 item is DarkSapphire ||
                 item is WhitePearl ||
                 item is FireRuby ||
                 item is Tourmaline) && !selloptions.SellGems)
                return false;
            else if ((item is BaseHides || item is BaseScales) && !selloptions.SellHides)
                return false;
            else if ((item is CookableFood || item is Food) && !selloptions.SellFood)
                return false;
            else
                return true;
        }
Beispiel #5
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile   m           = sender.Mobile;
            SellData selloptions = (SellData)XmlAttach.FindAttachment(m, typeof(SellData));

            if (selloptions == null)
            {
                selloptions = new SellData();
                XmlAttach.AttachTo(m, selloptions);
            }
            switch (info.ButtonID)
            {
            case 0:     // Closed or Cancel
            {
                return;
            }

            default:
            {
                // Make sure that the OK button was pressed
                if (info.ButtonID == 1)
                {
                    // see what types of stuff the user do not wants to sell and toggle the property
                    ArrayList Selections = new ArrayList(info.Switches);

//                            if (Selections.Contains(1) == true) { selloptions.SellMagic = true; }
//                            else { selloptions.SellMagic = false; }
                    if (Selections.Contains(2) == true)
                    {
                        selloptions.SellHides = true;
                    }
                    else
                    {
                        selloptions.SellHides = false;
                    }
                    if (Selections.Contains(3) == true)
                    {
                        selloptions.SellArrows = true;
                    }
                    else
                    {
                        selloptions.SellArrows = false;
                    }
                    if (Selections.Contains(4) == true)
                    {
                        selloptions.SellWeapons = true;
                    }
                    else
                    {
                        selloptions.SellWeapons = false;
                    }
                    if (Selections.Contains(5) == true)
                    {
                        selloptions.SellArmor = true;
                    }
                    else
                    {
                        selloptions.SellArmor = false;
                    }
                    if (Selections.Contains(6) == true)
                    {
                        selloptions.SellJewelry = true;
                    }
                    else
                    {
                        selloptions.SellJewelry = false;
                    }
                    if (Selections.Contains(7) == true)
                    {
                        selloptions.SellPotions = true;
                    }
                    else
                    {
                        selloptions.SellPotions = false;
                    }
                    if (Selections.Contains(8) == true)
                    {
                        selloptions.SellGems = true;
                    }
                    else
                    {
                        selloptions.SellGems = false;
                    }
                    if (Selections.Contains(9) == true)
                    {
                        selloptions.SellClothes = true;
                    }
                    else
                    {
                        selloptions.SellClothes = false;
                    }
                    if (Selections.Contains(10) == true)
                    {
                        selloptions.SellFood = true;
                    }
                    else
                    {
                        selloptions.SellFood = false;
                    }
                    if (Selections.Contains(11) == true)
                    {
                        selloptions.SellRegs = true;
                    }
                    else
                    {
                        selloptions.SellRegs = false;
                    }
                    if (Selections.Contains(12) == true)
                    {
                        selloptions.SellResources = true;
                    }
                    else
                    {
                        selloptions.SellResources = false;
                    }
                }
                break;
            }
            }
        }
Beispiel #6
0
        public static bool isSellable(SellData selloptions, Item item)
        {
//            if (item is BaseWeapon)
//            {
//                if (!selloptions.SellWeapons)
//                    return false;
//                else if (!selloptions.SellMagic && MagicPoints.GetPoints((BaseWeapon)item) > 0)
//                    return false;
//                else
//                    return true;
//            }
//            else if (item is BaseArmor)
//            {
//                if (!selloptions.SellArmor)
//                    return false;
//                else if (!selloptions.SellMagic && MagicPoints.GetPoints((BaseArmor)item) > 0)
//                    return false;
//                else
//                    return true;
//            }
//            else if (item is BaseJewel)
//            {
//                if (!selloptions.SellJewelry)
//                    return false;
//                else if (!selloptions.SellMagic && MagicPoints.GetPoints((BaseJewel)item) > 0)
//                    return false;
//                else
//                    return true;
//            }
//            else if (item is BaseHat)
//            {
//                if (!selloptions.SellClothes)
//                    return false;
//                else if (!selloptions.SellMagic && MagicPoints.GetPoints((BaseHat)item) > 0)
//                    return false;
//                else
//                    return true;
//            }
//I ADDED
            if ((item is BaseWeapon) && !selloptions.SellWeapons)
            {
                return(false);
            }
            else if ((item is BaseArmor) && !selloptions.SellArmor)
            {
                return(false);
            }
            else if ((item is BaseJewel) && !selloptions.SellJewelry)
            {
                return(false);
            }
//
            else if ((item is BaseClothing || item is BaseShoes || item is BaseHat) && !selloptions.SellClothes)
            {
                return(false);
            }
            else if ((item is Arrow || item is Bolt) && !selloptions.SellArrows)
            {
                return(false);
            }
            else if (item is BasePotion && !selloptions.SellPotions)
            {
                return(false);
            }
            else if (item is BaseReagent && !selloptions.SellRegs)
            {
                return(false);
            }
            else if ((item is BaseIngot || item is Shaft || item is Board || item is BaseOre || item is Log || item is Feather) && !selloptions.SellResources)
            {
                return(false);
            }
            else if (
                (item is Diamond ||
                 item is Amber ||
                 item is Amethyst ||
                 item is Citrine ||
                 item is Emerald ||
                 item is Ruby ||
                 item is Sapphire ||
                 item is StarSapphire ||
                 item is DarkSapphire ||
                 item is WhitePearl ||
                 item is FireRuby ||
                 item is Tourmaline) && !selloptions.SellGems)
            {
                return(false);
            }
            else if ((item is BaseHides || item is BaseScales) && !selloptions.SellHides)
            {
                return(false);
            }
            else if ((item is CookableFood || item is Food) && !selloptions.SellFood)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }