protected virtual bool CheckTools(Creature creature, Skill skill, ProductionData productData)
{
// Sanity checks, the client should be handling this.
// If null, anything can be equipped
if (productData.Tool == null)
return true;
if (productData.Tool == "/barehand/")
{
// Fail if bare hand required but an item is equipped
if (creature.RightHand != null)
{
Log.Warning("ProductionSkill.Complete: User '{0}' tried to produce without empty hands.", creature.Client.Account.Id);
return false;
}
}
else
{
// Fail if no item or the wrong one is equipped
if (creature.RightHand == null || !creature.RightHand.HasTag(productData.Tool))
{
Log.Warning("ProductionSkill.Complete: Creature '{0:X16}' tried to produce without the appropriate tool.", creature.EntityId);
return false;
}
}
// TODO: Check durability? What happens if tool is unusable?
return true;
}