revert crafting updates of SVN538. Per Mark: changing baseclasses is a bad idea.
This commit is contained in:
parent
7399519cf7
commit
e86794c4e6
130 changed files with 1007 additions and 4906 deletions
|
|
@ -19,16 +19,6 @@ namespace Server.Engines.Craft
|
|||
private int m_LastGroupIndex;
|
||||
private bool m_DoNotColor;
|
||||
private CraftMarkOption m_MarkOption;
|
||||
|
||||
#region Hue State Vars
|
||||
private bool m_CheckedHues;
|
||||
private List<int> m_Hues;
|
||||
private Item m_CompareHueTo;
|
||||
|
||||
public bool CheckedHues { get { return m_CheckedHues; } set { m_CheckedHues = value; } }
|
||||
public List<int> Hues { get { return m_Hues; } set { m_Hues = value; } }
|
||||
public Item CompareHueTo { get { return m_CompareHueTo; } set { m_CompareHueTo = value; } }
|
||||
#endregion
|
||||
|
||||
public List<CraftItem> Items { get { return m_Items; } }
|
||||
public int LastResourceIndex{ get{ return m_LastResourceIndex; } set{ m_LastResourceIndex = value; } }
|
||||
|
|
@ -43,10 +33,6 @@ namespace Server.Engines.Craft
|
|||
m_LastResourceIndex = -1;
|
||||
m_LastResourceIndex2 = -1;
|
||||
m_LastGroupIndex = -1;
|
||||
|
||||
m_CheckedHues = false;
|
||||
m_Hues = new List<int>();
|
||||
m_CompareHueTo = null;
|
||||
}
|
||||
|
||||
public CraftItem LastMade
|
||||
|
|
@ -69,12 +55,5 @@ namespace Server.Engines.Craft
|
|||
|
||||
m_Items.Insert( 0, item );
|
||||
}
|
||||
|
||||
public void ResetHueStateVars()
|
||||
{
|
||||
m_CheckedHues = false;
|
||||
m_Hues = new List<int>();
|
||||
m_CompareHueTo = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -125,22 +125,25 @@ namespace Server.Engines.Craft
|
|||
|
||||
nameString = subResource.NameString;
|
||||
nameNumber = subResource.NameNumber;
|
||||
resourceType = subResource.ItemType;
|
||||
resourceType = subResource.ItemType;
|
||||
}
|
||||
|
||||
int resourceCount = GetResourceAmount( resourceType );
|
||||
int resourceCount = 0;
|
||||
|
||||
if ( from.Backpack != null )
|
||||
{
|
||||
Item[] items = from.Backpack.FindItemsByType( resourceType, true );
|
||||
|
||||
for ( int i = 0; i < items.Length; ++i )
|
||||
resourceCount += items[i].Amount;
|
||||
}
|
||||
|
||||
AddButton( 15, 362, 4005, 4007, GetButtonID( 6, 0 ), GumpButtonType.Reply, 0 );
|
||||
|
||||
if ( nameNumber > 0 )
|
||||
{
|
||||
if ( context.DoNotColor )
|
||||
AddLabel( 50, 364, LabelHue, "*" );
|
||||
|
||||
AddHtmlLocalized( context.DoNotColor ? 61 : 50, 365, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false );
|
||||
}
|
||||
AddHtmlLocalized( 50, 365, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false );
|
||||
else
|
||||
AddLabel( 50, 362, LabelHue, String.Format( "{0} ({1} Available)", nameString, resourceCount ) );
|
||||
AddLabel( 50, 362, LabelHue, String.Format( "{0} ({1} Available)", nameString, resourceCount ) );
|
||||
}
|
||||
// ****************************************
|
||||
|
||||
|
|
@ -152,7 +155,7 @@ namespace Server.Engines.Craft
|
|||
|
||||
int resIndex = ( context == null ? -1 : context.LastResourceIndex2 );
|
||||
|
||||
Type resourceType = craftSystem.CraftSubRes2.ResType;
|
||||
Type resourceType = craftSystem.CraftSubRes2.ResType;
|
||||
|
||||
if ( resIndex > -1 )
|
||||
{
|
||||
|
|
@ -160,22 +163,25 @@ namespace Server.Engines.Craft
|
|||
|
||||
nameString = subResource.NameString;
|
||||
nameNumber = subResource.NameNumber;
|
||||
resourceType = subResource.ItemType;
|
||||
resourceType = subResource.ItemType;
|
||||
}
|
||||
|
||||
int resourceCount = GetResourceAmount( resourceType );
|
||||
int resourceCount = 0;
|
||||
|
||||
if ( from.Backpack != null )
|
||||
{
|
||||
Item[] items = from.Backpack.FindItemsByType( resourceType, true );
|
||||
|
||||
for ( int i = 0; i < items.Length; ++i )
|
||||
resourceCount += items[i].Amount;
|
||||
}
|
||||
|
||||
AddButton( 15, 382, 4005, 4007, GetButtonID( 6, 7 ), GumpButtonType.Reply, 0 );
|
||||
|
||||
if ( nameNumber > 0 )
|
||||
{
|
||||
if ( context.DoNotColor )
|
||||
AddLabel( 50, 384, LabelHue, "*" );
|
||||
|
||||
AddHtmlLocalized( context.DoNotColor ? 61 : 50, 385, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false );
|
||||
}
|
||||
AddHtmlLocalized( 50, 385, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false );
|
||||
else
|
||||
AddLabel( 50, 385, LabelHue, String.Format( "{0} ({1} Available)", nameString, resourceCount ) );
|
||||
AddLabel( 50, 385, LabelHue, String.Format( "{0} ({1} Available)", nameString, resourceCount ) );
|
||||
}
|
||||
// ****************************************
|
||||
|
||||
|
|
@ -215,7 +221,15 @@ namespace Server.Engines.Craft
|
|||
AddHtmlLocalized( 255, 263, 200, 18, (context == null || !context.DoNotColor) ? 1061591 : 1061590, LabelColor, false, false );
|
||||
}
|
||||
|
||||
int resourceCount = GetResourceAmount( subResource.ItemType );
|
||||
int resourceCount = 0;
|
||||
|
||||
if ( from.Backpack != null )
|
||||
{
|
||||
Item[] items = from.Backpack.FindItemsByType( subResource.ItemType, true );
|
||||
|
||||
for ( int j = 0; j < items.Length; ++j )
|
||||
resourceCount += items[j].Amount;
|
||||
}
|
||||
|
||||
AddButton( 220, 60 + (index * 20), 4005, 4007, GetButtonID( 5, i ), GumpButtonType.Reply, 0 );
|
||||
|
||||
|
|
@ -350,44 +364,6 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
return 1 + type + (index * 7);
|
||||
}
|
||||
|
||||
public int GetResourceAmount( Type resourceType )
|
||||
{
|
||||
int resourceCount = 0;
|
||||
|
||||
Item[] items;
|
||||
|
||||
if ( m_From.Backpack != null )
|
||||
{
|
||||
if ( m_CraftSystem is DefCarpentry || m_CraftSystem is DefTailoring )
|
||||
{
|
||||
CraftResource resource = CraftResources.GetFromType( resourceType );
|
||||
CraftResourceInfo resourceInfo = CraftResources.GetInfo( resource );
|
||||
Type[] typeList = resourceInfo.ResourceTypes;
|
||||
|
||||
for ( int i = 0; i < typeList.Length; ++i )
|
||||
{
|
||||
items = m_From.Backpack.FindItemsByType( typeList[i], true );
|
||||
|
||||
for ( int j = 0; j < items.Length; ++j )
|
||||
{
|
||||
resourceCount += items[j].Amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
items = m_From.Backpack.FindItemsByType( resourceType, true );
|
||||
|
||||
for ( int i = 0; i < items.Length; ++i )
|
||||
{
|
||||
resourceCount += items[i].Amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return resourceCount;
|
||||
}
|
||||
|
||||
public void CraftItem( CraftItem item )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ namespace Server.Engines.Craft
|
|||
AddLabel( 330, 40, LabelHue, craftItem.NameString );
|
||||
|
||||
if ( craftItem.UseAllRes )
|
||||
AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, craftItem.UseAllMessage, LabelColor, false, false );
|
||||
AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1048176, LabelColor, false, false ); // Makes as many as possible at once
|
||||
|
||||
DrawItem();
|
||||
DrawSkill();
|
||||
|
|
@ -122,10 +122,7 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
Type type = m_CraftItem.ItemType;
|
||||
|
||||
int itemID = m_CraftItem.ForceGumpItemID ? m_CraftItem.GumpItemID : CraftItem.ItemIDOf( type );
|
||||
|
||||
if ( !type.IsSubclassOf( typeof( BaseAddonDeed ) ) || type.IsDefined( typeof( CraftItemIDAttribute ), true ) )
|
||||
AddItem( 20, 50, itemID );
|
||||
AddItem( 20, 50, CraftItem.ItemIDOf( type ) );
|
||||
|
||||
if ( m_CraftItem.IsMarkable( type ) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ using Server.Items;
|
|||
using Server.Factions;
|
||||
using Server.Mobiles;
|
||||
using Server.Commands;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Engines.Craft
|
||||
{
|
||||
|
|
@ -25,8 +24,6 @@ namespace Server.Engines.Craft
|
|||
private CraftResCol m_arCraftRes;
|
||||
private CraftSkillCol m_arCraftSkill;
|
||||
private Type m_Type;
|
||||
|
||||
private object[] m_CraftArgs;
|
||||
|
||||
private string m_GroupNameString;
|
||||
private int m_GroupNameNumber;
|
||||
|
|
@ -39,8 +36,6 @@ namespace Server.Engines.Craft
|
|||
private int m_Stam;
|
||||
|
||||
private bool m_UseAllRes;
|
||||
private int m_UseAllMessage;
|
||||
private int m_MultiplyBy;
|
||||
|
||||
private bool m_NeedHeat;
|
||||
private bool m_NeedOven;
|
||||
|
|
@ -49,42 +44,14 @@ namespace Server.Engines.Craft
|
|||
private bool m_UseSubRes2;
|
||||
|
||||
private bool m_ForceNonExceptional;
|
||||
private bool m_ForceGumpItemID;
|
||||
private int m_GumpItemID;
|
||||
|
||||
private bool m_BeginHueSelector;
|
||||
private Type m_TypeToCompare;
|
||||
|
||||
public int UseAllMessage
|
||||
{
|
||||
get { return m_UseAllMessage; }
|
||||
set { m_UseAllMessage = value; }
|
||||
}
|
||||
|
||||
public int MultiplyBy
|
||||
{
|
||||
get { return m_MultiplyBy; }
|
||||
set { m_MultiplyBy = value; }
|
||||
}
|
||||
|
||||
public bool ForceNonExceptional
|
||||
{
|
||||
get { return m_ForceNonExceptional; }
|
||||
set { m_ForceNonExceptional = value; }
|
||||
}
|
||||
|
||||
|
||||
public bool ForceGumpItemID
|
||||
{
|
||||
get { return m_ForceGumpItemID; }
|
||||
set { m_ForceGumpItemID = value; }
|
||||
}
|
||||
|
||||
public int GumpItemID
|
||||
{
|
||||
get { return m_GumpItemID; }
|
||||
set { m_GumpItemID = value; }
|
||||
}
|
||||
|
||||
private Expansion m_RequiredExpansion;
|
||||
|
||||
public Expansion RequiredExpansion
|
||||
|
|
@ -166,8 +133,6 @@ namespace Server.Engines.Craft
|
|||
|
||||
m_GroupNameNumber = groupName;
|
||||
m_NameNumber = name;
|
||||
|
||||
m_MultiplyBy = 1;
|
||||
}
|
||||
|
||||
public void AddRes( Type type, TextDefinition name, int amount )
|
||||
|
|
@ -187,12 +152,6 @@ namespace Server.Engines.Craft
|
|||
CraftSkill craftSkill = new CraftSkill( skillToMake, minSkill, maxSkill );
|
||||
m_arCraftSkill.Add( craftSkill );
|
||||
}
|
||||
|
||||
public object[] CraftArgs
|
||||
{
|
||||
get { return m_CraftArgs; }
|
||||
set { m_CraftArgs = value; }
|
||||
}
|
||||
|
||||
public int Mana
|
||||
{
|
||||
|
|
@ -402,37 +361,18 @@ namespace Server.Engines.Craft
|
|||
typeof( Spellbook ), typeof( Runebook ),
|
||||
typeof( BaseQuiver )
|
||||
};
|
||||
private static Type[] m_MarkableAOSTable = new Type[]
|
||||
{
|
||||
typeof( BaseCraftableItem ),
|
||||
typeof( BasePlayerBB ),
|
||||
typeof( BaseLight ),
|
||||
typeof( BaseOtherEquipable ),
|
||||
typeof( BaseFurnitureContainer ),
|
||||
typeof( LockableContainer )
|
||||
};
|
||||
#endregion
|
||||
|
||||
public bool IsMarkable( Type type )
|
||||
{
|
||||
if( m_ForceNonExceptional ) //Don't even display the stuff for marking if it can't ever be exceptional.
|
||||
return false;
|
||||
|
||||
|
||||
for ( int i = 0; i < m_MarkableTable.Length; ++i )
|
||||
{
|
||||
if ( type == m_MarkableTable[i] || type.IsSubclassOf( m_MarkableTable[i] ) )
|
||||
return true;
|
||||
}
|
||||
|
||||
// Carpentry prior to AOS did not have exceptional items.
|
||||
if ( Core.AOS )
|
||||
{
|
||||
for ( int i = 0; i < m_MarkableAOSTable.Length; ++i )
|
||||
{
|
||||
if ( type == m_MarkableAOSTable[i] || type.IsSubclassOf( m_MarkableAOSTable[i] ) )
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -633,19 +573,13 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
return ConsumeRes( from, typeRes, craftSystem, ref resHue, ref maxAmount, consumeType, ref message, false );
|
||||
}
|
||||
|
||||
|
||||
public bool ConsumeRes( Mobile from, Type typeRes, CraftSystem craftSystem, ref int resHue, ref int maxAmount, ConsumeType consumeType, ref object message, bool isFailure )
|
||||
{
|
||||
Container c = from.Backpack;
|
||||
|
||||
CraftContext context = craftSystem.GetContext( from );
|
||||
|
||||
m_System = craftSystem;
|
||||
Container ourPack = from.Backpack;
|
||||
|
||||
if ( c == null || !(c is BaseContainer) )
|
||||
if ( ourPack == null )
|
||||
return false;
|
||||
|
||||
BaseContainer ourPack = (BaseContainer)c;
|
||||
|
||||
if ( m_NeedHeat && !Find( from, m_HeatSources ) )
|
||||
{
|
||||
|
|
@ -703,15 +637,10 @@ namespace Server.Engines.Craft
|
|||
|
||||
amounts[i] = craftRes.Amount;
|
||||
|
||||
// For stackable items that can be crafted more than one at a time
|
||||
// For stackable items that can ben crafted more than one at a time
|
||||
if ( UseAllRes )
|
||||
{
|
||||
if ( !context.CheckedHues )
|
||||
if ( RetainsColorFrom( m_System, types[i][0] ) )
|
||||
CheckMulitpleHues( from, types[i] );
|
||||
|
||||
int tempAmount = ourPack.GetAmountCompared( types[i], new CheckItemGroup( CheckHueGrouping ), context.CompareHueTo );
|
||||
|
||||
int tempAmount = ourPack.GetAmount( types[i] );
|
||||
tempAmount /= amounts[i];
|
||||
if ( tempAmount < maxAmount )
|
||||
{
|
||||
|
|
@ -778,12 +707,12 @@ namespace Server.Engines.Craft
|
|||
// Consume ALL
|
||||
if ( consumeType == ConsumeType.All )
|
||||
{
|
||||
m_ResHue = 0; m_ResAmount = 0;
|
||||
|
||||
m_ResHue = 0; m_ResAmount = 0; m_System = craftSystem;
|
||||
|
||||
if ( IsQuantityType( types ) )
|
||||
index = ConsumeQuantity( ourPack, types, amounts );
|
||||
else
|
||||
index = ourPack.ConsumeTotalGroupedCompared( types, amounts, true, new OnItemConsumed( OnResourceConsumed ), new CheckItemGroup( CheckHueGrouping ), context.CompareHueTo );
|
||||
index = ourPack.ConsumeTotalGrouped( types, amounts, true, new OnItemConsumed( OnResourceConsumed ), new CheckItemGroup( CheckHueGrouping ) );
|
||||
|
||||
resHue = m_ResHue;
|
||||
}
|
||||
|
|
@ -799,12 +728,12 @@ namespace Server.Engines.Craft
|
|||
amounts[i] = 1;
|
||||
}
|
||||
|
||||
m_ResHue = 0; m_ResAmount = 0;
|
||||
m_ResHue = 0; m_ResAmount = 0; m_System = craftSystem;
|
||||
|
||||
if ( IsQuantityType( types ) )
|
||||
index = ConsumeQuantity( ourPack, types, amounts );
|
||||
else
|
||||
index = ourPack.ConsumeTotalGroupedCompared( types, amounts, true, new OnItemConsumed( OnResourceConsumed ), new CheckItemGroup( CheckHueGrouping ), context.CompareHueTo );
|
||||
index = ourPack.ConsumeTotalGrouped( types, amounts, true, new OnItemConsumed( OnResourceConsumed ), new CheckItemGroup( CheckHueGrouping ) );
|
||||
|
||||
resHue = m_ResHue;
|
||||
}
|
||||
|
|
@ -828,21 +757,7 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
for ( int i = 0; i < types.Length; i++ )
|
||||
{
|
||||
if ( !context.CheckedHues )
|
||||
if ( RetainsColorFrom( m_System, types[i][0] ) )
|
||||
CheckMulitpleHues( from, types[i] );
|
||||
|
||||
if ( craftSystem.UsesHueSelector( this, types[i][0] ) )
|
||||
{
|
||||
if ( context.CompareHueTo == null && context.Hues.Count > 1 )
|
||||
{
|
||||
m_BeginHueSelector = true;
|
||||
m_TypeToCompare = types[i][0];
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ourPack.GetComparedGroupAmount( types[i], true, new CheckItemGroup( CheckHueGrouping ), context.CompareHueTo ) < amounts[i] )
|
||||
if ( ourPack.GetBestGroupAmount( types[i], true, new CheckItemGroup( CheckHueGrouping ) ) < amounts[i] )
|
||||
{
|
||||
index = i;
|
||||
break;
|
||||
|
|
@ -869,106 +784,11 @@ namespace Server.Engines.Craft
|
|||
message = res.MessageString;
|
||||
else
|
||||
message = 502925; // You don't have the resources required to make that item.
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private class SelectHuedTarget : Target
|
||||
{
|
||||
private CraftItem m_CraftItem;
|
||||
private CraftSystem m_CraftSystem;
|
||||
private Type m_TypeRes;
|
||||
private BaseTool m_Tool;
|
||||
|
||||
public SelectHuedTarget( CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool ) : base( -1, true, TargetFlags.None )
|
||||
{
|
||||
m_CraftItem = craftItem;
|
||||
m_CraftSystem = craftSystem;
|
||||
m_TypeRes = typeRes;
|
||||
m_Tool = tool;
|
||||
}
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
CraftContext context = m_CraftSystem.GetContext( from );
|
||||
|
||||
if ( context == null )
|
||||
return;
|
||||
|
||||
if ( targeted is Item )
|
||||
{
|
||||
Item target = (Item)targeted;
|
||||
|
||||
Type targType = target.GetType();
|
||||
|
||||
List<Type> types = new List<Type>();
|
||||
|
||||
Type baseType = m_CraftItem.GetBaseResType( m_CraftSystem, m_TypeRes );
|
||||
|
||||
for ( int i = 0; i < m_TypesTable.Length; ++i )
|
||||
{
|
||||
if ( m_TypesTable[i][0] == baseType )
|
||||
{
|
||||
types.AddRange( m_TypesTable[i] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( types.Count <= 0 )
|
||||
types.Add( m_TypeRes );
|
||||
|
||||
for ( int i = 0; i < types.Count; ++i )
|
||||
{
|
||||
if ( target.IsChildOf( from.Backpack ) && targType == types[i] )
|
||||
{
|
||||
context.CompareHueTo = target;
|
||||
context.Hues = new List<int>( new int[] { target.Hue } );
|
||||
m_CraftItem.Craft( from, m_CraftSystem, m_TypeRes, m_Tool );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
from.Target = new SelectHuedTarget( m_CraftItem, m_CraftSystem, m_TypeRes, m_Tool );
|
||||
from.SendLocalizedMessage( 1046439 ); // That is not a valid target.
|
||||
from.SendLocalizedMessage( 1074794 ); // Target the material to use:
|
||||
}
|
||||
|
||||
protected override void OnTargetCancel( Mobile from, TargetCancelType cancelType )
|
||||
{
|
||||
CraftContext context = m_CraftSystem.GetContext( from );
|
||||
|
||||
if ( context != null )
|
||||
context.ResetHueStateVars();
|
||||
|
||||
if ( cancelType == TargetCancelType.Canceled )
|
||||
from.SendGump( new CraftGump( from, m_CraftSystem, m_Tool, 0 ) );
|
||||
}
|
||||
}
|
||||
|
||||
public Type GetBaseResType( CraftSystem craftSystem, Type typeRes )
|
||||
{
|
||||
CraftSubResCol resCol = ( UseSubRes2 ? craftSystem.CraftSubRes2 : craftSystem.CraftSubRes );
|
||||
CraftRes craftRes = Resources.GetAt( 0 );
|
||||
|
||||
foreach ( CraftRes res in Resources )
|
||||
{
|
||||
if ( res.ItemType == typeRes )
|
||||
{
|
||||
craftRes = res;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Type baseType = craftRes.ItemType;
|
||||
|
||||
if ( (baseType == resCol.ResType) && ( typeRes != null ) )
|
||||
baseType = typeRes;
|
||||
|
||||
return baseType;
|
||||
}
|
||||
|
||||
private int m_ResHue;
|
||||
private int m_ResAmount;
|
||||
private CraftSystem m_System;
|
||||
|
|
@ -984,25 +804,6 @@ namespace Server.Engines.Craft
|
|||
m_ResAmount = amount;
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckMulitpleHues( Mobile from, Type[] types )
|
||||
{
|
||||
Item[] items = from.Backpack.FindItemsByType( types, true );
|
||||
|
||||
CraftContext context = m_System.GetContext( from );
|
||||
|
||||
if ( context == null || context.CheckedHues || items.Length < 1 )
|
||||
return;
|
||||
|
||||
for ( int i = 0; i < items.Length; ++i )
|
||||
if ( !context.Hues.Contains( items[i].Hue ) )
|
||||
context.Hues.Add( items[i].Hue );
|
||||
|
||||
context.CheckedHues = true;
|
||||
|
||||
if ( m_UseAllRes && !m_System.UsesHueSelector( this, types[0] ) )
|
||||
context.CompareHueTo = items[0];
|
||||
}
|
||||
|
||||
private int CheckHueGrouping( Item a, Item b )
|
||||
{
|
||||
|
|
@ -1013,16 +814,6 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
if( m_ForceNonExceptional )
|
||||
return 0.0;
|
||||
|
||||
// Carpentry prior to AOS did not have exceptional items
|
||||
if ( !Core.AOS )
|
||||
{
|
||||
for ( int i = 0; i < m_MarkableAOSTable.Length; ++i )
|
||||
{
|
||||
if ( m_Type == m_MarkableAOSTable[i] || m_Type.IsSubclassOf( m_MarkableAOSTable[i] ) )
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
switch ( system.ECA )
|
||||
{
|
||||
|
|
@ -1100,7 +891,7 @@ namespace Server.Engines.Craft
|
|||
|
||||
return chance;
|
||||
}
|
||||
|
||||
|
||||
public void Craft( Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool )
|
||||
{
|
||||
if ( from.BeginAction( typeof( CraftSystem ) ) )
|
||||
|
|
@ -1121,15 +912,15 @@ namespace Server.Engines.Craft
|
|||
int resHue = 0;
|
||||
int maxAmount = 0;
|
||||
object message = null;
|
||||
|
||||
CraftContext context = craftSystem.GetContext( from );
|
||||
|
||||
if( ConsumeRes( from, typeRes, craftSystem, ref resHue, ref maxAmount, ConsumeType.None, ref message ) )
|
||||
{
|
||||
message = null;
|
||||
|
||||
|
||||
if( ConsumeAttributes( from, ref message, false ) )
|
||||
{
|
||||
CraftContext context = craftSystem.GetContext( from );
|
||||
|
||||
if( context != null )
|
||||
context.OnMade( this );
|
||||
|
||||
|
|
@ -1141,9 +932,6 @@ namespace Server.Engines.Craft
|
|||
}
|
||||
else
|
||||
{
|
||||
if ( context != null )
|
||||
context.ResetHueStateVars();
|
||||
|
||||
from.EndAction( typeof( CraftSystem ) );
|
||||
from.SendGump( new CraftGump( from, craftSystem, tool, message ) );
|
||||
}
|
||||
|
|
@ -1151,20 +939,7 @@ namespace Server.Engines.Craft
|
|||
else
|
||||
{
|
||||
from.EndAction( typeof( CraftSystem ) );
|
||||
|
||||
if ( m_BeginHueSelector )
|
||||
{
|
||||
m_BeginHueSelector = false;
|
||||
from.SendLocalizedMessage( 1074794 ); // Target the material to use:
|
||||
from.Target = new SelectHuedTarget( this, craftSystem, m_TypeToCompare, tool );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( context != null )
|
||||
context.ResetHueStateVars();
|
||||
|
||||
from.SendGump( new CraftGump( from, craftSystem, tool, message ) );
|
||||
}
|
||||
from.SendGump( new CraftGump( from, craftSystem, tool, message ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1289,31 +1064,26 @@ namespace Server.Engines.Craft
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
CraftContext context = craftSystem.GetContext( from );
|
||||
|
||||
if ( context != null && context.Hues.Count <= 1 )
|
||||
tool.UsesRemaining--;
|
||||
|
||||
if ( craftSystem is DefBlacksmithy )
|
||||
{
|
||||
tool.UsesRemaining--;
|
||||
|
||||
if ( craftSystem is DefBlacksmithy )
|
||||
AncientSmithyHammer hammer = from.FindItemOnLayer( Layer.OneHanded ) as AncientSmithyHammer;
|
||||
if ( hammer != null && hammer != tool )
|
||||
{
|
||||
AncientSmithyHammer hammer = from.FindItemOnLayer( Layer.OneHanded ) as AncientSmithyHammer;
|
||||
if ( hammer != null && hammer != tool )
|
||||
{
|
||||
hammer.UsesRemaining--;
|
||||
if ( hammer.UsesRemaining < 1 )
|
||||
hammer.Delete();
|
||||
}
|
||||
hammer.UsesRemaining--;
|
||||
if ( hammer.UsesRemaining < 1 )
|
||||
hammer.Delete();
|
||||
}
|
||||
|
||||
if ( tool.UsesRemaining < 1 )
|
||||
toolBroken = true;
|
||||
|
||||
if ( toolBroken )
|
||||
tool.Delete();
|
||||
}
|
||||
|
||||
if ( tool.UsesRemaining < 1 )
|
||||
toolBroken = true;
|
||||
|
||||
if ( toolBroken )
|
||||
tool.Delete();
|
||||
|
||||
int num = 0;
|
||||
|
||||
Item item;
|
||||
|
|
@ -1328,19 +1098,7 @@ namespace Server.Engines.Craft
|
|||
}
|
||||
else
|
||||
{
|
||||
if ( CraftArgs != null )
|
||||
{
|
||||
try{ item = Activator.CreateInstance( ItemType, CraftArgs ) as Item; }
|
||||
catch
|
||||
{
|
||||
item = null;
|
||||
//An internal error occurred, Please notify a game master that you received this message.
|
||||
from.SendGump( new CraftGump( from, craftSystem, tool, 1043288 ) );
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
item = Activator.CreateInstance( ItemType ) as Item;
|
||||
item = Activator.CreateInstance( ItemType ) as Item;
|
||||
}
|
||||
|
||||
if ( item != null )
|
||||
|
|
@ -1357,8 +1115,6 @@ namespace Server.Engines.Craft
|
|||
else
|
||||
item.Amount = maxAmount;
|
||||
}
|
||||
|
||||
item.Amount *= m_MultiplyBy;
|
||||
|
||||
from.AddToBackpack( item );
|
||||
|
||||
|
|
@ -1441,18 +1197,13 @@ namespace Server.Engines.Craft
|
|||
return;
|
||||
}
|
||||
|
||||
CraftContext context = craftSystem.GetContext( from );
|
||||
tool.UsesRemaining--;
|
||||
|
||||
if ( context != null && context.Hues.Count <= 1 )
|
||||
{
|
||||
tool.UsesRemaining--;
|
||||
if ( tool.UsesRemaining < 1 )
|
||||
toolBroken = true;
|
||||
|
||||
if ( tool.UsesRemaining < 1 )
|
||||
toolBroken = true;
|
||||
|
||||
if ( toolBroken )
|
||||
tool.Delete();
|
||||
}
|
||||
if ( toolBroken )
|
||||
tool.Delete();
|
||||
|
||||
// SkillCheck failed.
|
||||
int num = craftSystem.PlayEndingEffect( from, true, true, toolBroken, endquality, false, this );
|
||||
|
|
@ -1530,8 +1281,6 @@ namespace Server.Engines.Craft
|
|||
|
||||
if ( cc != null )
|
||||
cc.EndCraftAction();
|
||||
|
||||
context.ResetHueStateVars();
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -1549,30 +1298,9 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
if ( context.MarkOption == CraftMarkOption.DoNotMark )
|
||||
makersMark = false;
|
||||
|
||||
Type comparerResType = null;
|
||||
|
||||
if ( context.CompareHueTo != null )
|
||||
comparerResType = context.CompareHueTo.GetType();
|
||||
|
||||
Type baseType = m_CraftItem.GetBaseResType( m_CraftSystem, ( comparerResType != null ? comparerResType : m_TypeRes ) );
|
||||
|
||||
if ( context.Hues != null && context.Hues.Count > 0 && m_CraftItem.UseAllRes && !m_CraftSystem.UsesHueSelector( m_CraftItem, baseType ) )
|
||||
{
|
||||
while ( context.Hues.Count > 0 )
|
||||
{
|
||||
if ( context.CompareHueTo != null )
|
||||
context.CompareHueTo.Hue = context.Hues[0];
|
||||
|
||||
m_CraftItem.CompleteCraft( quality, makersMark, m_From, m_CraftSystem, m_TypeRes, m_Tool, null );
|
||||
context.Hues.RemoveAt( 0 );
|
||||
}
|
||||
}
|
||||
else
|
||||
m_CraftItem.CompleteCraft( quality, makersMark, m_From, m_CraftSystem, m_TypeRes, m_Tool, null );
|
||||
|
||||
m_CraftItem.CompleteCraft( quality, makersMark, m_From, m_CraftSystem, m_TypeRes, m_Tool, null );
|
||||
}
|
||||
|
||||
context.ResetHueStateVars();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,11 +50,6 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool UsesHueSelector( CraftItem item, Type type )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public CraftContext GetContext( Mobile m )
|
||||
{
|
||||
|
|
@ -150,11 +145,6 @@ namespace Server.Engines.Craft
|
|||
{
|
||||
return AddCraft( typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, message );
|
||||
}
|
||||
|
||||
public int AddCraft( Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount, TextDefinition message, object[] args )
|
||||
{
|
||||
return AddCraft( typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, message, args );
|
||||
}
|
||||
|
||||
public int AddCraft( Type typeItem, TextDefinition group, TextDefinition name, SkillName skillToMake, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount )
|
||||
{
|
||||
|
|
@ -162,17 +152,11 @@ namespace Server.Engines.Craft
|
|||
}
|
||||
|
||||
public int AddCraft( Type typeItem, TextDefinition group, TextDefinition name, SkillName skillToMake, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount, TextDefinition message )
|
||||
{
|
||||
return AddCraft( typeItem, group, name, skillToMake, minSkill, maxSkill, typeRes, nameRes, amount, "", null );
|
||||
}
|
||||
|
||||
public int AddCraft( Type typeItem, TextDefinition group, TextDefinition name, SkillName skillToMake, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount, TextDefinition message, object[] args )
|
||||
{
|
||||
CraftItem craftItem = new CraftItem( typeItem, group, name );
|
||||
craftItem.AddRes( typeRes, nameRes, amount, message );
|
||||
craftItem.AddSkill( skillToMake, minSkill, maxSkill );
|
||||
craftItem.CraftArgs = args;
|
||||
|
||||
|
||||
DoGroup( group, craftItem );
|
||||
return m_CraftItems.Add( craftItem );
|
||||
}
|
||||
|
|
@ -213,16 +197,10 @@ namespace Server.Engines.Craft
|
|||
craftItem.Hits = hits;
|
||||
}
|
||||
|
||||
public void SetUseAllRes( int index, bool useAll )
|
||||
{
|
||||
SetUseAllRes( index, useAll, 1048176); // Default message is "Makes as many as possible at once"
|
||||
}
|
||||
|
||||
public void SetUseAllRes( int index, bool useAll, int message )
|
||||
public void SetUseAllRes( int index, bool useAll )
|
||||
{
|
||||
CraftItem craftItem = m_CraftItems.GetAt( index );
|
||||
craftItem.UseAllRes = useAll;
|
||||
craftItem.UseAllMessage = message;
|
||||
}
|
||||
|
||||
public void SetNeedHeat( int index, bool needHeat )
|
||||
|
|
@ -277,12 +255,6 @@ namespace Server.Engines.Craft
|
|||
CraftItem craftItem = m_CraftItems.GetAt( index );
|
||||
craftItem.AddRecipe( id, this );
|
||||
}
|
||||
|
||||
public void MultiplyBy( int index, int multiple )
|
||||
{
|
||||
CraftItem craftItem = m_CraftItems.GetAt( index );
|
||||
craftItem.MultiplyBy = multiple;
|
||||
}
|
||||
|
||||
public void ForceNonExceptional( int index )
|
||||
{
|
||||
|
|
@ -290,12 +262,6 @@ namespace Server.Engines.Craft
|
|||
craftItem.ForceNonExceptional = true;
|
||||
}
|
||||
|
||||
public void ForceGumpItemID( int index, int itemID )
|
||||
{
|
||||
CraftItem craftItem = m_CraftItems.GetAt( index );
|
||||
craftItem.ForceGumpItemID = true;
|
||||
craftItem.GumpItemID = itemID;
|
||||
}
|
||||
|
||||
public void SetSubRes( Type type, string name )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Targeting;
|
||||
using Server.Items;
|
||||
|
|
@ -30,7 +29,7 @@ namespace Server.Engines.Craft
|
|||
if ( !item.IsChildOf( from.Backpack ) )
|
||||
return EnhanceResult.NotInBackpack;
|
||||
|
||||
if ( !(item is BaseArmor) && !(item is BaseWeapon) && !(item is BaseOtherEquipable) )
|
||||
if ( !(item is BaseArmor) && !(item is BaseWeapon) )
|
||||
return EnhanceResult.BadItem;
|
||||
|
||||
if ( item is IArcaneEquip )
|
||||
|
|
@ -86,10 +85,19 @@ namespace Server.Engines.Craft
|
|||
}
|
||||
}
|
||||
|
||||
int phys = 0, fire = 0, cold = 0, pois = 0, nrgy = 0;
|
||||
int dura = 0, luck = 0, lreq = 0, dinc = 0;
|
||||
int baseChance = 0;
|
||||
|
||||
BonusAttribute[] bonusAttrs = null;
|
||||
BonusAttribute[] randomAttrs = null;
|
||||
|
||||
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 )
|
||||
{
|
||||
|
|
@ -99,15 +107,23 @@ namespace Server.Engines.Craft
|
|||
return EnhanceResult.AlreadyEnhanced;
|
||||
|
||||
baseChance = 20;
|
||||
|
||||
CheckSkill( ref baseChance, from, craftSystem );
|
||||
|
||||
int numOfRand = attributes.RandomAttributeCount;
|
||||
|
||||
bonusAttrs = attributes.WeaponAttributes;
|
||||
randomAttrs = BonusAttributesHelper.GetRandomAttributes( attributes.WeaponRandomAttributes, numOfRand );
|
||||
|
||||
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 if ( item is BaseArmor )
|
||||
else
|
||||
{
|
||||
BaseArmor armor = (BaseArmor)item;
|
||||
|
||||
|
|
@ -115,48 +131,62 @@ namespace Server.Engines.Craft
|
|||
return EnhanceResult.AlreadyEnhanced;
|
||||
|
||||
baseChance = 20;
|
||||
|
||||
CheckSkill( ref baseChance, from, craftSystem );
|
||||
|
||||
int numOfRand = attributes.RandomAttributeCount;
|
||||
|
||||
if ( armor.UsesShieldAttrs )
|
||||
{
|
||||
bonusAttrs = attributes.ShieldAttributes;
|
||||
randomAttrs = BonusAttributesHelper.GetRandomAttributes( attributes.ShieldRandomAttributes, numOfRand );
|
||||
}
|
||||
else
|
||||
{
|
||||
bonusAttrs = info.AttributeInfo.ArmorAttributes;
|
||||
randomAttrs = BonusAttributesHelper.GetRandomAttributes( attributes.ArmorRandomAttributes, numOfRand );
|
||||
}
|
||||
}
|
||||
else if ( item is BaseOtherEquipable )
|
||||
{
|
||||
BaseOtherEquipable otherEquip = (BaseOtherEquipable)item;
|
||||
|
||||
if ( !CraftResources.IsStandard( otherEquip.Resource ) )
|
||||
return EnhanceResult.AlreadyEnhanced;
|
||||
phys = armor.PhysicalResistance;
|
||||
fire = armor.FireResistance;
|
||||
cold = armor.ColdResistance;
|
||||
pois = armor.PoisonResistance;
|
||||
nrgy = armor.EnergyResistance;
|
||||
|
||||
baseChance = 20;
|
||||
|
||||
CheckSkill( ref baseChance, from, craftSystem );
|
||||
|
||||
int numOfRand = attributes.RandomAttributeCount;
|
||||
|
||||
bonusAttrs = attributes.OtherAttributes;
|
||||
randomAttrs = BonusAttributesHelper.GetRandomAttributes( attributes.OtherRandomAttributes, numOfRand );
|
||||
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;
|
||||
}
|
||||
|
||||
List<BonusAttribute> attrs = new List<BonusAttribute>();
|
||||
if ( bonusAttrs != null && bonusAttrs.Length > 0 )
|
||||
attrs.AddRange( bonusAttrs );
|
||||
if ( randomAttrs != null && randomAttrs.Length > 0 )
|
||||
attrs.AddRange( randomAttrs );
|
||||
|
||||
|
||||
int skill = from.Skills[craftSystem.MainSkill].Fixed / 10;
|
||||
|
||||
if ( skill >= 100 )
|
||||
baseChance -= (skill - 90) / 10;
|
||||
|
||||
EnhanceResult res = EnhanceResult.Success;
|
||||
|
||||
TryEnhance( attrs, item, baseChance, ref res );
|
||||
|
||||
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 )
|
||||
{
|
||||
|
|
@ -176,29 +206,17 @@ namespace Server.Engines.Craft
|
|||
if( item is BaseWeapon )
|
||||
{
|
||||
BaseWeapon w = (BaseWeapon)item;
|
||||
|
||||
w.RandomAttributes = randomAttrs;
|
||||
|
||||
w.Resource = resource;
|
||||
|
||||
w.Hue = w.GetElementalDamageHue( w.Hue );
|
||||
int hue = w.GetElementalDamageHue();
|
||||
if( hue > 0 )
|
||||
w.Hue = hue;
|
||||
}
|
||||
else if( item is BaseArmor )
|
||||
else if( item is BaseArmor ) //Sanity
|
||||
{
|
||||
BaseArmor ar = (BaseArmor)item;
|
||||
|
||||
ar.RandomAttributes = randomAttrs;
|
||||
|
||||
((BaseArmor)item).Resource = resource;
|
||||
}
|
||||
else if( item is BaseOtherEquipable ) //Sanity
|
||||
{
|
||||
BaseOtherEquipable otherEquip = (BaseOtherEquipable)item;
|
||||
|
||||
otherEquip.RandomAttributes = randomAttrs;
|
||||
|
||||
((BaseOtherEquipable)item).Resource = resource;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -226,129 +244,6 @@ namespace Server.Engines.Craft
|
|||
else if ( chance > random )
|
||||
res = EnhanceResult.Broken;
|
||||
}
|
||||
|
||||
public static void CheckSkill( ref int baseChance, Mobile from, CraftSystem craftSystem )
|
||||
{
|
||||
int skill = from.Skills[craftSystem.MainSkill].Fixed / 10;
|
||||
|
||||
if ( skill >= 100 )
|
||||
baseChance -= (skill - 90) / 10;
|
||||
}
|
||||
|
||||
public static void TryEnhance( List<BonusAttribute> attrs, Item item, int baseChance, ref EnhanceResult res )
|
||||
{
|
||||
foreach ( BonusAttribute attr in attrs )
|
||||
{
|
||||
if ( res != EnhanceResult.Success )
|
||||
return;
|
||||
|
||||
if ( attr.Attribute == null )
|
||||
continue;
|
||||
|
||||
Type type = attr.Attribute.GetType();
|
||||
|
||||
if ( type == typeof( AosAttribute ) )
|
||||
{
|
||||
AosAttribute aosAttr = (AosAttribute)attr.Attribute;
|
||||
|
||||
if ( aosAttr == AosAttribute.SpellChanneling )
|
||||
continue;
|
||||
|
||||
if ( item is IAosAttributes )
|
||||
CheckResult( ref res, baseChance + GetChance( aosAttr, ((IAosAttributes)item).Attributes ) );
|
||||
}
|
||||
else if ( type == typeof( AosWeaponAttribute ) )
|
||||
{
|
||||
if ( item is BaseWeapon )
|
||||
CheckResult( ref res, baseChance + GetChance( (AosWeaponAttribute)attr.Attribute, ((BaseWeapon)item).WeaponAttributes ) );
|
||||
}
|
||||
else if ( type == typeof( AosArmorAttribute ) )
|
||||
{
|
||||
if ( (AosArmorAttribute)attr.Attribute == AosArmorAttribute.MageArmor )
|
||||
continue;
|
||||
|
||||
if ( item is BaseArmor )
|
||||
CheckResult( ref res, baseChance + GetChance( (AosArmorAttribute)attr.Attribute, ((BaseArmor)item).ArmorAttributes ) );
|
||||
}
|
||||
else if ( type == typeof( ResistanceType ) )
|
||||
{
|
||||
if ( item is BaseArmor )
|
||||
{
|
||||
BaseArmor ar = (BaseArmor)item;
|
||||
|
||||
switch ( (ResistanceType)attr.Attribute )
|
||||
{
|
||||
case ResistanceType.Physical:
|
||||
CheckResult( ref res, baseChance + ar.PhysicalResistance );
|
||||
break;
|
||||
case ResistanceType.Fire:
|
||||
CheckResult( ref res, baseChance + ar.FireResistance );
|
||||
break;
|
||||
case ResistanceType.Cold:
|
||||
CheckResult( ref res, baseChance + ar.ColdResistance );
|
||||
break;
|
||||
case ResistanceType.Poison:
|
||||
CheckResult( ref res, baseChance + ar.PoisonResistance );
|
||||
break;
|
||||
case ResistanceType.Energy:
|
||||
CheckResult( ref res, baseChance + ar.EnergyResistance );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetChance( AosAttribute attr, AosAttributes itemAttrs )
|
||||
{
|
||||
int chance;
|
||||
|
||||
switch ( attr )
|
||||
{
|
||||
case AosAttribute.LowerWeight: chance = itemAttrs[attr] / 40; break;
|
||||
case AosAttribute.WeaponDamage: chance = itemAttrs[attr] / 4; break;
|
||||
case AosAttribute.Luck: chance = 10 + itemAttrs[attr] / 2; break;
|
||||
default:
|
||||
chance = itemAttrs[attr] / 2; break;
|
||||
}
|
||||
|
||||
return chance;
|
||||
}
|
||||
|
||||
public static int GetChance( AosArmorAttribute attr, AosArmorAttributes itemAttrs )
|
||||
{
|
||||
int chance;
|
||||
|
||||
switch ( attr )
|
||||
{
|
||||
case AosArmorAttribute.DurabilityBonus: chance = itemAttrs[attr] / 40; break;
|
||||
case AosArmorAttribute.LowerStatReq: chance = itemAttrs[attr] / 4; break;
|
||||
default:
|
||||
chance = itemAttrs[attr] / 2; break;
|
||||
}
|
||||
|
||||
return chance;
|
||||
}
|
||||
|
||||
public static int GetChance( AosWeaponAttribute attr, AosWeaponAttributes itemAttrs )
|
||||
{
|
||||
int chance;
|
||||
|
||||
switch ( attr )
|
||||
{
|
||||
case AosWeaponAttribute.DurabilityBonus: chance = itemAttrs[attr] / 40; break;
|
||||
case AosWeaponAttribute.LowerStatReq: chance = itemAttrs[attr] / 4; break;
|
||||
case AosWeaponAttribute.ResistPhysicalBonus:
|
||||
case AosWeaponAttribute.ResistFireBonus:
|
||||
case AosWeaponAttribute.ResistColdBonus:
|
||||
case AosWeaponAttribute.ResistPoisonBonus:
|
||||
case AosWeaponAttribute.ResistEnergyBonus: chance = itemAttrs[attr]; break;
|
||||
default:
|
||||
chance = itemAttrs[attr] / 2; break;
|
||||
}
|
||||
|
||||
return chance;
|
||||
}
|
||||
|
||||
public static void BeginTarget( Mobile from, CraftSystem craftSystem, BaseTool tool )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,17 +27,6 @@ namespace Server.Engines.Craft
|
|||
return m_CraftSystem;
|
||||
}
|
||||
}
|
||||
|
||||
public override CraftECA ECA
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( Core.AOS )
|
||||
return CraftECA.ChanceMinusSixtyToFourtyFive;
|
||||
|
||||
return CraftECA.FiftyPercentChanceMinusTenPercent;
|
||||
}
|
||||
}
|
||||
|
||||
public override double GetChanceAtMin( CraftItem item )
|
||||
{
|
||||
|
|
@ -92,6 +81,8 @@ namespace Server.Engines.Craft
|
|||
}
|
||||
}
|
||||
|
||||
public override CraftECA ECA{ get{ return CraftECA.FiftyPercentChanceMinusTenPercent; } }
|
||||
|
||||
public override void InitCraftList()
|
||||
{
|
||||
int index = -1;
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@ namespace Server.Engines.Craft
|
|||
return m_CraftSystem;
|
||||
}
|
||||
}
|
||||
|
||||
public override CraftECA ECA{ get{ return CraftECA.ChanceMinusSixtyToFourtyFive; } }
|
||||
|
||||
public override double GetChanceAtMin( CraftItem item )
|
||||
{
|
||||
|
|
@ -48,14 +46,6 @@ namespace Server.Engines.Craft
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override bool RetainsColorFrom( CraftItem item, Type type )
|
||||
{
|
||||
if ( item.ItemType.IsSubclassOf( typeof( BaseWeapon ) ) || item.ItemType.IsSubclassOf( typeof( BaseArmor ) ) )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void PlayCraftEffect( Mobile from )
|
||||
{
|
||||
|
|
@ -98,30 +88,15 @@ namespace Server.Engines.Craft
|
|||
// Other Items
|
||||
if ( Core.Expansion == Expansion.AOS || Core.Expansion == Expansion.SE )
|
||||
{
|
||||
index = AddCraft( typeof( Board ), 1044294, 1027127, 0.0, 0.0, typeof( Log ), 1044466, 1, 1044465 );
|
||||
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 ); //Left
|
||||
|
||||
index = AddCraft( typeof( ShortMusicStand ), 1044294, 1044314, 78.9, 103.9, typeof( Log ), 1044041, 15, 1044351, new object[] { 0xEB8 } ); //Right
|
||||
ForceGumpItemID( index, 0xEB8 );
|
||||
|
||||
AddCraft( typeof( TallMusicStand ), 1044294, 1044315, 81.5, 106.5, typeof( Log ), 1044041, 20, 1044351 ); //Left
|
||||
|
||||
index = AddCraft( typeof( TallMusicStand ), 1044294, 1044316, 81.5, 106.5, typeof( Log ), 1044041, 20, 1044351, new object[] { 0xEBC } ); //Right
|
||||
ForceGumpItemID( index, 0xEBC );
|
||||
|
||||
AddCraft( typeof( EasleWithCanvas ), 1044294, 1044317, 86.8, 111.8, typeof( Log ), 1044041, 20, 1044351 ); //South
|
||||
|
||||
index = AddCraft( typeof( EasleWithCanvas ), 1044294, 1044318, 86.8, 111.8, typeof( Log ), 1044041, 20, 1044351, new object[] { 0xF68 } ); //East
|
||||
ForceGumpItemID( index, 0xF68 );
|
||||
|
||||
index = AddCraft( typeof( EasleWithCanvas ), 1044294, 1044319, 86.8, 111.8, typeof( Log ), 1044041, 20, 1044351, new object[] { 0xF6A } ); //North
|
||||
ForceGumpItemID( index, 0xF6A );
|
||||
|
||||
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 );
|
||||
|
|
@ -145,19 +120,12 @@ namespace Server.Engines.Craft
|
|||
|
||||
if( Core.AOS ) //Duplicate Entries to preserve ordering depending on era
|
||||
{
|
||||
index = AddCraft( typeof( FishingPole ), 1044294, 1023519, 68.4, 93.4, typeof( Log ), 1044041, 5, 1044351 ); //This is in the category of Other during AoS
|
||||
index = AddCraft( typeof( FishingPole ), 1044294, 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.ML )
|
||||
{
|
||||
index = AddCraft( typeof( ArcanistStatueSouthDeed ), 1044294, 1072885, 0.0, 35.0, typeof( Log ), 1044041, 250, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( ArcanistStatueEastDeed ), 1044294, 1072886, 0.0, 35.0, typeof( Log ), 1044041, 250, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
}
|
||||
|
||||
|
||||
// Furniture
|
||||
AddCraft( typeof( FootStool ), 1044291, 1022910, 11.0, 36.0, typeof( Log ), 1044041, 9, 1044351 );
|
||||
|
|
@ -182,30 +150,6 @@ namespace Server.Engines.Craft
|
|||
index = AddCraft( typeof( PlainLowTable ), 1044291, 1030266, 80.0, 105.0, typeof( Log ), 1044041, 35, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
}
|
||||
|
||||
if( Core.ML )
|
||||
{
|
||||
index = AddCraft( typeof( OrnateElvenTableSouthDeed ), 1044291, 1072869, 85.0, 110.0, typeof( Log ), 1044041, 60, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( OrnateElvenTableEastDeed ), 1044291, 1073384, 85.0, 110.0, typeof( Log ), 1044041, 60, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( FancyElvenTableSouthDeed ), 1044291, 1073385, 80.0, 105.0, typeof( Log ), 1044041, 50, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( FancyElvenTableEastDeed ), 1044291, 1073386, 80.0, 105.0, typeof( Log ), 1044041, 50, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( ElvenBookStand ), 1044291, 1031741, 80.0, 105.0, typeof( Log ), 1044041, 20, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( BigElvenChair ), 1044291, 1031755, 85.0, 110.0, typeof( Log ), 1044041, 40, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( ElvenReadingChair ), 1044291, 1072160, 80.0, 105.0, typeof( Log ), 1044041, 30, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
}
|
||||
|
||||
// Containers
|
||||
AddCraft( typeof( WoodenBox ), 1044292, 1023709, 21.0, 46.0, typeof( Log ), 1044041, 10, 1044351 );
|
||||
|
|
@ -246,44 +190,22 @@ namespace Server.Engines.Craft
|
|||
index = AddCraft( typeof( ElegantArmoire ), 1044292, 1030330, 90.0, 115.0, typeof( Log ), 1044041, 40, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( MapleArmoire ), 1044292, 1030332, 90.0, 115.0, typeof( Log ), 1044041, 40, 1044351 );
|
||||
index = AddCraft( typeof( MapleArmoire ), 1044292, 1030328, 90.0, 115.0, typeof( Log ), 1044041, 40, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( CherryArmoire ), 1044292, 1030334, 90.0, 115.0, typeof( Log ), 1044041, 40, 1044351 );
|
||||
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 );
|
||||
ForceNonExceptional( index );
|
||||
|
||||
if ( Core.ML )
|
||||
{
|
||||
index = AddCraft( typeof( ElvenWashBasinSouthDeed ), 1044292, 1072865, 70.0, 95.0, typeof( Log ), 1044041, 40, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( ElvenWashBasinEastDeed ), 1044292, 1073387, 70.0, 95.0, typeof( Log ), 1044041, 40, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( OrnateElvenChest ), 1044292, 1031761, 80.0, 105.0, typeof( Log ), 1044041, 30, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( OrnateElvenBox ), 1044292, 1031763, 80.0, 105.0, typeof( Log ), 1044041, 25, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
}
|
||||
|
||||
// Staves and Shields
|
||||
int group;
|
||||
if ( Core.ML )
|
||||
group = 1044566; // Armor and Weapons are seperated post ML
|
||||
else
|
||||
group = 1044295;
|
||||
|
||||
AddCraft( typeof( ShepherdsCrook ), group, 1023713, 78.9, 103.9, typeof( Log ), 1044041, 7, 1044351 );
|
||||
AddCraft( typeof( QuarterStaff ), group, 1023721, 73.6, 98.6, typeof( Log ), 1044041, 6, 1044351 );
|
||||
AddCraft( typeof( GnarledStaff ), group, 1025112, 78.9, 103.9, typeof( Log ), 1044041, 7, 1044351 );
|
||||
AddCraft( typeof( WoodenShield ), ( Core.ML ? 1062760 : 1044295 ), 1027034, 52.6, 77.6, typeof( Log ), 1044041, 9, 1044351 );
|
||||
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 );
|
||||
|
||||
if( !Core.AOS ) //Duplicate Entries to preserve ordering depending on era
|
||||
{
|
||||
|
|
@ -294,23 +216,17 @@ namespace Server.Engines.Craft
|
|||
|
||||
if( Core.SE )
|
||||
{
|
||||
index = AddCraft( typeof( Bokuto ), group, 1030227, 70.0, 95.0, typeof( Log ), 1044041, 6, 1044351 );
|
||||
index = AddCraft( typeof( Bokuto ), 1044295, 1030227, 70.0, 95.0, typeof( Log ), 1044041, 6, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( Fukiya ), group, 1030229, 60.0, 85.0, typeof( Log ), 1044041, 6, 1044351 );
|
||||
index = AddCraft( typeof( Fukiya ), 1044295, 1030229, 60.0, 85.0, typeof( Log ), 1044041, 6, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.SE );
|
||||
|
||||
index = AddCraft( typeof( Tetsubo ), group, 1030225, 85.0, 110.0, typeof( Log ), 1044041, 8, 1044351 );
|
||||
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 );
|
||||
}
|
||||
|
||||
if ( Core.ML )
|
||||
{
|
||||
index = AddCraft( typeof( WildStaff ), 1044566, 1031557, 63.8, 144.6, typeof( Log ), 1044041, 16, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
}
|
||||
|
||||
// Instruments
|
||||
index = AddCraft( typeof( LapHarp ), 1044293, 1023762, 63.1, 88.1, typeof( Log ), 1044041, 20, 1044351 );
|
||||
|
|
@ -345,61 +261,16 @@ namespace Server.Engines.Craft
|
|||
}
|
||||
|
||||
// Misc
|
||||
if ( Core.ML )
|
||||
{
|
||||
index = AddCraft( typeof( PlayerBBEast ), 1044290, 1062420, 85.0, 110.0, typeof( Log ), 1044041, 50, 1044351 );
|
||||
|
||||
index = AddCraft( typeof( PlayerBBSouth ), 1044290, 1062421, 85.0, 110.0, typeof( Log ), 1044041, 50, 1044351 );
|
||||
|
||||
index = AddCraft( typeof( ParrotPerchDeed ), 1044290, 1032214, 50.0, 85.0, typeof( Log ), 1044041, 100, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( ArcaneCircleDeed ), 1044290, 1032411, 94.7, 119.6, typeof( Log ), 1044041, 100, 1044351 );
|
||||
AddRes( index, typeof( BlueDiamond ), 1032696, 2, 1044253 );
|
||||
AddRes( index, typeof( PerfectEmerald ), 1032692, 2, 1044253 );
|
||||
AddRes( index, typeof( FireRuby ), 1032695, 2, 1044253 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( TallElvenBedSouthDeed ), 1044290, 1072858, 94.7, 119.6, typeof( Log ), 1044041, 200, 1044351 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 100, 1044287 );
|
||||
AddRecipe( index, 116 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( TallElvenBedEastDeed ), 1044290, 1072859, 94.7, 119.6, typeof( Log ), 1044041, 200, 1044351 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 100, 1044287 );
|
||||
AddRecipe( index, 117 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( ElvenBedSouthDeed ), 1044290, 1072860, 94.7, 119.6, typeof( Log ), 1044041, 100, 1044351 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 100, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( ElvenBedEastDeed ), 1044290, 1072861, 94.7, 119.6, typeof( Log ), 1044041, 100, 1044351 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 100, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( ElvenLoveseatSouthDeed ), 1044290, 1072867, 80.0, 105.0, typeof( Log ), 1044041, 50, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( ElvenLoveseatEastDeed ), 1044290, 1073372, 80.0, 105.0, typeof( Log ), 1044041, 50, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( AlchemistTableSouthDeed ), 1044290, 1073396, 85.0, 110.0, typeof( Log ), 1044041, 70, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( AlchemistTableEastDeed ), 1044290, 1073397, 85.0, 110.0, typeof( Log ), 1044041, 70, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
}
|
||||
index = AddCraft( typeof( SmallBedSouthDeed ), 1044290, 1044321, 94.7, 119.6, typeof( Log ), 1044041, 100, 1044351 );
|
||||
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, 119.6, typeof( Log ), 1044041, 100, 1044351 );
|
||||
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, 119.6, typeof( Log ), 1044041, 150, 1044351 );
|
||||
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, 119.6, typeof( Log ), 1044041, 150, 1044351 );
|
||||
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 );
|
||||
|
|
@ -412,72 +283,47 @@ namespace Server.Engines.Craft
|
|||
AddSkill( index, SkillName.Magery, 50.0, 55.0 );
|
||||
AddRes( index, typeof( IronIngot ), 1044036, 40, 1044037 );
|
||||
|
||||
if ( Core.Expansion == Expansion.AOS || Core.Expansion == Expansion.SE ) //Duplicate Entries to preserve ordering depending on era
|
||||
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 );
|
||||
}
|
||||
|
||||
if ( !Core.ML ) //Duplicate Entries to preserve ordering depending on era
|
||||
{
|
||||
// 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 );
|
||||
// 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 );
|
||||
}
|
||||
// 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 and Cooking
|
||||
index = AddCraft( typeof( Dressform ), 1044298, 1044339, 63.1, 88.1, typeof( Log ), 1044041, 25, 1044351 ); //Front
|
||||
// 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( Dressform ), 1044298, 1044340, 63.1, 88.1, typeof( Log ), 1044041, 25, 1044351, new object[] { 0xEC7 } ); //Side
|
||||
AddSkill( index, SkillName.Tailoring, 65.0, 70.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 10, 1044287 );
|
||||
ForceGumpItemID( index, 0xEC7 );
|
||||
if ( Core.ML )
|
||||
{
|
||||
index = AddCraft( typeof( ElvenSpinningwheelEastDeed ), 1044298, 1073393, 75.0, 100, typeof( Log ), 1044041, 60, 1044351 );
|
||||
AddSkill( index, SkillName.Tailoring, 65.0, 70.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 40, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( ElvenSpinningwheelSouthDeed ), 1044298, 1072878, 75.0, 100, typeof( Log ), 1044041, 60, 1044351 );
|
||||
AddSkill( index, SkillName.Tailoring, 65.0, 70.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 40, 1044287 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( ElvenStoveSouthDeed ), 1044298, 1073394, 85.0, 110.0, typeof( Log ), 1044041, 80, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
|
||||
index = AddCraft( typeof( ElvenStoveEastDeed ), 1044298, 1073395, 85.0, 110.0, typeof( Log ), 1044041, 80, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
}
|
||||
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 );
|
||||
|
|
@ -491,82 +337,36 @@ namespace Server.Engines.Craft
|
|||
AddSkill( index, SkillName.Tailoring, 65.0, 70.0 );
|
||||
AddRes( index, typeof( Cloth ), 1044286, 25, 1044287 );
|
||||
|
||||
|
||||
//Cooking
|
||||
if ( Core.ML )
|
||||
group = 1044298; // These are merged into the Tailoring and Cooking definition after ML
|
||||
else
|
||||
group = 1044299;
|
||||
|
||||
index = AddCraft( typeof( StoneOvenEastDeed ), group, 1044345, 68.4, 93.4, typeof( Log ), 1044041, 85, 1044351 );
|
||||
// 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 ), group, 1044346, 68.4, 93.4, typeof( Log ), 1044041, 85, 1044351 );
|
||||
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 ), group, 1044347, 94.7, 119.7, typeof( Log ), 1044041, 100, 1044351 );
|
||||
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 ), group, 1044348, 94.7, 119.7, typeof( Log ), 1044041, 100, 1044351 );
|
||||
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 ), group, 1044349, 94.7, 119.7, typeof( Log ), 1044041, 150, 1044351 );
|
||||
AddCraft( typeof( WaterTroughSouthDeed ), group, 1044350, 94.7, 119.7, typeof( Log ), 1044041, 150, 1044351 );
|
||||
|
||||
if ( Core.ML ) //Duplicate Entries to preserve ordering depending on era
|
||||
{
|
||||
// Blacksmithy
|
||||
index = AddCraft( typeof( ElvenForgeDeed ), 1044296, 1031736, 94.7, 119.7, typeof( Log ), 1044041, 200, 1044351 );
|
||||
SetNeededExpansion( index, Expansion.ML );
|
||||
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 );
|
||||
}
|
||||
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;
|
||||
CanEnhance = Core.ML;
|
||||
|
||||
if ( Core.ML )
|
||||
{
|
||||
SetSubRes( typeof( Log ), 1072643 );
|
||||
|
||||
// Add every material you want the player to be able to choose from
|
||||
// This will override the overridable material TODO: Verify the required skill amount
|
||||
AddSubRes( typeof( Log ), 1072643, 00.0, 1044041, 1072652 );
|
||||
AddSubRes( typeof( OakLog ), 1072644, 65.0, 1044041, 1072652 );
|
||||
AddSubRes( typeof( AshLog ), 1072645, 80.0, 1044041, 1072652 );
|
||||
AddSubRes( typeof( YewLog ), 1072646, 95.0, 1044041, 1072652 );
|
||||
AddSubRes( typeof( HeartwoodLog ), 1072647, 100.0, 1044041, 1072652 );
|
||||
AddSubRes( typeof( BloodwoodLog ), 1072648, 100.0, 1044041, 1072652 );
|
||||
AddSubRes( typeof( FrostwoodLog ), 1072649, 100.0, 1044041, 1072652 );
|
||||
}
|
||||
|
||||
SetSubRes( typeof( Log ), 1072643 );
|
||||
|
||||
// Add every material you want the player to be able to choose from
|
||||
// This will override the overridable material TODO: Verify the required skill amount
|
||||
AddSubRes( typeof( Log ), 1072643, 00.0, 1044041, 1072652 );
|
||||
AddSubRes( typeof( OakLog ), 1072644, 65.0, 1044041, 1072652 );
|
||||
AddSubRes( typeof( AshLog ), 1072645, 80.0, 1044041, 1072652 );
|
||||
AddSubRes( typeof( YewLog ), 1072646, 95.0, 1044041, 1072652 );
|
||||
AddSubRes( typeof( HeartwoodLog ), 1072647, 100.0, 1044041, 1072652 );
|
||||
AddSubRes( typeof( BloodwoodLog ), 1072648, 100.0, 1044041, 1072652 );
|
||||
AddSubRes( typeof( FrostwoodLog ), 1072649, 100.0, 1044041, 1072652 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -48,21 +48,28 @@ namespace Server.Engines.Craft
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
private static Type[] m_TailorColorables = new Type[]
|
||||
{
|
||||
typeof( GozaMatEastDeed ), typeof( GozaMatSouthDeed ),
|
||||
typeof( SquareGozaMatEastDeed ), typeof( SquareGozaMatSouthDeed ),
|
||||
typeof( BrocadeGozaMatEastDeed ), typeof( BrocadeGozaMatSouthDeed ),
|
||||
typeof( BrocadeSquareGozaMatEastDeed ), typeof( BrocadeSquareGozaMatSouthDeed )
|
||||
};
|
||||
|
||||
public override bool RetainsColorFrom( CraftItem item, Type type )
|
||||
{
|
||||
if ( item.ItemType == typeof( OilCloth ) )
|
||||
if ( type != typeof( Cloth ) && type != typeof( UncutCloth ) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool UsesHueSelector( CraftItem item, Type type )
|
||||
{
|
||||
if ( item.ItemType == typeof( UncutCloth ) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
type = item.ItemType;
|
||||
|
||||
bool contains = false;
|
||||
|
||||
for ( int i = 0; !contains && i < m_TailorColorables.Length; ++i )
|
||||
contains = ( m_TailorColorables[i] == type );
|
||||
|
||||
return contains;
|
||||
}
|
||||
|
||||
public override void PlayCraftEffect( Mobile from )
|
||||
|
|
@ -98,14 +105,6 @@ namespace Server.Engines.Craft
|
|||
public override void InitCraftList()
|
||||
{
|
||||
int index = -1;
|
||||
|
||||
#region Materials
|
||||
index = AddCraft( typeof( UncutCloth ), 1044457, 1044458, 0.0, 0.0, typeof( BoltOfCloth ), 1044453, 1, 1044253 );
|
||||
MultiplyBy( index, 50 );
|
||||
SetUseAllRes( index, true, 1044460 ); // Cut bolts of cloth into pieces of ready cloth.
|
||||
index = AddCraft( typeof( UncutCloth ), 1044457, 1044459, 0.0, 0.0, typeof( Cloth ), 1044455, 1, 1044253 );
|
||||
SetUseAllRes( index, true, 1044461 ); // Combine available cloth into piles by color.
|
||||
#endregion
|
||||
|
||||
#region Hats
|
||||
AddCraft( typeof( SkullCap ), 1011375, 1025444, 0.0, 25.0, typeof( Cloth ), 1044286, 2, 1044287 );
|
||||
|
|
|
|||
|
|
@ -34,17 +34,6 @@ namespace Server.Engines.Craft
|
|||
private DefTinkering() : base( 1, 1, 1.25 )// base( 1, 1, 3.0 )
|
||||
{
|
||||
}
|
||||
|
||||
public override CraftECA ECA
|
||||
{
|
||||
get
|
||||
{
|
||||
if ( Core.AOS )
|
||||
return CraftECA.ChanceMinusSixtyToFourtyFive;
|
||||
|
||||
return CraftECA.ChanceMinusSixty;
|
||||
}
|
||||
}
|
||||
|
||||
public override double GetChanceAtMin( CraftItem item )
|
||||
{
|
||||
|
|
@ -236,7 +225,7 @@ namespace Server.Engines.Craft
|
|||
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, 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 )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue