本文整理汇总了C#中Server.Items.BaseTool.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# BaseTool.Delete方法的具体用法?C# BaseTool.Delete怎么用?C# BaseTool.Delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Items.BaseTool
的用法示例。
在下文中一共展示了BaseTool.Delete方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompleteCraft
public void CompleteCraft(
int quality,
bool makersMark,
Mobile from,
CraftSystem craftSystem,
Type typeRes,
BaseTool tool,
CustomCraft customCraft)
{
int badCraft = craftSystem.CanCraft(from, tool, m_Type);
if (badCraft > 0)
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
{
from.SendGump(new CraftGump(from, craftSystem, tool, badCraft));
}
else
{
from.SendLocalizedMessage(badCraft);
}
AutoCraftTimer.EndTimer(from);
return;
}
int checkResHue = 0, checkMaxAmount = 0;
object checkMessage = null;
// Not enough resource to craft it
if (!ConsumeRes(from, typeRes, craftSystem, ref checkResHue, ref checkMaxAmount, ConsumeType.None, ref checkMessage))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
{
from.SendGump(new CraftGump(from, craftSystem, tool, checkMessage));
}
else if (checkMessage is int && (int)checkMessage > 0)
{
from.SendLocalizedMessage((int)checkMessage);
}
else if (checkMessage is string)
{
from.SendMessage((string)checkMessage);
}
AutoCraftTimer.EndTimer(from);
return;
}
else if (!ConsumeAttributes(from, ref checkMessage, false))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
{
from.SendGump(new CraftGump(from, craftSystem, tool, checkMessage));
}
else if (checkMessage is int && (int)checkMessage > 0)
{
from.SendLocalizedMessage((int)checkMessage);
}
else if (checkMessage is string)
{
from.SendMessage((string)checkMessage);
}
AutoCraftTimer.EndTimer(from);
return;
}
bool toolBroken = false;
int ignored = 1;
int endquality = 1;
bool allRequiredSkills = true;
if (CheckSkills(from, typeRes, craftSystem, ref ignored, ref allRequiredSkills))
{
// Resource
int resHue = 0;
int maxAmount = 0;
object message = null;
// Not enough resource to craft it
if (!ConsumeRes(from, typeRes, craftSystem, ref resHue, ref maxAmount, ConsumeType.All, ref message))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
{
from.SendGump(new CraftGump(from, craftSystem, tool, message));
}
else if (message is int && (int)message > 0)
{
from.SendLocalizedMessage((int)message);
}
else if (message is string)
{
from.SendMessage((string)message);
}
//.........这里部分代码省略.........
示例2: CompleteCraft
public void CompleteCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CustomCraft customCraft )
{
int badCraft = craftSystem.CanCraft( from, tool, m_Type );
if ( badCraft > 0 )
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, badCraft ) );
else
from.SendLocalizedMessage( badCraft );
return;
}
int checkResHue = 0, checkMaxAmount = 0;
object checkMessage = null;
// Not enough resource to craft it
if ( !ConsumeRes( from, typeRes, craftSystem, ref checkResHue, ref checkMaxAmount, ConsumeType.None, ref checkMessage ) )
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, checkMessage ) );
else if ( checkMessage is int && (int)checkMessage > 0 )
from.SendLocalizedMessage( (int)checkMessage );
else if ( checkMessage is string )
from.SendMessage( (string)checkMessage );
return;
}
else if ( !ConsumeAttributes( from, ref checkMessage, false ) )
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, checkMessage ) );
else if ( checkMessage is int && (int)checkMessage > 0 )
from.SendLocalizedMessage( (int)checkMessage );
else if ( checkMessage is string )
from.SendMessage( (string)checkMessage );
return;
}
bool toolBroken = false;
int ignored = 1;
int endquality = 1;
bool allRequiredSkills = true;
if ( CheckSkills( from, typeRes, craftSystem, ref ignored, ref allRequiredSkills ) )
{
// Resource
int resHue = 0;
int maxAmount = 0;
object message = null;
// Not enough resource to craft it
if ( !ConsumeRes( from, typeRes, craftSystem, ref resHue, ref maxAmount, ConsumeType.All, ref message ) )
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, message ) );
else if ( message is int && (int)message > 0 )
from.SendLocalizedMessage( (int)message );
else if ( message is string )
from.SendMessage( (string)message );
return;
}
else if ( !ConsumeAttributes( from, ref message, true ) )
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, message ) );
else if ( message is int && (int)message > 0 )
from.SendLocalizedMessage( (int)message );
else if ( message is string )
from.SendMessage( (string)message );
return;
}
tool.UsesRemaining--;
if ( craftSystem is DefBlacksmithy )
{
AncientSmithyHammer hammer = from.FindItemOnLayer( Layer.OneHanded ) as AncientSmithyHammer;
if ( hammer != null && hammer != tool )
{
hammer.UsesRemaining--;
if ( hammer.UsesRemaining < 1 )
hammer.Delete();
}
}
if ( tool.UsesRemaining < 1 )
toolBroken = true;
if ( toolBroken )
tool.Delete();
int num = 0;
//.........这里部分代码省略.........
示例3: CompleteCraft
public void CompleteCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CustomCraft customCraft )
{
int badCraft = craftSystem.CanCraft( from, tool, m_Type );
if ( badCraft > 0 )
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, badCraft ) );
else
from.SendLocalizedMessage( badCraft );
return;
}
int checkResHue = 0, checkMaxAmount = 0;
object checkMessage = null;
// Not enough resource to craft it
if ( !ConsumeRes( from, typeRes, craftSystem, ref checkResHue, ref checkMaxAmount, ConsumeType.None, ref checkMessage ) )
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, checkMessage ) );
else if ( checkMessage is int && (int)checkMessage > 0 )
from.SendLocalizedMessage( (int)checkMessage );
else if ( checkMessage is string )
from.SendMessage( (string)checkMessage );
return;
}
else if ( !ConsumeAttributes( from, ref checkMessage, false ) )
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, checkMessage ) );
else if ( checkMessage is int && (int)checkMessage > 0 )
from.SendLocalizedMessage( (int)checkMessage );
else if ( checkMessage is string )
from.SendMessage( (string)checkMessage );
return;
}
bool toolBroken = false;
int ignored = 1;
int endquality = 1;
bool allRequiredSkills = true;
if ( CheckSkills( from, typeRes, craftSystem, ref ignored, ref allRequiredSkills ) )
{
// Resource
int resHue = 0;
int maxAmount = 0;
object message = null;
// Not enough resource to craft it
if ( !ConsumeRes( from, typeRes, craftSystem, ref resHue, ref maxAmount, ConsumeType.All, ref message ) )
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, message ) );
else if ( message is int && (int)message > 0 )
from.SendLocalizedMessage( (int)message );
else if ( message is string )
from.SendMessage( (string)message );
return;
}
else if ( !ConsumeAttributes( from, ref message, true ) )
{
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
from.SendGump( new CraftGump( from, craftSystem, tool, message ) );
else if ( message is int && (int)message > 0 )
from.SendLocalizedMessage( (int)message );
else if ( message is string )
from.SendMessage( (string)message );
return;
}
tool.UsesRemaining--;
if ( craftSystem is DefBlacksmithy )
{
AncientSmithyHammer hammer = from.FindItemOnLayer( Layer.OneHanded ) as AncientSmithyHammer;
if ( hammer != null && hammer != tool )
{
hammer.UsesRemaining--;
if ( hammer.UsesRemaining < 1 )
hammer.Delete();
}
}
if ( tool.UsesRemaining < 1 )
toolBroken = true;
if ( toolBroken )
tool.Delete();
int num = 0;
//.........这里部分代码省略.........
示例4: CompleteCraft
public void CompleteCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CustomCraft customCraft, bool showGumps)
{
int badCraft = craftSystem.CanCraft(from, tool, m_Type);
if (badCraft > 0)
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, badCraft));
else
from.SendLocalizedMessage(badCraft);
return;
}
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
{
if (tool.CraftSystem == DefBlacksmithy.CraftSystem)
{
if (from.FindItemOnLayer(Layer.OneHanded) != tool)
{
from.SendGump(new CraftGump(from, craftSystem, tool, string.Format("You must have your smith hammer equipped!")));
return;
}
}
else
{
if (!tool.IsChildOf(from.Backpack))
{
from.SendGump(new CraftGump(from, craftSystem, tool, string.Format("You must have your tool in your backpack!")));
return;
}
}
}
else
{
from.SendLocalizedMessage(badCraft);
return;
}
object checkMessage = null;
int checkResHue = 0, checkMaxAmount = 0;
// Not enough resource to craft it
if ( !ConsumeRes( from, typeRes, craftSystem, ref checkResHue, ref checkMaxAmount, ConsumeType.None, ref checkMessage ) )
{
if (!tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, checkMessage));
else if (checkMessage is int && (int)checkMessage > 0)
from.SendLocalizedMessage((int)checkMessage);
else if (checkMessage is string)
from.SendMessage((string)checkMessage);
return;
}
if (!ConsumeAttributes(from, ref checkMessage, false))
{
if (!tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, checkMessage));
else if (checkMessage is int && (int)checkMessage > 0)
from.SendLocalizedMessage((int)checkMessage);
else if (checkMessage is string)
from.SendMessage((string)checkMessage);
return;
}
bool toolBroken = false;
int ignored = 1;
int endquality = 1;
bool allRequiredSkills = true;
if (CheckSkills(from, typeRes, craftSystem, ref ignored, ref allRequiredSkills))
{
// Resource
int resHue = 0;
int maxAmount = 0;
object message = null;
// Not enough resource to craft it
if (!ConsumeRes(from, typeRes, craftSystem, ref resHue, ref maxAmount, ConsumeType.All, ref message))
{
if (!tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, message));
else if (message is int && (int)message > 0)
from.SendLocalizedMessage((int)message);
else if (message is string)
from.SendMessage((string)message);
return;
}
if (!ConsumeAttributes(from, ref message, true))
{
if (!tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, message));
else if (message is int && (int)message > 0)
from.SendLocalizedMessage((int)message);
//.........这里部分代码省略.........
示例5: CompleteCraft
public void CompleteCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool)
{
int badCraft = craftSystem.CanCraft(from, tool, m_Type);
if (badCraft > 0)
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, badCraft));
else
from.SendLocalizedMessage(badCraft);
return;
}
int checkResHue = 0, checkMaxAmount = 0;
object checkMessage = null;
// Not enough resource to craft it
if (!ConsumeRes(from, typeRes, craftSystem, ref checkResHue, ref checkMaxAmount, ConsumeType.None, ref checkMessage))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, checkMessage));
else if (checkMessage is int && (int)checkMessage > 0)
from.SendLocalizedMessage((int)checkMessage);
else if (checkMessage is string)
from.SendMessage((string)checkMessage);
return;
}
else if (!ConsumeAttributes(from, ref checkMessage, false))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, checkMessage));
else if (checkMessage is int && (int)checkMessage > 0)
from.SendLocalizedMessage((int)checkMessage);
else if (checkMessage is string)
from.SendMessage((string)checkMessage);
return;
}
bool toolBroken = false;
int ignored = 1;
int endquality = 1;
bool allRequiredSkills = true;
// pla, 01/04/07
// -----------------------------------------------------------------
// Additional checks required here to prevent skill gain exploit with special dye tubs.
if (craftSystem is DefAlchemy && (ItemType == typeof(SpecialDyeTub) || ItemType == typeof(SpecialDye)))
{
// note here that if lighten or darken was chosen, there will always be at least one special tub,
// as it's set as a resource requirement.
if (m_NameString == "> Darken the mix" || m_NameString == "> Lighten the mix")
{
// darken/lighten requires a special tub
// Get list of all special tubs
Item[] sdtubs = ((Container)from.Backpack).FindItemsByType(typeof(SpecialDyeTub), true);
SpecialDyeTub sdtub;
if (sdtubs.Length == 0)
{
//should be impossible as in reqs
return;
}
else if (sdtubs.Length == 1)
{
// in this case we have just one tub. This means we will leave skill gain and execution to the
// standard craft code below. However, we need to first check if the tub can be lightened/darkened,
// and if not then return to prevent skill gain with no resource use.
sdtub = (SpecialDyeTub)sdtubs[0];
if (sdtub != null)
{
if (m_NameString == "> Darken the mix")
{
if (!sdtub.CanDarken)
{
from.SendMessage("You attempt to darken the mix, but it will go no darker.");
from.SendGump(new CraftGump(from, craftSystem, tool, 0));
return;
}
}
else
{
if (!sdtub.CanLighten)
{
from.SendMessage("You attempt to lighten the mix, but it will go no lighter.");
from.SendGump(new CraftGump(from, craftSystem, tool, 0));
return;
}
}
}
}
else if (sdtubs.Length > 1)
{
// in this case we have more than one possible tub to select so we hand execution over to the target.
//target also deals with all skill gain and failure/tool use etc.
int resHue = 0;
int maxAmount = 0;
//.........这里部分代码省略.........
示例6: DoCraft
public static void DoCraft( Mobile from, CraftSystem system, Type typeRes, BaseTool tool, CraftItem craftItem, PlantPigment pigments )
{
CraftContext context = system.GetContext( from );
if ( context != null )
context.OnMade( craftItem );
bool allRequiredSkills = true;
double chance = craftItem.GetSuccessChance( from, typeRes, system, true, ref allRequiredSkills );
if ( chance > 0.0 )
chance += craftItem.GetTalismanBonus( from, system );
if ( allRequiredSkills )
{
pigments.Consume();
if ( chance < Utility.RandomDouble() )
{
from.SendGump( new CraftGump( from, system, tool, 1044043 ) ); // You failed to create the item, and some of your materials are lost.
}
else
{
from.Backpack.ConsumeTotal( typeof( ColorFixative ), 1 );
bool toolBroken = false;
tool.UsesRemaining--;
if ( tool.UsesRemaining < 1 )
toolBroken = true;
if ( toolBroken )
{
tool.Delete();
from.SendLocalizedMessage( 1044038 ); // You have worn out your tool!
from.SendLocalizedMessage( 1044154 ); // You create the item.
}
else
{
// You create the item.
from.SendGump( new CraftGump( from, system, tool, 1044154 ) );
}
from.AddToBackpack( new NaturalDye( pigments.PlantHue ) );
}
}
else
{
// You don't have the required skills to attempt this item.
from.SendGump( new CraftGump( from, system, tool, 1044153 ) );
}
}
示例7: CompleteCraft
public void CompleteCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CustomCraft customCraft)
{
int badCraft = craftSystem.CanCraft(from, tool, m_Type);
if (badCraft > 0)
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, badCraft));
else
from.SendLocalizedMessage(badCraft);
return;
}
int checkResHue = 0, checkMaxAmount = 0;
object checkMessage = null;
// Not enough resource to craft it
if (!ConsumeRes(from, typeRes, craftSystem, ref checkResHue, ref checkMaxAmount, ConsumeType.None, ref checkMessage))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, checkMessage));
else if (checkMessage is int && (int)checkMessage > 0)
from.SendLocalizedMessage((int)checkMessage);
else if (checkMessage is string)
from.SendMessage((string)checkMessage);
return;
}
else if (!ConsumeAttributes(from, ref checkMessage, false))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, checkMessage));
else if (checkMessage is int && (int)checkMessage > 0)
from.SendLocalizedMessage((int)checkMessage);
else if (checkMessage is string)
from.SendMessage((string)checkMessage);
return;
}
bool toolBroken = false;
int ignored = 1;
int endquality = 1;
bool allRequiredSkills = true;
if (CheckSkills(from, typeRes, craftSystem, ref ignored, ref allRequiredSkills))
{
// Resource
int resHue = 0;
int maxAmount = 0;
object message = null;
// Not enough resource to craft it
if (!ConsumeRes(from, typeRes, craftSystem, ref resHue, ref maxAmount, ConsumeType.All, ref message))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, message));
else if (message is int && (int)message > 0)
from.SendLocalizedMessage((int)message);
else if (message is string)
from.SendMessage((string)message);
return;
}
else if (!ConsumeAttributes(from, ref message, true))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, message));
else if (message is int && (int)message > 0)
from.SendLocalizedMessage((int)message);
else if (message is string)
from.SendMessage((string)message);
return;
}
tool.UsesRemaining--;
if (craftSystem is DefBlacksmithy)
{
AncientSmithyHammer hammer = from.FindItemOnLayer(Layer.OneHanded) as AncientSmithyHammer;
if (hammer != null && hammer != tool)
{
#region Mondain's Legacy
if (hammer is HammerOfHephaestus)
{
if (hammer.UsesRemaining > 0)
hammer.UsesRemaining--;
if (hammer.UsesRemaining < 1)
from.PlaceInBackpack(hammer);
}
else
{
hammer.UsesRemaining--;
//.........这里部分代码省略.........
示例8: CompleteCraft
public void CompleteCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CustomCraft customCraft)
{
int badCraft = craftSystem.CanCraft(from, tool, m_Type);
if (badCraft > 0)
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, badCraft));
else
from.SendLocalizedMessage(badCraft);
return;
}
int checkResHue = 0, checkMaxAmount = 0;
object checkMessage = null;
// Not enough resource to craft it
if (!ConsumeRes(from, typeRes, craftSystem, ref checkResHue, ref checkMaxAmount, ConsumeType.None, ref checkMessage))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, checkMessage));
else if (checkMessage is int && (int)checkMessage > 0)
from.SendLocalizedMessage((int)checkMessage);
else if (checkMessage is string)
from.SendMessage((string)checkMessage);
return;
}
else if (!ConsumeAttributes(from, ref checkMessage, false))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, checkMessage));
else if (checkMessage is int && (int)checkMessage > 0)
from.SendLocalizedMessage((int)checkMessage);
else if (checkMessage is string)
from.SendMessage((string)checkMessage);
return;
}
bool toolBroken = false;
int ignored = 1;
int endquality = 1;
bool allRequiredSkills = true;
if (CheckSkills(from, craftSystem, ref ignored, ref allRequiredSkills))
{
// Resource
int resHue = 0;
int maxAmount = 0;
object message = null;
// Not enough resource to craft it
if (!ConsumeRes(from, typeRes, craftSystem, ref resHue, ref maxAmount, ConsumeType.All, ref message))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, message));
else if (message is int && (int)message > 0)
from.SendLocalizedMessage((int)message);
else if (message is string)
from.SendMessage((string)message);
return;
}
else if (!ConsumeAttributes(from, ref message, true))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, message));
else if (message is int && (int)message > 0)
from.SendLocalizedMessage((int)message);
else if (message is string)
from.SendMessage((string)message);
return;
}
tool.UsesRemaining--;
if (tool.UsesRemaining < 1 && tool.BreakOnDepletion)
toolBroken = true;
if (toolBroken)
tool.Delete();
int num = 0;
Item item;
if (customCraft != null)
{
item = customCraft.CompleteCraft(out num);
}
else if (typeof(MapItem).IsAssignableFrom(ItemType) && from.Map != Map.Felucca)
{
item = new IndecipherableMap();
from.SendLocalizedMessage(1070800); // The map you create becomes mysteriously indecipherable.
}
//.........这里部分代码省略.........
示例9: CompleteCraft
public void CompleteCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CustomCraft customCraft)
{
int badCraft = craftSystem.CanCraft(from, tool, m_Type);
if (badCraft > 0)
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, badCraft));
else
from.SendLocalizedMessage(badCraft);
return;
}
int checkResHue = 0, checkMaxAmount = 0;
object checkMessage = null;
// Not enough resource to craft it
if (!ConsumeRes(from, typeRes, craftSystem, ref checkResHue, ref checkMaxAmount, ConsumeType.None, ref checkMessage))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, checkMessage));
else if (checkMessage is int && (int)checkMessage > 0)
from.SendLocalizedMessage((int)checkMessage);
else if (checkMessage is string)
from.SendMessage((string)checkMessage);
return;
}
else if (!ConsumeAttributes(from, ref checkMessage, false))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, checkMessage));
else if (checkMessage is int && (int)checkMessage > 0)
from.SendLocalizedMessage((int)checkMessage);
else if (checkMessage is string)
from.SendMessage((string)checkMessage);
return;
}
bool toolBroken = false;
int ignored = 1;
int endquality = 1;
bool allRequiredSkills = true;
if (CheckSkills(from, typeRes, craftSystem, ref ignored, ref allRequiredSkills))
{
// Resource
int resHue = 0;
int maxAmount = 0;
object message = null;
// Not enough resource to craft it
if (!ConsumeRes(from, typeRes, craftSystem, ref resHue, ref maxAmount, ConsumeType.All, ref message))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, message));
else if (message is int && (int)message > 0)
from.SendLocalizedMessage((int)message);
else if (message is string)
from.SendMessage((string)message);
return;
}
else if (!ConsumeAttributes(from, ref message, true))
{
if (tool != null && !tool.Deleted && tool.UsesRemaining > 0)
from.SendGump(new CraftGump(from, craftSystem, tool, message));
else if (message is int && (int)message > 0)
from.SendLocalizedMessage((int)message);
else if (message is string)
from.SendMessage((string)message);
return;
}
tool.UsesRemaining--;
if (craftSystem is DefBlacksmithy)
{
AncientSmithyHammer hammer = from.FindItemOnLayer(Layer.OneHanded) as AncientSmithyHammer;
if (hammer != null && hammer != tool)
{
#region Mondain's Legacy
if (hammer is HammerOfHephaestus)
{
if (hammer.UsesRemaining > 0)
hammer.UsesRemaining--;
if (hammer.UsesRemaining < 1)
from.PlaceInBackpack(hammer);
}
else
{
hammer.UsesRemaining--;
//.........这里部分代码省略.........