This commit is contained in:
commit
47711d616e
2644 changed files with 479454 additions and 0 deletions
58
Scripts/Engines/Craft/Core/CraftContext.cs
Normal file
58
Scripts/Engines/Craft/Core/CraftContext.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public enum CraftMarkOption
|
||||
{
|
||||
MarkItem,
|
||||
DoNotMark,
|
||||
PromptForMark
|
||||
}
|
||||
|
||||
public class CraftContext
|
||||
{
|
||||
private ArrayList m_Items;
|
||||
private int m_LastResourceIndex;
|
||||
private int m_LastResourceIndex2;
|
||||
private int m_LastGroupIndex;
|
||||
private bool m_DoNotColor;
|
||||
private CraftMarkOption m_MarkOption;
|
||||
|
||||
public ArrayList Items{ get{ return m_Items; } }
|
||||
public int LastResourceIndex{ get{ return m_LastResourceIndex; } set{ m_LastResourceIndex = value; } }
|
||||
public int LastResourceIndex2{ get{ return m_LastResourceIndex2; } set{ m_LastResourceIndex2 = value; } }
|
||||
public int LastGroupIndex{ get{ return m_LastGroupIndex; } set{ m_LastGroupIndex = value; } }
|
||||
public bool DoNotColor{ get{ return m_DoNotColor; } set{ m_DoNotColor = value; } }
|
||||
public CraftMarkOption MarkOption{ get{ return m_MarkOption; } set{ m_MarkOption = value; } }
|
||||
|
||||
public CraftContext()
|
||||
{
|
||||
m_Items = new ArrayList();
|
||||
m_LastResourceIndex = -1;
|
||||
m_LastResourceIndex2 = -1;
|
||||
m_LastGroupIndex = -1;
|
||||
}
|
||||
|
||||
public CraftItem LastMade
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_Items.Count > 0 )
|
||||
return (CraftItem)m_Items[0];
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnMade( CraftItem item )
|
||||
{
|
||||
m_Items.Remove( item );
|
||||
|
||||
if ( m_Items.Count == 10 )
|
||||
m_Items.RemoveAt( 9 );
|
||||
|
||||
m_Items.Insert( 0, item );
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Scripts/Engines/Craft/Core/CraftGroup.cs
Normal file
39
Scripts/Engines/Craft/Core/CraftGroup.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class CraftGroup
|
||||
{
|
||||
private CraftItemCol m_arCraftItem;
|
||||
|
||||
private string m_NameString;
|
||||
private int m_NameNumber;
|
||||
|
||||
public CraftGroup( TextDefinition groupName )
|
||||
{
|
||||
m_NameNumber = groupName;
|
||||
m_NameString = groupName;
|
||||
m_arCraftItem = new CraftItemCol();
|
||||
}
|
||||
|
||||
public void AddCraftItem( CraftItem craftItem )
|
||||
{
|
||||
m_arCraftItem.Add( craftItem );
|
||||
}
|
||||
|
||||
public CraftItemCol CraftItems
|
||||
{
|
||||
get { return m_arCraftItem; }
|
||||
}
|
||||
|
||||
public string NameString
|
||||
{
|
||||
get { return m_NameString; }
|
||||
}
|
||||
|
||||
public int NameNumber
|
||||
{
|
||||
get { return m_NameNumber; }
|
||||
}
|
||||
}
|
||||
}
|
||||
48
Scripts/Engines/Craft/Core/CraftGroupCol.cs
Normal file
48
Scripts/Engines/Craft/Core/CraftGroupCol.cs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class CraftGroupCol : System.Collections.CollectionBase
|
||||
{
|
||||
public CraftGroupCol()
|
||||
{
|
||||
}
|
||||
|
||||
public int Add( CraftGroup craftGroup )
|
||||
{
|
||||
return List.Add( craftGroup );
|
||||
}
|
||||
|
||||
public void Remove( int index )
|
||||
{
|
||||
if ( index > Count - 1 || index < 0 )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
List.RemoveAt( index );
|
||||
}
|
||||
}
|
||||
|
||||
public CraftGroup GetAt( int index )
|
||||
{
|
||||
return ( CraftGroup ) List[index];
|
||||
}
|
||||
|
||||
public int SearchFor( TextDefinition groupName )
|
||||
{
|
||||
for ( int i = 0; i < List.Count; i++ )
|
||||
{
|
||||
CraftGroup craftGroup = (CraftGroup)List[i];
|
||||
|
||||
int nameNumber = craftGroup.NameNumber;
|
||||
string nameString = craftGroup.NameString;
|
||||
|
||||
if ( ( nameNumber != 0 && nameNumber == groupName.Number ) || ( nameString != null && nameString == groupName.String ) )
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
582
Scripts/Engines/Craft/Core/CraftGump.cs
Normal file
582
Scripts/Engines/Craft/Core/CraftGump.cs
Normal file
|
|
@ -0,0 +1,582 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class CraftGump : Gump
|
||||
{
|
||||
private Mobile m_From;
|
||||
private CraftSystem m_CraftSystem;
|
||||
private BaseTool m_Tool;
|
||||
|
||||
private CraftPage m_Page;
|
||||
|
||||
private const int LabelHue = 0x480;
|
||||
private const int LabelColor = 0x7FFF;
|
||||
private const int FontColor = 0xFFFFFF;
|
||||
|
||||
private enum CraftPage
|
||||
{
|
||||
None,
|
||||
PickResource,
|
||||
PickResource2
|
||||
}
|
||||
|
||||
/*public CraftGump( Mobile from, CraftSystem craftSystem, BaseTool tool ): this( from, craftSystem, -1, -1, tool, null )
|
||||
{
|
||||
}*/
|
||||
|
||||
public CraftGump( Mobile from, CraftSystem craftSystem, BaseTool tool, object notice ) : this( from, craftSystem, tool, notice, CraftPage.None )
|
||||
{
|
||||
}
|
||||
|
||||
private CraftGump( Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page ) : base( 40, 40 )
|
||||
{
|
||||
m_From = from;
|
||||
m_CraftSystem = craftSystem;
|
||||
m_Tool = tool;
|
||||
m_Page = page;
|
||||
|
||||
CraftContext context = craftSystem.GetContext( from );
|
||||
|
||||
from.CloseGump( typeof( CraftGump ) );
|
||||
from.CloseGump( typeof( CraftGumpItem ) );
|
||||
|
||||
AddPage( 0 );
|
||||
|
||||
AddBackground( 0, 0, 530, 437, 5054 );
|
||||
AddImageTiled( 10, 10, 510, 22, 2624 );
|
||||
AddImageTiled( 10, 292, 150, 45, 2624 );
|
||||
AddImageTiled( 165, 292, 355, 45, 2624 );
|
||||
AddImageTiled( 10, 342, 510, 85, 2624 );
|
||||
AddImageTiled( 10, 37, 200, 250, 2624 );
|
||||
AddImageTiled( 215, 37, 305, 250, 2624 );
|
||||
AddAlphaRegion( 10, 10, 510, 417 );
|
||||
|
||||
if ( craftSystem.GumpTitleNumber > 0 )
|
||||
AddHtmlLocalized( 10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false );
|
||||
else
|
||||
AddHtml( 10, 12, 510, 20, craftSystem.GumpTitleString, false, false );
|
||||
|
||||
AddHtmlLocalized( 10, 37, 200, 22, 1044010, LabelColor, false, false ); // <CENTER>CATEGORIES</CENTER>
|
||||
AddHtmlLocalized( 215, 37, 305, 22, 1044011, LabelColor, false, false ); // <CENTER>SELECTIONS</CENTER>
|
||||
AddHtmlLocalized( 10, 302, 150, 25, 1044012, LabelColor, false, false ); // <CENTER>NOTICES</CENTER>
|
||||
|
||||
AddButton( 15, 402, 4017, 4019, 0, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 50, 405, 150, 18, 1011441, LabelColor, false, false ); // EXIT
|
||||
|
||||
AddButton( 270, 402, 4005, 4007, GetButtonID( 6, 2 ), GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 305, 405, 150, 18, 1044013, LabelColor, false, false ); // MAKE LAST
|
||||
|
||||
// Mark option
|
||||
if ( craftSystem.MarkOption )
|
||||
{
|
||||
AddButton( 270, 362, 4005, 4007, GetButtonID( 6, 6 ), GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 305, 365, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false ); // MARK ITEM
|
||||
}
|
||||
// ****************************************
|
||||
|
||||
// Resmelt option
|
||||
if ( craftSystem.Resmelt )
|
||||
{
|
||||
AddButton( 15, 342, 4005, 4007, GetButtonID( 6, 1 ), GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 50, 345, 150, 18, 1044259, LabelColor, false, false ); // SMELT ITEM
|
||||
}
|
||||
// ****************************************
|
||||
|
||||
// Repair option
|
||||
if ( craftSystem.Repair )
|
||||
{
|
||||
AddButton( 270, 342, 4005, 4007, GetButtonID( 6, 5 ), GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 305, 345, 150, 18, 1044260, LabelColor, false, false ); // REPAIR ITEM
|
||||
}
|
||||
// ****************************************
|
||||
|
||||
// Enhance option
|
||||
if ( craftSystem.CanEnhance )
|
||||
{
|
||||
AddButton( 270, 382, 4005, 4007, GetButtonID( 6, 8 ), GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 305, 385, 150, 18, 1061001, LabelColor, false, false ); // ENHANCE ITEM
|
||||
}
|
||||
// ****************************************
|
||||
|
||||
if ( notice is int && (int)notice > 0 )
|
||||
AddHtmlLocalized( 170, 295, 350, 40, (int)notice, LabelColor, false, false );
|
||||
else if ( notice is string )
|
||||
AddHtml( 170, 295, 350, 40, String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice ), false, false );
|
||||
|
||||
// If the system has more than one resource
|
||||
if ( craftSystem.CraftSubRes.Init )
|
||||
{
|
||||
string nameString = craftSystem.CraftSubRes.NameString;
|
||||
int nameNumber = craftSystem.CraftSubRes.NameNumber;
|
||||
|
||||
int resIndex = ( context == null ? -1 : context.LastResourceIndex );
|
||||
|
||||
if ( resIndex > -1 )
|
||||
{
|
||||
CraftSubRes subResource = craftSystem.CraftSubRes.GetAt( resIndex );
|
||||
|
||||
nameString = subResource.NameString;
|
||||
nameNumber = subResource.NameNumber;
|
||||
}
|
||||
|
||||
AddButton( 15, 362, 4005, 4007, GetButtonID( 6, 0 ), GumpButtonType.Reply, 0 );
|
||||
|
||||
if ( nameNumber > 0 )
|
||||
AddHtmlLocalized( 50, 365, 250, 18, nameNumber, LabelColor, false, false );
|
||||
else
|
||||
AddLabel( 50, 362, LabelHue, nameString );
|
||||
}
|
||||
// ****************************************
|
||||
|
||||
// For dragon scales
|
||||
if ( craftSystem.CraftSubRes2.Init )
|
||||
{
|
||||
string nameString = craftSystem.CraftSubRes2.NameString;
|
||||
int nameNumber = craftSystem.CraftSubRes2.NameNumber;
|
||||
|
||||
int resIndex = ( context == null ? -1 : context.LastResourceIndex2 );
|
||||
|
||||
if ( resIndex > -1 )
|
||||
{
|
||||
CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt( resIndex );
|
||||
|
||||
nameString = subResource.NameString;
|
||||
nameNumber = subResource.NameNumber;
|
||||
}
|
||||
|
||||
AddButton( 15, 382, 4005, 4007, GetButtonID( 6, 7 ), GumpButtonType.Reply, 0 );
|
||||
|
||||
if ( nameNumber > 0 )
|
||||
AddHtmlLocalized( 50, 385, 250, 18, nameNumber, LabelColor, false, false );
|
||||
else
|
||||
AddLabel( 50, 385, LabelHue, nameString );
|
||||
}
|
||||
// ****************************************
|
||||
|
||||
CreateGroupList();
|
||||
|
||||
if ( page == CraftPage.PickResource )
|
||||
CreateResList( false );
|
||||
else if ( page == CraftPage.PickResource2 )
|
||||
CreateResList( true );
|
||||
else if ( context != null && context.LastGroupIndex > -1 )
|
||||
CreateItemList( context.LastGroupIndex );
|
||||
}
|
||||
|
||||
public void CreateResList( bool opt )
|
||||
{
|
||||
CraftSubResCol res = ( opt ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes );
|
||||
|
||||
for ( int i = 0; i < res.Count; ++i )
|
||||
{
|
||||
int index = i % 10;
|
||||
|
||||
CraftSubRes subResource = res.GetAt( i );
|
||||
|
||||
if ( index == 0 )
|
||||
{
|
||||
if ( i > 0 )
|
||||
AddButton( 485, 260, 4005, 4007, 0, GumpButtonType.Page, (i / 10) + 1 );
|
||||
|
||||
AddPage( (i / 10) + 1 );
|
||||
|
||||
if ( i > 0 )
|
||||
AddButton( 455, 260, 4014, 4015, 0, GumpButtonType.Page, i / 10 );
|
||||
|
||||
CraftContext context = m_CraftSystem.GetContext( m_From );
|
||||
|
||||
AddButton( 220, 260, 4005, 4007, GetButtonID( 6, 4 ), GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 255, 263, 200, 18, (context == null || !context.DoNotColor) ? 1061591 : 1061590, LabelColor, false, false );
|
||||
}
|
||||
|
||||
AddButton( 220, 60 + (index * 20), 4005, 4007, GetButtonID( 5, i ), GumpButtonType.Reply, 0 );
|
||||
|
||||
if ( subResource.NameNumber > 0 )
|
||||
AddHtmlLocalized( 255, 63 + (index * 20), 250, 18, subResource.NameNumber, LabelColor, false, false );
|
||||
else
|
||||
AddLabel( 255, 60 + (index * 20), LabelHue, subResource.NameString );
|
||||
}
|
||||
}
|
||||
|
||||
public void CreateMakeLastList()
|
||||
{
|
||||
CraftContext context = m_CraftSystem.GetContext( m_From );
|
||||
|
||||
if ( context == null )
|
||||
return;
|
||||
|
||||
ArrayList items = context.Items;
|
||||
|
||||
if ( items.Count > 0 )
|
||||
{
|
||||
for ( int i = 0; i < items.Count; ++i )
|
||||
{
|
||||
int index = i % 10;
|
||||
|
||||
CraftItem craftItem = (CraftItem)items[i];
|
||||
|
||||
if ( index == 0 )
|
||||
{
|
||||
if ( i > 0 )
|
||||
{
|
||||
AddButton( 370, 260, 4005, 4007, 0, GumpButtonType.Page, (i / 10) + 1 );
|
||||
AddHtmlLocalized( 405, 263, 100, 18, 1044045, LabelColor, false, false ); // NEXT PAGE
|
||||
}
|
||||
|
||||
AddPage( (i / 10) + 1 );
|
||||
|
||||
if ( i > 0 )
|
||||
{
|
||||
AddButton( 220, 260, 4014, 4015, 0, GumpButtonType.Page, i / 10 );
|
||||
AddHtmlLocalized( 255, 263, 100, 18, 1044044, LabelColor, false, false ); // PREV PAGE
|
||||
}
|
||||
}
|
||||
|
||||
AddButton( 220, 60 + (index * 20), 4005, 4007, GetButtonID( 3, i ), GumpButtonType.Reply, 0 );
|
||||
|
||||
if ( craftItem.NameNumber > 0 )
|
||||
AddHtmlLocalized( 255, 63 + (index * 20), 220, 18, craftItem.NameNumber, LabelColor, false, false );
|
||||
else
|
||||
AddLabel( 255, 60 + (index * 20), LabelHue, craftItem.NameString );
|
||||
|
||||
AddButton( 480, 60 + (index * 20), 4011, 4012, GetButtonID( 4, i ), GumpButtonType.Reply, 0 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// NOTE: This is not as OSI; it is an intentional difference
|
||||
|
||||
AddHtmlLocalized( 230, 62, 200, 22, 1044165, LabelColor, false, false ); // You haven't made anything yet.
|
||||
}
|
||||
}
|
||||
|
||||
public void CreateItemList( int selectedGroup )
|
||||
{
|
||||
if ( selectedGroup == 501 ) // 501 : Last 10
|
||||
{
|
||||
CreateMakeLastList();
|
||||
return;
|
||||
}
|
||||
|
||||
CraftGroupCol craftGroupCol = m_CraftSystem.CraftGroups;
|
||||
CraftGroup craftGroup = craftGroupCol.GetAt( selectedGroup );
|
||||
CraftItemCol craftItemCol = craftGroup.CraftItems;
|
||||
|
||||
for ( int i = 0; i < craftItemCol.Count; ++i )
|
||||
{
|
||||
int index = i % 10;
|
||||
|
||||
CraftItem craftItem = craftItemCol.GetAt( i );
|
||||
|
||||
if ( index == 0 )
|
||||
{
|
||||
if ( i > 0 )
|
||||
{
|
||||
AddButton( 370, 260, 4005, 4007, 0, GumpButtonType.Page, (i / 10) + 1 );
|
||||
AddHtmlLocalized( 405, 263, 100, 18, 1044045, LabelColor, false, false ); // NEXT PAGE
|
||||
}
|
||||
|
||||
AddPage( (i / 10) + 1 );
|
||||
|
||||
if ( i > 0 )
|
||||
{
|
||||
AddButton( 220, 260, 4014, 4015, 0, GumpButtonType.Page, i / 10 );
|
||||
AddHtmlLocalized( 255, 263, 100, 18, 1044044, LabelColor, false, false ); // PREV PAGE
|
||||
}
|
||||
}
|
||||
|
||||
AddButton( 220, 60 + (index * 20), 4005, 4007, GetButtonID( 1, i ), GumpButtonType.Reply, 0 );
|
||||
|
||||
if ( craftItem.NameNumber > 0 )
|
||||
AddHtmlLocalized( 255, 63 + (index * 20), 220, 18, craftItem.NameNumber, LabelColor, false, false );
|
||||
else
|
||||
AddLabel( 255, 60 + (index * 20), LabelHue, craftItem.NameString );
|
||||
|
||||
AddButton( 480, 60 + (index * 20), 4011, 4012, GetButtonID( 2, i ), GumpButtonType.Reply, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
public int CreateGroupList()
|
||||
{
|
||||
CraftGroupCol craftGroupCol = m_CraftSystem.CraftGroups;
|
||||
|
||||
AddButton( 15, 60, 4005, 4007, GetButtonID( 6, 3 ), GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 50, 63, 150, 18, 1044014, LabelColor, false, false ); // LAST TEN
|
||||
|
||||
for ( int i = 0; i < craftGroupCol.Count; i++ )
|
||||
{
|
||||
CraftGroup craftGroup = craftGroupCol.GetAt( i );
|
||||
|
||||
AddButton( 15, 80 + (i * 20), 4005, 4007, GetButtonID( 0, i ), GumpButtonType.Reply, 0 );
|
||||
|
||||
if ( craftGroup.NameNumber > 0 )
|
||||
AddHtmlLocalized( 50, 83 + (i * 20), 150, 18, craftGroup.NameNumber, LabelColor, false, false );
|
||||
else
|
||||
AddLabel( 50, 80 + (i * 20), LabelHue, craftGroup.NameString );
|
||||
}
|
||||
|
||||
return craftGroupCol.Count;
|
||||
}
|
||||
|
||||
public static int GetButtonID( int type, int index )
|
||||
{
|
||||
return 1 + type + (index * 7);
|
||||
}
|
||||
|
||||
public void CraftItem( CraftItem item )
|
||||
{
|
||||
int num = m_CraftSystem.CanCraft( m_From, m_Tool, item.ItemType );
|
||||
|
||||
if ( num > 0 )
|
||||
{
|
||||
m_From.SendGump( new CraftGump( m_From, m_CraftSystem, m_Tool, num ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
Type type = null;
|
||||
|
||||
CraftContext context = m_CraftSystem.GetContext( m_From );
|
||||
|
||||
if ( context != null )
|
||||
{
|
||||
CraftSubResCol res = ( item.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes );
|
||||
int resIndex = ( item.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex );
|
||||
|
||||
if ( resIndex >= 0 && resIndex < res.Count )
|
||||
type = res.GetAt( resIndex ).ItemType;
|
||||
}
|
||||
|
||||
m_CraftSystem.CreateItem( m_From, item.ItemType, type, m_Tool, item );
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
if ( info.ButtonID <= 0 )
|
||||
return; // Canceled
|
||||
|
||||
int buttonID = info.ButtonID - 1;
|
||||
int type = buttonID % 7;
|
||||
int index = buttonID / 7;
|
||||
|
||||
CraftSystem system = m_CraftSystem;
|
||||
CraftGroupCol groups = system.CraftGroups;
|
||||
CraftContext context = system.GetContext( m_From );
|
||||
|
||||
switch ( type )
|
||||
{
|
||||
case 0: // Show group
|
||||
{
|
||||
if ( context == null )
|
||||
break;
|
||||
|
||||
if ( index >= 0 && index < groups.Count )
|
||||
{
|
||||
context.LastGroupIndex = index;
|
||||
m_From.SendGump( new CraftGump( m_From, system, m_Tool, null ) );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 1: // Create item
|
||||
{
|
||||
if ( context == null )
|
||||
break;
|
||||
|
||||
int groupIndex = context.LastGroupIndex;
|
||||
|
||||
if ( groupIndex >= 0 && groupIndex < groups.Count )
|
||||
{
|
||||
CraftGroup group = groups.GetAt( groupIndex );
|
||||
|
||||
if ( index >= 0 && index < group.CraftItems.Count )
|
||||
CraftItem( group.CraftItems.GetAt( index ) );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 2: // Item details
|
||||
{
|
||||
if ( context == null )
|
||||
break;
|
||||
|
||||
int groupIndex = context.LastGroupIndex;
|
||||
|
||||
if ( groupIndex >= 0 && groupIndex < groups.Count )
|
||||
{
|
||||
CraftGroup group = groups.GetAt( groupIndex );
|
||||
|
||||
if ( index >= 0 && index < group.CraftItems.Count )
|
||||
m_From.SendGump( new CraftGumpItem( m_From, system, group.CraftItems.GetAt( index ), m_Tool ) );
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 3: // Create item (last 10)
|
||||
{
|
||||
if ( context == null )
|
||||
break;
|
||||
|
||||
ArrayList lastTen = context.Items;
|
||||
|
||||
if ( index >= 0 && index < lastTen.Count )
|
||||
CraftItem( (CraftItem)lastTen[index] );
|
||||
|
||||
break;
|
||||
}
|
||||
case 4: // Item details (last 10)
|
||||
{
|
||||
if ( context == null )
|
||||
break;
|
||||
|
||||
ArrayList lastTen = context.Items;
|
||||
|
||||
if ( index >= 0 && index < lastTen.Count )
|
||||
m_From.SendGump( new CraftGumpItem( m_From, system, (CraftItem)lastTen[index], m_Tool ) );
|
||||
|
||||
break;
|
||||
}
|
||||
case 5: // Resource selected
|
||||
{
|
||||
if ( m_Page == CraftPage.PickResource && index >= 0 && index < system.CraftSubRes.Count )
|
||||
{
|
||||
int groupIndex = ( context == null ? -1 : context.LastGroupIndex );
|
||||
|
||||
CraftSubRes res = system.CraftSubRes.GetAt( index );
|
||||
|
||||
if ( m_From.Skills[system.MainSkill].Base < res.RequiredSkill )
|
||||
{
|
||||
m_From.SendGump( new CraftGump( m_From, system, m_Tool, res.Message ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( context != null )
|
||||
context.LastResourceIndex = index;
|
||||
|
||||
m_From.SendGump( new CraftGump( m_From, system, m_Tool, null ) );
|
||||
}
|
||||
}
|
||||
else if ( m_Page == CraftPage.PickResource2 && index >= 0 && index < system.CraftSubRes2.Count )
|
||||
{
|
||||
int groupIndex = ( context == null ? -1 : context.LastGroupIndex );
|
||||
|
||||
CraftSubRes res = system.CraftSubRes2.GetAt( index );
|
||||
|
||||
if ( m_From.Skills[system.MainSkill].Base < res.RequiredSkill )
|
||||
{
|
||||
m_From.SendGump( new CraftGump( m_From, system, m_Tool, res.Message ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( context != null )
|
||||
context.LastResourceIndex2 = index;
|
||||
|
||||
m_From.SendGump( new CraftGump( m_From, system, m_Tool, null ) );
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 6: // Misc. buttons
|
||||
{
|
||||
switch ( index )
|
||||
{
|
||||
case 0: // Resource selection
|
||||
{
|
||||
if ( system.CraftSubRes.Init )
|
||||
m_From.SendGump( new CraftGump( m_From, system, m_Tool, null, CraftPage.PickResource ) );
|
||||
|
||||
break;
|
||||
}
|
||||
case 1: // Smelt item
|
||||
{
|
||||
if ( system.Resmelt )
|
||||
Resmelt.Do( m_From, system, m_Tool );
|
||||
|
||||
break;
|
||||
}
|
||||
case 2: // Make last
|
||||
{
|
||||
if ( context == null )
|
||||
break;
|
||||
|
||||
CraftItem item = context.LastMade;
|
||||
|
||||
if ( item != null )
|
||||
CraftItem( item );
|
||||
else
|
||||
m_From.SendGump( new CraftGump( m_From, m_CraftSystem, m_Tool, 1044165, m_Page ) ); // You haven't made anything yet.
|
||||
|
||||
break;
|
||||
}
|
||||
case 3: // Last 10
|
||||
{
|
||||
if ( context == null )
|
||||
break;
|
||||
|
||||
context.LastGroupIndex = 501;
|
||||
m_From.SendGump( new CraftGump( m_From, system, m_Tool, null ) );
|
||||
|
||||
break;
|
||||
}
|
||||
case 4: // Toggle use resource hue
|
||||
{
|
||||
if ( context == null )
|
||||
break;
|
||||
|
||||
context.DoNotColor = !context.DoNotColor;
|
||||
|
||||
m_From.SendGump( new CraftGump( m_From, m_CraftSystem, m_Tool, null, m_Page ) );
|
||||
|
||||
break;
|
||||
}
|
||||
case 5: // Repair item
|
||||
{
|
||||
if ( system.Repair )
|
||||
Repair.Do( m_From, system, m_Tool );
|
||||
|
||||
break;
|
||||
}
|
||||
case 6: // Toggle mark option
|
||||
{
|
||||
if ( context == null || !system.MarkOption )
|
||||
break;
|
||||
|
||||
switch ( context.MarkOption )
|
||||
{
|
||||
case CraftMarkOption.MarkItem: context.MarkOption = CraftMarkOption.DoNotMark; break;
|
||||
case CraftMarkOption.DoNotMark: context.MarkOption = CraftMarkOption.PromptForMark; break;
|
||||
case CraftMarkOption.PromptForMark: context.MarkOption = CraftMarkOption.MarkItem; break;
|
||||
}
|
||||
|
||||
m_From.SendGump( new CraftGump( m_From, m_CraftSystem, m_Tool, null, m_Page ) );
|
||||
|
||||
break;
|
||||
}
|
||||
case 7: // Resource selection 2
|
||||
{
|
||||
if ( system.CraftSubRes2.Init )
|
||||
m_From.SendGump( new CraftGump( m_From, system, m_Tool, null, CraftPage.PickResource2 ) );
|
||||
|
||||
break;
|
||||
}
|
||||
case 8: // Enhance item
|
||||
{
|
||||
if ( system.CanEnhance )
|
||||
Enhance.BeginTarget( m_From, system, m_Tool );
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
287
Scripts/Engines/Craft/Core/CraftGumpItem.cs
Normal file
287
Scripts/Engines/Craft/Core/CraftGumpItem.cs
Normal file
|
|
@ -0,0 +1,287 @@
|
|||
using System;
|
||||
using Server.Gumps;
|
||||
using Server.Network;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class CraftGumpItem : Gump
|
||||
{
|
||||
private Mobile m_From;
|
||||
private CraftSystem m_CraftSystem;
|
||||
private CraftItem m_CraftItem;
|
||||
private BaseTool m_Tool;
|
||||
|
||||
private const int LabelHue = 0x480; // 0x384
|
||||
private const int RedLabelHue = 0x20;
|
||||
|
||||
private const int LabelColor = 0x7FFF;
|
||||
private const int RedLabelColor = 0x6400;
|
||||
|
||||
private const int GreyLabelColor = 0x3DEF;
|
||||
|
||||
private int m_OtherCount;
|
||||
|
||||
public CraftGumpItem( Mobile from, CraftSystem craftSystem, CraftItem craftItem, BaseTool tool ) : base( 40, 40 )
|
||||
{
|
||||
m_From = from;
|
||||
m_CraftSystem = craftSystem;
|
||||
m_CraftItem = craftItem;
|
||||
m_Tool = tool;
|
||||
|
||||
from.CloseGump( typeof( CraftGump ) );
|
||||
from.CloseGump( typeof( CraftGumpItem ) );
|
||||
|
||||
AddPage( 0 );
|
||||
AddBackground( 0, 0, 530, 417, 5054 );
|
||||
AddImageTiled( 10, 10, 510, 22, 2624 );
|
||||
AddImageTiled( 10, 37, 150, 148, 2624 );
|
||||
AddImageTiled( 165, 37, 355, 90, 2624 );
|
||||
AddImageTiled( 10, 190, 155, 22, 2624 );
|
||||
AddImageTiled( 10, 217, 150, 53, 2624 );
|
||||
AddImageTiled( 165, 132, 355, 80, 2624 );
|
||||
AddImageTiled( 10, 275, 155, 22, 2624 );
|
||||
AddImageTiled( 10, 302, 150, 53, 2624 );
|
||||
AddImageTiled( 165, 217, 355, 80, 2624 );
|
||||
AddImageTiled( 10, 360, 155, 22, 2624 );
|
||||
AddImageTiled( 165, 302, 355, 80, 2624 );
|
||||
AddImageTiled( 10, 387, 510, 22, 2624 );
|
||||
AddAlphaRegion( 10, 10, 510, 399 );
|
||||
|
||||
AddHtmlLocalized( 170, 40, 150, 20, 1044053, LabelColor, false, false ); // ITEM
|
||||
AddHtmlLocalized( 10, 192, 150, 22, 1044054, LabelColor, false, false ); // <CENTER>SKILLS</CENTER>
|
||||
AddHtmlLocalized( 10, 277, 150, 22, 1044055, LabelColor, false, false ); // <CENTER>MATERIALS</CENTER>
|
||||
AddHtmlLocalized( 10, 362, 150, 22, 1044056, LabelColor, false, false ); // <CENTER>OTHER</CENTER>
|
||||
|
||||
if ( craftSystem.GumpTitleNumber > 0 )
|
||||
AddHtmlLocalized( 10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false );
|
||||
else
|
||||
AddHtml( 10, 12, 510, 20, craftSystem.GumpTitleString, false, false );
|
||||
|
||||
AddButton( 15, 387, 4014, 4016, 0, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 50, 390, 150, 18, 1044150, LabelColor, false, false ); // BACK
|
||||
|
||||
bool needsRecipe = ( craftItem.Recipe != null && from is PlayerMobile && !((PlayerMobile)from).HasRecipe( craftItem.Recipe ) );
|
||||
|
||||
if( needsRecipe )
|
||||
{
|
||||
AddButton( 270, 387, 4005, 4007, 0, GumpButtonType.Page, 0 );
|
||||
AddHtmlLocalized( 305, 390, 150, 18, 1044151, GreyLabelColor, false, false ); // MAKE NOW
|
||||
}
|
||||
else
|
||||
{
|
||||
AddButton( 270, 387, 4005, 4007, 1, GumpButtonType.Reply, 0 );
|
||||
AddHtmlLocalized( 305, 390, 150, 18, 1044151, LabelColor, false, false ); // MAKE NOW
|
||||
}
|
||||
|
||||
if ( craftItem.NameNumber > 0 )
|
||||
AddHtmlLocalized( 330, 40, 180, 18, craftItem.NameNumber, LabelColor, false, false );
|
||||
else
|
||||
AddLabel( 330, 40, LabelHue, craftItem.NameString );
|
||||
|
||||
if ( craftItem.UseAllRes )
|
||||
AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1048176, LabelColor, false, false ); // Makes as many as possible at once
|
||||
|
||||
DrawItem();
|
||||
DrawSkill();
|
||||
DrawRessource();
|
||||
|
||||
/*
|
||||
if( craftItem.RequiresSE )
|
||||
AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1063363, LabelColor, false, false ); //* Requires the "Samurai Empire" expansion
|
||||
* */
|
||||
|
||||
if( craftItem.RequiredExpansion != Expansion.None )
|
||||
{
|
||||
bool supportsEx = (from.NetState != null && from.NetState.SupportsExpansion( craftItem.RequiredExpansion ));
|
||||
TextDefinition.AddHtmlText( this, 170, 302 + (m_OtherCount++ * 20), 310, 18, RequiredExpansionMessage( craftItem.RequiredExpansion ), false, false, supportsEx ? LabelColor : RedLabelColor, supportsEx ? LabelHue : RedLabelHue );
|
||||
}
|
||||
|
||||
if( needsRecipe )
|
||||
AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1073620, RedLabelColor, false, false ); // You have not learned this recipe.
|
||||
|
||||
}
|
||||
|
||||
private TextDefinition RequiredExpansionMessage( Expansion expansion )
|
||||
{
|
||||
switch( expansion )
|
||||
{
|
||||
case Expansion.SE:
|
||||
return 1063363; // * Requires the "Samurai Empire" expansion
|
||||
case Expansion.ML:
|
||||
return 1072651; // * Requires the "Mondain's Legacy" expansion
|
||||
default:
|
||||
return String.Format( "* Requires the \"{0}\" expansion", ExpansionInfo.GetInfo( expansion ).Name );
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_ShowExceptionalChance;
|
||||
|
||||
public void DrawItem()
|
||||
{
|
||||
Type type = m_CraftItem.ItemType;
|
||||
|
||||
AddItem( 20, 50, CraftItem.ItemIDOf( type ) );
|
||||
|
||||
if ( m_CraftItem.IsMarkable( type ) )
|
||||
{
|
||||
AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1044059, LabelColor, false, false ); // This item may hold its maker's mark
|
||||
m_ShowExceptionalChance = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void DrawSkill()
|
||||
{
|
||||
for ( int i = 0; i < m_CraftItem.Skills.Count; i++ )
|
||||
{
|
||||
CraftSkill skill = m_CraftItem.Skills.GetAt( i );
|
||||
double minSkill = skill.MinSkill, maxSkill = skill.MaxSkill;
|
||||
|
||||
if ( minSkill < 0 )
|
||||
minSkill = 0;
|
||||
|
||||
AddHtmlLocalized( 170, 132 + (i * 20), 200, 18, 1044060 + (int)skill.SkillToMake, LabelColor, false, false );
|
||||
AddLabel( 430, 132 + (i * 20), LabelHue, String.Format( "{0:F1}", minSkill ) );
|
||||
}
|
||||
|
||||
CraftSubResCol res = ( m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes );
|
||||
int resIndex = -1;
|
||||
|
||||
CraftContext context = m_CraftSystem.GetContext( m_From );
|
||||
|
||||
if ( context != null )
|
||||
resIndex = ( m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex );
|
||||
|
||||
bool allRequiredSkills = true;
|
||||
double chance = m_CraftItem.GetSuccessChance( m_From, resIndex > -1 ? res.GetAt( resIndex ).ItemType : null, m_CraftSystem, false, ref allRequiredSkills );
|
||||
double excepChance = m_CraftItem.GetExceptionalChance( m_CraftSystem, chance, m_From );
|
||||
|
||||
if ( chance < 0.0 )
|
||||
chance = 0.0;
|
||||
else if ( chance > 1.0 )
|
||||
chance = 1.0;
|
||||
|
||||
AddHtmlLocalized( 170, 80, 250, 18, 1044057, LabelColor, false, false ); // Success Chance:
|
||||
AddLabel( 430, 80, LabelHue, String.Format( "{0:F1}%", chance * 100 ) );
|
||||
|
||||
if ( m_ShowExceptionalChance )
|
||||
{
|
||||
if( excepChance < 0.0 )
|
||||
excepChance = 0.0;
|
||||
else if( excepChance > 1.0 )
|
||||
excepChance = 1.0;
|
||||
|
||||
AddHtmlLocalized( 170, 100, 250, 18, 1044058, 32767, false, false ); // Exceptional Chance:
|
||||
AddLabel( 430, 100, LabelHue, String.Format( "{0:F1}%", excepChance * 100 ) );
|
||||
}
|
||||
}
|
||||
|
||||
private static Type typeofBlankScroll = typeof( BlankScroll );
|
||||
private static Type typeofSpellScroll = typeof( SpellScroll );
|
||||
|
||||
public void DrawRessource()
|
||||
{
|
||||
bool retainedColor = false;
|
||||
|
||||
CraftContext context = m_CraftSystem.GetContext( m_From );
|
||||
|
||||
CraftSubResCol res = ( m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes );
|
||||
int resIndex = -1;
|
||||
|
||||
if ( context != null )
|
||||
resIndex = ( m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex );
|
||||
|
||||
bool cropScroll = ( m_CraftItem.Ressources.Count > 1 )
|
||||
&& m_CraftItem.Ressources.GetAt( m_CraftItem.Ressources.Count - 1 ).ItemType == typeofBlankScroll
|
||||
&& typeofSpellScroll.IsAssignableFrom( m_CraftItem.ItemType );
|
||||
|
||||
for ( int i = 0; i < m_CraftItem.Ressources.Count - (cropScroll ? 1 : 0) && i < 4; i++ )
|
||||
{
|
||||
Type type;
|
||||
string nameString;
|
||||
int nameNumber;
|
||||
|
||||
CraftRes craftResource = m_CraftItem.Ressources.GetAt( i );
|
||||
|
||||
type = craftResource.ItemType;
|
||||
nameString = craftResource.NameString;
|
||||
nameNumber = craftResource.NameNumber;
|
||||
|
||||
// Resource Mutation
|
||||
if ( type == res.ResType && resIndex > -1 )
|
||||
{
|
||||
CraftSubRes subResource = res.GetAt( resIndex );
|
||||
|
||||
type = subResource.ItemType;
|
||||
|
||||
nameString = subResource.NameString;
|
||||
nameNumber = subResource.GenericNameNumber;
|
||||
|
||||
if ( nameNumber <= 0 )
|
||||
nameNumber = subResource.NameNumber;
|
||||
}
|
||||
// ******************
|
||||
|
||||
if ( !retainedColor && m_CraftItem.RetainsColorFrom( m_CraftSystem, type ) )
|
||||
{
|
||||
retainedColor = true;
|
||||
AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1044152, LabelColor, false, false ); // * The item retains the color of this material
|
||||
AddLabel( 500, 219 + (i * 20), LabelHue, "*" );
|
||||
}
|
||||
|
||||
if ( nameNumber > 0 )
|
||||
AddHtmlLocalized( 170, 219 + (i * 20), 310, 18, nameNumber, LabelColor, false, false );
|
||||
else
|
||||
AddLabel( 170, 219 + (i * 20), LabelHue, nameString );
|
||||
|
||||
AddLabel( 430, 219 + (i * 20), LabelHue, craftResource.Amount.ToString() );
|
||||
}
|
||||
|
||||
if ( m_CraftItem.NameNumber == 1041267 ) // runebook
|
||||
{
|
||||
AddHtmlLocalized( 170, 219 + (m_CraftItem.Ressources.Count * 20), 310, 18, 1044447, LabelColor, false, false );
|
||||
AddLabel( 430, 219 + (m_CraftItem.Ressources.Count * 20), LabelHue, "1" );
|
||||
}
|
||||
|
||||
if ( cropScroll )
|
||||
AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 360, 18, 1044379, LabelColor, false, false ); // Inscribing scrolls also requires a blank scroll and mana.
|
||||
}
|
||||
|
||||
public override void OnResponse( NetState sender, RelayInfo info )
|
||||
{
|
||||
// Back Button
|
||||
if ( info.ButtonID == 0 )
|
||||
{
|
||||
CraftGump craftGump = new CraftGump( m_From, m_CraftSystem, m_Tool, null );
|
||||
m_From.SendGump( craftGump );
|
||||
}
|
||||
else // Make Button
|
||||
{
|
||||
int num = m_CraftSystem.CanCraft( m_From, m_Tool, m_CraftItem.ItemType );
|
||||
|
||||
if ( num > 0 )
|
||||
{
|
||||
m_From.SendGump( new CraftGump( m_From, m_CraftSystem, m_Tool, num ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
Type type = null;
|
||||
|
||||
CraftContext context = m_CraftSystem.GetContext( m_From );
|
||||
|
||||
if ( context != null )
|
||||
{
|
||||
CraftSubResCol res = ( m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes );
|
||||
int resIndex = ( m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex );
|
||||
|
||||
if ( resIndex > -1 )
|
||||
type = res.GetAt( resIndex ).ItemType;
|
||||
}
|
||||
|
||||
m_CraftSystem.CreateItem( m_From, m_CraftItem.ItemType, type, m_Tool, m_CraftItem );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1309
Scripts/Engines/Craft/Core/CraftItem.cs
Normal file
1309
Scripts/Engines/Craft/Core/CraftItem.cs
Normal file
File diff suppressed because it is too large
Load diff
58
Scripts/Engines/Craft/Core/CraftItemCol.cs
Normal file
58
Scripts/Engines/Craft/Core/CraftItemCol.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class CraftItemCol : System.Collections.CollectionBase
|
||||
{
|
||||
public CraftItemCol()
|
||||
{
|
||||
}
|
||||
|
||||
public int Add( CraftItem craftItem )
|
||||
{
|
||||
return List.Add( craftItem );
|
||||
}
|
||||
|
||||
public void Remove( int index )
|
||||
{
|
||||
if ( index > Count - 1 || index < 0 )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
List.RemoveAt( index );
|
||||
}
|
||||
}
|
||||
|
||||
public CraftItem GetAt( int index )
|
||||
{
|
||||
return ( CraftItem ) List[index];
|
||||
}
|
||||
|
||||
public CraftItem SearchForSubclass( Type type )
|
||||
{
|
||||
for ( int i = 0; i < List.Count; i++ )
|
||||
{
|
||||
CraftItem craftItem = ( CraftItem )List[i];
|
||||
|
||||
if ( craftItem.ItemType == type || type.IsSubclassOf( craftItem.ItemType ) )
|
||||
return craftItem;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public CraftItem SearchFor( Type type )
|
||||
{
|
||||
for ( int i = 0; i < List.Count; i++ )
|
||||
{
|
||||
CraftItem craftItem = ( CraftItem )List[i];
|
||||
if ( craftItem.ItemType == type )
|
||||
{
|
||||
return craftItem;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Scripts/Engines/Craft/Core/CraftItemIDAttribute.cs
Normal file
18
Scripts/Engines/Craft/Core/CraftItemIDAttribute.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using Server;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
[AttributeUsage( AttributeTargets.Class )]
|
||||
public class CraftItemIDAttribute : Attribute
|
||||
{
|
||||
private int m_ItemID;
|
||||
|
||||
public int ItemID{ get{ return m_ItemID; } }
|
||||
|
||||
public CraftItemIDAttribute( int itemID )
|
||||
{
|
||||
m_ItemID = itemID;
|
||||
}
|
||||
}
|
||||
}
|
||||
71
Scripts/Engines/Craft/Core/CraftRes.cs
Normal file
71
Scripts/Engines/Craft/Core/CraftRes.cs
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class CraftRes
|
||||
{
|
||||
private Type m_Type;
|
||||
private int m_Amount;
|
||||
|
||||
private string m_MessageString;
|
||||
private int m_MessageNumber;
|
||||
|
||||
private string m_NameString;
|
||||
private int m_NameNumber;
|
||||
|
||||
public CraftRes( Type type, int amount )
|
||||
{
|
||||
m_Type = type;
|
||||
m_Amount = amount;
|
||||
}
|
||||
|
||||
public CraftRes( Type type, TextDefinition name, int amount, TextDefinition message ): this ( type, amount )
|
||||
{
|
||||
m_NameNumber = name;
|
||||
m_MessageNumber = message;
|
||||
|
||||
m_NameString = name;
|
||||
m_MessageString = message;
|
||||
}
|
||||
|
||||
public void SendMessage( Mobile from )
|
||||
{
|
||||
if ( m_MessageNumber > 0 )
|
||||
from.SendLocalizedMessage( m_MessageNumber );
|
||||
else if ( m_MessageString != null && m_MessageString != String.Empty )
|
||||
from.SendMessage( m_MessageString );
|
||||
else
|
||||
from.SendLocalizedMessage( 502925 ); // You don't have the resources required to make that item.
|
||||
}
|
||||
|
||||
public Type ItemType
|
||||
{
|
||||
get { return m_Type; }
|
||||
}
|
||||
|
||||
public string MessageString
|
||||
{
|
||||
get { return m_MessageString; }
|
||||
}
|
||||
|
||||
public int MessageNumber
|
||||
{
|
||||
get { return m_MessageNumber; }
|
||||
}
|
||||
|
||||
public string NameString
|
||||
{
|
||||
get { return m_NameString; }
|
||||
}
|
||||
|
||||
public int NameNumber
|
||||
{
|
||||
get { return m_NameNumber; }
|
||||
}
|
||||
|
||||
public int Amount
|
||||
{
|
||||
get { return m_Amount; }
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Scripts/Engines/Craft/Core/CraftResCol.cs
Normal file
32
Scripts/Engines/Craft/Core/CraftResCol.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class CraftResCol : System.Collections.CollectionBase
|
||||
{
|
||||
public CraftResCol()
|
||||
{
|
||||
}
|
||||
|
||||
public void Add( CraftRes craftRes )
|
||||
{
|
||||
List.Add( craftRes );
|
||||
}
|
||||
|
||||
public void Remove( int index )
|
||||
{
|
||||
if ( index > Count - 1 || index < 0 )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
List.RemoveAt( index );
|
||||
}
|
||||
}
|
||||
|
||||
public CraftRes GetAt( int index )
|
||||
{
|
||||
return ( CraftRes ) List[index];
|
||||
}
|
||||
}
|
||||
}
|
||||
33
Scripts/Engines/Craft/Core/CraftSkill.cs
Normal file
33
Scripts/Engines/Craft/Core/CraftSkill.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class CraftSkill
|
||||
{
|
||||
private SkillName m_SkillToMake;
|
||||
private double m_MinSkill;
|
||||
private double m_MaxSkill;
|
||||
|
||||
public CraftSkill( SkillName skillToMake, double minSkill, double maxSkill )
|
||||
{
|
||||
m_SkillToMake = skillToMake;
|
||||
m_MinSkill = minSkill;
|
||||
m_MaxSkill = maxSkill;
|
||||
}
|
||||
|
||||
public SkillName SkillToMake
|
||||
{
|
||||
get { return m_SkillToMake; }
|
||||
}
|
||||
|
||||
public double MinSkill
|
||||
{
|
||||
get { return m_MinSkill; }
|
||||
}
|
||||
|
||||
public double MaxSkill
|
||||
{
|
||||
get { return m_MaxSkill; }
|
||||
}
|
||||
}
|
||||
}
|
||||
32
Scripts/Engines/Craft/Core/CraftSkillCol.cs
Normal file
32
Scripts/Engines/Craft/Core/CraftSkillCol.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class CraftSkillCol : System.Collections.CollectionBase
|
||||
{
|
||||
public CraftSkillCol()
|
||||
{
|
||||
}
|
||||
|
||||
public void Add( CraftSkill craftSkill )
|
||||
{
|
||||
List.Add( craftSkill );
|
||||
}
|
||||
|
||||
public void Remove( int index )
|
||||
{
|
||||
if ( index > Count - 1 || index < 0 )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
List.RemoveAt( index );
|
||||
}
|
||||
}
|
||||
|
||||
public CraftSkill GetAt( int index )
|
||||
{
|
||||
return ( CraftSkill ) List[index];
|
||||
}
|
||||
}
|
||||
}
|
||||
58
Scripts/Engines/Craft/Core/CraftSubRes.cs
Normal file
58
Scripts/Engines/Craft/Core/CraftSubRes.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class CraftSubRes
|
||||
{
|
||||
private Type m_Type;
|
||||
private double m_ReqSkill;
|
||||
private string m_NameString;
|
||||
private int m_NameNumber;
|
||||
private int m_GenericNameNumber;
|
||||
private object m_Message;
|
||||
|
||||
public CraftSubRes( Type type, TextDefinition name, double reqSkill, object message ) : this( type, name, reqSkill, 0, message )
|
||||
{
|
||||
}
|
||||
|
||||
public CraftSubRes( Type type, TextDefinition name, double reqSkill, int genericNameNumber, object message )
|
||||
{
|
||||
m_Type = type;
|
||||
m_NameNumber = name;
|
||||
m_NameString = name;
|
||||
m_ReqSkill = reqSkill;
|
||||
m_GenericNameNumber = genericNameNumber;
|
||||
m_Message = message;
|
||||
}
|
||||
|
||||
public Type ItemType
|
||||
{
|
||||
get { return m_Type; }
|
||||
}
|
||||
|
||||
public string NameString
|
||||
{
|
||||
get { return m_NameString; }
|
||||
}
|
||||
|
||||
public int NameNumber
|
||||
{
|
||||
get { return m_NameNumber; }
|
||||
}
|
||||
|
||||
public int GenericNameNumber
|
||||
{
|
||||
get { return m_GenericNameNumber; }
|
||||
}
|
||||
|
||||
public object Message
|
||||
{
|
||||
get { return m_Message; }
|
||||
}
|
||||
|
||||
public double RequiredSkill
|
||||
{
|
||||
get { return m_ReqSkill; }
|
||||
}
|
||||
}
|
||||
}
|
||||
75
Scripts/Engines/Craft/Core/CraftSubResCol.cs
Normal file
75
Scripts/Engines/Craft/Core/CraftSubResCol.cs
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class CraftSubResCol : System.Collections.CollectionBase
|
||||
{
|
||||
private Type m_Type;
|
||||
private string m_NameString;
|
||||
private int m_NameNumber;
|
||||
private bool m_Init;
|
||||
|
||||
public bool Init
|
||||
{
|
||||
get { return m_Init; }
|
||||
set { m_Init = value; }
|
||||
}
|
||||
|
||||
public Type ResType
|
||||
{
|
||||
get { return m_Type; }
|
||||
set { m_Type = value; }
|
||||
}
|
||||
|
||||
public string NameString
|
||||
{
|
||||
get { return m_NameString; }
|
||||
set { m_NameString = value; }
|
||||
}
|
||||
|
||||
public int NameNumber
|
||||
{
|
||||
get { return m_NameNumber; }
|
||||
set { m_NameNumber = value; }
|
||||
}
|
||||
|
||||
public CraftSubResCol()
|
||||
{
|
||||
m_Init = false;
|
||||
}
|
||||
|
||||
public void Add( CraftSubRes craftSubRes )
|
||||
{
|
||||
List.Add( craftSubRes );
|
||||
}
|
||||
|
||||
public void Remove( int index )
|
||||
{
|
||||
if ( index > Count - 1 || index < 0 )
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
List.RemoveAt( index );
|
||||
}
|
||||
}
|
||||
|
||||
public CraftSubRes GetAt( int index )
|
||||
{
|
||||
return ( CraftSubRes ) List[index];
|
||||
}
|
||||
|
||||
public CraftSubRes SearchFor( Type type )
|
||||
{
|
||||
for ( int i = 0; i < List.Count; i++ )
|
||||
{
|
||||
CraftSubRes craftSubRes = ( CraftSubRes )List[i];
|
||||
if ( craftSubRes.ItemType == type )
|
||||
{
|
||||
return craftSubRes;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
337
Scripts/Engines/Craft/Core/CraftSystem.cs
Normal file
337
Scripts/Engines/Craft/Core/CraftSystem.cs
Normal file
|
|
@ -0,0 +1,337 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public enum CraftECA
|
||||
{
|
||||
ChanceMinusSixty,
|
||||
FiftyPercentChanceMinusTenPercent,
|
||||
ChanceMinusSixtyToFourtyFive
|
||||
}
|
||||
|
||||
public abstract class CraftSystem
|
||||
{
|
||||
private int m_MinCraftEffect;
|
||||
private int m_MaxCraftEffect;
|
||||
private double m_Delay;
|
||||
private bool m_Resmelt;
|
||||
private bool m_Repair;
|
||||
private bool m_MarkOption;
|
||||
private bool m_CanEnhance;
|
||||
|
||||
private CraftItemCol m_CraftItems;
|
||||
private CraftGroupCol m_CraftGroups;
|
||||
private CraftSubResCol m_CraftSubRes;
|
||||
private CraftSubResCol m_CraftSubRes2;
|
||||
|
||||
public int MinCraftEffect { get { return m_MinCraftEffect; } }
|
||||
public int MaxCraftEffect { get { return m_MaxCraftEffect; } }
|
||||
public double Delay { get { return m_Delay; } }
|
||||
|
||||
public CraftItemCol CraftItems{ get { return m_CraftItems; } }
|
||||
public CraftGroupCol CraftGroups{ get { return m_CraftGroups; } }
|
||||
public CraftSubResCol CraftSubRes{ get { return m_CraftSubRes; } }
|
||||
public CraftSubResCol CraftSubRes2{ get { return m_CraftSubRes2; } }
|
||||
|
||||
public abstract SkillName MainSkill{ get; }
|
||||
|
||||
public virtual int GumpTitleNumber{ get{ return 0; } }
|
||||
public virtual string GumpTitleString{ get{ return ""; } }
|
||||
|
||||
public virtual CraftECA ECA{ get{ return CraftECA.ChanceMinusSixty; } }
|
||||
|
||||
private Hashtable m_ContextTable = new Hashtable();
|
||||
|
||||
public abstract double GetChanceAtMin( CraftItem item );
|
||||
|
||||
public virtual bool RetainsColorFrom( CraftItem item, Type type )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public CraftContext GetContext( Mobile m )
|
||||
{
|
||||
if ( m == null )
|
||||
return null;
|
||||
|
||||
if ( m.Deleted )
|
||||
{
|
||||
m_ContextTable.Remove( m );
|
||||
return null;
|
||||
}
|
||||
|
||||
CraftContext c = (CraftContext)m_ContextTable[m];
|
||||
|
||||
if ( c == null )
|
||||
m_ContextTable[m] = c = new CraftContext();
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
public void OnMade( Mobile m, CraftItem item )
|
||||
{
|
||||
CraftContext c = GetContext( m );
|
||||
|
||||
if ( c != null )
|
||||
c.OnMade( item );
|
||||
}
|
||||
|
||||
public bool Resmelt
|
||||
{
|
||||
get { return m_Resmelt; }
|
||||
set { m_Resmelt = value; }
|
||||
}
|
||||
|
||||
public bool Repair
|
||||
{
|
||||
get{ return m_Repair; }
|
||||
set{ m_Repair = value; }
|
||||
}
|
||||
|
||||
public bool MarkOption
|
||||
{
|
||||
get{ return m_MarkOption; }
|
||||
set{ m_MarkOption = value; }
|
||||
}
|
||||
|
||||
public bool CanEnhance
|
||||
{
|
||||
get{ return m_CanEnhance; }
|
||||
set{ m_CanEnhance = value; }
|
||||
}
|
||||
|
||||
public CraftSystem( int minCraftEffect, int maxCraftEffect, double delay )
|
||||
{
|
||||
m_MinCraftEffect = minCraftEffect;
|
||||
m_MaxCraftEffect = maxCraftEffect;
|
||||
m_Delay = delay;
|
||||
|
||||
m_CraftItems = new CraftItemCol();
|
||||
m_CraftGroups = new CraftGroupCol();
|
||||
m_CraftSubRes = new CraftSubResCol();
|
||||
m_CraftSubRes2 = new CraftSubResCol();
|
||||
|
||||
InitCraftList();
|
||||
}
|
||||
|
||||
public virtual bool ConsumeOnFailure( Mobile from, Type resourceType, CraftItem craftItem )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void CreateItem( Mobile from, Type type, Type typeRes, BaseTool tool, CraftItem realCraftItem )
|
||||
{
|
||||
// Verify if the type is in the list of the craftable item
|
||||
CraftItem craftItem = m_CraftItems.SearchFor( type );
|
||||
if ( craftItem != null )
|
||||
{
|
||||
// The item is in the list, try to create it
|
||||
// Test code: items like sextant parts can be crafted either directly from ingots, or from different parts
|
||||
realCraftItem.Craft( from, this, typeRes, tool );
|
||||
//craftItem.Craft( from, this, typeRes, tool );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int AddCraft( Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount )
|
||||
{
|
||||
return AddCraft( typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, "" );
|
||||
}
|
||||
|
||||
public int AddCraft( Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount, TextDefinition message )
|
||||
{
|
||||
return AddCraft( typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, message );
|
||||
}
|
||||
|
||||
public int AddCraft( Type typeItem, TextDefinition group, TextDefinition name, SkillName skillToMake, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount )
|
||||
{
|
||||
return AddCraft( typeItem, group, name, skillToMake, minSkill, maxSkill, typeRes, nameRes, amount, "" );
|
||||
}
|
||||
|
||||
public int AddCraft( Type typeItem, TextDefinition group, TextDefinition name, SkillName skillToMake, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount, TextDefinition message )
|
||||
{
|
||||
CraftItem craftItem = new CraftItem( typeItem, group, name );
|
||||
craftItem.AddRes( typeRes, nameRes, amount, message );
|
||||
craftItem.AddSkill( skillToMake, minSkill, maxSkill );
|
||||
|
||||
DoGroup( group, craftItem );
|
||||
return m_CraftItems.Add( craftItem );
|
||||
}
|
||||
|
||||
|
||||
private void DoGroup( TextDefinition groupName, CraftItem craftItem )
|
||||
{
|
||||
int index = m_CraftGroups.SearchFor( groupName );
|
||||
|
||||
if ( index == -1)
|
||||
{
|
||||
CraftGroup craftGroup = new CraftGroup( groupName );
|
||||
craftGroup.AddCraftItem( craftItem );
|
||||
m_CraftGroups.Add( craftGroup );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_CraftGroups.GetAt( index ).AddCraftItem( craftItem );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetManaReq( int index, int mana )
|
||||
{
|
||||
CraftItem craftItem = m_CraftItems.GetAt( index );
|
||||
craftItem.Mana = mana;
|
||||
}
|
||||
|
||||
public void SetStamReq( int index, int stam )
|
||||
{
|
||||
CraftItem craftItem = m_CraftItems.GetAt( index );
|
||||
craftItem.Stam = stam;
|
||||
}
|
||||
|
||||
public void SetHitsReq( int index, int hits )
|
||||
{
|
||||
CraftItem craftItem = m_CraftItems.GetAt( index );
|
||||
craftItem.Hits = hits;
|
||||
}
|
||||
|
||||
public void SetUseAllRes( int index, bool useAll )
|
||||
{
|
||||
CraftItem craftItem = m_CraftItems.GetAt( index );
|
||||
craftItem.UseAllRes = useAll;
|
||||
}
|
||||
|
||||
public void SetNeedHeat( int index, bool needHeat )
|
||||
{
|
||||
CraftItem craftItem = m_CraftItems.GetAt( index );
|
||||
craftItem.NeedHeat = needHeat;
|
||||
}
|
||||
|
||||
public void SetNeedOven( int index, bool needOven )
|
||||
{
|
||||
CraftItem craftItem = m_CraftItems.GetAt( index );
|
||||
craftItem.NeedOven = needOven;
|
||||
}
|
||||
|
||||
public void SetNeedMill( int index, bool needMill )
|
||||
{
|
||||
CraftItem craftItem = m_CraftItems.GetAt( index );
|
||||
craftItem.NeedMill = needMill;
|
||||
}
|
||||
|
||||
public void SetNeededExpansion( int index, Expansion expansion )
|
||||
{
|
||||
CraftItem craftItem = m_CraftItems.GetAt( index );
|
||||
craftItem.RequiredExpansion = expansion;
|
||||
}
|
||||
|
||||
public void AddRes( int index, Type type, TextDefinition name, int amount )
|
||||
{
|
||||
AddRes( index, type, name, amount, "" );
|
||||
}
|
||||
|
||||
public void AddRes( int index, Type type, TextDefinition name, int amount, TextDefinition message )
|
||||
{
|
||||
CraftItem craftItem = m_CraftItems.GetAt( index );
|
||||
craftItem.AddRes( type, name, amount, message );
|
||||
}
|
||||
|
||||
public void AddSkill( int index, SkillName skillToMake, double minSkill, double maxSkill )
|
||||
{
|
||||
CraftItem craftItem = m_CraftItems.GetAt(index);
|
||||
craftItem.AddSkill(skillToMake, minSkill, maxSkill);
|
||||
}
|
||||
|
||||
public void SetUseSubRes2( int index, bool val )
|
||||
{
|
||||
CraftItem craftItem = m_CraftItems.GetAt(index);
|
||||
craftItem.UseSubRes2 = val;
|
||||
}
|
||||
|
||||
public void AddRecipe( int index, int id )
|
||||
{
|
||||
CraftItem craftItem = m_CraftItems.GetAt( index );
|
||||
craftItem.AddRecipe( id, this );
|
||||
}
|
||||
|
||||
public void ForceNonExceptional( int index )
|
||||
{
|
||||
CraftItem craftItem = m_CraftItems.GetAt( index );
|
||||
craftItem.ForceNonExceptional = true;
|
||||
}
|
||||
|
||||
|
||||
public void SetSubRes( Type type, string name )
|
||||
{
|
||||
m_CraftSubRes.ResType = type;
|
||||
m_CraftSubRes.NameString = name;
|
||||
m_CraftSubRes.Init = true;
|
||||
}
|
||||
|
||||
public void SetSubRes( Type type, int name )
|
||||
{
|
||||
m_CraftSubRes.ResType = type;
|
||||
m_CraftSubRes.NameNumber = name;
|
||||
m_CraftSubRes.Init = true;
|
||||
}
|
||||
|
||||
public void AddSubRes( Type type, int name, double reqSkill, object message )
|
||||
{
|
||||
CraftSubRes craftSubRes = new CraftSubRes( type, name, reqSkill, message );
|
||||
m_CraftSubRes.Add( craftSubRes );
|
||||
}
|
||||
|
||||
public void AddSubRes( Type type, int name, double reqSkill, int genericName, object message )
|
||||
{
|
||||
CraftSubRes craftSubRes = new CraftSubRes( type, name, reqSkill, genericName, message );
|
||||
m_CraftSubRes.Add( craftSubRes );
|
||||
}
|
||||
|
||||
public void AddSubRes( Type type, string name, double reqSkill, object message )
|
||||
{
|
||||
CraftSubRes craftSubRes = new CraftSubRes( type, name, reqSkill, message );
|
||||
m_CraftSubRes.Add( craftSubRes );
|
||||
}
|
||||
|
||||
|
||||
public void SetSubRes2( Type type, string name )
|
||||
{
|
||||
m_CraftSubRes2.ResType = type;
|
||||
m_CraftSubRes2.NameString = name;
|
||||
m_CraftSubRes2.Init = true;
|
||||
}
|
||||
|
||||
public void SetSubRes2( Type type, int name )
|
||||
{
|
||||
m_CraftSubRes2.ResType = type;
|
||||
m_CraftSubRes2.NameNumber = name;
|
||||
m_CraftSubRes2.Init = true;
|
||||
}
|
||||
|
||||
public void AddSubRes2( Type type, int name, double reqSkill, object message )
|
||||
{
|
||||
CraftSubRes craftSubRes = new CraftSubRes( type, name, reqSkill, message );
|
||||
m_CraftSubRes2.Add( craftSubRes );
|
||||
}
|
||||
|
||||
public void AddSubRes2( Type type, int name, double reqSkill, int genericName, object message )
|
||||
{
|
||||
CraftSubRes craftSubRes = new CraftSubRes( type, name, reqSkill, genericName, message );
|
||||
m_CraftSubRes2.Add( craftSubRes );
|
||||
}
|
||||
|
||||
public void AddSubRes2( Type type, string name, double reqSkill, object message )
|
||||
{
|
||||
CraftSubRes craftSubRes = new CraftSubRes( type, name, reqSkill, message );
|
||||
m_CraftSubRes2.Add( craftSubRes );
|
||||
}
|
||||
|
||||
public abstract void InitCraftList();
|
||||
|
||||
public abstract void PlayCraftEffect( Mobile from );
|
||||
public abstract int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item );
|
||||
|
||||
public abstract int CanCraft( Mobile from, BaseTool tool, Type itemType );
|
||||
}
|
||||
}
|
||||
36
Scripts/Engines/Craft/Core/CustomCraft.cs
Normal file
36
Scripts/Engines/Craft/Core/CustomCraft.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public abstract class CustomCraft
|
||||
{
|
||||
private Mobile m_From;
|
||||
private CraftItem m_CraftItem;
|
||||
private CraftSystem m_CraftSystem;
|
||||
private Type m_TypeRes;
|
||||
private BaseTool m_Tool;
|
||||
private int m_Quality;
|
||||
|
||||
public Mobile From{ get{ return m_From; } }
|
||||
public CraftItem CraftItem{ get{ return m_CraftItem; } }
|
||||
public CraftSystem CraftSystem{ get{ return m_CraftSystem; } }
|
||||
public Type TypeRes{ get{ return m_TypeRes; } }
|
||||
public BaseTool Tool{ get{ return m_Tool; } }
|
||||
public int Quality{ get{ return m_Quality; } }
|
||||
|
||||
public CustomCraft( Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool, int quality )
|
||||
{
|
||||
m_From = from;
|
||||
m_CraftItem = craftItem;
|
||||
m_CraftSystem = craftSystem;
|
||||
m_TypeRes = typeRes;
|
||||
m_Tool = tool;
|
||||
m_Quality = quality;
|
||||
}
|
||||
|
||||
public abstract void EndCraftAction();
|
||||
public abstract Item CompleteCraft( out int message );
|
||||
}
|
||||
}
|
||||
313
Scripts/Engines/Craft/Core/Enhance.cs
Normal file
313
Scripts/Engines/Craft/Core/Enhance.cs
Normal file
|
|
@ -0,0 +1,313 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public enum EnhanceResult
|
||||
{
|
||||
NotInBackpack,
|
||||
BadItem,
|
||||
BadResource,
|
||||
AlreadyEnhanced,
|
||||
Success,
|
||||
Failure,
|
||||
Broken,
|
||||
NoResources,
|
||||
NoSkill
|
||||
}
|
||||
|
||||
public class Enhance
|
||||
{
|
||||
public static EnhanceResult Invoke( Mobile from, CraftSystem craftSystem, BaseTool tool, Item item, CraftResource resource, Type resType, ref object resMessage )
|
||||
{
|
||||
if ( item == null )
|
||||
return EnhanceResult.BadItem;
|
||||
|
||||
if ( !item.IsChildOf( from.Backpack ) )
|
||||
return EnhanceResult.NotInBackpack;
|
||||
|
||||
if ( !(item is BaseArmor) && !(item is BaseWeapon) )
|
||||
return EnhanceResult.BadItem;
|
||||
|
||||
if ( CraftResources.IsStandard( resource ) )
|
||||
return EnhanceResult.BadResource;
|
||||
|
||||
CraftItem craftItem = craftSystem.CraftItems.SearchFor( item.GetType() );
|
||||
|
||||
if ( craftItem == null || craftItem.Ressources.Count == 0 )
|
||||
return EnhanceResult.BadItem;
|
||||
|
||||
int quality = 0;
|
||||
bool allRequiredSkills = false;
|
||||
|
||||
if ( !craftItem.CheckSkills( from, resType, craftSystem, ref quality, ref allRequiredSkills, false ) )
|
||||
return EnhanceResult.NoSkill;
|
||||
|
||||
CraftResourceInfo info = CraftResources.GetInfo( resource );
|
||||
|
||||
if ( info == null || info.ResourceTypes.Length == 0 )
|
||||
return EnhanceResult.BadResource;
|
||||
|
||||
CraftAttributeInfo attributes = info.AttributeInfo;
|
||||
|
||||
if ( attributes == null )
|
||||
return EnhanceResult.BadResource;
|
||||
|
||||
int resHue = 0, maxAmount = 0;
|
||||
|
||||
if ( !craftItem.ConsumeRes( from, resType, craftSystem, ref resHue, ref maxAmount, ConsumeType.None, ref resMessage ) )
|
||||
return EnhanceResult.NoResources;
|
||||
|
||||
if ( craftSystem is DefBlacksmithy )
|
||||
{
|
||||
AncientSmithyHammer hammer = from.FindItemOnLayer( Layer.OneHanded ) as AncientSmithyHammer;
|
||||
if ( hammer != null )
|
||||
{
|
||||
hammer.UsesRemaining--;
|
||||
if ( hammer.UsesRemaining < 1 )
|
||||
hammer.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
int phys = 0, fire = 0, cold = 0, pois = 0, nrgy = 0;
|
||||
int dura = 0, luck = 0, lreq = 0, dinc = 0;
|
||||
int baseChance = 0;
|
||||
|
||||
bool physBonus = false;
|
||||
bool fireBonus = false;
|
||||
bool coldBonus = false;
|
||||
bool nrgyBonus = false;
|
||||
bool poisBonus = false;
|
||||
bool duraBonus = false;
|
||||
bool luckBonus = false;
|
||||
bool lreqBonus = false;
|
||||
bool dincBonus = false;
|
||||
|
||||
if ( item is BaseWeapon )
|
||||
{
|
||||
BaseWeapon weapon = (BaseWeapon)item;
|
||||
|
||||
if ( !CraftResources.IsStandard( weapon.Resource ) )
|
||||
return EnhanceResult.AlreadyEnhanced;
|
||||
|
||||
baseChance = 20;
|
||||
|
||||
dura = weapon.MaxHitPoints;
|
||||
luck = weapon.Attributes.Luck;
|
||||
lreq = weapon.WeaponAttributes.LowerStatReq;
|
||||
dinc = weapon.Attributes.WeaponDamage;
|
||||
|
||||
fireBonus = ( attributes.WeaponFireDamage > 0 );
|
||||
coldBonus = ( attributes.WeaponColdDamage > 0 );
|
||||
nrgyBonus = ( attributes.WeaponEnergyDamage > 0 );
|
||||
poisBonus = ( attributes.WeaponPoisonDamage > 0 );
|
||||
|
||||
duraBonus = ( attributes.WeaponDurability > 0 );
|
||||
luckBonus = ( attributes.WeaponLuck > 0 );
|
||||
lreqBonus = ( attributes.WeaponLowerRequirements > 0 );
|
||||
dincBonus = ( dinc > 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseArmor armor = (BaseArmor)item;
|
||||
|
||||
if ( !CraftResources.IsStandard( armor.Resource ) )
|
||||
return EnhanceResult.AlreadyEnhanced;
|
||||
|
||||
baseChance = 20;
|
||||
|
||||
phys = armor.PhysicalResistance;
|
||||
fire = armor.FireResistance;
|
||||
cold = armor.ColdResistance;
|
||||
pois = armor.PoisonResistance;
|
||||
nrgy = armor.EnergyResistance;
|
||||
|
||||
dura = armor.MaxHitPoints;
|
||||
luck = armor.Attributes.Luck;
|
||||
lreq = armor.ArmorAttributes.LowerStatReq;
|
||||
|
||||
physBonus = ( attributes.ArmorPhysicalResist > 0 );
|
||||
fireBonus = ( attributes.ArmorFireResist > 0 );
|
||||
coldBonus = ( attributes.ArmorColdResist > 0 );
|
||||
nrgyBonus = ( attributes.ArmorEnergyResist > 0 );
|
||||
poisBonus = ( attributes.ArmorPoisonResist > 0 );
|
||||
|
||||
duraBonus = ( attributes.ArmorDurability > 0 );
|
||||
luckBonus = ( attributes.ArmorLuck > 0 );
|
||||
lreqBonus = ( attributes.ArmorLowerRequirements > 0 );
|
||||
dincBonus = false;
|
||||
}
|
||||
|
||||
int skill = from.Skills[craftSystem.MainSkill].Fixed / 10;
|
||||
|
||||
if ( skill >= 100 )
|
||||
baseChance -= (skill - 90) / 10;
|
||||
|
||||
EnhanceResult res = EnhanceResult.Success;
|
||||
|
||||
if ( physBonus )
|
||||
CheckResult( ref res, baseChance + phys );
|
||||
|
||||
if ( fireBonus )
|
||||
CheckResult( ref res, baseChance + fire );
|
||||
|
||||
if ( coldBonus )
|
||||
CheckResult( ref res, baseChance + cold );
|
||||
|
||||
if ( nrgyBonus )
|
||||
CheckResult( ref res, baseChance + nrgy );
|
||||
|
||||
if ( poisBonus )
|
||||
CheckResult( ref res, baseChance + pois );
|
||||
|
||||
if ( duraBonus )
|
||||
CheckResult( ref res, baseChance + (dura / 40) );
|
||||
|
||||
if ( luckBonus )
|
||||
CheckResult( ref res, baseChance + 10 + (luck / 2) );
|
||||
|
||||
if ( lreqBonus )
|
||||
CheckResult( ref res, baseChance + (lreq / 4) );
|
||||
|
||||
if ( dincBonus )
|
||||
CheckResult( ref res, baseChance + (dinc / 4) );
|
||||
|
||||
switch ( res )
|
||||
{
|
||||
case EnhanceResult.Broken:
|
||||
{
|
||||
if ( !craftItem.ConsumeRes( from, resType, craftSystem, ref resHue, ref maxAmount, ConsumeType.Half, ref resMessage ) )
|
||||
return EnhanceResult.NoResources;
|
||||
|
||||
item.Delete();
|
||||
break;
|
||||
}
|
||||
case EnhanceResult.Success:
|
||||
{
|
||||
if ( !craftItem.ConsumeRes( from, resType, craftSystem, ref resHue, ref maxAmount, ConsumeType.All, ref resMessage ) )
|
||||
return EnhanceResult.NoResources;
|
||||
|
||||
if( item is BaseWeapon )
|
||||
{
|
||||
BaseWeapon w = (BaseWeapon)item;
|
||||
|
||||
w.Resource = resource;
|
||||
|
||||
int hue = w.GetElementalDamageHue();
|
||||
if( hue > 0 )
|
||||
w.Hue = hue;
|
||||
}
|
||||
else if( item is BaseArmor ) //Sanity
|
||||
{
|
||||
((BaseArmor)item).Resource = resource;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case EnhanceResult.Failure:
|
||||
{
|
||||
if ( !craftItem.ConsumeRes( from, resType, craftSystem, ref resHue, ref maxAmount, ConsumeType.Half, ref resMessage ) )
|
||||
return EnhanceResult.NoResources;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public static void CheckResult( ref EnhanceResult res, int chance )
|
||||
{
|
||||
if ( res != EnhanceResult.Success )
|
||||
return; // we've already failed..
|
||||
|
||||
int random = Utility.Random( 100 );
|
||||
|
||||
if ( 10 > random )
|
||||
res = EnhanceResult.Failure;
|
||||
else if ( chance > random )
|
||||
res = EnhanceResult.Broken;
|
||||
}
|
||||
|
||||
public static void BeginTarget( Mobile from, CraftSystem craftSystem, BaseTool tool )
|
||||
{
|
||||
CraftContext context = craftSystem.GetContext( from );
|
||||
|
||||
if ( context == null )
|
||||
return;
|
||||
|
||||
int lastRes = context.LastResourceIndex;
|
||||
CraftSubResCol subRes = craftSystem.CraftSubRes;
|
||||
|
||||
if ( lastRes >= 0 && lastRes < subRes.Count )
|
||||
{
|
||||
CraftSubRes res = subRes.GetAt( lastRes );
|
||||
|
||||
if ( from.Skills[craftSystem.MainSkill].Value < res.RequiredSkill )
|
||||
{
|
||||
from.SendGump( new CraftGump( from, craftSystem, tool, res.Message ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
CraftResource resource = CraftResources.GetFromType( res.ItemType );
|
||||
|
||||
if ( resource != CraftResource.None )
|
||||
{
|
||||
from.Target = new InternalTarget( craftSystem, tool, res.ItemType, resource );
|
||||
from.SendLocalizedMessage( 1061004 ); // Target an item to enhance with the properties of your selected material.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendGump( new CraftGump( from, craftSystem, tool, 1061010 ) ); // You must select a special material in order to enhance an item with its properties.
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendGump( new CraftGump( from, craftSystem, tool, 1061010 ) ); // You must select a special material in order to enhance an item with its properties.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private CraftSystem m_CraftSystem;
|
||||
private BaseTool m_Tool;
|
||||
private Type m_ResourceType;
|
||||
private CraftResource m_Resource;
|
||||
|
||||
public InternalTarget( CraftSystem craftSystem, BaseTool tool, Type resourceType, CraftResource resource ) : base ( 2, false, TargetFlags.None )
|
||||
{
|
||||
m_CraftSystem = craftSystem;
|
||||
m_Tool = tool;
|
||||
m_ResourceType = resourceType;
|
||||
m_Resource = resource;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( targeted is Item )
|
||||
{
|
||||
object message = null;
|
||||
EnhanceResult res = Enhance.Invoke( from, m_CraftSystem, m_Tool, (Item)targeted, m_Resource, m_ResourceType, ref message );
|
||||
|
||||
switch ( res )
|
||||
{
|
||||
case EnhanceResult.NotInBackpack: message = 1061005; break; // The item must be in your backpack to enhance it.
|
||||
case EnhanceResult.AlreadyEnhanced: message = 1061012; break; // This item is already enhanced with the properties of a special material.
|
||||
case EnhanceResult.BadItem: message = 1061011; break; // You cannot enhance this type of item with the properties of the selected special material.
|
||||
case EnhanceResult.BadResource: message = 1061010; break; // You must select a special material in order to enhance an item with its properties.
|
||||
case EnhanceResult.Broken: message = 1061080; break; // You attempt to enhance the item, but fail catastrophically. The item is lost.
|
||||
case EnhanceResult.Failure: message = 1061082; break; // You attempt to enhance the item, but fail. Some material is lost in the process.
|
||||
case EnhanceResult.Success: message = 1061008; break; // You enhance the item with the properties of the special material.
|
||||
case EnhanceResult.NoSkill: message = 1044153; break; // You don't have the required skills to attempt this item.
|
||||
}
|
||||
|
||||
from.SendGump( new CraftGump( from, m_CraftSystem, m_Tool, message ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
54
Scripts/Engines/Craft/Core/QueryMakersMarkGump.cs
Normal file
54
Scripts/Engines/Craft/Core/QueryMakersMarkGump.cs
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Gumps;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class QueryMakersMarkGump : Gump
|
||||
{
|
||||
private int m_Quality;
|
||||
private Mobile m_From;
|
||||
private CraftItem m_CraftItem;
|
||||
private CraftSystem m_CraftSystem;
|
||||
private Type m_TypeRes;
|
||||
private BaseTool m_Tool;
|
||||
|
||||
public QueryMakersMarkGump( int quality, Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool ) : base( 100, 200 )
|
||||
{
|
||||
from.CloseGump( typeof( QueryMakersMarkGump ) );
|
||||
|
||||
m_Quality = quality;
|
||||
m_From = from;
|
||||
m_CraftItem = craftItem;
|
||||
m_CraftSystem = craftSystem;
|
||||
m_TypeRes = typeRes;
|
||||
m_Tool = tool;
|
||||
|
||||
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, 1011011, false, false ); // CONTINUE
|
||||
AddButton( 20, 100, 4005, 4007, 1, GumpButtonType.Reply, 0 );
|
||||
|
||||
AddHtmlLocalized( 55, 125, 140, 25, 1011012, false, false ); // CANCEL
|
||||
AddButton( 20, 125, 4005, 4007, 0, GumpButtonType.Reply, 0 );
|
||||
}
|
||||
|
||||
public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
|
||||
{
|
||||
bool makersMark = ( info.ButtonID == 1 );
|
||||
|
||||
if ( makersMark )
|
||||
m_From.SendLocalizedMessage( 501808 ); // You mark the item.
|
||||
else
|
||||
m_From.SendLocalizedMessage( 501809 ); // Cancelled mark.
|
||||
|
||||
m_CraftItem.CompleteCraft( m_Quality, makersMark, m_From, m_CraftSystem, m_TypeRes, m_Tool, null );
|
||||
}
|
||||
}
|
||||
}
|
||||
123
Scripts/Engines/Craft/Core/Recipes.cs
Normal file
123
Scripts/Engines/Craft/Core/Recipes.cs
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Commands;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class Recipe
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register( "LearnAllRecipes", AccessLevel.GameMaster, new CommandEventHandler( LearnAllRecipes_OnCommand ) );
|
||||
CommandSystem.Register( "ForgetAllRecipes", AccessLevel.GameMaster, new CommandEventHandler( ForgetAllRecipes_OnCommand ) );
|
||||
}
|
||||
|
||||
[Usage( "LearnAllRecipes" )]
|
||||
[Description( "Teaches a player all available recipes." )]
|
||||
private static void LearnAllRecipes_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
Mobile m = e.Mobile;
|
||||
m.SendMessage( "Target a player to teach them all of the recipies." );
|
||||
|
||||
m.BeginTarget( -1, false, Server.Targeting.TargetFlags.None, new TargetCallback(
|
||||
delegate( Mobile from, object targeted )
|
||||
{
|
||||
if( targeted is PlayerMobile )
|
||||
{
|
||||
foreach( KeyValuePair<int, Recipe> kvp in m_Recipes )
|
||||
((PlayerMobile)targeted).AcquireRecipe( kvp.Key );
|
||||
|
||||
m.SendMessage( "You teach them all of the recipies." );
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendMessage( "That is not a player!" );
|
||||
}
|
||||
}
|
||||
) );
|
||||
}
|
||||
|
||||
[Usage( "ForgetAllRecipes" )]
|
||||
[Description( "Makes a player forget all the recipies they've learned." )]
|
||||
private static void ForgetAllRecipes_OnCommand( CommandEventArgs e )
|
||||
{
|
||||
Mobile m = e.Mobile;
|
||||
m.SendMessage( "Target a player to have them forget all of the recipies they've learned." );
|
||||
|
||||
m.BeginTarget( -1, false, Server.Targeting.TargetFlags.None, new TargetCallback(
|
||||
delegate( Mobile from, object targeted )
|
||||
{
|
||||
if( targeted is PlayerMobile )
|
||||
{
|
||||
foreach( KeyValuePair<int, Recipe> kvp in m_Recipes )
|
||||
((PlayerMobile)targeted).AcquireRecipe( kvp.Key );
|
||||
|
||||
m.SendMessage( "They forget all their recipies." );
|
||||
}
|
||||
else
|
||||
{
|
||||
m.SendMessage( "That is not a player!" );
|
||||
}
|
||||
}
|
||||
) );
|
||||
}
|
||||
|
||||
|
||||
private static Dictionary<int, Recipe> m_Recipes = new Dictionary<int, Recipe>();
|
||||
|
||||
public static Dictionary<int, Recipe> Recipes { get { return m_Recipes; } }
|
||||
|
||||
private static int m_LargestRecipeID;
|
||||
public static int LargestRecipeID{ get{ return m_LargestRecipeID; } }
|
||||
|
||||
private CraftSystem m_System;
|
||||
|
||||
public CraftSystem CraftSystem
|
||||
{
|
||||
get { return m_System; }
|
||||
set { m_System = value; }
|
||||
}
|
||||
|
||||
private CraftItem m_CraftItem;
|
||||
|
||||
public CraftItem CraftItem
|
||||
{
|
||||
get { return m_CraftItem; }
|
||||
set { m_CraftItem = value; }
|
||||
}
|
||||
|
||||
private int m_ID;
|
||||
|
||||
public int ID
|
||||
{
|
||||
get { return m_ID; }
|
||||
}
|
||||
|
||||
private TextDefinition m_TD;
|
||||
public TextDefinition TextDefinition
|
||||
{
|
||||
get
|
||||
{
|
||||
if( m_TD == null )
|
||||
m_TD = new TextDefinition( m_CraftItem.NameNumber, m_CraftItem.NameString );
|
||||
|
||||
return m_TD;
|
||||
}
|
||||
}
|
||||
|
||||
public Recipe( int id, CraftSystem system, CraftItem item )
|
||||
{
|
||||
m_ID = id;
|
||||
m_System = system;
|
||||
m_CraftItem = item;
|
||||
|
||||
if( m_Recipes.ContainsKey( id ) )
|
||||
throw new Exception( "Attempting to create recipe with preexisting ID." );
|
||||
|
||||
m_Recipes.Add( id, this );
|
||||
m_LargestRecipeID = Math.Max( id, m_LargestRecipeID );
|
||||
}
|
||||
}
|
||||
}
|
||||
423
Scripts/Engines/Craft/Core/Repair.cs
Normal file
423
Scripts/Engines/Craft/Core/Repair.cs
Normal file
|
|
@ -0,0 +1,423 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class Repair
|
||||
{
|
||||
public Repair()
|
||||
{
|
||||
}
|
||||
|
||||
public static void Do( Mobile from, CraftSystem craftSystem, BaseTool tool )
|
||||
{
|
||||
from.Target = new InternalTarget( craftSystem, tool );
|
||||
from.SendLocalizedMessage( 1044276 ); // Target an item to repair.
|
||||
}
|
||||
|
||||
public static void Do( Mobile from, CraftSystem craftSystem, RepairDeed deed )
|
||||
{
|
||||
from.Target = new InternalTarget( craftSystem, deed );
|
||||
from.SendLocalizedMessage( 1044276 ); // Target an item to repair.
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private CraftSystem m_CraftSystem;
|
||||
private BaseTool m_Tool;
|
||||
private RepairDeed m_Deed;
|
||||
|
||||
public InternalTarget( CraftSystem craftSystem, BaseTool tool ) : base ( 2, false, TargetFlags.None )
|
||||
{
|
||||
m_CraftSystem = craftSystem;
|
||||
m_Tool = tool;
|
||||
}
|
||||
|
||||
public InternalTarget( CraftSystem craftSystem, RepairDeed deed ) : base( 2, false, TargetFlags.None )
|
||||
{
|
||||
m_CraftSystem = craftSystem;
|
||||
m_Deed = deed;
|
||||
}
|
||||
|
||||
private static void EndGolemRepair( object state )
|
||||
{
|
||||
((Mobile)state).EndAction( typeof( Golem ) );
|
||||
}
|
||||
|
||||
private int GetWeakenChance( Mobile mob, SkillName skill, int curHits, int maxHits )
|
||||
{
|
||||
// 40% - (1% per hp lost) - (1% per 10 craft skill)
|
||||
return (40 + (maxHits - curHits)) - (int)(((m_Deed != null)? m_Deed.SkillLevel : mob.Skills[skill].Value) / 10);
|
||||
}
|
||||
|
||||
private bool CheckWeaken( Mobile mob, SkillName skill, int curHits, int maxHits )
|
||||
{
|
||||
return ( GetWeakenChance( mob, skill, curHits, maxHits ) > Utility.Random( 100 ) );
|
||||
}
|
||||
|
||||
private int GetRepairDifficulty( int curHits, int maxHits )
|
||||
{
|
||||
return (((maxHits - curHits) * 1250) / Math.Max( maxHits, 1 )) - 250;
|
||||
}
|
||||
|
||||
private bool CheckRepairDifficulty( Mobile mob, SkillName skill, int curHits, int maxHits )
|
||||
{
|
||||
double difficulty = GetRepairDifficulty( curHits, maxHits ) * 0.1;
|
||||
|
||||
|
||||
if( m_Deed != null )
|
||||
{
|
||||
double value = m_Deed.SkillLevel;
|
||||
double minSkill = difficulty - 25.0;
|
||||
double maxSkill = difficulty + 25;
|
||||
|
||||
if( value < minSkill )
|
||||
return false; // Too difficult
|
||||
else if( value >= maxSkill )
|
||||
return true; // No challenge
|
||||
|
||||
double chance = (value - minSkill) / (maxSkill - minSkill);
|
||||
|
||||
return (chance >= Utility.RandomDouble());
|
||||
}
|
||||
else
|
||||
{
|
||||
return mob.CheckSkill( skill, difficulty - 25.0, difficulty + 25.0 );
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckDeed( Mobile from )
|
||||
{
|
||||
if( m_Deed != null )
|
||||
{
|
||||
return m_Deed.Check( from );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool IsSpecialWeapon( BaseWeapon weapon )
|
||||
{
|
||||
// Weapons repairable but not craftable
|
||||
|
||||
if ( m_CraftSystem is DefTinkering )
|
||||
{
|
||||
return ( weapon is Cleaver )
|
||||
|| ( weapon is Hatchet )
|
||||
|| ( weapon is Pickaxe )
|
||||
|| ( weapon is ButcherKnife )
|
||||
|| ( weapon is SkinningKnife );
|
||||
}
|
||||
else if ( m_CraftSystem is DefCarpentry )
|
||||
{
|
||||
return ( weapon is Club )
|
||||
|| ( weapon is BlackStaff )
|
||||
|| ( weapon is MagicWand );
|
||||
}
|
||||
else if ( m_CraftSystem is DefBlacksmithy )
|
||||
{
|
||||
return ( weapon is Pitchfork );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
int number;
|
||||
|
||||
if( !CheckDeed( from ) )
|
||||
return;
|
||||
|
||||
|
||||
bool usingDeed = (m_Deed != null);
|
||||
bool toDelete = false;
|
||||
|
||||
//TODO: Make a IRepairable
|
||||
|
||||
if ( m_CraftSystem is DefTinkering && targeted is Golem )
|
||||
{
|
||||
Golem g = (Golem)targeted;
|
||||
int damage = g.HitsMax - g.Hits;
|
||||
|
||||
if ( g.IsDeadBondedPet )
|
||||
{
|
||||
number = 500426; // You can't repair that.
|
||||
}
|
||||
else if ( damage <= 0 )
|
||||
{
|
||||
number = 500423; // That is already in full repair.
|
||||
}
|
||||
else
|
||||
{
|
||||
double skillValue = (usingDeed)? m_Deed.SkillLevel : from.Skills[SkillName.Tinkering].Value;
|
||||
|
||||
if ( skillValue < 60.0 )
|
||||
{
|
||||
number = 1044153; // You don't have the required skills to attempt this item. //TODO: How does OSI handle this with deeds with golems?
|
||||
}
|
||||
else if ( !from.CanBeginAction( typeof( Golem ) ) )
|
||||
{
|
||||
number = 501789; // You must wait before trying again.
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( damage > (int)(skillValue * 0.3) )
|
||||
damage = (int)(skillValue * 0.3);
|
||||
|
||||
damage += 30;
|
||||
|
||||
if ( !from.CheckSkill( SkillName.Tinkering, 0.0, 100.0 ) )
|
||||
damage /= 2;
|
||||
|
||||
Container pack = from.Backpack;
|
||||
|
||||
if ( pack != null )
|
||||
{
|
||||
int v = pack.ConsumeUpTo( typeof( IronIngot ), (damage+4)/5 );
|
||||
|
||||
if ( v > 0 )
|
||||
{
|
||||
g.Hits += v*5;
|
||||
|
||||
number = 1044279; // You repair the item.
|
||||
toDelete = true;
|
||||
|
||||
from.BeginAction( typeof( Golem ) );
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 12.0 ), new TimerStateCallback( EndGolemRepair ), from );
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 1044037; // You do not have sufficient metal to make that.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 1044037; // You do not have sufficient metal to make that.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( targeted is BaseWeapon )
|
||||
{
|
||||
BaseWeapon weapon = (BaseWeapon)targeted;
|
||||
SkillName skill = m_CraftSystem.MainSkill;
|
||||
int toWeaken = 0;
|
||||
|
||||
if ( Core.AOS )
|
||||
{
|
||||
toWeaken = 1;
|
||||
}
|
||||
else if ( skill != SkillName.Tailoring )
|
||||
{
|
||||
double skillLevel = (usingDeed)? m_Deed.SkillLevel : from.Skills[skill].Base;
|
||||
|
||||
if ( skillLevel >= 90.0 )
|
||||
toWeaken = 1;
|
||||
else if ( skillLevel >= 70.0 )
|
||||
toWeaken = 2;
|
||||
else
|
||||
toWeaken = 3;
|
||||
}
|
||||
|
||||
if ( m_CraftSystem.CraftItems.SearchForSubclass( weapon.GetType() ) == null && !IsSpecialWeapon( weapon ) )
|
||||
{
|
||||
number = (usingDeed)? 1061136 : 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract.
|
||||
}
|
||||
else if ( !weapon.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
number = 1044275; // The item must be in your backpack to repair it.
|
||||
}
|
||||
else if ( weapon.MaxHitPoints <= 0 || weapon.HitPoints == weapon.MaxHitPoints )
|
||||
{
|
||||
number = 1044281; // That item is in full repair
|
||||
}
|
||||
else if ( weapon.MaxHitPoints <= toWeaken )
|
||||
{
|
||||
number = 1044278; // That item has been repaired many times, and will break if repairs are attempted again.
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( CheckWeaken( from, skill, weapon.HitPoints, weapon.MaxHitPoints ) )
|
||||
{
|
||||
weapon.MaxHitPoints -= toWeaken;
|
||||
weapon.HitPoints = Math.Max( 0, weapon.HitPoints - toWeaken );
|
||||
}
|
||||
|
||||
if ( CheckRepairDifficulty( from, skill, weapon.HitPoints, weapon.MaxHitPoints ) )
|
||||
{
|
||||
number = 1044279; // You repair the item.
|
||||
m_CraftSystem.PlayCraftEffect( from );
|
||||
weapon.HitPoints = weapon.MaxHitPoints;
|
||||
}
|
||||
else
|
||||
{
|
||||
number = (usingDeed)? 1061137 : 1044280; // You fail to repair the item. [And the contract is destroyed]
|
||||
m_CraftSystem.PlayCraftEffect( from );
|
||||
}
|
||||
|
||||
toDelete = true;
|
||||
}
|
||||
}
|
||||
else if ( targeted is BaseArmor )
|
||||
{
|
||||
BaseArmor armor = (BaseArmor)targeted;
|
||||
SkillName skill = m_CraftSystem.MainSkill;
|
||||
int toWeaken = 0;
|
||||
|
||||
if ( Core.AOS )
|
||||
{
|
||||
toWeaken = 1;
|
||||
}
|
||||
else if ( skill != SkillName.Tailoring )
|
||||
{
|
||||
double skillLevel = (usingDeed)? m_Deed.SkillLevel : from.Skills[skill].Base;
|
||||
|
||||
if ( skillLevel >= 90.0 )
|
||||
toWeaken = 1;
|
||||
else if ( skillLevel >= 70.0 )
|
||||
toWeaken = 2;
|
||||
else
|
||||
toWeaken = 3;
|
||||
}
|
||||
|
||||
if ( m_CraftSystem.CraftItems.SearchForSubclass( armor.GetType() ) == null )
|
||||
{
|
||||
number = (usingDeed)? 1061136 : 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract.
|
||||
}
|
||||
else if ( !armor.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
number = 1044275; // The item must be in your backpack to repair it.
|
||||
}
|
||||
else if ( armor.MaxHitPoints <= 0 || armor.HitPoints == armor.MaxHitPoints )
|
||||
{
|
||||
number = 1044281; // That item is in full repair
|
||||
}
|
||||
else if ( armor.MaxHitPoints <= toWeaken )
|
||||
{
|
||||
number = 1044278; // That item has been repaired many times, and will break if repairs are attempted again.
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( CheckWeaken( from, skill, armor.HitPoints, armor.MaxHitPoints ) )
|
||||
{
|
||||
armor.MaxHitPoints -= toWeaken;
|
||||
armor.HitPoints = Math.Max( 0, armor.HitPoints - toWeaken );
|
||||
}
|
||||
|
||||
if ( CheckRepairDifficulty( from, skill, armor.HitPoints, armor.MaxHitPoints ) )
|
||||
{
|
||||
number = 1044279; // You repair the item.
|
||||
m_CraftSystem.PlayCraftEffect( from );
|
||||
armor.HitPoints = armor.MaxHitPoints;
|
||||
}
|
||||
else
|
||||
{
|
||||
number = (usingDeed)? 1061137 : 1044280; // You fail to repair the item. [And the contract is destroyed]
|
||||
m_CraftSystem.PlayCraftEffect( from );
|
||||
}
|
||||
|
||||
toDelete = true;
|
||||
}
|
||||
}
|
||||
else if ( targeted is BaseClothing )
|
||||
{
|
||||
BaseClothing clothing = (BaseClothing)targeted;
|
||||
SkillName skill = m_CraftSystem.MainSkill;
|
||||
int toWeaken = 0;
|
||||
|
||||
if ( Core.AOS )
|
||||
{
|
||||
toWeaken = 1;
|
||||
}
|
||||
else if ( skill != SkillName.Tailoring )
|
||||
{
|
||||
double skillLevel = (usingDeed) ? m_Deed.SkillLevel : from.Skills[skill].Base;
|
||||
|
||||
if ( skillLevel >= 90.0 )
|
||||
toWeaken = 1;
|
||||
else if ( skillLevel >= 70.0 )
|
||||
toWeaken = 2;
|
||||
else
|
||||
toWeaken = 3;
|
||||
}
|
||||
|
||||
if ( m_CraftSystem.CraftItems.SearchForSubclass( clothing.GetType() ) == null )
|
||||
{
|
||||
number = (usingDeed) ? 1061136 : 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract.
|
||||
}
|
||||
else if ( !clothing.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
number = 1044275; // The item must be in your backpack to repair it.
|
||||
}
|
||||
else if ( clothing.MaxHitPoints <= 0 || clothing.HitPoints == clothing.MaxHitPoints )
|
||||
{
|
||||
number = 1044281; // That item is in full repair
|
||||
}
|
||||
else if ( clothing.MaxHitPoints <= toWeaken )
|
||||
{
|
||||
number = 1044278; // That item has been repaired many times, and will break if repairs are attempted again.
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( CheckWeaken( from, skill, clothing.HitPoints, clothing.MaxHitPoints ) )
|
||||
{
|
||||
clothing.MaxHitPoints -= toWeaken;
|
||||
clothing.HitPoints = Math.Max( 0, clothing.HitPoints - toWeaken );
|
||||
}
|
||||
|
||||
if ( CheckRepairDifficulty( from, skill, clothing.HitPoints, clothing.MaxHitPoints ) )
|
||||
{
|
||||
number = 1044279; // You repair the item.
|
||||
m_CraftSystem.PlayCraftEffect( from );
|
||||
clothing.HitPoints = clothing.MaxHitPoints;
|
||||
}
|
||||
else
|
||||
{
|
||||
number = (usingDeed) ? 1061137 : 1044280; // You fail to repair the item. [And the contract is destroyed]
|
||||
m_CraftSystem.PlayCraftEffect( from );
|
||||
}
|
||||
|
||||
toDelete = true;
|
||||
}
|
||||
}
|
||||
else if( !usingDeed && targeted is BlankScroll )
|
||||
{
|
||||
SkillName skill = m_CraftSystem.MainSkill;
|
||||
|
||||
if( from.Skills[skill].Value >= 50.0 )
|
||||
{
|
||||
((BlankScroll)targeted).Consume( 1 );
|
||||
RepairDeed deed = new RepairDeed( RepairDeed.GetTypeFor( m_CraftSystem ), from.Skills[skill].Value, from );
|
||||
from.AddToBackpack( deed );
|
||||
|
||||
number = 500442; // You create the item and put it in your backpack.
|
||||
}
|
||||
else
|
||||
number = 1047005; // You must be at least apprentice level to create a repair service contract.
|
||||
}
|
||||
else if ( targeted is Item )
|
||||
{
|
||||
number = (usingDeed)? 1061136 : 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract.
|
||||
}
|
||||
else
|
||||
{
|
||||
number = 500426; // You can't repair that.
|
||||
}
|
||||
|
||||
if( !usingDeed )
|
||||
{
|
||||
CraftContext context = m_CraftSystem.GetContext( from );
|
||||
from.SendGump( new CraftGump( from, m_CraftSystem, m_Tool, number ) );
|
||||
}
|
||||
else if( toDelete )
|
||||
{
|
||||
m_Deed.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
121
Scripts/Engines/Craft/Core/Resmelt.cs
Normal file
121
Scripts/Engines/Craft/Core/Resmelt.cs
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class Resmelt
|
||||
{
|
||||
public Resmelt()
|
||||
{
|
||||
}
|
||||
|
||||
public static void Do( Mobile from, CraftSystem craftSystem, BaseTool tool )
|
||||
{
|
||||
int num = craftSystem.CanCraft( from, tool, null );
|
||||
|
||||
if ( num > 0 )
|
||||
{
|
||||
from.SendGump( new CraftGump( from, craftSystem, tool, num ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.Target = new InternalTarget( craftSystem, tool );
|
||||
from.SendLocalizedMessage( 1044273 ); // Target an item to recycle.
|
||||
}
|
||||
}
|
||||
|
||||
private class InternalTarget : Target
|
||||
{
|
||||
private CraftSystem m_CraftSystem;
|
||||
private BaseTool m_Tool;
|
||||
|
||||
public InternalTarget( CraftSystem craftSystem, BaseTool tool ) : base ( 2, false, TargetFlags.None )
|
||||
{
|
||||
m_CraftSystem = craftSystem;
|
||||
m_Tool = tool;
|
||||
}
|
||||
|
||||
private bool Resmelt( Mobile from, Item item, CraftResource resource )
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( CraftResources.GetType( resource ) != CraftResourceType.Metal )
|
||||
return false;
|
||||
|
||||
CraftResourceInfo info = CraftResources.GetInfo( resource );
|
||||
|
||||
if ( info == null || info.ResourceTypes.Length == 0 )
|
||||
return false;
|
||||
|
||||
CraftItem craftItem = m_CraftSystem.CraftItems.SearchFor( item.GetType() );
|
||||
|
||||
if ( craftItem == null || craftItem.Ressources.Count == 0 )
|
||||
return false;
|
||||
|
||||
CraftRes craftResource = craftItem.Ressources.GetAt( 0 );
|
||||
|
||||
if ( craftResource.Amount < 2 )
|
||||
return false; // Not enough metal to resmelt
|
||||
|
||||
Type resourceType = info.ResourceTypes[0];
|
||||
Item ingot = (Item)Activator.CreateInstance( resourceType );
|
||||
|
||||
if ( item is DragonBardingDeed || (item is BaseArmor && ((BaseArmor)item).PlayerConstructed) || (item is BaseWeapon && ((BaseWeapon)item).PlayerConstructed) || (item is BaseClothing && ((BaseClothing)item).PlayerConstructed) )
|
||||
ingot.Amount = craftResource.Amount / 2;
|
||||
else
|
||||
ingot.Amount = 1;
|
||||
|
||||
item.Delete();
|
||||
from.AddToBackpack( ingot );
|
||||
|
||||
from.PlaySound( 0x2A );
|
||||
from.PlaySound( 0x240 );
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
int num = m_CraftSystem.CanCraft( from, m_Tool, null );
|
||||
|
||||
if ( num > 0 )
|
||||
{
|
||||
from.SendGump( new CraftGump( from, m_CraftSystem, m_Tool, num ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
bool success = false;
|
||||
bool isStoreBought = false;
|
||||
|
||||
if ( targeted is BaseArmor )
|
||||
{
|
||||
success = Resmelt( from, (BaseArmor)targeted, ((BaseArmor)targeted).Resource );
|
||||
isStoreBought = !((BaseArmor)targeted).PlayerConstructed;
|
||||
}
|
||||
else if ( targeted is BaseWeapon )
|
||||
{
|
||||
success = Resmelt( from, (BaseWeapon)targeted, ((BaseWeapon)targeted).Resource );
|
||||
isStoreBought = !((BaseWeapon)targeted).PlayerConstructed;
|
||||
}
|
||||
else if ( targeted is DragonBardingDeed )
|
||||
{
|
||||
success = Resmelt( from, (DragonBardingDeed)targeted, ((DragonBardingDeed)targeted).Resource );
|
||||
isStoreBought = false;
|
||||
}
|
||||
|
||||
if ( success )
|
||||
from.SendGump( new CraftGump( from, m_CraftSystem, m_Tool, isStoreBought ? 500418 : 1044270 ) ); // You melt the item down into ingots.
|
||||
else
|
||||
from.SendGump( new CraftGump( from, m_CraftSystem, m_Tool, 1044272 ) ); // You can't melt that down into ingots.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
165
Scripts/Engines/Craft/DefAlchemy.cs
Normal file
165
Scripts/Engines/Craft/DefAlchemy.cs
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class DefAlchemy : CraftSystem
|
||||
{
|
||||
public override SkillName MainSkill
|
||||
{
|
||||
get { return SkillName.Alchemy; }
|
||||
}
|
||||
|
||||
public override int GumpTitleNumber
|
||||
{
|
||||
get { return 1044001; } // <CENTER>ALCHEMY MENU</CENTER>
|
||||
}
|
||||
|
||||
private static CraftSystem m_CraftSystem;
|
||||
|
||||
public static CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_CraftSystem == null )
|
||||
m_CraftSystem = new DefAlchemy();
|
||||
|
||||
return m_CraftSystem;
|
||||
}
|
||||
}
|
||||
|
||||
public override double GetChanceAtMin( CraftItem item )
|
||||
{
|
||||
return 0.0; // 0%
|
||||
}
|
||||
|
||||
private DefAlchemy() : base( 1, 1, 1.25 )// base( 1, 1, 3.1 )
|
||||
{
|
||||
}
|
||||
|
||||
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
|
||||
{
|
||||
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||
return 1044038; // You have worn out your tool!
|
||||
else if ( !BaseTool.CheckAccessible( tool, from ) )
|
||||
return 1044263; // The tool must be on your person to use.
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void PlayCraftEffect( Mobile from )
|
||||
{
|
||||
from.PlaySound( 0x242 );
|
||||
}
|
||||
|
||||
private static Type typeofPotion = typeof( BasePotion );
|
||||
|
||||
public static bool IsPotion( Type type )
|
||||
{
|
||||
return typeofPotion.IsAssignableFrom( type );
|
||||
}
|
||||
|
||||
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.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void InitCraftList()
|
||||
{
|
||||
int index = -1;
|
||||
|
||||
// Refresh Potion
|
||||
index = AddCraft( typeof( RefreshPotion ), 1044530, 1044538, -25, 25.0, typeof( BlackPearl ), 1044353, 1, 1044361 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
index = AddCraft( typeof( TotalRefreshPotion ), 1044530, 1044539, 25.0, 75.0, typeof( BlackPearl ), 1044353, 5, 1044361 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
|
||||
// Agility Potion
|
||||
index = AddCraft( typeof( AgilityPotion ), 1044531, 1044540, 15.0, 65.0, typeof( Bloodmoss ), 1044354, 1, 1044362 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
index = AddCraft( typeof( GreaterAgilityPotion ), 1044531, 1044541, 35.0, 85.0, typeof( Bloodmoss ), 1044354, 3, 1044362 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
|
||||
// Nightsight Potion
|
||||
index = AddCraft( typeof( NightSightPotion ), 1044532, 1044542, -25.0, 25.0, typeof( SpidersSilk ), 1044360, 1, 1044368 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
|
||||
// Heal Potion
|
||||
index = AddCraft( typeof( LesserHealPotion ), 1044533, 1044543, -25.0, 25.0, typeof( Ginseng ), 1044356, 1, 1044364 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
index = AddCraft( typeof( HealPotion ), 1044533, 1044544, 15.0, 65.0, typeof( Ginseng ), 1044356, 3, 1044364 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
index = AddCraft( typeof( GreaterHealPotion ), 1044533, 1044545, 55.0, 105.0, typeof( Ginseng ), 1044356, 7, 1044364 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
|
||||
// Strength Potion
|
||||
index = AddCraft( typeof( StrengthPotion ), 1044534, 1044546, 25.0, 75.0, typeof( MandrakeRoot ), 1044357, 2, 1044365 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
index = AddCraft( typeof( GreaterStrengthPotion ), 1044534, 1044547, 45.0, 95.0, typeof( MandrakeRoot ), 1044357, 5, 1044365 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
|
||||
// Poison Potion
|
||||
index = AddCraft( typeof( LesserPoisonPotion ), 1044535, 1044548, -5.0, 45.0, typeof( Nightshade ), 1044358, 1, 1044366 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
index = AddCraft( typeof( PoisonPotion ), 1044535, 1044549, 15.0, 65.0, typeof( Nightshade ), 1044358, 2, 1044366 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
index = AddCraft( typeof( GreaterPoisonPotion ), 1044535, 1044550, 55.0, 105.0, typeof( Nightshade ), 1044358, 4, 1044366 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
index = AddCraft( typeof( DeadlyPoisonPotion ), 1044535, 1044551, 90.0, 140.0, typeof( Nightshade ), 1044358, 8, 1044366 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
|
||||
// Cure Potion
|
||||
index = AddCraft( typeof( LesserCurePotion ), 1044536, 1044552, -10.0, 40.0, typeof( Garlic ), 1044355, 1, 1044363 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
index = AddCraft( typeof( CurePotion ), 1044536, 1044553, 25.0, 75.0, typeof( Garlic ), 1044355, 3, 1044363 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
index = AddCraft( typeof( GreaterCurePotion ), 1044536, 1044554, 65.0, 115.0, typeof( Garlic ), 1044355, 6, 1044363 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
|
||||
// Explosion Potion
|
||||
index = AddCraft( typeof( LesserExplosionPotion ), 1044537, 1044555, 5.0, 55.0, typeof( SulfurousAsh ), 1044359, 3, 1044367 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
index = AddCraft( typeof( ExplosionPotion ), 1044537, 1044556, 35.0, 85.0, typeof( SulfurousAsh ), 1044359, 5, 1044367 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
index = AddCraft( typeof( GreaterExplosionPotion ), 1044537, 1044557, 65.0, 115.0, typeof( SulfurousAsh ), 1044359, 10, 1044367 );
|
||||
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( SmokeBomb ), 1044537, 1030248, 90.0, 120.0, typeof( Eggs ), 1044477, 1, 1044253 );
|
||||
AddRes( index, typeof ( Ginseng ), 1044356, 3, 1044364 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
547
Scripts/Engines/Craft/DefBlacksmithy.cs
Normal file
547
Scripts/Engines/Craft/DefBlacksmithy.cs
Normal file
|
|
@ -0,0 +1,547 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class DefBlacksmithy : CraftSystem
|
||||
{
|
||||
public override SkillName MainSkill
|
||||
{
|
||||
get { return SkillName.Blacksmith; }
|
||||
}
|
||||
|
||||
public override int GumpTitleNumber
|
||||
{
|
||||
get { return 1044002; } // <CENTER>BLACKSMITHY MENU</CENTER>
|
||||
}
|
||||
|
||||
private static CraftSystem m_CraftSystem;
|
||||
|
||||
public static CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_CraftSystem == null )
|
||||
m_CraftSystem = new DefBlacksmithy();
|
||||
|
||||
return m_CraftSystem;
|
||||
}
|
||||
}
|
||||
|
||||
public override CraftECA ECA{ get{ return CraftECA.ChanceMinusSixtyToFourtyFive; } }
|
||||
|
||||
public override double GetChanceAtMin( CraftItem item )
|
||||
{
|
||||
return 0.0; // 0%
|
||||
}
|
||||
|
||||
private DefBlacksmithy() : base( 1, 1, 1.25 )// base( 1, 2, 1.7 )
|
||||
{
|
||||
/*
|
||||
|
||||
base( MinCraftEffect, MaxCraftEffect, Delay )
|
||||
|
||||
MinCraftEffect : The minimum number of time the mobile will play the craft effect
|
||||
MaxCraftEffect : The maximum number of time the mobile will play the craft effect
|
||||
Delay : The delay between each craft effect
|
||||
|
||||
Example: (3, 6, 1.7) would make the mobile do the PlayCraftEffect override
|
||||
function between 3 and 6 time, with a 1.7 second delay each time.
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
private static Type typeofAnvil = typeof( AnvilAttribute );
|
||||
private static Type typeofForge = typeof( ForgeAttribute );
|
||||
|
||||
public static void CheckAnvilAndForge( Mobile from, int range, out bool anvil, out bool forge )
|
||||
{
|
||||
anvil = false;
|
||||
forge = false;
|
||||
|
||||
Map map = from.Map;
|
||||
|
||||
if ( map == null )
|
||||
return;
|
||||
|
||||
IPooledEnumerable eable = map.GetItemsInRange( from.Location, range );
|
||||
|
||||
foreach ( Item item in eable )
|
||||
{
|
||||
Type type = item.GetType();
|
||||
|
||||
bool isAnvil = ( type.IsDefined( typeofAnvil, false ) || item.ItemID == 4015 || item.ItemID == 4016 || item.ItemID == 0x2DD5 || item.ItemID == 0x2DD6 );
|
||||
bool isForge = ( type.IsDefined( typeofForge, false ) || item.ItemID == 4017 || (item.ItemID >= 6522 && item.ItemID <= 6569) || item.ItemID == 0x2DD8 );
|
||||
|
||||
if ( isAnvil || isForge )
|
||||
{
|
||||
if ( (from.Z + 16) < item.Z || (item.Z + 16) < from.Z || !from.InLOS( item ) )
|
||||
continue;
|
||||
|
||||
anvil = anvil || isAnvil;
|
||||
forge = forge || isForge;
|
||||
|
||||
if ( anvil && forge )
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
eable.Free();
|
||||
|
||||
for ( int x = -range; (!anvil || !forge) && x <= range; ++x )
|
||||
{
|
||||
for ( int y = -range; (!anvil || !forge) && y <= range; ++y )
|
||||
{
|
||||
Tile[] tiles = map.Tiles.GetStaticTiles( from.X+x, from.Y+y, true );
|
||||
|
||||
for ( int i = 0; (!anvil || !forge) && i < tiles.Length; ++i )
|
||||
{
|
||||
int id = tiles[i].ID & 0x3FFF;
|
||||
|
||||
bool isAnvil = ( id == 4015 || id == 4016 || id == 0x2DD5 || id == 0x2DD6 );
|
||||
bool isForge = ( id == 4017 || (id >= 6522 && id <= 6569) || id == 0x2DD8 );
|
||||
|
||||
if ( isAnvil || isForge )
|
||||
{
|
||||
if ( (from.Z + 16) < tiles[i].Z || (tiles[i].Z + 16) < from.Z || !from.InLOS( new Point3D( from.X+x, from.Y+y, tiles[i].Z + (tiles[i].Height/2) + 1 ) ) )
|
||||
continue;
|
||||
|
||||
anvil = anvil || isAnvil;
|
||||
forge = forge || isForge;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
|
||||
{
|
||||
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||
return 1044038; // You have worn out your tool!
|
||||
else if ( !BaseTool.CheckTool( tool, from ) )
|
||||
return 1048146; // If you have a tool equipped, you must use that tool.
|
||||
else if ( !BaseTool.CheckAccessible( tool, from ) )
|
||||
return 1044263; // The tool must be on your person to use.
|
||||
|
||||
bool anvil, forge;
|
||||
CheckAnvilAndForge( from, 2, out anvil, out forge );
|
||||
|
||||
if ( anvil && forge )
|
||||
return 0;
|
||||
|
||||
return 1044267; // You must be near an anvil and a forge to smith items.
|
||||
}
|
||||
|
||||
public override void PlayCraftEffect( Mobile from )
|
||||
{
|
||||
// no animation, instant sound
|
||||
//if ( from.Body.Type == BodyType.Human && !from.Mounted )
|
||||
// from.Animate( 9, 5, 1, true, false, 0 );
|
||||
//new InternalTimer( from ).Start();
|
||||
|
||||
from.PlaySound( 0x2A );
|
||||
}
|
||||
|
||||
// Delay to synchronize the sound with the hit on the anvil
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_From;
|
||||
|
||||
public InternalTimer( Mobile from ) : base( TimeSpan.FromSeconds( 0.7 ) )
|
||||
{
|
||||
m_From = from;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_From.PlaySound( 0x2A );
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
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.
|
||||
}
|
||||
}
|
||||
|
||||
public override void InitCraftList()
|
||||
{
|
||||
/*
|
||||
Synthax for a SIMPLE craft item
|
||||
AddCraft( ObjectType, Group, MinSkill, MaxSkill, RessourceType, Amount, Message )
|
||||
|
||||
ObjectType : The type of the object you want to add to the build list.
|
||||
Group : The group in wich the object will be showed in the craft menu.
|
||||
MinSkill : The minimum of skill value
|
||||
MaxSkill : The maximum of skill value
|
||||
RessourceType : The type of the ressource the mobile need to create the item
|
||||
Amount : The amount of the RessourceType it need to create the item
|
||||
Message : String or Int for Localized. The message that will be sent to the mobile, if the specified ressource is missing.
|
||||
|
||||
Synthax for a COMPLEXE craft item. A complexe item is an item that need either more than
|
||||
only one skill, or more than only one ressource.
|
||||
|
||||
Coming soon....
|
||||
*/
|
||||
|
||||
#region Ringmail
|
||||
AddCraft( typeof( RingmailGloves ), 1011076, 1025099, 12.0, 62.0, typeof( IronIngot ), 1044036, 10, 1044037 );
|
||||
AddCraft( typeof( RingmailLegs ), 1011076, 1025104, 19.4, 69.4, typeof( IronIngot ), 1044036, 16, 1044037 );
|
||||
AddCraft( typeof( RingmailArms ), 1011076, 1025103, 16.9, 66.9, typeof( IronIngot ), 1044036, 14, 1044037 );
|
||||
AddCraft( typeof( RingmailChest ), 1011076, 1025100, 21.9, 71.9, typeof( IronIngot ), 1044036, 18, 1044037 );
|
||||
#endregion
|
||||
|
||||
#region Chainmail
|
||||
AddCraft( typeof( ChainCoif ), 1011077, 1025051, 14.5, 64.5, typeof( IronIngot ), 1044036, 10, 1044037 );
|
||||
AddCraft( typeof( ChainLegs ), 1011077, 1025054, 36.7, 86.7, typeof( IronIngot ), 1044036, 18, 1044037 );
|
||||
AddCraft( typeof( ChainChest ), 1011077, 1025055, 39.1, 89.1, typeof( IronIngot ), 1044036, 20, 1044037 );
|
||||
#endregion
|
||||
|
||||
int index = -1;
|
||||
|
||||
#region Platemail
|
||||
AddCraft( typeof( PlateArms ), 1011078, 1025136, 66.3, 116.3, typeof( IronIngot ), 1044036, 18, 1044037 );
|
||||
AddCraft( typeof( PlateGloves ), 1011078, 1025140, 58.9, 108.9, typeof( IronIngot ), 1044036, 12, 1044037 );
|
||||
AddCraft( typeof( PlateGorget ), 1011078, 1025139, 56.4, 106.4, typeof( IronIngot ), 1044036, 10, 1044037 );
|
||||
AddCraft( typeof( PlateLegs ), 1011078, 1025137, 68.8, 118.8, typeof( IronIngot ), 1044036, 20, 1044037 );
|
||||
AddCraft( typeof( PlateChest ), 1011078, 1046431, 75.0, 125.0, typeof( IronIngot ), 1044036, 25, 1044037 );
|
||||
AddCraft( typeof( FemalePlateChest ), 1011078, 1046430, 44.1, 94.1, typeof( IronIngot ), 1044036, 20, 1044037 );
|
||||
|
||||
if ( Core.AOS ) // exact pre-aos functionality unknown
|
||||
AddCraft( typeof( DragonBardingDeed ), 1011078, 1053012, 72.5, 122.5, typeof( IronIngot ), 1044036, 750, 1044037 );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
|
||||
index = AddCraft( typeof( PlateMempo ), 1011078, 1030180, 80.0, 130.0, typeof( IronIngot ), 1044036, 18, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( PlateDo ), 1011078, 1030184, 80.0, 130.0, typeof( IronIngot ), 1044036, 28, 1044037 ); //Double check skill
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( PlateHiroSode ), 1011078, 1030187, 80.0, 130.0, typeof( IronIngot ), 1044036, 16, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( PlateSuneate ), 1011078, 1030195, 65.0, 115.0, typeof( IronIngot ), 1044036, 20, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( PlateHaidate ), 1011078, 1030200, 65.0, 115.0, typeof( IronIngot ), 1044036, 20, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Helmets
|
||||
AddCraft( typeof( Bascinet ), 1011079, 1025132, 8.3, 58.3, typeof( IronIngot ), 1044036, 15, 1044037 );
|
||||
AddCraft( typeof( CloseHelm ), 1011079, 1025128, 37.9, 87.9, typeof( IronIngot ), 1044036, 15, 1044037 );
|
||||
AddCraft( typeof( Helmet ), 1011079, 1025130, 37.9, 87.9, typeof( IronIngot ), 1044036, 15, 1044037 );
|
||||
AddCraft( typeof( NorseHelm ), 1011079, 1025134, 37.9, 87.9, typeof( IronIngot ), 1044036, 15, 1044037 );
|
||||
AddCraft( typeof( PlateHelm ), 1011079, 1025138, 62.6, 112.6, typeof( IronIngot ), 1044036, 15, 1044037 );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( ChainHatsuburi ), 1011079, 1030175, 30.0, 80.0, typeof( IronIngot ), 1044036, 20, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( PlateHatsuburi ), 1011079, 1030176, 45.0, 95.0, typeof( IronIngot ), 1044036, 20, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( HeavyPlateJingasa ), 1011079, 1030178, 45.0, 95.0, typeof( IronIngot ), 1044036, 20, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( LightPlateJingasa ), 1011079, 1030188, 45.0, 95.0, typeof( IronIngot ), 1044036, 20, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( SmallPlateJingasa ), 1011079, 1030191, 45.0, 95.0, typeof( IronIngot ), 1044036, 20, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( DecorativePlateKabuto ), 1011079, 1030179, 90.0, 140.0, typeof( IronIngot ), 1044036, 25, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( PlateBattleKabuto ), 1011079, 1030192, 90.0, 140.0, typeof( IronIngot ), 1044036, 25, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( StandardPlateKabuto ), 1011079, 1030196, 90.0, 140.0, typeof( IronIngot ), 1044036, 25, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
if( Core.ML )
|
||||
{
|
||||
index = AddCraft( typeof( Circlet ), 1011079, 1032645, 62.1, 112.1, typeof( IronIngot ), 1044036, 6, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( RoyalCirclet ), 1011079, 1032646, 70.0, 120.0, typeof( IronIngot ), 1044036, 6, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( GemmedCirclet ), 1011079, 1032647, 75.0, 125.0, typeof( IronIngot ), 1044036, 6, 1044037 );
|
||||
AddRes( index, typeof( Tourmaline ), 1044237, 1, 1044240 );
|
||||
AddRes( index, typeof( Amethyst ), 1044236, 1, 1044240 );
|
||||
AddRes( index, typeof( BlueDiamond ), 1032696, 1, 1044240 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Shields
|
||||
AddCraft( typeof( Buckler ), 1011080, 1027027, -25.0, 25.0, typeof( IronIngot ), 1044036, 10, 1044037 );
|
||||
AddCraft( typeof( BronzeShield ), 1011080, 1027026, -15.2, 34.8, typeof( IronIngot ), 1044036, 12, 1044037 );
|
||||
AddCraft( typeof( HeaterShield ), 1011080, 1027030, 24.3, 74.3, typeof( IronIngot ), 1044036, 18, 1044037 );
|
||||
AddCraft( typeof( MetalShield ), 1011080, 1027035, -10.2, 39.8, typeof( IronIngot ), 1044036, 14, 1044037 );
|
||||
AddCraft( typeof( MetalKiteShield ), 1011080, 1027028, 4.6, 54.6, typeof( IronIngot ), 1044036, 16, 1044037 );
|
||||
AddCraft( typeof( WoodenKiteShield ), 1011080, 1027032, -15.2, 34.8, typeof( IronIngot ), 1044036, 8, 1044037 );
|
||||
|
||||
if ( Core.AOS )
|
||||
{
|
||||
AddCraft( typeof( ChaosShield ), 1011080, 1027107, 85.0, 135.0, typeof( IronIngot ), 1044036, 25, 1044037 );
|
||||
AddCraft( typeof( OrderShield ), 1011080, 1027108, 85.0, 135.0, typeof( IronIngot ), 1044036, 25, 1044037 );
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Bladed
|
||||
|
||||
if ( Core.AOS )
|
||||
AddCraft( typeof( BoneHarvester ), 1011081, 1029915, 33.0, 83.0, typeof( IronIngot ), 1044036, 10, 1044037 );
|
||||
|
||||
AddCraft( typeof( Broadsword ), 1011081, 1023934, 35.4, 85.4, typeof( IronIngot ), 1044036, 10, 1044037 );
|
||||
|
||||
if ( Core.AOS )
|
||||
AddCraft( typeof( CrescentBlade ), 1011081, 1029921, 45.0, 95.0, typeof( IronIngot ), 1044036, 14, 1044037 );
|
||||
|
||||
AddCraft( typeof( Cutlass ), 1011081, 1025185, 24.3, 74.3, typeof( IronIngot ), 1044036, 8, 1044037 );
|
||||
AddCraft( typeof( Dagger ), 1011081, 1023921, -0.4, 49.6, typeof( IronIngot ), 1044036, 3, 1044037 );
|
||||
AddCraft( typeof( Katana ),1011081, 1025119, 44.1, 94.1, typeof( IronIngot ), 1044036, 8, 1044037 );
|
||||
AddCraft( typeof( Kryss ), 1011081, 1025121, 36.7, 86.7, typeof( IronIngot ), 1044036, 8, 1044037 );
|
||||
AddCraft( typeof( Longsword ), 1011081, 1023937, 28.0, 78.0, typeof( IronIngot ), 1044036, 12, 1044037 );
|
||||
AddCraft( typeof( Scimitar ), 1011081, 1025046, 31.7, 81.7, typeof( IronIngot ), 1044036, 10, 1044037 );
|
||||
AddCraft( typeof( VikingSword ), 1011081, 1025049, 24.3, 74.3, typeof( IronIngot ), 1044036, 14, 1044037 );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
|
||||
index = AddCraft( typeof( NoDachi ), 1011081, 1030221, 75.0, 125.0, typeof( IronIngot ), 1044036, 18, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( Wakizashi ), 1011081, 1030223, 50.0, 100.0, typeof( IronIngot ), 1044036, 8, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( Lajatang ), 1011081, 1030226, 80.0, 130.0, typeof( IronIngot ), 1044036, 25, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( Daisho ), 1011081, 1030228, 60.0, 110.0, typeof( IronIngot ), 1044036, 15, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( Tekagi ), 1011081, 1030230, 55.0, 105.0, typeof( IronIngot ), 1044036, 12, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( Shuriken ), 1011081, 1030231, 45.0, 95.0, typeof( IronIngot ), 1044036, 5, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( Kama ), 1011081, 1030232, 40.0, 90.0, typeof( IronIngot ), 1044036, 14, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( Sai ), 1011081, 1030234, 50.0, 100.0, typeof( IronIngot ), 1044036, 12, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
if( Core.ML )
|
||||
{
|
||||
index = AddCraft( typeof( RadiantScimitar ), 1011081, 1031571, 75.0, 125.0, typeof( IronIngot ), 1044036, 15, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( WarCleaver ), 1011081, 1031567, 70.0, 120.0, typeof( IronIngot ), 1044036, 18, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( ElvenSpellblade ), 1011081, 1031564, 70.0, 120.0, typeof( IronIngot ), 1044036, 14, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( AssassinSpike ), 1011081, 1031564, 70.0, 120.0, typeof( IronIngot ), 1044036, 9, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( Leafblade ), 1011081, 1031565, 70.0, 120.0, typeof( IronIngot ), 1044036, 12, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( RuneBlade ), 1011081, 1031570, 70.0, 120.0, typeof( IronIngot ), 1044036, 15, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( ElvenMachete ), 1011081, 1031573, 70.0, 120.0, typeof( IronIngot ), 1044036, 14, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( RuneCarvingKnife ), 1011081, 1072915, 70.0, 120.0, typeof( IronIngot ), 1044036, 9, 1044037 );
|
||||
AddRes( index, typeof( DreadHornMane ), 1032682, 1, 1053098 );
|
||||
AddRes( index, typeof( Putrefication ), 1032678, 10, 1053098 );
|
||||
AddRes( index, typeof( Muculent ), 1032678, 10, 1053098 );
|
||||
AddRecipe( index, 0 );
|
||||
ForceNonExceptional( index );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( ColdForgedBlade ), 1011081, 1072916, 70.0, 120.0, typeof( IronIngot ), 1044036, 18, 1044037 );
|
||||
AddRes( index, typeof( GrizzledBones ), 1032684, 1, 1053098 );
|
||||
AddRes( index, typeof( Taint ), 1032684, 10, 1053098 );
|
||||
AddRes( index, typeof( Blight ), 1032675, 10, 1053098 );
|
||||
AddRecipe( index, 1 );
|
||||
ForceNonExceptional( index );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( OverseerSunderedBlade ), 1011081, 1072920, 70.0, 120.0, typeof( IronIngot ), 1044036, 15, 1044037 );
|
||||
AddRes( index, typeof( GrizzledBones ), 1032684, 1, 1053098 );
|
||||
AddRes( index, typeof( Blight ), 1032675, 10, 1053098 );
|
||||
AddRes( index, typeof( Scourge ), 1032677, 10, 1053098 );
|
||||
AddRecipe( index, 2 );
|
||||
ForceNonExceptional( index );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( LuminousRuneBlade ), 1011081, 1072922, 70.0, 120.0, typeof( IronIngot ), 1044036, 15, 1044037 );
|
||||
AddRes( index, typeof( GrizzledBones ), 1032684, 1, 1053098 );
|
||||
AddRes( index, typeof( Corruption ), 1032676, 10, 1053098 );
|
||||
AddRes( index, typeof( Putrefication ), 1032678, 10, 1053098 );
|
||||
AddRecipe( index, 3 );
|
||||
ForceNonExceptional( index );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
/* //TODO: true spellblade;
|
||||
index = AddCraft( typeof( ), 1011081, 1072920, 70.0, 120.0, typeof( IronIngot ), 1044036, 15, 1044037 );
|
||||
AddRes( index, typeof( GrizzledBones ), 1032684, 1, 1053098 );
|
||||
AddRes( index, typeof( Blight ), 1032675, 10, 1053098 );
|
||||
AddRes( index, typeof( Scourge ), 1032677, 10, 1053098 );
|
||||
AddRecipe( index, 4 );
|
||||
ForceNonExceptional( index );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
* */
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Axes
|
||||
AddCraft( typeof( Axe ), 1011082, 1023913, 34.2, 84.2, typeof( IronIngot ), 1044036, 14, 1044037 );
|
||||
AddCraft( typeof( BattleAxe ), 1011082, 1023911, 30.5, 80.5, typeof( IronIngot ), 1044036, 14, 1044037 );
|
||||
AddCraft( typeof( DoubleAxe ), 1011082, 1023915, 29.3, 79.3, typeof( IronIngot ), 1044036, 12, 1044037 );
|
||||
AddCraft( typeof( ExecutionersAxe ), 1011082, 1023909, 34.2, 84.2, typeof( IronIngot ), 1044036, 14, 1044037 );
|
||||
AddCraft( typeof( LargeBattleAxe ), 1011082, 1025115, 28.0, 78.0, typeof( IronIngot ), 1044036, 12, 1044037 );
|
||||
AddCraft( typeof( TwoHandedAxe ), 1011082, 1025187, 33.0, 83.0, typeof( IronIngot ), 1044036, 16, 1044037 );
|
||||
AddCraft( typeof( WarAxe ), 1011082, 1025040, 39.1, 89.1, typeof( IronIngot ), 1044036, 16, 1044037 );
|
||||
#endregion
|
||||
|
||||
#region Pole Arms
|
||||
|
||||
AddCraft( typeof( Bardiche ), 1011083, 1023917, 31.7, 81.7, typeof( IronIngot ), 1044036, 18, 1044037 );
|
||||
|
||||
if ( Core.AOS )
|
||||
AddCraft( typeof( BladedStaff ), 1011083, 1029917, 40.0, 90.0, typeof( IronIngot ), 1044036, 12, 1044037 );
|
||||
|
||||
if ( Core.AOS )
|
||||
AddCraft( typeof( DoubleBladedStaff ), 1011083, 1029919, 45.0, 95.0, typeof( IronIngot ), 1044036, 16, 1044037 );
|
||||
|
||||
AddCraft( typeof( Halberd ), 1011083, 1025183, 39.1, 89.1, typeof( IronIngot ), 1044036, 20, 1044037 );
|
||||
|
||||
if ( Core.AOS )
|
||||
AddCraft( typeof( Lance ), 1011083, 1029920, 48.0, 98.0, typeof( IronIngot ), 1044036, 20, 1044037 );
|
||||
|
||||
if ( Core.AOS )
|
||||
AddCraft( typeof( Pike ), 1011083, 1029918, 47.0, 97.0, typeof( IronIngot ), 1044036, 12, 1044037 );
|
||||
|
||||
AddCraft( typeof( ShortSpear ), 1011083, 1025123, 45.3, 95.3, typeof( IronIngot ), 1044036, 6, 1044037 );
|
||||
|
||||
if ( Core.AOS )
|
||||
AddCraft( typeof( Scythe ), 1011083, 1029914, 39.0, 89.0, typeof( IronIngot ), 1044036, 14, 1044037 );
|
||||
|
||||
AddCraft( typeof( Spear ), 1011083, 1023938, 49.0, 99.0, typeof( IronIngot ), 1044036, 12, 1044037 );
|
||||
AddCraft( typeof( WarFork ), 1011083, 1025125, 42.9, 92.9, typeof( IronIngot ), 1044036, 12, 1044037 );
|
||||
|
||||
// Not craftable (is this an AOS change ??)
|
||||
//AddCraft( typeof( Pitchfork ), 1011083, 1023720, 36.1, 86.1, typeof( IronIngot ), 1044036, 12, 1044037 );
|
||||
#endregion
|
||||
|
||||
#region Bashing
|
||||
AddCraft( typeof( HammerPick ), 1011084, 1025181, 34.2, 84.2, typeof( IronIngot ), 1044036, 16, 1044037 );
|
||||
AddCraft( typeof( Mace ), 1011084, 1023932, 14.5, 64.5, typeof( IronIngot ), 1044036, 6, 1044037 );
|
||||
AddCraft( typeof( Maul ), 1011084, 1025179, 19.4, 69.4, typeof( IronIngot ), 1044036, 10, 1044037 );
|
||||
|
||||
if ( Core.AOS )
|
||||
AddCraft( typeof( Scepter ), 1011084, 1029916, 21.4, 71.4, typeof( IronIngot ), 1044036, 10, 1044037 );
|
||||
|
||||
AddCraft( typeof( WarMace ), 1011084, 1025127, 28.0, 78.0, typeof( IronIngot ), 1044036, 14, 1044037 );
|
||||
AddCraft( typeof( WarHammer ), 1011084, 1025177, 34.2, 84.2, typeof( IronIngot ), 1044036, 16, 1044037 );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( Tessen ), 1011084, 1030222, 85.0, 135.0, typeof( IronIngot ), 1044036, 16, 1044037 );
|
||||
AddSkill( index, SkillName.Tailoring, 50.0, 55.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 10, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Dragon Scale Armor
|
||||
index = AddCraft( typeof( DragonGloves ), 1053114, 1029795, 68.9, 118.9, typeof( RedScales ), 1060883, 16, 1060884 );
|
||||
SetUseSubRes2( index, true );
|
||||
|
||||
index = AddCraft( typeof( DragonHelm ), 1053114, 1029797, 72.6, 122.6, typeof( RedScales ), 1060883, 20, 1060884 );
|
||||
SetUseSubRes2( index, true );
|
||||
|
||||
index = AddCraft( typeof( DragonLegs ), 1053114, 1029799, 78.8, 128.8, typeof( RedScales ), 1060883, 28, 1060884 );
|
||||
SetUseSubRes2( index, true );
|
||||
|
||||
index = AddCraft( typeof( DragonArms ), 1053114, 1029815, 76.3, 126.3, typeof( RedScales ), 1060883, 24, 1060884 );
|
||||
SetUseSubRes2( index, true );
|
||||
|
||||
index = AddCraft( typeof( DragonChest ), 1053114, 1029793, 85.0, 135.0, typeof( RedScales ), 1060883, 36, 1060884 );
|
||||
SetUseSubRes2( index, true );
|
||||
#endregion
|
||||
|
||||
// Set the overridable material
|
||||
SetSubRes( typeof( IronIngot ), 1044022 );
|
||||
|
||||
// Add every material you want the player to be able to choose from
|
||||
// This will override the overridable material
|
||||
AddSubRes( typeof( IronIngot ), 1044022, 00.0, 1044036, 1044267 );
|
||||
AddSubRes( typeof( DullCopperIngot ), 1044023, 65.0, 1044036, 1044268 );
|
||||
AddSubRes( typeof( ShadowIronIngot ), 1044024, 70.0, 1044036, 1044268 );
|
||||
AddSubRes( typeof( CopperIngot ), 1044025, 75.0, 1044036, 1044268 );
|
||||
AddSubRes( typeof( BronzeIngot ), 1044026, 80.0, 1044036, 1044268 );
|
||||
AddSubRes( typeof( GoldIngot ), 1044027, 85.0, 1044036, 1044268 );
|
||||
AddSubRes( typeof( AgapiteIngot ), 1044028, 90.0, 1044036, 1044268 );
|
||||
AddSubRes( typeof( VeriteIngot ), 1044029, 95.0, 1044036, 1044268 );
|
||||
AddSubRes( typeof( ValoriteIngot ), 1044030, 99.0, 1044036, 1044268 );
|
||||
|
||||
SetSubRes2( typeof( RedScales ), 1060875 );
|
||||
|
||||
AddSubRes2( typeof( RedScales ), 1060875, 0.0, 1053137, 1044268 );
|
||||
AddSubRes2( typeof( YellowScales ), 1060876, 0.0, 1053137, 1044268 );
|
||||
AddSubRes2( typeof( BlackScales ), 1060877, 0.0, 1053137, 1044268 );
|
||||
AddSubRes2( typeof( GreenScales ), 1060878, 0.0, 1053137, 1044268 );
|
||||
AddSubRes2( typeof( WhiteScales ), 1060879, 0.0, 1053137, 1044268 );
|
||||
AddSubRes2( typeof( BlueScales ), 1060880, 0.0, 1053137, 1044268 );
|
||||
|
||||
Resmelt = true;
|
||||
Repair = true;
|
||||
MarkOption = true;
|
||||
CanEnhance = Core.AOS;
|
||||
}
|
||||
}
|
||||
|
||||
public class ForgeAttribute : Attribute
|
||||
{
|
||||
public ForgeAttribute()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public class AnvilAttribute : Attribute
|
||||
{
|
||||
public AnvilAttribute()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
133
Scripts/Engines/Craft/DefBowFletching.cs
Normal file
133
Scripts/Engines/Craft/DefBowFletching.cs
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class DefBowFletching : CraftSystem
|
||||
{
|
||||
public override SkillName MainSkill
|
||||
{
|
||||
get { return SkillName.Fletching; }
|
||||
}
|
||||
|
||||
public override int GumpTitleNumber
|
||||
{
|
||||
get { return 1044006; } // <CENTER>BOWCRAFT AND FLETCHING MENU</CENTER>
|
||||
}
|
||||
|
||||
private static CraftSystem m_CraftSystem;
|
||||
|
||||
public static CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_CraftSystem == null )
|
||||
m_CraftSystem = new DefBowFletching();
|
||||
|
||||
return m_CraftSystem;
|
||||
}
|
||||
}
|
||||
|
||||
public override double GetChanceAtMin( CraftItem item )
|
||||
{
|
||||
return 0.5; // 50%
|
||||
}
|
||||
|
||||
private DefBowFletching() : base( 1, 1, 1.25 )// base( 1, 2, 1.7 )
|
||||
{
|
||||
}
|
||||
|
||||
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
|
||||
{
|
||||
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||
return 1044038; // You have worn out your tool!
|
||||
else if ( !BaseTool.CheckAccessible( tool, from ) )
|
||||
return 1044263; // The tool must be on your person to use.
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void PlayCraftEffect( Mobile from )
|
||||
{
|
||||
// no animation
|
||||
//if ( from.Body.Type == BodyType.Human && !from.Mounted )
|
||||
// from.Animate( 33, 5, 1, true, false, 0 );
|
||||
|
||||
from.PlaySound( 0x55 );
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
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.
|
||||
}
|
||||
}
|
||||
|
||||
public override CraftECA ECA{ get{ return CraftECA.FiftyPercentChanceMinusTenPercent; } }
|
||||
|
||||
public override void InitCraftList()
|
||||
{
|
||||
int index = -1;
|
||||
|
||||
// Materials
|
||||
AddCraft( typeof( Kindling ), 1044457, 1023553, 0.0, 00.0, typeof( Log ), 1044041, 1, 1044351 );
|
||||
|
||||
index = AddCraft( typeof( Shaft ), 1044457, 1027124, 0.0, 40.0, typeof( Log ), 1044041, 1, 1044351 );
|
||||
SetUseAllRes( index, true );
|
||||
|
||||
// Ammunition
|
||||
index = AddCraft( typeof( Arrow ), 1044565, 1023903, 0.0, 40.0, typeof( Shaft ), 1044560, 1, 1044561 );
|
||||
AddRes( index, typeof( Feather ), 1044562, 1, 1044563 );
|
||||
SetUseAllRes( index, true );
|
||||
|
||||
index = AddCraft( typeof( Bolt ), 1044565, 1027163, 0.0, 40.0, typeof( Shaft ), 1044560, 1, 1044561 );
|
||||
AddRes( index, typeof( Feather ), 1044562, 1, 1044563 );
|
||||
SetUseAllRes( index, true );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( FukiyaDarts ), 1044565, 1030246, 50.0, 90.0, typeof( Log ), 1044041, 1, 1044351 );
|
||||
SetUseAllRes( index, true );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
|
||||
// Weapons
|
||||
AddCraft( typeof( Bow ), 1044566, 1025042, 30.0, 70.0, typeof( Log ), 1044041, 7, 1044351 );
|
||||
AddCraft( typeof( Crossbow ), 1044566, 1023919, 60.0, 100.0, typeof( Log ), 1044041, 7, 1044351 );
|
||||
AddCraft( typeof( HeavyCrossbow ), 1044566, 1025117, 80.0, 120.0, typeof( Log ), 1044041, 10, 1044351 );
|
||||
|
||||
if ( Core.AOS )
|
||||
{
|
||||
AddCraft( typeof( CompositeBow ), 1044566, 1029922, 70.0, 110.0, typeof( Log ), 1044041, 7, 1044351 );
|
||||
AddCraft( typeof( RepeatingCrossbow ), 1044566, 1029923, 90.0, 130.0, typeof( Log ), 1044041, 10, 1044351 );
|
||||
}
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( Yumi ), 1044566, 1030224, 90.0, 130.0, typeof( Log ), 1044041, 10, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
|
||||
MarkOption = true;
|
||||
Repair = Core.AOS;
|
||||
}
|
||||
}
|
||||
}
|
||||
345
Scripts/Engines/Craft/DefCarpentry.cs
Normal file
345
Scripts/Engines/Craft/DefCarpentry.cs
Normal file
|
|
@ -0,0 +1,345 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class DefCarpentry : CraftSystem
|
||||
{
|
||||
public override SkillName MainSkill
|
||||
{
|
||||
get { return SkillName.Carpentry; }
|
||||
}
|
||||
|
||||
public override int GumpTitleNumber
|
||||
{
|
||||
get { return 1044004; } // <CENTER>CARPENTRY MENU</CENTER>
|
||||
}
|
||||
|
||||
private static CraftSystem m_CraftSystem;
|
||||
|
||||
public static CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_CraftSystem == null )
|
||||
m_CraftSystem = new DefCarpentry();
|
||||
|
||||
return m_CraftSystem;
|
||||
}
|
||||
}
|
||||
|
||||
public override double GetChanceAtMin( CraftItem item )
|
||||
{
|
||||
return 0.5; // 50%
|
||||
}
|
||||
|
||||
private DefCarpentry() : base( 1, 1, 1.25 )// base( 1, 1, 3.0 )
|
||||
{
|
||||
}
|
||||
|
||||
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
|
||||
{
|
||||
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||
return 1044038; // You have worn out your tool!
|
||||
else if ( !BaseTool.CheckAccessible( tool, from ) )
|
||||
return 1044263; // The tool must be on your person to use.
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void PlayCraftEffect( Mobile from )
|
||||
{
|
||||
// no animation
|
||||
//if ( from.Body.Type == BodyType.Human && !from.Mounted )
|
||||
// from.Animate( 9, 5, 1, true, false, 0 );
|
||||
|
||||
from.PlaySound( 0x23D );
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
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.
|
||||
}
|
||||
}
|
||||
|
||||
public override void InitCraftList()
|
||||
{
|
||||
int index = -1;
|
||||
|
||||
// Other Items
|
||||
index = AddCraft( typeof( Board ), 1044294, 1027127, 0.0, 0.0, typeof( Log ), 1044466, 1, 1044465 );
|
||||
SetUseAllRes( index, true );
|
||||
|
||||
AddCraft( typeof( BarrelStaves ), 1044294, 1027857, 00.0, 25.0, typeof( Log ), 1044041, 5, 1044351 );
|
||||
AddCraft( typeof( BarrelLid ), 1044294, 1027608, 11.0, 36.0, typeof( Log ), 1044041, 4, 1044351 );
|
||||
AddCraft( typeof( ShortMusicStand ), 1044294, 1044313, 78.9, 103.9, typeof( Log ), 1044041, 15, 1044351 );
|
||||
AddCraft( typeof( TallMusicStand ), 1044294, 1044315, 81.5, 106.5, typeof( Log ), 1044041, 20, 1044351 );
|
||||
AddCraft( typeof( Easle ), 1044294, 1044317, 86.8, 111.8, typeof( Log ), 1044041, 20, 1044351 );
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( RedHangingLantern ), 1044294, 1029412, 65.0, 90.0, typeof( Log ), 1044041, 5, 1044351 );
|
||||
AddRes( index, typeof( BlankScroll ), 1044377, 10, 1044378 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( WhiteHangingLantern ), 1044294, 1029416, 65.0, 90.0, typeof( Log ), 1044041, 5, 1044351 );
|
||||
AddRes( index, typeof( BlankScroll ), 1044377, 10, 1044378 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( ShojiScreen ), 1044294, 1029423, 80.0, 105.0, typeof( Log ), 1044041, 75, 1044351 );
|
||||
AddSkill( index, SkillName.Tailoring, 50.0, 55.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 60, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( BambooScreen ), 1044294, 1029428, 80.0, 105.0, typeof( Log ), 1044041, 75, 1044351 );
|
||||
AddSkill( index, SkillName.Tailoring, 50.0, 55.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 60, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
|
||||
// Furniture
|
||||
AddCraft( typeof( FootStool ), 1044291, 1022910, 11.0, 36.0, typeof( Log ), 1044041, 9, 1044351 );
|
||||
AddCraft( typeof( Stool ), 1044291, 1022602, 11.0, 36.0, typeof( Log ), 1044041, 9, 1044351 );
|
||||
AddCraft( typeof( BambooChair ), 1044291, 1044300, 21.0, 46.0, typeof( Log ), 1044041, 13, 1044351 );
|
||||
AddCraft( typeof( WoodenChair ), 1044291, 1044301, 21.0, 46.0, typeof( Log ), 1044041, 13, 1044351 );
|
||||
AddCraft( typeof( FancyWoodenChairCushion ), 1044291, 1044302, 42.1, 67.1, typeof( Log ), 1044041, 15, 1044351 );
|
||||
AddCraft( typeof( WoodenChairCushion ), 1044291, 1044303, 42.1, 67.1, typeof( Log ), 1044041, 13, 1044351 );
|
||||
AddCraft( typeof( WoodenBench ), 1044291, 1022860, 52.6, 77.6, typeof( Log ), 1044041, 17, 1044351 );
|
||||
AddCraft( typeof( WoodenThrone ), 1044291, 1044304, 52.6, 77.6, typeof( Log ), 1044041, 17, 1044351 );
|
||||
AddCraft( typeof( Throne ), 1044291, 1044305, 73.6, 98.6, typeof( Log ), 1044041, 19, 1044351 );
|
||||
AddCraft( typeof( Nightstand ), 1044291, 1044306, 42.1, 67.1, typeof( Log ), 1044041, 17, 1044351 );
|
||||
AddCraft( typeof( WritingTable ), 1044291, 1022890, 63.1, 88.1, typeof( Log ), 1044041, 17, 1044351 );
|
||||
AddCraft( typeof( YewWoodTable ), 1044291, 1044307, 63.1, 88.1, typeof( Log ), 1044041, 23, 1044351 );
|
||||
AddCraft( typeof( LargeTable ), 1044291, 1044308, 84.2, 109.2, typeof( Log ), 1044041, 27, 1044351 );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( ElegantLowTable ), 1044291, 1030265, 80.0, 105.0, typeof( Log ), 1044041, 35, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( PlainLowTable ), 1044291, 1030266, 80.0, 105.0, typeof( Log ), 1044041, 35, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
|
||||
// Containers
|
||||
AddCraft( typeof( WoodenBox ), 1044292, 1023709, 21.0, 46.0, typeof( Log ), 1044041, 10, 1044351 );
|
||||
AddCraft( typeof( SmallCrate ), 1044292, 1044309, 10.0, 35.0, typeof( Log ), 1044041, 8 , 1044351 );
|
||||
AddCraft( typeof( MediumCrate ), 1044292, 1044310, 31.0, 56.0, typeof( Log ), 1044041, 15, 1044351 );
|
||||
AddCraft( typeof( LargeCrate ), 1044292, 1044311, 47.3, 72.3, typeof( Log ), 1044041, 18, 1044351 );
|
||||
AddCraft( typeof( WoodenChest ), 1044292, 1023650, 73.6, 98.6, typeof( Log ), 1044041, 20, 1044351 );
|
||||
AddCraft( typeof( EmptyBookcase ), 1044292, 1022718, 31.5, 56.5, typeof( Log ), 1044041, 25, 1044351 );
|
||||
AddCraft( typeof( FancyArmoire ), 1044292, 1044312, 84.2, 109.2, typeof( Log ), 1044041, 35, 1044351 );
|
||||
AddCraft( typeof( Armoire ), 1044292, 1022643, 84.2, 109.2, typeof( Log ), 1044041, 35, 1044351 );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( PlainWoodenChest ), 1044292, 1030251, 90.0, 115.0, typeof( Log ), 1044041, 30, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( OrnateWoodenChest ), 1044292, 1030253, 90.0, 115.0, typeof( Log ), 1044041, 30, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( GildedWoodenChest ), 1044292, 1030255, 90.0, 115.0, typeof( Log ), 1044041, 30, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( WoodenFootLocker ), 1044292, 1030257, 90.0, 115.0, typeof( Log ), 1044041, 30, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( FinishedWoodenChest ),1044292, 1030259, 90.0, 115.0, typeof( Log ), 1044041, 30, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( TallCabinet ), 1044292, 1030261, 90.0, 115.0, typeof( Log ), 1044041, 35, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( ShortCabinet ), 1044292, 1030263, 90.0, 115.0, typeof( Log ), 1044041, 35, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( RedArmoire ), 1044292, 1030328, 90.0, 115.0, typeof( Log ), 1044041, 40, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( ElegantArmoire ), 1044292, 1030330, 90.0, 115.0, typeof( Log ), 1044041, 40, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( MapleArmoire ), 1044292, 1030328, 90.0, 115.0, typeof( Log ), 1044041, 40, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( CherryArmoire ), 1044292, 1030328, 90.0, 115.0, typeof( Log ), 1044041, 40, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
|
||||
index = AddCraft( typeof( Keg ), 1044292, 1023711, 57.8, 82.8, typeof( BarrelStaves ), 1044288, 3, 1044253 );
|
||||
AddRes( index, typeof( BarrelHoops ), 1044289, 1, 1044253 );
|
||||
AddRes( index, typeof( BarrelLid ), 1044251, 1, 1044253 );
|
||||
|
||||
// Staves and Shields
|
||||
AddCraft( typeof( ShepherdsCrook ), 1044295, 1023713, 78.9, 103.9, typeof( Log ), 1044041, 7, 1044351 );
|
||||
AddCraft( typeof( QuarterStaff ), 1044295, 1023721, 73.6, 98.6, typeof( Log ), 1044041, 6, 1044351 );
|
||||
AddCraft( typeof( GnarledStaff ), 1044295, 1025112, 78.9, 103.9, typeof( Log ), 1044041, 7, 1044351 );
|
||||
AddCraft( typeof( WoodenShield ), 1044295, 1027034, 52.6, 77.6, typeof( Log ), 1044041, 9, 1044351 );
|
||||
|
||||
index = AddCraft( typeof( FishingPole ), Core.AOS ? 1044294 : 1044295, 1023519, 68.4, 93.4, typeof( Log ), 1044041, 5, 1044351 ); //This is in the categor of Other during AoS
|
||||
AddSkill( index, SkillName.Tailoring, 40.0, 45.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 5, 1044287 );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( Bokuto ), 1044295, 1030227, 70.0, 95.0, typeof( Log ), 1044041, 6, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( Fukiya ), 1044295, 1030229, 60.0, 85.0, typeof( Log ), 1044041, 6, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( Tetsubo ), 1044295, 1030225, 85.0, 110.0, typeof( Log ), 1044041, 8, 1044351 );
|
||||
AddSkill( index, SkillName.Tinkering, 40.0, 45.0 );
|
||||
AddRes( index, typeof( IronIngot ), 1044036, 5, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
|
||||
// Instruments
|
||||
index = AddCraft( typeof( LapHarp ), 1044293, 1023762, 63.1, 88.1, typeof( Log ), 1044041, 20, 1044351 );
|
||||
AddSkill( index, SkillName.Musicianship, 45.0, 50.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 10, 1044287 );
|
||||
|
||||
index = AddCraft( typeof( Harp ), 1044293, 1023761, 78.9, 103.9, typeof( Log ), 1044041, 35, 1044351 );
|
||||
AddSkill( index, SkillName.Musicianship, 45.0, 50.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 15, 1044287 );
|
||||
|
||||
index = AddCraft( typeof( Drums ), 1044293, 1023740, 57.8, 82.8, typeof( Log ), 1044041, 20, 1044351 );
|
||||
AddSkill( index, SkillName.Musicianship, 45.0, 50.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 10, 1044287 );
|
||||
|
||||
index = AddCraft( typeof( Lute ), 1044293, 1023763, 68.4, 93.4, typeof( Log ), 1044041, 25, 1044351 );
|
||||
AddSkill( index, SkillName.Musicianship, 45.0, 50.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 10, 1044287 );
|
||||
|
||||
index = AddCraft( typeof( Tambourine ), 1044293, 1023741, 57.8, 82.8, typeof( Log ), 1044041, 15, 1044351 );
|
||||
AddSkill( index, SkillName.Musicianship, 45.0, 50.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 10, 1044287 );
|
||||
|
||||
index = AddCraft( typeof( TambourineTassel ), 1044293, 1044320, 57.8, 82.8, typeof( Log ), 1044041, 15, 1044351 );
|
||||
AddSkill( index, SkillName.Musicianship, 45.0, 50.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 15, 1044287 );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( BambooFlute ), 1044293, 1030247, 80.0, 105.0, typeof( Log ), 1044041, 15, 1044351 );
|
||||
AddSkill( index, SkillName.Musicianship, 45.0, 50.0 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
|
||||
// Misc
|
||||
index = AddCraft( typeof( SmallBedSouthDeed ), 1044290, 1044321, 94.7, 113.1, typeof( Log ), 1044041, 100, 1044351 );
|
||||
AddSkill( index, SkillName.Tailoring, 75.0, 80.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 100, 1044287 );
|
||||
index = AddCraft( typeof( SmallBedEastDeed ), 1044290, 1044322, 94.7, 113.1, typeof( Log ), 1044041, 100, 1044351 );
|
||||
AddSkill( index, SkillName.Tailoring, 75.0, 80.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 100, 1044287 );
|
||||
index = AddCraft( typeof( LargeBedSouthDeed ), 1044290,1044323, 94.7, 113.1, typeof( Log ), 1044041, 150, 1044351 );
|
||||
AddSkill( index, SkillName.Tailoring, 75.0, 80.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 150, 1044287 );
|
||||
index = AddCraft( typeof( LargeBedEastDeed ), 1044290, 1044324, 94.7, 113.1, typeof( Log ), 1044041, 150, 1044351 );
|
||||
AddSkill( index, SkillName.Tailoring, 75.0, 80.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 150, 1044287 );
|
||||
AddCraft( typeof( DartBoardSouthDeed ), 1044290, 1044325, 15.7, 40.7, typeof( Log ), 1044041, 5, 1044351 );
|
||||
AddCraft( typeof( DartBoardEastDeed ), 1044290, 1044326, 15.7, 40.7, typeof( Log ), 1044041, 5, 1044351 );
|
||||
AddCraft( typeof( BallotBoxDeed ), 1044290, 1044327, 47.3, 72.3, typeof( Log ), 1044041, 5, 1044351 );
|
||||
index = AddCraft( typeof( PentagramDeed ), 1044290, 1044328, 100.0, 125.0, typeof( Log ), 1044041, 100, 1044351 );
|
||||
AddSkill( index, SkillName.Magery, 75.0, 80.0 );
|
||||
AddRes( index, typeof( IronIngot ), 1044036, 40, 1044037 );
|
||||
index = AddCraft( typeof( AbbatoirDeed ), 1044290, 1044329, 100.0, 125.0, typeof( Log ), 1044041, 100, 1044351 );
|
||||
AddSkill( index, SkillName.Magery, 50.0, 55.0 );
|
||||
AddRes( index, typeof( IronIngot ), 1044036, 40, 1044037 );
|
||||
|
||||
if ( Core.AOS )
|
||||
{
|
||||
AddCraft( typeof( PlayerBBEast ), 1044290, 1062420, 85.0, 110.0, typeof( Log ), 1044041, 50, 1044351 );
|
||||
AddCraft( typeof( PlayerBBSouth ), 1044290, 1062421, 85.0, 110.0, typeof( Log ), 1044041, 50, 1044351 );
|
||||
}
|
||||
|
||||
// Blacksmithy
|
||||
index = AddCraft( typeof( SmallForgeDeed ), 1044296, 1044330, 73.6, 98.6, typeof( Log ), 1044041, 5, 1044351 );
|
||||
AddSkill( index, SkillName.Blacksmith, 75.0, 80.0 );
|
||||
AddRes( index, typeof( IronIngot ), 1044036, 75, 1044037 );
|
||||
index = AddCraft( typeof( LargeForgeEastDeed ), 1044296, 1044331, 78.9, 103.9, typeof( Log ), 1044041, 5, 1044351 );
|
||||
AddSkill( index, SkillName.Blacksmith, 80.0, 85.0 );
|
||||
AddRes( index, typeof( IronIngot ), 1044036, 100, 1044037 );
|
||||
index = AddCraft( typeof( LargeForgeSouthDeed ), 1044296, 1044332, 78.9, 103.9, typeof( Log ), 1044041, 5, 1044351 );
|
||||
AddSkill( index, SkillName.Blacksmith, 80.0, 85.0 );
|
||||
AddRes( index, typeof( IronIngot ), 1044036, 100, 1044037 );
|
||||
index = AddCraft( typeof( AnvilEastDeed ), 1044296, 1044333, 73.6, 98.6, typeof( Log ), 1044041, 5, 1044351 );
|
||||
AddSkill( index, SkillName.Blacksmith, 75.0, 80.0 );
|
||||
AddRes( index, typeof( IronIngot ), 1044036, 150, 1044037 );
|
||||
index = AddCraft( typeof( AnvilSouthDeed ), 1044296, 1044334, 73.6, 98.6, typeof( Log ), 1044041, 5, 1044351 );
|
||||
AddSkill( index, SkillName.Blacksmith, 75.0, 80.0 );
|
||||
AddRes( index, typeof( IronIngot ), 1044036, 150, 1044037 );
|
||||
|
||||
// Training
|
||||
index = AddCraft( typeof( TrainingDummyEastDeed ), 1044297, 1044335, 68.4, 93.4, typeof( Log ), 1044041, 55, 1044351 );
|
||||
AddSkill( index, SkillName.Tailoring, 50.0, 55.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 60, 1044287 );
|
||||
index = AddCraft( typeof( TrainingDummySouthDeed ), 1044297, 1044336, 68.4, 93.4, typeof( Log ), 1044041, 55, 1044351 );
|
||||
AddSkill( index, SkillName.Tailoring, 50.0, 55.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 60, 1044287 );
|
||||
index = AddCraft( typeof( PickpocketDipEastDeed ), 1044297, 1044337, 73.6, 98.6, typeof( Log ), 1044041, 65, 1044351 );
|
||||
AddSkill( index, SkillName.Tailoring, 50.0, 55.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 60, 1044287 );
|
||||
index = AddCraft( typeof( PickpocketDipSouthDeed ), 1044297, 1044338, 73.6, 98.6, typeof( Log ), 1044041, 65, 1044351 );
|
||||
AddSkill( index, SkillName.Tailoring, 50.0, 55.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 60, 1044287 );
|
||||
|
||||
// Tailoring
|
||||
index = AddCraft( typeof( Dressform ), 1044298, 1044339, 63.1, 88.1, typeof( Log ), 1044041, 25, 1044351 );
|
||||
AddSkill( index, SkillName.Tailoring, 65.0, 70.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 10, 1044287 );
|
||||
index = AddCraft( typeof( SpinningwheelEastDeed ), 1044298, 1044341, 73.6, 98.6, typeof( Log ), 1044041, 75, 1044351 );
|
||||
AddSkill( index, SkillName.Tailoring, 65.0, 70.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 25, 1044287 );
|
||||
index = AddCraft( typeof( SpinningwheelSouthDeed ), 1044298, 1044342, 73.6, 98.6, typeof( Log ), 1044041, 75, 1044351 );
|
||||
AddSkill( index, SkillName.Tailoring, 65.0, 70.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 25, 1044287 );
|
||||
index = AddCraft( typeof( LoomEastDeed ), 1044298, 1044343, 84.2, 109.2, typeof( Log ), 1044041, 85, 1044351 );
|
||||
AddSkill( index, SkillName.Tailoring, 65.0, 70.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 25, 1044287 );
|
||||
index = AddCraft( typeof( LoomSouthDeed ), 1044298, 1044344, 84.2, 109.2, typeof( Log ), 1044041, 85, 1044351 );
|
||||
AddSkill( index, SkillName.Tailoring, 65.0, 70.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 25, 1044287 );
|
||||
|
||||
// Cooking
|
||||
index = AddCraft( typeof( StoneOvenEastDeed ), 1044299, 1044345, 68.4, 93.4, typeof( Log ), 1044041, 85, 1044351 );
|
||||
AddSkill( index, SkillName.Tinkering, 50.0, 55.0 );
|
||||
AddRes( index, typeof( IronIngot ), 1044036, 125, 1044037 );
|
||||
index = AddCraft( typeof( StoneOvenSouthDeed ), 1044299, 1044346, 68.4, 93.4, typeof( Log ), 1044041, 85, 1044351 );
|
||||
AddSkill( index, SkillName.Tinkering, 50.0, 55.0 );
|
||||
AddRes( index, typeof( IronIngot ), 1044036, 125, 1044037 );
|
||||
index = AddCraft( typeof( FlourMillEastDeed ), 1044299, 1044347, 94.7, 119.7, typeof( Log ), 1044041, 100, 1044351 );
|
||||
AddSkill( index, SkillName.Tinkering, 50.0, 55.0 );
|
||||
AddRes( index, typeof( IronIngot ), 1044036, 50, 1044037 );
|
||||
index = AddCraft( typeof( FlourMillSouthDeed ), 1044299, 1044348, 94.7, 119.7, typeof( Log ), 1044041, 100, 1044351 );
|
||||
AddSkill( index, SkillName.Tinkering, 50.0, 55.0 );
|
||||
AddRes( index, typeof( IronIngot ), 1044036, 50, 1044037 );
|
||||
AddCraft( typeof( WaterTroughEastDeed ), 1044299, 1044349, 94.7, 119.7, typeof( Log ), 1044041, 150, 1044351 );
|
||||
AddCraft( typeof( WaterTroughSouthDeed ), 1044299, 1044350, 94.7, 119.7, typeof( Log ), 1044041, 150, 1044351 );
|
||||
|
||||
MarkOption = true;
|
||||
Repair = Core.AOS;
|
||||
}
|
||||
}
|
||||
}
|
||||
88
Scripts/Engines/Craft/DefCartography.cs
Normal file
88
Scripts/Engines/Craft/DefCartography.cs
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class DefCartography : CraftSystem
|
||||
{
|
||||
public override SkillName MainSkill
|
||||
{
|
||||
get { return SkillName.Cartography; }
|
||||
}
|
||||
|
||||
public override int GumpTitleNumber
|
||||
{
|
||||
get { return 1044008; } // <CENTER>CARTOGRAPHY MENU</CENTER>
|
||||
}
|
||||
|
||||
public override double GetChanceAtMin( CraftItem item )
|
||||
{
|
||||
return 0.0; // 0%
|
||||
}
|
||||
|
||||
private static CraftSystem m_CraftSystem;
|
||||
|
||||
public static CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_CraftSystem == null )
|
||||
m_CraftSystem = new DefCartography();
|
||||
|
||||
return m_CraftSystem;
|
||||
}
|
||||
}
|
||||
|
||||
private DefCartography() : base( 1, 1, 1.25 )// base( 1, 1, 3.0 )
|
||||
{
|
||||
}
|
||||
|
||||
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
|
||||
{
|
||||
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||
return 1044038; // You have worn out your tool!
|
||||
else if ( !BaseTool.CheckAccessible( tool, from ) )
|
||||
return 1044263; // The tool must be on your person to use.
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void PlayCraftEffect( Mobile from )
|
||||
{
|
||||
from.PlaySound( 0x249 );
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
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.
|
||||
}
|
||||
}
|
||||
|
||||
public override void InitCraftList()
|
||||
{
|
||||
AddCraft( typeof( LocalMap ), 1044448, 1015230, 10.0, 70.0, typeof( BlankMap ), 1044449, 1, 1044450 );
|
||||
AddCraft( typeof( CityMap ), 1044448, 1015231, 25.0, 85.0, typeof( BlankMap ), 1044449, 1, 1044450 );
|
||||
AddCraft( typeof( SeaChart ), 1044448, 1015232, 35.0, 95.0, typeof( BlankMap ), 1044449, 1, 1044450 );
|
||||
AddCraft( typeof( WorldMap ), 1044448, 1015233, 39.5, 99.5, typeof( BlankMap ), 1044449, 1, 1044450 );
|
||||
}
|
||||
}
|
||||
}
|
||||
247
Scripts/Engines/Craft/DefCooking.cs
Normal file
247
Scripts/Engines/Craft/DefCooking.cs
Normal file
|
|
@ -0,0 +1,247 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class DefCooking : CraftSystem
|
||||
{
|
||||
public override SkillName MainSkill
|
||||
{
|
||||
get { return SkillName.Cooking; }
|
||||
}
|
||||
|
||||
public override int GumpTitleNumber
|
||||
{
|
||||
get { return 1044003; } // <CENTER>COOKING MENU</CENTER>
|
||||
}
|
||||
|
||||
private static CraftSystem m_CraftSystem;
|
||||
|
||||
public static CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_CraftSystem == null )
|
||||
m_CraftSystem = new DefCooking();
|
||||
|
||||
return m_CraftSystem;
|
||||
}
|
||||
}
|
||||
|
||||
public override CraftECA ECA{ get{ return CraftECA.ChanceMinusSixtyToFourtyFive; } }
|
||||
|
||||
public override double GetChanceAtMin( CraftItem item )
|
||||
{
|
||||
return 0.0; // 0%
|
||||
}
|
||||
|
||||
private DefCooking() : base( 1, 1, 1.25 )// base( 1, 1, 1.5 )
|
||||
{
|
||||
}
|
||||
|
||||
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
|
||||
{
|
||||
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||
return 1044038; // You have worn out your tool!
|
||||
else if ( !BaseTool.CheckAccessible( tool, from ) )
|
||||
return 1044263; // The tool must be on your person to use.
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void PlayCraftEffect( Mobile from )
|
||||
{
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
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.
|
||||
}
|
||||
}
|
||||
|
||||
public override void InitCraftList()
|
||||
{
|
||||
int index = -1;
|
||||
|
||||
/* Begin Ingredients */
|
||||
index = AddCraft( typeof( SackFlour ), 1044495, 1024153, 0.0, 100.0, typeof( WheatSheaf ), 1044489, 2, 1044490 );
|
||||
SetNeedMill( index, true );
|
||||
|
||||
index = AddCraft( typeof( Dough ), 1044495, 1024157, 0.0, 100.0, typeof( SackFlour ), 1044468, 1, 1044253 );
|
||||
AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
|
||||
|
||||
index = AddCraft( typeof( SweetDough ), 1044495, 1041340, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
|
||||
AddRes( index, typeof( JarHoney ), 1044472, 1, 1044253 );
|
||||
|
||||
index = AddCraft( typeof( CakeMix ), 1044495, 1041002, 0.0, 100.0, typeof( SackFlour ), 1044468, 1, 1044253 );
|
||||
AddRes( index, typeof( SweetDough ), 1044475, 1, 1044253 );
|
||||
|
||||
index = AddCraft( typeof( CookieMix ), 1044495, 1024159, 0.0, 100.0, typeof( JarHoney ), 1044472, 1, 1044253 );
|
||||
AddRes( index, typeof( SweetDough ), 1044475, 1, 1044253 );
|
||||
/* End Ingredients */
|
||||
|
||||
/* Begin Preparations */
|
||||
index = AddCraft( typeof( UnbakedQuiche ), 1044496, 1041339, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
|
||||
AddRes( index, typeof( Eggs ), 1044477, 1, 1044253 );
|
||||
|
||||
// TODO: This must also support chicken and lamb legs
|
||||
index = AddCraft( typeof( UnbakedMeatPie ), 1044496, 1041338, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
|
||||
AddRes( index, typeof( RawRibs ), 1044482, 1, 1044253 );
|
||||
|
||||
index = AddCraft( typeof( UncookedSausagePizza ), 1044496, 1041337, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
|
||||
AddRes( index, typeof( Sausage ), 1044483, 1, 1044253 );
|
||||
|
||||
index = AddCraft( typeof( UncookedCheesePizza ), 1044496, 1041341, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
|
||||
AddRes( index, typeof( CheeseWheel ), 1044486, 1, 1044253 );
|
||||
|
||||
index = AddCraft( typeof( UnbakedFruitPie ), 1044496, 1041334, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
|
||||
AddRes( index, typeof( Pear ), 1044481, 1, 1044253 );
|
||||
|
||||
index = AddCraft( typeof( UnbakedPeachCobbler ), 1044496, 1041335, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
|
||||
AddRes( index, typeof( Peach ), 1044480, 1, 1044253 );
|
||||
|
||||
index = AddCraft( typeof( UnbakedApplePie ), 1044496, 1041336, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
|
||||
AddRes( index, typeof( Apple ), 1044479, 1, 1044253 );
|
||||
|
||||
index = AddCraft( typeof( UnbakedPumpkinPie ), 1044496, 1041342, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
|
||||
AddRes( index, typeof( Pumpkin ), 1044484, 1, 1044253 );
|
||||
|
||||
if ( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( GreenTea ), 1044496, 1030315, 80.0, 130.0, typeof( GreenTeaBasket ), 1030316, 1, 1044253 );
|
||||
AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
SetNeedOven( index, true );
|
||||
|
||||
index = AddCraft( typeof( WasabiClumps ), 1044496, 1029451, 70.0, 120.0, typeof( BaseBeverage ), 1046458, 1, 1044253 );
|
||||
AddRes( index, typeof( WoodenBowlOfPeas ), 1025633, 3, 1044253 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( SushiRolls ), 1044496, 1030303, 90.0, 120.0, typeof( BaseBeverage ), 1046458, 1, 1044253 );
|
||||
AddRes( index, typeof( RawFishSteak ), 1044476, 10, 1044253 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( SushiPlatter ), 1044496, 1030305, 90.0, 120.0, typeof( BaseBeverage ), 1046458, 1, 1044253 );
|
||||
AddRes( index, typeof( RawFishSteak ), 1044476, 10, 1044253 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
|
||||
index = AddCraft( typeof( TribalPaint ), 1044496, 1040000, 80.0, 80.0, typeof( SackFlour ), 1044468, 1, 1044253 );
|
||||
AddRes( index, typeof( TribalBerry ), 1046460, 1, 1044253 );
|
||||
|
||||
if ( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( EggBomb ), 1044496, 1030249, 90.0, 120.0, typeof( Eggs ), 1044477, 1, 1044253 );
|
||||
AddRes( index, typeof( SackFlour ), 1044468, 3, 1044253 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
/* End Preparations */
|
||||
|
||||
/* Begin Baking */
|
||||
index = AddCraft( typeof( BreadLoaf ), 1044497, 1024156, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
|
||||
SetNeedOven( index, true );
|
||||
|
||||
index = AddCraft( typeof( Cookies ), 1044497, 1025643, 0.0, 100.0, typeof( CookieMix ), 1044474, 1, 1044253 );
|
||||
SetNeedOven( index, true );
|
||||
|
||||
index = AddCraft( typeof( Cake ), 1044497, 1022537, 0.0, 100.0, typeof( CakeMix ), 1044471, 1, 1044253 );
|
||||
SetNeedOven( index, true );
|
||||
|
||||
index = AddCraft( typeof( Muffins ), 1044497, 1022539, 0.0, 100.0, typeof( SweetDough ), 1044475, 1, 1044253 );
|
||||
SetNeedOven( index, true );
|
||||
|
||||
index = AddCraft( typeof( Quiche ), 1044497, 1041345, 0.0, 100.0, typeof( UnbakedQuiche ), 1044518, 1, 1044253 );
|
||||
SetNeedOven( index, true );
|
||||
|
||||
index = AddCraft( typeof( MeatPie ), 1044497, 1041347, 0.0, 100.0, typeof( UnbakedMeatPie ), 1044519, 1, 1044253 );
|
||||
SetNeedOven( index, true );
|
||||
|
||||
index = AddCraft( typeof( SausagePizza ), 1044497, 1044517, 0.0, 100.0, typeof( UncookedSausagePizza ), 1044520, 1, 1044253 );
|
||||
SetNeedOven( index, true );
|
||||
|
||||
index = AddCraft( typeof( CheesePizza ), 1044497, 1044516, 0.0, 100.0, typeof( UncookedCheesePizza ), 1044521, 1, 1044253 );
|
||||
SetNeedOven( index, true );
|
||||
|
||||
index = AddCraft( typeof( FruitPie ), 1044497, 1041346, 0.0, 100.0, typeof( UnbakedFruitPie ), 1044522, 1, 1044253 );
|
||||
SetNeedOven( index, true );
|
||||
|
||||
index = AddCraft( typeof( PeachCobbler ), 1044497, 1041344, 0.0, 100.0, typeof( UnbakedPeachCobbler ), 1044523, 1, 1044253 );
|
||||
SetNeedOven( index, true );
|
||||
|
||||
index = AddCraft( typeof( ApplePie ), 1044497, 1041343, 0.0, 100.0, typeof( UnbakedApplePie ), 1044524, 1, 1044253 );
|
||||
SetNeedOven( index, true );
|
||||
|
||||
index = AddCraft( typeof( PumpkinPie ), 1044497, 1041348, 0.0, 100.0, typeof( UnbakedPumpkinPie ), 1046461, 1, 1044253 );
|
||||
SetNeedOven( index, true );
|
||||
|
||||
if ( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( MisoSoup ), 1044497, 1030317, 60.0, 110.0, typeof( RawFishSteak ), 1044476, 1, 1044253 );
|
||||
AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
SetNeedOven( index, true );
|
||||
|
||||
index = AddCraft( typeof( WhiteMisoSoup ), 1044497, 1030318, 60.0, 110.0, typeof( RawFishSteak ), 1044476, 1, 1044253 );
|
||||
AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
SetNeedOven( index, true );
|
||||
|
||||
index = AddCraft( typeof( RedMisoSoup ), 1044497, 1030319, 60.0, 110.0, typeof( RawFishSteak ), 1044476, 1, 1044253 );
|
||||
AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
SetNeedOven( index, true );
|
||||
|
||||
index = AddCraft( typeof( AwaseMisoSoup ), 1044497, 1030320, 60.0, 110.0, typeof( RawFishSteak ), 1044476, 1, 1044253 );
|
||||
AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
SetNeedOven( index, true );
|
||||
}
|
||||
/* End Baking */
|
||||
|
||||
/* Begin Barbecue */
|
||||
index = AddCraft( typeof( CookedBird ), 1044498, 1022487, 0.0, 100.0, typeof( RawBird ), 1044470, 1, 1044253 );
|
||||
SetNeedHeat( index, true );
|
||||
SetUseAllRes( index, true );
|
||||
|
||||
index = AddCraft( typeof( ChickenLeg ), 1044498, 1025640, 0.0, 100.0, typeof( RawChickenLeg ), 1044473, 1, 1044253 );
|
||||
SetNeedHeat( index, true );
|
||||
SetUseAllRes( index, true );
|
||||
|
||||
index = AddCraft( typeof( FishSteak ), 1044498, 1022427, 0.0, 100.0, typeof( RawFishSteak ), 1044476, 1, 1044253 );
|
||||
SetNeedHeat( index, true );
|
||||
SetUseAllRes( index, true );
|
||||
|
||||
index = AddCraft( typeof( FriedEggs ), 1044498, 1022486, 0.0, 100.0, typeof( Eggs ), 1044477, 1, 1044253 );
|
||||
SetNeedHeat( index, true );
|
||||
SetUseAllRes( index, true );
|
||||
|
||||
index = AddCraft( typeof( LambLeg ), 1044498, 1025642, 0.0, 100.0, typeof( RawLambLeg ), 1044478, 1, 1044253 );
|
||||
SetNeedHeat( index, true );
|
||||
SetUseAllRes( index, true );
|
||||
|
||||
index = AddCraft( typeof( Ribs ), 1044498, 1022546, 0.0, 100.0, typeof( RawRibs ), 1044485, 1, 1044253 );
|
||||
SetNeedHeat( index, true );
|
||||
SetUseAllRes( index, true );
|
||||
/* End Barbecue */
|
||||
}
|
||||
}
|
||||
}
|
||||
133
Scripts/Engines/Craft/DefGlassblowing.cs
Normal file
133
Scripts/Engines/Craft/DefGlassblowing.cs
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class DefGlassblowing : CraftSystem
|
||||
{
|
||||
public override SkillName MainSkill
|
||||
{
|
||||
get{ return SkillName.Alchemy; }
|
||||
}
|
||||
|
||||
public override int GumpTitleNumber
|
||||
{
|
||||
get{ return 1044622; } // <CENTER>Glassblowing MENU</CENTER>
|
||||
}
|
||||
|
||||
private static CraftSystem m_CraftSystem;
|
||||
|
||||
public static CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_CraftSystem == null )
|
||||
m_CraftSystem = new DefGlassblowing();
|
||||
|
||||
return m_CraftSystem;
|
||||
}
|
||||
}
|
||||
|
||||
public override double GetChanceAtMin( CraftItem item )
|
||||
{
|
||||
return 0.0; // 0%
|
||||
}
|
||||
|
||||
private DefGlassblowing() : base( 1, 1, 1.25 )// base( 1, 2, 1.7 )
|
||||
{
|
||||
}
|
||||
|
||||
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
|
||||
{
|
||||
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||
return 1044038; // You have worn out your tool!
|
||||
else if ( !BaseTool.CheckTool( tool, from ) )
|
||||
return 1048146; // If you have a tool equipped, you must use that tool.
|
||||
else if ( !(from is PlayerMobile && ((PlayerMobile)from).Glassblowing && from.Skills[SkillName.Alchemy].Base >= 100.0) )
|
||||
return 1044634; // You havent learned glassblowing.
|
||||
else if ( !BaseTool.CheckAccessible( tool, from ) )
|
||||
return 1044263; // The tool must be on your person to use.
|
||||
|
||||
bool anvil, forge;
|
||||
|
||||
DefBlacksmithy.CheckAnvilAndForge( from, 2, out anvil, out forge );
|
||||
|
||||
if ( forge )
|
||||
return 0;
|
||||
|
||||
return 1044628; // You must be near a forge to blow glass.
|
||||
}
|
||||
|
||||
public override void PlayCraftEffect( Mobile from )
|
||||
{
|
||||
from.PlaySound( 0x2B ); // bellows
|
||||
|
||||
//if ( from.Body.Type == BodyType.Human && !from.Mounted )
|
||||
// from.Animate( 9, 5, 1, true, false, 0 );
|
||||
|
||||
//new InternalTimer( from ).Start();
|
||||
}
|
||||
|
||||
// Delay to synchronize the sound with the hit on the anvil
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_From;
|
||||
|
||||
public InternalTimer( Mobile from ) : base( TimeSpan.FromSeconds( 0.7 ) )
|
||||
{
|
||||
m_From = from;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_From.PlaySound( 0x2A );
|
||||
}
|
||||
}
|
||||
|
||||
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.
|
||||
}
|
||||
}
|
||||
|
||||
public override void InitCraftList()
|
||||
{
|
||||
int index = AddCraft( typeof( Bottle ), 1044050, 1023854, 52.5, 102.5, typeof( Sand ), 1044625, 1, 1044627 );
|
||||
SetUseAllRes( index, true );
|
||||
|
||||
AddCraft( typeof( SmallFlask ), 1044050, 1044610, 52.5, 102.5, typeof( Sand ), 1044625, 2, 1044627 );
|
||||
AddCraft( typeof( MediumFlask ), 1044050, 1044611, 52.5, 102.5, typeof( Sand ), 1044625, 3, 1044627 );
|
||||
AddCraft( typeof( CurvedFlask ), 1044050, 1044612, 55.0, 105.0, typeof( Sand ), 1044625, 2, 1044627 );
|
||||
AddCraft( typeof( LongFlask ), 1044050, 1044613, 57.5, 107.5, typeof( Sand ), 1044625, 4, 1044627 );
|
||||
AddCraft( typeof( LargeFlask ), 1044050, 1044623, 60.0, 110.0, typeof( Sand ), 1044625, 5, 1044627 );
|
||||
AddCraft( typeof( AniSmallBlueFlask ), 1044050, 1044614, 60.0, 110.0, typeof( Sand ), 1044625, 5, 1044627 );
|
||||
AddCraft( typeof( AniLargeVioletFlask ), 1044050, 1044615, 60.0, 110.0, typeof( Sand ), 1044625, 5, 1044627 );
|
||||
AddCraft( typeof( AniRedRibbedFlask ), 1044050, 1044624, 60.0, 110.0, typeof( Sand ), 1044625, 7, 1044627 );
|
||||
AddCraft( typeof( EmptyVialsWRack ), 1044050, 1044616, 65.0, 115.0, typeof( Sand ), 1044625, 8, 1044627 );
|
||||
AddCraft( typeof( FullVialsWRack ), 1044050, 1044617, 65.0, 115.0, typeof( Sand ), 1044625, 9, 1044627 );
|
||||
AddCraft( typeof( SpinningHourglass ), 1044050, 1044618, 75.0, 125.0, typeof( Sand ), 1044625, 10, 1044627 );
|
||||
}
|
||||
}
|
||||
}
|
||||
308
Scripts/Engines/Craft/DefInscription.cs
Normal file
308
Scripts/Engines/Craft/DefInscription.cs
Normal file
|
|
@ -0,0 +1,308 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class DefInscription : CraftSystem
|
||||
{
|
||||
public override SkillName MainSkill
|
||||
{
|
||||
get { return SkillName.Inscribe; }
|
||||
}
|
||||
|
||||
public override int GumpTitleNumber
|
||||
{
|
||||
get { return 1044009; } // <CENTER>INSCRIPTION MENU</CENTER>
|
||||
}
|
||||
|
||||
private static CraftSystem m_CraftSystem;
|
||||
|
||||
public static CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_CraftSystem == null )
|
||||
m_CraftSystem = new DefInscription();
|
||||
|
||||
return m_CraftSystem;
|
||||
}
|
||||
}
|
||||
|
||||
public override double GetChanceAtMin( CraftItem item )
|
||||
{
|
||||
return 0.0; // 0%
|
||||
}
|
||||
|
||||
private DefInscription() : base( 1, 1, 1.25 )// base( 1, 1, 3.0 )
|
||||
{
|
||||
}
|
||||
|
||||
public override int CanCraft( Mobile from, BaseTool tool, Type typeItem )
|
||||
{
|
||||
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||
return 1044038; // You have worn out your tool!
|
||||
else if ( !BaseTool.CheckAccessible( tool, from ) )
|
||||
return 1044263; // The tool must be on your person to use.
|
||||
|
||||
if ( typeItem != null )
|
||||
{
|
||||
object o = Activator.CreateInstance( typeItem );
|
||||
|
||||
if ( o is SpellScroll )
|
||||
{
|
||||
SpellScroll scroll = (SpellScroll)o;
|
||||
Spellbook book = Spellbook.Find( from, scroll.SpellID );
|
||||
|
||||
bool hasSpell = ( book != null && book.HasSpell( scroll.SpellID ) );
|
||||
|
||||
scroll.Delete();
|
||||
|
||||
return ( hasSpell ? 0 : 1042404 ); // null : You don't have that spell!
|
||||
}
|
||||
else if ( o is Item )
|
||||
{
|
||||
((Item)o).Delete();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void PlayCraftEffect( Mobile from )
|
||||
{
|
||||
from.PlaySound( 0x249 );
|
||||
}
|
||||
|
||||
private static Type typeofSpellScroll = typeof( SpellScroll );
|
||||
|
||||
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.
|
||||
}
|
||||
}
|
||||
|
||||
private int m_Circle, m_Mana;
|
||||
|
||||
private enum Reg{ BlackPearl, Bloodmoss, Garlic, Ginseng, MandrakeRoot, Nightshade, SulfurousAsh, SpidersSilk }
|
||||
|
||||
private Type[] m_RegTypes = new Type[]
|
||||
{
|
||||
typeof( BlackPearl ),
|
||||
typeof( Bloodmoss ),
|
||||
typeof( Garlic ),
|
||||
typeof( Ginseng ),
|
||||
typeof( MandrakeRoot ),
|
||||
typeof( Nightshade ),
|
||||
typeof( SulfurousAsh ),
|
||||
typeof( SpidersSilk )
|
||||
};
|
||||
|
||||
private int m_Index;
|
||||
|
||||
private void AddSpell( Type type, params Reg[] regs )
|
||||
{
|
||||
double minSkill, maxSkill;
|
||||
|
||||
switch ( m_Circle )
|
||||
{
|
||||
default:
|
||||
case 0: minSkill = -25.0; maxSkill = 25.0; break;
|
||||
case 1: minSkill = -10.8; maxSkill = 39.2; break;
|
||||
case 2: minSkill = 03.5; maxSkill = 53.5; break;
|
||||
case 3: minSkill = 17.8; maxSkill = 67.8; break;
|
||||
case 4: minSkill = 32.1; maxSkill = 82.1; break;
|
||||
case 5: minSkill = 46.4; maxSkill = 96.4; break;
|
||||
case 6: minSkill = 60.7; maxSkill = 110.7; break;
|
||||
case 7: minSkill = 75.0; maxSkill = 125.0; break;
|
||||
}
|
||||
|
||||
int index = AddCraft( type, 1044369 + m_Circle, 1044381 + m_Index++, minSkill, maxSkill, m_RegTypes[(int)regs[0]], 1044353 + (int)regs[0], 1, 1044361 + (int)regs[0] );
|
||||
|
||||
for ( int i = 1; i < regs.Length; ++i )
|
||||
AddRes( index, m_RegTypes[(int)regs[i]], 1044353 + (int)regs[i], 1, 1044361 + (int)regs[i] );
|
||||
|
||||
AddRes( index, typeof( BlankScroll ), 1044377, 1, 1044378 );
|
||||
|
||||
SetManaReq( index, m_Mana );
|
||||
}
|
||||
|
||||
private void AddNecroSpell( int spell, int mana, double minSkill, Type type, params Type[] regs )
|
||||
{
|
||||
int index = AddCraft( type, 1061677, 1060509 + spell, minSkill, minSkill + 1.0, regs[0], 1020000 + CraftItem.ItemIDOf( regs[0] ), 1, 501627 ); //Yes, on OSI it's only 1.0 skill diff'. Don't blame me, blame OSI.
|
||||
|
||||
for ( int i = 1; i < regs.Length; ++i )
|
||||
AddRes( index, regs[i], 1020000 + CraftItem.ItemIDOf( regs[i] ), 1, 501627 );
|
||||
|
||||
AddRes( index, typeof( BlankScroll ), 1044377, 1, 1044378 );
|
||||
|
||||
SetManaReq( index, mana );
|
||||
}
|
||||
|
||||
public override void InitCraftList()
|
||||
{
|
||||
m_Circle = 0;
|
||||
m_Mana = 4;
|
||||
|
||||
AddSpell( typeof( ReactiveArmorScroll ), Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( ClumsyScroll ), Reg.Bloodmoss, Reg.Nightshade );
|
||||
AddSpell( typeof( CreateFoodScroll ), Reg.Garlic, Reg.Ginseng, Reg.MandrakeRoot );
|
||||
AddSpell( typeof( FeeblemindScroll ), Reg.Nightshade, Reg.Ginseng );
|
||||
AddSpell( typeof( HealScroll ), Reg.Garlic, Reg.Ginseng, Reg.SpidersSilk );
|
||||
AddSpell( typeof( MagicArrowScroll ), Reg.SulfurousAsh );
|
||||
AddSpell( typeof( NightSightScroll ), Reg.SpidersSilk, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( WeakenScroll ), Reg.Garlic, Reg.Nightshade );
|
||||
|
||||
m_Circle = 1;
|
||||
m_Mana = 6;
|
||||
|
||||
AddSpell( typeof( AgilityScroll ), Reg.Bloodmoss, Reg.MandrakeRoot );
|
||||
AddSpell( typeof( CunningScroll ), Reg.Nightshade, Reg.MandrakeRoot );
|
||||
AddSpell( typeof( CureScroll ), Reg.Garlic, Reg.Ginseng );
|
||||
AddSpell( typeof( HarmScroll ), Reg.Nightshade, Reg.SpidersSilk );
|
||||
AddSpell( typeof( MagicTrapScroll ), Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( MagicUnTrapScroll ), Reg.Bloodmoss, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( ProtectionScroll ), Reg.Garlic, Reg.Ginseng, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( StrengthScroll ), Reg.Nightshade, Reg.MandrakeRoot );
|
||||
|
||||
m_Circle = 2;
|
||||
m_Mana = 9;
|
||||
|
||||
AddSpell( typeof( BlessScroll ), Reg.Garlic, Reg.MandrakeRoot );
|
||||
AddSpell( typeof( FireballScroll ), Reg.BlackPearl );
|
||||
AddSpell( typeof( MagicLockScroll ), Reg.Bloodmoss, Reg.Garlic, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( PoisonScroll ), Reg.Nightshade );
|
||||
AddSpell( typeof( TelekinisisScroll ), Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( TeleportScroll ), Reg.Bloodmoss, Reg.MandrakeRoot );
|
||||
AddSpell( typeof( UnlockScroll ), Reg.Bloodmoss, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( WallOfStoneScroll ), Reg.Bloodmoss, Reg.Garlic );
|
||||
|
||||
m_Circle = 3;
|
||||
m_Mana = 11;
|
||||
|
||||
AddSpell( typeof( ArchCureScroll ), Reg.Garlic, Reg.Ginseng, Reg.MandrakeRoot );
|
||||
AddSpell( typeof( ArchProtectionScroll ), Reg.Garlic, Reg.Ginseng, Reg.MandrakeRoot, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( CurseScroll ), Reg.Garlic, Reg.Nightshade, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( FireFieldScroll ), Reg.BlackPearl, Reg.SpidersSilk, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( GreaterHealScroll ), Reg.Garlic, Reg.SpidersSilk, Reg.MandrakeRoot, Reg.Ginseng );
|
||||
AddSpell( typeof( LightningScroll ), Reg.MandrakeRoot, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( ManaDrainScroll ), Reg.BlackPearl, Reg.SpidersSilk, Reg.MandrakeRoot );
|
||||
AddSpell( typeof( RecallScroll ), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot );
|
||||
|
||||
m_Circle = 4;
|
||||
m_Mana = 14;
|
||||
|
||||
AddSpell( typeof( BladeSpiritsScroll ), Reg.BlackPearl, Reg.Nightshade, Reg.MandrakeRoot );
|
||||
AddSpell( typeof( DispelFieldScroll ), Reg.BlackPearl, Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( IncognitoScroll ), Reg.Bloodmoss, Reg.Garlic, Reg.Nightshade );
|
||||
AddSpell( typeof( MagicReflectScroll ), Reg.Garlic, Reg.MandrakeRoot, Reg.SpidersSilk );
|
||||
AddSpell( typeof( MindBlastScroll ), Reg.BlackPearl, Reg.MandrakeRoot, Reg.Nightshade, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( ParalyzeScroll ), Reg.Garlic, Reg.MandrakeRoot, Reg.SpidersSilk );
|
||||
AddSpell( typeof( PoisonFieldScroll ), Reg.BlackPearl, Reg.Nightshade, Reg.SpidersSilk );
|
||||
AddSpell( typeof( SummonCreatureScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk );
|
||||
|
||||
m_Circle = 5;
|
||||
m_Mana = 20;
|
||||
|
||||
AddSpell( typeof( DispelScroll ), Reg.Garlic, Reg.MandrakeRoot, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( EnergyBoltScroll ), Reg.BlackPearl, Reg.Nightshade );
|
||||
AddSpell( typeof( ExplosionScroll ), Reg.Bloodmoss, Reg.MandrakeRoot );
|
||||
AddSpell( typeof( InvisibilityScroll ), Reg.Bloodmoss, Reg.Nightshade );
|
||||
AddSpell( typeof( MarkScroll ), Reg.Bloodmoss, Reg.BlackPearl, Reg.MandrakeRoot );
|
||||
AddSpell( typeof( MassCurseScroll ), Reg.Garlic, Reg.MandrakeRoot, Reg.Nightshade, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( ParalyzeFieldScroll ), Reg.BlackPearl, Reg.Ginseng, Reg.SpidersSilk );
|
||||
AddSpell( typeof( RevealScroll ), Reg.Bloodmoss, Reg.SulfurousAsh );
|
||||
|
||||
m_Circle = 6;
|
||||
m_Mana = 40;
|
||||
|
||||
AddSpell( typeof( ChainLightningScroll ), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( EnergyFieldScroll ), Reg.BlackPearl, Reg.MandrakeRoot, Reg.SpidersSilk, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( FlamestrikeScroll ), Reg.SpidersSilk, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( GateTravelScroll ), Reg.BlackPearl, Reg.MandrakeRoot, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( ManaVampireScroll ), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk );
|
||||
AddSpell( typeof( MassDispelScroll ), Reg.BlackPearl, Reg.Garlic, Reg.MandrakeRoot, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( MeteorSwarmScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SulfurousAsh, Reg.SpidersSilk );
|
||||
AddSpell( typeof( PolymorphScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk );
|
||||
|
||||
m_Circle = 7;
|
||||
m_Mana = 50;
|
||||
|
||||
AddSpell( typeof( EarthquakeScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.Ginseng, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( EnergyVortexScroll ), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.Nightshade );
|
||||
AddSpell( typeof( ResurrectionScroll ), Reg.Bloodmoss, Reg.Garlic, Reg.Ginseng );
|
||||
AddSpell( typeof( SummonAirElementalScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk );
|
||||
AddSpell( typeof( SummonDaemonScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( SummonEarthElementalScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk );
|
||||
AddSpell( typeof( SummonFireElementalScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk, Reg.SulfurousAsh );
|
||||
AddSpell( typeof( SummonWaterElementalScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk );
|
||||
|
||||
if ( Core.SE )
|
||||
{
|
||||
AddNecroSpell( 0, 23, 39.6, typeof( AnimateDeadScroll ), Reagent.GraveDust, Reagent.DaemonBlood );
|
||||
AddNecroSpell( 1, 13, 19.6, typeof( BloodOathScroll ), Reagent.DaemonBlood );
|
||||
AddNecroSpell( 2, 11, 19.6, typeof( CorpseSkinScroll ), Reagent.BatWing, Reagent.GraveDust );
|
||||
AddNecroSpell( 3, 7, 19.6, typeof( CurseWeaponScroll ), Reagent.PigIron );
|
||||
AddNecroSpell( 4, 11, 19.6, typeof( EvilOmenScroll ), Reagent.BatWing, Reagent.NoxCrystal );
|
||||
AddNecroSpell( 5, 11, 39.6, typeof( HorrificBeastScroll ), Reagent.BatWing, Reagent.DaemonBlood );
|
||||
AddNecroSpell( 6, 23, 69.6, typeof( LichFormScroll ), Reagent.GraveDust, Reagent.DaemonBlood, Reagent.NoxCrystal );
|
||||
AddNecroSpell( 7, 17, 29.6, typeof( MindRotScroll ), Reagent.BatWing, Reagent.DaemonBlood, Reagent.PigIron );
|
||||
AddNecroSpell( 8, 5, 19.6, typeof( PainSpikeScroll ), Reagent.GraveDust, Reagent.PigIron );
|
||||
AddNecroSpell( 9, 17, 49.6, typeof( PoisonStrikeScroll ), Reagent.NoxCrystal );
|
||||
AddNecroSpell( 10, 29, 64.6, typeof( StrangleScroll ), Reagent.DaemonBlood, Reagent.NoxCrystal );
|
||||
AddNecroSpell( 11, 17, 29.6, typeof( SummonFamiliarScroll ), Reagent.BatWing, Reagent.GraveDust, Reagent.DaemonBlood );
|
||||
AddNecroSpell( 12, 23, 98.6, typeof( VampiricEmbraceScroll ), Reagent.BatWing, Reagent.NoxCrystal, Reagent.PigIron );
|
||||
AddNecroSpell( 13, 41, 79.6, typeof( VengefulSpiritScroll ), Reagent.BatWing, Reagent.GraveDust, Reagent.PigIron );
|
||||
AddNecroSpell( 14, 23, 59.6, typeof( WitherScroll ), Reagent.GraveDust, Reagent.NoxCrystal, Reagent.PigIron );
|
||||
AddNecroSpell( 15, 17, 79.6, typeof( WraithFormScroll ), Reagent.NoxCrystal, Reagent.PigIron );
|
||||
AddNecroSpell( 16, 40, 79.6, typeof( ExorcismScroll ), Reagent.NoxCrystal, Reagent.GraveDust );
|
||||
}
|
||||
|
||||
// Runebook
|
||||
int index = AddCraft( typeof( Runebook ), 1044294, 1041267, 45.0, 95.0, typeof( BlankScroll ), 1044377, 8, 1044378 );
|
||||
AddRes( index, typeof( RecallScroll ), 1044445, 1, 1044253 );
|
||||
AddRes( index, typeof( GateTravelScroll ), 1044446, 1, 1044253 );
|
||||
|
||||
if ( Core.AOS )
|
||||
{
|
||||
// Bulk order book
|
||||
AddCraft( typeof( Engines.BulkOrders.BulkOrderBook ), 1044294, 1028793, 65.0, 115.0, typeof( BlankScroll ), 1044377, 10, 1044378 );
|
||||
}
|
||||
|
||||
if ( Core.SE )
|
||||
AddCraft( typeof( Spellbook ), 1044294, 1023834, 50.0, 150.0, typeof( BlankScroll ), 1044377, 10, 1044378 );
|
||||
|
||||
MarkOption = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
150
Scripts/Engines/Craft/DefMasonry.cs
Normal file
150
Scripts/Engines/Craft/DefMasonry.cs
Normal file
|
|
@ -0,0 +1,150 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class DefMasonry : CraftSystem
|
||||
{
|
||||
public override SkillName MainSkill
|
||||
{
|
||||
get{ return SkillName.Carpentry; }
|
||||
}
|
||||
|
||||
public override int GumpTitleNumber
|
||||
{
|
||||
get{ return 1044500; } // <CENTER>MASONRY MENU</CENTER>
|
||||
}
|
||||
|
||||
private static CraftSystem m_CraftSystem;
|
||||
|
||||
public static CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_CraftSystem == null )
|
||||
m_CraftSystem = new DefMasonry();
|
||||
|
||||
return m_CraftSystem;
|
||||
}
|
||||
}
|
||||
|
||||
public override double GetChanceAtMin( CraftItem item )
|
||||
{
|
||||
return 0.0; // 0%
|
||||
}
|
||||
|
||||
private DefMasonry() : base( 1, 1, 1.25 )// base( 1, 2, 1.7 )
|
||||
{
|
||||
}
|
||||
|
||||
public override bool RetainsColorFrom( CraftItem item, Type type )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
|
||||
{
|
||||
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||
return 1044038; // You have worn out your tool!
|
||||
else if ( !BaseTool.CheckTool( tool, from ) )
|
||||
return 1048146; // If you have a tool equipped, you must use that tool.
|
||||
else if ( !(from is PlayerMobile && ((PlayerMobile)from).Masonry && from.Skills[SkillName.Carpentry].Base >= 100.0) )
|
||||
return 1044633; // You havent learned stonecraft.
|
||||
else if ( !BaseTool.CheckAccessible( tool, from ) )
|
||||
return 1044263; // The tool must be on your person to use.
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void PlayCraftEffect( Mobile from )
|
||||
{
|
||||
// no effects
|
||||
//if ( from.Body.Type == BodyType.Human && !from.Mounted )
|
||||
// from.Animate( 9, 5, 1, true, false, 0 );
|
||||
//new InternalTimer( from ).Start();
|
||||
}
|
||||
|
||||
// Delay to synchronize the sound with the hit on the anvil
|
||||
private class InternalTimer : Timer
|
||||
{
|
||||
private Mobile m_From;
|
||||
|
||||
public InternalTimer( Mobile from ) : base( TimeSpan.FromSeconds( 0.7 ) )
|
||||
{
|
||||
m_From = from;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
m_From.PlaySound( 0x23D );
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
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.
|
||||
}
|
||||
}
|
||||
|
||||
public override void InitCraftList()
|
||||
{
|
||||
// Decorations
|
||||
AddCraft( typeof( Vase ), 1044501, 1022888, 52.5, 102.5, typeof( Granite ), 1044514, 1, 1044513 );
|
||||
AddCraft( typeof( LargeVase ), 1044501, 1022887, 52.5, 102.5, typeof( Granite ), 1044514, 3, 1044513 );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
int index = AddCraft( typeof( SmallUrn ), 1044501, 1029244, 82.0, 132.0, typeof( Granite ), 1044514, 3, 1044513 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( SmallTowerSculpture ), 1044501, 1029242, 82.0, 132.0, typeof( Granite ), 1044514, 3, 1044513 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
|
||||
// Furniture
|
||||
AddCraft( typeof( StoneChair ), 1044502, 1024635, 55.0, 105.0, typeof( Granite ), 1044514, 4, 1044513 );
|
||||
AddCraft( typeof( MediumStoneTableEastDeed ), 1044502, 1044508, 65.0, 115.0, typeof( Granite ), 1044514, 6, 1044513 );
|
||||
AddCraft( typeof( MediumStoneTableSouthDeed ), 1044502, 1044509, 65.0, 115.0, typeof( Granite ), 1044514, 6, 1044513 );
|
||||
AddCraft( typeof( LargeStoneTableEastDeed ), 1044502, 1044511, 75.0, 125.0, typeof( Granite ), 1044514, 9, 1044513 );
|
||||
AddCraft( typeof( LargeStoneTableSouthDeed ), 1044502, 1044512, 75.0, 125.0, typeof( Granite ), 1044514, 9, 1044513 );
|
||||
|
||||
// Statues
|
||||
AddCraft( typeof( StatueSouth ), 1044503, 1044505, 60.0, 120.0, typeof( Granite ), 1044514, 3, 1044513 );
|
||||
AddCraft( typeof( StatueNorth ), 1044503, 1044506, 60.0, 120.0, typeof( Granite ), 1044514, 3, 1044513 );
|
||||
AddCraft( typeof( StatueEast ), 1044503, 1044507, 60.0, 120.0, typeof( Granite ), 1044514, 3, 1044513 );
|
||||
AddCraft( typeof( StatuePegasus ), 1044503, 1044510, 70.0, 130.0, typeof( Granite ), 1044514, 4, 1044513 );
|
||||
|
||||
SetSubRes( typeof( Granite ), 1044525 );
|
||||
|
||||
AddSubRes( typeof( Granite ), 1044525, 00.0, 1044514, 1044526 );
|
||||
AddSubRes( typeof( DullCopperGranite ), 1044023, 65.0, 1044514, 1044527 );
|
||||
AddSubRes( typeof( ShadowIronGranite ), 1044024, 70.0, 1044514, 1044527 );
|
||||
AddSubRes( typeof( CopperGranite ), 1044025, 75.0, 1044514, 1044527 );
|
||||
AddSubRes( typeof( BronzeGranite ), 1044026, 80.0, 1044514, 1044527 );
|
||||
AddSubRes( typeof( GoldGranite ), 1044027, 85.0, 1044514, 1044527 );
|
||||
AddSubRes( typeof( AgapiteGranite ), 1044028, 90.0, 1044514, 1044527 );
|
||||
AddSubRes( typeof( VeriteGranite ), 1044029, 95.0, 1044514, 1044527 );
|
||||
AddSubRes( typeof( ValoriteGranite ), 1044030, 99.0, 1044514, 1044527 );
|
||||
}
|
||||
}
|
||||
}
|
||||
324
Scripts/Engines/Craft/DefTailoring.cs
Normal file
324
Scripts/Engines/Craft/DefTailoring.cs
Normal file
|
|
@ -0,0 +1,324 @@
|
|||
using System;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class DefTailoring : CraftSystem
|
||||
{
|
||||
public override SkillName MainSkill
|
||||
{
|
||||
get { return SkillName.Tailoring; }
|
||||
}
|
||||
|
||||
public override int GumpTitleNumber
|
||||
{
|
||||
get { return 1044005; } // <CENTER>TAILORING MENU</CENTER>
|
||||
}
|
||||
|
||||
private static CraftSystem m_CraftSystem;
|
||||
|
||||
public static CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_CraftSystem == null )
|
||||
m_CraftSystem = new DefTailoring();
|
||||
|
||||
return m_CraftSystem;
|
||||
}
|
||||
}
|
||||
|
||||
public override CraftECA ECA{ get{ return CraftECA.ChanceMinusSixtyToFourtyFive; } }
|
||||
|
||||
public override double GetChanceAtMin( CraftItem item )
|
||||
{
|
||||
return 0.5; // 50%
|
||||
}
|
||||
|
||||
private DefTailoring() : base( 1, 1, 1.25 )// base( 1, 1, 4.5 )
|
||||
{
|
||||
}
|
||||
|
||||
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
|
||||
{
|
||||
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||
return 1044038; // You have worn out your tool!
|
||||
else if ( !BaseTool.CheckAccessible( tool, from ) )
|
||||
return 1044263; // The tool must be on your person to use.
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void PlayCraftEffect( Mobile from )
|
||||
{
|
||||
from.PlaySound( 0x248 );
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
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.
|
||||
}
|
||||
}
|
||||
|
||||
public override void InitCraftList()
|
||||
{
|
||||
int index = -1;
|
||||
|
||||
#region Hats
|
||||
AddCraft( typeof( SkullCap ), 1011375, 1025444, 0.0, 25.0, typeof( Cloth ), 1044286, 2, 1044287 );
|
||||
AddCraft( typeof( Bandana ), 1011375, 1025440, 0.0, 25.0, typeof( Cloth ), 1044286, 2, 1044287 );
|
||||
AddCraft( typeof( FloppyHat ), 1011375, 1025907, 6.2, 31.2, typeof( Cloth ), 1044286, 11, 1044287 );
|
||||
AddCraft( typeof( Cap ), 1011375, 1025909, -18.8, 6.2, typeof( Cloth ), 1044286, 11, 1044287 );
|
||||
AddCraft( typeof( WideBrimHat ), 1011375, 1025908, 6.2, 31.2, typeof( Cloth ), 1044286, 12, 1044287 );
|
||||
AddCraft( typeof( StrawHat ), 1011375, 1025911, 6.2, 31.2, typeof( Cloth ), 1044286, 10, 1044287 );
|
||||
AddCraft( typeof( TallStrawHat ), 1011375, 1025910, 6.7, 31.7, typeof( Cloth ), 1044286, 13, 1044287 );
|
||||
AddCraft( typeof( WizardsHat ), 1011375, 1025912, 7.2, 32.2, typeof( Cloth ), 1044286, 15, 1044287 );
|
||||
AddCraft( typeof( Bonnet ), 1011375, 1025913, 6.2, 31.2, typeof( Cloth ), 1044286, 11, 1044287 );
|
||||
AddCraft( typeof( FeatheredHat ), 1011375, 1025914, 6.2, 31.2, typeof( Cloth ), 1044286, 12, 1044287 );
|
||||
AddCraft( typeof( TricorneHat ), 1011375, 1025915, 6.2, 31.2, typeof( Cloth ), 1044286, 12, 1044287 );
|
||||
AddCraft( typeof( JesterHat ), 1011375, 1025916, 7.2, 32.2, typeof( Cloth ), 1044286, 15, 1044287 );
|
||||
|
||||
if ( Core.AOS )
|
||||
AddCraft( typeof( FlowerGarland ), 1011375, 1028965, 10.0, 35.0, typeof( Cloth ), 1044286, 5, 1044287 );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( ClothNinjaHood ), 1011375, 1030202, 80.0, 105.0, typeof( Cloth ), 1044286, 13, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( Kasa ), 1011375, 1030211, 60.0, 85.0, typeof( Cloth ), 1044286, 12, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Shirts
|
||||
AddCraft( typeof( Doublet ), 1015269, 1028059, 0, 25.0, typeof( Cloth ), 1044286, 8, 1044287 );
|
||||
AddCraft( typeof( Shirt ), 1015269, 1025399, 20.7, 45.7, typeof( Cloth ), 1044286, 8, 1044287 );
|
||||
AddCraft( typeof( FancyShirt ), 1015269, 1027933, 24.8, 49.8, typeof( Cloth ), 1044286, 8, 1044287 );
|
||||
AddCraft( typeof( Tunic ), 1015269, 1028097, 00.0, 25.0, typeof( Cloth ), 1044286, 12, 1044287 );
|
||||
AddCraft( typeof( Surcoat ), 1015269, 1028189, 8.2, 33.2, typeof( Cloth ), 1044286, 14, 1044287 );
|
||||
AddCraft( typeof( PlainDress ), 1015269, 1027937, 12.4, 37.4, typeof( Cloth ), 1044286, 10, 1044287 );
|
||||
AddCraft( typeof( FancyDress ), 1015269, 1027935, 33.1, 58.1, typeof( Cloth ), 1044286, 12, 1044287 );
|
||||
AddCraft( typeof( Cloak ), 1015269, 1025397, 41.4, 66.4, typeof( Cloth ), 1044286, 14, 1044287 );
|
||||
AddCraft( typeof( Robe ), 1015269, 1027939, 53.9, 78.9, typeof( Cloth ), 1044286, 16, 1044287 );
|
||||
AddCraft( typeof( JesterSuit ), 1015269, 1028095, 8.2, 33.2, typeof( Cloth ), 1044286, 24, 1044287 );
|
||||
|
||||
if ( Core.AOS )
|
||||
{
|
||||
AddCraft( typeof( FurCape ), 1015269, 1028969, 35.0, 60.0, typeof( Cloth ), 1044286, 13, 1044287 );
|
||||
AddCraft( typeof( GildedDress ), 1015269, 1028973, 37.5, 62.5, typeof( Cloth ), 1044286, 16, 1044287 );
|
||||
AddCraft( typeof( FormalShirt ), 1015269, 1028975, 26.0, 51.0, typeof( Cloth ), 1044286, 16, 1044287 );
|
||||
}
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( ClothNinjaJacket ), 1015269, 1030207, 75.0, 100.0, typeof( Cloth ), 1044286, 12, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( Kamishimo ), 1015269, 1030212, 75.0, 100.0, typeof( Cloth ), 1044286, 15, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( HakamaShita ), 1015269, 1030215, 40.0, 65.0, typeof( Cloth ), 1044286, 14, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( MaleKimono ), 1015269, 1030189, 50.0, 75.0, typeof( Cloth ), 1044286, 16, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( FemaleKimono ), 1015269, 1030190, 50.0, 75.0, typeof( Cloth ), 1044286, 16, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( JinBaori ), 1015269, 1030220, 30.0, 55.0, typeof( Cloth ), 1044286, 12, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
|
||||
// Pants
|
||||
#endregion
|
||||
|
||||
#region Pants
|
||||
AddCraft( typeof( ShortPants ), 1015279, 1025422, 24.8, 49.8, typeof( Cloth ), 1044286, 6, 1044287 );
|
||||
AddCraft( typeof( LongPants ), 1015279, 1025433, 24.8, 49.8, typeof( Cloth ), 1044286, 8, 1044287 );
|
||||
AddCraft( typeof( Kilt ), 1015279, 1025431, 20.7, 45.7, typeof( Cloth ), 1044286, 8, 1044287 );
|
||||
AddCraft( typeof( Skirt ), 1015279, 1025398, 29.0, 54.0, typeof( Cloth ), 1044286, 10, 1044287 );
|
||||
|
||||
if ( Core.AOS )
|
||||
AddCraft( typeof( FurSarong ), 1015279, 1028971, 35.0, 60.0, typeof( Cloth ), 1044286, 12, 1044287 );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( Hakama ), 1015279, 1030213, 50.0, 75.0, typeof( Cloth ), 1044286, 16, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( TattsukeHakama ), 1015279, 1030214, 50.0, 75.0, typeof( Cloth ), 1044286, 16, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Misc
|
||||
AddCraft( typeof( BodySash ), 1015283, 1025441, 4.1, 29.1, typeof( Cloth ), 1044286, 4, 1044287 );
|
||||
AddCraft( typeof( HalfApron ), 1015283, 1025435, 20.7, 45.7, typeof( Cloth ), 1044286, 6, 1044287 );
|
||||
AddCraft( typeof( FullApron ), 1015283, 1025437, 29.0, 54.0, typeof( Cloth ), 1044286, 10, 1044287 );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( Obi ), 1015283, 1030219, 20.0, 45.0, typeof( Cloth ), 1044286, 6, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
|
||||
AddCraft( typeof( OilCloth ), 1015283, 1041498, 74.6, 99.6, typeof( Cloth ), 1044286, 1, 1044287 );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( GozaMatEastDeed ), 1015283, 1030404, 55.0, 80.0, typeof( Cloth ), 1044286, 25, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( GozaMatSouthDeed ), 1015283, 1030405, 55.0, 80.0, typeof( Cloth ), 1044286, 25, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( SquareGozaMatEastDeed ), 1015283, 1030407, 55.0, 80.0, typeof( Cloth ), 1044286, 25, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( SquareGozaMatSouthDeed ), 1015283, 1030406, 55.0, 80.0, typeof( Cloth ), 1044286, 25, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( BrocadeGozaMatEastDeed ), 1015283, 1030408, 55.0, 80.0, typeof( Cloth ), 1044286, 25, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( BrocadeGozaMatSouthDeed ), 1015283, 1030409, 55.0, 80.0, typeof( Cloth ), 1044286, 25, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( BrocadeSquareGozaMatEastDeed ), 1015283, 1030411, 55.0, 80.0, typeof( Cloth ), 1044286, 25, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( BrocadeSquareGozaMatSouthDeed ), 1015283, 1030410, 55.0, 80.0, typeof( Cloth ), 1044286, 25, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Footwear
|
||||
if ( Core.AOS )
|
||||
AddCraft( typeof( FurBoots ), 1015288, 1028967, 50.0, 75.0, typeof( Cloth ), 1044286, 12, 1044287 );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( NinjaTabi ), 1015288, 1030210, 70.0, 95.0, typeof( Cloth ), 1044286, 10, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( SamuraiTabi ), 1015288, 1030209, 20.0, 45.0, typeof( Cloth ), 1044286, 6, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
|
||||
AddCraft( typeof( Sandals ), 1015288, 1025901, 12.4, 37.4, typeof( Leather ), 1044462, 4, 1044463 );
|
||||
AddCraft( typeof( Shoes ), 1015288, 1025904, 16.5, 41.5, typeof( Leather ), 1044462, 6, 1044463 );
|
||||
AddCraft( typeof( Boots ), 1015288, 1025899, 33.1, 58.1, typeof( Leather ), 1044462, 8, 1044463 );
|
||||
AddCraft( typeof( ThighBoots ), 1015288, 1025906, 41.4, 66.4, typeof( Leather ), 1044462, 10, 1044463 );
|
||||
#endregion
|
||||
|
||||
#region Leather Armor
|
||||
|
||||
AddCraft( typeof( LeatherGorget ), 1015293, 1025063, 53.9, 78.9, typeof( Leather ), 1044462, 4, 1044463 );
|
||||
AddCraft( typeof( LeatherCap ), 1015293, 1027609, 6.2, 31.2, typeof( Leather ), 1044462, 2, 1044463 );
|
||||
AddCraft( typeof( LeatherGloves ), 1015293, 1025062, 51.8, 76.8, typeof( Leather ), 1044462, 3, 1044463 );
|
||||
AddCraft( typeof( LeatherArms ), 1015293, 1025061, 53.9, 78.9, typeof( Leather ), 1044462, 8, 1044463 );
|
||||
AddCraft( typeof( LeatherLegs ), 1015293, 1025067, 66.3, 91.3, typeof( Leather ), 1044462, 10, 1044463 );
|
||||
AddCraft( typeof( LeatherChest ), 1015293, 1025068, 70.5, 95.5, typeof( Leather ), 1044462, 12, 1044463 );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( LeatherJingasa ), 1015293, 1030177, 45.0, 70.0, typeof( Leather ), 1044462, 4, 1044463 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( LeatherMempo ), 1015293, 1030181, 80.0, 105.0, typeof( Leather ), 1044462, 8, 1044463 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( LeatherDo ), 1015293, 1030182, 75.0, 100.0, typeof( Leather ), 1044462, 12, 1044463 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( LeatherHiroSode ), 1015293, 1030185, 55.0, 80.0, typeof( Leather ), 1044462, 5, 1044463 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( LeatherSuneate ), 1015293, 1030193, 68.0, 93.0, typeof( Leather ), 1044462, 12, 1044463 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( LeatherHaidate ), 1015293, 1030197, 68.0, 93.0, typeof( Leather ), 1044462, 12, 1044463 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( LeatherNinjaPants ), 1015293, 1030204, 80.0, 105.0, typeof( Leather ), 1044462, 13, 1044463 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( LeatherNinjaJacket ), 1015293, 1030206, 85.0, 110.0, typeof( Leather ), 1044462, 13, 1044463 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( LeatherNinjaBelt ), 1015293, 1030203, 50.0, 75.0, typeof( Leather ), 1044462, 15, 1044463 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( LeatherNinjaMitts ), 1015293, 1030205, 65.0, 90.0, typeof( Leather ), 1044462, 12, 1044463 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( LeatherNinjaHood ), 1015293, 1030201, 90.0, 115.0, typeof( Leather ), 1044462, 14, 1044463 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Studded Armor
|
||||
AddCraft( typeof( StuddedGorget ), 1015300, 1025078, 78.8, 103.8, typeof( Leather ), 1044462, 6, 1044463 );
|
||||
AddCraft( typeof( StuddedGloves ), 1015300, 1025077, 82.9, 107.9, typeof( Leather ), 1044462, 8, 1044463 );
|
||||
AddCraft( typeof( StuddedArms ), 1015300, 1025076, 87.1, 112.1, typeof( Leather ), 1044462, 10, 1044463 );
|
||||
AddCraft( typeof( StuddedLegs ), 1015300, 1025082, 91.2, 116.2, typeof( Leather ), 1044462, 12, 1044463 );
|
||||
AddCraft( typeof( StuddedChest ), 1015300, 1025083, 94.0, 119.0, typeof( Leather ), 1044462, 14, 1044463 );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( StuddedMempo ), 1015300, 1030216, 80.0, 105.0, typeof( Leather ), 1044462, 8, 1044463 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( StuddedDo ), 1015300, 1030183, 95.0, 120.0, typeof( Leather ), 1044462, 14, 1044463 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( StuddedHiroSode ), 1015300, 1030186, 85.0, 110.0, typeof( Leather ), 1044462, 8, 1044463 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( StuddedSuneate ), 1015300, 1030194, 92.0, 117.0, typeof( Leather ), 1044462, 14, 1044463 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
index = AddCraft( typeof( StuddedHaidate ), 1015300, 1030198, 92.0, 117.0, typeof( Leather ), 1044462, 14, 1044463 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Female Armor
|
||||
AddCraft( typeof( LeatherShorts ), 1015306, 1027168, 62.2, 87.2, typeof( Leather ), 1044462, 8, 1044463 );
|
||||
AddCraft( typeof( LeatherSkirt ), 1015306, 1027176, 58.0, 83.0, typeof( Leather ), 1044462, 6, 1044463 );
|
||||
AddCraft( typeof( LeatherBustierArms ), 1015306, 1027178, 58.0, 83.0, typeof( Leather ), 1044462, 6, 1044463 );
|
||||
AddCraft( typeof( StuddedBustierArms ), 1015306, 1027180, 82.9, 107.9, typeof( Leather ), 1044462, 8, 1044463 );
|
||||
AddCraft( typeof( FemaleLeatherChest ), 1015306, 1027174, 62.2, 87.2, typeof( Leather ), 1044462, 8, 1044463 );
|
||||
AddCraft( typeof( FemaleStuddedChest ), 1015306, 1027170, 87.1, 112.1, typeof( Leather ), 1044462, 10, 1044463 );
|
||||
#endregion
|
||||
|
||||
#region Bone Armor
|
||||
index = AddCraft( typeof( BoneHelm ), 1049149, 1025206, 85.0, 110.0, typeof( Leather ), 1044462, 4, 1044463 );
|
||||
AddRes( index, typeof( Bone ), 1049064, 2, 1049063 );
|
||||
|
||||
index = AddCraft( typeof( BoneGloves ), 1049149, 1025205, 89.0, 114.0, typeof( Leather ), 1044462, 6, 1044463 );
|
||||
AddRes( index, typeof( Bone ), 1049064, 2, 1049063 );
|
||||
|
||||
index = AddCraft( typeof( BoneArms ), 1049149, 1025203, 92.0, 117.0, typeof( Leather ), 1044462, 8, 1044463 );
|
||||
AddRes( index, typeof( Bone ), 1049064, 4, 1049063 );
|
||||
|
||||
index = AddCraft( typeof( BoneLegs ), 1049149, 1025202, 95.0, 120.0, typeof( Leather ), 1044462, 10, 1044463 );
|
||||
AddRes( index, typeof( Bone ), 1049064, 6, 1049063 );
|
||||
|
||||
index = AddCraft( typeof( BoneChest ), 1049149, 1025199, 96.0, 121.0, typeof( Leather ), 1044462, 12, 1044463 );
|
||||
AddRes( index, typeof( Bone ), 1049064, 10, 1049063 );
|
||||
#endregion
|
||||
|
||||
// Set the overridable material
|
||||
SetSubRes( typeof( Leather ), 1049150 );
|
||||
|
||||
// Add every material you want the player to be able to choose from
|
||||
// This will override the overridable material
|
||||
AddSubRes( typeof( Leather ), 1049150, 00.0, 1044462, 1049311 );
|
||||
AddSubRes( typeof( SpinedLeather ), 1049151, 65.0, 1044462, 1049311 );
|
||||
AddSubRes( typeof( HornedLeather ), 1049152, 80.0, 1044462, 1049311 );
|
||||
AddSubRes( typeof( BarbedLeather ), 1049153, 99.0, 1044462, 1049311 );
|
||||
|
||||
MarkOption = true;
|
||||
Repair = Core.AOS;
|
||||
CanEnhance = Core.AOS;
|
||||
}
|
||||
}
|
||||
}
|
||||
493
Scripts/Engines/Craft/DefTinkering.cs
Normal file
493
Scripts/Engines/Craft/DefTinkering.cs
Normal file
|
|
@ -0,0 +1,493 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Factions;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
public class DefTinkering : CraftSystem
|
||||
{
|
||||
public override SkillName MainSkill
|
||||
{
|
||||
get { return SkillName.Tinkering; }
|
||||
}
|
||||
|
||||
public override int GumpTitleNumber
|
||||
{
|
||||
get { return 1044007; } // <CENTER>TINKERING MENU</CENTER>
|
||||
}
|
||||
|
||||
private static CraftSystem m_CraftSystem;
|
||||
|
||||
public static CraftSystem CraftSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( m_CraftSystem == null )
|
||||
m_CraftSystem = new DefTinkering();
|
||||
|
||||
return m_CraftSystem;
|
||||
}
|
||||
}
|
||||
|
||||
private DefTinkering() : base( 1, 1, 1.25 )// base( 1, 1, 3.0 )
|
||||
{
|
||||
}
|
||||
|
||||
public override double GetChanceAtMin( CraftItem item )
|
||||
{
|
||||
if ( item.NameNumber == 1044258 || item.NameNumber == 1046445 ) // potion keg and faction trap removal kit
|
||||
return 0.5; // 50%
|
||||
|
||||
return 0.0; // 0%
|
||||
}
|
||||
|
||||
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
|
||||
{
|
||||
if( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
|
||||
return 1044038; // You have worn out your tool!
|
||||
else if ( !BaseTool.CheckAccessible( tool, from ) )
|
||||
return 1044263; // The tool must be on your person to use.
|
||||
else if ( itemType != null && ( itemType.IsSubclassOf( typeof( BaseFactionTrapDeed ) ) || itemType == typeof( FactionTrapRemovalKit ) ) && Faction.Find( from ) == null )
|
||||
return 1044573; // You have to be in a faction to do that.
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void PlayCraftEffect( Mobile from )
|
||||
{
|
||||
// no sound
|
||||
//from.PlaySound( 0x241 );
|
||||
}
|
||||
|
||||
private static Type[] m_TinkerColorables = new Type[]
|
||||
{
|
||||
typeof( ForkLeft ), typeof( ForkRight ),
|
||||
typeof( SpoonLeft ), typeof( SpoonRight ),
|
||||
typeof( KnifeLeft ), typeof( KnifeRight ),
|
||||
typeof( Plate ),
|
||||
typeof( Goblet ), typeof( PewterMug ),
|
||||
typeof( KeyRing ),
|
||||
typeof( Candelabra ), typeof( Scales ),
|
||||
typeof( Key ), typeof( Globe ),
|
||||
typeof( Spyglass ), typeof( Lantern ),
|
||||
typeof( HeatingStand )
|
||||
};
|
||||
|
||||
public override bool RetainsColorFrom( CraftItem item, Type type )
|
||||
{
|
||||
if ( !type.IsSubclassOf( typeof( BaseIngot ) ) )
|
||||
return false;
|
||||
|
||||
type = item.ItemType;
|
||||
|
||||
bool contains = false;
|
||||
|
||||
for ( int i = 0; !contains && i < m_TinkerColorables.Length; ++i )
|
||||
contains = ( m_TinkerColorables[i] == type );
|
||||
|
||||
return contains;
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
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.
|
||||
}
|
||||
}
|
||||
|
||||
public override bool ConsumeOnFailure( Mobile from, Type resourceType, CraftItem craftItem )
|
||||
{
|
||||
if ( resourceType == typeof( Silver ) )
|
||||
return false;
|
||||
|
||||
return base.ConsumeOnFailure( from, resourceType, craftItem );
|
||||
}
|
||||
|
||||
public void AddJewelrySet( GemType gemType, Type itemType )
|
||||
{
|
||||
int offset = (int)gemType - 1;
|
||||
|
||||
int index = AddCraft( typeof( GoldRing ), 1044049, 1044176 + offset, 40.0, 90.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddRes( index, itemType, 1044231 + offset, 1, 1044240 );
|
||||
|
||||
index = AddCraft( typeof( SilverBeadNecklace ), 1044049, 1044185 + offset, 40.0, 90.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddRes( index, itemType, 1044231 + offset, 1, 1044240 );
|
||||
|
||||
index = AddCraft( typeof( GoldNecklace ), 1044049, 1044194 + offset, 40.0, 90.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddRes( index, itemType, 1044231 + offset, 1, 1044240 );
|
||||
|
||||
index = AddCraft( typeof( GoldEarrings ), 1044049, 1044203 + offset, 40.0, 90.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddRes( index, itemType, 1044231 + offset, 1, 1044240 );
|
||||
|
||||
index = AddCraft( typeof( GoldBeadNecklace ), 1044049, 1044212 + offset, 40.0, 90.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddRes( index, itemType, 1044231 + offset, 1, 1044240 );
|
||||
|
||||
index = AddCraft( typeof( GoldBracelet ), 1044049, 1044221 + offset, 40.0, 90.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddRes( index, itemType, 1044231 + offset, 1, 1044240 );
|
||||
}
|
||||
|
||||
public override void InitCraftList()
|
||||
{
|
||||
int index = -1;
|
||||
|
||||
#region Wooden Items
|
||||
AddCraft( typeof( JointingPlane ), 1044042, 1024144, 0.0, 50.0, typeof( Log ), 1044041, 4, 1044351 );
|
||||
AddCraft( typeof( MouldingPlane ), 1044042, 1024140, 0.0, 50.0, typeof( Log ), 1044041, 4, 1044351 );
|
||||
AddCraft( typeof( SmoothingPlane ), 1044042, 1024146, 0.0, 50.0, typeof( Log ), 1044041, 4, 1044351 );
|
||||
AddCraft( typeof( ClockFrame ), 1044042, 1024173, 0.0, 50.0, typeof( Log ), 1044041, 6, 1044351 );
|
||||
AddCraft( typeof( Axle ), 1044042, 1024187, -25.0, 25.0, typeof( Log ), 1044041, 2, 1044351 );
|
||||
AddCraft( typeof( RollingPin ), 1044042, 1024163, 0.0, 50.0, typeof( Log ), 1044041, 5, 1044351 );
|
||||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( Nunchaku ), 1044042, 1030158, 70.0, 120.0, typeof( IronIngot ), 1044036, 3, 1044037 );
|
||||
AddRes( index, typeof( Log ), 1044041, 8, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Tools
|
||||
AddCraft( typeof( Scissors ), 1044046, 1023998, 5.0, 55.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddCraft( typeof( MortarPestle ), 1044046, 1023739, 20.0, 70.0, typeof( IronIngot ), 1044036, 3, 1044037 );
|
||||
AddCraft( typeof( Scorp ), 1044046, 1024327, 30.0, 80.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddCraft( typeof( TinkerTools ), 1044046, 1044164, 10.0, 60.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddCraft( typeof( Hatchet ), 1044046, 1023907, 30.0, 80.0, typeof( IronIngot ), 1044036, 4, 1044037 );
|
||||
AddCraft( typeof( DrawKnife ), 1044046, 1024324, 30.0, 80.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddCraft( typeof( SewingKit ), 1044046, 1023997, 10.0, 70.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddCraft( typeof( Saw ), 1044046, 1024148, 30.0, 80.0, typeof( IronIngot ), 1044036, 4, 1044037 );
|
||||
AddCraft( typeof( DovetailSaw ), 1044046, 1024136, 30.0, 80.0, typeof( IronIngot ), 1044036, 4, 1044037 );
|
||||
AddCraft( typeof( Froe ), 1044046, 1024325, 30.0, 80.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddCraft( typeof( Shovel ), 1044046, 1023898, 40.0, 90.0, typeof( IronIngot ), 1044036, 4, 1044037 );
|
||||
AddCraft( typeof( Hammer ), 1044046, 1024138, 30.0, 80.0, typeof( IronIngot ), 1044036, 1, 1044037 );
|
||||
AddCraft( typeof( Tongs ), 1044046, 1024028, 35.0, 85.0, typeof( IronIngot ), 1044036, 1, 1044037 );
|
||||
AddCraft( typeof( SmithHammer ), 1044046, 1025091, 40.0, 90.0, typeof( IronIngot ), 1044036, 4, 1044037 );
|
||||
AddCraft( typeof( SledgeHammer ), 1044046, 1024021, 40.0, 90.0, typeof( IronIngot ), 1044036, 4, 1044037 );
|
||||
AddCraft( typeof( Inshave ), 1044046, 1024326, 30.0, 80.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddCraft( typeof( Pickaxe ), 1044046, 1023718, 40.0, 90.0, typeof( IronIngot ), 1044036, 4, 1044037 );
|
||||
AddCraft( typeof( Lockpick ), 1044046, 1025371, 45.0, 95.0, typeof( IronIngot ), 1044036, 1, 1044037 );
|
||||
AddCraft( typeof( Skillet ), 1044046, 1044567, 30.0, 80.0, typeof( IronIngot ), 1044036, 4, 1044037 );
|
||||
AddCraft( typeof( FlourSifter ), 1044046, 1024158, 50.0, 100.0, typeof( IronIngot ), 1044036, 3, 1044037 );
|
||||
AddCraft( typeof( FletcherTools ), 1044046, 1044166, 35.0, 85.0, typeof( IronIngot ), 1044036, 3, 1044037 );
|
||||
AddCraft( typeof( MapmakersPen ), 1044046, 1044167, 25.0, 75.0, typeof( IronIngot ), 1044036, 1, 1044037 );
|
||||
AddCraft( typeof( ScribesPen ), 1044046, 1044168, 25.0, 75.0, typeof( IronIngot ), 1044036, 1, 1044037 );
|
||||
#endregion
|
||||
|
||||
#region Parts
|
||||
AddCraft( typeof( Gears ), 1044047, 1024179, 5.0, 55.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddCraft( typeof( ClockParts ), 1044047, 1024175, 25.0, 75.0, typeof( IronIngot ), 1044036, 1, 1044037 );
|
||||
AddCraft( typeof( BarrelTap ), 1044047, 1024100, 35.0, 85.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddCraft( typeof( Springs ), 1044047, 1024189, 5.0, 55.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddCraft( typeof( SextantParts ), 1044047, 1024185, 30.0, 80.0, typeof( IronIngot ), 1044036, 4, 1044037 );
|
||||
AddCraft( typeof( BarrelHoops ), 1044047, 1024321, -15.0, 35.0, typeof( IronIngot ), 1044036, 5, 1044037 );
|
||||
AddCraft( typeof( Hinge ), 1044047, 1024181, 5.0, 55.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddCraft( typeof( BolaBall ), 1044047, 1023699, 45.0, 95.0, typeof( IronIngot ), 1044036, 10, 1044037 );
|
||||
#endregion
|
||||
|
||||
#region Utensils
|
||||
AddCraft( typeof( ButcherKnife ), 1044048, 1025110, 25.0, 75.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddCraft( typeof( SpoonLeft ), 1044048, 1044158, 0.0, 50.0, typeof( IronIngot ), 1044036, 1, 1044037 );
|
||||
AddCraft( typeof( SpoonRight ), 1044048, 1044159, 0.0, 50.0, typeof( IronIngot ), 1044036, 1, 1044037 );
|
||||
AddCraft( typeof( Plate ), 1044048, 1022519, 0.0, 50.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddCraft( typeof( ForkLeft ), 1044048, 1044160, 0.0, 50.0, typeof( IronIngot ), 1044036, 1, 1044037 );
|
||||
AddCraft( typeof( ForkRight ), 1044048, 1044161, 0.0, 50.0, typeof( IronIngot ), 1044036, 1, 1044037 );
|
||||
AddCraft( typeof( Cleaver ), 1044048, 1023778, 20.0, 70.0, typeof( IronIngot ), 1044036, 3, 1044037 );
|
||||
AddCraft( typeof( KnifeLeft ), 1044048, 1044162, 0.0, 50.0, typeof( IronIngot ), 1044036, 1, 1044037 );
|
||||
AddCraft( typeof( KnifeRight ), 1044048, 1044163, 0.0, 50.0, typeof( IronIngot ), 1044036, 1, 1044037 );
|
||||
AddCraft( typeof( Goblet ), 1044048, 1022458, 10.0, 60.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddCraft( typeof( PewterMug ), 1044048, 1024097, 10.0, 60.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddCraft( typeof( SkinningKnife ), 1044048, 1023781, 25.0, 75.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
#endregion
|
||||
|
||||
#region Misc
|
||||
AddCraft( typeof( KeyRing ), 1044050, 1024113, 10.0, 60.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddCraft( typeof( Candelabra ), 1044050, 1022599, 55.0, 105.0, typeof( IronIngot ), 1044036, 4, 1044037 );
|
||||
AddCraft( typeof( Scales ), 1044050, 1026225, 60.0, 110.0, typeof( IronIngot ), 1044036, 4, 1044037 );
|
||||
AddCraft( typeof( Key ), 1044050, 1024112, 20.0, 70.0, typeof( IronIngot ), 1044036, 3, 1044037 );
|
||||
AddCraft( typeof( Globe ), 1044050, 1024167, 55.0, 105.0, typeof( IronIngot ), 1044036, 4, 1044037 );
|
||||
AddCraft( typeof( Spyglass ), 1044050, 1025365, 60.0, 110.0, typeof( IronIngot ), 1044036, 4, 1044037 );
|
||||
AddCraft( typeof( Lantern ), 1044050, 1022597, 30.0, 80.0, typeof( IronIngot ), 1044036, 2, 1044037 );
|
||||
AddCraft( typeof( HeatingStand ), 1044050, 1026217, 60.0, 110.0, typeof( IronIngot ), 1044036, 4, 1044037 );
|
||||
|
||||
if ( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( ShojiLantern ), 1044050, 1029404, 65.0, 115.0, typeof( IronIngot ), 1044036, 10, 1044037 );
|
||||
AddRes( index, typeof( Log ), 1044041, 5, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( PaperLantern ), 1044050, 1029406, 65.0, 115.0, typeof( IronIngot ), 1044036, 10, 1044037 );
|
||||
AddRes( index, typeof( Log ), 1044041, 5, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( RoundPaperLantern ), 1044050, 1029418, 65.0, 115.0, typeof( IronIngot ), 1044036, 10, 1044037 );
|
||||
AddRes( index, typeof( Log ), 1044041, 5, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( WindChimes ), 1044050, 1030290, 80.0, 130.0, typeof( IronIngot ), 1044036, 15, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( FancyWindChimes ), 1044050, 1030291, 80.0, 130.0, typeof( IronIngot ), 1044036, 15, 1044037 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Jewelry
|
||||
AddJewelrySet( GemType.StarSapphire, typeof( StarSapphire ) );
|
||||
AddJewelrySet( GemType.Emerald, typeof( Emerald ) );
|
||||
AddJewelrySet( GemType.Sapphire, typeof( Sapphire ) );
|
||||
AddJewelrySet( GemType.Ruby, typeof( Ruby ) );
|
||||
AddJewelrySet( GemType.Citrine, typeof( Citrine ) );
|
||||
AddJewelrySet( GemType.Amethyst, typeof( Amethyst ) );
|
||||
AddJewelrySet( GemType.Tourmaline, typeof( Tourmaline ) );
|
||||
AddJewelrySet( GemType.Amber, typeof( Amber ) );
|
||||
AddJewelrySet( GemType.Diamond, typeof( Diamond ) );
|
||||
#endregion
|
||||
|
||||
#region Multi-Component Items
|
||||
index = AddCraft( typeof( AxleGears ), 1044051, 1024177, 0.0, 0.0, typeof( Axle ), 1044169, 1, 1044253 );
|
||||
AddRes( index, typeof( Gears ), 1044254, 1, 1044253 );
|
||||
|
||||
index = AddCraft( typeof( ClockParts ), 1044051, 1024175, 0.0, 0.0, typeof( AxleGears ), 1044170, 1, 1044253 );
|
||||
AddRes( index, typeof( Springs ), 1044171, 1, 1044253 );
|
||||
|
||||
index = AddCraft( typeof( SextantParts ), 1044051, 1024185, 0.0, 0.0, typeof( AxleGears ), 1044170, 1, 1044253 );
|
||||
AddRes( index, typeof( Hinge ), 1044172, 1, 1044253 );
|
||||
|
||||
index = AddCraft( typeof( ClockRight ), 1044051, 1044257, 0.0, 0.0, typeof( ClockFrame ), 1044174, 1, 1044253 );
|
||||
AddRes( index, typeof( ClockParts ), 1044173, 1, 1044253 );
|
||||
|
||||
index = AddCraft( typeof( ClockLeft ), 1044051, 1044256, 0.0, 0.0, typeof( ClockFrame ), 1044174, 1, 1044253 );
|
||||
AddRes( index, typeof( ClockParts ), 1044173, 1, 1044253 );
|
||||
|
||||
AddCraft( typeof( Sextant ), 1044051, 1024183, 0.0, 0.0, typeof( SextantParts ), 1044175, 1, 1044253 );
|
||||
|
||||
index = AddCraft( typeof( Bola ), 1044051, 1046441, 60.0, 80.0, typeof( BolaBall ), 1046440, 4, 1042613 );
|
||||
AddRes( index, typeof( Leather ), 1044462, 3, 1044463 );
|
||||
|
||||
index = AddCraft( typeof( PotionKeg ), 1044051, 1044258, 75.0, 100.0, typeof( Keg ), 1044255, 1, 1044253 );
|
||||
AddRes( index, typeof( Bottle ), 1044250, 10, 1044253 );
|
||||
AddRes( index, typeof( BarrelLid ), 1044251, 1, 1044253 );
|
||||
AddRes( index, typeof( BarrelTap ), 1044252, 1, 1044253 );
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Traps
|
||||
// Dart Trap
|
||||
index = AddCraft( typeof( DartTrapCraft ), 1044052, 1024396, 30.0, 80.0, typeof( IronIngot ), 1044036, 1, 1044037 );
|
||||
AddRes( index, typeof( Bolt ), 1044570, 1, 1044253 );
|
||||
|
||||
// Poison Trap
|
||||
index = AddCraft( typeof( PoisonTrapCraft ), 1044052, 1044593, 30.0, 80.0, typeof( IronIngot ), 1044036, 1, 1044037 );
|
||||
AddRes( index, typeof( BasePoisonPotion ), 1044571, 1, 1044253 );
|
||||
|
||||
// Explosion Trap
|
||||
index = AddCraft( typeof( ExplosionTrapCraft ), 1044052, 1044597, 55.0, 105.0, typeof( IronIngot ), 1044036, 1, 1044037 );
|
||||
AddRes( index, typeof( BaseExplosionPotion ), 1044569, 1, 1044253 );
|
||||
|
||||
// Faction Gas Trap
|
||||
index = AddCraft( typeof( FactionGasTrapDeed ), 1044052, 1044598, 65.0, 115.0, typeof( Silver ), 1044572, Core.AOS ? 250 : 1000, 1044253 );
|
||||
AddRes( index, typeof( IronIngot ), 1044036, 10, 1044037 );
|
||||
AddRes( index, typeof( BasePoisonPotion ), 1044571, 1, 1044253 );
|
||||
|
||||
// Faction explosion Trap
|
||||
index = AddCraft( typeof( FactionExplosionTrapDeed ), 1044052, 1044599, 65.0, 115.0, typeof( Silver ), 1044572, Core.AOS ? 250 : 1000, 1044253 );
|
||||
AddRes( index, typeof( IronIngot ), 1044036, 10, 1044037 );
|
||||
AddRes( index, typeof( BaseExplosionPotion ), 1044569, 1, 1044253 );
|
||||
|
||||
// Faction Saw Trap
|
||||
index = AddCraft( typeof( FactionSawTrapDeed ), 1044052, 1044600, 65.0, 115.0, typeof( Silver ), 1044572, Core.AOS ? 250 : 1000, 1044253 );
|
||||
AddRes( index, typeof( IronIngot ), 1044036, 10, 1044037 );
|
||||
AddRes( index, typeof( Gears ), 1044254, 1, 1044253 );
|
||||
|
||||
// Faction Spike Trap
|
||||
index = AddCraft( typeof( FactionSpikeTrapDeed ), 1044052, 1044601, 65.0, 115.0, typeof( Silver ), 1044572, Core.AOS ? 250 : 1000, 1044253 );
|
||||
AddRes( index, typeof( IronIngot ), 1044036, 10, 1044037 );
|
||||
AddRes( index, typeof( Springs ), 1044171, 1, 1044253 );
|
||||
|
||||
// Faction trap removal kit
|
||||
index = AddCraft( typeof( FactionTrapRemovalKit ), 1044052, 1046445, 90.0, 115.0, typeof( Silver ), 1044572, 500, 1044253 );
|
||||
AddRes( index, typeof( IronIngot ), 1044036, 10, 1044037 );
|
||||
#endregion
|
||||
|
||||
// Set the overridable material
|
||||
SetSubRes( typeof( IronIngot ), 1044022 );
|
||||
|
||||
// Add every material you want the player to be able to choose from
|
||||
// This will override the overridable material
|
||||
AddSubRes( typeof( IronIngot ), 1044022, 00.0, 1044036, 1044267 );
|
||||
AddSubRes( typeof( DullCopperIngot ), 1044023, 65.0, 1044036, 1044268 );
|
||||
AddSubRes( typeof( ShadowIronIngot ), 1044024, 70.0, 1044036, 1044268 );
|
||||
AddSubRes( typeof( CopperIngot ), 1044025, 75.0, 1044036, 1044268 );
|
||||
AddSubRes( typeof( BronzeIngot ), 1044026, 80.0, 1044036, 1044268 );
|
||||
AddSubRes( typeof( GoldIngot ), 1044027, 85.0, 1044036, 1044268 );
|
||||
AddSubRes( typeof( AgapiteIngot ), 1044028, 90.0, 1044036, 1044268 );
|
||||
AddSubRes( typeof( VeriteIngot ), 1044029, 95.0, 1044036, 1044268 );
|
||||
AddSubRes( typeof( ValoriteIngot ), 1044030, 99.0, 1044036, 1044268 );
|
||||
|
||||
MarkOption = true;
|
||||
Repair = true;
|
||||
CanEnhance = Core.AOS;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class TrapCraft : CustomCraft
|
||||
{
|
||||
private LockableContainer m_Container;
|
||||
|
||||
public LockableContainer Container{ get{ return m_Container; } }
|
||||
|
||||
public abstract TrapType TrapType{ get; }
|
||||
|
||||
public TrapCraft( Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool, int quality ) : base( from, craftItem, craftSystem, typeRes, tool, quality )
|
||||
{
|
||||
}
|
||||
|
||||
private int Verify( LockableContainer container )
|
||||
{
|
||||
if ( container == null || container.KeyValue == 0 )
|
||||
return 1005638; // You can only trap lockable chests.
|
||||
if ( From.Map != container.Map || !From.InRange( container.GetWorldLocation(), 2 ) )
|
||||
return 500446; // That is too far away.
|
||||
if ( !container.Movable )
|
||||
return 502944; // You cannot trap this item because it is locked down.
|
||||
if ( !container.IsAccessibleTo( From ) )
|
||||
return 502946; // That belongs to someone else.
|
||||
if ( container.Locked )
|
||||
return 502943; // You can only trap an unlocked object.
|
||||
if ( container.TrapType != TrapType.None )
|
||||
return 502945; // You can only place one trap on an object at a time.
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private bool Acquire( object target, out int message )
|
||||
{
|
||||
LockableContainer container = target as LockableContainer;
|
||||
|
||||
message = Verify( container );
|
||||
|
||||
if ( message > 0 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Container = container;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void EndCraftAction()
|
||||
{
|
||||
From.SendLocalizedMessage( 502921 ); // What would you like to set a trap on?
|
||||
From.Target = new ContainerTarget( this );
|
||||
}
|
||||
|
||||
private class ContainerTarget : Target
|
||||
{
|
||||
private TrapCraft m_TrapCraft;
|
||||
|
||||
public ContainerTarget( TrapCraft trapCraft ) : base( -1, false, TargetFlags.None )
|
||||
{
|
||||
m_TrapCraft = trapCraft;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
int message;
|
||||
|
||||
if ( m_TrapCraft.Acquire( targeted, out message ) )
|
||||
m_TrapCraft.CraftItem.CompleteCraft( m_TrapCraft.Quality, false, m_TrapCraft.From, m_TrapCraft.CraftSystem, m_TrapCraft.TypeRes, m_TrapCraft.Tool, m_TrapCraft );
|
||||
else
|
||||
Failure( message );
|
||||
}
|
||||
|
||||
protected override void OnTargetCancel( Mobile from, TargetCancelType cancelType )
|
||||
{
|
||||
if ( cancelType == TargetCancelType.Canceled )
|
||||
Failure( 0 );
|
||||
}
|
||||
|
||||
private void Failure( int message )
|
||||
{
|
||||
Mobile from = m_TrapCraft.From;
|
||||
BaseTool tool = m_TrapCraft.Tool;
|
||||
|
||||
if ( tool != null && !tool.Deleted && tool.UsesRemaining > 0 )
|
||||
from.SendGump( new CraftGump( from, m_TrapCraft.CraftSystem, tool, message ) );
|
||||
else if ( message > 0 )
|
||||
from.SendLocalizedMessage( message );
|
||||
}
|
||||
}
|
||||
|
||||
public override Item CompleteCraft( out int message )
|
||||
{
|
||||
message = Verify( this.Container );
|
||||
|
||||
if ( message == 0 )
|
||||
{
|
||||
int trapLevel = (int)(From.Skills.Tinkering.Value / 10);
|
||||
|
||||
Container.TrapType = this.TrapType;
|
||||
Container.TrapPower = trapLevel * 9;
|
||||
Container.TrapLevel = trapLevel;
|
||||
Container.TrapOnLockpick = true;
|
||||
|
||||
message = 1005639; // Trap is disabled until you lock the chest.
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
[CraftItemID( 0x1BFC )]
|
||||
public class DartTrapCraft : TrapCraft
|
||||
{
|
||||
public override TrapType TrapType{ get{ return TrapType.DartTrap; } }
|
||||
|
||||
public DartTrapCraft( Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool, int quality ) : base( from, craftItem, craftSystem, typeRes, tool, quality )
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[CraftItemID( 0x113E )]
|
||||
public class PoisonTrapCraft : TrapCraft
|
||||
{
|
||||
public override TrapType TrapType{ get{ return TrapType.PoisonTrap; } }
|
||||
|
||||
public PoisonTrapCraft( Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool, int quality ) : base( from, craftItem, craftSystem, typeRes, tool, quality )
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
[CraftItemID( 0x370C )]
|
||||
public class ExplosionTrapCraft : TrapCraft
|
||||
{
|
||||
public override TrapType TrapType{ get{ return TrapType.ExplosionTrap; } }
|
||||
|
||||
public ExplosionTrapCraft( Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool, int quality ) : base( from, craftItem, craftSystem, typeRes, tool, quality )
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue