示例#1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Clippers.Deleted)
                {
                    return;
                }

                if (targeted is PlantItem)
                {
                    PlantItem plant = (PlantItem)targeted;

                    if (!plant.IsChildOf(from.Backpack))
                    {
                        from.SendLocalizedMessage(502437);                           // Items you wish to cut must be in your backpack.
                    }
                    if (plant.PlantStatus != PlantStatus.DecorativePlant)
                    {
                        from.SendLocalizedMessage(1112119);                           // You may only use these clippers on decorative plants.
                    }
                    else
                    {
                        // TODO (SA): ¿Se puede podar cualquier tipo de planta?

                        Item item;
                        if (m_Clippers.CutReeds)
                        {
                            item = new DryReeds(plant.PlantHue);
                        }
                        else
                        {
                            item = new PlantClippings(plant.PlantHue);
                        }

                        plant.Delete();

                        if (!from.PlaceInBackpack(item))
                        {
                            item.MoveToWorld(from.Location, from.Map);
                        }

                        from.SendLocalizedMessage(1112120);                           // You cut the plant into small pieces and place them in your backpack.

                        m_Clippers.UsesRemaining--;

                        if (m_Clippers.UsesRemaining <= 0)
                        {
                            m_Clippers.Delete();
                            from.SendLocalizedMessage(1112126);                               // Your clippers break as you use up the last charge.
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1112119);                       // You may only use these clippers on decorative plants.
                }
            }
示例#2
0
        protected override void OnTarget(Mobile from, object target)
        {
            if (target is PlantItem)
            {
                PlantItem bowl = (PlantItem)target;

                if (bowl.PlantSystem.Water < 2)
                {
                    from.SendMessage("The dirt must be softened.");
                    return;
                }
                else if (bowl.PlantStatus > PlantStatus.BowlOfDirt)
                {
                    from.SendMessage("That already contains a plant.");
                    return;
                }
                else if (!bowl.IsChildOf(from.Backpack))
                {
                    from.SendMessage("That must be in your back pack.");
                    return;
                }
                else
                {
                    Backpack pack = (Backpack)from.Backpack;

                    BaseRegentPlant plant = GetPlant();
                    plant.Held    = 0;
                    plant.Name    = plant.Name + " potted";
                    plant.Movable = true;

                    pack.DropItem(plant);

                    bowl.Delete();
                    seed.Delete();
                }
            }
        }