was trying to find a scripting way to do it
grapevine.cs

public override void OnDoubleClick(Mobile from)
{
if((ItemID == 3358 || ItemID == 3363) && Movable == false && m_NextHarvest < DateTime.UtcNow)
//
{
from.AddToBackpack(new GrapeBunch());

m_NextHarvest = DateTime.UtcNow + TimeSpan.FromSeconds(HarvestWait);

}
}
but on grapebunch.cs
public override int LabelNumber { get { return 1022513; } }

[Constructable]
public GrapeBunch() : base(1, 3354)
itemid may be different?

is there another way to addtopack ondoubleclick?
maybe make a basetreeaddon but will it effect labelnumber ?
add an xml spawner.. grapes fall, pick em up, hope the ground dont become wine!! horses will drink em.. ya!
 
was trying to find a scripting way to do it
grapevine.cs

public override void OnDoubleClick(Mobile from)
{
if((ItemID == 3358 || ItemID == 3363) && Movable == false && m_NextHarvest < DateTime.UtcNow)
//
{
from.AddToBackpack(new GrapeBunch());

m_NextHarvest = DateTime.UtcNow + TimeSpan.FromSeconds(HarvestWait);

}
}
but on grapebunch.cs
public override int LabelNumber { get { return 1022513; } }

[Constructable]
public GrapeBunch() : base(1, 3354)
itemid may be different?

is there another way to addtopack ondoubleclick?
maybe make a basetreeaddon but will it effect labelnumber ?
add an xml spawner.. grapes fall, pick em up, hope the ground dont become wine!! horses will drink em.. ya!

C#:
/*grapevine.cs*/
public override void OnDoubleClick(Mobile from)
{
    if((ItemID == 3358 || ItemID == 3363) && Movable == false && m_NextHarvest < DateTime.UtcNow)
    {
        from.AddToBackpack(new GrapeBunch());
        m_NextHarvest = DateTime.UtcNow + TimeSpan.FromSeconds(HarvestWait);
    }

}
C#:
/*Grapebunch.cs*/

/*
public override int LabelNumber { get { return 1022513; } }
[Constructable]

public GrapeBunch()
    : base(1, 3354)
*/
C#:
public override void OnDoubleClick(Mobile from)
{
    if (ItemID == 3358 || ItemID == 3363
    || (ItemID == 3354 && LabelNumber == 1022513)
    && Movable == false
    && m_NextHarvest < DateTime.UtcNow)
    {
        from.AddToBackpack(new GrapeBunch());
        m_NextHarvest = DateTime.UtcNow + TimeSpan.FromSeconds(HarvestWait);
    }
}

you can review Mobile.cs or perhaps Container.cs in the server folder for any/all available methods of adding items to a mobile or container
 
Last edited:
The grape vines in yew are part of the map. The best way to do what your wanting to do would be to unfreeze them and delete them and add in the vines with something like what is posted above in the script. This change would require you to share the client with anyone wanting to play on the server.
 
Or, add a system to track what world objects the player double clicks, then depending on its ID, you can perform the action ie : add grapes to pack if double click static item with grapevine id!

iirc there is a method already in target for targeting statics! I would start there and test multiple ways to utilize it!

On the surface, I think there is an idea for a system here that I might look at when I get some free time!
I had a minute to check something for you,

Look in BladedItemTarget.cs

Code:
                else if (targeted is StaticTarget)
                {
                    int itemID = ((StaticTarget)targeted).ItemID;

                    if (itemID == 0xD15 || itemID == 0xD16) // red mushroom
                    {
                        PlayerMobile player = from as PlayerMobile;

                        if (player != null)
                        {
                            QuestSystem qs = player.Quest;

                            if (qs is WitchApprenticeQuest)
                            {
                                FindIngredientObjective obj = qs.FindObjective(typeof(FindIngredientObjective)) as FindIngredientObjective;

                                if (obj != null && !obj.Completed && obj.Ingredient == Ingredient.RedMushrooms)
                                {
                                    player.SendLocalizedMessage(1055036); // You slice a red cap mushroom from its stem.
                                    obj.Complete();

                                    if (Siege.SiegeShard && m_Item is IUsesRemaining)
                                    {
                                        Siege.CheckUsesRemaining(from, m_Item);
                                    }

                                    return;
                                }
                            }
                        }
                    }
                }


This is exactly where I would start, this shows you how to use a item, in this case a blade, to pick a static mushroom and return something, in this case it is quest related but you can add what you want here like addtobackpack grapes!

Hope this helps!
 
Last edited by a moderator:
Back