Пример #1
0
        public bool TryTurnInToSlim(Mobile from, TradeOrderCrate order, SlimTheFence slim)
        {
            if (order == null || from == null || slim == null || order.Entry == null)
            {
                return(false);
            }

            TradeEntry entry = order.Entry;

            if (!order.Fulfilled)
            {
                slim.SayTo(from, 1151732); // This trade order has not been fulfilled.  Fill the trade order with all necessary items and try again.
            }
            else
            {
                CityLoyaltySystem.OnSlimTradeComplete(from, order.Entry);
                CityTradeEntry pentry = GetPlayerEntry <CityTradeEntry>(from as PlayerMobile, true);

                if (pentry != null)
                {
                    pentry.Points++;
                    pentry.DistanceTraveled += entry.Distance;
                    pentry.CompletedSlim++;
                    CheckTitle(pentry);
                }

                slim.SayTo(from, 1151736); // Haha! These goods will fetch me quite a bit o' coin!  Thanks fer yer help!  Here's a little something I was able to get me hands on...

                order.Delete();
                return(true);
            }

            return(false);
        }