Пример #1
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.InRange(GetWorldLocation(), 2))
            {
                if (m_Held > 0)
                {
                    Container pack = from.Backpack;

                    if (pack != null && pack.ConsumeTotal(typeof(Bottle), 1))
                    {
                        from.SendAsciiMessage("You pour some of the keg's contents into an empty bottle...");

                        BasePotion pot = FillBottle();
                        if ((m_Tasters != null && m_Tasters.Contains(from)) || from == m_Owner)
                        {
                            pot.AddTasters(from);
                        }

                        if (pack.TryDropItem(from, pot, false))
                        {
                            from.SendAsciiMessage("...and place it into your backpack.");
                            from.PlaySound(0x240);

                            if (--Held == 0)
                            {
                                from.SendAsciiMessage("The keg is now empty.");
                            }
                        }
                        else
                        {
                            from.SendAsciiMessage("...but there is no room for the bottle in your backpack.");
                            pot.Delete();
                        }
                    }
                    else
                    {
                        // TODO: Target a bottle
                    }
                }
                else
                {
                    from.SendAsciiMessage("The keg is empty.");
                }
            }
            else
            {
                from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045);                   // I can't reach that.
            }
        }