Esempio 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(EmptyMeadBottle), 1))
                 {
                     from.SendLocalizedMessage(502242);
                     BaseCraftMead mead = FillBottle();
                     mead.Crafter = m_Crafter;
                     mead.Quality = m_Quality;
                     mead.Variety = m_Variety;
                     if (this.Name != null)
                     {
                         mead.Name = this.Name;
                     }
                     if (pack.TryDropItem(from, mead, 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);
                         mead.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.");
     }
 }
Esempio n. 2
0
            protected override void OnTarget(Mobile from, object target)
            {
                if (target is Mobile)
                {
                    from.SendMessage("Invalid Target.  Only crafted mead hegs, mead bottles, or this label maker can be labeled.");
                }
                else if (target is Item)
                {
                    Item item = (Item)target;

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