예제 #1
0
        public GenericBuyInfo(string name, Type type, int price, int amount, int min_amount, int max_amount, int itemID, int hue, object[] args)
        {
            //amount = 20;

            m_Type = type;
            if (m_Type == null)
            {
                Console.WriteLine();
                Console.WriteLine("***WARNING***: GenericBuy constructor passed null for m_Type! BAD!");
                Console.WriteLine("Item ID of offending object: {0:X}", itemID);
                Console.WriteLine("Search all files for that ID (and possibly decimal version!) and look for any that pass null to this constructor.");
                Console.WriteLine("Setting type to recall rune...");
                Console.WriteLine();
                m_Type = typeof(Server.Items.RecallRune);
            }
            m_Price = price;

            if (Core.UOSP)
            {
                m_Price = GenericBuyInfo.ComputeSiegeMarkup(m_Price);
            }

            m_Amount = amount;
            m_ItemID = itemID;
            m_Hue    = hue;

            m_Args = args;

            if (max_amount == 0)
            {
                m_MaxAmount = 100;
            }
            else
            {
                m_MaxAmount = max_amount;
            }

            if (min_amount == 0)
            {
                m_MinAmount = 20;
            }
            else
            {
                m_MinAmount = min_amount;
            }

            m_RestockAmount = amount;

            if (name == null)
            {
                m_Name = (1020000 + (itemID & 0x3FFF)).ToString();
            }
            else
            {
                m_Name = name;
            }
        }
예제 #2
0
        public static int ComputePriceFor(HouseDeed deed)
        {
            int price = 0;

            /*if (deed is SmallBrickHouseDeed || deed is StonePlasterHouseDeed || deed is FieldStoneHouseDeed || deed is SmallBrickHouseDeed || deed is WoodHouseDeed || deed is WoodPlasterHouseDeed || deed is ThatchedRoofCottageDeed)
             * else if (deed is BrickHouseDeed)
             *      price = 144500;
             * else if (deed is TwoStoryWoodPlasterHouseDeed || deed is TwoStoryStonePlasterHouseDeed)
             *      price = 192400;
             * else if (deed is TowerDeed)
             *      price = 433200;
             * else if (deed is KeepDeed)
             *      price = 665200;
             * else if (deed is CastleDeed)
             *      price = 1022800;
             * else if (deed is LargePatioDeed)
             *      price = 152800;
             * else if (deed is LargeMarbleDeed)
             *      price = 192800;
             * else if (deed is SmallTowerDeed)
             *      price = 88500;
             * else if (deed is LogCabinDeed)
             *      price = 97800;
             * else if (deed is SandstonePatioDeed)
             *      price = 90900;
             * else if (deed is VillaDeed)
             *      price = 136500;
             * else if (deed is StoneWorkshopDeed)
             *      price = 60600;
             * else if (deed is MarbleWorkshopDeed)
             *      price = 60300;
             * else if (deed is StaticDeed) //pla: Allow our static houses to be sold back based on price in blueprint
             * {
             *      price = StaticHouseHelper.GetPrice(((StaticDeed)deed).HouseID);
             *
             *      //check for the failsafe price and if so set to 0 - dont want someone getting 8 million back!
             *      if (price == (int)StaticHouseHelper.Error.PriceError)
             *              price = 0;
             *
             *      // track the error
             *      Misc.Diagnostics.Assert(price != 0, "price == 0");
             * } */

            if (deed is HouseDeed)
            {
                price = deed.Price;
            }

            //check for the failsafe price and if so set to 0 - dont want someone getting 8 million back!
            if (price == (int)StaticHouseHelper.Error.PriceError)
            {
                price = 0;
            }

            // track the error
            Misc.Diagnostics.Assert(price != 0, "price == 0");

            // don't allow repurchase (or sale) of customs on siege. Before we can buy them back, we need to markup the sale price and that's not been done
            // on the player vendors in the special	housing area. (so they will make 300% profit!)
            if (Core.UOSP && !Misc.Diagnostics.Assert(deed is StaticDeed == false, "deed is StaticDeed for sale on siege!"))
            {
                price = 0;
            }

            // Publish 11
            // o) NPC real estate brokers will now buy house deeds back at 20% below the base price of the deed, or the original
            //	price paid when the deed was purchased from a vendor (whichever is lower).
            // o) House deed prices when reselling to real estate agents raised to the correct level on Siege Perilous
            if (!Core.UOAI && !Core.UOAR && !Core.UOMO && Core.Publish < 11)
            {
                return(GenericBuyInfo.ComputeSiegeMarkup(price)); // 100%
            }
            return(AOS.Scale(price, 80));                         // refunds 80% of the purchase price
        }