public override void OnDoubleClick(Mobile from)
        {
            m_returnPack = null;

            if (from.InRange(GetWorldLocation(), 2))
            {
                if (m_Held > 0)
                {
                    Container pack = from.Backpack;

                    // Adam: be cool and remember the pack from which the bottle came, then place the filled bottle back in that pack
                    if (pack != null && pack.ConsumeTotal(typeof(Bottle), 1, true, OnItemConsumed))
                    {
                        from.SendLocalizedMessage(502242);                         // You pour some of the keg's contents into an empty bottle...

                        // default return location
                        if (m_returnPack == null)
                        {
                            m_returnPack = from.Backpack;
                        }

                        BasePotion pot = FillBottle();

                        if (m_returnPack != null && m_returnPack.TryDropItem(from, pot, false))
                        {
                            from.SendLocalizedMessage(502243);                             // ...and place it into your backpack.
                            from.PlaySound(0x240);

                            if (--Held == 0)
                            {
                                from.SendLocalizedMessage(502245);                                 // The keg is now empty.
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(502244);                             // ...but there is no room for the bottle in your backpack.
                            pot.Delete();
                        }
                    }
                    else
                    {
                        // TODO: Target a bottle
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502246);                     // The keg is empty.
                }
            }
            else
            {
                from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045);                 // I can't reach that.
            }
        }
示例#2
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.SendLocalizedMessage(502242); // You pour some of the keg's contents into an empty bottle...

                        BasePotion pot = FillBottle();

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

                            if (--Held == 0)
                            {
                                from.SendLocalizedMessage(502245); // The keg is now empty.
                            }
                            else
                            {
                                Unknown = false;
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(502244); // ...but there is no room for the bottle in your backpack.
                            pot.Delete();
                        }
                    }
                    else
                    {
                        from.Target = new BottleTarget(this);

                        from.SendLocalizedMessage(502241); // Where is a container for your potion?
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502246); // The keg is empty.
                }
            }
            else
            {
                from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
            }
        }
示例#3
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.InRange(GetWorldLocation(), 2) && from.InLOS(this))
            {
                if (m_Held > 0)
                {
                    Container pack = from.Backpack;

                    if (pack != null)
                    {
                        BasePotion pot = FillBottle(from);

                        if (pot == null)
                        {
                            from.SendAsciiMessage("You have no empty bottles in your backpack.");
                            return;
                        }

                        from.SendLocalizedMessage(502242); // You pour some of the keg's contents into an empty bottle...

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

                            if (--Held == 0)
                            {
                                from.SendLocalizedMessage(502245); // The keg is now empty.
                                ColorKeg();
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(502244);                               // ...but there is no room for the bottle in your backpack.

                            //TODO: Put on ground
                            pot.Delete();
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502246);                       // The keg is empty.
                }
            }
            else
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045);                   // I can't reach that.
            }
        }
示例#4
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.
            }
        }
示例#5
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.InRange(GetWorldLocation(), 2))
            {
                if (m_Held > 0)
                {
                    Container pack = from.Backpack;

                    if (pack != null && ((IsJarPotion(m_Type) && pack.ConsumeTotal(typeof(Jar), 1)) || (!IsJarPotion(m_Type) && pack.ConsumeTotal(typeof(Bottle), 1))))
                    {
                        from.SendLocalizedMessage(502242);                           // You pour some of the keg's contents into an empty bottle...

                        BasePotion pot = FillBottle();

                        if (pack.TryDropItem(from, pot, false))
                        {
                            BaseContainer.DropItemFix(pot, from, from.Backpack.ItemID, from.Backpack.GumpID);
                            from.SendLocalizedMessage(502243);                               // ...and place it into your backpack.
                            from.PlaySound(0x240);

                            if (--Held == 0)
                            {
                                from.SendLocalizedMessage(502245);                                   // The keg is now empty.
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(502244);                               // ...but there is no room for the bottle in your backpack.
                            pot.Delete();
                        }
                    }
                    else
                    {
                        // TODO: Target a bottle
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502246);                       // The keg is empty.
                }
                SetColorKeg(this, this);
            }
            else
            {
                from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045);                   // I can't reach that.
            }
        }
示例#6
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Bottle)
                {
                    Bottle bottle = targeted as Bottle;

                    Container pack = from.Backpack;

                    from.SendLocalizedMessage(502242);                       // You pour some of the keg's contents into an empty bottle...

                    BasePotion pot = m_Keg.FillBottle();

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

                        if (--m_Keg.Held == 0)
                        {
                            from.SendLocalizedMessage(502245);                               // The keg is now empty.
                        }
                        else
                        {
                            m_Keg.Unknown = false;
                        }

                        bottle.Consume();
                    }
                    else
                    {
                        from.SendLocalizedMessage(502244);                           // ...but there is no room for the bottle in your backpack.

                        from.SendLocalizedMessage(502217);                           // Nothing comes out of the tap!
                        pot.Delete();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502227);                       // That cannot be used to hold a potion.
                }
            }
示例#7
0
        public override void OnDoubleClick(Mobile from)
        {
            if (m_Held > 0)
            {
                Container pack = from.Backpack;

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

                    BasePotion pot = FillBottle();

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

                        if (--Held == 0)
                        {
                            from.SendLocalizedMessage(502245);                               // The keg is now empty.
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(502244);                           // ...but there is no room for the bottle in your backpack.
                        pot.Delete();
                    }
                }
                else
                {
                    // TODO: Target a bottle
                }
            }
            else
            {
                from.SendLocalizedMessage(502246);                   // The keg is empty.
            }
        }