コード例 #1
0
        public static void ChangeAmountUserOrder(MarketDatabase.Order order, String market)
        {
            MarketUserContainer authorBox  = MarketDatabase.GetAccountBox(order.author as PlayerMobile, market);
            List <OrderRecord>  UserOrders = authorBox.UserOrders;

            for (int i = 0; i < UserOrders.Count; ++i)
            {
                if (UserOrders[i].m_uniqueID == order.uniqueID && UserOrders[i].m_market == market)
                {
                    UserOrders[i].m_amountCurrent = order.amount;
                    return;
                }
            }
        }
コード例 #2
0
        public static List <OrderRecord> GetUserOrders(Mobile from, String Market)
        {
            MarketUserContainer userContainer = MarketDatabase.GetAccountBox(from as PlayerMobile, Market);

            return(userContainer.UserOrders);
        }
コード例 #3
0
        public static void AddUserOrder(MarketDatabase.Order order, String market)
        {
            MarketUserContainer authorBox = MarketDatabase.GetAccountBox(order.author as PlayerMobile, market);

            authorBox.UserOrders.Add(new OrderRecord((order is MarketDatabase.SellOrder) ? 1 : 2, market, order));
        }
コード例 #4
0
        public void HandleSpeech(Mobile from, String speech)
        {
            if (speech.Contains("vendor") || speech.Contains(Name.ToLower()))
            {
                if (from is PlayerMobile && speech.Contains("information")) // vendor, *buy*
                {
                    Say("I am a marketeer for the " + m_Market + " market, i manage the buy and sell orders of items or creatures for my customers.");
                    return;
                }

                if (from is PlayerMobile && speech.Contains("buy")) // vendor, *buy*
                {
                    List <MarketDatabase.SellOrder> results = new List <MarketDatabase.SellOrder>();
                    from.SendGump(new MarketItemBuySearchGump(from, "", 0, results, m_Market));
                    Say("Feel free to search the my records of items for sale.");
                    return;
                }

                if (from is PlayerMobile && speech.Contains("sell")) // vendor, *buy*
                {
                    if (from.Target != null)
                    {
                        from.SendMessage("You can't sell something like your target cursor is in use.");
                        return;
                    }
                    Say("What would you like to put up for sale?");

                    from.SendMessage("Select an item in your inventory, bank box or " + m_Market + " market account box, or tamed pet you wish to put for sale.");
                    from.Target = new MarketDatabase.SellOrderTarget(m_Market);
                    return;
                }

                if (from is PlayerMobile && (speech.Contains("claim") || speech.Contains("inventory"))) // vendor, *claim*
                {
                    MarketUserContainer accountBox = MarketDatabase.GetAccountBox(from as PlayerMobile, m_Market);
                    if (accountBox != null)
                    {
                        if (accountBox.Summon(from))
                        {
                            Say("Here you go; your account chest.");
                        }
                    }
                    return;
                }

                if (from is PlayerMobile && speech.Contains("order")) // vendor, *orders*
                {
                    List <MarketDatabase.BuyOrder> results = new List <MarketDatabase.BuyOrder>();
                    from.SendGump(new MarketBuyOrderSearchGump(from, "", 0, results, m_Market));
                    Say("Your welcome to search my records of customer requests.");
                    return;
                }

                if (from is PlayerMobile && (speech.Contains("account") || speech.Contains("my offer"))) // vendor, *account*
                {
                    from.SendGump(new UserAccountSearchGump(from, 0, null, m_Market));
                    Say("Here are your current market records.");
                    return;
                }
            }
        }