Exemplo n.º 1
0
        public override void OnResponse(RelayInfo info)
        {
            if (info.ButtonID == 195)
            {
                TextRelay amtText = info.GetTextEntry(0);

                if (amtText != null && !string.IsNullOrWhiteSpace(amtText.Text))
                {
                    int amount = Utility.ToInt32(amtText.Text);

                    if (amount > 0)
                    {
                        if (amount <= 10)
                        {
                            UltimaStore.GetProfile(User).SetCartAmount(Entry, amount);
                        }
                        else
                        {
                            User.SendLocalizedMessage(1150315); // That text is unacceptable.
                            //User.SendLocalizedMessage(1156836); // You can't exceed 125 items per purchase.
                        }

                        Gump.Refresh();
                    }
                }
                else
                {
                    User.SendLocalizedMessage(1150315); // That text is unacceptable.
                }
            }

            UltimaStoreGump.ReleaseHidden(User);
        }