本文整理汇总了C#中Server.Engines.Craft.CraftItem类的典型用法代码示例。如果您正苦于以下问题:C# CraftItem类的具体用法?C# CraftItem怎么用?C# CraftItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CraftItem类属于Server.Engines.Craft命名空间,在下文中一共展示了CraftItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlayEndingEffect
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
if (failed)
{
if (lostMaterial)
return 1044043; // You failed to create the item, and some of your materials are lost.
else
return 1044157; // You failed to create the item, but no materials were lost.
}
else
{
from.PlaySound(0x41); // glass breaking
if (quality == 0)
return 502785; // You were barely able to make this item. It's quality is below average.
else if (makersMark && quality == 2)
return 1044156; // You create an exceptional quality item and affix your maker's mark.
else if (quality == 2)
return 1044155; // You create an exceptional quality item.
else
return 1044154; // You create the item.
}
}
示例2: OnCraft
public override bool OnCraft( bool exceptional, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
{
if ( exceptional )
ArmorAttributes.MageArmor = 1;
return base.OnCraft( exceptional, makersMark, from, craftSystem, typeRes, tool, craftItem, resHue );
}
示例3: RetainsColorFrom
public override bool RetainsColorFrom( CraftItem item, Type type )
{
if ( type != typeof( Cloth ) && type != typeof( UncutCloth ) )
return false;
return true;
}
示例4: PlayEndingEffect
public override int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item )
{
if ( toolBroken )
from.SendLocalizedMessage( 1044038 ); // You have worn out your tool
// erl: handle special dyes differently
if( item.ItemType == typeof( SpecialDyeTub ) || item.ItemType == typeof( SpecialDye ) )
{
if( failed )
from.SendMessage("You fail to mix the dye correctly.");
return 0;
}
if ( failed )
{
from.AddToBackpack( new Bottle() );
return 500287; // You fail to create a useful potion.
}
else
{
from.PlaySound( 0x240 ); // Sound of a filling bottle
if ( quality == -1 )
return 1048136; // You create the potion and pour it into a keg.
else
return 500279; // You pour the potion into a bottle...
}
}
示例5: QueryMakersMarkGump
public QueryMakersMarkGump( bool exceptional, Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool, bool questItem )
: base(100, 200)
{
from.CloseGump( typeof( QueryMakersMarkGump ) );
m_Exceptional = exceptional;
m_From = from;
m_CraftItem = craftItem;
m_CraftSystem = craftSystem;
m_TypeRes = typeRes;
m_Tool = tool;
m_QuestItem = questItem;
AddPage( 0 );
AddBackground( 0, 0, 220, 170, 5054 );
AddBackground( 10, 10, 200, 150, 3000 );
AddHtmlLocalized( 20, 20, 180, 80, 1018317, false, false ); // Do you wish to place your maker's mark on this item?
AddHtmlLocalized( 55, 100, 140, 25, 1011036, false, false ); // OKAY
AddButton( 20, 100, 4005, 4007, 2, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 55, 125, 140, 25, 1011012, false, false ); // CANCEL
AddButton( 20, 125, 4005, 4007, 1, GumpButtonType.Reply, 0 );
}
示例6: Craft
public static void Craft( Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem )
{
if ( from.Backpack == null )
{
from.EndAction( typeof( CraftSystem ) );
return;
}
Timer.DelayCall( TimeSpan.FromSeconds( craftSystem.Delay ), new TimerCallback(
delegate
{
if ( from.Backpack.GetAmount( typeof( Bottle ) ) < 1 || from.Backpack.GetAmount( typeof( PlantClippings ) ) < 1 )
{
from.EndAction( typeof( CraftSystem ) );
// You don't have the components needed to make that.
from.SendGump( new CraftGump( from, craftSystem, tool, 1044253 ) );
}
else if ( ShouldChooseHue( from ) )
{
from.SendLocalizedMessage( 1074794 ); // Target the material to use:
from.Target = new ClippingsTarget( craftSystem, typeRes, tool, craftItem );
}
else
{
from.EndAction( typeof( CraftSystem ) );
DoCraft( from, craftSystem, typeRes, tool, craftItem, from.Backpack.FindItemByType<PlantClippings>() );
}
}
) );
}
示例7: GetDelay
public static int GetDelay(CraftItem toCraft)
{
if (toCraft != null)
return toCraft.Resources.GetAt(0).Amount+1;
else
return 2;
}
示例8: QueryMakersMarkGump
public QueryMakersMarkGump(int quality, Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool)
: base(100, 200)
{
from.CloseGump(typeof(QueryMakersMarkGump));
this.m_Quality = quality;
this.m_From = from;
this.m_CraftItem = craftItem;
this.m_CraftSystem = craftSystem;
this.m_TypeRes = typeRes;
this.m_Tool = tool;
this.AddPage(0);
this.AddBackground(0, 0, 220, 170, 5054);
this.AddBackground(10, 10, 200, 150, 3000);
this.AddHtmlLocalized(20, 20, 180, 80, 1018317, false, false); // Do you wish to place your maker's mark on this item?
this.AddHtmlLocalized(55, 100, 140, 25, 1011011, false, false); // CONTINUE
this.AddButton(20, 100, 4005, 4007, 1, GumpButtonType.Reply, 0);
this.AddHtmlLocalized(55, 125, 140, 25, 1011012, false, false); // CANCEL
this.AddButton(20, 125, 4005, 4007, 0, GumpButtonType.Reply, 0);
}
示例9: MakeNumberCraftPrompt
public MakeNumberCraftPrompt(Mobile from, CraftSystem system, CraftItem item, BaseTool tool)
{
m_From = from;
m_CraftSystem = system;
m_CraftItem = item;
m_Tool = tool;
}
示例10: GetChanceAtMin
public override double GetChanceAtMin( CraftItem item )
{
if( item.ItemType == typeof( HollowPrism ) )
return 0.5; // 50%
return 0.0; // 0%
}
示例11: OnCraft
public override int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
{
double magery = from.Skills.Magery.Value - 100;
if ( magery < 0 )
magery = 0;
int count = (int) Math.Round( magery * Utility.RandomDouble() / 5 );
if ( count > 2 )
count = 2;
if ( Utility.RandomDouble() < 0.5 )
count = 0;
else
BaseRunicTool.ApplyAttributesTo( this, false, 0, count, 70, 80 );
Attributes.SpellDamage = 25;
Attributes.LowerManaCost = 10;
Attributes.CastSpeed = 1;
Attributes.CastRecovery = 1;
if ( makersMark )
Crafter = from;
return quality;
}
示例12: OnMade
public void OnMade( Mobile m, CraftItem item )
{
CraftContext c = GetContext( m );
if ( c != null )
c.OnMade( item );
}
示例13: PlayEndingEffect
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
if (!typeofSpellScroll.IsAssignableFrom(item.ItemType)) // not a scroll
{
if (failed)
{
if (lostMaterial)
return 1044043; // You failed to create the item, and some of your materials are lost.
else
return 1044157; // You failed to create the item, but no materials were lost.
}
else
{
if (quality == 0)
return 502785; // You were barely able to make this item. It's quality is below average.
else if (makersMark && quality == 2)
return 1044156; // You create an exceptional quality item and affix your maker's mark.
else if (quality == 2)
return 1044155; // You create an exceptional quality item.
else
return 1044154; // You create the item.
}
}
else
{
if (failed)
return 501630; // You fail to inscribe the scroll, and the scroll is ruined.
else
return 501629; // You inscribe the spell and put the scroll in your backpack.
}
}
示例14: PlayEndingEffect
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
if (failed)
{
if (IsPotion(item.ItemType))
{
from.AddToBackpack(new Bottle());
return 500287; // You fail to create a useful potion.
}
else
{
return 1044043; // You failed to create the item, and some of your materials are lost.
}
}
else
{
from.PlaySound(0x240); // Sound of a filling bottle
if (IsPotion(item.ItemType))
{
if (quality == -1)
return 1048136; // You create the potion and pour it into a keg.
else
return 500279; // You pour the potion into a bottle...
}
else
{
return 1044154; // You create the item.
}
}
}
示例15: GetChanceAtMin
public override double GetChanceAtMin( CraftItem item )
{
if ( item.NameNumber == 1044258 ) // potion keg
return 0.5; // 50%
return 0.0; // 0%
}