public RefillGump(BaseVendor vendor, Mobile from, QuestReagentBag bag, List<RefillEntry> refillEntryList)
            : base(50, 50)
        {
            from.CloseGump(typeof(RefillGump));

            m_Vendor = vendor;
            m_Bag = bag;
            m_RefillEntryList = refillEntryList;

            this.Closable = true;
            this.Disposable = true;
            this.Dragable = true;
            this.Resizable = false;

            this.AddPage(0);

            this.AddBackground(0, 0, 453, 285, 2620);
            this.AddAlphaRegion(4, 7, 443, 271);
            this.AddLabel(bag.Type == QuestReagentBag.ReagentBagType.Mage ? 160 : 140, 13, 955, string.Format("Refill {0}", bag.Name));
            this.AddLabel(22, 45, 955, @"Reagents");
            this.AddLabel(106, 45, 955, @"Amount to refill");
            this.AddLabel(371, 45, 955, @"Total Cost");
            this.AddLabel(239, 45, 955, @"Cost per reagent");
            this.AddButton(410, 250, 4017, 4018, (int)Buttons.Cancel, GumpButtonType.Reply, 0);

            m_Price = ShowReagentCostList(refillEntryList);

            if (m_Price > 0)
            {
                this.AddLabel(100, 229, 955, string.Format("Do you want to refill your bag for {0} gp?", m_Price));
                this.AddButton(210, 250, 4023, 4024, (int)Buttons.OK, GumpButtonType.Reply, 0);
            }
        }
        public override void OnTalk(PlayerMobile player, bool contextMenu)
        {
            Direction = GetDirectionTo(player);
            QuestSystem qs = player.Quest;

            // Doing this quest
            if (qs is ElderWizardQuest)
            {
                if (qs.IsObjectiveInProgress(typeof(FindPlantObjective)))
                {
                    qs.AddConversation(new DuringFindPlantConversation());
                }
                else
                {
                    QuestObjective obj = qs.FindObjective(typeof(ReportBackObjective));

                    if (obj != null && !obj.Completed)
                    {
                        QuestReagentBag.ReagentBagType bagType = QuestReagentBag.ReagentBagType.Mage;

                        if (player.Skills[SkillName.Necromancy].Base > player.Skills[SkillName.Magery].Base)
                            bagType = QuestReagentBag.ReagentBagType.Necro;
                        else if (player.Skills[SkillName.Necromancy].Base == player.Skills[SkillName.Magery].Base && Utility.RandomBool() )
                            bagType = QuestReagentBag.ReagentBagType.Necro;

                        Bag rewardBag = new QuestReagentBag(bagType);

                        if (player.PlaceInBackpack(rewardBag))
                            obj.Complete();
                        else
                        {
                            rewardBag.Delete();
                            player.SendLocalizedMessage(1046260); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
                        }
                    }
                }
            }
            else
            {
                // Busy with another quest
                if (qs != null)
                {
                    qs.AddConversation(new DontOfferConversation());
                }
                // Offer Quest
                else if (qs == null && QuestSystem.CanOfferQuest(player, typeof(ElderWizardQuest)))
                {
                    Direction = GetDirectionTo(player);
                    new ElderWizardQuest(player).SendOffer();
                }
            }
        }