- ServUO Version
- Publish 57
- Ultima Expansion
- Endless Journey
Trying to make a bag where only certain items can be dropped into it, in this example some unbreakable tools, however using the following code pulled from another bag that does something similar I receive the following error:
Code:
As usual I'm sure the answer is simple for you coders out there, but any help would be appreciated
The items themselves are based off the BaseEverlastingTool which in turn is based off of BaseTool
C#:
Errors:
+ Custom/Custom Items/Everlasting Items/EverlastingBagOfTools.cs:
CS0119: Line 40: 'BaseEverlastingTool' is a type, which is not valid in the given context
Scripts: One or more scripts failed to compile or no script files were found.
C#:
public override bool OnDragDrop(Mobile from, Item dropped)
{
if (!(dropped is BaseEverlastingTool))
{
from.SendMessage("Only Everlasting items can be placed in this bag.");
return false;
}
return base.OnDragDrop(from, dropped);
}
public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
{
if (!(dropped is BaseEverlastingTool))
{
from.SendMessage("Only Everlasting items can be placed in this bag.");
return false;
}
return base.OnDragDropInto(from, item, p);
}
The items themselves are based off the BaseEverlastingTool which in turn is based off of BaseTool
Last edited: