Exemplo n.º 1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                PlayerMobile pm = from as PlayerMobile;

                if (pm == null || m_Item == null || m_Item.Deleted)
                {
                    return;
                }

                PlantItem plant = targeted as PlantItem;

                if (null == plant || PlantStatus.DecorativePlant != plant.PlantStatus)
                {
                    from.SendLocalizedMessage(1112119);                     // You may only use these clippers on decorative plants.
                    return;
                }

                if (pm.ToggleCutClippings)
                {
                    /*
                     * PlantClippings clippings = new PlantClippings();
                     *
                     * clippings.PlantHue = plant.PlantHue;
                     * clippings.MoveToWorld(plant.Location, plant.Map);
                     * plant.Delete();
                     */
                    from.PlaySound(0x248);
                    from.AddToBackpack(
                        new PlantClippings
                    {
                        Hue      = ((PlantItem)targeted).Hue,
                        PlantHue = plant.PlantHue
                    });
                    plant.Delete();
                }
                else if (pm.ToggleCutReeds)
                {
                    /*
                     * DryReeds reeds = new DryReeds();
                     *
                     * reeds.PlantHue = plant.PlantHue;
                     * reeds.MoveToWorld(plant.Location, plant.Map);
                     * plant.Delete();
                     * from.PlaySound(0x248);
                     */
                    from.PlaySound(0x248);
                    from.AddToBackpack(
                        new DryReeds
                    {
                        Hue      = ((PlantItem)targeted).Hue,
                        PlantHue = plant.PlantHue
                    });
                    plant.Delete();
                }

                // TODO: Add in clipping hedges (short and tall) and juniperbushes for topiaries
            }
Exemplo n.º 2
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                PlayerMobile pm = from as PlayerMobile;

                if (pm == null || m_Item == null || m_Item.Deleted)
                {
                    return;
                }

                PlantItem plant = targeted as PlantItem;

                if (null == plant || PlantStatus.DecorativePlant != plant.PlantStatus)
                {
                    from.SendLocalizedMessage(1112119); // You may only use these clippers on decorative plants.
                    return;
                }

                if (pm.ToggleCutClippings)
                {
                    from.PlaySound(0x248);
                    from.AddToBackpack(
                        new PlantClippings
                    {
                        Hue      = ((PlantItem)targeted).Hue,
                        PlantHue = plant.PlantHue
                    });
                    plant.Delete();
                    m_Item.ConsumeUse(from);
                }
                else if (pm.ToggleCutReeds)
                {
                    from.PlaySound(0x248);
                    from.AddToBackpack(
                        new DryReeds
                    {
                        Hue      = ((PlantItem)targeted).Hue,
                        PlantHue = plant.PlantHue
                    });
                    plant.Delete();
                    m_Item.ConsumeUse(from);
                }
                else if (pm.ToggleCutTopiaries)
                {
                    if (plant.PlantType == PlantType.HedgeTall || plant.PlantType == PlantType.HedgeShort || plant.PlantType == PlantType.JuniperBush)
                    {
                        from.CloseGump(typeof(TopiaryGump));
                        from.SendGump(new TopiaryGump(plant, m_Item));
                    }
                }
            }
Exemplo n.º 3
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                PlayerMobile pm = from as PlayerMobile;

                if (m_Item.Deleted)
                {
                    return;
                }

                PlantItem plant = targeted as PlantItem;

                if (null == plant || PlantStatus.DecorativePlant != plant.PlantStatus)
                {
                    from.SendLocalizedMessage(1112119); // You may only use these clippers on decorative plants.
                    return;
                }
                if (pm.ToggleCutClippings == true)
                {
                    /*PlantClippings clippings = new PlantClippings();
                     * clippings.PlantHue = plant.PlantHue;
                     * clippings.MoveToWorld(plant.Location, plant.Map);
                     * plant.Delete();*/
                    from.PlaySound(0x248);
                    PlantClippings cl = new PlantClippings();
                    cl.Hue      = ((PlantItem)targeted).Hue;
                    cl.PlantHue = plant.PlantHue;
                    from.AddToBackpack(cl);
                    plant.Delete();
                }


                else if (pm.ToggleCutReeds == true)
                {
                    /*DryReeds reeds = new DryReeds();
                     * reeds.PlantHue = plant.PlantHue;
                     * reeds.MoveToWorld(plant.Location, plant.Map);
                     * plant.Delete();
                     * from.PlaySound(0x248);*/
                    from.PlaySound(0x248);
                    DryReeds dr = new DryReeds();
                    dr.Hue      = ((PlantItem)targeted).Hue;
                    dr.PlantHue = plant.PlantHue;
                    from.AddToBackpack(dr);
                    plant.Delete();
                }
            }
Exemplo n.º 4
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.
                }
            }
Exemplo n.º 5
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();
                }
            }
        }