Sorry I've gotten a little further but still can't figure out what I need to do next.
By the way I'm working from here .... \Scripts\Items\Consumables\CookableFood.cs
Which starts like...
public abstract class CookableFood : Item, IQuality, ICommodity
The Item class is someing you might take note of here.
Changing things up a bit here is where I'm at.
public override void OnDoubleClick(Mobile from)
{
if (ItemID == 0x1E1F)
{
from.SendLocalizedMessage(1010018); // What do you want to use this item on?
from.Target = new ItemTarget(this);
}
}
public class ItemTarget : Target
{
private readonly Item m_Item;
public ItemTarget(Item item) : base(2, false, TargetFlags.None)
{
m_Item = item;
}
protected override void OnTarget(Mobile from, object targeted)
{
from.SendLocalizedMessage(500494); //using this for a test message - // You can't use a bladed item on that!
}
}
The above works and after I click on the compfire it does show the message -
You can't use a bladed item on that!. (again only using that phrase for a test).
So it looks like everything is going to work.
But I can't add my next line of code which is...
new SoylentGreen().MoveToWorld(Location, Map); // Location, Map are underlined and won't work
public class ItemTarget : Target
{
private readonly Item m_Item;
public ItemTarget(Item item) : base(2, false, TargetFlags.None)
{
m_Item = item;
}
protected override void OnTarget(Mobile from, object targeted)
{
from.SendLocalizedMessage(500494); //using this for a test message - // You can't use a bladed item on that!
new SoylentGreen().MoveToWorld(Location, Map); // Location, Map are underlined and won't work
}
}
The problem coems from (Location, Map) being part of : Item and not : Target
I can put this line of code here...
public override void OnDoubleClick(Mobile from)
{
if (ItemID == 0x1E1F)
{
from.SendLocalizedMessage(1010018); // What do you want to use this item on?
new SoylentGreen().MoveToWorld(Location, Map); // this line works here because this part of the code is part of : Item
}
}
But using that code above I never get to use my target which I what I'm trying to do.
I think I'm close but having a hard time on what to do next.
Thanks for the help again.
Sorry I can't figure things out.