예제 #1
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.InRange(GetWorldLocation(), 2))
            {
                if (_Fermenting && _FermentingEnds < DateTime.UtcNow)
                {
                    _Fermented = true;

                    int skill = (int)((from.Skills[SkillName.Cooking].Value + from.Skills[SkillName.Alchemy].Value) / 2);

                    skill *= _BacterialResistance / 4;

                    _BadBatch = skill < Utility.Random(225);

                    if (!_BadBatch)
                    {
                        BottlesRemaining = _Fruit / 4;
                    }
                }

                if (_Fermented)
                {
                    if (_BadBatch)
                    {
                        from.PrivateOverheadMessage(Server.Network.MessageType.Regular, 1154, 1157258, from.NetState); // *You gently taste the fermentation...it's spoiled! You should probably empty the barrel*
                    }
                    else if (_BottlesRemaining > 0)
                    {
                        BottleOfWine bottle = new BottleOfWine(_FruitType, _Vintage, _Maker);

                        if (from.Backpack != null && from.Backpack.TryDropItem(from, bottle, false))
                        {
                            from.PlaySound(0x240);
                            from.SendMessage("You pour the wine into a bottle and place it in your backpack.");

                            BottlesRemaining--;
                        }
                        else
                        {
                            from.SendLocalizedMessage(500720); // You don't have enough room in your backpack!
                            bottle.Delete();
                        }
                    }
                }
            }
        }
예제 #2
0
        public override void Open(Mobile from)
        {
            if (!Fermenting)
            {
                DisplayTo(from);
            }
            else if (FermentingEnds > DateTime.UtcNow)
            {
                from.SendLocalizedMessage(1157230); // You may not open the barrel once fermentation has begun!
            }
            else if (Fermented)
            {
                if (BottlesRemaining == -1)
                {
                    from.PrivateOverheadMessage(MessageType.Regular, 0x22, 1157258, from.NetState); // *You gently taste the fermentation...it's spoiled! You should probably empty the barrel*
                }
                else if (BottlesRemaining > 0)
                {
                    var bottle = new BottleOfWine(FruitType, Vintage, Year);

                    if (from.Backpack != null && from.Backpack.TryDropItem(from, bottle, false))
                    {
                        from.PlaySound(0x240);

                        BottlesRemaining--;

                        InvalidateProperties();
                    }
                    else
                    {
                        from.SendLocalizedMessage(500720); // You don't have enough room in your backpack!
                        bottle.Delete();
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1042975); // It's empty.
                }
            }
        }