public void Craft(Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool)
{
if (from.BeginAction(typeof(CraftSystem)))
{
bool allRequiredSkills = true;
double chance = GetSuccessChance(from, craftSystem, false, ref allRequiredSkills);
if (allRequiredSkills && chance >= 0.0)
{
int badCraft = craftSystem.CanCraft(from, tool, m_Type);
if (badCraft <= 0)
{
int resHue = 0;
int maxAmount = 0;
object message = null;
if (ConsumeRes(from, typeRes, craftSystem, ref resHue, ref maxAmount, ConsumeType.None, ref message))
{
message = null;
if (ConsumeAttributes(from, ref message, false))
{
CraftContext context = craftSystem.GetContext(from);
if (context != null)
context.OnMade(this);
int iMin = craftSystem.MinCraftEffect;
int iMax = (craftSystem.MaxCraftEffect - iMin) + 1;
int iRandom = Utility.Random(iMax);
iRandom += iMin + 1;
new InternalTimer(from, craftSystem, this, typeRes, tool, iRandom).Start();
}
else
{
from.EndAction(typeof(CraftSystem));
from.SendGump(new CraftGump(from, craftSystem, tool, message));
}
}
else
{
from.EndAction(typeof(CraftSystem));
from.SendGump(new CraftGump(from, craftSystem, tool, message));
}
}
else
{
from.EndAction(typeof(CraftSystem));
from.SendGump(new CraftGump(from, craftSystem, tool, badCraft));
}
}
else
{
from.EndAction(typeof(CraftSystem));
from.SendGump(new CraftGump(from, craftSystem, tool, 1044153)); // You don't have the required skills to attempt this item.
}
}
else
{
from.SendLocalizedMessage(500119); // You must wait to perform another action
}
}