diff --git a/Scripts/Engines/Craft/Core/CraftContext.cs b/Scripts/Engines/Craft/Core/CraftContext.cs index 61026da17..254626c66 100644 --- a/Scripts/Engines/Craft/Core/CraftContext.cs +++ b/Scripts/Engines/Craft/Core/CraftContext.cs @@ -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 m_Hues; - private Item m_CompareHueTo; - - public bool CheckedHues { get { return m_CheckedHues; } set { m_CheckedHues = value; } } - public List Hues { get { return m_Hues; } set { m_Hues = value; } } - public Item CompareHueTo { get { return m_CompareHueTo; } set { m_CompareHueTo = value; } } - #endregion public List 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(); - 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(); - m_CompareHueTo = null; - } } } \ No newline at end of file diff --git a/Scripts/Engines/Craft/Core/CraftGump.cs b/Scripts/Engines/Craft/Core/CraftGump.cs index 0ba365c44..5bb081f34 100644 --- a/Scripts/Engines/Craft/Core/CraftGump.cs +++ b/Scripts/Engines/Craft/Core/CraftGump.cs @@ -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 ) { diff --git a/Scripts/Engines/Craft/Core/CraftGumpItem.cs b/Scripts/Engines/Craft/Core/CraftGumpItem.cs index 6589c7e05..0c5e63e19 100644 --- a/Scripts/Engines/Craft/Core/CraftGumpItem.cs +++ b/Scripts/Engines/Craft/Core/CraftGumpItem.cs @@ -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 ) ) { diff --git a/Scripts/Engines/Craft/Core/CraftItem.cs b/Scripts/Engines/Craft/Core/CraftItem.cs index 42311b849..acc38f500 100644 --- a/Scripts/Engines/Craft/Core/CraftItem.cs +++ b/Scripts/Engines/Craft/Core/CraftItem.cs @@ -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 types = new List(); - - 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( 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(); } } } diff --git a/Scripts/Engines/Craft/Core/CraftSystem.cs b/Scripts/Engines/Craft/Core/CraftSystem.cs index 86312fa35..b4695ef90 100644 --- a/Scripts/Engines/Craft/Core/CraftSystem.cs +++ b/Scripts/Engines/Craft/Core/CraftSystem.cs @@ -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 ) { diff --git a/Scripts/Engines/Craft/Core/Enhance.cs b/Scripts/Engines/Craft/Core/Enhance.cs index 0d6db28fe..9b6e2e37f 100644 --- a/Scripts/Engines/Craft/Core/Enhance.cs +++ b/Scripts/Engines/Craft/Core/Enhance.cs @@ -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 attrs = new List(); - 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 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 ) { diff --git a/Scripts/Engines/Craft/DefBowFletching.cs b/Scripts/Engines/Craft/DefBowFletching.cs index f8ffab23a..2d267e278 100644 --- a/Scripts/Engines/Craft/DefBowFletching.cs +++ b/Scripts/Engines/Craft/DefBowFletching.cs @@ -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; diff --git a/Scripts/Engines/Craft/DefCarpentry.cs b/Scripts/Engines/Craft/DefCarpentry.cs index e14fefe36..095a4f2ff 100644 --- a/Scripts/Engines/Craft/DefCarpentry.cs +++ b/Scripts/Engines/Craft/DefCarpentry.cs @@ -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 ); } } } \ No newline at end of file diff --git a/Scripts/Engines/Craft/DefTailoring.cs b/Scripts/Engines/Craft/DefTailoring.cs index e10d53c12..6d25ab6dd 100644 --- a/Scripts/Engines/Craft/DefTailoring.cs +++ b/Scripts/Engines/Craft/DefTailoring.cs @@ -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 ); diff --git a/Scripts/Engines/Craft/DefTinkering.cs b/Scripts/Engines/Craft/DefTinkering.cs index 3db96aac9..f6a2259db 100644 --- a/Scripts/Engines/Craft/DefTinkering.cs +++ b/Scripts/Engines/Craft/DefTinkering.cs @@ -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 ) diff --git a/Scripts/Items/Addons/AbbatoirAddon.cs b/Scripts/Items/Addons/AbbatoirAddon.cs index cb0d37eef..392f1d078 100644 --- a/Scripts/Items/Addons/AbbatoirAddon.cs +++ b/Scripts/Items/Addons/AbbatoirAddon.cs @@ -8,12 +8,7 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new AbbatoirDeed(); } } [Constructable] - public AbbatoirAddon() : this( 0 ) - { - } - - [Constructable] - public AbbatoirAddon( int hue ) + public AbbatoirAddon() { AddComponent( new AddonComponent( 0x120E ), -1, -1, 0 ); AddComponent( new AddonComponent( 0x120F ), 0, -1, 0 ); @@ -24,7 +19,6 @@ namespace Server.Items AddComponent( new AddonComponent( 0x1214 ), -1, 1, 0 ); AddComponent( new AddonComponent( 0x1213 ), 0, 1, 0 ); AddComponent( new AddonComponent( 0x1212 ), 1, 1, 0 ); - Hue = hue; } public AbbatoirAddon( Serial serial ) : base( serial ) @@ -48,7 +42,7 @@ namespace Server.Items public class AbbatoirDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new AbbatoirAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new AbbatoirAddon(); } } public override int LabelNumber{ get{ return 1044329; } } // abbatoir [Constructable] diff --git a/Scripts/Items/Addons/AlchemistTableEastAddon.cs b/Scripts/Items/Addons/AlchemistTableEastAddon.cs index 4ec9379d6..19577e023 100644 --- a/Scripts/Items/Addons/AlchemistTableEastAddon.cs +++ b/Scripts/Items/Addons/AlchemistTableEastAddon.cs @@ -1,6 +1,5 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { @@ -9,15 +8,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new AlchemistTableEastDeed(); } } [Constructable] - public AlchemistTableEastAddon() : this( 0 ) - { - } - - [Constructable] - public AlchemistTableEastAddon( int hue ) + public AlchemistTableEastAddon() { AddComponent( new AddonComponent( 0x2DD3 ), 0, 0, 0 ); - Hue = hue; } public AlchemistTableEastAddon( Serial serial ) : base( serial ) @@ -39,10 +32,9 @@ namespace Server.Items } } - [CraftItemID( 0x2DD3 )] public class AlchemistTableEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new AlchemistTableEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new AlchemistTableEastAddon(); } } public override int LabelNumber{ get{ return 1073397; } } // alchemist table (east) [Constructable] diff --git a/Scripts/Items/Addons/AlchemistTableSouthAddon.cs b/Scripts/Items/Addons/AlchemistTableSouthAddon.cs index 38568ba7c..1302da0d9 100644 --- a/Scripts/Items/Addons/AlchemistTableSouthAddon.cs +++ b/Scripts/Items/Addons/AlchemistTableSouthAddon.cs @@ -1,6 +1,5 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { @@ -9,15 +8,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new AlchemistTableSouthDeed(); } } [Constructable] - public AlchemistTableSouthAddon() : this( 0 ) - { - } - - [Constructable] - public AlchemistTableSouthAddon( int hue ) + public AlchemistTableSouthAddon() { AddComponent( new AddonComponent( 0x2DD4 ), 0, 0, 0 ); - Hue = hue; } public AlchemistTableSouthAddon( Serial serial ) : base( serial ) @@ -39,10 +32,9 @@ namespace Server.Items } } - [CraftItemID( 0x2DD4 )] public class AlchemistTableSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new AlchemistTableSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new AlchemistTableSouthAddon(); } } public override int LabelNumber{ get{ return 1073396; } } // alchemist table (south) [Constructable] diff --git a/Scripts/Items/Addons/AnvilEastAddon.cs b/Scripts/Items/Addons/AnvilEastAddon.cs index 601e603c4..2df2183ff 100644 --- a/Scripts/Items/Addons/AnvilEastAddon.cs +++ b/Scripts/Items/Addons/AnvilEastAddon.cs @@ -8,15 +8,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new AnvilEastDeed(); } } [Constructable] - public AnvilEastAddon() : this( 0 ) - { - } - - [Constructable] - public AnvilEastAddon( int hue ) + public AnvilEastAddon() { AddComponent( new AnvilComponent( 0xFAF ), 0, 0, 0 ); - Hue = hue; } public AnvilEastAddon( Serial serial ) : base( serial ) @@ -40,7 +34,7 @@ namespace Server.Items public class AnvilEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new AnvilEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new AnvilEastAddon(); } } public override int LabelNumber{ get{ return 1044333; } } // anvil (east) [Constructable] diff --git a/Scripts/Items/Addons/AnvilSouthAddon.cs b/Scripts/Items/Addons/AnvilSouthAddon.cs index c5308b647..e635c91ac 100644 --- a/Scripts/Items/Addons/AnvilSouthAddon.cs +++ b/Scripts/Items/Addons/AnvilSouthAddon.cs @@ -8,15 +8,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new AnvilSouthDeed(); } } [Constructable] - public AnvilSouthAddon() : this( 0 ) - { - } - - [Constructable] - public AnvilSouthAddon( int hue ) + public AnvilSouthAddon() { AddComponent( new AnvilComponent( 0xFB0 ), 0, 0, 0 ); - Hue = hue; } public AnvilSouthAddon( Serial serial ) : base( serial ) @@ -40,7 +34,7 @@ namespace Server.Items public class AnvilSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new AnvilSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new AnvilSouthAddon(); } } public override int LabelNumber{ get{ return 1044334; } } // anvil (south) [Constructable] diff --git a/Scripts/Items/Addons/ArcaneBookshelfEastAddon.cs b/Scripts/Items/Addons/ArcaneBookshelfEastAddon.cs index 22056a1d0..673d197d9 100644 --- a/Scripts/Items/Addons/ArcaneBookshelfEastAddon.cs +++ b/Scripts/Items/Addons/ArcaneBookshelfEastAddon.cs @@ -8,16 +8,10 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ArcaneBookshelfEastDeed(); } } [Constructable] - public ArcaneBookshelfEastAddon() : this( 0 ) - { - } - - [Constructable] - public ArcaneBookshelfEastAddon( int hue ) + public ArcaneBookshelfEastAddon() { AddComponent( new AddonComponent( 0x3084 ), 0, 0, 0 ); AddComponent( new AddonComponent( 0x3085 ), -1, 0, 0 ); - Hue = hue; } public ArcaneBookshelfEastAddon( Serial serial ) : base( serial ) diff --git a/Scripts/Items/Addons/ArcaneBookshelfSouthAddon.cs b/Scripts/Items/Addons/ArcaneBookshelfSouthAddon.cs index d520068f6..f7e6499fc 100644 --- a/Scripts/Items/Addons/ArcaneBookshelfSouthAddon.cs +++ b/Scripts/Items/Addons/ArcaneBookshelfSouthAddon.cs @@ -8,16 +8,10 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ArcaneBookshelfSouthDeed(); } } [Constructable] - public ArcaneBookshelfSouthAddon() : this( 0 ) - { - } - - [Constructable] - public ArcaneBookshelfSouthAddon( int hue ) + public ArcaneBookshelfSouthAddon() { AddComponent( new AddonComponent( 0x3087 ), 0, 0, 0 ); AddComponent( new AddonComponent( 0x3086 ), 0, 1, 0 ); - Hue = hue; } public ArcaneBookshelfSouthAddon( Serial serial ) : base( serial ) @@ -41,7 +35,7 @@ namespace Server.Items public class ArcaneBookshelfSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new ArcaneBookshelfSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new ArcaneBookshelfSouthAddon(); } } public override int LabelNumber{ get{ return 1072871; } } // arcane bookshelf (south) [Constructable] diff --git a/Scripts/Items/Addons/ArcaneCircleAddon.cs b/Scripts/Items/Addons/ArcaneCircleAddon.cs index 41082d43b..2905c5eed 100644 --- a/Scripts/Items/Addons/ArcaneCircleAddon.cs +++ b/Scripts/Items/Addons/ArcaneCircleAddon.cs @@ -8,12 +8,7 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ArcaneCircleDeed(); } } [Constructable] - public ArcaneCircleAddon() : this( 0 ) - { - } - - [Constructable] - public ArcaneCircleAddon( int hue ) + public ArcaneCircleAddon() { AddComponent( new AddonComponent( 0x3080 ), -1, 0, 0 ); AddComponent( new AddonComponent( 0x3082 ), 0, -1, 0 ); @@ -24,7 +19,6 @@ namespace Server.Items AddComponent( new AddonComponent( 0x307C ), 0, 1, 0 ); AddComponent( new AddonComponent( 0x307B ), 1, 1, 0 ); AddComponent( new AddonComponent( 0x3083 ), 1, 1, 0 ); - Hue = hue; } public ArcaneCircleAddon( Serial serial ) : base( serial ) @@ -48,7 +42,7 @@ namespace Server.Items public class ArcaneCircleDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new ArcaneCircleAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new ArcaneCircleAddon(); } } public override int LabelNumber{ get{ return 1072703; } } // arcane circle [Constructable] diff --git a/Scripts/Items/Addons/ArcanistStatueEastAddon.cs b/Scripts/Items/Addons/ArcanistStatueEastAddon.cs index 7f665845b..1f13f1851 100644 --- a/Scripts/Items/Addons/ArcanistStatueEastAddon.cs +++ b/Scripts/Items/Addons/ArcanistStatueEastAddon.cs @@ -1,6 +1,5 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { @@ -9,15 +8,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ArcanistStatueEastDeed(); } } [Constructable] - public ArcanistStatueEastAddon() : this( 0 ) - { - } - - [Constructable] - public ArcanistStatueEastAddon( int hue ) + public ArcanistStatueEastAddon() { AddComponent( new AddonComponent( 0x2D0E ), 0, 0, 0 ); - Hue = hue; } public ArcanistStatueEastAddon( Serial serial ) : base( serial ) @@ -39,10 +32,9 @@ namespace Server.Items } } - [CraftItemID( 0x2D0E )] public class ArcanistStatueEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new ArcanistStatueEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new ArcanistStatueEastAddon(); } } public override int LabelNumber{ get{ return 1072886; } } // arcanist statue (east) [Constructable] diff --git a/Scripts/Items/Addons/ArcanistStatueSouthAddon.cs b/Scripts/Items/Addons/ArcanistStatueSouthAddon.cs index c9c00f590..1f055dec4 100644 --- a/Scripts/Items/Addons/ArcanistStatueSouthAddon.cs +++ b/Scripts/Items/Addons/ArcanistStatueSouthAddon.cs @@ -1,6 +1,5 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { @@ -9,15 +8,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ArcanistStatueSouthDeed(); } } [Constructable] - public ArcanistStatueSouthAddon() : this( 0 ) - { - } - - [Constructable] - public ArcanistStatueSouthAddon( int hue ) + public ArcanistStatueSouthAddon() { AddComponent( new AddonComponent( 0x2D0F ), 0, 0, 0 ); - Hue = hue; } public ArcanistStatueSouthAddon( Serial serial ) : base( serial ) @@ -39,10 +32,9 @@ namespace Server.Items } } - [CraftItemID( 0x2D0F )] public class ArcanistStatueSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new ArcanistStatueSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new ArcanistStatueSouthAddon(); } } public override int LabelNumber{ get{ return 1072885; } } // arcanist statue (south) [Constructable] diff --git a/Scripts/Items/Addons/BallotBox.cs b/Scripts/Items/Addons/BallotBox.cs index 73c5e6f36..3d32741a9 100644 --- a/Scripts/Items/Addons/BallotBox.cs +++ b/Scripts/Items/Addons/BallotBox.cs @@ -336,14 +336,9 @@ namespace Server.Items { public override BaseAddonDeed Deed{ get{ return new BallotBoxDeed(); } } - public BallotBoxAddon() : this( 0 ) - { - } - - public BallotBoxAddon( int hue ) + public BallotBoxAddon() { AddComponent( new BallotBox(), 0, 0, 0 ); - Hue = hue; } public BallotBoxAddon( Serial serial ) : base( serial ) @@ -367,7 +362,7 @@ namespace Server.Items public class BallotBoxDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new BallotBoxAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new BallotBoxAddon(); } } public override int LabelNumber{ get{ return 1044327; } } // ballot box diff --git a/Scripts/Items/Addons/BaseAddon.cs b/Scripts/Items/Addons/BaseAddon.cs index 70ddf831e..9449d24d1 100644 --- a/Scripts/Items/Addons/BaseAddon.cs +++ b/Scripts/Items/Addons/BaseAddon.cs @@ -47,7 +47,7 @@ namespace Server.Items m_Components = new List(); } - public virtual bool RetainDeedHue{ get{ return ( Core.ML ? true : false ); } } + public virtual bool RetainDeedHue{ get{ return false; } } public virtual void OnChop( Mobile from ) { diff --git a/Scripts/Items/Addons/BaseAddonDeed.cs b/Scripts/Items/Addons/BaseAddonDeed.cs index e24f60080..8fdcd2d75 100644 --- a/Scripts/Items/Addons/BaseAddonDeed.cs +++ b/Scripts/Items/Addons/BaseAddonDeed.cs @@ -3,12 +3,11 @@ using System.Collections.Generic; using Server; using Server.Multis; using Server.Targeting; -using Server.Engines.Craft; namespace Server.Items { [Flipable( 0x14F0, 0x14EF )] - public abstract class BaseAddonDeed : Item, ICraftable + public abstract class BaseAddonDeed : Item { public abstract BaseAddon Addon{ get; } @@ -48,29 +47,6 @@ namespace Server.Items else from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it. } - - #region ICraftable Members - public virtual int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue ) - { - Type resourceType = typeRes; - - if ( resourceType == null ) - resourceType = craftItem.Resources.GetAt( 0 ).ItemType; - - CraftResource resource = CraftResources.GetFromType( resourceType ); - - CraftContext context = craftSystem.GetContext( from ); - - if ( context != null && context.DoNotColor ) - Hue = 0; - else if ( resource == CraftResource.None ) - Hue = resHue; - else - Hue = CraftResources.GetHue( resource ); - - return 1; - } - #endregion private class InternalTarget : Target { diff --git a/Scripts/Items/Addons/DartBoard.cs b/Scripts/Items/Addons/DartBoard.cs index 373e507b6..1744382a1 100644 --- a/Scripts/Items/Addons/DartBoard.cs +++ b/Scripts/Items/Addons/DartBoard.cs @@ -104,14 +104,9 @@ namespace Server.Items { public override BaseAddonDeed Deed{ get{ return new DartBoardEastDeed(); } } - public DartBoardEastAddon() : this( 0 ) - { - } - - public DartBoardEastAddon( int hue ) + public DartBoardEastAddon() { AddComponent( new DartBoard( true ), 0, 0, 0 ); - Hue = hue; } public DartBoardEastAddon( Serial serial ) : base( serial ) @@ -135,7 +130,7 @@ namespace Server.Items public class DartBoardEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new DartBoardEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new DartBoardEastAddon(); } } public override int LabelNumber{ get{ return 1044326; } } // dartboard (east) @@ -167,14 +162,9 @@ namespace Server.Items { public override BaseAddonDeed Deed{ get{ return new DartBoardSouthDeed(); } } - public DartBoardSouthAddon() : this( 0 ) - { - } - - public DartBoardSouthAddon( int hue ) + public DartBoardSouthAddon() { AddComponent( new DartBoard( false ), 0, 0, 0 ); - Hue = hue; } public DartBoardSouthAddon( Serial serial ) : base( serial ) @@ -198,7 +188,7 @@ namespace Server.Items public class DartBoardSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new DartBoardSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new DartBoardSouthAddon(); } } public override int LabelNumber{ get{ return 1044325; } } // dartboard (south) diff --git a/Scripts/Items/Addons/ElvenBedEastAddon.cs b/Scripts/Items/Addons/ElvenBedEastAddon.cs index c7aeda459..75b168e4f 100644 --- a/Scripts/Items/Addons/ElvenBedEastAddon.cs +++ b/Scripts/Items/Addons/ElvenBedEastAddon.cs @@ -8,16 +8,10 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ElvenBedEastDeed(); } } [Constructable] - public ElvenBedEastAddon() : this( 0 ) - { - } - - [Constructable] - public ElvenBedEastAddon( int hue ) + public ElvenBedEastAddon() { AddComponent( new AddonComponent( 0x304D ), 0, 0, 0 ); AddComponent( new AddonComponent( 0x304C ), 1, 0, 0 ); - Hue = hue; } public ElvenBedEastAddon( Serial serial ) : base( serial ) @@ -41,7 +35,7 @@ namespace Server.Items public class ElvenBedEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new ElvenBedEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new ElvenBedEastAddon(); } } public override int LabelNumber{ get{ return 1072861; } } // elven bed (east) [Constructable] diff --git a/Scripts/Items/Addons/ElvenBedSouthAddon.cs b/Scripts/Items/Addons/ElvenBedSouthAddon.cs index 8ee2cb6cb..8c76245db 100644 --- a/Scripts/Items/Addons/ElvenBedSouthAddon.cs +++ b/Scripts/Items/Addons/ElvenBedSouthAddon.cs @@ -8,16 +8,10 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ElvenBedSouthDeed(); } } [Constructable] - public ElvenBedSouthAddon() : this( 0 ) - { - } - - [Constructable] - public ElvenBedSouthAddon( int hue ) + public ElvenBedSouthAddon() { AddComponent( new AddonComponent( 0x3050 ), 0, 0, 0 ); AddComponent( new AddonComponent( 0x3051 ), 0, -1, 0 ); - Hue = hue; } public ElvenBedSouthAddon( Serial serial ) : base( serial ) @@ -41,7 +35,7 @@ namespace Server.Items public class ElvenBedSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new ElvenBedSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new ElvenBedSouthAddon(); } } public override int LabelNumber{ get{ return 1072860; } } // elven bed (south) [Constructable] diff --git a/Scripts/Items/Addons/ElvenDresserEastAddon.cs b/Scripts/Items/Addons/ElvenDresserEastAddon.cs index 9702c750b..f5f2bef60 100644 --- a/Scripts/Items/Addons/ElvenDresserEastAddon.cs +++ b/Scripts/Items/Addons/ElvenDresserEastAddon.cs @@ -8,16 +8,10 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ElvenDresserEastDeed(); } } [Constructable] - public ElvenDresserEastAddon() : this( 0 ) - { - } - - [Constructable] - public ElvenDresserEastAddon( int hue ) + public ElvenDresserEastAddon() { AddComponent( new AddonComponent( 0x30E4 ), 0, 0, 0 ); AddComponent( new AddonComponent( 0x30E3 ), 0, -1, 0 ); - Hue = hue; } public ElvenDresserEastAddon( Serial serial ) : base( serial ) @@ -41,7 +35,7 @@ namespace Server.Items public class ElvenDresserEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new ElvenDresserEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new ElvenDresserEastAddon(); } } public override int LabelNumber{ get{ return 1073388; } } // elven dresser (east) [Constructable] diff --git a/Scripts/Items/Addons/ElvenDresserSouthAddon.cs b/Scripts/Items/Addons/ElvenDresserSouthAddon.cs index ab831db3c..4db58cee8 100644 --- a/Scripts/Items/Addons/ElvenDresserSouthAddon.cs +++ b/Scripts/Items/Addons/ElvenDresserSouthAddon.cs @@ -8,16 +8,10 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ElvenDresserSouthDeed(); } } [Constructable] - public ElvenDresserSouthAddon() : this( 0 ) - { - } - - [Constructable] - public ElvenDresserSouthAddon( int hue ) + public ElvenDresserSouthAddon() { AddComponent( new AddonComponent( 0x30E5 ), 0, 0, 0 ); AddComponent( new AddonComponent( 0x30E6 ), 1, 0, 0 ); - Hue = hue; } public ElvenDresserSouthAddon( Serial serial ) : base( serial ) @@ -41,7 +35,7 @@ namespace Server.Items public class ElvenDresserSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new ElvenDresserSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new ElvenDresserSouthAddon(); } } public override int LabelNumber{ get{ return 1072864; } } // elven dresser (south) [Constructable] diff --git a/Scripts/Items/Addons/ElvenForgeAddon.cs b/Scripts/Items/Addons/ElvenForgeAddon.cs index fdde614b1..2db9e1682 100644 --- a/Scripts/Items/Addons/ElvenForgeAddon.cs +++ b/Scripts/Items/Addons/ElvenForgeAddon.cs @@ -1,6 +1,5 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { @@ -9,18 +8,11 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ElvenForgeDeed(); } } [Constructable] - public ElvenForgeAddon() : this( 0 ) - { - } - - [Constructable] - public ElvenForgeAddon( int hue ) + public ElvenForgeAddon() { AddComponent( new AddonComponent( 0x2DD8 ), 0, 0, 0 ); - Hue = hue; } - public ElvenForgeAddon( Serial serial ) : base( serial ) { } @@ -40,10 +32,9 @@ namespace Server.Items } } - [CraftItemID( 0x2DD8 )] public class ElvenForgeDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new ElvenForgeAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new ElvenForgeAddon(); } } public override int LabelNumber{ get{ return 1072875; } } // squirrel statue (east) [Constructable] diff --git a/Scripts/Items/Addons/ElvenLoveseatEastAddon.cs b/Scripts/Items/Addons/ElvenLoveseatEastAddon.cs index ddd050224..706e93b97 100644 --- a/Scripts/Items/Addons/ElvenLoveseatEastAddon.cs +++ b/Scripts/Items/Addons/ElvenLoveseatEastAddon.cs @@ -1,6 +1,5 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { @@ -9,16 +8,10 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ElvenLoveseatEastDeed(); } } [Constructable] - public ElvenLoveseatEastAddon() : this( 0 ) + public ElvenLoveseatEastAddon() { - } - - [Constructable] - public ElvenLoveseatEastAddon( int hue ) - { - AddComponent( new AddonComponent( 0x308A ), 0, 0, 0 ); - AddComponent( new AddonComponent( 0x308B ), 0, -1, 0 ); - Hue = hue; + AddComponent( new AddonComponent( 0x3089 ), 0, 0, 0 ); + AddComponent( new AddonComponent( 0x3088 ), 1, 0, 0 ); } public ElvenLoveseatEastAddon( Serial serial ) : base( serial ) @@ -40,10 +33,9 @@ namespace Server.Items } } - [CraftItemID( 0x2DE0 )] public class ElvenLoveseatEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new ElvenLoveseatEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new ElvenLoveseatEastAddon(); } } public override int LabelNumber{ get{ return 1073372; } } // elven loveseat (east) [Constructable] diff --git a/Scripts/Items/Addons/ElvenLoveseatSouthAddon.cs b/Scripts/Items/Addons/ElvenLoveseatSouthAddon.cs index e9f1e66ec..071e7c59b 100644 --- a/Scripts/Items/Addons/ElvenLoveseatSouthAddon.cs +++ b/Scripts/Items/Addons/ElvenLoveseatSouthAddon.cs @@ -1,6 +1,5 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { @@ -9,16 +8,10 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ElvenLoveseatSouthDeed(); } } [Constructable] - public ElvenLoveseatSouthAddon() : this( 0 ) + public ElvenLoveseatSouthAddon() { - } - - [Constructable] - public ElvenLoveseatSouthAddon( int hue ) - { - AddComponent( new AddonComponent( 0x3089 ), 0, 0, 0 ); - AddComponent( new AddonComponent( 0x3088 ), 1, 0, 0 ); - Hue = hue; + AddComponent( new AddonComponent( 0x308A ), 0, 0, 0 ); + AddComponent( new AddonComponent( 0x308B ), 0, -1, 0 ); } public ElvenLoveseatSouthAddon( Serial serial ) : base( serial ) @@ -40,10 +33,9 @@ namespace Server.Items } } - [CraftItemID( 0x2DDF )] public class ElvenLoveseatSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new ElvenLoveseatSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new ElvenLoveseatSouthAddon(); } } public override int LabelNumber{ get{ return 1072867; } } // elven loveseat (south) [Constructable] diff --git a/Scripts/Items/Addons/ElvenSpinningwheelEastAddon.cs b/Scripts/Items/Addons/ElvenSpinningwheelEastAddon.cs index 4216dc00c..06aea8891 100644 --- a/Scripts/Items/Addons/ElvenSpinningwheelEastAddon.cs +++ b/Scripts/Items/Addons/ElvenSpinningwheelEastAddon.cs @@ -1,6 +1,5 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { @@ -9,15 +8,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ElvenSpinningwheelEastDeed(); } } [Constructable] - public ElvenSpinningwheelEastAddon() : this( 0 ) - { - } - - [Constructable] - public ElvenSpinningwheelEastAddon( int hue ) + public ElvenSpinningwheelEastAddon() { AddComponent( new AddonComponent( 0x2DD9 ), 0, 0, 0 ); - Hue = hue; } public ElvenSpinningwheelEastAddon( Serial serial ) : base( serial ) @@ -113,10 +106,9 @@ namespace Server.Items } } - [CraftItemID( 0x2DD9 )] public class ElvenSpinningwheelEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new ElvenSpinningwheelEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new ElvenSpinningwheelEastAddon(); } } public override int LabelNumber{ get{ return 1073393; } } // elven spinning wheel (east) [Constructable] diff --git a/Scripts/Items/Addons/ElvenSpinningwheelSouthAddon.cs b/Scripts/Items/Addons/ElvenSpinningwheelSouthAddon.cs index b45bd8400..0df8698ea 100644 --- a/Scripts/Items/Addons/ElvenSpinningwheelSouthAddon.cs +++ b/Scripts/Items/Addons/ElvenSpinningwheelSouthAddon.cs @@ -1,6 +1,5 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { @@ -9,15 +8,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ElvenSpinningwheelSouthDeed(); } } [Constructable] - public ElvenSpinningwheelSouthAddon() : this( 0 ) - { - } - - [Constructable] - public ElvenSpinningwheelSouthAddon( int hue ) + public ElvenSpinningwheelSouthAddon() { AddComponent( new AddonComponent( 0x2DDA ), 0, 0, 0 ); - Hue = hue; } public ElvenSpinningwheelSouthAddon( Serial serial ) : base( serial ) @@ -115,10 +108,9 @@ namespace Server.Items } } - [CraftItemID( 0x2DDA )] public class ElvenSpinningwheelSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new ElvenSpinningwheelSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new ElvenSpinningwheelSouthAddon(); } } public override int LabelNumber{ get{ return 1072878; } } // spinning wheel (south) [Constructable] diff --git a/Scripts/Items/Addons/ElvenStoveEastAddon.cs b/Scripts/Items/Addons/ElvenStoveEastAddon.cs index 9994808b0..952a28914 100644 --- a/Scripts/Items/Addons/ElvenStoveEastAddon.cs +++ b/Scripts/Items/Addons/ElvenStoveEastAddon.cs @@ -1,6 +1,5 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { @@ -9,15 +8,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ElvenStoveEastDeed(); } } [Constructable] - public ElvenStoveEastAddon() : this( 0 ) - { - } - - [Constructable] - public ElvenStoveEastAddon( int hue ) + public ElvenStoveEastAddon() { AddComponent( new AddonComponent( 0x2DDB ), 0, 0, 0 ); - Hue = hue; } public ElvenStoveEastAddon( Serial serial ) : base( serial ) @@ -39,10 +32,9 @@ namespace Server.Items } } - [CraftItemID( 0x2DDB )] public class ElvenStoveEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new ElvenStoveEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new ElvenStoveEastAddon(); } } public override int LabelNumber{ get{ return 1073395; } } // elven oven (east) [Constructable] diff --git a/Scripts/Items/Addons/ElvenStoveSouthAddon.cs b/Scripts/Items/Addons/ElvenStoveSouthAddon.cs index 5d79f1cdf..2a4aa4b29 100644 --- a/Scripts/Items/Addons/ElvenStoveSouthAddon.cs +++ b/Scripts/Items/Addons/ElvenStoveSouthAddon.cs @@ -1,6 +1,5 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { @@ -9,15 +8,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ElvenStoveSouthDeed(); } } [Constructable] - public ElvenStoveSouthAddon() : this( 0 ) - { - } - - [Constructable] - public ElvenStoveSouthAddon( int hue ) + public ElvenStoveSouthAddon() { AddComponent( new AddonComponent( 0x2DDC ), 0, 0, 0 ); - Hue = hue; } public ElvenStoveSouthAddon( Serial serial ) : base( serial ) @@ -39,10 +32,9 @@ namespace Server.Items } } - [CraftItemID( 0x2DDC )] public class ElvenStoveSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new ElvenStoveSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new ElvenStoveSouthAddon(); } } public override int LabelNumber{ get{ return 1073394; } } // elven oven (south) [Constructable] diff --git a/Scripts/Items/Addons/ElvenWashbasinEastAddon.cs b/Scripts/Items/Addons/ElvenWashbasinEastAddon.cs index 25e39723a..dc07b415c 100644 --- a/Scripts/Items/Addons/ElvenWashbasinEastAddon.cs +++ b/Scripts/Items/Addons/ElvenWashbasinEastAddon.cs @@ -1,6 +1,5 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { @@ -9,16 +8,10 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ElvenWashBasinEastDeed(); } } [Constructable] - public ElvenWashBasinEastAddon() : this( 0 ) - { - } - - [Constructable] - public ElvenWashBasinEastAddon( int hue ) + public ElvenWashBasinEastAddon() { AddComponent( new AddonComponent( 0x30DF ), 0, 0, 0 ); AddComponent( new AddonComponent( 0x30E0 ), 0, 1, 0 ); - Hue = hue; } public ElvenWashBasinEastAddon( Serial serial ) : base( serial ) @@ -40,10 +33,9 @@ namespace Server.Items } } - [CraftItemID( 0x2D0C )] public class ElvenWashBasinEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new ElvenWashBasinEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new ElvenWashBasinEastAddon(); } } public override int LabelNumber{ get{ return 1073387; } } // elven wash basin (east) [Constructable] diff --git a/Scripts/Items/Addons/ElvenWashbasinSouthAddon.cs b/Scripts/Items/Addons/ElvenWashbasinSouthAddon.cs index 1d22e53bf..6a32fc416 100644 --- a/Scripts/Items/Addons/ElvenWashbasinSouthAddon.cs +++ b/Scripts/Items/Addons/ElvenWashbasinSouthAddon.cs @@ -1,6 +1,5 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { @@ -9,16 +8,10 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ElvenWashBasinSouthDeed(); } } [Constructable] - public ElvenWashBasinSouthAddon() : this( 0 ) - { - } - - [Constructable] - public ElvenWashBasinSouthAddon( int hue ) + public ElvenWashBasinSouthAddon() { AddComponent( new AddonComponent( 0x30E1 ), 0, 0, 0 ); AddComponent( new AddonComponent( 0x30E2 ), 1, 0, 0 ); - Hue = hue; } public ElvenWashBasinSouthAddon( Serial serial ) : base( serial ) @@ -40,10 +33,9 @@ namespace Server.Items } } - [CraftItemID( 0x2D0B )] public class ElvenWashBasinSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new ElvenWashBasinSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new ElvenWashBasinSouthAddon(); } } public override int LabelNumber{ get{ return 1072865; } } // elven wash basin (south) [Constructable] diff --git a/Scripts/Items/Addons/FancyElvenTableEastAddon.cs b/Scripts/Items/Addons/FancyElvenTableEastAddon.cs index 0d62a2660..ebd4f6414 100644 --- a/Scripts/Items/Addons/FancyElvenTableEastAddon.cs +++ b/Scripts/Items/Addons/FancyElvenTableEastAddon.cs @@ -1,6 +1,5 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { @@ -9,17 +8,11 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new FancyElvenTableEastDeed(); } } [Constructable] - public FancyElvenTableEastAddon() : this( 0 ) + public FancyElvenTableEastAddon() { - } - - [Constructable] - public FancyElvenTableEastAddon( int hue ) - { - AddComponent( new AddonComponent( 0x3095 ), 0, 1, 0 ); - AddComponent( new AddonComponent( 0x3096 ), 0, 0, 0 ); - AddComponent( new AddonComponent( 0x3097 ), 0, -1, 0 ); - Hue = hue; + AddComponent( new AddonComponent( 0x3094 ), -1, 0, 0 ); + AddComponent( new AddonComponent( 0x3093 ), 0, 0, 0 ); + AddComponent( new AddonComponent( 0x3092 ), 1, 0, 0 ); } public FancyElvenTableEastAddon( Serial serial ) : base( serial ) @@ -41,10 +34,9 @@ namespace Server.Items } } - [CraftItemID( 0x2DE8 )] public class FancyElvenTableEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new FancyElvenTableEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new FancyElvenTableEastAddon(); } } public override int LabelNumber{ get{ return 1073386; } } // hardwood table (east) [Constructable] diff --git a/Scripts/Items/Addons/FancyElvenTableSouthAddon.cs b/Scripts/Items/Addons/FancyElvenTableSouthAddon.cs index 942f66ff6..b59b27481 100644 --- a/Scripts/Items/Addons/FancyElvenTableSouthAddon.cs +++ b/Scripts/Items/Addons/FancyElvenTableSouthAddon.cs @@ -1,6 +1,5 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { @@ -9,17 +8,11 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new FancyElvenTableSouthDeed(); } } [Constructable] - public FancyElvenTableSouthAddon() : this( 0 ) + public FancyElvenTableSouthAddon() { - } - - [Constructable] - public FancyElvenTableSouthAddon( int hue ) - { - AddComponent( new AddonComponent( 0x3094 ), -1, 0, 0 ); - AddComponent( new AddonComponent( 0x3093 ), 0, 0, 0 ); - AddComponent( new AddonComponent( 0x3092 ), 1, 0, 0 ); - Hue = hue; + AddComponent( new AddonComponent( 0x3095 ), 0, 1, 0 ); + AddComponent( new AddonComponent( 0x3096 ), 0, 0, 0 ); + AddComponent( new AddonComponent( 0x3097 ), 0, -1, 0 ); } public FancyElvenTableSouthAddon( Serial serial ) : base( serial ) @@ -41,10 +34,9 @@ namespace Server.Items } } - [CraftItemID( 0x2DE7 )] public class FancyElvenTableSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new FancyElvenTableSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new FancyElvenTableSouthAddon(); } } public override int LabelNumber{ get{ return 1073385; } } // hardwood table (south) [Constructable] diff --git a/Scripts/Items/Addons/FlourMillEastAddon.cs b/Scripts/Items/Addons/FlourMillEastAddon.cs index b9c957fe6..c8eecd59d 100644 --- a/Scripts/Items/Addons/FlourMillEastAddon.cs +++ b/Scripts/Items/Addons/FlourMillEastAddon.cs @@ -160,17 +160,11 @@ namespace Server.Items } [Constructable] - public FlourMillEastAddon() : this( 0 ) - { - } - - [Constructable] - public FlourMillEastAddon( int hue ) + public FlourMillEastAddon() { AddComponent( new AddonComponent( 0x1920 ),-1, 0, 0 ); AddComponent( new AddonComponent( 0x1922 ), 0, 0, 0 ); AddComponent( new AddonComponent( 0x1924 ), 1, 0, 0 ); - Hue = hue; } public FlourMillEastAddon( Serial serial ) : base( serial ) @@ -207,7 +201,7 @@ namespace Server.Items public class FlourMillEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new FlourMillEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new FlourMillEastAddon(); } } public override int LabelNumber{ get{ return 1044347; } } // flour mill (east) [Constructable] diff --git a/Scripts/Items/Addons/FlourMillSouthAddon.cs b/Scripts/Items/Addons/FlourMillSouthAddon.cs index 36b8b1fdb..82d3b59d8 100644 --- a/Scripts/Items/Addons/FlourMillSouthAddon.cs +++ b/Scripts/Items/Addons/FlourMillSouthAddon.cs @@ -146,17 +146,11 @@ namespace Server.Items } [Constructable] - public FlourMillSouthAddon() : this( 0 ) - { - } - - [Constructable] - public FlourMillSouthAddon( int hue ) + public FlourMillSouthAddon() { AddComponent( new AddonComponent( 0x192C ), 0,-1, 0 ); AddComponent( new AddonComponent( 0x192E ), 0, 0, 0 ); AddComponent( new AddonComponent( 0x1930 ), 0, 1, 0 ); - Hue = hue; } public FlourMillSouthAddon( Serial serial ) : base( serial ) @@ -193,7 +187,7 @@ namespace Server.Items public class FlourMillSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new FlourMillSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new FlourMillSouthAddon(); } } public override int LabelNumber{ get{ return 1044348; } } // flour mill (south) [Constructable] diff --git a/Scripts/Items/Addons/LargeBedEastAddon.cs b/Scripts/Items/Addons/LargeBedEastAddon.cs index 2f2612b68..ac77ea22b 100644 --- a/Scripts/Items/Addons/LargeBedEastAddon.cs +++ b/Scripts/Items/Addons/LargeBedEastAddon.cs @@ -8,18 +8,12 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new LargeBedEastDeed(); } } [Constructable] - public LargeBedEastAddon() : this( 0 ) - { - } - - [Constructable] - public LargeBedEastAddon( int hue ) + public LargeBedEastAddon() { AddComponent( new AddonComponent( 0xA7D ), 0, 0, 0 ); AddComponent( new AddonComponent( 0xA7C ), 0, 1, 0 ); AddComponent( new AddonComponent( 0xA79 ), 1, 0, 0 ); AddComponent( new AddonComponent( 0xA78 ), 1, 1, 0 ); - Hue = hue; } public LargeBedEastAddon( Serial serial ) : base( serial ) @@ -43,7 +37,7 @@ namespace Server.Items public class LargeBedEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new LargeBedEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new LargeBedEastAddon(); } } public override int LabelNumber{ get{ return 1044324; } } // large bed (east) [Constructable] diff --git a/Scripts/Items/Addons/LargeBedSouthAddon.cs b/Scripts/Items/Addons/LargeBedSouthAddon.cs index be008a615..29be75761 100644 --- a/Scripts/Items/Addons/LargeBedSouthAddon.cs +++ b/Scripts/Items/Addons/LargeBedSouthAddon.cs @@ -8,18 +8,12 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new LargeBedSouthDeed(); } } [Constructable] - public LargeBedSouthAddon() : this( 0 ) - { - } - - [Constructable] - public LargeBedSouthAddon( int hue ) + public LargeBedSouthAddon() { AddComponent( new AddonComponent( 0xA83 ), 0, 0, 0 ); AddComponent( new AddonComponent( 0xA7F ), 0, 1, 0 ); AddComponent( new AddonComponent( 0xA82 ), 1, 0, 0 ); AddComponent( new AddonComponent( 0xA7E ), 1, 1, 0 ); - Hue = hue; } public LargeBedSouthAddon( Serial serial ) : base( serial ) @@ -43,7 +37,7 @@ namespace Server.Items public class LargeBedSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new LargeBedSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new LargeBedSouthAddon(); } } public override int LabelNumber{ get{ return 1044323; } } // large bed (south) [Constructable] diff --git a/Scripts/Items/Addons/LargeForgeEastAddon.cs b/Scripts/Items/Addons/LargeForgeEastAddon.cs index 17d850adc..d98bea26c 100644 --- a/Scripts/Items/Addons/LargeForgeEastAddon.cs +++ b/Scripts/Items/Addons/LargeForgeEastAddon.cs @@ -8,18 +8,12 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new LargeForgeEastDeed(); } } [Constructable] - public LargeForgeEastAddon() : this( 0 ) - { - } - - [Constructable] - public LargeForgeEastAddon( int hue ) + public LargeForgeEastAddon() { AddComponent( new ForgeComponent( 0x1986 ), 0, 0, 0 ); AddComponent( new ForgeComponent( 0x198A ), 0, 1, 0 ); AddComponent( new ForgeComponent( 0x1996 ), 0, 2, 0 ); AddComponent( new ForgeComponent( 0x1992 ), 0, 3, 0 ); - Hue = hue; } public LargeForgeEastAddon( Serial serial ) : base( serial ) @@ -43,7 +37,7 @@ namespace Server.Items public class LargeForgeEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new LargeForgeEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new LargeForgeEastAddon(); } } public override int LabelNumber{ get{ return 1044331; } } // large forge (east) [Constructable] diff --git a/Scripts/Items/Addons/LargeForgeSouthAddon.cs b/Scripts/Items/Addons/LargeForgeSouthAddon.cs index f4677a54e..a51061c45 100644 --- a/Scripts/Items/Addons/LargeForgeSouthAddon.cs +++ b/Scripts/Items/Addons/LargeForgeSouthAddon.cs @@ -8,18 +8,12 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new LargeForgeSouthDeed(); } } [Constructable] - public LargeForgeSouthAddon() : this( 0 ) - { - } - - [Constructable] - public LargeForgeSouthAddon( int hue ) + public LargeForgeSouthAddon() { AddComponent( new ForgeComponent( 0x197A ), 0, 0, 0 ); AddComponent( new ForgeComponent( 0x197E ), 1, 0, 0 ); AddComponent( new ForgeComponent( 0x19A2 ), 2, 0, 0 ); AddComponent( new ForgeComponent( 0x199E ), 3, 0, 0 ); - Hue = hue; } public LargeForgeSouthAddon( Serial serial ) : base( serial ) @@ -43,7 +37,7 @@ namespace Server.Items public class LargeForgeSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new LargeForgeSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new LargeForgeSouthAddon(); } } public override int LabelNumber{ get{ return 1044332; } } // large forge (south) [Constructable] diff --git a/Scripts/Items/Addons/LoomEastAddon.cs b/Scripts/Items/Addons/LoomEastAddon.cs index a6a4b182b..6f49f4e4e 100644 --- a/Scripts/Items/Addons/LoomEastAddon.cs +++ b/Scripts/Items/Addons/LoomEastAddon.cs @@ -17,16 +17,10 @@ namespace Server.Items public int Phase{ get{ return m_Phase; } set{ m_Phase = value; } } [Constructable] - public LoomEastAddon() : this( 0 ) - { - } - - [Constructable] - public LoomEastAddon( int hue ) + public LoomEastAddon() { AddComponent( new AddonComponent( 0x1060 ), 0, 0, 0 ); AddComponent( new AddonComponent( 0x105F ), 0, 1, 0 ); - Hue = hue; } public LoomEastAddon( Serial serial ) : base( serial ) @@ -61,7 +55,7 @@ namespace Server.Items public class LoomEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new LoomEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new LoomEastAddon(); } } public override int LabelNumber{ get{ return 1044343; } } // loom (east) [Constructable] diff --git a/Scripts/Items/Addons/LoomSouthAddon.cs b/Scripts/Items/Addons/LoomSouthAddon.cs index 3abe592a9..ff0b5e24b 100644 --- a/Scripts/Items/Addons/LoomSouthAddon.cs +++ b/Scripts/Items/Addons/LoomSouthAddon.cs @@ -12,16 +12,10 @@ namespace Server.Items public int Phase{ get{ return m_Phase; } set{ m_Phase = value; } } [Constructable] - public LoomSouthAddon() : this( 0 ) - { - } - - [Constructable] - public LoomSouthAddon( int hue ) + public LoomSouthAddon() { AddComponent( new AddonComponent( 0x1061 ), 0, 0, 0 ); AddComponent( new AddonComponent( 0x1062 ), 1, 0, 0 ); - Hue = hue; } public LoomSouthAddon( Serial serial ) : base( serial ) @@ -56,7 +50,7 @@ namespace Server.Items public class LoomSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new LoomSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new LoomSouthAddon(); } } public override int LabelNumber{ get{ return 1044344; } } // loom (south) [Constructable] diff --git a/Scripts/Items/Addons/OrnateElvenTableEastAddon.cs b/Scripts/Items/Addons/OrnateElvenTableEastAddon.cs index a0d9ab6a2..222c03fc7 100644 --- a/Scripts/Items/Addons/OrnateElvenTableEastAddon.cs +++ b/Scripts/Items/Addons/OrnateElvenTableEastAddon.cs @@ -1,6 +1,5 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { @@ -9,17 +8,11 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new OrnateElvenTableEastDeed(); } } [Constructable] - public OrnateElvenTableEastAddon() : this( 0 ) + public OrnateElvenTableEastAddon() { - } - - [Constructable] - public OrnateElvenTableEastAddon( int hue ) - { - AddComponent( new AddonComponent( 0x308F ), 0, 1, 0 ); - AddComponent( new AddonComponent( 0x3090 ), 0, 0, 0 ); - AddComponent( new AddonComponent( 0x3091 ), 0, -1, 0 ); - Hue = hue; + AddComponent( new AddonComponent( 0x308E ), -1, 0, 0 ); + AddComponent( new AddonComponent( 0x308D ), 0, 0, 0 ); + AddComponent( new AddonComponent( 0x308C ), 1, 0, 0 ); } public OrnateElvenTableEastAddon( Serial serial ) : base( serial ) @@ -41,10 +34,9 @@ namespace Server.Items } } - [CraftItemID( 0x2DE2 )] public class OrnateElvenTableEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new OrnateElvenTableEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new OrnateElvenTableEastAddon(); } } public override int LabelNumber{ get{ return 1073384; } } // ornate table (east) [Constructable] diff --git a/Scripts/Items/Addons/OrnateElvenTableSouthAddon.cs b/Scripts/Items/Addons/OrnateElvenTableSouthAddon.cs index ee7ab7d63..7f00e92da 100644 --- a/Scripts/Items/Addons/OrnateElvenTableSouthAddon.cs +++ b/Scripts/Items/Addons/OrnateElvenTableSouthAddon.cs @@ -1,6 +1,5 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { @@ -9,17 +8,11 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new OrnateElvenTableSouthDeed(); } } [Constructable] - public OrnateElvenTableSouthAddon() : this( 0 ) + public OrnateElvenTableSouthAddon() { - } - - [Constructable] - public OrnateElvenTableSouthAddon( int hue ) - { - AddComponent( new AddonComponent( 0x308E ), -1, 0, 0 ); - AddComponent( new AddonComponent( 0x308D ), 0, 0, 0 ); - AddComponent( new AddonComponent( 0x308C ), 1, 0, 0 ); - Hue = hue; + AddComponent( new AddonComponent( 0x308F ), 0, 1, 0 ); + AddComponent( new AddonComponent( 0x3090 ), 0, 0, 0 ); + AddComponent( new AddonComponent( 0x3091 ), 0, -1, 0 ); } public OrnateElvenTableSouthAddon( Serial serial ) : base( serial ) @@ -41,10 +34,9 @@ namespace Server.Items } } - [CraftItemID( 0x2DE1 )] public class OrnateElvenTableSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new OrnateElvenTableSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new OrnateElvenTableSouthAddon(); } } public override int LabelNumber{ get{ return 1072869; } } // ornate table (south) [Constructable] diff --git a/Scripts/Items/Addons/ParrotPerchAddon.cs b/Scripts/Items/Addons/ParrotPerchAddon.cs index ac8673b09..9e16cf1ff 100644 --- a/Scripts/Items/Addons/ParrotPerchAddon.cs +++ b/Scripts/Items/Addons/ParrotPerchAddon.cs @@ -1,6 +1,5 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { @@ -9,15 +8,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new ParrotPerchDeed(); } } [Constructable] - public ParrotPerchAddon() : this( 0 ) + public ParrotPerchAddon() { - } - - [Constructable] - public ParrotPerchAddon( int hue ) - { - AddComponent( new AddonComponent( 0x2FB6 ), 0, 0, 0 ); - Hue = hue; + AddComponent( new AddonComponent( 0x2FF4 ), 0, 0, 0 ); } public ParrotPerchAddon( Serial serial ) : base( serial ) @@ -39,10 +32,9 @@ namespace Server.Items } } - [CraftItemID( 0x2FB6 )] public class ParrotPerchDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new ParrotPerchAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new ParrotPerchAddon(); } } public override int LabelNumber{ get{ return 1072617; } } // parrot perch [Constructable] diff --git a/Scripts/Items/Addons/PentagramAddon.cs b/Scripts/Items/Addons/PentagramAddon.cs index d1919a212..379a9209e 100644 --- a/Scripts/Items/Addons/PentagramAddon.cs +++ b/Scripts/Items/Addons/PentagramAddon.cs @@ -8,12 +8,7 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new PentagramDeed(); } } [Constructable] - public PentagramAddon() : this( 0 ) - { - } - - [Constructable] - public PentagramAddon( int hue ) + public PentagramAddon() { AddComponent( new AddonComponent( 0xFE7 ), -1, -1, 0 ); AddComponent( new AddonComponent( 0xFE8 ), 0, -1, 0 ); @@ -24,7 +19,6 @@ namespace Server.Items AddComponent( new AddonComponent( 0xFE9 ), -1, 1, 0 ); AddComponent( new AddonComponent( 0xFEC ), 0, 1, 0 ); AddComponent( new AddonComponent( 0xFED ), 1, 1, 0 ); - Hue = hue; } public PentagramAddon( Serial serial ) : base( serial ) @@ -48,7 +42,7 @@ namespace Server.Items public class PentagramDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new PentagramAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new PentagramAddon(); } } public override int LabelNumber{ get{ return 1044328; } } // pentagram [Constructable] diff --git a/Scripts/Items/Addons/PickpocketDips.cs b/Scripts/Items/Addons/PickpocketDips.cs index 2462b0cc0..7a20aacc9 100644 --- a/Scripts/Items/Addons/PickpocketDips.cs +++ b/Scripts/Items/Addons/PickpocketDips.cs @@ -161,15 +161,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new PickpocketDipEastDeed(); } } [Constructable] - public PickpocketDipEastAddon() : this( 0 ) - { - } - - [Constructable] - public PickpocketDipEastAddon( int hue ) + public PickpocketDipEastAddon() { AddComponent( new PickpocketDip( 0x1EC3 ), 0, 0, 0 ); - Hue = hue; } public PickpocketDipEastAddon( Serial serial ) : base( serial ) @@ -193,7 +187,7 @@ namespace Server.Items public class PickpocketDipEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new PickpocketDipEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new PickpocketDipEastAddon(); } } public override int LabelNumber{ get{ return 1044337; } } // pickpocket dip (east) [Constructable] @@ -225,15 +219,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new PickpocketDipSouthDeed(); } } [Constructable] - public PickpocketDipSouthAddon() : this( 0 ) - { - } - - [Constructable] - public PickpocketDipSouthAddon( int hue ) + public PickpocketDipSouthAddon() { AddComponent( new PickpocketDip( 0x1EC0 ), 0, 0, 0 ); - Hue = hue; } public PickpocketDipSouthAddon( Serial serial ) : base( serial ) @@ -257,7 +245,7 @@ namespace Server.Items public class PickpocketDipSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new PickpocketDipSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new PickpocketDipSouthAddon(); } } public override int LabelNumber{ get{ return 1044338; } } // pickpocket dip (south) [Constructable] diff --git a/Scripts/Items/Addons/SmallBedEastAddon.cs b/Scripts/Items/Addons/SmallBedEastAddon.cs index bd7631eaf..bc223c201 100644 --- a/Scripts/Items/Addons/SmallBedEastAddon.cs +++ b/Scripts/Items/Addons/SmallBedEastAddon.cs @@ -8,16 +8,10 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new SmallBedEastDeed(); } } [Constructable] - public SmallBedEastAddon() : this( 0 ) - { - } - - [Constructable] - public SmallBedEastAddon( int hue ) + public SmallBedEastAddon() { AddComponent( new AddonComponent( 0xA5D ), 0, 0, 0 ); AddComponent( new AddonComponent( 0xA62 ), 1, 0, 0 ); - Hue = hue; } public SmallBedEastAddon( Serial serial ) : base( serial ) @@ -41,7 +35,7 @@ namespace Server.Items public class SmallBedEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new SmallBedEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new SmallBedEastAddon(); } } public override int LabelNumber{ get{ return 1044322; } } // small bed (east) [Constructable] diff --git a/Scripts/Items/Addons/SmallBedSouthAddon.cs b/Scripts/Items/Addons/SmallBedSouthAddon.cs index ac7a6e5cb..678de43a0 100644 --- a/Scripts/Items/Addons/SmallBedSouthAddon.cs +++ b/Scripts/Items/Addons/SmallBedSouthAddon.cs @@ -8,16 +8,10 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new SmallBedSouthDeed(); } } [Constructable] - public SmallBedSouthAddon() : this( 0 ) - { - } - - [Constructable] - public SmallBedSouthAddon( int hue ) + public SmallBedSouthAddon() { AddComponent( new AddonComponent( 0xA63 ), 0, 0, 0 ); AddComponent( new AddonComponent( 0xA5C ), 0, 1, 0 ); - Hue = hue; } public SmallBedSouthAddon( Serial serial ) : base( serial ) @@ -41,7 +35,7 @@ namespace Server.Items public class SmallBedSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new SmallBedSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new SmallBedSouthAddon(); } } public override int LabelNumber{ get{ return 1044321; } } // small bed (south) [Constructable] diff --git a/Scripts/Items/Addons/SmallForgeAddon.cs b/Scripts/Items/Addons/SmallForgeAddon.cs index 289acfa14..5a461fb9e 100644 --- a/Scripts/Items/Addons/SmallForgeAddon.cs +++ b/Scripts/Items/Addons/SmallForgeAddon.cs @@ -8,15 +8,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new SmallForgeDeed(); } } [Constructable] - public SmallForgeAddon() : this( 0 ) - { - } - - [Constructable] - public SmallForgeAddon( int hue ) + public SmallForgeAddon() { AddComponent( new ForgeComponent( 0xFB1 ), 0, 0, 0 ); - Hue = hue; } public SmallForgeAddon( Serial serial ) : base( serial ) @@ -40,7 +34,7 @@ namespace Server.Items public class SmallForgeDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new SmallForgeAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new SmallForgeAddon(); } } public override int LabelNumber{ get{ return 1044330; } } // small forge [Constructable] diff --git a/Scripts/Items/Addons/SpinningwheelEastAddon.cs b/Scripts/Items/Addons/SpinningwheelEastAddon.cs index 6352a846a..6d07f86c1 100644 --- a/Scripts/Items/Addons/SpinningwheelEastAddon.cs +++ b/Scripts/Items/Addons/SpinningwheelEastAddon.cs @@ -16,15 +16,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new SpinningwheelEastDeed(); } } [Constructable] - public SpinningwheelEastAddon() : this( 0 ) - { - } - - [Constructable] - public SpinningwheelEastAddon( int hue ) + public SpinningwheelEastAddon() { AddComponent( new AddonComponent( 0x1019 ), 0, 0, 0 ); - Hue = hue; } public SpinningwheelEastAddon( Serial serial ) : base( serial ) @@ -124,7 +118,7 @@ namespace Server.Items public class SpinningwheelEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new SpinningwheelEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new SpinningwheelEastAddon(); } } public override int LabelNumber{ get{ return 1044341; } } // spining wheel (east) [Constructable] diff --git a/Scripts/Items/Addons/SpinningwheelSouthAddon.cs b/Scripts/Items/Addons/SpinningwheelSouthAddon.cs index 285cb0c3c..a2cd565f3 100644 --- a/Scripts/Items/Addons/SpinningwheelSouthAddon.cs +++ b/Scripts/Items/Addons/SpinningwheelSouthAddon.cs @@ -8,15 +8,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new SpinningwheelSouthDeed(); } } [Constructable] - public SpinningwheelSouthAddon() : this( 0 ) - { - } - - [Constructable] - public SpinningwheelSouthAddon( int hue ) + public SpinningwheelSouthAddon() { AddComponent( new AddonComponent( 0x1015 ), 0, 0, 0 ); - Hue = hue; } public SpinningwheelSouthAddon( Serial serial ) : base( serial ) @@ -116,7 +110,7 @@ namespace Server.Items public class SpinningwheelSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new SpinningwheelSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new SpinningwheelSouthAddon(); } } public override int LabelNumber{ get{ return 1044342; } } // spining wheel (south) [Constructable] diff --git a/Scripts/Items/Addons/SquirrelStatueEastAddon.cs b/Scripts/Items/Addons/SquirrelStatueEastAddon.cs index 06129f7bf..6c7427ef5 100644 --- a/Scripts/Items/Addons/SquirrelStatueEastAddon.cs +++ b/Scripts/Items/Addons/SquirrelStatueEastAddon.cs @@ -8,15 +8,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new SquirrelStatueEastDeed(); } } [Constructable] - public SquirrelStatueEastAddon() : this( 0 ) - { - } - - [Constructable] - public SquirrelStatueEastAddon( int hue ) + public SquirrelStatueEastAddon() { AddComponent( new AddonComponent( 0x2D10 ), 0, 0, 0 ); - Hue = hue; } public SquirrelStatueEastAddon( Serial serial ) : base( serial ) @@ -40,7 +34,7 @@ namespace Server.Items public class SquirrelStatueEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new SquirrelStatueEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new SquirrelStatueEastAddon(); } } public override int LabelNumber{ get{ return 1073398; } } // squirrel statue (east) [Constructable] diff --git a/Scripts/Items/Addons/SquirrelStatueSouthAddon.cs b/Scripts/Items/Addons/SquirrelStatueSouthAddon.cs index 3c30ba9de..a4269ee25 100644 --- a/Scripts/Items/Addons/SquirrelStatueSouthAddon.cs +++ b/Scripts/Items/Addons/SquirrelStatueSouthAddon.cs @@ -8,15 +8,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new SquirrelStatueSouthDeed(); } } [Constructable] - public SquirrelStatueSouthAddon() : this( 0 ) - { - } - - [Constructable] - public SquirrelStatueSouthAddon( int hue ) + public SquirrelStatueSouthAddon() { AddComponent( new AddonComponent( 0x2D11 ), 0, 0, 0 ); - Hue = hue; } public SquirrelStatueSouthAddon( Serial serial ) : base( serial ) @@ -40,7 +34,7 @@ namespace Server.Items public class SquirrelStatueSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new SquirrelStatueSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new SquirrelStatueSouthAddon(); } } public override int LabelNumber{ get{ return 1072884; } } // squirrel statue (south) [Constructable] diff --git a/Scripts/Items/Addons/StoneOvenEastAddon.cs b/Scripts/Items/Addons/StoneOvenEastAddon.cs index 57fa28f46..59811cba7 100644 --- a/Scripts/Items/Addons/StoneOvenEastAddon.cs +++ b/Scripts/Items/Addons/StoneOvenEastAddon.cs @@ -8,16 +8,10 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new StoneOvenEastDeed(); } } [Constructable] - public StoneOvenEastAddon() : this( 0 ) - { - } - - [Constructable] - public StoneOvenEastAddon( int hue ) + public StoneOvenEastAddon() { AddComponent( new AddonComponent( 0x92C ), 0, 0, 0 ); AddComponent( new AddonComponent( 0x92B ), 0, 1, 0 ); - Hue = hue; } public StoneOvenEastAddon( Serial serial ) : base( serial ) @@ -41,7 +35,7 @@ namespace Server.Items public class StoneOvenEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new StoneOvenEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new StoneOvenEastAddon(); } } public override int LabelNumber{ get{ return 1044345; } } // stone oven (east) [Constructable] diff --git a/Scripts/Items/Addons/StoneOvenSouthAddon.cs b/Scripts/Items/Addons/StoneOvenSouthAddon.cs index a85d3d9a8..380a55449 100644 --- a/Scripts/Items/Addons/StoneOvenSouthAddon.cs +++ b/Scripts/Items/Addons/StoneOvenSouthAddon.cs @@ -8,16 +8,10 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new StoneOvenSouthDeed(); } } [Constructable] - public StoneOvenSouthAddon() : this( 0 ) - { - } - - [Constructable] - public StoneOvenSouthAddon( int hue ) + public StoneOvenSouthAddon() { AddComponent( new AddonComponent( 0x931 ), -1, 0, 0 ); AddComponent( new AddonComponent( 0x930 ), 0, 0, 0 ); - Hue = hue; } public StoneOvenSouthAddon( Serial serial ) : base( serial ) @@ -41,7 +35,7 @@ namespace Server.Items public class StoneOvenSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new StoneOvenSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new StoneOvenSouthAddon(); } } public override int LabelNumber{ get{ return 1044346; } } // stone oven (south) [Constructable] diff --git a/Scripts/Items/Addons/TallElvenBedEastAddon.cs b/Scripts/Items/Addons/TallElvenBedEastAddon.cs index 865acc815..48fb16680 100644 --- a/Scripts/Items/Addons/TallElvenBedEastAddon.cs +++ b/Scripts/Items/Addons/TallElvenBedEastAddon.cs @@ -8,18 +8,12 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new TallElvenBedEastDeed(); } } [Constructable] - public TallElvenBedEastAddon() : this( 0 ) - { - } - - [Constructable] - public TallElvenBedEastAddon( int hue ) + public TallElvenBedEastAddon() { AddComponent( new AddonComponent( 0x3054 ), 0, 0, 0 ); AddComponent( new AddonComponent( 0x3053 ), 1, 0, 0 ); AddComponent( new AddonComponent( 0x3055 ), 2, -1, 0 ); AddComponent( new AddonComponent( 0x3052 ), 2, 0, 0 ); - Hue = hue; } public TallElvenBedEastAddon( Serial serial ) : base( serial ) @@ -43,7 +37,7 @@ namespace Server.Items public class TallElvenBedEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new TallElvenBedEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new TallElvenBedEastAddon(); } } public override int LabelNumber{ get{ return 1072859; } } // tall elven bed (east) [Constructable] diff --git a/Scripts/Items/Addons/TallElvenBedSouthAddon.cs b/Scripts/Items/Addons/TallElvenBedSouthAddon.cs index 8fab084a8..c981f4d09 100644 --- a/Scripts/Items/Addons/TallElvenBedSouthAddon.cs +++ b/Scripts/Items/Addons/TallElvenBedSouthAddon.cs @@ -8,18 +8,12 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new TallElvenBedSouthDeed(); } } [Constructable] - public TallElvenBedSouthAddon() : this( 0 ) - { - } - - [Constructable] - public TallElvenBedSouthAddon( int hue ) + public TallElvenBedSouthAddon() { AddComponent( new AddonComponent( 0x3058 ), 0, 0, 0 ); // angolo alto sx AddComponent( new AddonComponent( 0x3057 ), -1, 1, 0 ); // angolo basso sx AddComponent( new AddonComponent( 0x3059 ), 0, -1, 0 ); // angolo alto dx AddComponent( new AddonComponent( 0x3056 ), 0, 1, 0 ); // angolo basso dx - Hue = hue; } public TallElvenBedSouthAddon( Serial serial ) : base( serial ) @@ -43,7 +37,7 @@ namespace Server.Items public class TallElvenBedSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new TallElvenBedSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new TallElvenBedSouthAddon(); } } public override int LabelNumber{ get{ return 1072858; } } // tall elven bed (south) [Constructable] diff --git a/Scripts/Items/Addons/TrainingDummies.cs b/Scripts/Items/Addons/TrainingDummies.cs index 0a01ac325..d77feb36b 100644 --- a/Scripts/Items/Addons/TrainingDummies.cs +++ b/Scripts/Items/Addons/TrainingDummies.cs @@ -171,15 +171,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new TrainingDummyEastDeed(); } } [Constructable] - public TrainingDummyEastAddon() : this( 0 ) - { - } - - [Constructable] - public TrainingDummyEastAddon( int hue ) + public TrainingDummyEastAddon() { AddComponent( new TrainingDummy( 0x1074 ), 0, 0, 0 ); - Hue = hue; } public TrainingDummyEastAddon( Serial serial ) : base( serial ) @@ -203,7 +197,7 @@ namespace Server.Items public class TrainingDummyEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new TrainingDummyEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new TrainingDummyEastAddon(); } } public override int LabelNumber{ get{ return 1044335; } } // training dummy (east) [Constructable] @@ -235,15 +229,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new TrainingDummySouthDeed(); } } [Constructable] - public TrainingDummySouthAddon() : this( 0 ) - { - } - - [Constructable] - public TrainingDummySouthAddon( int hue ) + public TrainingDummySouthAddon() { AddComponent( new TrainingDummy( 0x1070 ), 0, 0, 0 ); - Hue = hue; } public TrainingDummySouthAddon( Serial serial ) : base( serial ) @@ -267,7 +255,7 @@ namespace Server.Items public class TrainingDummySouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new TrainingDummySouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new TrainingDummySouthAddon(); } } public override int LabelNumber{ get{ return 1044336; } } // training dummy (south) [Constructable] diff --git a/Scripts/Items/Addons/WarriorStatueEastAddon.cs b/Scripts/Items/Addons/WarriorStatueEastAddon.cs index 37ee35bef..8e87608b6 100644 --- a/Scripts/Items/Addons/WarriorStatueEastAddon.cs +++ b/Scripts/Items/Addons/WarriorStatueEastAddon.cs @@ -8,15 +8,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new WarriorStatueEastDeed(); } } [Constructable] - public WarriorStatueEastAddon() : this( 0 ) - { - } - - [Constructable] - public WarriorStatueEastAddon( int hue ) + public WarriorStatueEastAddon() { AddComponent( new AddonComponent( 0x2D12 ), 0, 0, 0 ); - Hue = hue; } public WarriorStatueEastAddon( Serial serial ) : base( serial ) @@ -40,7 +34,7 @@ namespace Server.Items public class WarriorStatueEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new WarriorStatueEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new WarriorStatueEastAddon(); } } public override int LabelNumber{ get{ return 1072888; } } // warrior statue (east) [Constructable] diff --git a/Scripts/Items/Addons/WarriorStatueSouthAddon.cs b/Scripts/Items/Addons/WarriorStatueSouthAddon.cs index 472eecf25..0369aef53 100644 --- a/Scripts/Items/Addons/WarriorStatueSouthAddon.cs +++ b/Scripts/Items/Addons/WarriorStatueSouthAddon.cs @@ -8,15 +8,9 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new WarriorStatueSouthDeed(); } } [Constructable] - public WarriorStatueSouthAddon() : this( 0 ) - { - } - - [Constructable] - public WarriorStatueSouthAddon( int hue ) + public WarriorStatueSouthAddon() { AddComponent( new AddonComponent( 0x2D13 ), 0, 0, 0 ); - Hue = hue; } public WarriorStatueSouthAddon( Serial serial ) : base( serial ) @@ -40,7 +34,7 @@ namespace Server.Items public class WarriorStatueSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new WarriorStatueSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new WarriorStatueSouthAddon(); } } public override int LabelNumber{ get{ return 1072887; } } // warrior statue (south) [Constructable] diff --git a/Scripts/Items/Addons/WaterTroughEastAddon.cs b/Scripts/Items/Addons/WaterTroughEastAddon.cs index ff3bf9d53..2c317df6a 100644 --- a/Scripts/Items/Addons/WaterTroughEastAddon.cs +++ b/Scripts/Items/Addons/WaterTroughEastAddon.cs @@ -8,16 +8,10 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new WaterTroughEastDeed(); } } [Constructable] - public WaterTroughEastAddon() : this( 0 ) - { - } - - [Constructable] - public WaterTroughEastAddon( int hue ) + public WaterTroughEastAddon() { AddComponent( new AddonComponent( 0xB41 ), 0, 0, 0 ); AddComponent( new AddonComponent( 0xB42 ), 0, 1, 0 ); - Hue = hue; } public WaterTroughEastAddon( Serial serial ) : base( serial ) @@ -47,7 +41,7 @@ namespace Server.Items public class WaterTroughEastDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new WaterTroughEastAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new WaterTroughEastAddon(); } } public override int LabelNumber{ get{ return 1044349; } } // water trough (east) [Constructable] diff --git a/Scripts/Items/Addons/WaterTroughSouthAddon.cs b/Scripts/Items/Addons/WaterTroughSouthAddon.cs index 50e79b884..ffe6577b7 100644 --- a/Scripts/Items/Addons/WaterTroughSouthAddon.cs +++ b/Scripts/Items/Addons/WaterTroughSouthAddon.cs @@ -8,16 +8,10 @@ namespace Server.Items public override BaseAddonDeed Deed{ get{ return new WaterTroughSouthDeed(); } } [Constructable] - public WaterTroughSouthAddon() : this( 0 ) - { - } - - [Constructable] - public WaterTroughSouthAddon( int hue ) + public WaterTroughSouthAddon() { AddComponent( new AddonComponent( 0xB43 ), 0, 0, 0 ); AddComponent( new AddonComponent( 0xB44 ), 1, 0, 0 ); - Hue = hue; } public WaterTroughSouthAddon( Serial serial ) : base( serial ) @@ -47,7 +41,7 @@ namespace Server.Items public class WaterTroughSouthDeed : BaseAddonDeed { - public override BaseAddon Addon{ get{ return new WaterTroughSouthAddon( Hue ); } } + public override BaseAddon Addon{ get{ return new WaterTroughSouthAddon(); } } public override int LabelNumber{ get{ return 1044350; } } // water trough (south) [Constructable] diff --git a/Scripts/Items/Armor/BaseArmor.cs b/Scripts/Items/Armor/BaseArmor.cs index 002f1f099..c66d6ef3e 100644 --- a/Scripts/Items/Armor/BaseArmor.cs +++ b/Scripts/Items/Armor/BaseArmor.cs @@ -10,7 +10,7 @@ using ABT = Server.Items.ArmorBodyType; namespace Server.Items { - public abstract class BaseArmor : Item, IScissorable, IFactionItem, ICraftable, IWearableDurability, IAosAttributes + public abstract class BaseArmor : Item, IScissorable, IFactionItem, ICraftable, IWearableDurability { #region Factions private FactionItem m_FactionState; @@ -61,9 +61,6 @@ namespace Server.Items private AosAttributes m_AosAttributes; private AosArmorAttributes m_AosArmorAttributes; private AosSkillBonuses m_AosSkillBonuses; - - private BonusAttribute[] m_BonusRandomAttributes; - private double m_OriginalWeight; // Overridable values. These values are provided to override the defaults which get defined in the individual armor scripts. private int m_ArmorBase = -1; @@ -101,9 +98,6 @@ namespace Server.Items public virtual int OldIntReq{ get{ return 0; } } public virtual bool CanFortify{ get{ return true; } } - - public virtual bool MageArmorOnExceptional{ get{ return false; } } - public virtual bool UsesShieldAttrs{ get{ return false; } } public override void OnAfterDuped( Item newItem ) { @@ -115,11 +109,8 @@ namespace Server.Items armor.m_AosAttributes = new AosAttributes( newItem, m_AosAttributes ); armor.m_AosArmorAttributes = new AosArmorAttributes( newItem, m_AosArmorAttributes ); armor.m_AosSkillBonuses = new AosSkillBonuses( newItem, m_AosSkillBonuses ); - armor.m_BonusRandomAttributes = m_BonusRandomAttributes; } - #region Getters & Setters - [CommandProperty( AccessLevel.GameMaster )] public AMA MeditationAllowance { @@ -255,37 +246,18 @@ namespace Server.Items { if ( m_Resource != value ) { - if ( !Core.AOS ) - UnscaleDurability(); + UnscaleDurability(); - if ( Core.AOS && !CraftResources.IsStandard( m_Resource ) ) - { - BonusAttributesHelper.RemoveAttrsFrom( this, GetResourceBonusAttrs() ); - BonusAttributesHelper.RemoveAttrsFrom( this, RandomAttributes ); - RandomAttributes = null; - } - m_Resource = value; Hue = CraftResources.GetHue( m_Resource ); - - if ( Core.AOS && !CraftResources.IsStandard( m_Resource ) ) - { - // Enhance sets RandomAttributes so check if it's null/empty first before getting new random attributes. - if ( RandomAttributes == null || RandomAttributes.Length == 0 ) - RandomAttributes = BonusAttributesHelper.GetRandomAttributes( GetResourceRandomAttrs(), GetResourceAttrs().RandomAttributeCount ); - - BonusAttributesHelper.ApplyAttributesTo( this, GetResourceBonusAttrs() ); - BonusAttributesHelper.ApplyAttributesTo( this, RandomAttributes ); - } - + Invalidate(); InvalidateProperties(); if ( Parent is Mobile ) ((Mobile)Parent).UpdateResistances(); - if ( !Core.AOS ) - ScaleDurability(); + ScaleDurability(); } } } @@ -403,14 +375,6 @@ namespace Server.Items get{ return m_AosSkillBonuses; } set{} } - - public BonusAttribute[] RandomAttributes - { - get { return m_BonusRandomAttributes; } - set { m_BonusRandomAttributes = value; } - } - - #endregion public int ComputeStatReq( StatType type ) { @@ -457,11 +421,11 @@ namespace Server.Items public virtual int BasePoisonResistance{ get{ return 0; } } public virtual int BaseEnergyResistance{ get{ return 0; } } - public override int PhysicalResistance{ get{ return BasePhysicalResistance + GetProtOffset() + m_PhysicalBonus; } } - public override int FireResistance{ get{ return BaseFireResistance + GetProtOffset() + m_FireBonus; } } - public override int ColdResistance{ get{ return BaseColdResistance + GetProtOffset() + m_ColdBonus; } } - public override int PoisonResistance{ get{ return BasePoisonResistance + GetProtOffset() + m_PoisonBonus; } } - public override int EnergyResistance{ get{ return BaseEnergyResistance + GetProtOffset() + m_EnergyBonus; } } + public override int PhysicalResistance{ get{ return BasePhysicalResistance + GetProtOffset() + GetResourceAttrs().ArmorPhysicalResist + m_PhysicalBonus; } } + public override int FireResistance{ get{ return BaseFireResistance + GetProtOffset() + GetResourceAttrs().ArmorFireResist + m_FireBonus; } } + public override int ColdResistance{ get{ return BaseColdResistance + GetProtOffset() + GetResourceAttrs().ArmorColdResist + m_ColdBonus; } } + public override int PoisonResistance{ get{ return BasePoisonResistance + GetProtOffset() + GetResourceAttrs().ArmorPoisonResist + m_PoisonBonus; } } + public override int EnergyResistance{ get{ return BaseEnergyResistance + GetProtOffset() + GetResourceAttrs().ArmorEnergyResist + m_EnergyBonus; } } public virtual int InitMinHits{ get{ return 0; } } public virtual int InitMaxHits{ get{ return 0; } } @@ -517,26 +481,6 @@ namespace Server.Items return info.AttributeInfo; } - - public BonusAttribute[] GetResourceBonusAttrs() - { - CraftAttributeInfo attrInfo = GetResourceAttrs(); - - if ( UsesShieldAttrs ) - return attrInfo.ShieldAttributes; - - return attrInfo.ArmorAttributes; - } - - public BonusAttribute[] GetResourceRandomAttrs() - { - CraftAttributeInfo attrInfo = GetResourceAttrs(); - - if ( UsesShieldAttrs ) - return attrInfo.ShieldRandomAttributes; - - return attrInfo.ArmorRandomAttributes; - } public int GetProtOffset() { @@ -550,25 +494,6 @@ namespace Server.Items return 0; } - - public void ModifyWeight() - { - double v = 0; - - v = 100 - GetWeightBonus(); - - Weight = m_OriginalWeight * (v / 100); - } - - public int GetWeightBonus() - { - int v = Attributes.LowerWeight; - - if ( v > 100 ) - v = 100; - - return v; - } public void UnscaleDurability() { @@ -607,6 +532,15 @@ namespace Server.Items if ( Core.AOS ) { bonus += m_AosArmorAttributes.DurabilityBonus; + + CraftResourceInfo resInfo = CraftResources.GetInfo( m_Resource ); + CraftAttributeInfo attrInfo = null; + + if ( resInfo != null ) + attrInfo = resInfo.AttributeInfo; + + if ( attrInfo != null ) + bonus += attrInfo.ArmorDurability; } return bonus; @@ -713,6 +647,16 @@ namespace Server.Items int v = m_AosArmorAttributes.LowerStatReq; + CraftResourceInfo info = CraftResources.GetInfo( m_Resource ); + + if ( info != null ) + { + CraftAttributeInfo attrInfo = info.AttributeInfo; + + if ( attrInfo != null ) + v += attrInfo.ArmorLowerRequirements; + } + if ( v > 100 ) v = 100; @@ -791,16 +735,14 @@ namespace Server.Items IntReq = 0x00200000, MedAllowance = 0x00400000, SkillBonuses = 0x00800000, - PlayerConstructed = 0x01000000, - BonusAttributes = 0x02000000, - OriginalWeight = 0x04000000 + PlayerConstructed = 0x01000000 } public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); - writer.Write( (int) 8 ); // version + writer.Write( (int) 7 ); // version SaveFlag flags = SaveFlag.None; @@ -829,9 +771,7 @@ namespace Server.Items SetSaveFlag( ref flags, SaveFlag.MedAllowance, m_Meditate != (AMA)(-1) ); SetSaveFlag( ref flags, SaveFlag.SkillBonuses, !m_AosSkillBonuses.IsEmpty ); SetSaveFlag( ref flags, SaveFlag.PlayerConstructed, m_PlayerConstructed != false ); - SetSaveFlag( ref flags, SaveFlag.BonusAttributes, m_BonusRandomAttributes != null && m_BonusRandomAttributes.Length > 0 ); - SetSaveFlag( ref flags, SaveFlag.OriginalWeight, m_OriginalWeight != 0 ); - + writer.WriteEncodedInt( (int) flags ); if ( GetSaveFlag( flags, SaveFlag.Attributes ) ) @@ -902,16 +842,6 @@ namespace Server.Items if ( GetSaveFlag( flags, SaveFlag.SkillBonuses ) ) m_AosSkillBonuses.Serialize( writer ); - - if ( GetSaveFlag( flags, SaveFlag.BonusAttributes ) ) - { - writer.Write( (int)m_BonusRandomAttributes.Length ); - for ( int i = 0; i < m_BonusRandomAttributes.Length; i++ ) - m_BonusRandomAttributes[i].Serialize( writer ); - } - - if ( GetSaveFlag( flags, SaveFlag.OriginalWeight ) ) - writer.Write( (double)m_OriginalWeight ); } public override void Deserialize( GenericReader reader ) @@ -922,7 +852,6 @@ namespace Server.Items switch ( version ) { - case 8: case 7: case 6: case 5: @@ -1043,17 +972,6 @@ namespace Server.Items if ( GetSaveFlag( flags, SaveFlag.PlayerConstructed ) ) m_PlayerConstructed = true; - - if ( GetSaveFlag( flags, SaveFlag.BonusAttributes ) ) - { - m_BonusRandomAttributes = new BonusAttribute[reader.ReadInt()]; - - for( int i = 0; i < m_BonusRandomAttributes.Length; i++ ) - m_BonusRandomAttributes[i] = new BonusAttribute( reader ); - } - - if ( GetSaveFlag( flags, SaveFlag.OriginalWeight ) ) - m_OriginalWeight = reader.ReadDouble(); break; } @@ -1211,18 +1129,6 @@ namespace Server.Items if ( version < 7 ) m_PlayerConstructed = true; // we don't know, so, assume it's crafted - - if ( version < 8 ) - { - int hits = m_HitPoints; - int maxHits = m_MaxHitPoints; - - m_OriginalWeight = Weight; - BonusAttributesHelper.ApplyAttributesTo( this, GetResourceBonusAttrs() ); - - m_HitPoints = hits; - m_MaxHitPoints = maxHits; - } } public virtual CraftResource DefaultResource{ get{ return CraftResource.Iron; } } @@ -1243,8 +1149,6 @@ namespace Server.Items m_AosAttributes = new AosAttributes( this ); m_AosArmorAttributes = new AosArmorAttributes( this ); m_AosSkillBonuses = new AosSkillBonuses( this ); - - m_OriginalWeight = Weight; } public override bool AllowSecureTrade( Mobile from, Mobile to, Mobile newOwner, bool accepted ) @@ -1482,7 +1386,7 @@ namespace Server.Items default: oreType = 0; break; } - if ( m_Quality == ArmorQuality.Exceptional && !( m_Resource >= CraftResource.RegularWood && m_Resource <= CraftResource.Frostwood ) ) + if ( m_Quality == ArmorQuality.Exceptional ) { if ( oreType != 0 ) list.Add( 1053100, "#{0}\t{1}", oreType, GetNameString() ); // exceptional ~1_oretype~ ~2_armortype~ @@ -1507,16 +1411,28 @@ namespace Server.Items return ( m_AosAttributes.SpellChanneling != 0 ); } - + + public virtual int GetLuckBonus() + { + CraftResourceInfo resInfo = CraftResources.GetInfo( m_Resource ); + + if ( resInfo == null ) + return 0; + + CraftAttributeInfo attrInfo = resInfo.AttributeInfo; + + if ( attrInfo == null ) + return 0; + + return attrInfo.ArmorLuck; + } + public override void GetProperties( ObjectPropertyList list ) { base.GetProperties( list ); if ( m_Crafter != null ) list.Add( 1050043, m_Crafter.Name ); // crafted by ~1_NAME~ - - if ( m_Quality == ArmorQuality.Exceptional && ( m_Resource >= CraftResource.RegularWood && m_Resource <= CraftResource.Frostwood ) ) - list.Add( 1060636 ); // exceptional #region Factions if ( m_FactionState != null ) @@ -1569,7 +1485,7 @@ namespace Server.Items if ( (prop = GetLowerStatReq()) != 0 ) list.Add( 1060435, prop.ToString() ); // lower requirements ~1_val~% - if ( (prop = m_AosAttributes.Luck) != 0 ) + if ( (prop = (GetLuckBonus() + m_AosAttributes.Luck)) != 0 ) list.Add( 1060436, prop.ToString() ); // luck ~1_val~ if ( (prop = m_AosArmorAttributes.MageArmor) != 0 ) @@ -1683,15 +1599,23 @@ namespace Server.Items if ( makersMark ) Crafter = from; + Type resourceType = typeRes; + + if ( resourceType == null ) + resourceType = craftItem.Resources.GetAt( 0 ).ItemType; + + Resource = CraftResources.GetFromType( resourceType ); + PlayerConstructed = true; + + CraftContext context = craftSystem.GetContext( from ); + + if ( context != null && context.DoNotColor ) + Hue = 0; + if( Quality == ArmorQuality.Exceptional ) { - if ( !(this is BaseShield) ) - DistributeBonuses( (tool is BaseRunicTool ? 6 : Core.SE ? 15 : 14) ); // Not sure since when, but right now 15 points are added, not 14. + DistributeBonuses( (tool is BaseRunicTool ? 6 : Core.SE ? 15 : 14) ); // Not sure since when, but right now 15 points are added, not 14. - if ( Core.SE ) - if ( MageArmorOnExceptional ) - ArmorAttributes[AosArmorAttribute.MageArmor] = 1; - if( Core.ML && !(this is BaseShield) ) { int bonus = (int)(from.Skills.ArmsLore.Value / 20); @@ -1714,26 +1638,7 @@ namespace Server.Items if ( Core.AOS && tool is BaseRunicTool ) ((BaseRunicTool)tool).ApplyAttributesTo( this ); - - Type resourceType = typeRes; - if ( resourceType == null ) - resourceType = craftItem.Resources.GetAt( 0 ).ItemType; - - Resource = CraftResources.GetFromType( resourceType ); - - PlayerConstructed = true; - - CraftContext context = craftSystem.GetContext( from ); - - if ( context != null ) - { - if ( context.DoNotColor ) - Hue = 0; - else if ( context.CompareHueTo != null ) - Hue = context.CompareHueTo.Hue; - } - return quality; } diff --git a/Scripts/Items/Armor/Plate/HeavyPlateJingasa.cs b/Scripts/Items/Armor/Plate/HeavyPlateJingasa.cs index 46b573353..b76a955e5 100644 --- a/Scripts/Items/Armor/Plate/HeavyPlateJingasa.cs +++ b/Scripts/Items/Armor/Plate/HeavyPlateJingasa.cs @@ -18,8 +18,6 @@ namespace Server.Items public override int OldStrReq{ get{ return 55; } } public override int ArmorBase{ get{ return 4; } } - - public override bool MageArmorOnExceptional{ get{ return true; } } public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } } diff --git a/Scripts/Items/Armor/Plate/LightPlateJingasa.cs b/Scripts/Items/Armor/Plate/LightPlateJingasa.cs index aad0a3b0d..1087dfd14 100644 --- a/Scripts/Items/Armor/Plate/LightPlateJingasa.cs +++ b/Scripts/Items/Armor/Plate/LightPlateJingasa.cs @@ -18,8 +18,6 @@ namespace Server.Items public override int OldStrReq{ get{ return 55; } } public override int ArmorBase{ get{ return 4; } } - - public override bool MageArmorOnExceptional{ get{ return true; } } public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } } diff --git a/Scripts/Items/Armor/Plate/PlateDo.cs b/Scripts/Items/Armor/Plate/PlateDo.cs index 0851c6416..ca5cfb2ff 100644 --- a/Scripts/Items/Armor/Plate/PlateDo.cs +++ b/Scripts/Items/Armor/Plate/PlateDo.cs @@ -18,8 +18,6 @@ namespace Server.Items public override int OldStrReq{ get{ return 85; } } public override int ArmorBase{ get{ return 3; } } - - public override bool MageArmorOnExceptional{ get{ return true; } } public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } } diff --git a/Scripts/Items/Armor/Plate/PlateHaidate.cs b/Scripts/Items/Armor/Plate/PlateHaidate.cs index 4f21a1198..eb666c361 100644 --- a/Scripts/Items/Armor/Plate/PlateHaidate.cs +++ b/Scripts/Items/Armor/Plate/PlateHaidate.cs @@ -18,8 +18,6 @@ namespace Server.Items public override int OldStrReq{ get{ return 80; } } public override int ArmorBase{ get{ return 3; } } - - public override bool MageArmorOnExceptional{ get{ return true; } } public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } } diff --git a/Scripts/Items/Armor/Plate/PlateHatsuburi.cs b/Scripts/Items/Armor/Plate/PlateHatsuburi.cs index d826c8b50..a34f66512 100644 --- a/Scripts/Items/Armor/Plate/PlateHatsuburi.cs +++ b/Scripts/Items/Armor/Plate/PlateHatsuburi.cs @@ -18,8 +18,6 @@ namespace Server.Items public override int OldStrReq{ get{ return 65; } } public override int ArmorBase{ get{ return 4; } } - - public override bool MageArmorOnExceptional{ get{ return true; } } public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } } diff --git a/Scripts/Items/Armor/Plate/PlateHiroSode.cs b/Scripts/Items/Armor/Plate/PlateHiroSode.cs index accdc6692..f67981cd4 100644 --- a/Scripts/Items/Armor/Plate/PlateHiroSode.cs +++ b/Scripts/Items/Armor/Plate/PlateHiroSode.cs @@ -18,8 +18,6 @@ namespace Server.Items public override int OldStrReq{ get{ return 75; } } public override int ArmorBase{ get{ return 3; } } - - public override bool MageArmorOnExceptional{ get{ return true; } } public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } } diff --git a/Scripts/Items/Armor/Plate/PlateMempo.cs b/Scripts/Items/Armor/Plate/PlateMempo.cs index 650bcc72b..a7b9cc34c 100644 --- a/Scripts/Items/Armor/Plate/PlateMempo.cs +++ b/Scripts/Items/Armor/Plate/PlateMempo.cs @@ -18,8 +18,6 @@ namespace Server.Items public override int OldStrReq{ get{ return 50; } } public override int ArmorBase{ get{ return 4; } } - - public override bool MageArmorOnExceptional{ get{ return true; } } public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } } diff --git a/Scripts/Items/Armor/Plate/PlateSuneate.cs b/Scripts/Items/Armor/Plate/PlateSuneate.cs index 51df99459..0e2bdd7ee 100644 --- a/Scripts/Items/Armor/Plate/PlateSuneate.cs +++ b/Scripts/Items/Armor/Plate/PlateSuneate.cs @@ -18,8 +18,6 @@ namespace Server.Items public override int OldStrReq{ get{ return 80; } } public override int ArmorBase{ get{ return 3; } } - - public override bool MageArmorOnExceptional{ get{ return true; } } public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } } diff --git a/Scripts/Items/Armor/Plate/SmallPlateJingasa.cs b/Scripts/Items/Armor/Plate/SmallPlateJingasa.cs index c2d93e0cc..8cf5a63fe 100644 --- a/Scripts/Items/Armor/Plate/SmallPlateJingasa.cs +++ b/Scripts/Items/Armor/Plate/SmallPlateJingasa.cs @@ -18,8 +18,6 @@ namespace Server.Items public override int OldStrReq{ get{ return 55; } } public override int ArmorBase{ get{ return 4; } } - - public override bool MageArmorOnExceptional{ get{ return true; } } public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Plate; } } diff --git a/Scripts/Items/Clothing/BaseClothing.cs b/Scripts/Items/Clothing/BaseClothing.cs index 567aac7b6..00c0e68ae 100644 --- a/Scripts/Items/Clothing/BaseClothing.cs +++ b/Scripts/Items/Clothing/BaseClothing.cs @@ -21,7 +21,7 @@ namespace Server.Items int MaxArcaneCharges{ get; set; } } - public abstract class BaseClothing : Item, IDyable, IScissorable, IFactionItem, ICraftable, IWearableDurability, IAosAttributes + public abstract class BaseClothing : Item, IDyable, IScissorable, IFactionItem, ICraftable, IWearableDurability { #region Factions private FactionItem m_FactionState; diff --git a/Scripts/Items/Construction/Chairs/Benchs.cs b/Scripts/Items/Construction/Chairs/Benchs.cs index 151da454e..4c067d168 100644 --- a/Scripts/Items/Construction/Chairs/Benchs.cs +++ b/Scripts/Items/Construction/Chairs/Benchs.cs @@ -4,12 +4,12 @@ namespace Server.Items { [Furniture] [Flipable( 0xB2D, 0xB2C )] - public class WoodenBench : BaseCraftableItem + public class WoodenBench : Item { [Constructable] - public WoodenBench() : base( 0xB2C ) + public WoodenBench() : base( 0xB2D ) { - Weight = 1; + Weight = 6; } public WoodenBench(Serial serial) : base(serial) @@ -27,10 +27,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion - - if ( Weight == 6 ) - Weight = 1; + int version = reader.ReadInt(); } } } \ No newline at end of file diff --git a/Scripts/Items/Construction/Chairs/Chairs.cs b/Scripts/Items/Construction/Chairs/Chairs.cs index 11a2547b7..ff1ac6c38 100644 --- a/Scripts/Items/Construction/Chairs/Chairs.cs +++ b/Scripts/Items/Construction/Chairs/Chairs.cs @@ -4,10 +4,10 @@ namespace Server.Items { [Furniture] [Flipable( 0xB4F, 0xB4E, 0xB50, 0xB51 )] - public class FancyWoodenChairCushion : BaseCraftableItem + public class FancyWoodenChairCushion : Item { [Constructable] - public FancyWoodenChairCushion() : base(0xB4E) + public FancyWoodenChairCushion() : base(0xB4F) { Weight = 20.0; } @@ -27,7 +27,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); if ( Weight == 6.0 ) Weight = 20.0; @@ -36,10 +36,10 @@ namespace Server.Items [Furniture] [Flipable( 0xB53, 0xB52, 0xB54, 0xB55 )] - public class WoodenChairCushion : BaseCraftableItem + public class WoodenChairCushion : Item { [Constructable] - public WoodenChairCushion() : base(0xB52) + public WoodenChairCushion() : base(0xB53) { Weight = 20.0; } @@ -59,7 +59,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); if ( Weight == 6.0 ) Weight = 20.0; @@ -68,10 +68,10 @@ namespace Server.Items [Furniture] [Flipable( 0xB57, 0xB56, 0xB59, 0xB58 )] - public class WoodenChair : BaseCraftableItem + public class WoodenChair : Item { [Constructable] - public WoodenChair() : base(0xB56) + public WoodenChair() : base(0xB57) { Weight = 20.0; } @@ -91,7 +91,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); if ( Weight == 6.0 ) Weight = 20.0; @@ -100,10 +100,10 @@ namespace Server.Items [Furniture] [Flipable( 0xB5B, 0xB5A, 0xB5C, 0xB5D )] - public class BambooChair : BaseCraftableItem + public class BambooChair : Item { [Constructable] - public BambooChair() : base(0xB5A) + public BambooChair() : base(0xB5B) { Weight = 20.0; } @@ -123,7 +123,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); if ( Weight == 6.0 ) Weight = 20.0; @@ -132,9 +132,8 @@ namespace Server.Items [DynamicFliping] [Flipable(0x1218, 0x1219, 0x121A, 0x121B)] - public class StoneChair : BaseCraftableItem + public class StoneChair : Item { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } [Constructable] public StoneChair() : base(0x1218) { @@ -156,13 +155,13 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } - [Furniture] + [DynamicFliping] [Flipable( 0x2DE3, 0x2DE4, 0x2DE5, 0x2DE6 )] - public class OrnateElvenChair : BaseCraftableItem + public class OrnateElvenChair : Item { [Constructable] public OrnateElvenChair() : base( 0x2DE3 ) @@ -185,16 +184,16 @@ namespace Server.Items { base.Deserialize( reader ); - int version = ( InheritsItem ? OldVersion : reader.ReadEncodedInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadEncodedInt(); } } - [Furniture] + [DynamicFliping] [Flipable( 0x2DEB, 0x2DEC, 0x2DED, 0x2DEE )] - public class BigElvenChair : BaseCraftableItem + public class BigElvenChair : Item { [Constructable] - public BigElvenChair() : base( 0x2DED ) + public BigElvenChair() : base( 0x2DEB ) { } @@ -213,13 +212,13 @@ namespace Server.Items { base.Deserialize( reader ); - int version = ( InheritsItem ? OldVersion : reader.ReadEncodedInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadEncodedInt(); } } - [Furniture] + [DynamicFliping] [Flipable( 0x2DF5, 0x2DF6 )] - public class ElvenReadingChair : BaseCraftableItem + public class ElvenReadingChair : Item { [Constructable] public ElvenReadingChair() : base( 0x2DF5 ) @@ -241,7 +240,7 @@ namespace Server.Items { base.Deserialize( reader ); - int version = ( InheritsItem ? OldVersion : reader.ReadEncodedInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadEncodedInt(); } } } \ No newline at end of file diff --git a/Scripts/Items/Construction/Chairs/Stools.cs b/Scripts/Items/Construction/Chairs/Stools.cs index b23a53a80..00ea2a27b 100644 --- a/Scripts/Items/Construction/Chairs/Stools.cs +++ b/Scripts/Items/Construction/Chairs/Stools.cs @@ -3,7 +3,7 @@ using System; namespace Server.Items { [Furniture] - public class Stool : BaseCraftableItem + public class Stool : Item { [Constructable] public Stool() : base( 0xA2A ) @@ -26,7 +26,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); if ( Weight == 6.0 ) Weight = 10.0; @@ -34,12 +34,12 @@ namespace Server.Items } [Furniture] - public class FootStool : BaseCraftableItem + public class FootStool : Item { [Constructable] public FootStool() : base( 0xB5E ) { - Weight = 10.0; + Weight = 6.0; } public FootStool(Serial serial) : base(serial) @@ -57,7 +57,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); if ( Weight == 6.0 ) Weight = 10.0; diff --git a/Scripts/Items/Construction/Chairs/Thrones.cs b/Scripts/Items/Construction/Chairs/Thrones.cs index 707211364..0024f4418 100644 --- a/Scripts/Items/Construction/Chairs/Thrones.cs +++ b/Scripts/Items/Construction/Chairs/Thrones.cs @@ -4,7 +4,7 @@ namespace Server.Items { [Furniture] [Flipable(0xB32, 0xB33)] - public class Throne : BaseCraftableItem + public class Throne : Item { [Constructable] public Throne() : base(0xB33) @@ -27,7 +27,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); if ( Weight == 6.0 ) Weight = 1.0; @@ -36,10 +36,10 @@ namespace Server.Items [Furniture] [Flipable( 0xB2E, 0xB2F, 0xB31, 0xB30 )] - public class WoodenThrone : BaseCraftableItem + public class WoodenThrone : Item { [Constructable] - public WoodenThrone() : base(0xB2F) + public WoodenThrone() : base(0xB2E) { Weight = 15.0; } @@ -59,7 +59,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); if ( Weight == 6.0 ) Weight = 15.0; diff --git a/Scripts/Items/Construction/Misc/BarrelParts.cs b/Scripts/Items/Construction/Misc/BarrelParts.cs index 71b64b19b..f61401a2a 100644 --- a/Scripts/Items/Construction/Misc/BarrelParts.cs +++ b/Scripts/Items/Construction/Misc/BarrelParts.cs @@ -2,11 +2,8 @@ using System; namespace Server.Items { - public class BarrelLid : BaseCraftableItem + public class BarrelLid : Item { - public override bool DisplaysResource{ get{ return false; } } - public override bool DisplaysMakersMark{ get{ return false; } } - [Constructable] public BarrelLid() : base(0x1DB8) { @@ -28,16 +25,13 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } [FlipableAttribute(0x1EB1, 0x1EB2, 0x1EB3, 0x1EB4)] - public class BarrelStaves : BaseCraftableItem + public class BarrelStaves : Item { - public override bool DisplaysResource{ get{ return false; } } - public override bool DisplaysMakersMark{ get{ return false; } } - [Constructable] public BarrelStaves() : base(0x1EB1) { @@ -59,7 +53,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } diff --git a/Scripts/Items/Construction/Misc/BookStand.cs b/Scripts/Items/Construction/Misc/BookStand.cs deleted file mode 100644 index e663fec9d..000000000 --- a/Scripts/Items/Construction/Misc/BookStand.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; - -namespace Server.Items -{ - [Furniture] - [Flipable( false, 0x2DDD, 0x2DDE )] - public class ElvenBookStand : BaseCraftableItem - { - [Constructable] - public ElvenBookStand() : base( 0x2DDD ) - { - Weight = 20.0; - } - - public ElvenBookStand(Serial serial) : base(serial) - { - } - - public override void Serialize(GenericWriter writer) - { - base.Serialize(writer); - - writer.Write((int) 0); - } - - public override void Deserialize(GenericReader reader) - { - base.Deserialize(reader); - - int version = reader.ReadInt(); //Required for BaseCraftableItem insertion - } - } -} diff --git a/Scripts/Items/Construction/Misc/Easle.cs b/Scripts/Items/Construction/Misc/Easle.cs index 696a488f2..d3a180fcc 100644 --- a/Scripts/Items/Construction/Misc/Easle.cs +++ b/Scripts/Items/Construction/Misc/Easle.cs @@ -3,18 +3,13 @@ using System; namespace Server.Items { [Furniture] - [Flipable( false, 0xF65, 0xF67, 0xF69 )] - public class Easle : BaseCraftableItem + [Flipable(0xF65, 0xF67, 0xF69)] + public class Easle : Item { [Constructable] - public Easle() : base( 0xF65 ) + public Easle() : base(0xF65) { - } - - [Constructable] - public Easle( int itemID ) : base( itemID ) - { - Weight = 24.0; + Weight = 25.0; } public Easle(Serial serial) : base(serial) @@ -28,48 +23,14 @@ namespace Server.Items writer.Write((int) 0); } - public override void Deserialize(GenericReader reader) - { - base.Deserialize(reader); - - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion - - if ( Weight == 10.0 || Weight == 25.0 ) - Weight = 24.0; - } - } - - [Furniture] - [Flipable( false, 0xF66, 0xF68, 0xF6A )] - public class EasleWithCanvas : BaseCraftableItem - { - [Constructable] - public EasleWithCanvas() : base( 0xF66 ) - { - } - - [Constructable] - public EasleWithCanvas( int itemID ) : base( itemID ) - { - Weight = 24.0; - } - - public EasleWithCanvas(Serial serial) : base(serial) - { - } - - public override void Serialize(GenericWriter writer) - { - base.Serialize(writer); - - writer.Write((int) 0); - } - public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); + + if ( Weight == 10.0 ) + Weight = 25.0; } } } \ No newline at end of file diff --git a/Scripts/Items/Construction/Misc/MusicStand.cs b/Scripts/Items/Construction/Misc/MusicStand.cs index 042587f7d..ce76b1b1b 100644 --- a/Scripts/Items/Construction/Misc/MusicStand.cs +++ b/Scripts/Items/Construction/Misc/MusicStand.cs @@ -3,18 +3,11 @@ using System; namespace Server.Items { [Furniture] - [Flipable( false, 0xEBB, 0xEBC )] - public class TallMusicStand : BaseCraftableItem + [Flipable(0xEBB, 0xEBC)] + public class TallMusicStand : Item { - public override bool DisplaysResource{ get{ return false; } } - [Constructable] - public TallMusicStand() : this( 0xEBB ) - { - } - - [Constructable] - public TallMusicStand( int itemID ) : base( itemID ) + public TallMusicStand() : base(0xEBB) { Weight = 10.0; } @@ -34,7 +27,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); if ( Weight == 8.0 ) Weight = 10.0; @@ -42,18 +35,11 @@ namespace Server.Items } [Furniture] - [Flipable( false, 0xEB6,0xEB8 )] - public class ShortMusicStand : BaseCraftableItem + [Flipable(0xEB6,0xEB8)] + public class ShortMusicStand : Item { - public override bool DisplaysResource{ get{ return false; } } - [Constructable] - public ShortMusicStand() : this( 0xEB6 ) - { - } - - [Constructable] - public ShortMusicStand( int itemID ) : base( itemID ) + public ShortMusicStand() : base(0xEB6) { Weight = 10.0; } @@ -73,7 +59,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); if ( Weight == 6.0 ) Weight = 10.0; diff --git a/Scripts/Items/Construction/Misc/Screens.cs b/Scripts/Items/Construction/Misc/Screens.cs index 3a228082e..c538d4e22 100644 --- a/Scripts/Items/Construction/Misc/Screens.cs +++ b/Scripts/Items/Construction/Misc/Screens.cs @@ -4,12 +4,12 @@ namespace Server.Items { [Furniture] [Flipable( 0x24D0, 0x24D1, 0x24D2, 0x24D3, 0x24D4 )] - public class BambooScreen : BaseCraftableItem + public class BambooScreen : Item { [Constructable] - public BambooScreen() : base( 0x24D1 ) + public BambooScreen() : base(0x24D0) { - Weight = 1.0; + Weight = 20.0; } public BambooScreen(Serial serial) : base(serial) @@ -27,21 +27,19 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion - - if ( Weight == 20.0 ) - Weight = 1.0; + int version = reader.ReadInt(); + } } [Furniture] [Flipable( 0x24CB, 0x24CC, 0x24CD, 0x24CE, 0x24CF )] - public class ShojiScreen : BaseCraftableItem + public class ShojiScreen : Item { [Constructable] - public ShojiScreen() : base( 0x24CB ) + public ShojiScreen() : base(0x24CB) { - Weight = 1.0; + Weight = 20.0; } public ShojiScreen(Serial serial) : base(serial) @@ -59,10 +57,8 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion - - if ( Weight == 20.0 ) - Weight = 1.0; + int version = reader.ReadInt(); + } } diff --git a/Scripts/Items/Construction/Misc/Statues.cs b/Scripts/Items/Construction/Misc/Statues.cs index 04da029c8..22aedeeb5 100644 --- a/Scripts/Items/Construction/Misc/Statues.cs +++ b/Scripts/Items/Construction/Misc/Statues.cs @@ -2,10 +2,8 @@ using System; namespace Server.Items { - public class StatueSouth : BaseCraftableItem - { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - + public class StatueSouth : Item + { [Constructable] public StatueSouth() : base(0x139A) { @@ -29,14 +27,12 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } - public class StatueSouth2 : BaseCraftableItem - { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - + public class StatueSouth2 : Item + { [Constructable] public StatueSouth2() : base(0x1227) { @@ -60,11 +56,11 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } - public class StatueNorth : BaseCraftableItem + public class StatueNorth : Item { [Constructable] public StatueNorth() : base(0x139B) @@ -89,11 +85,11 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } - public class StatueWest : BaseCraftableItem + public class StatueWest : Item { [Constructable] public StatueWest() : base(0x1226) @@ -118,11 +114,11 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } - public class StatueEast : BaseCraftableItem + public class StatueEast : Item { [Constructable] public StatueEast() : base(0x139C) @@ -147,14 +143,12 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } - public class StatueEast2 : BaseCraftableItem - { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - + public class StatueEast2 : Item + { [Constructable] public StatueEast2() : base(0x1224) { @@ -178,14 +172,12 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } - public class StatueSouthEast : BaseCraftableItem - { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - + public class StatueSouthEast : Item + { [Constructable] public StatueSouthEast() : base(0x1225) { @@ -209,14 +201,12 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } - public class BustSouth : BaseCraftableItem - { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - + public class BustSouth : Item + { [Constructable] public BustSouth() : base(0x12CB) { @@ -240,14 +230,12 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } - public class BustEast : BaseCraftableItem - { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - + public class BustEast : Item + { [Constructable] public BustEast() : base(0x12CA) { @@ -271,14 +259,12 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } - public class StatuePegasus : BaseCraftableItem + public class StatuePegasus : Item { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - [Constructable] public StatuePegasus() : base(0x139D) { @@ -302,14 +288,12 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } - public class StatuePegasus2 : BaseCraftableItem + public class StatuePegasus2 : Item { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - [Constructable] public StatuePegasus2() : base(0x1228) { @@ -333,14 +317,12 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } - public class SmallTowerSculpture : BaseCraftableItem + public class SmallTowerSculpture : Item { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - [Constructable] public SmallTowerSculpture() : base(0x241A) { @@ -362,7 +344,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } } \ No newline at end of file diff --git a/Scripts/Items/Construction/Misc/Vase.cs b/Scripts/Items/Construction/Misc/Vase.cs index 497ab10ed..87778301b 100644 --- a/Scripts/Items/Construction/Misc/Vase.cs +++ b/Scripts/Items/Construction/Misc/Vase.cs @@ -2,10 +2,8 @@ using System; namespace Server.Items { - public class Vase : BaseCraftableItem + public class Vase : Item { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - [Constructable] public Vase() : base( 0xB46 ) { @@ -27,14 +25,12 @@ namespace Server.Items { base.Deserialize( reader ); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } - public class LargeVase : BaseCraftableItem + public class LargeVase : Item { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - [Constructable] public LargeVase() : base( 0xB45 ) { @@ -56,14 +52,12 @@ namespace Server.Items { base.Deserialize( reader ); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } - public class SmallUrn : BaseCraftableItem + public class SmallUrn : Item { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - [Constructable] public SmallUrn() : base( 0x241C ) { @@ -85,7 +79,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } } \ No newline at end of file diff --git a/Scripts/Items/Construction/Tables/Tables.cs b/Scripts/Items/Construction/Tables/Tables.cs index 43bfc33f1..22078e896 100644 --- a/Scripts/Items/Construction/Tables/Tables.cs +++ b/Scripts/Items/Construction/Tables/Tables.cs @@ -4,7 +4,7 @@ namespace Server.Items { [Furniture] - public class ElegantLowTable : BaseCraftableItem + public class ElegantLowTable : Item { [Constructable] public ElegantLowTable() : base(0x2819) @@ -27,12 +27,13 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); + } } [Furniture] - public class PlainLowTable : BaseCraftableItem + public class PlainLowTable : Item { [Constructable] public PlainLowTable() : base(0x281A) @@ -55,16 +56,17 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); + } } [Furniture] [Flipable(0xB90,0xB7D)] - public class LargeTable : BaseCraftableItem + public class LargeTable : Item { [Constructable] - public LargeTable() : base(0xB7D) + public LargeTable() : base(0xB90) { Weight = 1.0; } @@ -84,7 +86,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); if ( Weight == 4.0 ) Weight = 1.0; @@ -93,10 +95,10 @@ namespace Server.Items [Furniture] [Flipable(0xB35,0xB34)] - public class Nightstand : BaseCraftableItem + public class Nightstand : Item { [Constructable] - public Nightstand() : base(0xB34) + public Nightstand() : base(0xB35) { Weight = 1.0; } @@ -116,7 +118,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); if ( Weight == 4.0 ) Weight = 1.0; @@ -125,10 +127,10 @@ namespace Server.Items [Furniture] [Flipable(0xB8F,0xB7C)] - public class YewWoodTable : BaseCraftableItem + public class YewWoodTable : Item { [Constructable] - public YewWoodTable() : base(0xB7C) + public YewWoodTable() : base(0xB8F) { Weight = 1.0; } @@ -148,7 +150,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); if ( Weight == 4.0 ) Weight = 1.0; diff --git a/Scripts/Items/Construction/Tables/WritingTable.cs b/Scripts/Items/Construction/Tables/WritingTable.cs index 22f3c7aef..3ece21dab 100644 --- a/Scripts/Items/Construction/Tables/WritingTable.cs +++ b/Scripts/Items/Construction/Tables/WritingTable.cs @@ -4,7 +4,7 @@ namespace Server.Items { [Furniture] [Flipable(0xB4A,0xB49, 0xB4B, 0xB4C)] - public class WritingTable : BaseCraftableItem + public class WritingTable : Item { [Constructable] public WritingTable() : base(0xB4A) @@ -27,7 +27,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); if ( Weight == 4.0 ) Weight = 1.0; diff --git a/Scripts/Items/Containers/Container.cs b/Scripts/Items/Containers/Container.cs index 91bfd4686..8453f12ae 100644 --- a/Scripts/Items/Containers/Container.cs +++ b/Scripts/Items/Containers/Container.cs @@ -139,250 +139,7 @@ namespace Server.Items public BaseContainer( Serial serial ) : base( serial ) { } - - #region Consume[...] - public int ConsumeTotalGroupedCompared( Type[][] types, int[] amounts, bool recurse, OnItemConsumed callback, CheckItemGroup grouper, Item compareTo ) - { - if ( types.Length != amounts.Length ) - throw new ArgumentException(); - else if ( grouper == null ) - throw new ArgumentNullException(); - Item[][][] items = new Item[types.Length][][]; - int[] totals = new int[types.Length]; - - bool hasComparer = false; - - Item originalComparer = compareTo; - - int comparerType = -1; - - for ( int i = 0; i < types.Length; ++i ) - { - Item[] typedItems = FindItemsByType( types[i], recurse ); - - List> groups = new List>(); - - int idx = 0; - - if ( originalComparer != null ) - { - for ( int j = 0; j < types[i].Length; ++j ) - { - if ( originalComparer.GetType() == types[i][j] ) - { - hasComparer = true; - compareTo = originalComparer; - comparerType = i; - break; - } - } - } - - while( idx < typedItems.Length ) - { - Item a = typedItems[idx++]; - List group = new List(); - - if ( !hasComparer ) - { - compareTo = a; - group.Add( a ); - } - else if ( grouper( compareTo, a ) == 0 ) - group.Add( a ); - - while( idx < typedItems.Length ) - { - Item b = typedItems[idx]; - int v = grouper( compareTo, b ); - - if( v == 0 ) - group.Add( b ); - else - break; - - ++idx; - } - - groups.Add( group ); - } - - compareTo = originalComparer; - hasComparer = false; - - items[i] = new Item[groups.Count][]; - - bool hasEnough = false; - - for ( int j = 0; j < groups.Count; ++j ) - { - items[i][j] = groups[j].ToArray(); - - for ( int k = 0; k < items[i][j].Length; ++k ) - totals[i] += items[i][j][k].Amount; - } - - if ( totals[i] >= amounts[i] ) - hasEnough = true; - - if ( !hasEnough ) - return i; - } - - - for ( int i = 0; i < items.Length; ++i ) - { - int need = amounts[i]; - - if ( originalComparer != null && comparerType == i ) - { - object parent = originalComparer.RootParent; - - if ( parent is Mobile ) - { - Mobile m = (Mobile)parent; - - if ( this.RootParent is Mobile && m == (Mobile)this.RootParent ) - ConsumeNeeded( ref need, originalComparer, callback ); - } - } - - for ( int j = 0; j < items[i].Length && need > 0; ++j ) - { - if ( totals[i] >= amounts[i] ) - { - for ( int k = 0; k < items[i][j].Length && need > 0; ++k ) - { - Item item = items[i][j][k]; - - if ( !item.Deleted ) - ConsumeNeeded( ref need, item, callback ); - } - } - } - } - - return -1; - } - - private void ConsumeNeeded( ref int need, Item item, OnItemConsumed callback ) - { - int theirAmount = item.Amount; - - if ( theirAmount < need ) - { - if ( callback != null ) - callback( item, theirAmount ); - - item.Delete(); - need -= theirAmount; - } - else - { - if ( callback != null ) - callback( item, need ); - - item.Consume( need ); - need = 0; - } - } - #endregion - - #region Get[Compared]Amount - public int GetComparedGroupAmount( Type[] types, bool recurse, CheckItemGroup grouper, Item compareTo ) - { - if( grouper == null ) - throw new ArgumentNullException(); - - Item[] typedItems = FindItemsByType( types, recurse ); - - bool hasComparer = false; - - if ( compareTo != null ) - { - for ( int i = 0; i < types.Length; ++i ) - { - if ( compareTo.GetType() == types[i] ) - { - hasComparer = true; - break; - } - } - } - - List> groups = new List>(); - - int idx = 0; - - while( idx < typedItems.Length ) - { - Item a = typedItems[idx++]; - List group = new List(); - - if ( !hasComparer ) - { - compareTo = a; - group.Add( a ); - } - else if ( grouper( compareTo, a ) == 0 ) - group.Add( a ); - - while( idx < typedItems.Length ) - { - Item b = typedItems[idx]; - int v = grouper( compareTo, b ); - - if( v == 0 ) - group.Add( b ); - else - break; - - ++idx; - } - - groups.Add( group ); - } - - int total = 0; - - for( int j = 0; j < groups.Count; ++j ) - { - Item[] items = groups[j].ToArray(); - - for( int k = 0; k < items.Length; ++k ) - total += items[k].Amount; - } - - return total; - } - - public int GetAmountCompared( Type[] types, CheckItemGroup grouper, Item compareTo ) - { - return GetAmountCompared( types, grouper, compareTo, true ); - } - - public int GetAmountCompared( Type[] types, CheckItemGroup grouper, Item compareTo, bool recurse ) - { - Item[] items = FindItemsByType( types, recurse ); - - int amount = 0; - - for ( int i = 0; i < items.Length; ++i ) - { - if ( compareTo == null ) - { - compareTo = items[i]; - amount += items[i].Amount; - } - else if ( grouper( compareTo, items[i] ) == 0 ) - amount += items[i].Amount; - } - - return amount; - } - #endregion - /* Note: base class insertion; we cannot serialize anything here */ public override void Serialize( GenericWriter writer ) { @@ -717,7 +474,7 @@ namespace Server.Items } } - public class Barrel : BaseFurnitureContainer + public class Barrel : BaseContainer { [Constructable] public Barrel() : base( 0xE77 ) @@ -740,14 +497,14 @@ namespace Server.Items { base.Deserialize( reader ); - int version = ( InheritsBaseCont ? OldVersion : reader.ReadInt() ); //Required for BaseFurnitureContainer insertion + int version = reader.ReadInt(); if ( Weight == 0.0 ) Weight = 25.0; } } - public class Keg : BaseFurnitureContainer + public class Keg : BaseContainer { [Constructable] public Keg() : base( 0xE7F ) @@ -770,7 +527,7 @@ namespace Server.Items { base.Deserialize( reader ); - int version = ( InheritsBaseCont ? OldVersion : reader.ReadInt() ); //Required for BaseFurnitureContainer insertion + int version = reader.ReadInt(); } } @@ -833,7 +590,7 @@ namespace Server.Items public class WoodenBox : LockableContainer { [Constructable] - public WoodenBox() : base( 0xE7D ) + public WoodenBox() : base( 0x9AA ) { Weight = 4.0; } @@ -862,9 +619,9 @@ namespace Server.Items public class SmallCrate : LockableContainer { [Constructable] - public SmallCrate() : base( 0xE7E ) + public SmallCrate() : base( 0x9A9 ) { - Weight = 1.0; + Weight = 2.0; } public SmallCrate( Serial serial ) : base( serial ) @@ -884,8 +641,8 @@ namespace Server.Items int version = reader.ReadInt(); - if ( Weight == 4.0 || Weight == 2.0 ) - Weight = 1.0; + if ( Weight == 4.0 ) + Weight = 2.0; } } @@ -894,9 +651,9 @@ namespace Server.Items public class MediumCrate : LockableContainer { [Constructable] - public MediumCrate() : base( 0xE3E ) + public MediumCrate() : base( 0xE3F ) { - Weight = 1.0; + Weight = 2.0; } public MediumCrate( Serial serial ) : base( serial ) @@ -916,8 +673,8 @@ namespace Server.Items int version = reader.ReadInt(); - if ( Weight == 6.0 || Weight == 2.0 ) - Weight = 1.0; + if ( Weight == 6.0 ) + Weight = 2.0; } } @@ -926,7 +683,7 @@ namespace Server.Items public class LargeCrate : LockableContainer { [Constructable] - public LargeCrate() : base( 0xE3C ) + public LargeCrate() : base( 0xE3D ) { Weight = 1.0; } @@ -957,8 +714,6 @@ namespace Server.Items [Flipable( 0x9A8, 0xE80 )] public class MetalBox : LockableContainer { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - [Constructable] public MetalBox() : base( 0x9A8 ) { @@ -990,8 +745,6 @@ namespace Server.Items [Flipable( 0x9AB, 0xE7C )] public class MetalChest : LockableContainer { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - [Constructable] public MetalChest() : base( 0x9AB ) { @@ -1023,8 +776,6 @@ namespace Server.Items [Flipable( 0xE41, 0xE40 )] public class MetalGoldenChest : LockableContainer { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - [Constructable] public MetalGoldenChest() : base( 0xE41 ) { @@ -1053,13 +804,13 @@ namespace Server.Items } [Furniture] - [Flipable( 0xE43, 0xE42 )] + [Flipable( 0xe43, 0xe42 )] public class WoodenChest : LockableContainer { [Constructable] - public WoodenChest() : base( 0xE42 ) + public WoodenChest() : base( 0xe43 ) { - Weight = 1.0; + Weight = 2.0; } public WoodenChest( Serial serial ) : base( serial ) @@ -1079,8 +830,8 @@ namespace Server.Items int version = reader.ReadInt(); - if ( Weight == 15.0 || Weight == 2.0 ) - Weight = 1.0; + if ( Weight == 15.0 ) + Weight = 2.0; } } @@ -1089,7 +840,7 @@ namespace Server.Items public class PlainWoodenChest : LockableContainer { [Constructable] - public PlainWoodenChest() : base( 0x280C ) + public PlainWoodenChest() : base( 0x280B ) { } @@ -1120,7 +871,7 @@ namespace Server.Items public class OrnateWoodenChest : LockableContainer { [Constructable] - public OrnateWoodenChest() : base( 0x280E ) + public OrnateWoodenChest() : base( 0x280D ) { } @@ -1151,7 +902,7 @@ namespace Server.Items public class GildedWoodenChest : LockableContainer { [Constructable] - public GildedWoodenChest() : base( 0x2810 ) + public GildedWoodenChest() : base( 0x280F ) { } @@ -1182,7 +933,7 @@ namespace Server.Items public class WoodenFootLocker : LockableContainer { [Constructable] - public WoodenFootLocker() : base( 0x2812 ) + public WoodenFootLocker() : base( 0x2811 ) { GumpID = 0x10B; } @@ -1217,7 +968,7 @@ namespace Server.Items public class FinishedWoodenChest : LockableContainer { [Constructable] - public FinishedWoodenChest() : base( 0x2814 ) + public FinishedWoodenChest() : base( 0x2813 ) { } diff --git a/Scripts/Items/Containers/FillableContainers.cs b/Scripts/Items/Containers/FillableContainers.cs index 6ef8afeab..b3bbd29fd 100644 --- a/Scripts/Items/Containers/FillableContainers.cs +++ b/Scripts/Items/Containers/FillableContainers.cs @@ -407,8 +407,6 @@ namespace Server.Items [Flipable( 0x9A8, 0xE80 )] public class FillableMetalBox : FillableContainer { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - [Constructable] public FillableMetalBox() : base( 0x9A8 ) { @@ -470,8 +468,6 @@ namespace Server.Items [Flipable( 0x9AB, 0xE7C )] public class FillableMetalChest : FillableContainer { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - [Constructable] public FillableMetalChest() : base( 0x9AB ) { @@ -502,8 +498,6 @@ namespace Server.Items [Flipable( 0xE41, 0xE40 )] public class FillableMetalGoldenChest : FillableContainer { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - [Constructable] public FillableMetalGoldenChest() : base( 0xE41 ) { diff --git a/Scripts/Items/Containers/FurnitureContainer.cs b/Scripts/Items/Containers/FurnitureContainer.cs index 5b43e916c..9e3d01169 100644 --- a/Scripts/Items/Containers/FurnitureContainer.cs +++ b/Scripts/Items/Containers/FurnitureContainer.cs @@ -1,162 +1,17 @@ using System; using System.Collections.Generic; using Server; -using Server.Misc; using Server.Multis; using Server.Network; -using Server.Engines.Craft; namespace Server.Items { - public abstract class BaseFurnitureContainer : BaseContainer, ICraftable - { - private Mobile m_Crafter; - private CraftQuality m_Quality; - private CraftResource m_Resource; - - [CommandProperty( AccessLevel.GameMaster )] - public Mobile Crafter - { - get { return m_Crafter; } - set { m_Crafter = value; InvalidateProperties(); } - } - - [CommandProperty( AccessLevel.GameMaster )] - public CraftQuality Quality - { - get { return m_Quality; } - set { m_Quality = value; InvalidateProperties(); } - } - - [CommandProperty( AccessLevel.GameMaster )] - public CraftResource Resource - { - get { return m_Resource; } - set - { - if ( m_Resource != value ) - { - m_Resource = value; - Hue = CraftResources.GetHue( m_Resource ); - InvalidateProperties(); - } - } - } - - public virtual CraftResource DefaultResource{ get{ return CraftResource.RegularWood; } } - public virtual bool DisplaysResource{ get{ return true; } } - public virtual bool DisplaysMakersMark{ get{ return true; } } - - #region Old Container Serialization Vars - /* DO NOT USE! Only used in serialization of furniture containers that originally derived from BaseContainer */ - private bool m_InheritsBaseCont; - private int m_OldVersion; - - protected bool InheritsBaseCont - { - get{ return m_InheritsBaseCont; } - } - - protected int OldVersion - { - get{ return m_OldVersion; } - } - #endregion - - public BaseFurnitureContainer( int itemID ) : base( itemID ) - { - m_Quality = CraftQuality.Regular; - Resource = DefaultResource; - } - - public BaseFurnitureContainer(Serial serial) : base(serial) - { - } - - public override void GetProperties( ObjectPropertyList list ) - { - base.GetProperties( list ); - - if ( m_Crafter != null && DisplaysMakersMark ) - list.Add( 1050043, m_Crafter.Name ); // crafted by ~1_NAME~ - - if ( m_Quality == CraftQuality.Exceptional ) - list.Add( 1060636 ); // exceptional - - if( ( m_Resource >= CraftResource.OakWood && m_Resource <= CraftResource.Frostwood ) && Hue == CraftResources.GetHue( m_Resource ) && DisplaysResource ) - list.Add( CraftResources.GetLocalizationNumber( m_Resource ) ); // resource name - } - - public override void Serialize(GenericWriter writer) - { - base.Serialize(writer); - - writer.Write((int) 2); - - writer.Write( m_Crafter ); - writer.WriteEncodedInt( (int) m_Quality ); - writer.WriteEncodedInt( (int) m_Resource ); - } - - public override void Deserialize(GenericReader reader) - { - base.Deserialize(reader); - - int version = reader.ReadInt(); - - switch ( version ) - { - case 2: - { - m_Crafter = reader.ReadMobile(); - m_Quality = (CraftQuality)reader.ReadEncodedInt(); - m_Resource = (CraftResource)reader.ReadEncodedInt(); - break; - } - case 1: //Captcha for EmptyBookcase - case 0: - { - m_InheritsBaseCont = true; - m_OldVersion = version; - m_Quality = CraftQuality.Regular; - m_Resource = DefaultResource; - break; - } - } - } - - public virtual int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue ) - { - if ( Core.ML ) - { - Quality = (CraftQuality)quality; - - if ( makersMark ) - Crafter = from; - - Type resourceType = typeRes; - - if ( resourceType == null ) - resourceType = craftItem.Resources.GetAt( 0 ).ItemType; - - Resource = CraftResources.GetFromType( resourceType ); - - CraftContext context = craftSystem.GetContext( from ); - - if ( context != null && context.DoNotColor ) - Hue = 0; - } - - return quality; - } - } - [Furniture] [Flipable( 0x2815, 0x2816 )] - public class TallCabinet : BaseFurnitureContainer + public class TallCabinet : BaseContainer { [Constructable] - public TallCabinet() : base( 0x2816 ) + public TallCabinet() : base( 0x2815 ) { Weight = 1.0; } @@ -174,16 +29,16 @@ namespace Server.Items public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); - int version = ( InheritsBaseCont ? OldVersion : reader.ReadInt() ); //Required for BaseFurnitureContainer insertion + int version = reader.ReadInt(); } } [Furniture] [Flipable( 0x2817, 0x2818 )] - public class ShortCabinet : BaseFurnitureContainer + public class ShortCabinet : BaseContainer { [Constructable] - public ShortCabinet() : base( 0x2818 ) + public ShortCabinet() : base( 0x2817 ) { Weight = 1.0; } @@ -201,19 +56,19 @@ namespace Server.Items public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); - int version = ( InheritsBaseCont ? OldVersion : reader.ReadInt() ); //Required for BaseFurnitureContainer insertion + int version = reader.ReadInt(); } } [Furniture] [Flipable( 0x2857, 0x2858 )] - public class RedArmoire : BaseFurnitureContainer + public class RedArmoire : BaseContainer { [Constructable] - public RedArmoire() : base( 0x2858 ) + public RedArmoire() : base( 0x2857 ) { - Weight = 10.0; + Weight = 1.0; } public RedArmoire( Serial serial ) : base( serial ) @@ -229,21 +84,18 @@ namespace Server.Items public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); - int version = ( InheritsBaseCont ? OldVersion : reader.ReadInt() ); //Required for BaseFurnitureContainer insertion - - if ( Weight == 1.0 ) - Weight = 10.0; + int version = reader.ReadInt(); } } [Furniture] [Flipable( 0x285D, 0x285E )] - public class CherryArmoire : BaseFurnitureContainer + public class CherryArmoire : BaseContainer { [Constructable] - public CherryArmoire() : base( 0x285E ) + public CherryArmoire() : base( 0x285D ) { - Weight = 10.0; + Weight = 1.0; } public CherryArmoire( Serial serial ) : base( serial ) @@ -259,21 +111,18 @@ namespace Server.Items public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); - int version = ( InheritsBaseCont ? OldVersion : reader.ReadInt() ); //Required for BaseFurnitureContainer insertion - - if ( Weight == 1.0 ) - Weight = 10.0; + int version = reader.ReadInt(); } } [Furniture] [Flipable( 0x285B, 0x285C )] - public class MapleArmoire : BaseFurnitureContainer + public class MapleArmoire : BaseContainer { [Constructable] - public MapleArmoire() : base( 0x285C ) + public MapleArmoire() : base( 0x285B ) { - Weight = 10.0; + Weight = 1.0; } public MapleArmoire( Serial serial ) : base( serial ) @@ -289,21 +138,18 @@ namespace Server.Items public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); - int version = ( InheritsBaseCont ? OldVersion : reader.ReadInt() ); //Required for BaseFurnitureContainer insertion - - if ( Weight == 1.0 ) - Weight = 10.0; + int version = reader.ReadInt(); } } [Furniture] [Flipable( 0x2859, 0x285A )] - public class ElegantArmoire : BaseFurnitureContainer + public class ElegantArmoire : BaseContainer { [Constructable] - public ElegantArmoire() : base( 0x285A ) + public ElegantArmoire() : base( 0x2859 ) { - Weight = 10.0; + Weight = 1.0; } public ElegantArmoire( Serial serial ) : base( serial ) @@ -319,19 +165,16 @@ namespace Server.Items public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); - int version = ( InheritsBaseCont ? OldVersion : reader.ReadInt() ); //Required for BaseFurnitureContainer insertion - - if ( Weight == 1.0 ) - Weight = 10.0; + int version = reader.ReadInt(); } } [Furniture] - [Flipable( 0xA97, 0xA99, 0xA98, 0xA9A, 0xA9B, 0xA9C )] - public class FullBookcase : BaseFurnitureContainer + [Flipable( 0xa97, 0xa99, 0xa98, 0xa9a, 0xa9b, 0xa9c )] + public class FullBookcase : BaseContainer { [Constructable] - public FullBookcase() : base( 0xA99 ) + public FullBookcase() : base( 0xA97 ) { Weight = 1.0; } @@ -349,16 +192,16 @@ namespace Server.Items public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); - int version = ( InheritsBaseCont ? OldVersion : reader.ReadInt() ); //Required for BaseFurnitureContainer insertion + int version = reader.ReadInt(); } } [Furniture] - [Flipable( 0xA9D, 0xA9E )] - public class EmptyBookcase : BaseFurnitureContainer + [Flipable( 0xa9d, 0xa9e )] + public class EmptyBookcase : BaseContainer { [Constructable] - public EmptyBookcase() : base( 0xA9E ) + public EmptyBookcase() : base( 0xA9D ) { } @@ -376,7 +219,7 @@ namespace Server.Items public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); - int version = ( InheritsBaseCont ? OldVersion : reader.ReadInt() ); //Required for BaseFurnitureContainer insertion + int version = reader.ReadInt(); if ( version == 0 && Weight == 1.0 ) Weight = -1; @@ -384,11 +227,11 @@ namespace Server.Items } [Furniture] - [Flipable( 0xA2C, 0xA34 )] - public class Drawer : BaseFurnitureContainer + [Flipable( 0xa2c, 0xa34 )] + public class Drawer : BaseContainer { [Constructable] - public Drawer() : base( 0xA34 ) + public Drawer() : base( 0xA2C ) { Weight = 1.0; } @@ -406,16 +249,16 @@ namespace Server.Items public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); - int version = ( InheritsBaseCont ? OldVersion : reader.ReadInt() ); //Required for BaseFurnitureContainer insertion + int version = reader.ReadInt(); } } [Furniture] - [Flipable( 0xA30, 0xA38 )] - public class FancyDrawer : BaseFurnitureContainer + [Flipable( 0xa30, 0xa38 )] + public class FancyDrawer : BaseContainer { [Constructable] - public FancyDrawer() : base( 0xA38 ) + public FancyDrawer() : base( 0xA30 ) { Weight = 1.0; } @@ -430,81 +273,19 @@ namespace Server.Items writer.Write( (int) 0 ); // version } - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); - int version = ( InheritsBaseCont ? OldVersion : reader.ReadInt() ); //Required for BaseFurnitureContainer insertion - } - } - - [Furniture] - [Flipable( 0x2DF1, 0x2DF2 )] - public class OrnateElvenChest : BaseFurnitureContainer - { - [Constructable] - public OrnateElvenChest() : base( 0x2DF1 ) - { - Weight = 1.0; - GumpID = 0x10C; - } - - public OrnateElvenChest( Serial serial ) : base( serial ) - { - } - - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); - writer.Write( (int) 1 ); // version - } - public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); - - if ( version < 1 ) - GumpID = 0x10C; - } - } - - [Furniture] - [Flipable( 0x2DF3, 0x2DF4 )] - public class OrnateElvenBox : BaseFurnitureContainer - { - [Constructable] - public OrnateElvenBox() : base( 0x2DF3 ) - { - Weight = 1.0; - GumpID = 0x10C; - } - - public OrnateElvenBox( Serial serial ) : base( serial ) - { - } - - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); - writer.Write( (int) 1 ); // version - } - - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); - int version = reader.ReadInt(); - - if ( version < 1 ) - GumpID = 0x10C; } } [Furniture] - [Flipable( 0xA4F, 0xA53 )] - public class Armoire : BaseFurnitureContainer + [Flipable( 0xa4f, 0xa53 )] + public class Armoire : BaseContainer { [Constructable] - public Armoire() : base( 0xA53 ) + public Armoire() : base( 0xA4F ) { Weight = 1.0; } @@ -528,18 +309,18 @@ namespace Server.Items public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); - int version = ( InheritsBaseCont ? OldVersion : reader.ReadInt() ); //Required for BaseFurnitureContainer insertion + int version = reader.ReadInt(); DynamicFurniture.Close( this ); } } [Furniture] - [Flipable( 0xA4D, 0xA51 )] - public class FancyArmoire : BaseFurnitureContainer + [Flipable( 0xa4d, 0xa51 )] + public class FancyArmoire : BaseContainer { [Constructable] - public FancyArmoire() : base( 0xA51 ) + public FancyArmoire() : base( 0xA4D ) { Weight = 1.0; } @@ -563,7 +344,7 @@ namespace Server.Items public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); - int version = ( InheritsBaseCont ? OldVersion : reader.ReadInt() ); //Required for BaseFurnitureContainer insertion + int version = reader.ReadInt(); DynamicFurniture.Close( this ); } diff --git a/Scripts/Items/Containers/LockableContainer.cs b/Scripts/Items/Containers/LockableContainer.cs index 0e42044b6..c42004287 100644 --- a/Scripts/Items/Containers/LockableContainer.cs +++ b/Scripts/Items/Containers/LockableContainer.cs @@ -12,9 +12,6 @@ namespace Server.Items private uint m_KeyValue; private Mobile m_Picker; private bool m_TrapOnLockpick; - private CraftQuality m_Quality; - private Mobile m_Crafter; - private CraftResource m_Resource; [CommandProperty( AccessLevel.GameMaster )] public Mobile Picker @@ -119,39 +116,12 @@ namespace Server.Items m_TrapOnLockpick = value; } } - - [CommandProperty( AccessLevel.GameMaster )] - public CraftQuality Quality - { - get{ return m_Quality; } - set{ m_Quality = value; InvalidateProperties(); } - } - - [CommandProperty( AccessLevel.GameMaster )] - public Mobile Crafter - { - get{ return m_Crafter; } - set{ m_Crafter = value; InvalidateProperties(); } - } - - [CommandProperty( AccessLevel.GameMaster )] - public CraftResource Resource - { - get{ return m_Resource; } - set{ m_Resource = value; Hue = CraftResources.GetHue( m_Resource ); InvalidateProperties(); } - } - - public virtual CraftResource DefaultResource{ get{ return CraftResource.RegularWood; } } public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); - writer.Write( (int) 7 ); // version - - writer.Write( (int)m_Quality ); - writer.Write( (int)m_Resource ); - writer.WriteMobile( m_Crafter ); + writer.Write( (int) 6 ); // version writer.Write( m_IsShipwreckedItem ); @@ -174,13 +144,6 @@ namespace Server.Items switch ( version ) { - case 7: - { - m_Quality = (CraftQuality)reader.ReadInt(); - m_Resource = (CraftResource)reader.ReadInt(); - m_Crafter = reader.ReadMobile(); - goto case 6; - } case 6: { m_IsShipwreckedItem = reader.ReadBool(); @@ -235,12 +198,6 @@ namespace Server.Items m_RequiredSkill = m_LockLevel; } } - - if ( version < 7 ) - { - m_Quality = CraftQuality.Regular; - m_Resource = DefaultResource; - } m_Locked = reader.ReadBool(); @@ -251,8 +208,6 @@ namespace Server.Items public LockableContainer( int itemID ) : base( itemID ) { - m_Quality = CraftQuality.Regular; - Resource = DefaultResource; m_MaxLockLevel = 100; } @@ -260,20 +215,6 @@ namespace Server.Items { } - public override void GetProperties( ObjectPropertyList list ) - { - base.GetProperties( list ); - - if ( m_Crafter != null ) - list.Add( 1050043, m_Crafter.Name ); // crafted by ~1_NAME~ - - if ( m_Quality == CraftQuality.Exceptional ) - list.Add( 1060636 ); // exceptional - - if( ( m_Resource >= CraftResource.OakWood && m_Resource <= CraftResource.Frostwood ) && Hue == CraftResources.GetHue( m_Resource ) ) - list.Add( CraftResources.GetLocalizationNumber( m_Resource ) ); // resource name - } - public override bool CheckContentDisplay( Mobile from ) { return !m_Locked && base.CheckContentDisplay( from ); @@ -419,26 +360,6 @@ namespace Server.Items public int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue ) { - if ( Core.ML ) - { - Quality = (CraftQuality)quality; - - Type resourceType = typeRes; - - if ( resourceType == null ) - resourceType = craftItem.Resources.GetAt( 0 ).ItemType; - - Resource = CraftResources.GetFromType( resourceType ); - - CraftContext context = craftSystem.GetContext( from ); - - if ( context != null && context.DoNotColor ) - Resource = DefaultResource; - - if ( makersMark ) - Crafter = from; - } - if ( from.CheckSkill( SkillName.Tinkering, -5.0, 15.0 ) ) { from.SendLocalizedMessage( 500636 ); // Your tinker skill was sufficient to make the item lockable. @@ -471,7 +392,7 @@ namespace Server.Items from.SendLocalizedMessage( 500637 ); // Your tinker skill was insufficient to make the item lockable. } - return quality; + return 1; } #endregion diff --git a/Scripts/Items/Containers/ParagonChest.cs b/Scripts/Items/Containers/ParagonChest.cs index f0163d562..e7bc80394 100644 --- a/Scripts/Items/Containers/ParagonChest.cs +++ b/Scripts/Items/Containers/ParagonChest.cs @@ -12,8 +12,6 @@ namespace Server.Items [Flipable] public class ParagonChest : LockableContainer { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - private static int[] m_ItemIDs = new int[] { 0x9AB, 0xE40, 0xE41, 0xE7C diff --git a/Scripts/Items/Containers/TreasureChest.cs b/Scripts/Items/Containers/TreasureChest.cs index 73d9106a2..87b83d48b 100644 --- a/Scripts/Items/Containers/TreasureChest.cs +++ b/Scripts/Items/Containers/TreasureChest.cs @@ -36,8 +36,6 @@ namespace Server.Items [FlipableAttribute( 0xe41, 0xe40 )] public class MetalGoldenTreasureChest : BaseTreasureChest { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - [Constructable] public MetalGoldenTreasureChest() : base( 0xE41 ) { @@ -65,8 +63,6 @@ namespace Server.Items [FlipableAttribute( 0x9ab, 0xe7c )] public class MetalTreasureChest : BaseTreasureChest { - public override CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - [Constructable] public MetalTreasureChest() : base( 0x9AB ) { diff --git a/Scripts/Items/Games/Backgammon.cs b/Scripts/Items/Games/Backgammon.cs index 1e4ab84c2..0b906c3bd 100644 --- a/Scripts/Items/Games/Backgammon.cs +++ b/Scripts/Items/Games/Backgammon.cs @@ -4,7 +4,7 @@ using System.Collections; namespace Server.Items { [Flipable( 0xE1C, 0xFAD )] - public class Backgammon : BaseGameBoard + public class Backgammon : BaseBoard { [Constructable] public Backgammon() : base( 0xE1C ) diff --git a/Scripts/Items/Games/BaseGameBoard.cs b/Scripts/Items/Games/BaseBoard.cs similarity index 83% rename from Scripts/Items/Games/BaseGameBoard.cs rename to Scripts/Items/Games/BaseBoard.cs index 77860fb4c..2956b2446 100644 --- a/Scripts/Items/Games/BaseGameBoard.cs +++ b/Scripts/Items/Games/BaseBoard.cs @@ -10,7 +10,7 @@ using Server.Gumps; namespace Server.Items { - public abstract class BaseGameBoard : Container, ISecurable + public abstract class BaseBoard : Container, ISecurable { private SecureLevel m_Level; @@ -21,7 +21,7 @@ namespace Server.Items set{ m_Level = value; } } - public BaseGameBoard( int itemID ) : base( itemID ) + public BaseBoard( int itemID ) : base( itemID ) { CreatePieces(); @@ -51,7 +51,7 @@ namespace Server.Items public override bool IsDecoContainer{ get{ return false; } } - public BaseGameBoard( Serial serial ) : base( serial ) + public BaseBoard( Serial serial ) : base( serial ) { } @@ -124,7 +124,7 @@ namespace Server.Items SetSecureLevelEntry.AddTo( from, this, list ); } - public static bool ValidateDefault( Mobile from, BaseGameBoard board ) + public static bool ValidateDefault( Mobile from, BaseBoard board ) { if ( from.AccessLevel >= AccessLevel.GameMaster ) return true; @@ -151,9 +151,9 @@ namespace Server.Items public class DefaultEntry : ContextMenuEntry { private Mobile m_From; - private BaseGameBoard m_Board; + private BaseBoard m_Board; - public DefaultEntry( Mobile from, BaseGameBoard board ) : base( 6162, from.AccessLevel >= AccessLevel.GameMaster ? -1 : 1 ) + public DefaultEntry( Mobile from, BaseBoard board ) : base( 6162, from.AccessLevel >= AccessLevel.GameMaster ? -1 : 1 ) { m_From = from; m_Board = board; @@ -161,9 +161,9 @@ namespace Server.Items public override void OnClick() { - if ( BaseGameBoard.ValidateDefault( m_From, m_Board ) ) + if ( BaseBoard.ValidateDefault( m_From, m_Board ) ) m_Board.Reset(); } } } -} +} \ No newline at end of file diff --git a/Scripts/Items/Games/BasePiece.cs b/Scripts/Items/Games/BasePiece.cs index 6599bba9c..d22b06fb9 100644 --- a/Scripts/Items/Games/BasePiece.cs +++ b/Scripts/Items/Games/BasePiece.cs @@ -5,9 +5,9 @@ namespace Server.Items { public class BasePiece : Item { - private BaseGameBoard m_Board; + private BaseBoard m_Board; - public BaseGameBoard Board + public BaseBoard Board { get { return m_Board; } set { m_Board = value; } @@ -15,7 +15,7 @@ namespace Server.Items public override bool IsVirtualItem{ get{ return true; } } - public BasePiece( int itemID, BaseGameBoard board ) : base( itemID ) + public BasePiece( int itemID, BaseBoard board ) : base( itemID ) { m_Board = board; } @@ -42,7 +42,7 @@ namespace Server.Items { case 0: { - m_Board = (BaseGameBoard)reader.ReadItem(); + m_Board = (BaseBoard)reader.ReadItem(); if ( m_Board == null || Parent == null ) Delete(); diff --git a/Scripts/Items/Games/CheckerBoard.cs b/Scripts/Items/Games/CheckerBoard.cs index 12eb196b1..df7c3a50e 100644 --- a/Scripts/Items/Games/CheckerBoard.cs +++ b/Scripts/Items/Games/CheckerBoard.cs @@ -3,7 +3,7 @@ using System.Collections; namespace Server.Items { - public class CheckerBoard : BaseGameBoard + public class CheckerBoard : BaseBoard { public override int LabelNumber{ get{ return 1016449; } } // a checker board diff --git a/Scripts/Items/Games/CheckersPieces.cs b/Scripts/Items/Games/CheckersPieces.cs index cabcb37c1..895c2440a 100644 --- a/Scripts/Items/Games/CheckersPieces.cs +++ b/Scripts/Items/Games/CheckersPieces.cs @@ -10,7 +10,7 @@ namespace Server.Items get { return "white checker"; } } - public PieceWhiteChecker( BaseGameBoard board ) : base( 0x3584, board ) + public PieceWhiteChecker( BaseBoard board ) : base( 0x3584, board ) { } @@ -38,7 +38,7 @@ namespace Server.Items get { return "black checker"; } } - public PieceBlackChecker( BaseGameBoard board ) : base( 0x358B, board ) + public PieceBlackChecker( BaseBoard board ) : base( 0x358B, board ) { } diff --git a/Scripts/Items/Games/ChessPieces.cs b/Scripts/Items/Games/ChessPieces.cs index 2f341de65..bf3c197ea 100644 --- a/Scripts/Items/Games/ChessPieces.cs +++ b/Scripts/Items/Games/ChessPieces.cs @@ -10,7 +10,7 @@ namespace Server.Items get { return "white king"; } } - public PieceWhiteKing( BaseGameBoard board ) : base( 0x3587, board ) + public PieceWhiteKing( BaseBoard board ) : base( 0x3587, board ) { } @@ -38,7 +38,7 @@ namespace Server.Items get { return "black king"; } } - public PieceBlackKing( BaseGameBoard board ) : base( 0x358E, board ) + public PieceBlackKing( BaseBoard board ) : base( 0x358E, board ) { } @@ -66,7 +66,7 @@ namespace Server.Items get { return "white queen"; } } - public PieceWhiteQueen( BaseGameBoard board ) : base( 0x358A, board ) + public PieceWhiteQueen( BaseBoard board ) : base( 0x358A, board ) { } @@ -94,7 +94,7 @@ namespace Server.Items get { return "black queen"; } } - public PieceBlackQueen( BaseGameBoard board ) : base( 0x3591, board ) + public PieceBlackQueen( BaseBoard board ) : base( 0x3591, board ) { } @@ -122,7 +122,7 @@ namespace Server.Items get { return "white rook"; } } - public PieceWhiteRook( BaseGameBoard board ) : base( 0x3586, board ) + public PieceWhiteRook( BaseBoard board ) : base( 0x3586, board ) { } @@ -150,7 +150,7 @@ namespace Server.Items get { return "black rook"; } } - public PieceBlackRook( BaseGameBoard board ) : base( 0x358D, board ) + public PieceBlackRook( BaseBoard board ) : base( 0x358D, board ) { } @@ -178,7 +178,7 @@ namespace Server.Items get { return "white bishop"; } } - public PieceWhiteBishop( BaseGameBoard board ) : base( 0x3585, board ) + public PieceWhiteBishop( BaseBoard board ) : base( 0x3585, board ) { } @@ -206,7 +206,7 @@ namespace Server.Items get { return "black bishop"; } } - public PieceBlackBishop( BaseGameBoard board ) : base( 0x358C, board ) + public PieceBlackBishop( BaseBoard board ) : base( 0x358C, board ) { } @@ -234,7 +234,7 @@ namespace Server.Items get { return "white knight"; } } - public PieceWhiteKnight( BaseGameBoard board ) : base( 0x3588, board ) + public PieceWhiteKnight( BaseBoard board ) : base( 0x3588, board ) { } @@ -262,7 +262,7 @@ namespace Server.Items get { return "black knight"; } } - public PieceBlackKnight( BaseGameBoard board ) : base( 0x358F, board ) + public PieceBlackKnight( BaseBoard board ) : base( 0x358F, board ) { } @@ -290,7 +290,7 @@ namespace Server.Items get { return "white pawn"; } } - public PieceWhitePawn( BaseGameBoard board ) : base( 0x3589, board ) + public PieceWhitePawn( BaseBoard board ) : base( 0x3589, board ) { } @@ -318,7 +318,7 @@ namespace Server.Items get { return "black pawn"; } } - public PieceBlackPawn( BaseGameBoard board ) : base( 0x3590, board ) + public PieceBlackPawn( BaseBoard board ) : base( 0x3590, board ) { } diff --git a/Scripts/Items/Games/Chessboard.cs b/Scripts/Items/Games/Chessboard.cs index 9dd325228..58747682a 100644 --- a/Scripts/Items/Games/Chessboard.cs +++ b/Scripts/Items/Games/Chessboard.cs @@ -3,7 +3,7 @@ using System.Collections; namespace Server.Items { - public class Chessboard : BaseGameBoard + public class Chessboard : BaseBoard { public override int LabelNumber{ get{ return 1016450; } } // a chessboard diff --git a/Scripts/Items/Jewels/BaseJewel.cs b/Scripts/Items/Jewels/BaseJewel.cs index a96d4fd76..a77835f30 100644 --- a/Scripts/Items/Jewels/BaseJewel.cs +++ b/Scripts/Items/Jewels/BaseJewel.cs @@ -17,7 +17,7 @@ namespace Server.Items Diamond } - public abstract class BaseJewel : Item, ICraftable, IAosAttributes + public abstract class BaseJewel : Item, ICraftable { private int m_MaxHitPoints; private int m_HitPoints; diff --git a/Scripts/Items/Lights/BaseLight.cs b/Scripts/Items/Lights/BaseLight.cs index 6a72b3a95..342a57675 100644 --- a/Scripts/Items/Lights/BaseLight.cs +++ b/Scripts/Items/Lights/BaseLight.cs @@ -1,10 +1,9 @@ using System; using Server; -using Server.Engines.Craft; namespace Server.Items { - public abstract class BaseLight : Item, ICraftable + public abstract class BaseLight : Item { private Timer m_Timer; private DateTime m_End; @@ -13,10 +12,6 @@ namespace Server.Items private bool m_Protected = false; private TimeSpan m_Duration = TimeSpan.Zero; - private Mobile m_Crafter; - private CraftQuality m_Quality; - private CraftResource m_Resource; - public abstract int LitItemID{ get; } public virtual int UnlitItemID{ get { return 0; } } @@ -27,39 +22,6 @@ namespace Server.Items public virtual int BurntOutSound{ get { return 0x4b8; } } public static readonly bool Burnout = false; - - public virtual CraftResource DefaultResource{ get{ return CraftResource.Iron; } } - public virtual bool DisplaysResource{ get{ return true; } } - public virtual bool DisplaysMakersMark{ get{ return true; } } - - [CommandProperty( AccessLevel.GameMaster )] - public Mobile Crafter - { - get { return m_Crafter; } - set { m_Crafter = value; InvalidateProperties(); } - } - - [CommandProperty( AccessLevel.GameMaster )] - public CraftQuality Quality - { - get { return m_Quality; } - set { m_Quality = value; InvalidateProperties(); } - } - - [CommandProperty( AccessLevel.GameMaster )] - public CraftResource Resource - { - get { return m_Resource; } - set - { - if ( m_Resource != value ) - { - m_Resource = value; - Hue = CraftResources.GetHue( m_Resource ); - InvalidateProperties(); - } - } - } [CommandProperty( AccessLevel.GameMaster )] public bool Burning @@ -113,20 +75,6 @@ namespace Server.Items public BaseLight( Serial serial ) : base( serial ) { } - - public override void GetProperties( ObjectPropertyList list ) - { - base.GetProperties( list ); - - if ( m_Crafter != null && DisplaysMakersMark ) - list.Add( 1050043, m_Crafter.Name ); // crafted by ~1_NAME~ - - if ( m_Quality == CraftQuality.Exceptional ) - list.Add( 1060636 ); // exceptional - - if( ( m_Resource >= CraftResource.OakWood && m_Resource <= CraftResource.Frostwood ) && Hue == CraftResources.GetHue( m_Resource ) && DisplaysResource ) - list.Add( CraftResources.GetLocalizationNumber( m_Resource ) ); // resource name - } public virtual void PlayLitSound() { @@ -232,12 +180,7 @@ namespace Server.Items { base.Serialize( writer ); - writer.Write( (int) 1 ); - - writer.Write( m_Crafter ); - writer.WriteEncodedInt( (int) m_Quality ); - writer.WriteEncodedInt( (int) m_Resource ); - + writer.Write( (int) 0 ); writer.Write( m_BurntOut ); writer.Write( m_Burning ); writer.Write( m_Duration ); @@ -255,13 +198,6 @@ namespace Server.Items switch ( version ) { - case 1: - { - m_Crafter = reader.ReadMobile(); - m_Quality = (CraftQuality)reader.ReadEncodedInt(); - m_Resource = (CraftResource)reader.ReadEncodedInt(); - goto case 0; - } case 0: { m_BurntOut = reader.ReadBool(); @@ -275,12 +211,6 @@ namespace Server.Items break; } } - - if ( version < 1 ) - { - m_Quality = CraftQuality.Regular; - m_Resource = DefaultResource; - } } private class InternalTimer : Timer @@ -299,32 +229,5 @@ namespace Server.Items m_Light.Burn(); } } - - public virtual int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue ) - { - if ( Core.ML ) - { - Quality = (CraftQuality)quality; - - if ( makersMark ) - Crafter = from; - - Type resourceType = typeRes; - - if ( resourceType == null ) - resourceType = craftItem.Resources.GetAt( 0 ).ItemType; - - Resource = CraftResources.GetFromType( resourceType ); - - CraftContext context = craftSystem.GetContext( from ); - - if ( context != null && context.DoNotColor ) - Resource = DefaultResource; - } - else - Resource = DefaultResource; - - return quality; - } } } diff --git a/Scripts/Items/Lights/RedHangingLantern.cs b/Scripts/Items/Lights/RedHangingLantern.cs index 4ee29c3a8..1ed424694 100644 --- a/Scripts/Items/Lights/RedHangingLantern.cs +++ b/Scripts/Items/Lights/RedHangingLantern.cs @@ -28,16 +28,14 @@ namespace Server.Items } } - public override CraftResource DefaultResource{ get{ return CraftResource.RegularWood; } } - [Constructable] - public RedHangingLantern() : base( 0x24C4 ) + public RedHangingLantern() : base( 0x24C2 ) { Movable = true; Duration = TimeSpan.Zero; // Never burnt out Burning = false; Light = LightType.Circle300; - Weight = 1.0; + Weight = 3.0; } public RedHangingLantern( Serial serial ) : base( serial ) @@ -68,9 +66,6 @@ namespace Server.Items { base.Deserialize( reader ); int version = reader.ReadInt(); - - if ( Weight == 3.0 ) - Weight = 1.0; } } } \ No newline at end of file diff --git a/Scripts/Items/Lights/WhiteHangingLantern.cs b/Scripts/Items/Lights/WhiteHangingLantern.cs index 5ab2d1675..e0dcf122a 100644 --- a/Scripts/Items/Lights/WhiteHangingLantern.cs +++ b/Scripts/Items/Lights/WhiteHangingLantern.cs @@ -28,16 +28,14 @@ namespace Server.Items } } - public override CraftResource DefaultResource{ get{ return CraftResource.RegularWood; } } - [Constructable] - public WhiteHangingLantern() : base( 0x24C8 ) + public WhiteHangingLantern() : base( 0x24C6 ) { Movable = true; Duration = TimeSpan.Zero; // Never burnt out Burning = false; Light = LightType.Circle300; - Weight = 1.0; + Weight = 3.0; } public WhiteHangingLantern( Serial serial ) : base( serial ) @@ -68,9 +66,6 @@ namespace Server.Items { base.Deserialize( reader ); int version = reader.ReadInt(); - - if ( Weight == 3.0 ) - Weight = 1.0; } } } \ No newline at end of file diff --git a/Scripts/Items/Misc/BaseCraftableItem.cs b/Scripts/Items/Misc/BaseCraftableItem.cs deleted file mode 100644 index 827921e86..000000000 --- a/Scripts/Items/Misc/BaseCraftableItem.cs +++ /dev/null @@ -1,159 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Server.Network; -using Server.Engines.Craft; -using Server.Misc; - -namespace Server.Items -{ - public enum CraftQuality - { - Low, - Regular, - Exceptional - } - - public abstract class BaseCraftableItem : Item, ICraftable - { - private Mobile m_Crafter; - private CraftQuality m_Quality; - private CraftResource m_Resource; - - [CommandProperty( AccessLevel.GameMaster )] - public Mobile Crafter - { - get { return m_Crafter; } - set { m_Crafter = value; InvalidateProperties(); } - } - - [CommandProperty( AccessLevel.GameMaster )] - public CraftQuality Quality - { - get { return m_Quality; } - set { m_Quality = value; InvalidateProperties(); } - } - - [CommandProperty( AccessLevel.GameMaster )] - public CraftResource Resource - { - get { return m_Resource; } - set - { - if ( m_Resource != value ) - { - m_Resource = value; - Hue = CraftResources.GetHue( m_Resource ); - InvalidateProperties(); - } - } - } - - #region Old Item Serialization Vars - /* DO NOT USE! Only used in serialization of furniture that originally derived from Item */ - private bool m_InheritsItem; - private int m_OldVersion; - - protected bool InheritsItem - { - get{ return m_InheritsItem; } - } - - protected int OldVersion - { - get{ return m_OldVersion; } - } - #endregion - - public virtual CraftResource DefaultResource{ get{ return CraftResource.RegularWood; } } - public virtual bool DisplaysResource{ get{ return true; } } - //For odd entries that can be crafted exceptionally with maker's mark but don't actually display a maker's mark - public virtual bool DisplaysMakersMark{ get{ return true; } } - - public BaseCraftableItem( int itemID ) : base( itemID ) - { - m_Quality = CraftQuality.Regular; - Resource = DefaultResource; - } - - public BaseCraftableItem(Serial serial) : base(serial) - { - } - - public override void GetProperties( ObjectPropertyList list ) - { - base.GetProperties( list ); - - if ( m_Crafter != null && DisplaysMakersMark ) - list.Add( 1050043, m_Crafter.Name ); // crafted by ~1_NAME~ - - if ( m_Quality == CraftQuality.Exceptional ) - list.Add( 1060636 ); // exceptional - - if( ( m_Resource >= CraftResource.OakWood && m_Resource <= CraftResource.Frostwood ) && Hue == CraftResources.GetHue( m_Resource ) && DisplaysResource ) - list.Add( CraftResources.GetLocalizationNumber( m_Resource ) ); // resource name - } - - public override void Serialize(GenericWriter writer) - { - base.Serialize(writer); - - writer.Write((int) 1); - - writer.Write( m_Crafter ); - writer.WriteEncodedInt( (int) m_Quality ); - writer.WriteEncodedInt( (int) m_Resource ); - } - - public override void Deserialize(GenericReader reader) - { - base.Deserialize(reader); - - int version = reader.ReadInt(); - - switch ( version ) - { - case 1: - { - m_Crafter = reader.ReadMobile(); - m_Quality = (CraftQuality)reader.ReadEncodedInt(); - m_Resource = (CraftResource)reader.ReadEncodedInt(); - break; - } - case 0: - { - m_InheritsItem = true; - m_OldVersion = version; - m_Quality = CraftQuality.Regular; - m_Resource = DefaultResource; - break; - } - } - } - - public virtual int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue ) - { - if ( Core.ML ) - { - Quality = (CraftQuality)quality; - - if ( makersMark ) - Crafter = from; - - Type resourceType = typeRes; - - if ( resourceType == null ) - resourceType = craftItem.Resources.GetAt( 0 ).ItemType; - - Resource = CraftResources.GetFromType( resourceType ); - - CraftContext context = craftSystem.GetContext( from ); - - if ( context != null && context.DoNotColor ) - Hue = 0; - } - - return (int)Quality; - } - } -} diff --git a/Scripts/Items/Misc/BaseOtherEquipable.cs b/Scripts/Items/Misc/BaseOtherEquipable.cs deleted file mode 100644 index 1e1bf752d..000000000 --- a/Scripts/Items/Misc/BaseOtherEquipable.cs +++ /dev/null @@ -1,683 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Server.Network; -using Server.Engines.Craft; -using Server.Factions; -using AMA = Server.Items.ArmorMeditationAllowance; -using AMT = Server.Items.ArmorMaterialType; -using ABT = Server.Items.ArmorBodyType; - - -namespace Server.Items -{ - public abstract class BaseOtherEquipable : Item, ICraftable, IAosAttributes - { - private Mobile m_Crafter; - private CraftQuality m_Quality; - private CraftResource m_Resource; - private bool m_PlayerConstructed; - - private AosAttributes m_AosAttributes; - private AosArmorAttributes m_AosArmorAttributes; - private AosSkillBonuses m_AosSkillBonuses; - - private BonusAttribute[] m_BonusRandomAttributes; - private double m_OriginalWeight; - - private int m_StrReq = -1, m_DexReq = -1, m_IntReq = -1; - - public virtual bool AllowMaleWearer{ get{ return true; } } - public virtual bool AllowFemaleWearer{ get{ return true; } } - - public virtual Race RequiredRace { get { return null; } } - - public virtual int AosStrReq{ get{ return 0; } } - public virtual int AosDexReq{ get{ return 0; } } - public virtual int AosIntReq{ get{ return 0; } } - - public virtual int OldStrReq{ get{ return 0; } } - public virtual int OldDexReq{ get{ return 0; } } - public virtual int OldIntReq{ get{ return 0; } } - - public virtual CraftResource DefaultResource{ get{ return CraftResource.RegularWood; } } - - public override void OnAfterDuped( Item newItem ) - { - BaseOtherEquipable otherEquip = newItem as BaseOtherEquipable; - - if ( otherEquip == null ) - return; - - otherEquip.m_AosAttributes = new AosAttributes( newItem, m_AosAttributes ); - otherEquip.m_AosArmorAttributes = new AosArmorAttributes( newItem, m_AosArmorAttributes ); - otherEquip.m_AosSkillBonuses = new AosSkillBonuses( newItem, m_AosSkillBonuses ); - otherEquip.m_BonusRandomAttributes = m_BonusRandomAttributes; - } - - #region Getters/Setters - [CommandProperty( AccessLevel.GameMaster )] - public bool PlayerConstructed - { - get{ return m_PlayerConstructed; } - set{ m_PlayerConstructed = value; } - } - - [CommandProperty( AccessLevel.GameMaster )] - public int StrRequirement - { - get{ return ( m_StrReq == -1 ? Core.AOS ? AosStrReq : OldStrReq : m_StrReq ); } - set{ m_StrReq = value; InvalidateProperties(); } - } - - [CommandProperty( AccessLevel.GameMaster )] - public int DexRequirement - { - get{ return ( m_DexReq == -1 ? Core.AOS ? AosDexReq : OldDexReq : m_DexReq ); } - set{ m_DexReq = value; InvalidateProperties(); } - } - - [CommandProperty( AccessLevel.GameMaster )] - public int IntRequirement - { - get{ return ( m_IntReq == -1 ? Core.AOS ? AosIntReq : OldIntReq : m_IntReq ); } - set{ m_IntReq = value; InvalidateProperties(); } - } - - [CommandProperty( AccessLevel.GameMaster )] - public CraftResource Resource - { - get - { - return m_Resource; - } - set - { - if ( m_Resource != value ) - { - if ( Core.AOS && !CraftResources.IsStandard( m_Resource ) ) - { - BonusAttributesHelper.RemoveAttrsFrom( this, GetResourceBonusAttrs() ); - BonusAttributesHelper.RemoveAttrsFrom( this, RandomAttributes ); - RandomAttributes = null; - } - - m_Resource = value; - Hue = CraftResources.GetHue( m_Resource ); - - if ( Core.AOS && !CraftResources.IsStandard( m_Resource ) ) - { - // Enhance sets RandomAttributes so check if it's null/empty first before getting new random attributes. - if ( RandomAttributes == null || RandomAttributes.Length == 0 ) - RandomAttributes = BonusAttributesHelper.GetRandomAttributes( GetResourceRandomAttrs(), GetResourceAttrs().RandomAttributeCount ); - - BonusAttributesHelper.ApplyAttributesTo( this, GetResourceBonusAttrs() ); - BonusAttributesHelper.ApplyAttributesTo( this, RandomAttributes ); - } - - InvalidateProperties(); - } - } - } - - [CommandProperty( AccessLevel.GameMaster )] - public Mobile Crafter - { - get{ return m_Crafter; } - set{ m_Crafter = value; InvalidateProperties(); } - } - - [CommandProperty( AccessLevel.GameMaster )] - public CraftQuality Quality - { - get{ return m_Quality; } - set{ m_Quality = value; InvalidateProperties(); } - } - - [CommandProperty( AccessLevel.GameMaster )] - public AosAttributes Attributes - { - get{ return m_AosAttributes; } - set{} - } - - [CommandProperty( AccessLevel.GameMaster )] - public AosArmorAttributes ArmorAttributes - { - get{ return m_AosArmorAttributes; } - set{} - } - - public BonusAttribute[] RandomAttributes - { - get { return m_BonusRandomAttributes; } - set { m_BonusRandomAttributes = value; } - } - - #endregion - - #region Old Item Serialization Vars - /* Only used in serialization of other equipables that originally derived from Item */ - private bool m_InheritsItem; - private int m_OldVersion; - - protected bool InheritsItem - { - get{ return m_InheritsItem; } - } - - protected int OldVersion - { - get{ return m_OldVersion; } - } - #endregion - - public CraftAttributeInfo GetResourceAttrs() - { - CraftResourceInfo info = CraftResources.GetInfo( m_Resource ); - - if ( info == null ) - return CraftAttributeInfo.Blank; - - return info.AttributeInfo; - } - - public BonusAttribute[] GetResourceBonusAttrs() - { - CraftAttributeInfo attrInfo = GetResourceAttrs(); - - return attrInfo.OtherAttributes; - } - - public BonusAttribute[] GetResourceRandomAttrs() - { - CraftAttributeInfo attrInfo = GetResourceAttrs(); - - return attrInfo.OtherRandomAttributes; - } - - public int ComputeStatReq( StatType type ) - { - int v; - - if ( type == StatType.Str ) - v = StrRequirement; - else if ( type == StatType.Dex ) - v = DexRequirement; - else - v = IntRequirement; - - return AOS.Scale( v, 100 - GetLowerStatReq() ); - } - - - public BaseOtherEquipable( int itemID ) : base( itemID ) - { - m_Quality = CraftQuality.Regular; - Resource = DefaultResource; - - m_AosAttributes = new AosAttributes( this ); - m_AosArmorAttributes = new AosArmorAttributes( this ); - m_AosSkillBonuses = new AosSkillBonuses( this ); - - m_OriginalWeight = Weight; - } - - public BaseOtherEquipable( Serial serial ) : base( serial ) - { - } - - #region Serialization/Deserialization - private static void SetSaveFlag( ref SaveFlag flags, SaveFlag toSet, bool setIf ) - { - if ( setIf ) - flags |= toSet; - } - - private static bool GetSaveFlag( SaveFlag flags, SaveFlag toGet ) - { - return ( (flags & toGet) != 0 ); - } - - [Flags] - private enum SaveFlag - { - None = 0x00000000, - Attributes = 0x00000001, - ArmorAttributes = 0x00000002, - Crafter = 0x00000004, - Quality = 0x00000008, - Resource = 0x00000010, - StrReq = 0x00000020, - DexReq = 0x00000040, - IntReq = 0x00000080, - SkillBonuses = 0x00000100, - PlayerConstructed = 0x00000200, - BonusRandomAttributes = 0x00000400 - } - - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); - - writer.Write( (int) 1 ); // version - - SaveFlag flags = SaveFlag.None; - - SetSaveFlag( ref flags, SaveFlag.Attributes, !m_AosAttributes.IsEmpty ); - SetSaveFlag( ref flags, SaveFlag.ArmorAttributes, !m_AosArmorAttributes.IsEmpty ); - SetSaveFlag( ref flags, SaveFlag.Crafter, m_Crafter != null ); - SetSaveFlag( ref flags, SaveFlag.Quality, m_Quality != CraftQuality.Regular ); - SetSaveFlag( ref flags, SaveFlag.Resource, m_Resource != DefaultResource ); - SetSaveFlag( ref flags, SaveFlag.StrReq, m_StrReq != -1 ); - SetSaveFlag( ref flags, SaveFlag.DexReq, m_DexReq != -1 ); - SetSaveFlag( ref flags, SaveFlag.IntReq, m_IntReq != -1 ); - SetSaveFlag( ref flags, SaveFlag.SkillBonuses, !m_AosSkillBonuses.IsEmpty ); - SetSaveFlag( ref flags, SaveFlag.PlayerConstructed, m_PlayerConstructed != false ); - SetSaveFlag( ref flags, SaveFlag.BonusRandomAttributes, m_BonusRandomAttributes != null && m_BonusRandomAttributes.Length > 0 ); - - writer.WriteEncodedInt( (int) flags ); - - if ( GetSaveFlag( flags, SaveFlag.Attributes ) ) - m_AosAttributes.Serialize( writer ); - - if ( GetSaveFlag( flags, SaveFlag.ArmorAttributes ) ) - m_AosArmorAttributes.Serialize( writer ); - - if ( GetSaveFlag( flags, SaveFlag.Crafter ) ) - writer.Write( (Mobile) m_Crafter ); - - if ( GetSaveFlag( flags, SaveFlag.Quality ) ) - writer.WriteEncodedInt( (int) m_Quality ); - - if ( GetSaveFlag( flags, SaveFlag.Resource ) ) - writer.WriteEncodedInt( (int) m_Resource ); - - if ( GetSaveFlag( flags, SaveFlag.StrReq ) ) - writer.WriteEncodedInt( (int) m_StrReq ); - - if ( GetSaveFlag( flags, SaveFlag.DexReq ) ) - writer.WriteEncodedInt( (int) m_DexReq ); - - if ( GetSaveFlag( flags, SaveFlag.IntReq ) ) - writer.WriteEncodedInt( (int) m_IntReq ); - - if ( GetSaveFlag( flags, SaveFlag.SkillBonuses ) ) - m_AosSkillBonuses.Serialize( writer ); - - if ( GetSaveFlag( flags, SaveFlag.BonusRandomAttributes ) ) - { - writer.Write( m_BonusRandomAttributes.Length ); - for ( int i = 0; i < m_BonusRandomAttributes.Length; i++ ) - m_BonusRandomAttributes[i].Serialize( writer ); - } - } - - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); - - int version = reader.ReadInt(); - - switch ( version ) - { - case 1: - { - SaveFlag flags = (SaveFlag)reader.ReadEncodedInt(); - - if ( GetSaveFlag( flags, SaveFlag.Attributes ) ) - m_AosAttributes = new AosAttributes( this, reader ); - else - m_AosAttributes = new AosAttributes( this ); - - if ( GetSaveFlag( flags, SaveFlag.ArmorAttributes ) ) - m_AosArmorAttributes = new AosArmorAttributes( this, reader ); - else - m_AosArmorAttributes = new AosArmorAttributes( this ); - - if ( GetSaveFlag( flags, SaveFlag.Crafter ) ) - m_Crafter = reader.ReadMobile(); - - if ( GetSaveFlag( flags, SaveFlag.Quality ) ) - m_Quality = (CraftQuality)reader.ReadEncodedInt(); - else - m_Quality = CraftQuality.Regular; - - if ( GetSaveFlag( flags, SaveFlag.Resource ) ) - m_Resource = (CraftResource)reader.ReadEncodedInt(); - else - m_Resource = DefaultResource; - - if ( m_Resource == CraftResource.None ) - m_Resource = DefaultResource; - - if ( GetSaveFlag( flags, SaveFlag.StrReq ) ) - m_StrReq = reader.ReadEncodedInt(); - else - m_StrReq = -1; - - if ( GetSaveFlag( flags, SaveFlag.DexReq ) ) - m_DexReq = reader.ReadEncodedInt(); - else - m_DexReq = -1; - - if ( GetSaveFlag( flags, SaveFlag.IntReq ) ) - m_IntReq = reader.ReadEncodedInt(); - else - m_IntReq = -1; - - if ( GetSaveFlag( flags, SaveFlag.SkillBonuses ) ) - m_AosSkillBonuses = new AosSkillBonuses( this, reader ); - - if ( GetSaveFlag( flags, SaveFlag.PlayerConstructed ) ) - m_PlayerConstructed = true; - - if ( GetSaveFlag( flags, SaveFlag.BonusRandomAttributes ) ) - { - m_BonusRandomAttributes = new BonusAttribute[reader.ReadInt()]; - - for( int i = 0; i < m_BonusRandomAttributes.Length; i++ ) - m_BonusRandomAttributes[i] = new BonusAttribute( reader ); - } - - break; - } - case 0: - { - m_InheritsItem = true; - m_OldVersion = version; - m_AosAttributes = new AosAttributes( this ); - m_AosArmorAttributes = new AosArmorAttributes( this ); - m_Quality = CraftQuality.Regular; - m_Resource = DefaultResource; - m_PlayerConstructed = true; - break; - } - } - - if ( m_AosSkillBonuses == null ) - m_AosSkillBonuses = new AosSkillBonuses( this ); - - if ( Core.AOS && Parent is Mobile ) - m_AosSkillBonuses.AddTo( (Mobile)Parent ); - - if ( Parent is Mobile ) - ((Mobile)Parent).CheckStatTimers(); - } - #endregion - - public int GetLowerStatReq() - { - if ( !Core.AOS ) - return 0; - - int v = m_AosArmorAttributes.LowerStatReq; - - if ( v > 100 ) - v = 100; - - return v; - } - - public void ModifyWeight() - { - double v = 0; - - v = 100 - GetWeightBonus(); - - Weight = m_OriginalWeight * (v / 100); - } - - public int GetWeightBonus() - { - CraftAttributeInfo attrInfo = GetResourceAttrs(); - - int v = Attributes.LowerWeight; - - if ( v > 100 ) - v = 100; - - return v; - } - - public override bool CanEquip( Mobile from ) - { - if( !Ethics.Ethic.CheckEquip( from, this ) ) - return false; - - if( from.AccessLevel < AccessLevel.GameMaster ) - { - if( RequiredRace != null && from.Race != RequiredRace ) - { - if( RequiredRace == Race.Elf ) - from.SendLocalizedMessage( 1072203 ); // Only Elves may use this. - else - from.SendMessage( "Only {0} may use this.", RequiredRace.PluralName ); - - return false; - } - else if( !AllowMaleWearer && !from.Female ) - { - if( AllowFemaleWearer ) - from.SendLocalizedMessage( 1010388 ); // Only females can wear this. - else - from.SendMessage( "You may not wear this." ); - - return false; - } - else if( !AllowFemaleWearer && from.Female ) - { - if( AllowMaleWearer ) - from.SendLocalizedMessage( 1063343 ); // Only males can wear this. - else - from.SendMessage( "You may not wear this." ); - - return false; - } - else - { - int strReq = ComputeStatReq( StatType.Str ); - int dexReq = ComputeStatReq( StatType.Dex ); - int intReq = ComputeStatReq( StatType.Int ); - - if( from.Dex < dexReq ) - { - from.SendLocalizedMessage( 502077 ); // You do not have enough dexterity to equip this item. - return false; - } - else if( from.Str < strReq ) - { - from.SendLocalizedMessage( 500213 ); // You are not strong enough to equip that. - return false; - } - else if( from.Int < intReq ) - { - from.SendMessage( "You are not smart enough to equip that." ); - return false; - } - } - } - - return base.CanEquip( from ); - } - - public override bool OnEquip( Mobile from ) - { - from.CheckStatTimers(); - - int strBonus = m_AosAttributes.BonusStr; - int dexBonus = m_AosAttributes.BonusDex; - int intBonus = m_AosAttributes.BonusInt; - - if ( strBonus != 0 || dexBonus != 0 || intBonus != 0 ) - { - string modName = this.Serial.ToString(); - - if ( strBonus != 0 ) - from.AddStatMod( new StatMod( StatType.Str, modName + "Str", strBonus, TimeSpan.Zero ) ); - - if ( dexBonus != 0 ) - from.AddStatMod( new StatMod( StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero ) ); - - if ( intBonus != 0 ) - from.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) ); - } - - return base.OnEquip( from ); - } - - public override void OnAdded( object parent ) - { - if ( parent is Mobile ) - { - Mobile from = (Mobile)parent; - - if ( Core.AOS ) - m_AosSkillBonuses.AddTo( from ); - } - } - - public override void OnRemoved( object parent ) - { - if ( parent is Mobile ) - { - Mobile m = (Mobile)parent; - string modName = this.Serial.ToString(); - - m.RemoveStatMod( modName + "Str" ); - m.RemoveStatMod( modName + "Dex" ); - m.RemoveStatMod( modName + "Int" ); - - if ( Core.AOS ) - m_AosSkillBonuses.Remove(); - - m.CheckStatTimers(); - } - - base.OnRemoved( parent ); - } - - public override void GetProperties( ObjectPropertyList list ) - { - base.GetProperties( list ); - - if ( m_Crafter != null ) - list.Add( 1050043, m_Crafter.Name ); // crafted by ~1_NAME~ - - if ( m_Quality == CraftQuality.Exceptional ) - list.Add( 1060636 ); // exceptional - - if ( m_AosSkillBonuses != null ) - m_AosSkillBonuses.GetProperties( list ); - - int prop; - - if ( ( m_Resource >= CraftResource.OakWood && m_Resource <= CraftResource.Frostwood ) && Hue == CraftResources.GetHue( m_Resource ) ) - list.Add( CraftResources.GetLocalizationNumber( m_Resource ) ); - - if ( (prop = m_AosAttributes.WeaponDamage) != 0 ) - list.Add( 1060401, prop.ToString() ); // damage increase ~1_val~% - - if ( (prop = m_AosAttributes.DefendChance) != 0 ) - list.Add( 1060408, prop.ToString() ); // defense chance increase ~1_val~% - - if ( (prop = m_AosAttributes.BonusDex ) != 0 ) - list.Add( 1060409, prop.ToString() ); // dexterity bonus ~1_val~ - - if ( (prop = m_AosAttributes.EnhancePotions) != 0 ) - list.Add( 1060411, prop.ToString() ); // enhance potions ~1_val~% - - if ( (prop = m_AosAttributes.CastRecovery) != 0 ) - list.Add( 1060412, prop.ToString() ); // faster cast recovery ~1_val~ - - if ( (prop = m_AosAttributes.CastSpeed) != 0 ) - list.Add( 1060413, prop.ToString() ); // faster casting ~1_val~ - - if ( (prop = m_AosAttributes.AttackChance) != 0 ) - list.Add( 1060415, prop.ToString() ); // hit chance increase ~1_val~% - - if ( (prop = m_AosAttributes.BonusHits) != 0 ) - list.Add( 1060431, prop.ToString() ); // hit point increase ~1_val~ - - if ( (prop = m_AosAttributes.BonusInt) != 0 ) - list.Add( 1060432, prop.ToString() ); // intelligence bonus ~1_val~ - - if ( (prop = m_AosAttributes.LowerManaCost) != 0 ) - list.Add( 1060433, prop.ToString() ); // lower mana cost ~1_val~% - - if ( (prop = m_AosAttributes.LowerRegCost) != 0 ) - list.Add( 1060434, prop.ToString() ); // lower reagent cost ~1_val~% - - if ( (prop = GetLowerStatReq()) != 0 ) - list.Add( 1060435, prop.ToString() ); // lower requirements ~1_val~% - - if ( (prop = m_AosAttributes.Luck) != 0 ) - list.Add( 1060436, prop.ToString() ); // luck ~1_val~ - - if ( (prop = m_AosAttributes.BonusMana) != 0 ) - list.Add( 1060439, prop.ToString() ); // mana increase ~1_val~ - - if ( (prop = m_AosAttributes.RegenMana) != 0 ) - list.Add( 1060440, prop.ToString() ); // mana regeneration ~1_val~ - - if ( (prop = m_AosAttributes.NightSight) != 0 ) - list.Add( 1060441 ); // night sight - - if ( (prop = m_AosAttributes.ReflectPhysical) != 0 ) - list.Add( 1060442, prop.ToString() ); // reflect physical damage ~1_val~% - - if ( (prop = m_AosAttributes.RegenStam) != 0 ) - list.Add( 1060443, prop.ToString() ); // stamina regeneration ~1_val~ - - if ( (prop = m_AosAttributes.RegenHits) != 0 ) - list.Add( 1060444, prop.ToString() ); // hit point regeneration ~1_val~ - - if ( (prop = m_AosAttributes.SpellChanneling) != 0 ) - list.Add( 1060482 ); // spell channeling - - if ( (prop = m_AosAttributes.SpellDamage) != 0 ) - list.Add( 1060483, prop.ToString() ); // spell damage increase ~1_val~% - - if ( (prop = m_AosAttributes.BonusStam) != 0 ) - list.Add( 1060484, prop.ToString() ); // stamina increase ~1_val~ - - if ( (prop = m_AosAttributes.BonusStr) != 0 ) - list.Add( 1060485, prop.ToString() ); // strength bonus ~1_val~ - - if ( (prop = m_AosAttributes.WeaponSpeed) != 0 ) - list.Add( 1060486, prop.ToString() ); // swing speed increase ~1_val~% - - if ( (prop = ComputeStatReq( StatType.Str )) > 0 ) - list.Add( 1061170, prop.ToString() ); // strength requirement ~1_val~ - } - - #region ICraftable Members - - public virtual int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue ) - { - if ( Core.ML ) - { - Quality = (CraftQuality)quality; - - if ( makersMark ) - Crafter = from; - - Type resourceType = typeRes; - - if ( resourceType == null ) - resourceType = craftItem.Resources.GetAt( 0 ).ItemType; - - Resource = CraftResources.GetFromType( resourceType ); - PlayerConstructed = true; - - CraftContext context = craftSystem.GetContext( from ); - - if ( context != null && context.DoNotColor ) - Hue = 0; - } - - return quality; - } - #endregion - } -} diff --git a/Scripts/Items/Misc/BonusAttribute.cs b/Scripts/Items/Misc/BonusAttribute.cs deleted file mode 100644 index 482e39bb3..000000000 --- a/Scripts/Items/Misc/BonusAttribute.cs +++ /dev/null @@ -1,416 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using Server.Items; - -namespace Server -{ - public static class BonusAttributesHelper - { - #region Random Attributes - - /// - /// Returns a array populated with one unique random attribute - /// chosen from '' array -or- returns null if a null or empty array is supplied. - /// - public static BonusAttribute[] GetRandomAttributes( BonusAttribute[] randAttrs ) - { - return GetRandomAttributes( randAttrs, 1 ); - } - - /// - /// Returns a array populated with '' unique random attributes - /// chosen from '' array -or- returns null if a null or empty array is supplied. - /// - public static BonusAttribute[] GetRandomAttributes( BonusAttribute[] randAttrs, int numOfAttr ) - { - BonusAttribute[] toAttrs = null; - - if ( randAttrs != null && randAttrs.Length > 0 && numOfAttr > 0) - { - toAttrs = new BonusAttribute[numOfAttr]; - - int avail = 0; - - List numList = new List(); - - for ( int i = 0; i < randAttrs.Length; ++i ) - numList.Add( avail++ ); - - if ( numOfAttr > randAttrs.Length ) - numOfAttr = randAttrs.Length; - - int v; - - for ( int i = 0; i < numOfAttr; ++i ) - { - v = Utility.Random(avail--); - - toAttrs[i] = randAttrs[numList[v]]; - - numList.RemoveAt(v); - } - } - - return toAttrs; - } - #endregion - - #region Apply Attributes - public static void ApplyAttributesTo( Item item, BonusAttribute[] attributes ) - { - if ( attributes != null && attributes.Length > 0 ) - { - int cold = 0, nrgy = 0, fire = 0, pois = 0, chaos = 0, direct = 0; - - for ( int i = 0; i < attributes.Length; i++ ) - { - if ( attributes[i].Attribute == null ) - continue; - - Type attrType = attributes[i].Attribute.GetType(); - - if ( attrType == typeof( AosAttribute ) ) - { - if ( item is IAosAttributes ) - ApplyAttribute( ((IAosAttributes)item).Attributes, (AosAttribute)attributes[i].Attribute, attributes[i].Amount ); - } - else if ( attrType == typeof( AosArmorAttribute ) ) - { - if ( (AosArmorAttribute)attributes[i].Attribute == AosArmorAttribute.DurabilityBonus ) - ApplyDurability( item, attributes[i].Amount ); - else if ( item is BaseArmor ) - ApplyAttribute( ((BaseArmor)item).ArmorAttributes, (AosArmorAttribute)attributes[i].Attribute, attributes[i].Amount ); - else if ( item is BaseOtherEquipable ) - ApplyAttribute( ((BaseOtherEquipable)item).ArmorAttributes, (AosArmorAttribute)attributes[i].Attribute, attributes[i].Amount ); - } - else if ( attrType == typeof( AosWeaponAttribute ) ) - { - if ( (AosWeaponAttribute)attributes[i].Attribute == AosWeaponAttribute.DurabilityBonus ) - ApplyDurability( item, attributes[i].Amount ); - else if ( item is BaseWeapon ) - ApplyAttribute( ((BaseWeapon)item).WeaponAttributes, (AosWeaponAttribute)attributes[i].Attribute, attributes[i].Amount ); - } - else if ( attrType == typeof( AosElementAttribute ) ) - { - if ( item is BaseWeapon ) - { - switch ( (AosElementAttribute)attributes[i].Attribute ) - { - case AosElementAttribute.Cold: cold = attributes[i].Amount; break; - case AosElementAttribute.Energy: nrgy = attributes[i].Amount; break; - case AosElementAttribute.Fire: fire = attributes[i].Amount; break; - case AosElementAttribute.Poison: pois = attributes[i].Amount; break; - case AosElementAttribute.Chaos: chaos = attributes[i].Amount; break; - case AosElementAttribute.Direct: direct = attributes[i].Amount; break; - } - } - } - else if ( attrType == typeof( ResistanceType ) ) - { - if ( item is BaseArmor ) - ApplyResistance( (BaseArmor)item, (ResistanceType)attributes[i].Attribute, attributes[i].Amount ); - } - } - - if ( item is BaseWeapon ) - ApplyElementDamages( (BaseWeapon)item, cold, nrgy, fire, pois, chaos, direct ); - } - } - - public static void ApplyAttribute( AosAttributes attrs, AosAttribute attr, int amount ) - { - if ( attr == AosAttribute.SpellChanneling && attrs.SpellChanneling == 0 ) - { - attrs[attr] = 1; - attrs.CastSpeed--; - } - else - attrs[attr] += amount; - } - - public static void ApplyAttribute( AosArmorAttributes attrs, AosArmorAttribute attr, int amount ) - { - if ( attr == AosArmorAttribute.MageArmor && attrs.MageArmor == 0 ) - attrs[attr] = 1; - else - attrs[attr] += amount; - } - - public static void ApplyAttribute( AosWeaponAttributes attrs, AosWeaponAttribute attr, int amount ) - { - attrs[attr] += amount; - } - - public static void ApplyAttribute( AosElementAttributes attrs, AosElementAttribute attr, int amount ) - { - attrs[attr] += amount; - } - - public static void ApplyElementDamages( BaseWeapon weapon, int cold, int nrgy, int fire, int pois, int chaos, int direct ) - { - - int weapPhys, weapCold, weapNrgy, weapFire, weapPois, weapChaos, weapDirect; - - weapon.GetDamageTypes( null, out weapPhys, out weapFire, out weapCold, out weapPois, out weapNrgy, out weapChaos, out weapDirect ); - - weapPhys = weapon.ApplyAttributeElementDamage( cold, ref weapCold, weapPhys ); - weapPhys = weapon.ApplyAttributeElementDamage( nrgy, ref weapNrgy, weapPhys ); - weapPhys = weapon.ApplyAttributeElementDamage( fire, ref weapFire, weapPhys ); - weapPhys = weapon.ApplyAttributeElementDamage( pois, ref weapPois, weapPhys ); - weapPhys = weapon.ApplyAttributeElementDamage( chaos, ref weapChaos, weapPhys ); - weapPhys = weapon.ApplyAttributeElementDamage( direct, ref weapDirect, weapPhys ); - - weapon.AosElementDamages.Physical = weapPhys; - weapon.AosElementDamages.Cold = weapCold; - weapon.AosElementDamages.Energy = weapNrgy; - weapon.AosElementDamages.Fire = weapFire; - weapon.AosElementDamages.Poison = weapPois; - weapon.AosElementDamages.Chaos = weapChaos; - weapon.AosElementDamages.Direct = weapDirect; - } - - public static void ApplyResistance( BaseArmor ar, ResistanceType res, int amount ) - { - switch ( res ) - { - case ResistanceType.Physical: ar.PhysicalBonus += amount; break; - case ResistanceType.Fire: ar.FireBonus += amount; break; - case ResistanceType.Cold: ar.ColdBonus += amount; break; - case ResistanceType.Poison: ar.PoisonBonus += amount; break; - case ResistanceType.Energy: ar.EnergyBonus += amount; break; - } - } - - public static void ApplyDurability( Item item, int amount ) - { - if ( item is IDurability ) - { - IDurability durableItem = (IDurability)item; - - durableItem.MaxHitPoints = ( ( 100 + amount ) * durableItem.MaxHitPoints ) / 100; - - if ( durableItem.MaxHitPoints > 255 ) - durableItem.MaxHitPoints = 255; - - durableItem.HitPoints = durableItem.MaxHitPoints; // Item is repaired upon enhancing - } - } - #endregion - - #region Remove Attributes - public static void RemoveAttrsFrom( Item item, BonusAttribute[] attributes ) - { - if ( attributes != null && attributes.Length > 0 ) - { - int cold = 0, nrgy = 0, fire = 0, pois = 0, chaos = 0, direct = 0; - - for ( int i = 0; i < attributes.Length; i++ ) - { - if ( attributes[i].Attribute == null ) - continue; - - Type attrType = attributes[i].Attribute.GetType(); - - if ( attrType == typeof( AosAttribute ) ) - { - if ( item is IAosAttributes ) - RemoveAttribute( ((IAosAttributes)item).Attributes, (AosAttribute)attributes[i].Attribute, attributes[i].Amount ); - } - else if ( attrType == typeof( AosArmorAttribute ) ) - { - if ( (AosArmorAttribute)attributes[i].Attribute == AosArmorAttribute.DurabilityBonus ) - RemoveDurability( item, attributes[i].Amount ); - else if ( item is BaseArmor ) - RemoveAttribute( ((BaseArmor)item).ArmorAttributes, (AosArmorAttribute)attributes[i].Attribute, attributes[i].Amount ); - else if ( item is BaseOtherEquipable ) - RemoveAttribute( ((BaseOtherEquipable)item).ArmorAttributes, (AosArmorAttribute)attributes[i].Attribute, attributes[i].Amount ); - } - else if ( attrType == typeof( AosWeaponAttribute ) ) - { - if ( (AosWeaponAttribute)attributes[i].Attribute == AosWeaponAttribute.DurabilityBonus ) - RemoveDurability( item, attributes[i].Amount ); - else if ( item is BaseWeapon ) - RemoveAttribute( ((BaseWeapon)item).WeaponAttributes, (AosWeaponAttribute)attributes[i].Attribute, attributes[i].Amount ); - } - else if ( attrType == typeof( AosElementAttribute ) ) - { - if ( item is BaseWeapon ) - { - switch ( (AosElementAttribute)attributes[i].Attribute ) - { - case AosElementAttribute.Cold: cold = attributes[i].Amount; break; - case AosElementAttribute.Energy: nrgy = attributes[i].Amount; break; - case AosElementAttribute.Fire: fire = attributes[i].Amount; break; - case AosElementAttribute.Poison: pois = attributes[i].Amount; break; - case AosElementAttribute.Chaos: chaos = attributes[i].Amount; break; - case AosElementAttribute.Direct: direct = attributes[i].Amount; break; - } - } - } - else if ( attrType == typeof( ResistanceType ) ) - { - if ( item is BaseArmor ) - RemoveResistance( (BaseArmor)item, (ResistanceType)attributes[i].Attribute, attributes[i].Amount ); - } - } - - if ( item is BaseWeapon ) - RemoveElementDamages( (BaseWeapon)item, cold, nrgy, fire, pois, chaos, direct ); - } - } - - public static void RemoveAttribute( AosAttributes attrs, AosAttribute attr, int amount ) - { - if ( attr == AosAttribute.SpellChanneling && attrs.SpellChanneling > 0 ) - { - attrs[attr] = 0; - attrs.CastSpeed++; - } - else - attrs[attr] = Math.Max( attrs[attr] - amount, 0 ); - } - - public static void RemoveAttribute( AosArmorAttributes attrs, AosArmorAttribute attr, int amount ) - { - if ( attr == AosArmorAttribute.MageArmor && attrs.MageArmor > 0 ) - attrs[attr] = 0; - else - attrs[attr] = Math.Max( attrs[attr] - amount, 0 ); - } - - public static void RemoveAttribute( AosWeaponAttributes attrs, AosWeaponAttribute attr, int amount ) - { - attrs[attr] = Math.Max( attrs[attr] - amount, 0 ); - } - - public static void RemoveAttribute( AosElementAttributes attrs, AosElementAttribute attr, int amount ) - { - attrs[attr] = Math.Max( attrs[attr] - amount, 0 ); - } - - public static void RemoveElementDamages( BaseWeapon weapon, int cold, int nrgy, int fire, int pois, int chaos, int direct ) - { - - int weapPhys, weapCold, weapNrgy, weapFire, weapPois, weapChaos, weapDirect; - - weapon.GetDamageTypes( null, out weapPhys, out weapFire, out weapCold, out weapPois, out weapNrgy, out weapChaos, out weapDirect ); - - // Remove the element damages in reverse order they were applied in. - - weapPhys = weapon.RemoveAttributeElementDamage( direct, ref weapDirect, weapPhys ); - weapPhys = weapon.RemoveAttributeElementDamage( chaos, ref weapChaos, weapPhys ); - weapPhys = weapon.RemoveAttributeElementDamage( pois, ref weapPois, weapPhys ); - weapPhys = weapon.RemoveAttributeElementDamage( fire, ref weapFire, weapPhys ); - weapPhys = weapon.RemoveAttributeElementDamage( nrgy, ref weapNrgy, weapPhys ); - weapPhys = weapon.RemoveAttributeElementDamage( cold, ref weapCold, weapPhys ); - - weapon.AosElementDamages.Physical = weapPhys; - weapon.AosElementDamages.Cold = weapCold; - weapon.AosElementDamages.Energy = weapNrgy; - weapon.AosElementDamages.Fire = weapFire; - weapon.AosElementDamages.Poison = weapPois; - weapon.AosElementDamages.Chaos = weapChaos; - weapon.AosElementDamages.Direct = weapDirect; - } - - public static void RemoveResistance( BaseArmor ar, ResistanceType res, int amount ) - { - switch ( res ) - { - case ResistanceType.Physical: ar.PhysicalBonus = Math.Max( ar.PhysicalBonus - amount, 0 ); break; - case ResistanceType.Fire: ar.FireBonus = Math.Max( ar.ColdBonus - amount, 0 ); break; - case ResistanceType.Cold: ar.ColdBonus = Math.Max( ar.FireBonus - amount, 0 ); break; - case ResistanceType.Poison: ar.PoisonBonus = Math.Max( ar.PoisonBonus - amount, 0 ); break; - case ResistanceType.Energy: ar.EnergyBonus = Math.Max( ar.EnergyBonus - amount, 0 ); break; - } - } - - public static void RemoveDurability( Item item, int amount ) - { - if ( item is IDurability ) - { - IDurability durableItem = (IDurability)item; - - durableItem.MaxHitPoints = ( ( 100 + amount ) * durableItem.MaxHitPoints ) / 100; - durableItem.HitPoints = durableItem.MaxHitPoints; - } - } - #endregion - } - - public sealed class BonusAttribute - { - private object m_Attribute; - private int m_Amount; - - public object Attribute{ get{ return m_Attribute; } } - public int Amount{ get{ return m_Amount; } } - - #region Constructors - public BonusAttribute( AosAttribute attr, int amount ) : this( (object)attr, amount ) - { - } - - public BonusAttribute( AosArmorAttribute attr, int amount ) : this( (object)attr, amount ) - { - } - - public BonusAttribute( AosWeaponAttribute attr, int amount ) : this( (object)attr, amount ) - { - } - - public BonusAttribute( AosElementAttribute attr, int amount ) : this( (object)attr, amount ) - { - } - - public BonusAttribute( ResistanceType attr, int amount ) : this( (object)attr, amount ) - { - } - - private BonusAttribute( object attr, int amount ) - { - m_Attribute = attr; - m_Amount = amount; - } - - public BonusAttribute( GenericReader reader ) - { - Deserialize( reader ); - } - #endregion - - public void Serialize( GenericWriter writer ) - { - writer.Write( (int) 0 ); // version - - writer.Write( m_Attribute.GetType().ToString() ); // Enum type - writer.Write( m_Attribute.ToString() ); // Enum value - writer.Write( (int) m_Amount ); - } - - public void Deserialize( GenericReader reader ) - { - int version = reader.ReadInt(); - - switch ( version ) - { - case 0: - { - string type = reader.ReadString(); - string enumValue = reader.ReadString(); - - try { - m_Attribute = Enum.Parse( Type.GetType( type ), enumValue ); - } - catch { - Console.WriteLine( "Unable to create Enum of type {0} with value of {1}.", type, enumValue ); - } - - m_Amount = reader.ReadInt(); - break; - } - } - } - } -} diff --git a/Scripts/Items/Misc/FlipableAttribute.cs b/Scripts/Items/Misc/FlipableAttribute.cs index 4ffe852a3..adac01da5 100644 --- a/Scripts/Items/Misc/FlipableAttribute.cs +++ b/Scripts/Items/Misc/FlipableAttribute.cs @@ -65,31 +65,19 @@ namespace Server.Items public class FlipableAttribute : Attribute { private int[] m_ItemIDs; - private bool m_IsDynamicFlipable; public int[] ItemIDs { get { return m_ItemIDs; } } - - public bool IsDynamicFlipable - { - get { return m_IsDynamicFlipable; } - } public FlipableAttribute() : this( null ) { } - public FlipableAttribute( params int[] itemIDs ) - : this( true, itemIDs ) + public FlipableAttribute( params int[] itemIDs ) { - } - - public FlipableAttribute( bool isDynamicFlipable, params int[] itemIDs) - { - m_IsDynamicFlipable = isDynamicFlipable; m_ItemIDs = itemIDs; } diff --git a/Scripts/Items/Misc/PlayerBulletinBoards.cs b/Scripts/Items/Misc/PlayerBulletinBoards.cs index 1ad739125..abbd4f815 100644 --- a/Scripts/Items/Misc/PlayerBulletinBoards.cs +++ b/Scripts/Items/Misc/PlayerBulletinBoards.cs @@ -8,11 +8,9 @@ using Server.Prompts; using Server.Mobiles; using Server.Network; using Server.ContextMenus; -using Server.Engines.Craft; namespace Server.Items { - [CraftItemID( 0x2311 )] public class PlayerBBSouth : BasePlayerBB { public override int LabelNumber{ get{ return 1062421; } } // bulletin board (south) @@ -42,7 +40,6 @@ namespace Server.Items } } - [CraftItemID( 0x2312 )] public class PlayerBBEast : BasePlayerBB { public override int LabelNumber{ get{ return 1062420; } } // bulletin board (east) @@ -72,15 +69,12 @@ namespace Server.Items } } - public abstract class BasePlayerBB : Item, ISecurable, ICraftable + public abstract class BasePlayerBB : Item, ISecurable { private PlayerBBMessage m_Greeting; private List m_Messages; private string m_Title; private SecureLevel m_Level; - - private Mobile m_Crafter; - private CraftQuality m_Quality; public List Messages { @@ -106,20 +100,6 @@ namespace Server.Items get{ return m_Level; } set{ m_Level = value; } } - - [CommandProperty( AccessLevel.GameMaster )] - public Mobile Crafter - { - get { return m_Crafter; } - set { m_Crafter = value; InvalidateProperties(); } - } - - [CommandProperty( AccessLevel.GameMaster )] - public CraftQuality Quality - { - get { return m_Quality; } - set { m_Quality = value; InvalidateProperties(); } - } public BasePlayerBB( int itemID ) : base( itemID ) { @@ -130,17 +110,6 @@ namespace Server.Items public BasePlayerBB( Serial serial ) : base( serial ) { } - - public override void GetProperties( ObjectPropertyList list ) - { - base.GetProperties( list ); - - if ( m_Crafter != null ) - list.Add( 1050043, m_Crafter.Name ); // crafted by ~1_NAME~ - - if ( m_Quality == CraftQuality.Exceptional ) - list.Add( 1060636 ); // exceptional - } public override void GetContextMenuEntries( Mobile from, List list ) { @@ -152,10 +121,7 @@ namespace Server.Items { base.Serialize( writer ); - writer.Write( (int) 2 ); - - writer.Write( m_Crafter ); - writer.WriteEncodedInt( (int) m_Quality ); + writer.Write( (int) 1 ); writer.Write( (int) m_Level ); @@ -185,12 +151,6 @@ namespace Server.Items switch ( version ) { - case 2: - { - m_Crafter = reader.ReadMobile(); - m_Quality = (CraftQuality)reader.ReadEncodedInt(); - goto case 1; - } case 1: { m_Level = (SecureLevel)reader.ReadInt(); @@ -200,9 +160,6 @@ namespace Server.Items { if ( version < 1 ) m_Level = SecureLevel.Anyone; - - if ( version < 2 ) - m_Quality = CraftQuality.Regular; m_Title = reader.ReadString(); @@ -218,7 +175,7 @@ namespace Server.Items break; } - } + } } public static bool CheckAccess( BaseHouse house, Mobile from ) @@ -240,31 +197,6 @@ namespace Server.Items else if ( CheckAccess( house, from ) ) from.SendGump( new PlayerBBGump( from, house, this, 0 ) ); } - - public virtual int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue ) - { - if ( Core.ML ) - { - Quality = (CraftQuality)quality; - - if ( makersMark ) - Crafter = from; - - Type resourceType = typeRes; - - if ( resourceType == null ) - resourceType = craftItem.Resources.GetAt( 0 ).ItemType; - - Hue = CraftResources.GetHue( CraftResources.GetFromType( resourceType ) ); - - CraftContext context = craftSystem.GetContext( from ); - - if ( context != null && context.DoNotColor ) - Hue = 0; - } - - return quality; - } public class PostPrompt : Prompt { diff --git a/Scripts/Items/Shields/WoodenShield.cs b/Scripts/Items/Shields/WoodenShield.cs index f5feb0c70..188777d45 100644 --- a/Scripts/Items/Shields/WoodenShield.cs +++ b/Scripts/Items/Shields/WoodenShield.cs @@ -17,8 +17,6 @@ namespace Server.Items public override int AosStrReq{ get{ return 20; } } public override int ArmorBase{ get{ return 8; } } - - public override bool UsesShieldAttrs{ get{ return true; } } [Constructable] public WoodenShield() : base( 0x1B7A ) diff --git a/Scripts/Items/Skill Items/Carpenter Items/Board.cs b/Scripts/Items/Skill Items/Carpenter Items/Board.cs index af648599e..9e83cea38 100644 --- a/Scripts/Items/Skill Items/Carpenter Items/Board.cs +++ b/Scripts/Items/Skill Items/Carpenter Items/Board.cs @@ -3,7 +3,7 @@ using System; namespace Server.Items { [FlipableAttribute( 0x1BD7, 0x1BDA )] - public abstract class BaseBoard : Item, ICommodity + public class Board : Item, ICommodity { private CraftResource m_Resource; @@ -13,22 +13,6 @@ namespace Server.Items get { return m_Resource; } set { m_Resource = value; InvalidateProperties(); } } - - #region Old Board Serialization Vars - /* DO NOT USE! Only used in serialization of boards that originally derived from Board */ - private bool m_InheritsItem; - private int m_OldVersion; - - protected bool InheritsItem - { - get{ return m_InheritsItem; } - } - - protected int OldVersion - { - get{ return m_OldVersion; } - } - #endregion string ICommodity.Description { @@ -56,12 +40,30 @@ namespace Server.Items } } - public BaseBoard( Serial serial ) + [Constructable] + public Board() + : this( 1 ) + { + } + + [Constructable] + public Board( int amount ) + : this( CraftResource.RegularWood, amount ) + { + } + + public Board( Serial serial ) : base( serial ) { } - public BaseBoard( CraftResource resource, int amount ) + [Constructable] + public Board( CraftResource resource ) : this( resource, 1 ) + { + } + + [Constructable] + public Board( CraftResource resource, int amount ) : base( 0x1BD7 ) { Stackable = true; @@ -92,7 +94,7 @@ namespace Server.Items { base.Serialize( writer ); - writer.Write( (int) 4 ); + writer.Write( (int) 3 ); writer.Write( (int)m_Resource ); } @@ -105,79 +107,24 @@ namespace Server.Items switch ( version ) { - case 4: - { - m_Resource = (CraftResource)reader.ReadInt(); - break; - } - /** Below is for deserialization of old boards that orignally inherited from Board or Item **/ - case 3: // For all boards + case 3: case 2: - { - m_Resource = (CraftResource)reader.ReadInt(); - goto case 0; - } - case 1: // For old standard boards - case 0: - { - m_InheritsItem = true; - m_OldVersion = version; - break; - } + { + m_Resource = (CraftResource)reader.ReadInt(); + break; + } } if ( (version == 0 && Weight == 0.1) || ( version <= 2 && Weight == 2 ) ) Weight = -1; - } - } - - public class Board : BaseBoard - { - [Constructable] - public Board() - : this( 1 ) - { - } - [Constructable] - public Board( int amount ) - : base( CraftResource.RegularWood, amount ) - { - } - - public Board( Serial serial ) - : base( serial ) - { - } - - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); - - writer.Write( (int) 4 ); - } - - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); - - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); // Required for BaseBoard insertion - - switch ( version ) - { - /** Versions 0 through 3 originally inherited from Item. Versions 0 and 1 are from before Board became a CraftResource. **/ - case 1: - case 0: - { - Resource = CraftResource.RegularWood; - break; - } - } + if ( version <= 1 ) + m_Resource = CraftResource.RegularWood; } } - public class HeartwoodBoard : BaseBoard + public class HeartwoodBoard : Board { [Constructable] public HeartwoodBoard() @@ -211,7 +158,7 @@ namespace Server.Items } } - public class BloodwoodBoard : BaseBoard + public class BloodwoodBoard : Board { [Constructable] public BloodwoodBoard() @@ -245,7 +192,7 @@ namespace Server.Items } } - public class FrostwoodBoard : BaseBoard + public class FrostwoodBoard : Board { [Constructable] public FrostwoodBoard() @@ -279,7 +226,7 @@ namespace Server.Items } } - public class OakBoard : BaseBoard + public class OakBoard : Board { [Constructable] public OakBoard() @@ -313,7 +260,7 @@ namespace Server.Items } } - public class AshBoard : BaseBoard + public class AshBoard : Board { [Constructable] public AshBoard() @@ -347,7 +294,7 @@ namespace Server.Items } } - public class YewBoard : BaseBoard + public class YewBoard : Board { [Constructable] public YewBoard() diff --git a/Scripts/Items/Skill Items/Fishing/FishingPole.cs b/Scripts/Items/Skill Items/Fishing/FishingPole.cs index ba61ceb06..779312206 100644 --- a/Scripts/Items/Skill Items/Fishing/FishingPole.cs +++ b/Scripts/Items/Skill Items/Fishing/FishingPole.cs @@ -8,14 +8,10 @@ using Server.ContextMenus; namespace Server.Items { - public class FishingPole : BaseOtherEquipable + public class FishingPole : Item { - public override int AosStrReq{ get{ return 10; } } - - public override CraftResource DefaultResource{ get{ return CraftResource.RegularWood; } } - [Constructable] - public FishingPole() : base( 0x0DBF ) + public FishingPole() : base( 0x0DC0 ) { Layer = Layer.OneHanded; Weight = 8.0; @@ -48,7 +44,7 @@ namespace Server.Items { base.Deserialize( reader ); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseOtherEquipable insertion + int version = reader.ReadInt(); } } } \ No newline at end of file diff --git a/Scripts/Items/Skill Items/Lumberjack/Log.cs b/Scripts/Items/Skill Items/Lumberjack/Log.cs index cb181bade..969edc0e8 100644 --- a/Scripts/Items/Skill Items/Lumberjack/Log.cs +++ b/Scripts/Items/Skill Items/Lumberjack/Log.cs @@ -4,7 +4,7 @@ using Server.Items; namespace Server.Items { [FlipableAttribute( 0x1bdd, 0x1be0 )] - public abstract class BaseLog : Item, ICommodity, IAxe + public class Log : Item, ICommodity, IAxe { private CraftResource m_Resource; @@ -14,22 +14,6 @@ namespace Server.Items get { return m_Resource; } set { m_Resource = value; InvalidateProperties(); } } - - #region Old Log Serialization Vars - /* DO NOT USE! Only used in serialization of logs that originally derived from Log */ - private bool m_InheritsItem; - private int m_OldVersion; - - protected bool InheritsItem - { - get{ return m_InheritsItem; } - } - - protected int OldVersion - { - get{ return m_OldVersion; } - } - #endregion string ICommodity.Description { @@ -41,7 +25,23 @@ namespace Server.Items int ICommodity.DescriptionNumber { get { return CraftResources.IsStandard( m_Resource ) ? LabelNumber : 1075062 + ( (int)m_Resource - (int)CraftResource.RegularWood ); } } - public BaseLog( CraftResource resource, int amount ) + [Constructable] + public Log() : this( 1 ) + { + } + + [Constructable] + public Log( int amount ) : this( CraftResource.RegularWood, amount ) + { + } + + [Constructable] + public Log( CraftResource resource ) + : this( resource, 1 ) + { + } + [Constructable] + public Log( CraftResource resource, int amount ) : base( 0x1BDD ) { Stackable = true; @@ -66,7 +66,7 @@ namespace Server.Items list.Add( CraftResources.GetName( m_Resource ) ); } } - public BaseLog( Serial serial ) : base( serial ) + public Log( Serial serial ) : base( serial ) { } @@ -74,7 +74,7 @@ namespace Server.Items { base.Serialize( writer ); - writer.Write( (int) 2 ); // version + writer.Write( (int) 1 ); // version writer.Write( (int)m_Resource ); } @@ -87,24 +87,15 @@ namespace Server.Items switch ( version ) { - case 2: - { - m_Resource = (CraftResource)reader.ReadInt(); - break; - } - /** Below is for deserialization of old logs that orignally inherited from Log or Item **/ - case 1: // For all logs - { - m_Resource = (CraftResource)reader.ReadInt(); - goto case 0; - } - case 0: // For old standard logs - { - m_InheritsItem = true; - m_OldVersion = version; - break; - } + case 1: + { + m_Resource = (CraftResource)reader.ReadInt(); + break; + } } + + if ( version == 0 ) + m_Resource = CraftResource.RegularWood; } public virtual bool TryCreateBoards( Mobile from, double skill, Item item ) @@ -129,58 +120,7 @@ namespace Server.Items return true; } } - - public class Log : BaseLog - { - [Constructable] - public Log() : this( 1 ) - { - } - - [Constructable] - public Log( int amount ) - : base( CraftResource.RegularWood, amount ) - { - } - - public Log( Serial serial ) : base( serial ) - { - } - - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); - - writer.Write( (int) 2 ); // version - } - - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); - - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); // Required for BaseLog insertion - - switch ( version ) - { - /** Versions 0 and 1 originally inherited from Item. Version 0 is from before Log became a CraftResource. **/ - case 0: - { - Resource = CraftResource.RegularWood; - break; - } - } - } - - public override bool Axe( Mobile from, BaseAxe axe ) - { - if ( !TryCreateBoards( from , 0, new Board() ) ) - return false; - - return true; - } - } - - public class HeartwoodLog : BaseLog + public class HeartwoodLog : Log { [Constructable] public HeartwoodLog() : this( 1 ) @@ -216,7 +156,7 @@ namespace Server.Items } } - public class BloodwoodLog : BaseLog + public class BloodwoodLog : Log { [Constructable] public BloodwoodLog() @@ -254,7 +194,7 @@ namespace Server.Items } } - public class FrostwoodLog : BaseLog + public class FrostwoodLog : Log { [Constructable] public FrostwoodLog() @@ -296,7 +236,7 @@ namespace Server.Items } } - public class OakLog : BaseLog + public class OakLog : Log { [Constructable] public OakLog() @@ -338,7 +278,7 @@ namespace Server.Items } } - public class AshLog : BaseLog + public class AshLog : Log { [Constructable] public AshLog() @@ -380,7 +320,7 @@ namespace Server.Items } } - public class YewLog : BaseLog + public class YewLog : Log { [Constructable] public YewLog() diff --git a/Scripts/Items/Skill Items/Magical/Spellbook.cs b/Scripts/Items/Skill Items/Magical/Spellbook.cs index bd44590a6..b2c45b9cd 100644 --- a/Scripts/Items/Skill Items/Magical/Spellbook.cs +++ b/Scripts/Items/Skill Items/Magical/Spellbook.cs @@ -20,7 +20,7 @@ namespace Server.Items Arcanist } - public class Spellbook : Item, ICraftable, ISlayer, IAosAttributes + public class Spellbook : Item, ICraftable, ISlayer { public static void Initialize() { diff --git a/Scripts/Items/Skill Items/Musical Instruments/BaseInstrument.cs b/Scripts/Items/Skill Items/Musical Instruments/BaseInstrument.cs index 9f77d4252..1f642f850 100644 --- a/Scripts/Items/Skill Items/Musical Instruments/BaseInstrument.cs +++ b/Scripts/Items/Skill Items/Musical Instruments/BaseInstrument.cs @@ -24,7 +24,6 @@ namespace Server.Items private InstrumentQuality m_Quality; private Mobile m_Crafter; private int m_UsesRemaining; - private CraftResource m_Resource; [CommandProperty( AccessLevel.GameMaster )] public int SuccessSound @@ -67,15 +66,6 @@ namespace Server.Items get{ return m_Crafter; } set{ m_Crafter = value; InvalidateProperties(); } } - - [CommandProperty( AccessLevel.GameMaster )] - public CraftResource Resource - { - get{ return m_Resource; } - set{ m_Resource = value; Hue = CraftResources.GetHue( m_Resource ); InvalidateProperties(); } - } - - public virtual CraftResource DefaultResource{ get{ return CraftResource.RegularWood; } } public virtual int InitMinUses{ get{ return 350; } } public virtual int InitMaxUses{ get{ return 450; } } @@ -380,9 +370,6 @@ namespace Server.Items if( entry != null ) list.Add( entry.Title ); } - - if ( ( m_Resource >= CraftResource.OakWood && m_Resource <= CraftResource.Frostwood ) && Hue == CraftResources.GetHue( m_Resource ) ) - list.Add( CraftResources.GetLocalizationNumber( m_Resource ) ); if( m_UsesRemaining != oldUses ) Timer.DelayCall( TimeSpan.Zero, new TimerCallback( InvalidateProperties ) ); @@ -449,14 +436,13 @@ namespace Server.Items { base.Serialize( writer ); - writer.Write( (int) 4 ); // version + writer.Write( (int) 3 ); // version - writer.WriteEncodedInt( (int)m_Resource ); - writer.Write( m_ReplenishesCharges ); if( m_ReplenishesCharges ) writer.Write( m_LastReplenished ); + writer.Write( m_Crafter ); writer.WriteEncodedInt( (int) m_Quality ); @@ -477,11 +463,6 @@ namespace Server.Items switch ( version ) { - case 4: - { - m_Resource = (CraftResource)reader.ReadEncodedInt(); - goto case 3; - } case 3: { m_ReplenishesCharges = reader.ReadBool(); @@ -529,9 +510,6 @@ namespace Server.Items break; } } - - if ( version < 4 ) - m_Resource = DefaultResource; CheckReplenishUses(); } @@ -592,34 +570,18 @@ namespace Server.Items m_From.EndAction( typeof( BaseInstrument ) ); } } - #region ICraftable Members + public int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue ) { Quality = (InstrumentQuality)quality; - - if ( Core.ML ) - { - Type resourceType = typeRes; - - if ( resourceType == null ) - resourceType = craftItem.Resources.GetAt( 0 ).ItemType; - - Resource = CraftResources.GetFromType( resourceType ); - - CraftContext context = craftSystem.GetContext( from ); - if ( context != null && context.DoNotColor ) - Hue = 0; - } - else - Resource = DefaultResource; - if ( makersMark ) Crafter = from; return quality; } + #endregion } } \ No newline at end of file diff --git a/Scripts/Items/Skill Items/Tailor Items/Dyetubs/DyeTub.cs b/Scripts/Items/Skill Items/Tailor Items/Dyetubs/DyeTub.cs index a8c56b085..2d98fe40b 100644 --- a/Scripts/Items/Skill Items/Tailor Items/Dyetubs/DyeTub.cs +++ b/Scripts/Items/Skill Items/Tailor Items/Dyetubs/DyeTub.cs @@ -215,7 +215,6 @@ namespace Server.Items if ( okay ) { item.Hue = m_Tub.DyedHue; - item.InvalidateProperties(); from.PlaySound( 0x23E ); } } diff --git a/Scripts/Items/Skill Items/Tailor Items/Misc/Dressform.cs b/Scripts/Items/Skill Items/Tailor Items/Misc/Dressform.cs index 8db148983..c18ea0dde 100644 --- a/Scripts/Items/Skill Items/Tailor Items/Misc/Dressform.cs +++ b/Scripts/Items/Skill Items/Tailor Items/Misc/Dressform.cs @@ -2,23 +2,16 @@ using System; namespace Server.Items { - [Flipable( 0xEC6, 0xEC7 )] - public class Dressform : BaseCraftableItem + [FlipableAttribute(0xec6, 0xec7)] + public class Dressform : Item { - public override bool DisplaysResource{ get{ return false; } } - [Constructable] - public Dressform() : this( 0xEC6 ) - { - } - - [Constructable] - public Dressform( int itemID ) : base( itemID ) + public Dressform() : base(0xec6) { Weight = 10; } - public Dressform( Serial serial ) : base( serial ) + public Dressform(Serial serial) : base(serial) { } @@ -33,7 +26,7 @@ namespace Server.Items { base.Deserialize(reader); - int version = ( InheritsItem ? OldVersion : reader.ReadInt() ); //Required for BaseCraftableItem insertion + int version = reader.ReadInt(); } } } \ No newline at end of file diff --git a/Scripts/Items/Skill Items/Tools/BaseRunicTool.cs b/Scripts/Items/Skill Items/Tools/BaseRunicTool.cs index 833cf49c2..ba258ffa5 100644 --- a/Scripts/Items/Skill Items/Tools/BaseRunicTool.cs +++ b/Scripts/Items/Skill Items/Tools/BaseRunicTool.cs @@ -391,6 +391,8 @@ namespace Server.Items //Order is Cold, Energy, Fire, Poison -> Physical left //Cannot be looped, AoselementAttribute is 'out of order' + + weapon.Hue = weapon.GetElementalDamageHue(); } private static int AssignElementalDamage( BaseWeapon weapon, AosElementAttribute attr, int totalDamage ) @@ -471,7 +473,7 @@ namespace Server.Items int baseCount = ( isShield ? 7 : 20 ); int baseOffset = ( isShield ? 0 : 4 ); - if ( ( !isShield && armor.MeditationAllowance == ArmorMeditationAllowance.All ) || armor.ArmorAttributes.MageArmor > 0 ) + if ( !isShield && armor.MeditationAllowance == ArmorMeditationAllowance.All ) m_Props.Set( 3, true ); // remove mage armor from possible properties if ( armor.Resource >= CraftResource.RegularLeather && armor.Resource <= CraftResource.BarbedLeather ) { diff --git a/Scripts/Items/Skill Items/Tools/RunicDovetailSaw.cs b/Scripts/Items/Skill Items/Tools/RunicDovetailSaw.cs deleted file mode 100644 index 141f0f68c..000000000 --- a/Scripts/Items/Skill Items/Tools/RunicDovetailSaw.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using Server; -using Server.Engines.Craft; - -namespace Server.Items -{ - [FlipableAttribute( 0x1028, 0x1029 )] - public class RunicDovetailSaw : BaseRunicTool - { - public override CraftSystem CraftSystem{ get{ return DefCarpentry.CraftSystem; } } - - public override int LabelNumber - { - get - { - int index = CraftResources.GetIndex( Resource ); - - if ( index >= 1 && index <= 6 ) - return 1072633 + index; - - return 1011196; // dovetail saw - } - } - - public override void AddNameProperties( ObjectPropertyList list ) - { - base.AddNameProperties( list ); - - int index = CraftResources.GetIndex( Resource ); - - if ( index >= 1 && index <= 6 ) - return; - - if ( !CraftResources.IsStandard( Resource ) ) - { - int num = CraftResources.GetLocalizationNumber( Resource ); - - if ( num > 0 ) - list.Add( num ); - else - list.Add( CraftResources.GetName( Resource ) ); - } - } - - [Constructable] - public RunicDovetailSaw( CraftResource resource ) : base( resource, 0x1029 ) - { - Weight = 2.0; - Hue = CraftResources.GetHue( resource ); - } - - [Constructable] - public RunicDovetailSaw( CraftResource resource, int uses ) : base( resource, uses, 0x1029 ) - { - Weight = 2.0; - Hue = CraftResources.GetHue( resource ); - } - - public RunicDovetailSaw( Serial serial ) : base( serial ) - { - } - - public override void Serialize( GenericWriter writer ) - { - base.Serialize( writer ); - - writer.Write( (int) 0 ); // version - } - - public override void Deserialize( GenericReader reader ) - { - base.Deserialize( reader ); - - int version = reader.ReadInt(); - } - } -} diff --git a/Scripts/Items/Weapons/BaseWeapon.cs b/Scripts/Items/Weapons/BaseWeapon.cs index ba1e416ab..4fda0b7da 100644 --- a/Scripts/Items/Weapons/BaseWeapon.cs +++ b/Scripts/Items/Weapons/BaseWeapon.cs @@ -21,7 +21,7 @@ namespace Server.Items SlayerName Slayer2 { get; set; } } - public abstract class BaseWeapon : Item, IWeapon, IFactionItem, ICraftable, ISlayer, IDurability, IAosAttributes + public abstract class BaseWeapon : Item, IWeapon, IFactionItem, ICraftable, ISlayer, IDurability { private string m_EngravedText; @@ -92,9 +92,6 @@ namespace Server.Items private AosWeaponAttributes m_AosWeaponAttributes; private AosSkillBonuses m_AosSkillBonuses; private AosElementAttributes m_AosElementDamages; - - private BonusAttribute[] m_BonusRandomAttributes; - private double m_OriginalWeight; // Overridable values. These values are provided to override the defaults which get defined in the individual weapon scripts. private int m_StrReq, m_DexReq, m_IntReq; @@ -280,43 +277,7 @@ namespace Server.Items public CraftResource Resource { get{ return m_Resource; } - set - { - if ( m_Resource != value ) - { - if ( !Core.AOS ) - UnscaleDurability(); - - if ( Core.AOS && !CraftResources.IsStandard( m_Resource ) ) - { - BonusAttributesHelper.RemoveAttrsFrom( this, GetResourceBonusAttrs() ); - BonusAttributesHelper.RemoveAttrsFrom( this, RandomAttributes ); - RandomAttributes = null; - } - - m_Resource = value; - - if ( Core.AOS && !CraftResources.IsStandard( m_Resource ) ) - { - // Enhance sets RandomAttributes so check if it's null/empty first before getting new random attributes. - if ( RandomAttributes == null || RandomAttributes.Length == 0 ) - RandomAttributes = BonusAttributesHelper.GetRandomAttributes( GetResourceRandomAttrs(), GetResourceAttrs().RandomAttributeCount ); - - BonusAttributesHelper.ApplyAttributesTo( this, GetResourceBonusAttrs() ); - BonusAttributesHelper.ApplyAttributesTo( this, RandomAttributes ); - } - - if ( Core.AOS ) - Hue = GetElementalDamageHue( CraftResources.GetHue( m_Resource ) ); - else - Hue = CraftResources.GetHue( m_Resource ); - - InvalidateProperties(); - - if ( !Core.AOS ) - ScaleDurability(); - } - } + set{ UnscaleDurability(); m_Resource = value; Hue = CraftResources.GetHue( m_Resource ); InvalidateProperties(); ScaleDurability(); } } [CommandProperty( AccessLevel.GameMaster )] @@ -472,12 +433,6 @@ namespace Server.Items } } } - - public BonusAttribute[] RandomAttributes - { - get { return m_BonusRandomAttributes; } - set { m_BonusRandomAttributes = value; } - } #endregion @@ -492,28 +447,6 @@ namespace Server.Items weap.m_AosElementDamages = new AosElementAttributes( newItem, m_AosElementDamages ); weap.m_AosSkillBonuses = new AosSkillBonuses( newItem, m_AosSkillBonuses ); weap.m_AosWeaponAttributes = new AosWeaponAttributes( newItem, m_AosWeaponAttributes ); - weap.m_BonusRandomAttributes = m_BonusRandomAttributes; - } - - public void ModifyWeight() - { - double v = 0; - - v = 100 - GetWeightBonus(); - - Weight = m_OriginalWeight * (v / 100); - } - - public int GetWeightBonus() - { - CraftAttributeInfo attrInfo = GetResourceAttrs(); - - int v = Attributes.LowerWeight; - - if ( v > 100 ) - v = 100; - - return v; } public virtual void UnscaleDurability() @@ -533,30 +466,6 @@ namespace Server.Items m_MaxHits = ((m_MaxHits * scale) + 99) / 100; InvalidateProperties(); } - - public CraftAttributeInfo GetResourceAttrs() - { - CraftResourceInfo info = CraftResources.GetInfo( m_Resource ); - - if ( info == null ) - return CraftAttributeInfo.Blank; - - return info.AttributeInfo; - } - - public BonusAttribute[] GetResourceBonusAttrs() - { - CraftAttributeInfo attrInfo = GetResourceAttrs(); - - return attrInfo.WeaponAttributes; - } - - public BonusAttribute[] GetResourceRandomAttrs() - { - CraftAttributeInfo attrInfo = GetResourceAttrs(); - - return attrInfo.WeaponRandomAttributes; - } public int GetDurabilityBonus() { @@ -577,6 +486,15 @@ namespace Server.Items if ( Core.AOS ) { bonus += m_AosWeaponAttributes.DurabilityBonus; + + CraftResourceInfo resInfo = CraftResources.GetInfo( m_Resource ); + CraftAttributeInfo attrInfo = null; + + if ( resInfo != null ) + attrInfo = resInfo.AttributeInfo; + + if ( attrInfo != null ) + bonus += attrInfo.WeaponDurability; } return bonus; @@ -589,6 +507,16 @@ namespace Server.Items int v = m_AosWeaponAttributes.LowerStatReq; + CraftResourceInfo info = CraftResources.GetInfo( m_Resource ); + + if ( info != null ) + { + CraftAttributeInfo attrInfo = info.AttributeInfo; + + if ( attrInfo != null ) + v += attrInfo.WeaponLowerRequirements; + } + if ( v > 100 ) v = 100; @@ -1005,7 +933,6 @@ namespace Server.Items ticks = Math.Floor( ( 80000.0 / ( ( m.Stam + 100 ) * speed ) ) - 2 ); } - // Swing speed currently capped at one swing every 1.25 seconds (5 ticks). if ( ticks < 5 ) ticks = 5; @@ -2078,10 +2005,31 @@ namespace Server.Items direct = m_AosElementDamages.Direct; phys = 100 - fire - cold - pois - nrgy - chaos - direct; + + CraftResourceInfo resInfo = CraftResources.GetInfo( m_Resource ); + + if( resInfo != null ) + { + CraftAttributeInfo attrInfo = resInfo.AttributeInfo; + + if( attrInfo != null ) + { + int left = phys; + + left = ApplyCraftAttributeElementDamage( attrInfo.WeaponColdDamage, ref cold, left ); + left = ApplyCraftAttributeElementDamage( attrInfo.WeaponEnergyDamage, ref nrgy, left ); + left = ApplyCraftAttributeElementDamage( attrInfo.WeaponFireDamage, ref fire, left ); + left = ApplyCraftAttributeElementDamage( attrInfo.WeaponPoisonDamage, ref pois, left ); + left = ApplyCraftAttributeElementDamage( attrInfo.WeaponChaosDamage, ref chaos, left ); + left = ApplyCraftAttributeElementDamage( attrInfo.WeaponDirectDamage, ref direct, left ); + + phys = left; + } + } } } - public int ApplyAttributeElementDamage( int attrDamage, ref int element, int totalRemaining ) + private int ApplyCraftAttributeElementDamage( int attrDamage, ref int element, int totalRemaining ) { if( totalRemaining <= 0 ) return 0; @@ -2101,27 +2049,6 @@ namespace Server.Items return totalRemaining - appliedDamage; } - - public int RemoveAttributeElementDamage( int attrDamage, ref int element, int totalRemaining ) - { - if( totalRemaining >= 100 ) - return 100; - - if ( attrDamage <= 0 ) - return totalRemaining; - - int removedDamage = attrDamage; - - if ( (element - removedDamage) < 0 ) - removedDamage = element; - - if( removedDamage > 100 - totalRemaining ) - removedDamage = 100 - totalRemaining; - - element -= removedDamage; - - return totalRemaining + removedDamage; - } public virtual void OnMiss( Mobile attacker, Mobile defender ) { @@ -2520,33 +2447,20 @@ namespace Server.Items if ( setIf ) flags |= toSet; } - - private static void SetSaveFlag( ref SaveFlag2 flags, SaveFlag2 toSet, bool setIf ) - { - if ( setIf ) - flags |= toSet; - } private static bool GetSaveFlag( SaveFlag flags, SaveFlag toGet ) { return ( (flags & toGet) != 0 ); } - - private static bool GetSaveFlag( SaveFlag2 flags, SaveFlag2 toGet ) - { - return ( (flags & toGet) != 0 ); - } public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); - writer.Write( (int) 10 ); // version + writer.Write( (int) 9 ); // version SaveFlag flags = SaveFlag.None; - SaveFlag2 flags2 = SaveFlag2.None; - //SaveFlag SetSaveFlag( ref flags, SaveFlag.DamageLevel, m_DamageLevel != WeaponDamageLevel.Regular ); SetSaveFlag( ref flags, SaveFlag.AccuracyLevel, m_AccuracyLevel != WeaponAccuracyLevel.Regular ); SetSaveFlag( ref flags, SaveFlag.DurabilityLevel, m_DurabilityLevel != WeaponDurabilityLevel.Regular ); @@ -2578,23 +2492,7 @@ namespace Server.Items SetSaveFlag( ref flags, SaveFlag.Slayer2, m_Slayer2 != SlayerName.None ); SetSaveFlag( ref flags, SaveFlag.ElementalDamages, !m_AosElementDamages.IsEmpty ); SetSaveFlag( ref flags, SaveFlag.EngravedText, !String.IsNullOrEmpty( m_EngravedText ) ); - - //SaveFlag2 - SetSaveFlag( ref flags2, SaveFlag2.BonusAttributes, m_BonusRandomAttributes != null && m_BonusRandomAttributes.Length > 0 ); - SetSaveFlag( ref flags2, SaveFlag2.OriginalWeight, m_OriginalWeight != 0 ); - - writer.Write( (int) flags2 ); - - if ( GetSaveFlag( flags2, SaveFlag2.BonusAttributes ) ) - { - writer.Write( (int)m_BonusRandomAttributes.Length ); - for ( int i = 0; i < m_BonusRandomAttributes.Length; i++ ) - m_BonusRandomAttributes[i].Serialize( writer ); - } - - if ( GetSaveFlag( flags2, SaveFlag2.OriginalWeight ) ) - writer.Write( (double)m_OriginalWeight ); - + writer.Write( (int) flags ); if ( GetSaveFlag( flags, SaveFlag.DamageLevel ) ) @@ -2721,14 +2619,6 @@ namespace Server.Items ElementalDamages = 0x20000000, EngravedText = 0x40000000 } - - [Flags] - private enum SaveFlag2 - { - None = 0x00000000, - BonusAttributes = 0x00000001, - OriginalWeight = 0x00000002 - } public override void Deserialize( GenericReader reader ) { @@ -2738,23 +2628,6 @@ namespace Server.Items switch ( version ) { - case 10: - { - SaveFlag2 flags2 = (SaveFlag2)reader.ReadInt(); - - if ( GetSaveFlag( flags2, SaveFlag2.BonusAttributes ) ) - { - m_BonusRandomAttributes = new BonusAttribute[reader.ReadInt()]; - - for( int i = 0; i < m_BonusRandomAttributes.Length; i++ ) - m_BonusRandomAttributes[i] = new BonusAttribute( reader ); - } - - if ( GetSaveFlag( flags2, SaveFlag2.OriginalWeight ) ) - m_OriginalWeight = reader.ReadDouble(); - - goto case 9; - } case 9: case 8: case 7: @@ -3069,18 +2942,6 @@ namespace Server.Items if ( version < 6 ) m_PlayerConstructed = true; // we don't know, so, assume it's crafted - - if ( version < 10 ) - { - int hits = m_Hits; - int maxHits = m_MaxHits; - - m_OriginalWeight = Weight; - BonusAttributesHelper.ApplyAttributesTo( this, GetResourceBonusAttrs() ); - - m_Hits = hits; - m_MaxHits = maxHits; - } } #endregion @@ -3110,8 +2971,6 @@ namespace Server.Items m_AosWeaponAttributes = new AosWeaponAttributes( this ); m_AosSkillBonuses = new AosSkillBonuses( this ); m_AosElementDamages = new AosElementAttributes( this ); - - m_OriginalWeight = Weight; } public BaseWeapon( Serial serial ) : base( serial ) @@ -3134,24 +2993,16 @@ namespace Server.Items get{ return base.Hue; } set{ base.Hue = value; InvalidateProperties(); } } - - public int GetElementalDamageHue() - { - return GetElementalDamageHue( 0 ); - } - public int GetElementalDamageHue( int currentHue ) + public int GetElementalDamageHue() { int phys, fire, cold, pois, nrgy, chaos, direct; GetDamageTypes( null, out phys, out fire, out cold, out pois, out nrgy, out chaos, out direct ); //Order is Cold, Energy, Fire, Poison, Physical left - - if( ( m_Resource >= CraftResource.OakWood && m_Resource <= CraftResource.Frostwood ) && currentHue == CraftResources.GetHue( m_Resource ) ) - return currentHue; int currentMax = 50; - int hue = currentHue; - + int hue = 0; + if( pois >= currentMax ) { hue = 1267 + (pois - 50) / 10; @@ -3229,6 +3080,21 @@ namespace Server.Items get{ return 0; } } + public virtual int GetLuckBonus() + { + CraftResourceInfo resInfo = CraftResources.GetInfo( m_Resource ); + + if ( resInfo == null ) + return 0; + + CraftAttributeInfo attrInfo = resInfo.AttributeInfo; + + if ( attrInfo == null ) + return 0; + + return attrInfo.WeaponLuck; + } + public override void GetProperties( ObjectPropertyList list ) { base.GetProperties( list ); @@ -3277,9 +3143,6 @@ namespace Server.Items base.AddResistanceProperties( list ); int prop; - - if ( ( m_Resource >= CraftResource.OakWood && m_Resource <= CraftResource.Frostwood ) && Hue == CraftResources.GetHue( m_Resource ) ) - list.Add( CraftResources.GetLocalizationNumber( m_Resource ) ); if ( Core.ML && this is BaseRanged && ( (BaseRanged) this ).Balanced ) list.Add( 1072792 ); // Balanced @@ -3371,7 +3234,7 @@ namespace Server.Items if ( (prop = GetLowerStatReq()) != 0 ) list.Add( 1060435, prop.ToString() ); // lower requirements ~1_val~% - if ( (prop = m_AosAttributes.Luck) != 0 ) + if ( (prop = (GetLuckBonus() + m_AosAttributes.Luck)) != 0 ) list.Add( 1060436, prop.ToString() ); // luck ~1_val~ if ( (prop = m_AosWeaponAttributes.MageWeapon) != 0 ) @@ -3570,6 +3433,13 @@ namespace Server.Items if ( Core.AOS ) { + Resource = CraftResources.GetFromType( resourceType ); + + CraftContext context = craftSystem.GetContext( from ); + + if ( context != null && context.DoNotColor ) + Hue = 0; + if ( tool is BaseRunicTool ) ((BaseRunicTool)tool).ApplyAttributesTo( this ); @@ -3590,13 +3460,6 @@ namespace Server.Items from.CheckSkill( SkillName.ArmsLore, 0, 100 ); } } - - Resource = CraftResources.GetFromType( resourceType ); - - CraftContext context = craftSystem.GetContext( from ); - - if ( context != null && context.DoNotColor ) - Hue = GetElementalDamageHue(); } else if ( tool is BaseRunicTool ) { diff --git a/Scripts/Misc/AOS.cs b/Scripts/Misc/AOS.cs index bc08bfe20..f3d4de8c4 100644 --- a/Scripts/Misc/AOS.cs +++ b/Scripts/Misc/AOS.cs @@ -224,13 +224,7 @@ namespace Server EnhancePotions=0x00080000, Luck=0x00100000, SpellChanneling=0x00200000, - NightSight=0x00400000, - LowerWeight=0x00800000 - } - - public interface IAosAttributes - { - AosAttributes Attributes{ get; set; } + NightSight=0x00400000 } public sealed class AosAttributes : BaseAttributes @@ -262,9 +256,43 @@ namespace Server { Item obj = items[i]; - if( obj is IAosAttributes ) + if( obj is BaseWeapon ) { - AosAttributes attrs = ((IAosAttributes)obj).Attributes; + AosAttributes attrs = ((BaseWeapon)obj).Attributes; + + if( attrs != null ) + value += attrs[attribute]; + + if( attribute == AosAttribute.Luck ) + value += ((BaseWeapon)obj).GetLuckBonus(); + } + else if( obj is BaseArmor ) + { + AosAttributes attrs = ((BaseArmor)obj).Attributes; + + if( attrs != null ) + value += attrs[attribute]; + + if( attribute == AosAttribute.Luck ) + value += ((BaseArmor)obj).GetLuckBonus(); + } + else if( obj is BaseJewel ) + { + AosAttributes attrs = ((BaseJewel)obj).Attributes; + + if( attrs != null ) + value += attrs[attribute]; + } + else if( obj is BaseClothing ) + { + AosAttributes attrs = ((BaseClothing)obj).Attributes; + + if( attrs != null ) + value += attrs[attribute]; + } + else if( obj is Spellbook ) + { + AosAttributes attrs = ((Spellbook)obj).Attributes; if( attrs != null ) value += attrs[attribute]; @@ -394,9 +422,6 @@ namespace Server [CommandProperty( AccessLevel.GameMaster )] public int NightSight { get { return this[AosAttribute.NightSight]; } set { this[AosAttribute.NightSight] = value; } } - - [CommandProperty( AccessLevel.GameMaster )] - public int LowerWeight { get { return this[AosAttribute.LowerWeight]; } set { this[AosAttribute.LowerWeight] = value; } } } [Flags] @@ -1114,16 +1139,6 @@ namespace Server } } - if( (bitmask == (int)AosAttribute.LowerWeight) && (this is AosAttributes) ) - { - if( m_Owner is BaseArmor ) - ((BaseArmor)m_Owner).ModifyWeight(); - else if( m_Owner is BaseWeapon ) - ((BaseWeapon)m_Owner).ModifyWeight(); - else if( m_Owner is BaseOtherEquipable ) - ((BaseOtherEquipable)m_Owner).ModifyWeight(); - } - m_Owner.InvalidateProperties(); } diff --git a/Scripts/Misc/ResourceInfo.cs b/Scripts/Misc/ResourceInfo.cs index e9b777ba5..d9668235f 100644 --- a/Scripts/Misc/ResourceInfo.cs +++ b/Scripts/Misc/ResourceInfo.cs @@ -48,32 +48,52 @@ namespace Server.Items public class CraftAttributeInfo { - private BonusAttribute[] m_WeaponAttributes; - private BonusAttribute[] m_ArmorAttributes; - private BonusAttribute[] m_ShieldAttributes; - private BonusAttribute[] m_OtherAttributes; - - private int m_RandomAttributeCount; - private BonusAttribute[] m_WeaponRandomAttributes; - private BonusAttribute[] m_ArmorRandomAttributes; - private BonusAttribute[] m_ShieldRandomAttributes; - private BonusAttribute[] m_OtherRandomAttributes; + private int m_WeaponFireDamage; + private int m_WeaponColdDamage; + private int m_WeaponPoisonDamage; + private int m_WeaponEnergyDamage; + private int m_WeaponChaosDamage; + private int m_WeaponDirectDamage; + private int m_WeaponDurability; + private int m_WeaponLuck; + private int m_WeaponGoldIncrease; + private int m_WeaponLowerRequirements; + + private int m_ArmorPhysicalResist; + private int m_ArmorFireResist; + private int m_ArmorColdResist; + private int m_ArmorPoisonResist; + private int m_ArmorEnergyResist; + private int m_ArmorDurability; + private int m_ArmorLuck; + private int m_ArmorGoldIncrease; + private int m_ArmorLowerRequirements; private int m_RunicMinAttributes; private int m_RunicMaxAttributes; private int m_RunicMinIntensity; private int m_RunicMaxIntensity; - - public BonusAttribute[] WeaponAttributes{ get{ return m_WeaponAttributes; } set{ m_WeaponAttributes = value; } } - public BonusAttribute[] ArmorAttributes{ get{ return m_ArmorAttributes; } set{ m_ArmorAttributes = value; } } - public BonusAttribute[] ShieldAttributes{ get{ return m_ShieldAttributes; } set{ m_ShieldAttributes = value; } } - public BonusAttribute[] OtherAttributes{ get{ return m_OtherAttributes; } set{ m_OtherAttributes = value; } } - - public int RandomAttributeCount{ get{ return m_RandomAttributeCount; } set{ m_RandomAttributeCount = value; } } - public BonusAttribute[] WeaponRandomAttributes{ get{ return m_WeaponRandomAttributes; } set{ m_WeaponRandomAttributes = value; } } - public BonusAttribute[] ArmorRandomAttributes{ get{ return m_ArmorRandomAttributes; } set{ m_ArmorRandomAttributes = value; } } - public BonusAttribute[] ShieldRandomAttributes{ get{ return m_ShieldRandomAttributes; } set{ m_ShieldRandomAttributes = value; } } - public BonusAttribute[] OtherRandomAttributes{ get{ return m_OtherRandomAttributes; } set{ m_OtherRandomAttributes = value; } } + + public int WeaponFireDamage{ get{ return m_WeaponFireDamage; } set{ m_WeaponFireDamage = value; } } + public int WeaponColdDamage{ get{ return m_WeaponColdDamage; } set{ m_WeaponColdDamage = value; } } + public int WeaponPoisonDamage{ get{ return m_WeaponPoisonDamage; } set{ m_WeaponPoisonDamage = value; } } + public int WeaponEnergyDamage{ get{ return m_WeaponEnergyDamage; } set{ m_WeaponEnergyDamage = value; } } + public int WeaponChaosDamage{ get{ return m_WeaponChaosDamage; } set{ m_WeaponChaosDamage = value; } } + public int WeaponDirectDamage{ get{ return m_WeaponDirectDamage; } set{ m_WeaponDirectDamage = value; } } + public int WeaponDurability{ get{ return m_WeaponDurability; } set{ m_WeaponDurability = value; } } + public int WeaponLuck{ get{ return m_WeaponLuck; } set{ m_WeaponLuck = value; } } + public int WeaponGoldIncrease{ get{ return m_WeaponGoldIncrease; } set{ m_WeaponGoldIncrease = value; } } + public int WeaponLowerRequirements{ get{ return m_WeaponLowerRequirements; } set{ m_WeaponLowerRequirements = value; } } + + public int ArmorPhysicalResist{ get{ return m_ArmorPhysicalResist; } set{ m_ArmorPhysicalResist = value; } } + public int ArmorFireResist{ get{ return m_ArmorFireResist; } set{ m_ArmorFireResist = value; } } + public int ArmorColdResist{ get{ return m_ArmorColdResist; } set{ m_ArmorColdResist = value; } } + public int ArmorPoisonResist{ get{ return m_ArmorPoisonResist; } set{ m_ArmorPoisonResist = value; } } + public int ArmorEnergyResist{ get{ return m_ArmorEnergyResist; } set{ m_ArmorEnergyResist = value; } } + public int ArmorDurability{ get{ return m_ArmorDurability; } set{ m_ArmorDurability = value; } } + public int ArmorLuck{ get{ return m_ArmorLuck; } set{ m_ArmorLuck = value; } } + public int ArmorGoldIncrease{ get{ return m_ArmorGoldIncrease; } set{ m_ArmorGoldIncrease = value; } } + public int ArmorLowerRequirements{ get{ return m_ArmorLowerRequirements; } set{ m_ArmorLowerRequirements = value; } } public int RunicMinAttributes{ get{ return m_RunicMinAttributes; } set{ m_RunicMinAttributes = value; } } public int RunicMaxAttributes{ get{ return m_RunicMaxAttributes; } set{ m_RunicMaxAttributes = value; } } @@ -96,15 +116,11 @@ namespace Server.Items CraftAttributeInfo dullCopper = DullCopper = new CraftAttributeInfo(); - dullCopper.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 6 ), - new BonusAttribute( AosArmorAttribute.DurabilityBonus, 50 ), - new BonusAttribute( AosArmorAttribute.LowerStatReq, 20 ) - }; - dullCopper.WeaponAttributes = new BonusAttribute[] { - new BonusAttribute( AosWeaponAttribute.DurabilityBonus, 100 ), - new BonusAttribute( AosWeaponAttribute.LowerStatReq, 50 ) - }; + dullCopper.ArmorPhysicalResist = 6; + dullCopper.ArmorDurability = 50; + dullCopper.ArmorLowerRequirements = 20; + dullCopper.WeaponDurability = 100; + dullCopper.WeaponLowerRequirements = 50; dullCopper.RunicMinAttributes = 1; dullCopper.RunicMaxAttributes = 2; if ( Core.ML ) @@ -120,16 +136,12 @@ namespace Server.Items CraftAttributeInfo shadowIron = ShadowIron = new CraftAttributeInfo(); - shadowIron.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 2 ), - new BonusAttribute( ResistanceType.Fire, 1 ), - new BonusAttribute( ResistanceType.Energy, 5 ), - new BonusAttribute( AosArmorAttribute.DurabilityBonus, 100 ) - }; - shadowIron.WeaponAttributes = new BonusAttribute[] { - new BonusAttribute( AosElementAttribute.Cold, 20 ), - new BonusAttribute( AosWeaponAttribute.DurabilityBonus, 50 ) - }; + shadowIron.ArmorPhysicalResist = 2; + shadowIron.ArmorFireResist = 1; + shadowIron.ArmorEnergyResist = 5; + shadowIron.ArmorDurability = 100; + shadowIron.WeaponColdDamage = 20; + shadowIron.WeaponDurability = 50; shadowIron.RunicMinAttributes = 2; shadowIron.RunicMaxAttributes = 2; if ( Core.ML ) @@ -145,16 +157,12 @@ namespace Server.Items CraftAttributeInfo copper = Copper = new CraftAttributeInfo(); - copper.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 1 ), - new BonusAttribute( ResistanceType.Fire, 1 ), - new BonusAttribute( ResistanceType.Poison, 5 ), - new BonusAttribute( ResistanceType.Energy, 2 ) - }; - copper.WeaponAttributes = new BonusAttribute[] { - new BonusAttribute( AosElementAttribute.Poison, 10 ), - new BonusAttribute( AosElementAttribute.Energy, 20 ) - }; + copper.ArmorPhysicalResist = 1; + copper.ArmorFireResist = 1; + copper.ArmorPoisonResist = 5; + copper.ArmorEnergyResist = 2; + copper.WeaponPoisonDamage = 10; + copper.WeaponEnergyDamage = 20; copper.RunicMinAttributes = 2; copper.RunicMaxAttributes = 3; if ( Core.ML ) @@ -170,15 +178,11 @@ namespace Server.Items CraftAttributeInfo bronze = Bronze = new CraftAttributeInfo(); - bronze.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 3 ), - new BonusAttribute( ResistanceType.Cold, 5 ), - new BonusAttribute( ResistanceType.Poison, 1 ), - new BonusAttribute( ResistanceType.Energy, 1 ) - }; - bronze.WeaponAttributes = new BonusAttribute[] { - new BonusAttribute( AosElementAttribute.Fire, 40 ) - }; + bronze.ArmorPhysicalResist = 3; + bronze.ArmorColdResist = 5; + bronze.ArmorPoisonResist = 1; + bronze.ArmorEnergyResist = 1; + bronze.WeaponFireDamage = 40; bronze.RunicMinAttributes = 3; bronze.RunicMaxAttributes = 3; if ( Core.ML ) @@ -194,18 +198,14 @@ namespace Server.Items CraftAttributeInfo golden = Golden = new CraftAttributeInfo(); - golden.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 1 ), - new BonusAttribute( ResistanceType.Fire, 1 ), - new BonusAttribute( ResistanceType.Cold, 2 ), - new BonusAttribute( ResistanceType.Energy, 2 ), - new BonusAttribute( AosAttribute.Luck, 40 ), - new BonusAttribute( AosArmorAttribute.LowerStatReq, 30 ) - }; - golden.WeaponAttributes = new BonusAttribute[] { - new BonusAttribute( AosAttribute.Luck, 40 ), - new BonusAttribute( AosWeaponAttribute.LowerStatReq, 50 ) - }; + golden.ArmorPhysicalResist = 1; + golden.ArmorFireResist = 1; + golden.ArmorColdResist = 2; + golden.ArmorEnergyResist = 2; + golden.ArmorLuck = 40; + golden.ArmorLowerRequirements = 30; + golden.WeaponLuck = 40; + golden.WeaponLowerRequirements = 50; golden.RunicMinAttributes = 3; golden.RunicMaxAttributes = 4; if ( Core.ML ) @@ -221,17 +221,13 @@ namespace Server.Items CraftAttributeInfo agapite = Agapite = new CraftAttributeInfo(); - agapite.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 2 ), - new BonusAttribute( ResistanceType.Fire, 3 ), - new BonusAttribute( ResistanceType.Cold, 2 ), - new BonusAttribute( ResistanceType.Poison, 2 ), - new BonusAttribute( ResistanceType.Energy, 2 ) - }; - agapite.WeaponAttributes = new BonusAttribute[] { - new BonusAttribute( AosElementAttribute.Cold, 30 ), - new BonusAttribute( AosElementAttribute.Energy, 20 ) - }; + agapite.ArmorPhysicalResist = 2; + agapite.ArmorFireResist = 3; + agapite.ArmorColdResist = 2; + agapite.ArmorPoisonResist = 2; + agapite.ArmorEnergyResist = 2; + agapite.WeaponColdDamage = 30; + agapite.WeaponEnergyDamage = 20; agapite.RunicMinAttributes = 4; agapite.RunicMaxAttributes = 4; if ( Core.ML ) @@ -247,17 +243,13 @@ namespace Server.Items CraftAttributeInfo verite = Verite = new CraftAttributeInfo(); - verite.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 3 ), - new BonusAttribute( ResistanceType.Fire, 3 ), - new BonusAttribute( ResistanceType.Cold, 2 ), - new BonusAttribute( ResistanceType.Poison, 3 ), - new BonusAttribute( ResistanceType.Energy, 1 ) - }; - verite.WeaponAttributes = new BonusAttribute[] { - new BonusAttribute( AosElementAttribute.Poison, 40 ), - new BonusAttribute( AosElementAttribute.Energy, 20 ) - }; + verite.ArmorPhysicalResist = 3; + verite.ArmorFireResist = 3; + verite.ArmorColdResist = 2; + verite.ArmorPoisonResist = 3; + verite.ArmorEnergyResist = 1; + verite.WeaponPoisonDamage = 40; + verite.WeaponEnergyDamage = 20; verite.RunicMinAttributes = 4; verite.RunicMaxAttributes = 5; if ( Core.ML ) @@ -273,19 +265,15 @@ namespace Server.Items CraftAttributeInfo valorite = Valorite = new CraftAttributeInfo(); - valorite.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 4 ), - new BonusAttribute( ResistanceType.Cold, 3 ), - new BonusAttribute( ResistanceType.Poison, 3 ), - new BonusAttribute( ResistanceType.Energy, 3 ), - new BonusAttribute( AosArmorAttribute.DurabilityBonus, 50 ) - }; - valorite.WeaponAttributes = new BonusAttribute[] { - new BonusAttribute( AosElementAttribute.Fire, 10 ), - new BonusAttribute( AosElementAttribute.Cold, 20 ), - new BonusAttribute( AosElementAttribute.Poison, 10 ), - new BonusAttribute( AosElementAttribute.Energy, 20 ) - }; + valorite.ArmorPhysicalResist = 4; + valorite.ArmorColdResist = 3; + valorite.ArmorPoisonResist = 3; + valorite.ArmorEnergyResist = 3; + valorite.ArmorDurability = 50; + valorite.WeaponFireDamage = 10; + valorite.WeaponColdDamage = 20; + valorite.WeaponPoisonDamage = 10; + valorite.WeaponEnergyDamage = 20; valorite.RunicMinAttributes = 5; valorite.RunicMaxAttributes = 5; if ( Core.ML ) @@ -301,10 +289,8 @@ namespace Server.Items CraftAttributeInfo spined = Spined = new CraftAttributeInfo(); - spined.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 5 ), - new BonusAttribute( AosAttribute.Luck, 40 ) - }; + spined.ArmorPhysicalResist = 5; + spined.ArmorLuck = 40; spined.RunicMinAttributes = 1; spined.RunicMaxAttributes = 3; if ( Core.ML ) @@ -320,13 +306,11 @@ namespace Server.Items CraftAttributeInfo horned = Horned = new CraftAttributeInfo(); - horned.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 2 ), - new BonusAttribute( ResistanceType.Fire, 3 ), - new BonusAttribute( ResistanceType.Cold, 2 ), - new BonusAttribute( ResistanceType.Poison, 2 ), - new BonusAttribute( ResistanceType.Energy, 2 ) - }; + horned.ArmorPhysicalResist = 2; + horned.ArmorFireResist = 3; + horned.ArmorColdResist = 2; + horned.ArmorPoisonResist = 2; + horned.ArmorEnergyResist = 2; horned.RunicMinAttributes = 3; horned.RunicMaxAttributes = 4; if ( Core.ML ) @@ -342,13 +326,11 @@ namespace Server.Items CraftAttributeInfo barbed = Barbed = new CraftAttributeInfo(); - barbed.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 2 ), - new BonusAttribute( ResistanceType.Fire, 1 ), - new BonusAttribute( ResistanceType.Cold, 2 ), - new BonusAttribute( ResistanceType.Poison, 3 ), - new BonusAttribute( ResistanceType.Energy, 4 ) - }; + barbed.ArmorPhysicalResist = 2; + barbed.ArmorFireResist = 1; + barbed.ArmorColdResist = 2; + barbed.ArmorPoisonResist = 3; + barbed.ArmorEnergyResist = 4; barbed.RunicMinAttributes = 4; barbed.RunicMaxAttributes = 5; if ( Core.ML ) @@ -364,235 +346,47 @@ namespace Server.Items CraftAttributeInfo red = RedScales = new CraftAttributeInfo(); - red.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Fire, 10 ), - new BonusAttribute( ResistanceType.Cold, -3 ) - }; + red.ArmorFireResist = 10; + red.ArmorColdResist = -3; CraftAttributeInfo yellow = YellowScales = new CraftAttributeInfo(); - yellow.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, -3 ), - new BonusAttribute( AosAttribute.Luck, 20 ) - }; + yellow.ArmorPhysicalResist = -3; + yellow.ArmorLuck = 20; CraftAttributeInfo black = BlackScales = new CraftAttributeInfo(); - black.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 10 ), - new BonusAttribute( ResistanceType.Energy, -3 ) - }; + black.ArmorPhysicalResist = 10; + black.ArmorEnergyResist = -3; CraftAttributeInfo green = GreenScales = new CraftAttributeInfo(); - green.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Fire, -3 ), - new BonusAttribute( ResistanceType.Poison, 10 ) - }; + green.ArmorFireResist = -3; + green.ArmorPoisonResist = 10; CraftAttributeInfo white = WhiteScales = new CraftAttributeInfo(); - white.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, -3 ), - new BonusAttribute( ResistanceType.Cold, 10 ) - }; + white.ArmorPhysicalResist = -3; + white.ArmorColdResist = 10; CraftAttributeInfo blue = BlueScales = new CraftAttributeInfo(); - blue.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Poison, -3 ), - new BonusAttribute( ResistanceType.Energy, 10 ) - }; + blue.ArmorPoisonResist = -3; + blue.ArmorEnergyResist = 10; + + //public static readonly CraftAttributeInfo OakWood, AshWood, YewWood, Heartwood, Bloodwood, Frostwood; - #region Mondain's Legacy CraftAttributeInfo oak = OakWood = new CraftAttributeInfo(); - - oak.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 3 ), - new BonusAttribute( ResistanceType.Fire, 3 ), - new BonusAttribute( ResistanceType.Poison, 2 ), - new BonusAttribute( ResistanceType.Energy, 3 ), - new BonusAttribute( AosAttribute.Luck, 40 ), - new BonusAttribute( AosArmorAttribute.DurabilityBonus, 50 ) - }; - oak.WeaponAttributes = new BonusAttribute[] { - new BonusAttribute( AosAttribute.Luck, 40 ), - new BonusAttribute( AosAttribute.WeaponDamage, 5 ), - new BonusAttribute( AosWeaponAttribute.DurabilityBonus, 50 ) - }; - oak.ShieldAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 1 ), - new BonusAttribute( ResistanceType.Fire, 1 ), - new BonusAttribute( ResistanceType.Cold, 1 ), - new BonusAttribute( ResistanceType.Poison, 1 ), - new BonusAttribute( ResistanceType.Energy, 1 ) - }; - oak.OtherAttributes = new BonusAttribute[] { - new BonusAttribute( AosAttribute.Luck, 40 ) - }; - oak.RunicMinAttributes = 1; - oak.RunicMaxAttributes = 2; - oak.RunicMinIntensity = 1; - oak.RunicMaxIntensity = 50; CraftAttributeInfo ash = AshWood = new CraftAttributeInfo(); - ash.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 3 ), - new BonusAttribute( ResistanceType.Cold, 3 ), - new BonusAttribute( ResistanceType.Poison, 2 ), - new BonusAttribute( ResistanceType.Energy, 3 ), - new BonusAttribute( AosArmorAttribute.LowerStatReq, 20 ), - new BonusAttribute( AosAttribute.LowerWeight, 75 ) - }; - ash.WeaponAttributes = new BonusAttribute[] { - new BonusAttribute( AosAttribute.WeaponSpeed, 10 ), - new BonusAttribute( AosAttribute.LowerWeight, 75 ), - new BonusAttribute( AosWeaponAttribute.LowerStatReq, 20 ) - }; - ash.ShieldAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Energy, 3 ), - new BonusAttribute( AosArmorAttribute.LowerStatReq, 20 ) - }; - ash.OtherAttributes = new BonusAttribute[] { - new BonusAttribute( AosArmorAttribute.LowerStatReq, 20 ) - }; - ash.RunicMinAttributes = 2; - ash.RunicMaxAttributes = 3; - ash.RunicMinIntensity = 35; - ash.RunicMaxIntensity = 75; - CraftAttributeInfo yew = YewWood = new CraftAttributeInfo(); - yew.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 6 ), - new BonusAttribute( ResistanceType.Fire, 3 ), - new BonusAttribute( ResistanceType.Cold, 3 ), - new BonusAttribute( ResistanceType.Energy, 3 ), - new BonusAttribute( AosAttribute.RegenHits, 1 ) - }; - yew.WeaponAttributes = new BonusAttribute[] { - new BonusAttribute( AosAttribute.WeaponDamage, 10 ), - new BonusAttribute( AosAttribute.AttackChance, 5 ) - }; - yew.ShieldAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 3 ), - new BonusAttribute( AosAttribute.RegenHits, 1 ) - }; - yew.OtherAttributes = new BonusAttribute[] { - new BonusAttribute( AosAttribute.RegenHits, 2 ) - }; - yew.RunicMinAttributes = 3; - yew.RunicMaxAttributes = 3; - yew.RunicMinIntensity = 40; - yew.RunicMaxIntensity = 90; - CraftAttributeInfo heart = Heartwood = new CraftAttributeInfo(); - - heart.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 2 ), - new BonusAttribute( ResistanceType.Fire, 3 ), - new BonusAttribute( ResistanceType.Cold, 2 ), - new BonusAttribute( ResistanceType.Poison, 7 ), - new BonusAttribute( ResistanceType.Energy, 2 ) - }; - - #region Random Attributes - heart.RandomAttributeCount = 1; - heart.ArmorRandomAttributes = new BonusAttribute[] { - new BonusAttribute( AosAttribute.Luck, 40 ), - new BonusAttribute( AosArmorAttribute.DurabilityBonus, 50 ), - new BonusAttribute( AosArmorAttribute.LowerStatReq, 20 ), - new BonusAttribute( AosAttribute.WeaponDamage, 10 ), - new BonusAttribute( AosAttribute.LowerWeight, 50 ), - new BonusAttribute( AosAttribute.AttackChance, 5 ), - new BonusAttribute( AosArmorAttribute.MageArmor, 1 ) - }; - - heart.WeaponRandomAttributes = new BonusAttribute[] { - new BonusAttribute( AosAttribute.Luck, 40 ), - new BonusAttribute( AosWeaponAttribute.DurabilityBonus, 50 ), - new BonusAttribute( AosWeaponAttribute.LowerStatReq, 20 ), - new BonusAttribute( AosAttribute.WeaponSpeed, 10 ), - new BonusAttribute( AosAttribute.LowerWeight, 75 ), - new BonusAttribute( AosAttribute.AttackChance, 5 ), - new BonusAttribute( AosWeaponAttribute.HitLeechHits, 13 ), - new BonusAttribute( AosAttribute.Luck, 10 ) - }; - - heart.ShieldRandomAttributes = new BonusAttribute[] { - new BonusAttribute( AosAttribute.BonusDex, 2 ), - new BonusAttribute( AosAttribute.BonusStr, 2 ), - new BonusAttribute( ResistanceType.Physical, 5 ), - new BonusAttribute( AosAttribute.ReflectPhysical, 5 ), - new BonusAttribute( AosArmorAttribute.SelfRepair, 2 ), - new BonusAttribute( ResistanceType.Cold, 3 ), - new BonusAttribute( AosAttribute.SpellChanneling, 1 ) - }; - - heart.OtherRandomAttributes = new BonusAttribute[] { - new BonusAttribute( AosAttribute.Luck, 40 ), - new BonusAttribute( AosAttribute.RegenHits, 2 ), - new BonusAttribute( AosArmorAttribute.LowerStatReq, 20 ), - new BonusAttribute( AosAttribute.SpellChanneling, 1 ), - new BonusAttribute( AosAttribute.Luck, 10 ) - }; - #endregion - - heart.RunicMinAttributes = 4; - heart.RunicMaxAttributes = 4; - heart.RunicMinIntensity = 50; - heart.RunicMaxIntensity = 100; CraftAttributeInfo blood = Bloodwood = new CraftAttributeInfo(); - - blood.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 3 ), - new BonusAttribute( ResistanceType.Fire, 8 ), - new BonusAttribute( ResistanceType.Cold, 1 ), - new BonusAttribute( ResistanceType.Poison, 3 ), - new BonusAttribute( ResistanceType.Energy, 3 ), - new BonusAttribute( AosAttribute.RegenHits, 2 ) - }; - blood.WeaponAttributes = new BonusAttribute[] { - new BonusAttribute( AosAttribute.RegenHits, 2 ), - new BonusAttribute( AosWeaponAttribute.HitLeechHits, 13 ) - }; - blood.ShieldAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Fire, 3 ), - new BonusAttribute( AosAttribute.Luck, 40 ), - new BonusAttribute( AosAttribute.RegenHits, 2 ) - }; - blood.OtherAttributes = new BonusAttribute[] { - new BonusAttribute( AosAttribute.RegenHits, 2 ), - new BonusAttribute( AosAttribute.Luck, 20 ) - }; CraftAttributeInfo frost = Frostwood = new CraftAttributeInfo(); - - frost.ArmorAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Physical, 2 ), - new BonusAttribute( ResistanceType.Fire, 1 ), - new BonusAttribute( ResistanceType.Cold, 8 ), - new BonusAttribute( ResistanceType.Poison, 3 ), - new BonusAttribute( ResistanceType.Energy, 4 ) - }; - blood.WeaponAttributes = new BonusAttribute[] { - - new BonusAttribute( AosWeaponAttribute.HitLeechHits, 13 ) - }; - frost.WeaponAttributes = new BonusAttribute[] { - new BonusAttribute( AosElementAttribute.Cold, 40 ), - new BonusAttribute( AosAttribute.WeaponDamage, 12 ) - }; - frost.ShieldAttributes = new BonusAttribute[] { - new BonusAttribute( ResistanceType.Cold, 3 ), - new BonusAttribute( AosAttribute.SpellChanneling, 1 ) - }; - frost.OtherAttributes = new BonusAttribute[] { - new BonusAttribute( AosAttribute.SpellChanneling, 1 ) - }; - #endregion } } diff --git a/Scripts/Mobiles/PlayerMobile.cs b/Scripts/Mobiles/PlayerMobile.cs index 61ef91be8..e5b0d7fcc 100644 --- a/Scripts/Mobiles/PlayerMobile.cs +++ b/Scripts/Mobiles/PlayerMobile.cs @@ -505,9 +505,6 @@ namespace Server.Mobiles if ( fp != null ) { - if ( !fp.IsDynamicFlipable ) - return true; - int[] itemIDs = fp.ItemIDs; Point3D oldWorldLoc = bi.m_WorldLoc; diff --git a/Scripts/Multis/BaseHouse.cs b/Scripts/Multis/BaseHouse.cs index 3bb3cc499..8bd38b218 100644 --- a/Scripts/Multis/BaseHouse.cs +++ b/Scripts/Multis/BaseHouse.cs @@ -1014,7 +1014,7 @@ namespace Server.Multis return IsFriend( from ); else if ( item is PotionKeg ) return IsFriend( from ); - else if ( item is BaseGameBoard ) + else if ( item is BaseBoard ) return true; else if ( item is Dices ) return true; @@ -1456,7 +1456,7 @@ namespace Server.Multis if ( !locked ) i.SetLastMoved(); - if ( (i is Container) && (!locked || !(i is BaseGameBoard)) ) + if ( (i is Container) && (!locked || !(i is BaseBoard)) ) { foreach ( Item c in i.Items ) SetLockdown( c, locked, checkContains ); @@ -2355,7 +2355,7 @@ namespace Server.Multis { Item item = (Item)m_LockDowns[i]; - if ( item is Container && !(item is BaseGameBoard) ) + if ( item is Container && !(item is BaseBoard) ) { Container cont = (Container)item; List children = cont.Items; diff --git a/Scripts/Skills/Meditation.cs b/Scripts/Skills/Meditation.cs index 478c61612..95ee6d3b1 100644 --- a/Scripts/Skills/Meditation.cs +++ b/Scripts/Skills/Meditation.cs @@ -18,7 +18,10 @@ namespace Server.SkillHandlers if ( item is Spellbook || item is Runebook ) return true; - if ( Core.AOS && item is IAosAttributes && ((IAosAttributes)item).Attributes.SpellChanneling != 0 ) + if ( Core.AOS && item is BaseWeapon && ((BaseWeapon)item).Attributes.SpellChanneling != 0 ) + return true; + + if ( Core.AOS && item is BaseArmor && ((BaseArmor)item).Attributes.SpellChanneling != 0 ) return true; return false;