Exemplo n.º 1
0
        public override void OnDoubleClick(Mobile from)
        {
            if (AllowBottling)
            {
                if (from.InRange(GetWorldLocation(), 2))
                {
                    if (m_Held > 0)
                    {
                        Container pack = from.Backpack;

                        if (pack != null && pack.ConsumeTotal(typeof(EmptyWineBottle), 1))
                        {
                            from.SendLocalizedMessage(502242);

                            BaseCraftWine wine = FillBottle();
                            wine.Crafter = m_Crafter;
                            wine.Quality = m_Quality;
                            wine.Variety = m_Variety;
                            if (this.Name != null)
                            {
                                wine.Name = this.Name;
                            }

                            if (pack.TryDropItem(from, wine, false))
                            {
                                from.SendLocalizedMessage(502243);
                                from.PlaySound(0x240);

                                if (--Held == 0)
                                {
                                    this.Delete();

                                    if (GiveKeg(from))
                                    {
                                        from.SendMessage("The Keg is empty and you clean it for reuse");
                                    }
                                    else
                                    {
                                        from.SendMessage("The Keg is now empty and cannot be reused.");
                                    }
                                }
                            }
                            else
                            {
                                from.SendLocalizedMessage(502244);
                                wine.Delete();
                            }
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(502246);
                    }
                }
                else
                {
                    from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045);
                }
            }
            else
            {
                from.SendMessage("This keg is not ready to bottle yet, the fermentation process is not yet complete.");
            }
        }
Exemplo n.º 2
0
            protected override void OnTarget(Mobile from, object target)
            {
                if (target is Mobile)
                {
                    from.SendMessage("Invalid Target.  Only crafted Wine Kegs, Wine Bottles, or this label maker can be labeled.");
                }
                else if (target is Item)
                {
                    Item item = (Item)target;

                    if (target == m_LabelMaker || target is BaseCraftWine || target is WineKeg)
                    {
                        if (item.RootParent != from)
                        {
                            from.SendMessage("The item must be in your pack to label it.");
                        }
                        else
                        {
                            if (item is BaseCraftWine)
                            {
                                BaseCraftWine wine = (BaseCraftWine)item;
                                if (wine.Crafter != from)
                                {
                                    from.SendMessage("That bottle is either not worth labeling or was not crafted at your vinyard!");
                                }
                                else
                                {
                                    from.SendMessage("Enter label name now...");
                                    from.Prompt = new LabelPrompt(item);
                                }
                            }
                            else if (item is WineKeg)
                            {
                                WineKeg keg = (WineKeg)item;
                                if (keg.Crafter != from)
                                {
                                    from.SendMessage("That keg is either not worth labeling or was not crafted at your vinyard!");
                                }
                                else
                                {
                                    from.SendMessage("Enter label name now...");
                                    from.Prompt = new LabelPrompt(item);
                                }
                            }
                            else
                            {
                                from.SendMessage("Enter your vinyard name now...");
                                from.Prompt = new LabelPrompt2(m_LabelMaker);
                            }
                        }
                    }
                    else
                    {
                        from.SendMessage("Invalid Target.   Only crafted Wine Kegs, Wine Bottles, or this label maker can be labeled.");
                    }
                }
                else
                {
                    from.SendMessage("Invalid Target.   Only crafted Wine Kegs, Wine Bottles, or this label maker can be labeled.");
                }
            }