Fixes code according to modern code style. Fixes a few expression bugs.

This commit is contained in:
Kamron Batman 2018-09-15 09:58:51 -07:00
parent 89eea25e5f
commit 970fd563b2
3324 changed files with 441118 additions and 433755 deletions

View file

@ -2,54 +2,54 @@ using System.Collections.Generic;
namespace Server.Engines.Craft
{
public enum CraftMarkOption
{
MarkItem,
DoNotMark,
PromptForMark
}
public enum CraftMarkOption
{
MarkItem,
DoNotMark,
PromptForMark
}
public class CraftContext
{
public List<CraftItem> Items { get; }
public class CraftContext
{
public CraftContext()
{
Items = new List<CraftItem>();
LastResourceIndex = -1;
LastResourceIndex2 = -1;
LastGroupIndex = -1;
}
public int LastResourceIndex { get; set; }
public List<CraftItem> Items{ get; }
public int LastResourceIndex2 { get; set; }
public int LastResourceIndex{ get; set; }
public int LastGroupIndex { get; set; }
public int LastResourceIndex2{ get; set; }
public bool DoNotColor { get; set; }
public int LastGroupIndex{ get; set; }
public CraftMarkOption MarkOption { get; set; }
public bool DoNotColor{ get; set; }
public CraftContext()
{
Items = new List<CraftItem>();
LastResourceIndex = -1;
LastResourceIndex2 = -1;
LastGroupIndex = -1;
}
public CraftMarkOption MarkOption{ get; set; }
public CraftItem LastMade
{
get
{
if ( Items.Count > 0 )
return Items[0];
public CraftItem LastMade
{
get
{
if (Items.Count > 0)
return Items[0];
return null;
}
}
return null;
}
}
public void OnMade( CraftItem item )
{
Items.Remove( item );
public void OnMade(CraftItem item)
{
Items.Remove(item);
if ( Items.Count == 10 )
Items.RemoveAt( 9 );
if (Items.Count == 10)
Items.RemoveAt(9);
Items.Insert( 0, item );
}
}
}
Items.Insert(0, item);
}
}
}

View file

@ -1,23 +1,23 @@
namespace Server.Engines.Craft
{
public class CraftGroup
{
public CraftGroup( TextDefinition groupName )
{
NameNumber = groupName;
NameString = groupName;
CraftItems = new CraftItemCol();
}
public class CraftGroup
{
public CraftGroup(TextDefinition groupName)
{
NameNumber = groupName;
NameString = groupName;
CraftItems = new CraftItemCol();
}
public void AddCraftItem( CraftItem craftItem )
{
CraftItems.Add( craftItem );
}
public CraftItemCol CraftItems{ get; }
public CraftItemCol CraftItems { get; }
public string NameString{ get; }
public string NameString { get; }
public int NameNumber{ get; }
public int NameNumber { get; }
}
public void AddCraftItem(CraftItem craftItem)
{
CraftItems.Add(craftItem);
}
}
}

View file

@ -1,46 +1,45 @@
using System.Collections;
namespace Server.Engines.Craft
{
public class CraftGroupCol : System.Collections.CollectionBase
{
public CraftGroupCol()
{
}
public class CraftGroupCol : CollectionBase
{
public int Add(CraftGroup craftGroup)
{
return List.Add(craftGroup);
}
public int Add( CraftGroup craftGroup )
{
return List.Add( craftGroup );
}
public void Remove(int index)
{
if (index > Count - 1 || index < 0)
{
}
else
{
List.RemoveAt(index);
}
}
public void Remove( int index )
{
if ( index > Count - 1 || index < 0 )
{
}
else
{
List.RemoveAt( index );
}
}
public CraftGroup GetAt(int index)
{
return (CraftGroup)List[index];
}
public CraftGroup GetAt( int index )
{
return ( CraftGroup ) List[index];
}
public int SearchFor(TextDefinition groupName)
{
for (int i = 0; i < List.Count; i++)
{
CraftGroup craftGroup = (CraftGroup)List[i];
public int SearchFor( TextDefinition groupName )
{
for ( int i = 0; i < List.Count; i++ )
{
CraftGroup craftGroup = (CraftGroup)List[i];
int nameNumber = craftGroup.NameNumber;
string nameString = craftGroup.NameString;
int nameNumber = craftGroup.NameNumber;
string nameString = craftGroup.NameString;
if (nameNumber != 0 && nameNumber == groupName.Number ||
nameString != null && nameString == groupName.String)
return i;
}
if ( ( nameNumber != 0 && nameNumber == groupName.Number ) || ( nameString != null && nameString == groupName.String ) )
return i;
}
return -1;
}
}
return -1;
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,287 +1,295 @@
using System;
using Server.Gumps;
using Server.Network;
using Server.Items;
using Server.Mobiles;
using Server.Network;
namespace Server.Engines.Craft
{
public class CraftGumpItem : Gump
{
private Mobile m_From;
private CraftSystem m_CraftSystem;
private CraftItem m_CraftItem;
private BaseTool m_Tool;
public class CraftGumpItem : Gump
{
private const int LabelHue = 0x480; // 0x384
private const int RedLabelHue = 0x20;
private const int LabelHue = 0x480; // 0x384
private const int RedLabelHue = 0x20;
private const int LabelColor = 0x7FFF;
private const int RedLabelColor = 0x6400;
private const int LabelColor = 0x7FFF;
private const int RedLabelColor = 0x6400;
private const int GreyLabelColor = 0x3DEF;
private const int GreyLabelColor = 0x3DEF;
private static Type typeofBlankScroll = typeof(BlankScroll);
private static Type typeofSpellScroll = typeof(SpellScroll);
private CraftItem m_CraftItem;
private CraftSystem m_CraftSystem;
private Mobile m_From;
private int m_OtherCount;
private int m_OtherCount;
public CraftGumpItem( Mobile from, CraftSystem craftSystem, CraftItem craftItem, BaseTool tool ) : base( 40, 40 )
{
m_From = from;
m_CraftSystem = craftSystem;
m_CraftItem = craftItem;
m_Tool = tool;
private bool m_ShowExceptionalChance;
private BaseTool m_Tool;
from.CloseGump( typeof( CraftGump ) );
from.CloseGump( typeof( CraftGumpItem ) );
public CraftGumpItem(Mobile from, CraftSystem craftSystem, CraftItem craftItem, BaseTool tool) : base(40, 40)
{
m_From = from;
m_CraftSystem = craftSystem;
m_CraftItem = craftItem;
m_Tool = tool;
AddPage( 0 );
AddBackground( 0, 0, 530, 417, 5054 );
AddImageTiled( 10, 10, 510, 22, 2624 );
AddImageTiled( 10, 37, 150, 148, 2624 );
AddImageTiled( 165, 37, 355, 90, 2624 );
AddImageTiled( 10, 190, 155, 22, 2624 );
AddImageTiled( 10, 217, 150, 53, 2624 );
AddImageTiled( 165, 132, 355, 80, 2624 );
AddImageTiled( 10, 275, 155, 22, 2624 );
AddImageTiled( 10, 302, 150, 53, 2624 );
AddImageTiled( 165, 217, 355, 80, 2624 );
AddImageTiled( 10, 360, 155, 22, 2624 );
AddImageTiled( 165, 302, 355, 80, 2624 );
AddImageTiled( 10, 387, 510, 22, 2624 );
AddAlphaRegion( 10, 10, 510, 399 );
from.CloseGump(typeof(CraftGump));
from.CloseGump(typeof(CraftGumpItem));
AddHtmlLocalized( 170, 40, 150, 20, 1044053, LabelColor, false, false ); // ITEM
AddHtmlLocalized( 10, 192, 150, 22, 1044054, LabelColor, false, false ); // <CENTER>SKILLS</CENTER>
AddHtmlLocalized( 10, 277, 150, 22, 1044055, LabelColor, false, false ); // <CENTER>MATERIALS</CENTER>
AddHtmlLocalized( 10, 362, 150, 22, 1044056, LabelColor, false, false ); // <CENTER>OTHER</CENTER>
AddPage(0);
AddBackground(0, 0, 530, 417, 5054);
AddImageTiled(10, 10, 510, 22, 2624);
AddImageTiled(10, 37, 150, 148, 2624);
AddImageTiled(165, 37, 355, 90, 2624);
AddImageTiled(10, 190, 155, 22, 2624);
AddImageTiled(10, 217, 150, 53, 2624);
AddImageTiled(165, 132, 355, 80, 2624);
AddImageTiled(10, 275, 155, 22, 2624);
AddImageTiled(10, 302, 150, 53, 2624);
AddImageTiled(165, 217, 355, 80, 2624);
AddImageTiled(10, 360, 155, 22, 2624);
AddImageTiled(165, 302, 355, 80, 2624);
AddImageTiled(10, 387, 510, 22, 2624);
AddAlphaRegion(10, 10, 510, 399);
if ( craftSystem.GumpTitleNumber > 0 )
AddHtmlLocalized( 10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false );
else
AddHtml( 10, 12, 510, 20, craftSystem.GumpTitleString, false, false );
AddHtmlLocalized(170, 40, 150, 20, 1044053, LabelColor, false, false); // ITEM
AddHtmlLocalized(10, 192, 150, 22, 1044054, LabelColor, false, false); // <CENTER>SKILLS</CENTER>
AddHtmlLocalized(10, 277, 150, 22, 1044055, LabelColor, false, false); // <CENTER>MATERIALS</CENTER>
AddHtmlLocalized(10, 362, 150, 22, 1044056, LabelColor, false, false); // <CENTER>OTHER</CENTER>
AddButton( 15, 387, 4014, 4016, 0, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 50, 390, 150, 18, 1044150, LabelColor, false, false ); // BACK
if (craftSystem.GumpTitleNumber > 0)
AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false);
else
AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false);
bool needsRecipe = ( craftItem.Recipe != null && from is PlayerMobile mobile && !mobile.HasRecipe( craftItem.Recipe ) );
AddButton(15, 387, 4014, 4016, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(50, 390, 150, 18, 1044150, LabelColor, false, false); // BACK
if ( needsRecipe )
{
AddButton( 270, 387, 4005, 4007, 0, GumpButtonType.Page, 0 );
AddHtmlLocalized( 305, 390, 150, 18, 1044151, GreyLabelColor, false, false ); // MAKE NOW
}
else
{
AddButton( 270, 387, 4005, 4007, 1, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 305, 390, 150, 18, 1044151, LabelColor, false, false ); // MAKE NOW
}
bool needsRecipe = craftItem.Recipe != null && from is PlayerMobile mobile &&
!mobile.HasRecipe(craftItem.Recipe);
if ( craftItem.NameNumber > 0 )
AddHtmlLocalized( 330, 40, 180, 18, craftItem.NameNumber, LabelColor, false, false );
else
AddLabel( 330, 40, LabelHue, craftItem.NameString );
if (needsRecipe)
{
AddButton(270, 387, 4005, 4007, 0, GumpButtonType.Page, 0);
AddHtmlLocalized(305, 390, 150, 18, 1044151, GreyLabelColor, false, false); // MAKE NOW
}
else
{
AddButton(270, 387, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(305, 390, 150, 18, 1044151, LabelColor, false, false); // MAKE NOW
}
if ( craftItem.UseAllRes )
AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1048176, LabelColor, false, false ); // Makes as many as possible at once
if (craftItem.NameNumber > 0)
AddHtmlLocalized(330, 40, 180, 18, craftItem.NameNumber, LabelColor, false, false);
else
AddLabel(330, 40, LabelHue, craftItem.NameString);
DrawItem();
DrawSkill();
DrawResource();
if (craftItem.UseAllRes)
AddHtmlLocalized(170, 302 + m_OtherCount++ * 20, 310, 18, 1048176, LabelColor, false,
false); // Makes as many as possible at once
/*
if ( craftItem.RequiresSE )
AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1063363, LabelColor, false, false ); //* Requires the "Samurai Empire" expansion
* */
DrawItem();
DrawSkill();
DrawResource();
if ( craftItem.RequiredExpansion != Expansion.None )
{
bool supportsEx = (from.NetState != null && from.NetState.SupportsExpansion( craftItem.RequiredExpansion ));
TextDefinition.AddHtmlText( this, 170, 302 + (m_OtherCount++ * 20), 310, 18, RequiredExpansionMessage( craftItem.RequiredExpansion ), false, false, supportsEx ? LabelColor : RedLabelColor, supportsEx ? LabelHue : RedLabelHue );
}
/*
if ( craftItem.RequiresSE )
AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1063363, LabelColor, false, false ); //* Requires the "Samurai Empire" expansion
* */
if ( needsRecipe )
AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1073620, RedLabelColor, false, false ); // You have not learned this recipe.
if (craftItem.RequiredExpansion != Expansion.None)
{
bool supportsEx = from.NetState != null && from.NetState.SupportsExpansion(craftItem.RequiredExpansion);
TextDefinition.AddHtmlText(this, 170, 302 + m_OtherCount++ * 20, 310, 18,
RequiredExpansionMessage(craftItem.RequiredExpansion), false, false,
supportsEx ? LabelColor : RedLabelColor, supportsEx ? LabelHue : RedLabelHue);
}
}
if (needsRecipe)
AddHtmlLocalized(170, 302 + m_OtherCount++ * 20, 310, 18, 1073620, RedLabelColor, false,
false); // You have not learned this recipe.
}
private TextDefinition RequiredExpansionMessage( Expansion expansion )
{
switch( expansion )
{
case Expansion.SE:
return 1063363; // * Requires the "Samurai Empire" expansion
case Expansion.ML:
return 1072651; // * Requires the "Mondain's Legacy" expansion
default:
return $"* Requires the \"{ExpansionInfo.GetInfo(expansion).Name}\" expansion";
}
}
private TextDefinition RequiredExpansionMessage(Expansion expansion)
{
switch (expansion)
{
case Expansion.SE:
return 1063363; // * Requires the "Samurai Empire" expansion
case Expansion.ML:
return 1072651; // * Requires the "Mondain's Legacy" expansion
default:
return $"* Requires the \"{ExpansionInfo.GetInfo(expansion).Name}\" expansion";
}
}
private bool m_ShowExceptionalChance;
public void DrawItem()
{
Type type = m_CraftItem.ItemType;
public void DrawItem()
{
Type type = m_CraftItem.ItemType;
AddItem(20, 50, CraftItem.ItemIDOf(type), m_CraftItem.ItemHue);
AddItem( 20, 50, CraftItem.ItemIDOf( type ), m_CraftItem.ItemHue );
if (m_CraftItem.IsMarkable(type))
{
AddHtmlLocalized(170, 302 + m_OtherCount++ * 20, 310, 18, 1044059, LabelColor, false,
false); // This item may hold its maker's mark
m_ShowExceptionalChance = true;
}
}
if ( m_CraftItem.IsMarkable( type ) )
{
AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1044059, LabelColor, false, false ); // This item may hold its maker's mark
m_ShowExceptionalChance = true;
}
}
public void DrawSkill()
{
for (int i = 0; i < m_CraftItem.Skills.Count; i++)
{
CraftSkill skill = m_CraftItem.Skills.GetAt(i);
double minSkill = skill.MinSkill, maxSkill = skill.MaxSkill;
public void DrawSkill()
{
for ( int i = 0; i < m_CraftItem.Skills.Count; i++ )
{
CraftSkill skill = m_CraftItem.Skills.GetAt( i );
double minSkill = skill.MinSkill, maxSkill = skill.MaxSkill;
if (minSkill < 0)
minSkill = 0;
if ( minSkill < 0 )
minSkill = 0;
AddHtmlLocalized(170, 132 + i * 20, 200, 18, AosSkillBonuses.GetLabel(skill.SkillToMake), LabelColor, false,
false);
AddLabel(430, 132 + i * 20, LabelHue, $"{minSkill:F1}");
}
AddHtmlLocalized( 170, 132 + (i * 20), 200, 18, AosSkillBonuses.GetLabel( skill.SkillToMake ), LabelColor, false, false );
AddLabel( 430, 132 + (i * 20), LabelHue, $"{minSkill:F1}");
}
CraftSubResCol res = m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes;
int resIndex = -1;
CraftSubResCol res = ( m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes );
int resIndex = -1;
CraftContext context = m_CraftSystem.GetContext(m_From);
CraftContext context = m_CraftSystem.GetContext( m_From );
if (context != null)
resIndex = m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex;
if ( context != null )
resIndex = ( m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex );
bool allRequiredSkills = true;
double chance = m_CraftItem.GetSuccessChance(m_From, resIndex > -1 ? res.GetAt(resIndex).ItemType : null,
m_CraftSystem, false, ref allRequiredSkills);
double excepChance = m_CraftItem.GetExceptionalChance(m_CraftSystem, chance, m_From);
bool allRequiredSkills = true;
double chance = m_CraftItem.GetSuccessChance( m_From, resIndex > -1 ? res.GetAt( resIndex ).ItemType : null, m_CraftSystem, false, ref allRequiredSkills );
double excepChance = m_CraftItem.GetExceptionalChance( m_CraftSystem, chance, m_From );
if (chance < 0.0)
chance = 0.0;
else if (chance > 1.0)
chance = 1.0;
if ( chance < 0.0 )
chance = 0.0;
else if ( chance > 1.0 )
chance = 1.0;
AddHtmlLocalized(170, 80, 250, 18, 1044057, LabelColor, false, false); // Success Chance:
AddLabel(430, 80, LabelHue, $"{chance * 100:F1}%");
AddHtmlLocalized( 170, 80, 250, 18, 1044057, LabelColor, false, false ); // Success Chance:
AddLabel( 430, 80, LabelHue, $"{chance * 100:F1}%");
if (m_ShowExceptionalChance)
{
if (excepChance < 0.0)
excepChance = 0.0;
else if (excepChance > 1.0)
excepChance = 1.0;
if ( m_ShowExceptionalChance )
{
if ( excepChance < 0.0 )
excepChance = 0.0;
else if ( excepChance > 1.0 )
excepChance = 1.0;
AddHtmlLocalized(170, 100, 250, 18, 1044058, 32767, false, false); // Exceptional Chance:
AddLabel(430, 100, LabelHue, $"{excepChance * 100:F1}%");
}
}
AddHtmlLocalized( 170, 100, 250, 18, 1044058, 32767, false, false ); // Exceptional Chance:
AddLabel( 430, 100, LabelHue, $"{excepChance * 100:F1}%");
}
}
public void DrawResource()
{
bool retainedColor = false;
private static Type typeofBlankScroll = typeof( BlankScroll );
private static Type typeofSpellScroll = typeof( SpellScroll );
CraftContext context = m_CraftSystem.GetContext(m_From);
public void DrawResource()
{
bool retainedColor = false;
CraftSubResCol res = m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes;
int resIndex = -1;
CraftContext context = m_CraftSystem.GetContext( m_From );
if (context != null)
resIndex = m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex;
CraftSubResCol res = ( m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes );
int resIndex = -1;
bool cropScroll = m_CraftItem.Resources.Count > 1
&& m_CraftItem.Resources.GetAt(m_CraftItem.Resources.Count - 1).ItemType == typeofBlankScroll
&& typeofSpellScroll.IsAssignableFrom(m_CraftItem.ItemType);
if ( context != null )
resIndex = ( m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex );
for (int i = 0; i < m_CraftItem.Resources.Count - (cropScroll ? 1 : 0) && i < 4; i++)
{
Type type;
string nameString;
int nameNumber;
bool cropScroll = ( m_CraftItem.Resources.Count > 1 )
&& m_CraftItem.Resources.GetAt( m_CraftItem.Resources.Count - 1 ).ItemType == typeofBlankScroll
&& typeofSpellScroll.IsAssignableFrom( m_CraftItem.ItemType );
CraftRes craftResource = m_CraftItem.Resources.GetAt(i);
for ( int i = 0; i < m_CraftItem.Resources.Count - (cropScroll ? 1 : 0) && i < 4; i++ )
{
Type type;
string nameString;
int nameNumber;
type = craftResource.ItemType;
nameString = craftResource.NameString;
nameNumber = craftResource.NameNumber;
CraftRes craftResource = m_CraftItem.Resources.GetAt( i );
// Resource Mutation
if (type == res.ResType && resIndex > -1)
{
CraftSubRes subResource = res.GetAt(resIndex);
type = craftResource.ItemType;
nameString = craftResource.NameString;
nameNumber = craftResource.NameNumber;
type = subResource.ItemType;
// Resource Mutation
if ( type == res.ResType && resIndex > -1 )
{
CraftSubRes subResource = res.GetAt( resIndex );
nameString = subResource.NameString;
nameNumber = subResource.GenericNameNumber;
type = subResource.ItemType;
if (nameNumber <= 0)
nameNumber = subResource.NameNumber;
}
// ******************
nameString = subResource.NameString;
nameNumber = subResource.GenericNameNumber;
if (!retainedColor && m_CraftItem.RetainsColorFrom(m_CraftSystem, type))
{
retainedColor = true;
AddHtmlLocalized(170, 302 + m_OtherCount++ * 20, 310, 18, 1044152, LabelColor, false,
false); // * The item retains the color of this material
AddLabel(500, 219 + i * 20, LabelHue, "*");
}
if ( nameNumber <= 0 )
nameNumber = subResource.NameNumber;
}
// ******************
if (nameNumber > 0)
AddHtmlLocalized(170, 219 + i * 20, 310, 18, nameNumber, LabelColor, false, false);
else
AddLabel(170, 219 + i * 20, LabelHue, nameString);
if ( !retainedColor && m_CraftItem.RetainsColorFrom( m_CraftSystem, type ) )
{
retainedColor = true;
AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1044152, LabelColor, false, false ); // * The item retains the color of this material
AddLabel( 500, 219 + (i * 20), LabelHue, "*" );
}
AddLabel(430, 219 + i * 20, LabelHue, craftResource.Amount.ToString());
}
if ( nameNumber > 0 )
AddHtmlLocalized( 170, 219 + (i * 20), 310, 18, nameNumber, LabelColor, false, false );
else
AddLabel( 170, 219 + (i * 20), LabelHue, nameString );
if (m_CraftItem.NameNumber == 1041267) // runebook
{
AddHtmlLocalized(170, 219 + m_CraftItem.Resources.Count * 20, 310, 18, 1044447, LabelColor, false, false);
AddLabel(430, 219 + m_CraftItem.Resources.Count * 20, LabelHue, "1");
}
AddLabel( 430, 219 + (i * 20), LabelHue, craftResource.Amount.ToString() );
}
if (cropScroll)
AddHtmlLocalized(170, 302 + m_OtherCount++ * 20, 360, 18, 1044379, LabelColor, false,
false); // Inscribing scrolls also requires a blank scroll and mana.
}
if ( m_CraftItem.NameNumber == 1041267 ) // runebook
{
AddHtmlLocalized( 170, 219 + (m_CraftItem.Resources.Count * 20), 310, 18, 1044447, LabelColor, false, false );
AddLabel( 430, 219 + (m_CraftItem.Resources.Count * 20), LabelHue, "1" );
}
public override void OnResponse(NetState sender, RelayInfo info)
{
// Back Button
if (info.ButtonID == 0)
{
CraftGump craftGump = new CraftGump(m_From, m_CraftSystem, m_Tool, null);
m_From.SendGump(craftGump);
}
else // Make Button
{
int num = m_CraftSystem.CanCraft(m_From, m_Tool, m_CraftItem.ItemType);
if ( cropScroll )
AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 360, 18, 1044379, LabelColor, false, false ); // Inscribing scrolls also requires a blank scroll and mana.
}
if (num > 0)
{
m_From.SendGump(new CraftGump(m_From, m_CraftSystem, m_Tool, num));
}
else
{
Type type = null;
public override void OnResponse( NetState sender, RelayInfo info )
{
// Back Button
if ( info.ButtonID == 0 )
{
CraftGump craftGump = new CraftGump( m_From, m_CraftSystem, m_Tool, null );
m_From.SendGump( craftGump );
}
else // Make Button
{
int num = m_CraftSystem.CanCraft( m_From, m_Tool, m_CraftItem.ItemType );
CraftContext context = m_CraftSystem.GetContext(m_From);
if ( num > 0 )
{
m_From.SendGump( new CraftGump( m_From, m_CraftSystem, m_Tool, num ) );
}
else
{
Type type = null;
if (context != null)
{
CraftSubResCol res = m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes;
int resIndex = m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex;
CraftContext context = m_CraftSystem.GetContext( m_From );
if (resIndex > -1)
type = res.GetAt(resIndex).ItemType;
}
if ( context != null )
{
CraftSubResCol res = ( m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes );
int resIndex = ( m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex );
if ( resIndex > -1 )
type = res.GetAt( resIndex ).ItemType;
}
m_CraftSystem.CreateItem( m_From, m_CraftItem.ItemType, type, m_Tool, m_CraftItem );
}
}
}
}
}
m_CraftSystem.CreateItem(m_From, m_CraftItem.ItemType, type, m_Tool, m_CraftItem);
}
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,58 +1,53 @@
using System;
using System.Collections;
namespace Server.Engines.Craft
{
public class CraftItemCol : System.Collections.CollectionBase
{
public CraftItemCol()
{
}
public class CraftItemCol : CollectionBase
{
public int Add(CraftItem craftItem)
{
return List.Add(craftItem);
}
public int Add( CraftItem craftItem )
{
return List.Add( craftItem );
}
public void Remove(int index)
{
if (index > Count - 1 || index < 0)
{
}
else
{
List.RemoveAt(index);
}
}
public void Remove( int index )
{
if ( index > Count - 1 || index < 0 )
{
}
else
{
List.RemoveAt( index );
}
}
public CraftItem GetAt(int index)
{
return (CraftItem)List[index];
}
public CraftItem GetAt( int index )
{
return ( CraftItem ) List[index];
}
public CraftItem SearchForSubclass(Type type)
{
for (int i = 0; i < List.Count; i++)
{
CraftItem craftItem = (CraftItem)List[i];
public CraftItem SearchForSubclass( Type type )
{
for ( int i = 0; i < List.Count; i++ )
{
CraftItem craftItem = ( CraftItem )List[i];
if (craftItem.ItemType == type || type.IsSubclassOf(craftItem.ItemType))
return craftItem;
}
if ( craftItem.ItemType == type || type.IsSubclassOf( craftItem.ItemType ) )
return craftItem;
}
return null;
}
return null;
}
public CraftItem SearchFor(Type type)
{
for (int i = 0; i < List.Count; i++)
{
CraftItem craftItem = (CraftItem)List[i];
if (craftItem.ItemType == type) return craftItem;
}
public CraftItem SearchFor( Type type )
{
for ( int i = 0; i < List.Count; i++ )
{
CraftItem craftItem = ( CraftItem )List[i];
if ( craftItem.ItemType == type )
{
return craftItem;
}
}
return null;
}
}
return null;
}
}
}

View file

@ -2,14 +2,14 @@ using System;
namespace Server.Engines.Craft
{
[AttributeUsage( AttributeTargets.Class )]
public class CraftItemIDAttribute : Attribute
{
public int ItemID { get; }
[AttributeUsage(AttributeTargets.Class)]
public class CraftItemIDAttribute : Attribute
{
public CraftItemIDAttribute(int itemID)
{
ItemID = itemID;
}
public CraftItemIDAttribute( int itemID )
{
ItemID = itemID;
}
}
public int ItemID{ get; }
}
}

View file

@ -2,43 +2,43 @@ using System;
namespace Server.Engines.Craft
{
public class CraftRes
{
public CraftRes( Type type, int amount )
{
ItemType = type;
Amount = amount;
}
public class CraftRes
{
public CraftRes(Type type, int amount)
{
ItemType = type;
Amount = amount;
}
public CraftRes( Type type, TextDefinition name, int amount, TextDefinition message ): this ( type, amount )
{
NameNumber = name;
MessageNumber = message;
public CraftRes(Type type, TextDefinition name, int amount, TextDefinition message) : this(type, amount)
{
NameNumber = name;
MessageNumber = message;
NameString = name;
MessageString = message;
}
NameString = name;
MessageString = message;
}
public void SendMessage( Mobile from )
{
if ( MessageNumber > 0 )
from.SendLocalizedMessage( MessageNumber );
else if ( !string.IsNullOrEmpty( MessageString ) )
from.SendMessage( MessageString );
else
from.SendLocalizedMessage( 502925 ); // You don't have the resources required to make that item.
}
public Type ItemType{ get; }
public Type ItemType { get; }
public string MessageString{ get; }
public string MessageString { get; }
public int MessageNumber{ get; }
public int MessageNumber { get; }
public string NameString{ get; }
public string NameString { get; }
public int NameNumber{ get; }
public int NameNumber { get; }
public int Amount{ get; }
public int Amount { get; }
}
}
public void SendMessage(Mobile from)
{
if (MessageNumber > 0)
from.SendLocalizedMessage(MessageNumber);
else if (!string.IsNullOrEmpty(MessageString))
from.SendMessage(MessageString);
else
from.SendLocalizedMessage(502925); // You don't have the resources required to make that item.
}
}
}

View file

@ -1,30 +1,28 @@
using System.Collections;
namespace Server.Engines.Craft
{
public class CraftResCol : System.Collections.CollectionBase
{
public CraftResCol()
{
}
public class CraftResCol : CollectionBase
{
public void Add(CraftRes craftRes)
{
List.Add(craftRes);
}
public void Add( CraftRes craftRes )
{
List.Add( craftRes );
}
public void Remove(int index)
{
if (index > Count - 1 || index < 0)
{
}
else
{
List.RemoveAt(index);
}
}
public void Remove( int index )
{
if ( index > Count - 1 || index < 0 )
{
}
else
{
List.RemoveAt( index );
}
}
public CraftRes GetAt( int index )
{
return ( CraftRes ) List[index];
}
}
public CraftRes GetAt(int index)
{
return (CraftRes)List[index];
}
}
}

View file

@ -1,18 +1,18 @@
namespace Server.Engines.Craft
{
public class CraftSkill
{
public CraftSkill( SkillName skillToMake, double minSkill, double maxSkill )
{
SkillToMake = skillToMake;
MinSkill = minSkill;
MaxSkill = maxSkill;
}
public class CraftSkill
{
public CraftSkill(SkillName skillToMake, double minSkill, double maxSkill)
{
SkillToMake = skillToMake;
MinSkill = minSkill;
MaxSkill = maxSkill;
}
public SkillName SkillToMake { get; }
public SkillName SkillToMake{ get; }
public double MinSkill { get; }
public double MinSkill{ get; }
public double MaxSkill { get; }
}
public double MaxSkill{ get; }
}
}

View file

@ -1,30 +1,28 @@
using System.Collections;
namespace Server.Engines.Craft
{
public class CraftSkillCol : System.Collections.CollectionBase
{
public CraftSkillCol()
{
}
public class CraftSkillCol : CollectionBase
{
public void Add(CraftSkill craftSkill)
{
List.Add(craftSkill);
}
public void Add( CraftSkill craftSkill )
{
List.Add( craftSkill );
}
public void Remove(int index)
{
if (index > Count - 1 || index < 0)
{
}
else
{
List.RemoveAt(index);
}
}
public void Remove( int index )
{
if ( index > Count - 1 || index < 0 )
{
}
else
{
List.RemoveAt( index );
}
}
public CraftSkill GetAt( int index )
{
return ( CraftSkill ) List[index];
}
}
public CraftSkill GetAt(int index)
{
return (CraftSkill)List[index];
}
}
}

View file

@ -2,32 +2,33 @@ using System;
namespace Server.Engines.Craft
{
public class CraftSubRes
{
public CraftSubRes( Type type, TextDefinition name, double reqSkill, object message ) : this( type, name, reqSkill, 0, message )
{
}
public class CraftSubRes
{
public CraftSubRes(Type type, TextDefinition name, double reqSkill, object message) : this(type, name, reqSkill, 0,
message)
{
}
public CraftSubRes( Type type, TextDefinition name, double reqSkill, int genericNameNumber, object message )
{
ItemType = type;
NameNumber = name;
NameString = name;
RequiredSkill = reqSkill;
GenericNameNumber = genericNameNumber;
Message = message;
}
public CraftSubRes(Type type, TextDefinition name, double reqSkill, int genericNameNumber, object message)
{
ItemType = type;
NameNumber = name;
NameString = name;
RequiredSkill = reqSkill;
GenericNameNumber = genericNameNumber;
Message = message;
}
public Type ItemType { get; }
public Type ItemType{ get; }
public string NameString { get; }
public string NameString{ get; }
public int NameNumber { get; }
public int NameNumber{ get; }
public int GenericNameNumber { get; }
public int GenericNameNumber{ get; }
public object Message { get; }
public object Message{ get; }
public double RequiredSkill { get; }
}
public double RequiredSkill{ get; }
}
}

View file

@ -1,54 +1,53 @@
using System;
using System.Collections;
namespace Server.Engines.Craft
{
public class CraftSubResCol : System.Collections.CollectionBase
{
public bool Init { get; set; }
public class CraftSubResCol : CollectionBase
{
public CraftSubResCol()
{
Init = false;
}
public Type ResType { get; set; }
public bool Init{ get; set; }
public string NameString { get; set; }
public Type ResType{ get; set; }
public int NameNumber { get; set; }
public string NameString{ get; set; }
public CraftSubResCol()
{
Init = false;
}
public int NameNumber{ get; set; }
public void Add( CraftSubRes craftSubRes )
{
List.Add( craftSubRes );
}
public void Add(CraftSubRes craftSubRes)
{
List.Add(craftSubRes);
}
public void Remove( int index )
{
if ( index > Count - 1 || index < 0 )
{
}
else
{
List.RemoveAt( index );
}
}
public void Remove(int index)
{
if (index > Count - 1 || index < 0)
{
}
else
{
List.RemoveAt(index);
}
}
public CraftSubRes GetAt( int index )
{
return ( CraftSubRes ) List[index];
}
public CraftSubRes GetAt(int index)
{
return (CraftSubRes)List[index];
}
public CraftSubRes SearchFor( Type type )
{
for ( int i = 0; i < List.Count; i++ )
{
CraftSubRes craftSubRes = ( CraftSubRes )List[i];
if ( craftSubRes.ItemType == type )
{
return craftSubRes;
}
}
return null;
}
}
public CraftSubRes SearchFor(Type type)
{
for (int i = 0; i < List.Count; i++)
{
CraftSubRes craftSubRes = (CraftSubRes)List[i];
if (craftSubRes.ItemType == type) return craftSubRes;
}
return null;
}
}
}

View file

@ -4,360 +4,359 @@ using Server.Items;
namespace Server.Engines.Craft
{
public enum CraftECA
{
ChanceMinusSixty,
FiftyPercentChanceMinusTenPercent,
ChanceMinusSixtyToFourtyFive
}
public enum CraftECA
{
ChanceMinusSixty,
FiftyPercentChanceMinusTenPercent,
ChanceMinusSixtyToFourtyFive
}
public abstract class CraftSystem
{
private List<int> m_Recipes;
private List<int> m_RareRecipes;
public abstract class CraftSystem
{
private Dictionary<Mobile, CraftContext> m_ContextTable = new Dictionary<Mobile, CraftContext>();
private List<int> m_RareRecipes;
private List<int> m_Recipes;
public int MinCraftEffect { get; }
public CraftSystem(int minCraftEffect, int maxCraftEffect, double delay)
{
MinCraftEffect = minCraftEffect;
MaxCraftEffect = maxCraftEffect;
Delay = delay;
public int MaxCraftEffect { get; }
CraftItems = new CraftItemCol();
CraftGroups = new CraftGroupCol();
CraftSubRes = new CraftSubResCol();
CraftSubRes2 = new CraftSubResCol();
public double Delay { get; }
m_Recipes = new List<int>();
m_RareRecipes = new List<int>();
public CraftItemCol CraftItems { get; }
InitCraftList();
}
public CraftGroupCol CraftGroups { get; }
public int MinCraftEffect{ get; }
public CraftSubResCol CraftSubRes { get; }
public int MaxCraftEffect{ get; }
public CraftSubResCol CraftSubRes2 { get; }
public double Delay{ get; }
public abstract SkillName MainSkill{ get; }
public CraftItemCol CraftItems{ get; }
public virtual int GumpTitleNumber => 0;
public virtual string GumpTitleString => "";
public CraftGroupCol CraftGroups{ get; }
public virtual CraftECA ECA => CraftECA.ChanceMinusSixty;
public CraftSubResCol CraftSubRes{ get; }
private Dictionary<Mobile, CraftContext> m_ContextTable = new Dictionary<Mobile, CraftContext>();
public CraftSubResCol CraftSubRes2{ get; }
public abstract double GetChanceAtMin( CraftItem item );
public abstract SkillName MainSkill{ get; }
public virtual bool RetainsColorFrom( CraftItem item, Type type )
{
return false;
}
public virtual int GumpTitleNumber => 0;
public virtual string GumpTitleString => "";
public CraftContext GetContext( Mobile m )
{
if ( m == null )
return null;
public virtual CraftECA ECA => CraftECA.ChanceMinusSixty;
if ( m.Deleted )
{
m_ContextTable.Remove( m );
return null;
}
public bool Resmelt{ get; set; }
m_ContextTable.TryGetValue( m, out CraftContext c );
public bool Repair{ get; set; }
if ( c == null )
m_ContextTable[m] = c = new CraftContext();
public bool MarkOption{ get; set; }
return c;
}
public bool CanEnhance{ get; set; }
public void OnMade( Mobile m, CraftItem item )
{
CraftContext c = GetContext( m );
public abstract double GetChanceAtMin(CraftItem item);
c?.OnMade( item );
}
public virtual bool RetainsColorFrom(CraftItem item, Type type)
{
return false;
}
public bool Resmelt { get; set; }
public CraftContext GetContext(Mobile m)
{
if (m == null)
return null;
public bool Repair { get; set; }
if (m.Deleted)
{
m_ContextTable.Remove(m);
return null;
}
public bool MarkOption { get; set; }
m_ContextTable.TryGetValue(m, out CraftContext c);
public bool CanEnhance { get; set; }
if (c == null)
m_ContextTable[m] = c = new CraftContext();
public CraftSystem( int minCraftEffect, int maxCraftEffect, double delay )
{
MinCraftEffect = minCraftEffect;
MaxCraftEffect = maxCraftEffect;
Delay = delay;
return c;
}
CraftItems = new CraftItemCol();
CraftGroups = new CraftGroupCol();
CraftSubRes = new CraftSubResCol();
CraftSubRes2 = new CraftSubResCol();
public void OnMade(Mobile m, CraftItem item)
{
CraftContext c = GetContext(m);
m_Recipes = new List<int>();
m_RareRecipes = new List<int>();
c?.OnMade(item);
}
InitCraftList();
}
public virtual bool ConsumeOnFailure(Mobile from, Type resourceType, CraftItem craftItem)
{
return true;
}
public virtual bool ConsumeOnFailure( Mobile from, Type resourceType, CraftItem craftItem )
{
return true;
}
public void CreateItem(Mobile from, Type type, Type typeRes, BaseTool tool, CraftItem realCraftItem)
{
// Verify if the type is in the list of the craftable item
CraftItem craftItem = CraftItems.SearchFor(type);
if (craftItem != null) realCraftItem.Craft(from, this, typeRes, tool);
}
public void CreateItem( Mobile from, Type type, Type typeRes, BaseTool tool, CraftItem realCraftItem )
{
// Verify if the type is in the list of the craftable item
CraftItem craftItem = CraftItems.SearchFor( type );
if ( craftItem != null )
{
// The item is in the list, try to create it
// Test code: items like sextant parts can be crafted either directly from ingots, or from different parts
realCraftItem.Craft( from, this, typeRes, tool );
//craftItem.Craft( from, this, typeRes, tool );
}
}
public int RandomRecipe()
{
if (m_Recipes.Count == 0)
return -1;
public int RandomRecipe()
{
if ( m_Recipes.Count == 0 )
return -1;
return m_Recipes[Utility.Random(m_Recipes.Count)];
}
return m_Recipes[Utility.Random( m_Recipes.Count )];
}
public int RandomRareRecipe()
{
if ( m_RareRecipes.Count == 0 )
return -1;
return m_RareRecipes[Utility.Random( m_RareRecipes.Count )];
}
public int AddCraft( Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount )
{
return AddCraft( typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, "" );
}
public int AddCraft( Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount, TextDefinition message )
{
return AddCraft( typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, message );
}
public int AddCraft( Type typeItem, TextDefinition group, TextDefinition name, SkillName skillToMake, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount )
{
return AddCraft( typeItem, group, name, skillToMake, minSkill, maxSkill, typeRes, nameRes, amount, "" );
}
public int AddCraft( Type typeItem, TextDefinition group, TextDefinition name, SkillName skillToMake, double minSkill, double maxSkill, Type typeRes, TextDefinition nameRes, int amount, TextDefinition message )
{
CraftItem craftItem = new CraftItem( typeItem, group, name );
craftItem.AddRes( typeRes, nameRes, amount, message );
craftItem.AddSkill( skillToMake, minSkill, maxSkill );
DoGroup( group, craftItem );
return CraftItems.Add( craftItem );
}
private void DoGroup( TextDefinition groupName, CraftItem craftItem )
{
int index = CraftGroups.SearchFor( groupName );
if ( index == -1)
{
CraftGroup craftGroup = new CraftGroup( groupName );
craftGroup.AddCraftItem( craftItem );
CraftGroups.Add( craftGroup );
}
else
{
CraftGroups.GetAt( index ).AddCraftItem( craftItem );
}
}
public void SetItemHue( int index, int hue )
{
CraftItem craftItem = CraftItems.GetAt( index );
craftItem.ItemHue = hue;
}
public void SetManaReq( int index, int mana )
{
CraftItem craftItem = CraftItems.GetAt( index );
craftItem.Mana = mana;
}
public void SetStamReq( int index, int stam )
{
CraftItem craftItem = CraftItems.GetAt( index );
craftItem.Stam = stam;
}
public void SetHitsReq( int index, int hits )
{
CraftItem craftItem = CraftItems.GetAt( index );
craftItem.Hits = hits;
}
public void SetUseAllRes( int index, bool useAll )
{
CraftItem craftItem = CraftItems.GetAt( index );
craftItem.UseAllRes = useAll;
}
public void SetNeedHeat( int index, bool needHeat )
{
CraftItem craftItem = CraftItems.GetAt( index );
craftItem.NeedHeat = needHeat;
}
public void SetNeedOven( int index, bool needOven )
{
CraftItem craftItem = CraftItems.GetAt( index );
craftItem.NeedOven = needOven;
}
public void SetBeverageType( int index, BeverageType requiredBeverage )
{
CraftItem craftItem = CraftItems.GetAt( index );
craftItem.RequiredBeverage = requiredBeverage;
}
public void SetNeedMill( int index, bool needMill )
{
CraftItem craftItem = CraftItems.GetAt( index );
craftItem.NeedMill = needMill;
}
public void SetNeededExpansion( int index, Expansion expansion )
{
CraftItem craftItem = CraftItems.GetAt( index );
craftItem.RequiredExpansion = expansion;
}
public void AddRes( int index, Type type, TextDefinition name, int amount )
{
AddRes( index, type, name, amount, "" );
}
public void AddRes( int index, Type type, TextDefinition name, int amount, TextDefinition message )
{
CraftItem craftItem = CraftItems.GetAt( index );
craftItem.AddRes( type, name, amount, message );
}
public void AddSkill( int index, SkillName skillToMake, double minSkill, double maxSkill )
{
CraftItem craftItem = CraftItems.GetAt(index);
craftItem.AddSkill(skillToMake, minSkill, maxSkill);
}
public void SetUseSubRes2( int index, bool val )
{
CraftItem craftItem = CraftItems.GetAt(index);
craftItem.UseSubRes2 = val;
}
private void AddRecipeBase( int index, int id )
{
CraftItem craftItem = CraftItems.GetAt( index );
craftItem.AddRecipe( id, this );
}
public void AddRecipe( int index, int id )
{
AddRecipeBase( index, id );
m_Recipes.Add( id );
}
public void AddRareRecipe( int index, int id )
{
AddRecipeBase( index, id );
m_RareRecipes.Add( id );
}
public void AddQuestRecipe( int index, int id )
{
AddRecipeBase( index, id );
}
public void ForceNonExceptional( int index )
{
CraftItem craftItem = CraftItems.GetAt( index );
craftItem.ForceNonExceptional = true;
}
public void SetSubRes( Type type, string name )
{
CraftSubRes.ResType = type;
CraftSubRes.NameString = name;
CraftSubRes.Init = true;
}
public void SetSubRes( Type type, int name )
{
CraftSubRes.ResType = type;
CraftSubRes.NameNumber = name;
CraftSubRes.Init = true;
}
public void AddSubRes( Type type, int name, double reqSkill, object message )
{
CraftSubRes craftSubRes = new CraftSubRes( type, name, reqSkill, message );
CraftSubRes.Add( craftSubRes );
}
public void AddSubRes( Type type, int name, double reqSkill, int genericName, object message )
{
CraftSubRes craftSubRes = new CraftSubRes( type, name, reqSkill, genericName, message );
CraftSubRes.Add( craftSubRes );
}
public void AddSubRes( Type type, string name, double reqSkill, object message )
{
CraftSubRes craftSubRes = new CraftSubRes( type, name, reqSkill, message );
CraftSubRes.Add( craftSubRes );
}
public void SetSubRes2( Type type, string name )
{
CraftSubRes2.ResType = type;
CraftSubRes2.NameString = name;
CraftSubRes2.Init = true;
}
public void SetSubRes2( Type type, int name )
{
CraftSubRes2.ResType = type;
CraftSubRes2.NameNumber = name;
CraftSubRes2.Init = true;
}
public void AddSubRes2( Type type, int name, double reqSkill, object message )
{
CraftSubRes craftSubRes = new CraftSubRes( type, name, reqSkill, message );
CraftSubRes2.Add( craftSubRes );
}
public void AddSubRes2( Type type, int name, double reqSkill, int genericName, object message )
{
CraftSubRes craftSubRes = new CraftSubRes( type, name, reqSkill, genericName, message );
CraftSubRes2.Add( craftSubRes );
}
public void AddSubRes2( Type type, string name, double reqSkill, object message )
{
CraftSubRes craftSubRes = new CraftSubRes( type, name, reqSkill, message );
CraftSubRes2.Add( craftSubRes );
}
public abstract void InitCraftList();
public abstract void PlayCraftEffect( Mobile from );
public abstract int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item );
public abstract int CanCraft( Mobile from, BaseTool tool, Type itemType );
}
}
public int RandomRareRecipe()
{
if (m_RareRecipes.Count == 0)
return -1;
return m_RareRecipes[Utility.Random(m_RareRecipes.Count)];
}
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill,
Type typeRes, TextDefinition nameRes, int amount)
{
return AddCraft(typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, "");
}
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, double minSkill, double maxSkill,
Type typeRes, TextDefinition nameRes, int amount, TextDefinition message)
{
return AddCraft(typeItem, group, name, MainSkill, minSkill, maxSkill, typeRes, nameRes, amount, message);
}
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, SkillName skillToMake, double minSkill,
double maxSkill, Type typeRes, TextDefinition nameRes, int amount)
{
return AddCraft(typeItem, group, name, skillToMake, minSkill, maxSkill, typeRes, nameRes, amount, "");
}
public int AddCraft(Type typeItem, TextDefinition group, TextDefinition name, SkillName skillToMake, double minSkill,
double maxSkill, Type typeRes, TextDefinition nameRes, int amount, TextDefinition message)
{
CraftItem craftItem = new CraftItem(typeItem, group, name);
craftItem.AddRes(typeRes, nameRes, amount, message);
craftItem.AddSkill(skillToMake, minSkill, maxSkill);
DoGroup(group, craftItem);
return CraftItems.Add(craftItem);
}
private void DoGroup(TextDefinition groupName, CraftItem craftItem)
{
int index = CraftGroups.SearchFor(groupName);
if (index == -1)
{
CraftGroup craftGroup = new CraftGroup(groupName);
craftGroup.AddCraftItem(craftItem);
CraftGroups.Add(craftGroup);
}
else
{
CraftGroups.GetAt(index).AddCraftItem(craftItem);
}
}
public void SetItemHue(int index, int hue)
{
CraftItem craftItem = CraftItems.GetAt(index);
craftItem.ItemHue = hue;
}
public void SetManaReq(int index, int mana)
{
CraftItem craftItem = CraftItems.GetAt(index);
craftItem.Mana = mana;
}
public void SetStamReq(int index, int stam)
{
CraftItem craftItem = CraftItems.GetAt(index);
craftItem.Stam = stam;
}
public void SetHitsReq(int index, int hits)
{
CraftItem craftItem = CraftItems.GetAt(index);
craftItem.Hits = hits;
}
public void SetUseAllRes(int index, bool useAll)
{
CraftItem craftItem = CraftItems.GetAt(index);
craftItem.UseAllRes = useAll;
}
public void SetNeedHeat(int index, bool needHeat)
{
CraftItem craftItem = CraftItems.GetAt(index);
craftItem.NeedHeat = needHeat;
}
public void SetNeedOven(int index, bool needOven)
{
CraftItem craftItem = CraftItems.GetAt(index);
craftItem.NeedOven = needOven;
}
public void SetBeverageType(int index, BeverageType requiredBeverage)
{
CraftItem craftItem = CraftItems.GetAt(index);
craftItem.RequiredBeverage = requiredBeverage;
}
public void SetNeedMill(int index, bool needMill)
{
CraftItem craftItem = CraftItems.GetAt(index);
craftItem.NeedMill = needMill;
}
public void SetNeededExpansion(int index, Expansion expansion)
{
CraftItem craftItem = CraftItems.GetAt(index);
craftItem.RequiredExpansion = expansion;
}
public void AddRes(int index, Type type, TextDefinition name, int amount)
{
AddRes(index, type, name, amount, "");
}
public void AddRes(int index, Type type, TextDefinition name, int amount, TextDefinition message)
{
CraftItem craftItem = CraftItems.GetAt(index);
craftItem.AddRes(type, name, amount, message);
}
public void AddSkill(int index, SkillName skillToMake, double minSkill, double maxSkill)
{
CraftItem craftItem = CraftItems.GetAt(index);
craftItem.AddSkill(skillToMake, minSkill, maxSkill);
}
public void SetUseSubRes2(int index, bool val)
{
CraftItem craftItem = CraftItems.GetAt(index);
craftItem.UseSubRes2 = val;
}
private void AddRecipeBase(int index, int id)
{
CraftItem craftItem = CraftItems.GetAt(index);
craftItem.AddRecipe(id, this);
}
public void AddRecipe(int index, int id)
{
AddRecipeBase(index, id);
m_Recipes.Add(id);
}
public void AddRareRecipe(int index, int id)
{
AddRecipeBase(index, id);
m_RareRecipes.Add(id);
}
public void AddQuestRecipe(int index, int id)
{
AddRecipeBase(index, id);
}
public void ForceNonExceptional(int index)
{
CraftItem craftItem = CraftItems.GetAt(index);
craftItem.ForceNonExceptional = true;
}
public void SetSubRes(Type type, string name)
{
CraftSubRes.ResType = type;
CraftSubRes.NameString = name;
CraftSubRes.Init = true;
}
public void SetSubRes(Type type, int name)
{
CraftSubRes.ResType = type;
CraftSubRes.NameNumber = name;
CraftSubRes.Init = true;
}
public void AddSubRes(Type type, int name, double reqSkill, object message)
{
CraftSubRes craftSubRes = new CraftSubRes(type, name, reqSkill, message);
CraftSubRes.Add(craftSubRes);
}
public void AddSubRes(Type type, int name, double reqSkill, int genericName, object message)
{
CraftSubRes craftSubRes = new CraftSubRes(type, name, reqSkill, genericName, message);
CraftSubRes.Add(craftSubRes);
}
public void AddSubRes(Type type, string name, double reqSkill, object message)
{
CraftSubRes craftSubRes = new CraftSubRes(type, name, reqSkill, message);
CraftSubRes.Add(craftSubRes);
}
public void SetSubRes2(Type type, string name)
{
CraftSubRes2.ResType = type;
CraftSubRes2.NameString = name;
CraftSubRes2.Init = true;
}
public void SetSubRes2(Type type, int name)
{
CraftSubRes2.ResType = type;
CraftSubRes2.NameNumber = name;
CraftSubRes2.Init = true;
}
public void AddSubRes2(Type type, int name, double reqSkill, object message)
{
CraftSubRes craftSubRes = new CraftSubRes(type, name, reqSkill, message);
CraftSubRes2.Add(craftSubRes);
}
public void AddSubRes2(Type type, int name, double reqSkill, int genericName, object message)
{
CraftSubRes craftSubRes = new CraftSubRes(type, name, reqSkill, genericName, message);
CraftSubRes2.Add(craftSubRes);
}
public void AddSubRes2(Type type, string name, double reqSkill, object message)
{
CraftSubRes craftSubRes = new CraftSubRes(type, name, reqSkill, message);
CraftSubRes2.Add(craftSubRes);
}
public abstract void InitCraftList();
public abstract void PlayCraftEffect(Mobile from);
public abstract int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality,
bool makersMark, CraftItem item);
public abstract int CanCraft(Mobile from, BaseTool tool, Type itemType);
}
}

View file

@ -3,31 +3,32 @@ using Server.Items;
namespace Server.Engines.Craft
{
public abstract class CustomCraft
{
public Mobile From { get; }
public abstract class CustomCraft
{
public CustomCraft(Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool,
int quality)
{
From = from;
CraftItem = craftItem;
CraftSystem = craftSystem;
TypeRes = typeRes;
Tool = tool;
Quality = quality;
}
public CraftItem CraftItem { get; }
public Mobile From{ get; }
public CraftSystem CraftSystem { get; }
public CraftItem CraftItem{ get; }
public Type TypeRes { get; }
public CraftSystem CraftSystem{ get; }
public BaseTool Tool { get; }
public Type TypeRes{ get; }
public int Quality { get; }
public BaseTool Tool{ get; }
public CustomCraft( Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool, int quality )
{
From = from;
CraftItem = craftItem;
CraftSystem = craftSystem;
TypeRes = typeRes;
Tool = tool;
Quality = quality;
}
public int Quality{ get; }
public abstract void EndCraftAction();
public abstract Item CompleteCraft( out int message );
}
public abstract void EndCraftAction();
public abstract Item CompleteCraft(out int message);
}
}

View file

@ -1,317 +1,340 @@
using System;
using Server.Targeting;
using Server.Items;
using Server.Targeting;
namespace Server.Engines.Craft
{
public enum EnhanceResult
{
None,
NotInBackpack,
BadItem,
BadResource,
AlreadyEnhanced,
Success,
Failure,
Broken,
NoResources,
NoSkill
}
public enum EnhanceResult
{
None,
NotInBackpack,
BadItem,
BadResource,
AlreadyEnhanced,
Success,
Failure,
Broken,
NoResources,
NoSkill
}
public class Enhance
{
public static EnhanceResult Invoke( Mobile from, CraftSystem craftSystem, BaseTool tool, Item item, CraftResource resource, Type resType, ref object resMessage )
{
if ( item == null )
return EnhanceResult.BadItem;
public class Enhance
{
public static EnhanceResult Invoke(Mobile from, CraftSystem craftSystem, BaseTool tool, Item item,
CraftResource resource, Type resType, ref object resMessage)
{
if (item == null)
return EnhanceResult.BadItem;
if ( !item.IsChildOf( from.Backpack ) )
return EnhanceResult.NotInBackpack;
if (!item.IsChildOf(from.Backpack))
return EnhanceResult.NotInBackpack;
if ( !(item is BaseArmor) && !(item is BaseWeapon) )
return EnhanceResult.BadItem;
if (!(item is BaseArmor) && !(item is BaseWeapon))
return EnhanceResult.BadItem;
if ( item is IArcaneEquip eq && eq.IsArcane )
return EnhanceResult.BadItem;
if (item is IArcaneEquip eq && eq.IsArcane)
return EnhanceResult.BadItem;
if ( CraftResources.IsStandard( resource ) )
return EnhanceResult.BadResource;
if (CraftResources.IsStandard(resource))
return EnhanceResult.BadResource;
int num = craftSystem.CanCraft( from, tool, item.GetType() );
int num = craftSystem.CanCraft(from, tool, item.GetType());
if ( num > 0 )
{
resMessage = num;
return EnhanceResult.None;
}
if (num > 0)
{
resMessage = num;
return EnhanceResult.None;
}
CraftItem craftItem = craftSystem.CraftItems.SearchFor( item.GetType() );
CraftItem craftItem = craftSystem.CraftItems.SearchFor(item.GetType());
if ( craftItem == null || craftItem.Resources.Count == 0 )
return EnhanceResult.BadItem;
if (craftItem == null || craftItem.Resources.Count == 0)
return EnhanceResult.BadItem;
bool allRequiredSkills = false;
if ( craftItem.GetSuccessChance( from, resType, craftSystem, false, ref allRequiredSkills ) <= 0.0 )
return EnhanceResult.NoSkill;
bool allRequiredSkills = false;
if (craftItem.GetSuccessChance(from, resType, craftSystem, false, ref allRequiredSkills) <= 0.0)
return EnhanceResult.NoSkill;
CraftResourceInfo info = CraftResources.GetInfo( resource );
CraftResourceInfo info = CraftResources.GetInfo(resource);
if ( info == null || info.ResourceTypes.Length == 0 )
return EnhanceResult.BadResource;
if (info == null || info.ResourceTypes.Length == 0)
return EnhanceResult.BadResource;
CraftAttributeInfo attributes = info.AttributeInfo;
CraftAttributeInfo attributes = info.AttributeInfo;
if ( attributes == null )
return EnhanceResult.BadResource;
if (attributes == null)
return EnhanceResult.BadResource;
int resHue = 0, maxAmount = 0;
int resHue = 0, maxAmount = 0;
if ( !craftItem.ConsumeRes( from, resType, craftSystem, ref resHue, ref maxAmount, ConsumeType.None, ref resMessage ) )
return EnhanceResult.NoResources;
if (!craftItem.ConsumeRes(from, resType, craftSystem, ref resHue, ref maxAmount, ConsumeType.None,
ref resMessage))
return EnhanceResult.NoResources;
if ( craftSystem is DefBlacksmithy )
{
if ( from.FindItemOnLayer( Layer.OneHanded ) is AncientSmithyHammer hammer )
{
hammer.UsesRemaining--;
if ( hammer.UsesRemaining < 1 )
hammer.Delete();
}
}
if (craftSystem is DefBlacksmithy)
if (from.FindItemOnLayer(Layer.OneHanded) is AncientSmithyHammer hammer)
{
hammer.UsesRemaining--;
if (hammer.UsesRemaining < 1)
hammer.Delete();
}
int phys = 0, fire = 0, cold = 0, pois = 0, nrgy = 0;
int dura = 0, luck = 0, lreq = 0, dinc = 0;
int baseChance = 0;
int phys = 0, fire = 0, cold = 0, pois = 0, nrgy = 0;
int dura = 0, luck = 0, lreq = 0, dinc = 0;
int baseChance = 0;
bool physBonus = false;
bool fireBonus = false;
bool coldBonus = false;
bool nrgyBonus = false;
bool poisBonus = false;
bool duraBonus = false;
bool luckBonus = false;
bool lreqBonus = false;
bool dincBonus = false;
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 weapon )
{
if ( !CraftResources.IsStandard( weapon.Resource ) )
return EnhanceResult.AlreadyEnhanced;
if (item is BaseWeapon weapon)
{
if (!CraftResources.IsStandard(weapon.Resource))
return EnhanceResult.AlreadyEnhanced;
baseChance = 20;
baseChance = 20;
dura = weapon.MaxHitPoints;
luck = weapon.Attributes.Luck;
lreq = weapon.WeaponAttributes.LowerStatReq;
dinc = weapon.Attributes.WeaponDamage;
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 );
fireBonus = attributes.WeaponFireDamage > 0;
coldBonus = attributes.WeaponColdDamage > 0;
nrgyBonus = attributes.WeaponEnergyDamage > 0;
poisBonus = attributes.WeaponPoisonDamage > 0;
duraBonus = ( attributes.WeaponDurability > 0 );
luckBonus = ( attributes.WeaponLuck > 0 );
lreqBonus = ( attributes.WeaponLowerRequirements > 0 );
dincBonus = ( dinc > 0 );
}
else
{
BaseArmor armor = (BaseArmor)item;
duraBonus = attributes.WeaponDurability > 0;
luckBonus = attributes.WeaponLuck > 0;
lreqBonus = attributes.WeaponLowerRequirements > 0;
dincBonus = dinc > 0;
}
else
{
BaseArmor armor = (BaseArmor)item;
if ( !CraftResources.IsStandard( armor.Resource ) )
return EnhanceResult.AlreadyEnhanced;
if (!CraftResources.IsStandard(armor.Resource))
return EnhanceResult.AlreadyEnhanced;
baseChance = 20;
baseChance = 20;
phys = armor.PhysicalResistance;
fire = armor.FireResistance;
cold = armor.ColdResistance;
pois = armor.PoisonResistance;
nrgy = armor.EnergyResistance;
phys = armor.PhysicalResistance;
fire = armor.FireResistance;
cold = armor.ColdResistance;
pois = armor.PoisonResistance;
nrgy = armor.EnergyResistance;
dura = armor.MaxHitPoints;
luck = armor.Attributes.Luck;
lreq = armor.ArmorAttributes.LowerStatReq;
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 );
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;
}
duraBonus = attributes.ArmorDurability > 0;
luckBonus = attributes.ArmorLuck > 0;
lreqBonus = attributes.ArmorLowerRequirements > 0;
dincBonus = false;
}
int skill = from.Skills[craftSystem.MainSkill].Fixed / 10;
int skill = from.Skills[craftSystem.MainSkill].Fixed / 10;
if ( skill >= 100 )
baseChance -= (skill - 90) / 10;
if (skill >= 100)
baseChance -= (skill - 90) / 10;
EnhanceResult res = EnhanceResult.Success;
EnhanceResult res = EnhanceResult.Success;
if ( physBonus )
CheckResult( ref res, baseChance + phys );
if (physBonus)
CheckResult(ref res, baseChance + phys);
if ( fireBonus )
CheckResult( ref res, baseChance + fire );
if (fireBonus)
CheckResult(ref res, baseChance + fire);
if ( coldBonus )
CheckResult( ref res, baseChance + cold );
if (coldBonus)
CheckResult(ref res, baseChance + cold);
if ( nrgyBonus )
CheckResult( ref res, baseChance + nrgy );
if (nrgyBonus)
CheckResult(ref res, baseChance + nrgy);
if ( poisBonus )
CheckResult( ref res, baseChance + pois );
if (poisBonus)
CheckResult(ref res, baseChance + pois);
if ( duraBonus )
CheckResult( ref res, baseChance + (dura / 40) );
if (duraBonus)
CheckResult(ref res, baseChance + dura / 40);
if ( luckBonus )
CheckResult( ref res, baseChance + 10 + (luck / 2) );
if (luckBonus)
CheckResult(ref res, baseChance + 10 + luck / 2);
if ( lreqBonus )
CheckResult( ref res, baseChance + (lreq / 4) );
if (lreqBonus)
CheckResult(ref res, baseChance + lreq / 4);
if ( dincBonus )
CheckResult( ref res, baseChance + (dinc / 4) );
if (dincBonus)
CheckResult(ref res, baseChance + dinc / 4);
switch ( res )
{
case EnhanceResult.Broken:
{
if ( !craftItem.ConsumeRes( from, resType, craftSystem, ref resHue, ref maxAmount, ConsumeType.Half, ref resMessage ) )
return EnhanceResult.NoResources;
switch (res)
{
case EnhanceResult.Broken:
{
if (!craftItem.ConsumeRes(from, resType, craftSystem, ref resHue, ref maxAmount, ConsumeType.Half,
ref resMessage))
return EnhanceResult.NoResources;
item.Delete();
break;
}
case EnhanceResult.Success:
{
if ( !craftItem.ConsumeRes( from, resType, craftSystem, ref resHue, ref maxAmount, ConsumeType.All, ref resMessage ) )
return EnhanceResult.NoResources;
item.Delete();
break;
}
case EnhanceResult.Success:
{
if (!craftItem.ConsumeRes(from, resType, craftSystem, ref resHue, ref maxAmount, ConsumeType.All,
ref resMessage))
return EnhanceResult.NoResources;
if ( item is BaseWeapon w )
{
w.Resource = resource;
if (item is BaseWeapon w)
{
w.Resource = resource;
int hue = w.GetElementalDamageHue();
if ( hue > 0 )
w.Hue = hue;
}
else
{
((BaseArmor)item).Resource = resource;
}
int hue = w.GetElementalDamageHue();
if (hue > 0)
w.Hue = hue;
}
else
{
((BaseArmor)item).Resource = resource;
}
break;
}
case EnhanceResult.Failure:
{
if ( !craftItem.ConsumeRes( from, resType, craftSystem, ref resHue, ref maxAmount, ConsumeType.Half, ref resMessage ) )
return EnhanceResult.NoResources;
break;
}
case EnhanceResult.Failure:
{
if (!craftItem.ConsumeRes(from, resType, craftSystem, ref resHue, ref maxAmount, ConsumeType.Half,
ref resMessage))
return EnhanceResult.NoResources;
break;
}
}
break;
}
}
return res;
}
return res;
}
public static void CheckResult( ref EnhanceResult res, int chance )
{
if ( res != EnhanceResult.Success )
return; // we've already failed..
public static void CheckResult(ref EnhanceResult res, int chance)
{
if (res != EnhanceResult.Success)
return; // we've already failed..
int random = Utility.Random( 100 );
int random = Utility.Random(100);
if ( 10 > random )
res = EnhanceResult.Failure;
else if ( chance > random )
res = EnhanceResult.Broken;
}
if (10 > random)
res = EnhanceResult.Failure;
else if (chance > random)
res = EnhanceResult.Broken;
}
public static void BeginTarget( Mobile from, CraftSystem craftSystem, BaseTool tool )
{
CraftContext context = craftSystem.GetContext( from );
public static void BeginTarget(Mobile from, CraftSystem craftSystem, BaseTool tool)
{
CraftContext context = craftSystem.GetContext(from);
if ( context == null )
return;
if (context == null)
return;
int lastRes = context.LastResourceIndex;
CraftSubResCol subRes = craftSystem.CraftSubRes;
int lastRes = context.LastResourceIndex;
CraftSubResCol subRes = craftSystem.CraftSubRes;
if ( lastRes >= 0 && lastRes < subRes.Count )
{
CraftSubRes res = subRes.GetAt( lastRes );
if (lastRes >= 0 && lastRes < subRes.Count)
{
CraftSubRes res = subRes.GetAt(lastRes);
if ( from.Skills[craftSystem.MainSkill].Value < res.RequiredSkill )
{
from.SendGump( new CraftGump( from, craftSystem, tool, res.Message ) );
}
else
{
CraftResource resource = CraftResources.GetFromType( res.ItemType );
if (from.Skills[craftSystem.MainSkill].Value < res.RequiredSkill)
{
from.SendGump(new CraftGump(from, craftSystem, tool, res.Message));
}
else
{
CraftResource resource = CraftResources.GetFromType(res.ItemType);
if ( resource != CraftResource.None )
{
from.Target = new InternalTarget( craftSystem, tool, res.ItemType, resource );
from.SendLocalizedMessage( 1061004 ); // Target an item to enhance with the properties of your selected material.
}
else
{
from.SendGump( new CraftGump( from, craftSystem, tool, 1061010 ) ); // You must select a special material in order to enhance an item with its properties.
}
}
}
else
{
from.SendGump( new CraftGump( from, craftSystem, tool, 1061010 ) ); // You must select a special material in order to enhance an item with its properties.
}
if (resource != CraftResource.None)
{
from.Target = new InternalTarget(craftSystem, tool, res.ItemType, resource);
from.SendLocalizedMessage(
1061004); // Target an item to enhance with the properties of your selected material.
}
else
{
from.SendGump(new CraftGump(from, craftSystem, tool,
1061010)); // You must select a special material in order to enhance an item with its properties.
}
}
}
else
{
from.SendGump(new CraftGump(from, craftSystem, tool,
1061010)); // You must select a special material in order to enhance an item with its properties.
}
}
}
private class InternalTarget : Target
{
private CraftSystem m_CraftSystem;
private CraftResource m_Resource;
private Type m_ResourceType;
private BaseTool m_Tool;
private class InternalTarget : Target
{
private CraftSystem m_CraftSystem;
private BaseTool m_Tool;
private Type m_ResourceType;
private CraftResource m_Resource;
public InternalTarget(CraftSystem craftSystem, BaseTool tool, Type resourceType, CraftResource resource) : base(
2, false, TargetFlags.None)
{
m_CraftSystem = craftSystem;
m_Tool = tool;
m_ResourceType = resourceType;
m_Resource = resource;
}
public InternalTarget( CraftSystem craftSystem, BaseTool tool, Type resourceType, CraftResource resource ) : base ( 2, false, TargetFlags.None )
{
m_CraftSystem = craftSystem;
m_Tool = tool;
m_ResourceType = resourceType;
m_Resource = resource;
}
protected override void OnTarget(Mobile from, object targeted)
{
if (targeted is Item item)
{
object message = null;
EnhanceResult res = Enhance.Invoke(from, m_CraftSystem, m_Tool, item, m_Resource, m_ResourceType,
ref message);
protected override void OnTarget( Mobile from, object targeted )
{
if ( targeted is Item item )
{
object message = null;
EnhanceResult res = Enhance.Invoke( from, m_CraftSystem, m_Tool, item, m_Resource, m_ResourceType, ref message );
switch (res)
{
case EnhanceResult.NotInBackpack:
message = 1061005;
break; // The item must be in your backpack to enhance it.
case EnhanceResult.AlreadyEnhanced:
message = 1061012;
break; // This item is already enhanced with the properties of a special material.
case EnhanceResult.BadItem:
message = 1061011;
break; // You cannot enhance this type of item with the properties of the selected special material.
case EnhanceResult.BadResource:
message = 1061010;
break; // You must select a special material in order to enhance an item with its properties.
case EnhanceResult.Broken:
message = 1061080;
break; // You attempt to enhance the item, but fail catastrophically. The item is lost.
case EnhanceResult.Failure:
message = 1061082;
break; // You attempt to enhance the item, but fail. Some material is lost in the process.
case EnhanceResult.Success:
message = 1061008;
break; // You enhance the item with the properties of the special material.
case EnhanceResult.NoSkill:
message = 1044153;
break; // You don't have the required skills to attempt this item.
}
switch ( res )
{
case EnhanceResult.NotInBackpack: message = 1061005; break; // The item must be in your backpack to enhance it.
case EnhanceResult.AlreadyEnhanced: message = 1061012; break; // This item is already enhanced with the properties of a special material.
case EnhanceResult.BadItem: message = 1061011; break; // You cannot enhance this type of item with the properties of the selected special material.
case EnhanceResult.BadResource: message = 1061010; break; // You must select a special material in order to enhance an item with its properties.
case EnhanceResult.Broken: message = 1061080; break; // You attempt to enhance the item, but fail catastrophically. The item is lost.
case EnhanceResult.Failure: message = 1061082; break; // You attempt to enhance the item, but fail. Some material is lost in the process.
case EnhanceResult.Success: message = 1061008; break; // You enhance the item with the properties of the special material.
case EnhanceResult.NoSkill: message = 1044153; break; // You don't have the required skills to attempt this item.
}
from.SendGump( new CraftGump( from, m_CraftSystem, m_Tool, message ) );
}
}
}
}
}
from.SendGump(new CraftGump(from, m_CraftSystem, m_Tool, message));
}
}
}
}
}

View file

@ -1,53 +1,55 @@
using System;
using Server.Gumps;
using Server.Items;
using Server.Network;
namespace Server.Engines.Craft
{
public class QueryMakersMarkGump : Gump
{
private int m_Quality;
private Mobile m_From;
private CraftItem m_CraftItem;
private CraftSystem m_CraftSystem;
private Type m_TypeRes;
private BaseTool m_Tool;
public class QueryMakersMarkGump : Gump
{
private CraftItem m_CraftItem;
private CraftSystem m_CraftSystem;
private Mobile m_From;
private int m_Quality;
private BaseTool m_Tool;
private Type m_TypeRes;
public QueryMakersMarkGump( int quality, Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool ) : base( 100, 200 )
{
from.CloseGump( typeof( QueryMakersMarkGump ) );
public QueryMakersMarkGump(int quality, Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes,
BaseTool tool) : base(100, 200)
{
from.CloseGump(typeof(QueryMakersMarkGump));
m_Quality = quality;
m_From = from;
m_CraftItem = craftItem;
m_CraftSystem = craftSystem;
m_TypeRes = typeRes;
m_Tool = tool;
m_Quality = quality;
m_From = from;
m_CraftItem = craftItem;
m_CraftSystem = craftSystem;
m_TypeRes = typeRes;
m_Tool = tool;
AddPage( 0 );
AddPage(0);
AddBackground( 0, 0, 220, 170, 5054 );
AddBackground( 10, 10, 200, 150, 3000 );
AddBackground(0, 0, 220, 170, 5054);
AddBackground(10, 10, 200, 150, 3000);
AddHtmlLocalized( 20, 20, 180, 80, 1018317, false, false ); // Do you wish to place your maker's mark on this item?
AddHtmlLocalized(20, 20, 180, 80, 1018317, false, false); // Do you wish to place your maker's mark on this item?
AddHtmlLocalized( 55, 100, 140, 25, 1011011, false, false ); // CONTINUE
AddButton( 20, 100, 4005, 4007, 1, GumpButtonType.Reply, 0 );
AddHtmlLocalized(55, 100, 140, 25, 1011011, false, false); // CONTINUE
AddButton(20, 100, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized( 55, 125, 140, 25, 1011012, false, false ); // CANCEL
AddButton( 20, 125, 4005, 4007, 0, GumpButtonType.Reply, 0 );
}
AddHtmlLocalized(55, 125, 140, 25, 1011012, false, false); // CANCEL
AddButton(20, 125, 4005, 4007, 0, GumpButtonType.Reply, 0);
}
public override void OnResponse( Network.NetState sender, RelayInfo info )
{
bool makersMark = ( info.ButtonID == 1 );
public override void OnResponse(NetState sender, RelayInfo info)
{
bool makersMark = info.ButtonID == 1;
if ( makersMark )
m_From.SendLocalizedMessage( 501808 ); // You mark the item.
else
m_From.SendLocalizedMessage( 501809 ); // Cancelled mark.
if (makersMark)
m_From.SendLocalizedMessage(501808); // You mark the item.
else
m_From.SendLocalizedMessage(501809); // Cancelled mark.
m_CraftItem.CompleteCraft( m_Quality, makersMark, m_From, m_CraftSystem, m_TypeRes, m_Tool, null );
}
}
m_CraftItem.CompleteCraft(m_Quality, makersMark, m_From, m_CraftSystem, m_TypeRes, m_Tool, null);
}
}
}

View file

@ -1,97 +1,99 @@
using System;
using System.Collections.Generic;
using Server.Mobiles;
using Server.Commands;
using Server.Mobiles;
using Server.Targeting;
namespace Server.Engines.Craft
{
public class Recipe
{
public static void Initialize()
{
CommandSystem.Register( "LearnAllRecipes", AccessLevel.GameMaster, LearnAllRecipes_OnCommand );
CommandSystem.Register( "ForgetAllRecipes", AccessLevel.GameMaster, ForgetAllRecipes_OnCommand );
}
public class Recipe
{
private TextDefinition m_TD;
[Usage( "LearnAllRecipes" )]
[Description( "Teaches a player all available recipes." )]
private static void LearnAllRecipes_OnCommand( CommandEventArgs e )
{
Mobile m = e.Mobile;
m.SendMessage( "Target a player to teach them all of the recipies." );
public Recipe(int id, CraftSystem system, CraftItem item)
{
ID = id;
CraftSystem = system;
CraftItem = item;
m.BeginTarget( -1, false, Targeting.TargetFlags.None, delegate( Mobile from, object targeted )
{
if ( targeted is PlayerMobile mobile )
{
foreach( KeyValuePair<int, Recipe> kvp in Recipes )
mobile.AcquireRecipe( kvp.Key );
if (Recipes.ContainsKey(id))
throw new Exception("Attempting to create recipe with preexisting ID.");
m.SendMessage( "You teach them all of the recipies." );
}
else
{
m.SendMessage( "That is not a player!" );
}
} );
}
[Usage( "ForgetAllRecipes" )]
[Description( "Makes a player forget all the recipies they've learned." )]
private static void ForgetAllRecipes_OnCommand( CommandEventArgs e )
{
Mobile m = e.Mobile;
m.SendMessage( "Target a player to have them forget all of the recipies they've learned." );
m.BeginTarget( -1, false, Targeting.TargetFlags.None, delegate( Mobile from, object targeted )
{
if ( targeted is PlayerMobile mobile )
{
mobile.ResetRecipes();
m.SendMessage( "They forget all their recipies." );
}
else
{
m.SendMessage( "That is not a player!" );
}
} );
}
Recipes.Add(id, this);
LargestRecipeID = Math.Max(id, LargestRecipeID);
}
public static Dictionary<int, Recipe> Recipes { get; } = new Dictionary<int, Recipe>();
public static Dictionary<int, Recipe> Recipes{ get; } = new Dictionary<int, Recipe>();
public static int LargestRecipeID { get; private set; }
public static int LargestRecipeID{ get; private set; }
public CraftSystem CraftSystem { get; set; }
public CraftSystem CraftSystem{ get; set; }
public CraftItem CraftItem { get; set; }
public CraftItem CraftItem{ get; set; }
public int ID { get; }
public int ID{ get; }
private TextDefinition m_TD;
public TextDefinition TextDefinition
{
get
{
if ( m_TD == null )
m_TD = new TextDefinition( CraftItem.NameNumber, CraftItem.NameString );
public TextDefinition TextDefinition
{
get
{
if (m_TD == null)
m_TD = new TextDefinition(CraftItem.NameNumber, CraftItem.NameString);
return m_TD;
}
}
return m_TD;
}
}
public Recipe( int id, CraftSystem system, CraftItem item )
{
ID = id;
CraftSystem = system;
CraftItem = item;
public static void Initialize()
{
CommandSystem.Register("LearnAllRecipes", AccessLevel.GameMaster, LearnAllRecipes_OnCommand);
CommandSystem.Register("ForgetAllRecipes", AccessLevel.GameMaster, ForgetAllRecipes_OnCommand);
}
if ( Recipes.ContainsKey( id ) )
throw new Exception( "Attempting to create recipe with preexisting ID." );
[Usage("LearnAllRecipes")]
[Description("Teaches a player all available recipes.")]
private static void LearnAllRecipes_OnCommand(CommandEventArgs e)
{
Mobile m = e.Mobile;
m.SendMessage("Target a player to teach them all of the recipies.");
Recipes.Add( id, this );
LargestRecipeID = Math.Max( id, LargestRecipeID );
}
}
}
m.BeginTarget(-1, false, TargetFlags.None, delegate(Mobile from, object targeted)
{
if (targeted is PlayerMobile mobile)
{
foreach (KeyValuePair<int, Recipe> kvp in Recipes)
mobile.AcquireRecipe(kvp.Key);
m.SendMessage("You teach them all of the recipies.");
}
else
{
m.SendMessage("That is not a player!");
}
});
}
[Usage("ForgetAllRecipes")]
[Description("Makes a player forget all the recipies they've learned.")]
private static void ForgetAllRecipes_OnCommand(CommandEventArgs e)
{
Mobile m = e.Mobile;
m.SendMessage("Target a player to have them forget all of the recipies they've learned.");
m.BeginTarget(-1, false, TargetFlags.None, delegate(Mobile from, object targeted)
{
if (targeted is PlayerMobile mobile)
{
mobile.ResetRecipes();
m.SendMessage("They forget all their recipies.");
}
else
{
m.SendMessage("That is not a player!");
}
});
}
}
}

View file

@ -1,512 +1,523 @@
using System;
using Server.Items;
using Server.Mobiles;
using Server.Targeting;
using Server.Items;
namespace Server.Engines.Craft
{
public class Repair
{
public Repair()
{
}
public class Repair
{
public static void Do(Mobile from, CraftSystem craftSystem, BaseTool tool)
{
from.Target = new InternalTarget(craftSystem, tool);
from.SendLocalizedMessage(1044276); // Target an item to repair.
}
public static void Do( Mobile from, CraftSystem craftSystem, BaseTool tool )
{
from.Target = new InternalTarget( craftSystem, tool );
from.SendLocalizedMessage( 1044276 ); // Target an item to repair.
}
public static void Do(Mobile from, CraftSystem craftSystem, RepairDeed deed)
{
from.Target = new InternalTarget(craftSystem, deed);
from.SendLocalizedMessage(1044276); // Target an item to repair.
}
public static void Do( Mobile from, CraftSystem craftSystem, RepairDeed deed )
{
from.Target = new InternalTarget( craftSystem, deed );
from.SendLocalizedMessage( 1044276 ); // Target an item to repair.
}
private class InternalTarget : Target
{
private CraftSystem m_CraftSystem;
private RepairDeed m_Deed;
private BaseTool m_Tool;
private class InternalTarget : Target
{
private CraftSystem m_CraftSystem;
private BaseTool m_Tool;
private RepairDeed m_Deed;
public InternalTarget(CraftSystem craftSystem, BaseTool tool) : base(2, false, TargetFlags.None)
{
m_CraftSystem = craftSystem;
m_Tool = tool;
}
public InternalTarget( CraftSystem craftSystem, BaseTool tool ) : base ( 2, false, TargetFlags.None )
{
m_CraftSystem = craftSystem;
m_Tool = tool;
}
public InternalTarget(CraftSystem craftSystem, RepairDeed deed) : base(2, false, TargetFlags.None)
{
m_CraftSystem = craftSystem;
m_Deed = deed;
}
public InternalTarget( CraftSystem craftSystem, RepairDeed deed ) : base( 2, false, TargetFlags.None )
{
m_CraftSystem = craftSystem;
m_Deed = deed;
}
private static void EndGolemRepair(object state)
{
((Mobile)state).EndAction(typeof(Golem));
}
private static void EndGolemRepair( object state )
{
((Mobile)state).EndAction( typeof( Golem ) );
}
private int GetWeakenChance(Mobile mob, SkillName skill, int curHits, int maxHits)
{
// 40% - (1% per hp lost) - (1% per 10 craft skill)
return 40 + (maxHits - curHits) - (int)((m_Deed?.SkillLevel ?? mob.Skills[skill].Value) / 10);
}
private int GetWeakenChance( Mobile mob, SkillName skill, int curHits, int maxHits )
{
// 40% - (1% per hp lost) - (1% per 10 craft skill)
return (40 + (maxHits - curHits)) - (int)((m_Deed?.SkillLevel ?? mob.Skills[skill].Value) / 10);
}
private bool CheckWeaken(Mobile mob, SkillName skill, int curHits, int maxHits)
{
return GetWeakenChance(mob, skill, curHits, maxHits) > Utility.Random(100);
}
private bool CheckWeaken( Mobile mob, SkillName skill, int curHits, int maxHits )
{
return ( GetWeakenChance( mob, skill, curHits, maxHits ) > Utility.Random( 100 ) );
}
private int GetRepairDifficulty(int curHits, int maxHits)
{
return (maxHits - curHits) * 1250 / Math.Max(maxHits, 1) - 250;
}
private int GetRepairDifficulty( int curHits, int maxHits )
{
return (((maxHits - curHits) * 1250) / Math.Max( maxHits, 1 )) - 250;
}
private bool CheckRepairDifficulty( Mobile mob, SkillName skill, int curHits, int maxHits )
{
double difficulty = GetRepairDifficulty( curHits, maxHits ) * 0.1;
private bool CheckRepairDifficulty(Mobile mob, SkillName skill, int curHits, int maxHits)
{
double difficulty = GetRepairDifficulty(curHits, maxHits) * 0.1;
if ( m_Deed != null )
{
double value = m_Deed.SkillLevel;
double minSkill = difficulty - 25.0;
double maxSkill = difficulty + 25;
if (m_Deed != null)
{
double value = m_Deed.SkillLevel;
double minSkill = difficulty - 25.0;
double maxSkill = difficulty + 25;
if ( value < minSkill )
return false; // Too difficult
if ( value >= maxSkill )
return true; // No challenge
if (value < minSkill)
return false; // Too difficult
if (value >= maxSkill)
return true; // No challenge
double chance = (value - minSkill) / (maxSkill - minSkill);
double chance = (value - minSkill) / (maxSkill - minSkill);
return (chance >= Utility.RandomDouble());
}
return chance >= Utility.RandomDouble();
}
return mob.CheckSkill( skill, difficulty - 25.0, difficulty + 25.0 );
}
return mob.CheckSkill(skill, difficulty - 25.0, difficulty + 25.0);
}
private bool CheckDeed( Mobile from )
{
if ( m_Deed != null )
{
return m_Deed.Check( from );
}
private bool CheckDeed(Mobile from)
{
if (m_Deed != null) return m_Deed.Check(from);
return true;
}
return true;
}
private bool IsSpecialClothing( BaseClothing clothing )
{
// Clothing repairable but not craftable
private bool IsSpecialClothing(BaseClothing clothing)
{
// Clothing repairable but not craftable
if ( m_CraftSystem is DefTailoring )
{
return ( clothing is BearMask )
|| ( clothing is DeerMask )
|| ( clothing is TheMostKnowledgePerson )
|| ( clothing is TheRobeOfBritanniaAri )
|| ( clothing is EmbroideredOakLeafCloak );
}
if (m_CraftSystem is DefTailoring)
return clothing is BearMask
|| clothing is DeerMask
|| clothing is TheMostKnowledgePerson
|| clothing is TheRobeOfBritanniaAri
|| clothing is EmbroideredOakLeafCloak;
return false;
}
return false;
}
private bool IsSpecialWeapon( BaseWeapon weapon )
{
// Weapons repairable but not craftable
private bool IsSpecialWeapon(BaseWeapon weapon)
{
// Weapons repairable but not craftable
if ( m_CraftSystem is DefTinkering )
{
return ( weapon is Cleaver )
|| ( weapon is Hatchet )
|| ( weapon is Pickaxe )
|| ( weapon is ButcherKnife )
|| ( weapon is SkinningKnife );
}
if (m_CraftSystem is DefTinkering)
return weapon is Cleaver
|| weapon is Hatchet
|| weapon is Pickaxe
|| weapon is ButcherKnife
|| weapon is SkinningKnife;
if ( m_CraftSystem is DefCarpentry )
{
return ( weapon is Club )
|| ( weapon is BlackStaff )
|| ( weapon is MagicWand )
#region Temporary
// TODO: Make these items craftable
|| ( weapon is WildStaff );
#endregion
}
if ( m_CraftSystem is DefBlacksmithy )
{
return ( weapon is Pitchfork )
#region Temporary
// TODO: Make these items craftable
|| ( weapon is RadiantScimitar )
|| ( weapon is WarCleaver )
|| ( weapon is ElvenSpellblade )
|| ( weapon is AssassinSpike )
|| ( weapon is Leafblade )
|| ( weapon is RuneBlade )
|| ( weapon is ElvenMachete )
|| ( weapon is OrnateAxe )
|| ( weapon is DiamondMace );
#endregion
}
#region Temporary
// TODO: Make these items craftable
if ( m_CraftSystem is DefBowFletching )
{
return ( weapon is ElvenCompositeLongbow )
|| ( weapon is MagicalShortbow );
}
if (m_CraftSystem is DefCarpentry)
{
return weapon is Club
|| weapon is BlackStaff
|| weapon is MagicWand
#endregion
#region Temporary
return false;
}
// TODO: Make these items craftable
|| weapon is WildStaff;
private bool IsSpecialArmor( BaseArmor armor )
{
// Armor repairable but not craftable
#endregion
}
#region Temporary
// TODO: Make these items craftable
if ( m_CraftSystem is DefTailoring )
{
return ( armor is LeafTonlet )
|| ( armor is LeafArms )
|| ( armor is LeafChest )
|| ( armor is LeafGloves )
|| ( armor is LeafGorget )
|| ( armor is LeafLegs )
|| ( armor is HideChest )
|| ( armor is HideGloves )
|| ( armor is HideGorget )
|| ( armor is HidePants )
|| ( armor is HidePauldrons );
}
if (m_CraftSystem is DefBlacksmithy)
{
return weapon is Pitchfork
if ( m_CraftSystem is DefCarpentry )
{
return ( armor is WingedHelm )
|| ( armor is RavenHelm )
|| ( armor is VultureHelm )
|| ( armor is WoodlandArms )
|| ( armor is WoodlandChest )
|| ( armor is WoodlandGloves )
|| ( armor is WoodlandGorget )
|| ( armor is WoodlandLegs );
}
if ( m_CraftSystem is DefBlacksmithy )
{
return ( armor is Circlet )
|| ( armor is RoyalCirclet )
|| ( armor is GemmedCirclet );
}
#region Temporary
#endregion
// TODO: Make these items craftable
|| weapon is RadiantScimitar
|| weapon is WarCleaver
|| weapon is ElvenSpellblade
|| weapon is AssassinSpike
|| weapon is Leafblade
|| weapon is RuneBlade
|| weapon is ElvenMachete
|| weapon is OrnateAxe
|| weapon is DiamondMace;
return false;
}
#endregion
}
protected override void OnTarget( Mobile from, object targeted )
{
int number;
#region Temporary
if ( !CheckDeed( from ) )
return;
// TODO: Make these items craftable
if (m_CraftSystem is DefBowFletching)
return weapon is ElvenCompositeLongbow
|| weapon is MagicalShortbow;
bool usingDeed = (m_Deed != null);
bool toDelete = false;
#endregion
// TODO: Make an IRepairable
return false;
}
if ( m_CraftSystem.CanCraft( from, m_Tool, targeted.GetType() ) == 1044267 )
{
number = 1044282; // You must be near a forge and and anvil to repair items. * Yes, there are two and's *
}
else if ( m_CraftSystem is DefTinkering && targeted is Golem g )
{
int damage = g.HitsMax - g.Hits;
private bool IsSpecialArmor(BaseArmor armor)
{
// Armor repairable but not craftable
if ( g.IsDeadBondedPet )
{
number = 500426; // You can't repair that.
}
else if ( damage <= 0 )
{
number = 500423; // That is already in full repair.
}
else
{
double skillValue = (usingDeed)? m_Deed.SkillLevel : from.Skills[SkillName.Tinkering].Value;
#region Temporary
if ( skillValue < 60.0 )
{
number = 1044153; // You don't have the required skills to attempt this item. //TODO: How does OSI handle this with deeds with golems?
}
else if ( !from.CanBeginAction( typeof( Golem ) ) )
{
number = 501789; // You must wait before trying again.
}
else
{
if ( damage > (int)(skillValue * 0.3) )
damage = (int)(skillValue * 0.3);
// TODO: Make these items craftable
if (m_CraftSystem is DefTailoring)
return armor is LeafTonlet
|| armor is LeafArms
|| armor is LeafChest
|| armor is LeafGloves
|| armor is LeafGorget
|| armor is LeafLegs
|| armor is HideChest
|| armor is HideGloves
|| armor is HideGorget
|| armor is HidePants
|| armor is HidePauldrons;
damage += 30;
if (m_CraftSystem is DefCarpentry)
return armor is WingedHelm
|| armor is RavenHelm
|| armor is VultureHelm
|| armor is WoodlandArms
|| armor is WoodlandChest
|| armor is WoodlandGloves
|| armor is WoodlandGorget
|| armor is WoodlandLegs;
if (m_CraftSystem is DefBlacksmithy)
return armor is Circlet
|| armor is RoyalCirclet
|| armor is GemmedCirclet;
if ( !from.CheckSkill( SkillName.Tinkering, 0.0, 100.0 ) )
damage /= 2;
#endregion
Container pack = from.Backpack;
return false;
}
if ( pack != null )
{
int v = pack.ConsumeUpTo( typeof( IronIngot ), (damage+4)/5 );
protected override void OnTarget(Mobile from, object targeted)
{
int number;
if ( v > 0 )
{
g.Hits += v*5;
if (!CheckDeed(from))
return;
number = 1044279; // You repair the item.
toDelete = true;
bool usingDeed = m_Deed != null;
bool toDelete = false;
from.BeginAction( typeof( Golem ) );
Timer.DelayCall( TimeSpan.FromSeconds( 12.0 ), new TimerStateCallback( EndGolemRepair ), from );
}
else
{
number = 1044037; // You do not have sufficient metal to make that.
}
}
else
{
number = 1044037; // You do not have sufficient metal to make that.
}
}
}
}
else if ( targeted is BaseWeapon weapon )
{
SkillName skill = m_CraftSystem.MainSkill;
int toWeaken = 0;
// TODO: Make an IRepairable
if ( Core.AOS )
{
toWeaken = 1;
}
else if ( skill != SkillName.Tailoring )
{
double skillLevel = (usingDeed)? m_Deed.SkillLevel : from.Skills[skill].Base;
if (m_CraftSystem.CanCraft(from, m_Tool, targeted.GetType()) == 1044267)
{
number = 1044282; // You must be near a forge and and anvil to repair items. * Yes, there are two and's *
}
else if (m_CraftSystem is DefTinkering && targeted is Golem g)
{
int damage = g.HitsMax - g.Hits;
if ( skillLevel >= 90.0 )
toWeaken = 1;
else if ( skillLevel >= 70.0 )
toWeaken = 2;
else
toWeaken = 3;
}
if (g.IsDeadBondedPet)
{
number = 500426; // You can't repair that.
}
else if (damage <= 0)
{
number = 500423; // That is already in full repair.
}
else
{
double skillValue = usingDeed ? m_Deed.SkillLevel : from.Skills[SkillName.Tinkering].Value;
if ( m_CraftSystem.CraftItems.SearchForSubclass( weapon.GetType() ) == null && !IsSpecialWeapon( weapon ) )
{
number = (usingDeed)? 1061136 : 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract.
}
else if ( !weapon.IsChildOf( from.Backpack ) && ( !Core.ML || weapon.Parent != from ) )
{
number = 1044275; // The item must be in your backpack to repair it.
}
else if ( !Core.AOS && weapon.PoisonCharges != 0 )
{
number = 1005012; // You cannot repair an item while a caustic substance is on it.
}
else if ( weapon.MaxHitPoints <= 0 || weapon.HitPoints == weapon.MaxHitPoints )
{
number = 1044281; // That item is in full repair
}
else if ( weapon.MaxHitPoints <= toWeaken )
{
number = 1044278; // That item has been repaired many times, and will break if repairs are attempted again.
}
else
{
if ( CheckWeaken( from, skill, weapon.HitPoints, weapon.MaxHitPoints ) )
{
weapon.MaxHitPoints -= toWeaken;
weapon.HitPoints = Math.Max( 0, weapon.HitPoints - toWeaken );
}
if (skillValue < 60.0)
{
number =
1044153; // You don't have the required skills to attempt this item. //TODO: How does OSI handle this with deeds with golems?
}
else if (!from.CanBeginAction(typeof(Golem)))
{
number = 501789; // You must wait before trying again.
}
else
{
if (damage > (int)(skillValue * 0.3))
damage = (int)(skillValue * 0.3);
if ( CheckRepairDifficulty( from, skill, weapon.HitPoints, weapon.MaxHitPoints ) )
{
number = 1044279; // You repair the item.
m_CraftSystem.PlayCraftEffect( from );
weapon.HitPoints = weapon.MaxHitPoints;
}
else
{
number = (usingDeed)? 1061137 : 1044280; // You fail to repair the item. [And the contract is destroyed]
m_CraftSystem.PlayCraftEffect( from );
}
damage += 30;
toDelete = true;
}
}
else if ( targeted is BaseArmor armor )
{
SkillName skill = m_CraftSystem.MainSkill;
int toWeaken = 0;
if (!from.CheckSkill(SkillName.Tinkering, 0.0, 100.0))
damage /= 2;
if ( Core.AOS )
{
toWeaken = 1;
}
else if ( skill != SkillName.Tailoring )
{
double skillLevel = (usingDeed)? m_Deed.SkillLevel : from.Skills[skill].Base;
Container pack = from.Backpack;
if ( skillLevel >= 90.0 )
toWeaken = 1;
else if ( skillLevel >= 70.0 )
toWeaken = 2;
else
toWeaken = 3;
}
if (pack != null)
{
int v = pack.ConsumeUpTo(typeof(IronIngot), (damage + 4) / 5);
if ( m_CraftSystem.CraftItems.SearchForSubclass( armor.GetType() ) == null && !IsSpecialArmor( armor ) )
{
number = (usingDeed)? 1061136 : 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract.
}
else if ( !armor.IsChildOf( from.Backpack ) && ( !Core.ML || armor.Parent != from ) )
{
number = 1044275; // The item must be in your backpack to repair it.
}
else if ( armor.MaxHitPoints <= 0 || armor.HitPoints == armor.MaxHitPoints )
{
number = 1044281; // That item is in full repair
}
else if ( armor.MaxHitPoints <= toWeaken )
{
number = 1044278; // That item has been repaired many times, and will break if repairs are attempted again.
}
else
{
if ( CheckWeaken( from, skill, armor.HitPoints, armor.MaxHitPoints ) )
{
armor.MaxHitPoints -= toWeaken;
armor.HitPoints = Math.Max( 0, armor.HitPoints - toWeaken );
}
if (v > 0)
{
g.Hits += v * 5;
if ( CheckRepairDifficulty( from, skill, armor.HitPoints, armor.MaxHitPoints ) )
{
number = 1044279; // You repair the item.
m_CraftSystem.PlayCraftEffect( from );
armor.HitPoints = armor.MaxHitPoints;
}
else
{
number = (usingDeed)? 1061137 : 1044280; // You fail to repair the item. [And the contract is destroyed]
m_CraftSystem.PlayCraftEffect( from );
}
number = 1044279; // You repair the item.
toDelete = true;
toDelete = true;
}
}
else if ( targeted is BaseClothing clothing )
{
SkillName skill = m_CraftSystem.MainSkill;
int toWeaken = 0;
from.BeginAction(typeof(Golem));
Timer.DelayCall(TimeSpan.FromSeconds(12.0), new TimerStateCallback(EndGolemRepair),
from);
}
else
{
number = 1044037; // You do not have sufficient metal to make that.
}
}
else
{
number = 1044037; // You do not have sufficient metal to make that.
}
}
}
}
else if (targeted is BaseWeapon weapon)
{
SkillName skill = m_CraftSystem.MainSkill;
int toWeaken = 0;
if ( Core.AOS )
{
toWeaken = 1;
}
else if ( skill != SkillName.Tailoring )
{
double skillLevel = (usingDeed) ? m_Deed.SkillLevel : from.Skills[skill].Base;
if (Core.AOS)
{
toWeaken = 1;
}
else if (skill != SkillName.Tailoring)
{
double skillLevel = usingDeed ? m_Deed.SkillLevel : from.Skills[skill].Base;
if ( skillLevel >= 90.0 )
toWeaken = 1;
else if ( skillLevel >= 70.0 )
toWeaken = 2;
else
toWeaken = 3;
}
if (skillLevel >= 90.0)
toWeaken = 1;
else if (skillLevel >= 70.0)
toWeaken = 2;
else
toWeaken = 3;
}
if (m_CraftSystem.CraftItems.SearchForSubclass(clothing.GetType()) == null && !IsSpecialClothing(clothing) && !((clothing is TribalMask) || (clothing is HornedTribalMask)) )
{
number = (usingDeed) ? 1061136 : 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract.
}
else if ( !clothing.IsChildOf( from.Backpack ) && ( !Core.ML || clothing.Parent != from ) )
{
number = 1044275; // The item must be in your backpack to repair it.
}
else if ( clothing.MaxHitPoints <= 0 || clothing.HitPoints == clothing.MaxHitPoints )
{
number = 1044281; // That item is in full repair
}
else if ( clothing.MaxHitPoints <= toWeaken )
{
number = 1044278; // That item has been repaired many times, and will break if repairs are attempted again.
}
else
{
if ( CheckWeaken( from, skill, clothing.HitPoints, clothing.MaxHitPoints ) )
{
clothing.MaxHitPoints -= toWeaken;
clothing.HitPoints = Math.Max( 0, clothing.HitPoints - toWeaken );
}
if (m_CraftSystem.CraftItems.SearchForSubclass(weapon.GetType()) == null && !IsSpecialWeapon(weapon))
{
number = usingDeed
? 1061136
: 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract.
}
else if (!weapon.IsChildOf(from.Backpack) && (!Core.ML || weapon.Parent != from))
{
number = 1044275; // The item must be in your backpack to repair it.
}
else if (!Core.AOS && weapon.PoisonCharges != 0)
{
number = 1005012; // You cannot repair an item while a caustic substance is on it.
}
else if (weapon.MaxHitPoints <= 0 || weapon.HitPoints == weapon.MaxHitPoints)
{
number = 1044281; // That item is in full repair
}
else if (weapon.MaxHitPoints <= toWeaken)
{
number = 1044278; // That item has been repaired many times, and will break if repairs are attempted again.
}
else
{
if (CheckWeaken(from, skill, weapon.HitPoints, weapon.MaxHitPoints))
{
weapon.MaxHitPoints -= toWeaken;
weapon.HitPoints = Math.Max(0, weapon.HitPoints - toWeaken);
}
if ( CheckRepairDifficulty( from, skill, clothing.HitPoints, clothing.MaxHitPoints ) )
{
number = 1044279; // You repair the item.
m_CraftSystem.PlayCraftEffect( from );
clothing.HitPoints = clothing.MaxHitPoints;
}
else
{
number = (usingDeed) ? 1061137 : 1044280; // You fail to repair the item. [And the contract is destroyed]
m_CraftSystem.PlayCraftEffect( from );
}
if (CheckRepairDifficulty(from, skill, weapon.HitPoints, weapon.MaxHitPoints))
{
number = 1044279; // You repair the item.
m_CraftSystem.PlayCraftEffect(from);
weapon.HitPoints = weapon.MaxHitPoints;
}
else
{
number = usingDeed
? 1061137
: 1044280; // You fail to repair the item. [And the contract is destroyed]
m_CraftSystem.PlayCraftEffect(from);
}
toDelete = true;
}
}
else if ( !usingDeed && targeted is BlankScroll scroll )
{
SkillName skill = m_CraftSystem.MainSkill;
toDelete = true;
}
}
else if (targeted is BaseArmor armor)
{
SkillName skill = m_CraftSystem.MainSkill;
int toWeaken = 0;
if ( from.Skills[skill].Value >= 50.0 )
{
scroll.Consume( 1 );
RepairDeed deed = new RepairDeed( RepairDeed.GetTypeFor( m_CraftSystem ), from.Skills[skill].Value, from );
from.AddToBackpack( deed );
if (Core.AOS)
{
toWeaken = 1;
}
else if (skill != SkillName.Tailoring)
{
double skillLevel = usingDeed ? m_Deed.SkillLevel : from.Skills[skill].Base;
number = 500442; // You create the item and put it in your backpack.
}
else
number = 1047005; // You must be at least apprentice level to create a repair service contract.
}
else if ( targeted is Item )
{
number = (usingDeed)? 1061136 : 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract.
}
else
{
number = 500426; // You can't repair that.
}
if (skillLevel >= 90.0)
toWeaken = 1;
else if (skillLevel >= 70.0)
toWeaken = 2;
else
toWeaken = 3;
}
if ( !usingDeed )
{
CraftContext context = m_CraftSystem.GetContext( from );
from.SendGump( new CraftGump( from, m_CraftSystem, m_Tool, number ) );
}
else
{
from.SendLocalizedMessage( number );
if (m_CraftSystem.CraftItems.SearchForSubclass(armor.GetType()) == null && !IsSpecialArmor(armor))
{
number = usingDeed
? 1061136
: 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract.
}
else if (!armor.IsChildOf(from.Backpack) && (!Core.ML || armor.Parent != from))
{
number = 1044275; // The item must be in your backpack to repair it.
}
else if (armor.MaxHitPoints <= 0 || armor.HitPoints == armor.MaxHitPoints)
{
number = 1044281; // That item is in full repair
}
else if (armor.MaxHitPoints <= toWeaken)
{
number = 1044278; // That item has been repaired many times, and will break if repairs are attempted again.
}
else
{
if (CheckWeaken(from, skill, armor.HitPoints, armor.MaxHitPoints))
{
armor.MaxHitPoints -= toWeaken;
armor.HitPoints = Math.Max(0, armor.HitPoints - toWeaken);
}
if ( toDelete )
m_Deed.Delete();
}
}
}
}
}
if (CheckRepairDifficulty(from, skill, armor.HitPoints, armor.MaxHitPoints))
{
number = 1044279; // You repair the item.
m_CraftSystem.PlayCraftEffect(from);
armor.HitPoints = armor.MaxHitPoints;
}
else
{
number = usingDeed
? 1061137
: 1044280; // You fail to repair the item. [And the contract is destroyed]
m_CraftSystem.PlayCraftEffect(from);
}
toDelete = true;
}
}
else if (targeted is BaseClothing clothing)
{
SkillName skill = m_CraftSystem.MainSkill;
int toWeaken = 0;
if (Core.AOS)
{
toWeaken = 1;
}
else if (skill != SkillName.Tailoring)
{
double skillLevel = usingDeed ? m_Deed.SkillLevel : from.Skills[skill].Base;
if (skillLevel >= 90.0)
toWeaken = 1;
else if (skillLevel >= 70.0)
toWeaken = 2;
else
toWeaken = 3;
}
if (m_CraftSystem.CraftItems.SearchForSubclass(clothing.GetType()) == null &&
!IsSpecialClothing(clothing) && !(clothing is TribalMask || clothing is HornedTribalMask))
{
number = usingDeed
? 1061136
: 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract.
}
else if (!clothing.IsChildOf(from.Backpack) && (!Core.ML || clothing.Parent != from))
{
number = 1044275; // The item must be in your backpack to repair it.
}
else if (clothing.MaxHitPoints <= 0 || clothing.HitPoints == clothing.MaxHitPoints)
{
number = 1044281; // That item is in full repair
}
else if (clothing.MaxHitPoints <= toWeaken)
{
number = 1044278; // That item has been repaired many times, and will break if repairs are attempted again.
}
else
{
if (CheckWeaken(from, skill, clothing.HitPoints, clothing.MaxHitPoints))
{
clothing.MaxHitPoints -= toWeaken;
clothing.HitPoints = Math.Max(0, clothing.HitPoints - toWeaken);
}
if (CheckRepairDifficulty(from, skill, clothing.HitPoints, clothing.MaxHitPoints))
{
number = 1044279; // You repair the item.
m_CraftSystem.PlayCraftEffect(from);
clothing.HitPoints = clothing.MaxHitPoints;
}
else
{
number = usingDeed
? 1061137
: 1044280; // You fail to repair the item. [And the contract is destroyed]
m_CraftSystem.PlayCraftEffect(from);
}
toDelete = true;
}
}
else if (!usingDeed && targeted is BlankScroll scroll)
{
SkillName skill = m_CraftSystem.MainSkill;
if (from.Skills[skill].Value >= 50.0)
{
scroll.Consume(1);
RepairDeed deed = new RepairDeed(RepairDeed.GetTypeFor(m_CraftSystem), from.Skills[skill].Value,
from);
from.AddToBackpack(deed);
number = 500442; // You create the item and put it in your backpack.
}
else
{
number = 1047005; // You must be at least apprentice level to create a repair service contract.
}
}
else if (targeted is Item)
{
number = usingDeed
? 1061136
: 1044277; // That item cannot be repaired. // You cannot repair that item with this type of repair contract.
}
else
{
number = 500426; // You can't repair that.
}
if (!usingDeed)
{
CraftContext context = m_CraftSystem.GetContext(from);
from.SendGump(new CraftGump(from, m_CraftSystem, m_Tool, number));
}
else
{
from.SendLocalizedMessage(number);
if (toDelete)
m_Deed.Delete();
}
}
}
}
}

View file

@ -1,166 +1,186 @@
using System;
using Server.Targeting;
using Server.Ethics;
using Server.Items;
using Server.Targeting;
namespace Server.Engines.Craft
{
public enum SmeltResult
{
Success,
Invalid,
NoSkill
}
public enum SmeltResult
{
Success,
Invalid,
NoSkill
}
public class Resmelt
{
public Resmelt()
{
}
public class Resmelt
{
public static void Do(Mobile from, CraftSystem craftSystem, BaseTool tool)
{
int num = craftSystem.CanCraft(from, tool, null);
public static void Do( Mobile from, CraftSystem craftSystem, BaseTool tool )
{
int num = craftSystem.CanCraft( from, tool, null );
if (num > 0 && num != 1044267)
{
from.SendGump(new CraftGump(from, craftSystem, tool, num));
}
else
{
from.Target = new InternalTarget(craftSystem, tool);
from.SendLocalizedMessage(1044273); // Target an item to recycle.
}
}
if ( num > 0 && num != 1044267 )
{
from.SendGump( new CraftGump( from, craftSystem, tool, num ) );
}
else
{
from.Target = new InternalTarget( craftSystem, tool );
from.SendLocalizedMessage( 1044273 ); // Target an item to recycle.
}
}
private class InternalTarget : Target
{
private CraftSystem m_CraftSystem;
private BaseTool m_Tool;
private class InternalTarget : Target
{
private CraftSystem m_CraftSystem;
private BaseTool m_Tool;
public InternalTarget(CraftSystem craftSystem, BaseTool tool) : base(2, false, TargetFlags.None)
{
m_CraftSystem = craftSystem;
m_Tool = tool;
}
public InternalTarget( CraftSystem craftSystem, BaseTool tool ) : base ( 2, false, TargetFlags.None )
{
m_CraftSystem = craftSystem;
m_Tool = tool;
}
private SmeltResult Resmelt(Mobile from, Item item, CraftResource resource)
{
try
{
if (Ethic.IsImbued(item))
return SmeltResult.Invalid;
private SmeltResult Resmelt( Mobile from, Item item, CraftResource resource )
{
try
{
if (CraftResources.GetType(resource) != CraftResourceType.Metal)
return SmeltResult.Invalid;
if ( Ethics.Ethic.IsImbued( item ) )
return SmeltResult.Invalid;
CraftResourceInfo info = CraftResources.GetInfo(resource);
if ( CraftResources.GetType( resource ) != CraftResourceType.Metal )
return SmeltResult.Invalid;
if (info == null || info.ResourceTypes.Length == 0)
return SmeltResult.Invalid;
CraftResourceInfo info = CraftResources.GetInfo( resource );
CraftItem craftItem = m_CraftSystem.CraftItems.SearchFor(item.GetType());
if ( info == null || info.ResourceTypes.Length == 0 )
return SmeltResult.Invalid;
if (craftItem == null || craftItem.Resources.Count == 0)
return SmeltResult.Invalid;
CraftItem craftItem = m_CraftSystem.CraftItems.SearchFor( item.GetType() );
CraftRes craftResource = craftItem.Resources.GetAt(0);
if ( craftItem == null || craftItem.Resources.Count == 0 )
return SmeltResult.Invalid;
if (craftResource.Amount < 2)
return SmeltResult.Invalid; // Not enough metal to resmelt
CraftRes craftResource = craftItem.Resources.GetAt( 0 );
double difficulty = 0.0;
if ( craftResource.Amount < 2 )
return SmeltResult.Invalid; // Not enough metal to resmelt
switch (resource)
{
case CraftResource.DullCopper:
difficulty = 65.0;
break;
case CraftResource.ShadowIron:
difficulty = 70.0;
break;
case CraftResource.Copper:
difficulty = 75.0;
break;
case CraftResource.Bronze:
difficulty = 80.0;
break;
case CraftResource.Gold:
difficulty = 85.0;
break;
case CraftResource.Agapite:
difficulty = 90.0;
break;
case CraftResource.Verite:
difficulty = 95.0;
break;
case CraftResource.Valorite:
difficulty = 99.0;
break;
}
double difficulty = 0.0;
if (difficulty > from.Skills[SkillName.Mining].Value)
return SmeltResult.NoSkill;
switch ( resource )
{
case CraftResource.DullCopper: difficulty = 65.0; break;
case CraftResource.ShadowIron: difficulty = 70.0; break;
case CraftResource.Copper: difficulty = 75.0; break;
case CraftResource.Bronze: difficulty = 80.0; break;
case CraftResource.Gold: difficulty = 85.0; break;
case CraftResource.Agapite: difficulty = 90.0; break;
case CraftResource.Verite: difficulty = 95.0; break;
case CraftResource.Valorite: difficulty = 99.0; break;
}
Type resourceType = info.ResourceTypes[0];
Item ingot = (Item)Activator.CreateInstance(resourceType);
if ( difficulty > from.Skills[ SkillName.Mining ].Value )
return SmeltResult.NoSkill;
if (item is DragonBardingDeed || item is BaseArmor armor && armor.PlayerConstructed ||
item is BaseWeapon weapon && weapon.PlayerConstructed ||
item is BaseClothing clothing && clothing.PlayerConstructed)
ingot.Amount = craftResource.Amount / 2;
else
ingot.Amount = 1;
Type resourceType = info.ResourceTypes[0];
Item ingot = (Item)Activator.CreateInstance( resourceType );
item.Delete();
from.AddToBackpack(ingot);
if ( item is DragonBardingDeed || (item is BaseArmor armor && armor.PlayerConstructed) || (item is BaseWeapon weapon && weapon.PlayerConstructed) || (item is BaseClothing clothing && clothing.PlayerConstructed) )
ingot.Amount = craftResource.Amount / 2;
else
ingot.Amount = 1;
from.PlaySound(0x2A);
from.PlaySound(0x240);
return SmeltResult.Success;
}
catch
{
}
item.Delete();
from.AddToBackpack( ingot );
return SmeltResult.Invalid;
}
from.PlaySound( 0x2A );
from.PlaySound( 0x240 );
return SmeltResult.Success;
}
catch
{
}
protected override void OnTarget(Mobile from, object targeted)
{
int num = m_CraftSystem.CanCraft(from, m_Tool, null);
return SmeltResult.Invalid;
}
if (num > 0)
{
if (num == 1044267)
{
bool anvil, forge;
protected override void OnTarget( Mobile from, object targeted )
{
int num = m_CraftSystem.CanCraft( from, m_Tool, null );
DefBlacksmithy.CheckAnvilAndForge(from, 2, out anvil, out forge);
if ( num > 0 )
{
if ( num == 1044267 )
{
bool anvil, forge;
if (!anvil)
num = 1044266; // You must be near an anvil
else if (!forge)
num = 1044265; // You must be near a forge.
}
DefBlacksmithy.CheckAnvilAndForge( from, 2, out anvil, out forge );
from.SendGump(new CraftGump(from, m_CraftSystem, m_Tool, num));
}
else
{
SmeltResult result = SmeltResult.Invalid;
bool isStoreBought = false;
int message;
if ( !anvil )
num = 1044266; // You must be near an anvil
else if ( !forge )
num = 1044265; // You must be near a forge.
}
if (targeted is BaseArmor armor)
{
result = Resmelt(from, armor, armor.Resource);
isStoreBought = !armor.PlayerConstructed;
}
else if (targeted is BaseWeapon weapon)
{
result = Resmelt(from, weapon, weapon.Resource);
isStoreBought = !weapon.PlayerConstructed;
}
else if (targeted is DragonBardingDeed deed)
{
result = Resmelt(from, deed, deed.Resource);
isStoreBought = false;
}
from.SendGump( new CraftGump( from, m_CraftSystem, m_Tool, num ) );
}
else
{
SmeltResult result = SmeltResult.Invalid;
bool isStoreBought = false;
int message;
switch (result)
{
default:
case SmeltResult.Invalid:
message = 1044272;
break; // You can't melt that down into ingots.
case SmeltResult.NoSkill:
message = 1044269;
break; // You have no idea how to work this metal.
case SmeltResult.Success:
message = isStoreBought ? 500418 : 1044270;
break; // You melt the item down into ingots.
}
if ( targeted is BaseArmor armor )
{
result = Resmelt( from, armor, armor.Resource );
isStoreBought = !armor.PlayerConstructed;
}
else if ( targeted is BaseWeapon weapon )
{
result = Resmelt( from, weapon, weapon.Resource );
isStoreBought = !weapon.PlayerConstructed;
}
else if ( targeted is DragonBardingDeed deed )
{
result = Resmelt( from, deed, deed.Resource );
isStoreBought = false;
}
switch ( result )
{
default:
case SmeltResult.Invalid: message = 1044272; break; // You can't melt that down into ingots.
case SmeltResult.NoSkill: message = 1044269; break; // You have no idea how to work this metal.
case SmeltResult.Success: message = isStoreBought ? 500418 : 1044270; break; // You melt the item down into ingots.
}
from.SendGump( new CraftGump( from, m_CraftSystem, m_Tool, message ) );
}
}
}
}
}
from.SendGump(new CraftGump(from, m_CraftSystem, m_Tool, message));
}
}
}
}
}

View file

@ -3,165 +3,181 @@ using Server.Items;
namespace Server.Engines.Craft
{
public class DefAlchemy : CraftSystem
{
public override SkillName MainSkill => SkillName.Alchemy;
public class DefAlchemy : CraftSystem
{
private static CraftSystem m_CraftSystem;
public override int GumpTitleNumber => 1044001;
private static Type typeofPotion = typeof(BasePotion);
private static CraftSystem m_CraftSystem;
private DefAlchemy() : base(1, 1, 1.25) // base( 1, 1, 3.1 )
{
}
public static CraftSystem CraftSystem
{
get
{
if ( m_CraftSystem == null )
m_CraftSystem = new DefAlchemy();
public override SkillName MainSkill => SkillName.Alchemy;
return m_CraftSystem;
}
}
public override int GumpTitleNumber => 1044001;
public override double GetChanceAtMin( CraftItem item )
{
return 0.0; // 0%
}
public static CraftSystem CraftSystem
{
get
{
if (m_CraftSystem == null)
m_CraftSystem = new DefAlchemy();
private DefAlchemy() : base( 1, 1, 1.25 )// base( 1, 1, 3.1 )
{
}
return m_CraftSystem;
}
}
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
{
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
public override double GetChanceAtMin(CraftItem item)
{
return 0.0; // 0%
}
return 0;
}
public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
{
if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
return 1044038; // You have worn out your tool!
if (!BaseTool.CheckAccessible(tool, from))
return 1044263; // The tool must be on your person to use.
public override void PlayCraftEffect( Mobile from )
{
from.PlaySound( 0x242 );
}
return 0;
}
private static Type typeofPotion = typeof( BasePotion );
public override void PlayCraftEffect(Mobile from)
{
from.PlaySound(0x242);
}
public static bool IsPotion( Type type )
{
return typeofPotion.IsAssignableFrom( type );
}
public static bool IsPotion(Type type)
{
return typeofPotion.IsAssignableFrom(type);
}
public override int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item )
{
if ( toolBroken )
from.SendLocalizedMessage( 1044038 ); // You have worn out your tool
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality,
bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
if ( failed )
{
if ( IsPotion( item.ItemType ) )
{
from.AddToBackpack( new Bottle() );
return 500287; // You fail to create a useful potion.
}
if (failed)
{
if (IsPotion(item.ItemType))
{
from.AddToBackpack(new Bottle());
return 500287; // You fail to create a useful potion.
}
return 1044043; // You failed to create the item, and some of your materials are lost.
}
return 1044043; // You failed to create the item, and some of your materials are lost.
}
from.PlaySound( 0x240 ); // Sound of a filling bottle
from.PlaySound(0x240); // Sound of a filling bottle
if ( IsPotion( item.ItemType ) )
{
if ( quality == -1 )
return 1048136; // You create the potion and pour it into a keg.
return 500279; // You pour the potion into a bottle...
}
if (IsPotion(item.ItemType))
{
if (quality == -1)
return 1048136; // You create the potion and pour it into a keg.
return 500279; // You pour the potion into a bottle...
}
return 1044154; // You create the item.
}
return 1044154; // You create the item.
}
public override void InitCraftList()
{
int index = -1;
public override void InitCraftList()
{
int index = -1;
// Refresh Potion
index = AddCraft( typeof( RefreshPotion ), 1044530, 1044538, -25, 25.0, typeof( BlackPearl ), 1044353, 1, 1044361 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
index = AddCraft( typeof( TotalRefreshPotion ), 1044530, 1044539, 25.0, 75.0, typeof( BlackPearl ), 1044353, 5, 1044361 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
// Refresh Potion
index = AddCraft(typeof(RefreshPotion), 1044530, 1044538, -25, 25.0, typeof(BlackPearl), 1044353, 1, 1044361);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(TotalRefreshPotion), 1044530, 1044539, 25.0, 75.0, typeof(BlackPearl), 1044353, 5,
1044361);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
// Agility Potion
index = AddCraft( typeof( AgilityPotion ), 1044531, 1044540, 15.0, 65.0, typeof( Bloodmoss ), 1044354, 1, 1044362 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
index = AddCraft( typeof( GreaterAgilityPotion ), 1044531, 1044541, 35.0, 85.0, typeof( Bloodmoss ), 1044354, 3, 1044362 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
// Agility Potion
index = AddCraft(typeof(AgilityPotion), 1044531, 1044540, 15.0, 65.0, typeof(Bloodmoss), 1044354, 1, 1044362);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(GreaterAgilityPotion), 1044531, 1044541, 35.0, 85.0, typeof(Bloodmoss), 1044354, 3,
1044362);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
// Nightsight Potion
index = AddCraft( typeof( NightSightPotion ), 1044532, 1044542, -25.0, 25.0, typeof( SpidersSilk ), 1044360, 1, 1044368 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
// Nightsight Potion
index = AddCraft(typeof(NightSightPotion), 1044532, 1044542, -25.0, 25.0, typeof(SpidersSilk), 1044360, 1,
1044368);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
// Heal Potion
index = AddCraft( typeof( LesserHealPotion ), 1044533, 1044543, -25.0, 25.0, typeof( Ginseng ), 1044356, 1, 1044364 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
index = AddCraft( typeof( HealPotion ), 1044533, 1044544, 15.0, 65.0, typeof( Ginseng ), 1044356, 3, 1044364 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
index = AddCraft( typeof( GreaterHealPotion ), 1044533, 1044545, 55.0, 105.0, typeof( Ginseng ), 1044356, 7, 1044364 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
// Heal Potion
index = AddCraft(typeof(LesserHealPotion), 1044533, 1044543, -25.0, 25.0, typeof(Ginseng), 1044356, 1, 1044364);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(HealPotion), 1044533, 1044544, 15.0, 65.0, typeof(Ginseng), 1044356, 3, 1044364);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(GreaterHealPotion), 1044533, 1044545, 55.0, 105.0, typeof(Ginseng), 1044356, 7, 1044364);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
// Strength Potion
index = AddCraft( typeof( StrengthPotion ), 1044534, 1044546, 25.0, 75.0, typeof( MandrakeRoot ), 1044357, 2, 1044365 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
index = AddCraft( typeof( GreaterStrengthPotion ), 1044534, 1044547, 45.0, 95.0, typeof( MandrakeRoot ), 1044357, 5, 1044365 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
// Strength Potion
index = AddCraft(typeof(StrengthPotion), 1044534, 1044546, 25.0, 75.0, typeof(MandrakeRoot), 1044357, 2,
1044365);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(GreaterStrengthPotion), 1044534, 1044547, 45.0, 95.0, typeof(MandrakeRoot), 1044357, 5,
1044365);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
// Poison Potion
index = AddCraft( typeof( LesserPoisonPotion ), 1044535, 1044548, -5.0, 45.0, typeof( Nightshade ), 1044358, 1, 1044366 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
index = AddCraft( typeof( PoisonPotion ), 1044535, 1044549, 15.0, 65.0, typeof( Nightshade ), 1044358, 2, 1044366 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
index = AddCraft( typeof( GreaterPoisonPotion ), 1044535, 1044550, 55.0, 105.0, typeof( Nightshade ), 1044358, 4, 1044366 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
index = AddCraft( typeof( DeadlyPoisonPotion ), 1044535, 1044551, 90.0, 140.0, typeof( Nightshade ), 1044358, 8, 1044366 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
// Poison Potion
index = AddCraft(typeof(LesserPoisonPotion), 1044535, 1044548, -5.0, 45.0, typeof(Nightshade), 1044358, 1,
1044366);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(PoisonPotion), 1044535, 1044549, 15.0, 65.0, typeof(Nightshade), 1044358, 2, 1044366);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(GreaterPoisonPotion), 1044535, 1044550, 55.0, 105.0, typeof(Nightshade), 1044358, 4,
1044366);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(DeadlyPoisonPotion), 1044535, 1044551, 90.0, 140.0, typeof(Nightshade), 1044358, 8,
1044366);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
// Cure Potion
index = AddCraft( typeof( LesserCurePotion ), 1044536, 1044552, -10.0, 40.0, typeof( Garlic ), 1044355, 1, 1044363 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
index = AddCraft( typeof( CurePotion ), 1044536, 1044553, 25.0, 75.0, typeof( Garlic ), 1044355, 3, 1044363 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
index = AddCraft( typeof( GreaterCurePotion ), 1044536, 1044554, 65.0, 115.0, typeof( Garlic ), 1044355, 6, 1044363 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
// Cure Potion
index = AddCraft(typeof(LesserCurePotion), 1044536, 1044552, -10.0, 40.0, typeof(Garlic), 1044355, 1, 1044363);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(CurePotion), 1044536, 1044553, 25.0, 75.0, typeof(Garlic), 1044355, 3, 1044363);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(GreaterCurePotion), 1044536, 1044554, 65.0, 115.0, typeof(Garlic), 1044355, 6, 1044363);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
// Explosion Potion
index = AddCraft( typeof( LesserExplosionPotion ), 1044537, 1044555, 5.0, 55.0, typeof( SulfurousAsh ), 1044359, 3, 1044367 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
index = AddCraft( typeof( ExplosionPotion ), 1044537, 1044556, 35.0, 85.0, typeof( SulfurousAsh ), 1044359, 5, 1044367 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
index = AddCraft( typeof( GreaterExplosionPotion ), 1044537, 1044557, 65.0, 115.0, typeof( SulfurousAsh ), 1044359, 10, 1044367 );
AddRes( index, typeof ( Bottle ), 1044529, 1, 500315 );
// Explosion Potion
index = AddCraft(typeof(LesserExplosionPotion), 1044537, 1044555, 5.0, 55.0, typeof(SulfurousAsh), 1044359, 3,
1044367);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(ExplosionPotion), 1044537, 1044556, 35.0, 85.0, typeof(SulfurousAsh), 1044359, 5,
1044367);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
index = AddCraft(typeof(GreaterExplosionPotion), 1044537, 1044557, 65.0, 115.0, typeof(SulfurousAsh), 1044359,
10, 1044367);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
if ( Core.SE )
{
index = AddCraft( typeof( SmokeBomb ), 1044537, 1030248, 90.0, 120.0, typeof( Eggs ), 1044477, 1, 1044253 );
AddRes( index, typeof ( Ginseng ), 1044356, 3, 1044364 );
SetNeededExpansion( index, Expansion.SE );
if (Core.SE)
{
index = AddCraft(typeof(SmokeBomb), 1044537, 1030248, 90.0, 120.0, typeof(Eggs), 1044477, 1, 1044253);
AddRes(index, typeof(Ginseng), 1044356, 3, 1044364);
SetNeededExpansion(index, Expansion.SE);
// Conflagration Potions
index = AddCraft( typeof(ConflagrationPotion), 1044109, 1072096, 55.0, 105.0, typeof(GraveDust), 1023983, 5, 1044253 );
AddRes( index, typeof(Bottle), 1044529, 1, 500315 );
SetNeededExpansion(index, Expansion.SE);
index = AddCraft( typeof(GreaterConflagrationPotion), 1044109, 1072099, 65.0, 115.0, typeof(GraveDust), 1023983, 10, 1044253 );
AddRes( index, typeof(Bottle), 1044529, 1, 500315 );
SetNeededExpansion(index, Expansion.SE);
// Confusion Blast Potions
index = AddCraft( typeof(ConfusionBlastPotion), 1044109, 1072106, 55.0, 105.0, typeof(PigIron), 1023978, 5, 1044253 );
AddRes( index, typeof(Bottle), 1044529, 1, 500315 );
SetNeededExpansion(index, Expansion.SE);
index = AddCraft( typeof(GreaterConfusionBlastPotion), 1044109, 1072109, 65.0, 115.0, typeof(PigIron), 1023978, 10, 1044253 );
AddRes( index, typeof(Bottle), 1044529, 1, 500315 );
SetNeededExpansion(index, Expansion.SE);
}
}
}
}
// Conflagration Potions
index = AddCraft(typeof(ConflagrationPotion), 1044109, 1072096, 55.0, 105.0, typeof(GraveDust), 1023983, 5,
1044253);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(GreaterConflagrationPotion), 1044109, 1072099, 65.0, 115.0, typeof(GraveDust),
1023983, 10, 1044253);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
SetNeededExpansion(index, Expansion.SE);
// Confusion Blast Potions
index = AddCraft(typeof(ConfusionBlastPotion), 1044109, 1072106, 55.0, 105.0, typeof(PigIron), 1023978, 5,
1044253);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(GreaterConfusionBlastPotion), 1044109, 1072109, 65.0, 115.0, typeof(PigIron),
1023978, 10, 1044253);
AddRes(index, typeof(Bottle), 1044529, 1, 500315);
SetNeededExpansion(index, Expansion.SE);
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -3,208 +3,213 @@ using Server.Items;
namespace Server.Engines.Craft
{
public class DefBowFletching : CraftSystem
{
public override SkillName MainSkill => SkillName.Fletching;
public class DefBowFletching : CraftSystem
{
private static CraftSystem m_CraftSystem;
public override int GumpTitleNumber => 1044006;
private DefBowFletching() : base(1, 1, 1.25) // base( 1, 2, 1.7 )
{
}
private static CraftSystem m_CraftSystem;
public override SkillName MainSkill => SkillName.Fletching;
public static CraftSystem CraftSystem
{
get
{
if ( m_CraftSystem == null )
m_CraftSystem = new DefBowFletching();
public override int GumpTitleNumber => 1044006;
return m_CraftSystem;
}
}
public static CraftSystem CraftSystem
{
get
{
if (m_CraftSystem == null)
m_CraftSystem = new DefBowFletching();
public override double GetChanceAtMin( CraftItem item )
{
return 0.5; // 50%
}
return m_CraftSystem;
}
}
private DefBowFletching() : base( 1, 1, 1.25 )// base( 1, 2, 1.7 )
{
}
public override CraftECA ECA => CraftECA.FiftyPercentChanceMinusTenPercent;
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
{
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
public override double GetChanceAtMin(CraftItem item)
{
return 0.5; // 50%
}
return 0;
}
public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
{
if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
return 1044038; // You have worn out your tool!
if (!BaseTool.CheckAccessible(tool, from))
return 1044263; // The tool must be on your person to use.
public override void PlayCraftEffect( Mobile from )
{
// no animation
//if ( from.Body.Type == BodyType.Human && !from.Mounted )
// from.Animate( 33, 5, 1, true, false, 0 );
return 0;
}
from.PlaySound( 0x55 );
}
public override void PlayCraftEffect(Mobile from)
{
// no animation
//if ( from.Body.Type == BodyType.Human && !from.Mounted )
// from.Animate( 33, 5, 1, true, false, 0 );
public override int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item )
{
if ( toolBroken )
from.SendLocalizedMessage( 1044038 ); // You have worn out your tool
from.PlaySound(0x55);
}
if ( failed )
{
if ( lostMaterial )
return 1044043; // You failed to create the item, and some of your materials are lost.
return 1044157; // You failed to create the item, but no materials were lost.
}
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality,
bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
if ( quality == 0 )
return 502785; // You were barely able to make this item. It's quality is below average.
if ( makersMark && quality == 2 )
return 1044156; // You create an exceptional quality item and affix your maker's mark.
if ( quality == 2 )
return 1044155; // You create an exceptional quality item.
return 1044154; // You create the item.
}
if (failed)
{
if (lostMaterial)
return 1044043; // You failed to create the item, and some of your materials are lost.
return 1044157; // You failed to create the item, but no materials were lost.
}
public override CraftECA ECA => CraftECA.FiftyPercentChanceMinusTenPercent;
if (quality == 0)
return 502785; // You were barely able to make this item. It's quality is below average.
if (makersMark && quality == 2)
return 1044156; // You create an exceptional quality item and affix your maker's mark.
if (quality == 2)
return 1044155; // You create an exceptional quality item.
return 1044154; // You create the item.
}
public override void InitCraftList()
{
int index = -1;
public override void InitCraftList()
{
int index = -1;
// Materials
AddCraft( typeof( Kindling ), 1044457, 1023553, 0.0, 00.0, typeof( Log ), 1044041, 1, 1044351 );
// Materials
AddCraft(typeof(Kindling), 1044457, 1023553, 0.0, 00.0, typeof(Log), 1044041, 1, 1044351);
index = AddCraft( typeof( Shaft ), 1044457, 1027124, 0.0, 40.0, typeof( Log ), 1044041, 1, 1044351 );
SetUseAllRes( index, true );
index = AddCraft(typeof(Shaft), 1044457, 1027124, 0.0, 40.0, typeof(Log), 1044041, 1, 1044351);
SetUseAllRes(index, true);
// Ammunition
index = AddCraft( typeof( Arrow ), 1044565, 1023903, 0.0, 40.0, typeof( Shaft ), 1044560, 1, 1044561 );
AddRes( index, typeof( Feather ), 1044562, 1, 1044563 );
SetUseAllRes( index, true );
// Ammunition
index = AddCraft(typeof(Arrow), 1044565, 1023903, 0.0, 40.0, typeof(Shaft), 1044560, 1, 1044561);
AddRes(index, typeof(Feather), 1044562, 1, 1044563);
SetUseAllRes(index, true);
index = AddCraft( typeof( Bolt ), 1044565, 1027163, 0.0, 40.0, typeof( Shaft ), 1044560, 1, 1044561 );
AddRes( index, typeof( Feather ), 1044562, 1, 1044563 );
SetUseAllRes( index, true );
index = AddCraft(typeof(Bolt), 1044565, 1027163, 0.0, 40.0, typeof(Shaft), 1044560, 1, 1044561);
AddRes(index, typeof(Feather), 1044562, 1, 1044563);
SetUseAllRes(index, true);
if ( Core.SE )
{
index = AddCraft( typeof( FukiyaDarts ), 1044565, 1030246, 50.0, 90.0, typeof( Log ), 1044041, 1, 1044351 );
SetUseAllRes( index, true );
SetNeededExpansion( index, Expansion.SE );
}
if (Core.SE)
{
index = AddCraft(typeof(FukiyaDarts), 1044565, 1030246, 50.0, 90.0, typeof(Log), 1044041, 1, 1044351);
SetUseAllRes(index, true);
SetNeededExpansion(index, Expansion.SE);
}
// Weapons
AddCraft( typeof( Bow ), 1044566, 1025042, 30.0, 70.0, typeof( Log ), 1044041, 7, 1044351 );
AddCraft( typeof( Crossbow ), 1044566, 1023919, 60.0, 100.0, typeof( Log ), 1044041, 7, 1044351 );
AddCraft( typeof( HeavyCrossbow ), 1044566, 1025117, 80.0, 120.0, typeof( Log ), 1044041, 10, 1044351 );
// Weapons
AddCraft(typeof(Bow), 1044566, 1025042, 30.0, 70.0, typeof(Log), 1044041, 7, 1044351);
AddCraft(typeof(Crossbow), 1044566, 1023919, 60.0, 100.0, typeof(Log), 1044041, 7, 1044351);
AddCraft(typeof(HeavyCrossbow), 1044566, 1025117, 80.0, 120.0, typeof(Log), 1044041, 10, 1044351);
if ( Core.AOS )
{
AddCraft( typeof( CompositeBow ), 1044566, 1029922, 70.0, 110.0, typeof( Log ), 1044041, 7, 1044351 );
AddCraft( typeof( RepeatingCrossbow ), 1044566, 1029923, 90.0, 130.0, typeof( Log ), 1044041, 10, 1044351 );
}
if (Core.AOS)
{
AddCraft(typeof(CompositeBow), 1044566, 1029922, 70.0, 110.0, typeof(Log), 1044041, 7, 1044351);
AddCraft(typeof(RepeatingCrossbow), 1044566, 1029923, 90.0, 130.0, typeof(Log), 1044041, 10, 1044351);
}
if ( Core.SE )
{
index = AddCraft( typeof( Yumi ), 1044566, 1030224, 90.0, 130.0, typeof( Log ), 1044041, 10, 1044351 );
SetNeededExpansion( index, Expansion.SE );
}
if (Core.SE)
{
index = AddCraft(typeof(Yumi), 1044566, 1030224, 90.0, 130.0, typeof(Log), 1044041, 10, 1044351);
SetNeededExpansion(index, Expansion.SE);
}
if ( Core.ML )
{
index = AddCraft( typeof( BlightGrippedLongbow ), 1044566, 1072907, 75.0, 125.0, typeof( Log ), 1044041, 20, 1044351 );
AddRes( index, typeof( LardOfParoxysmus ), 1032681, 1, 1053098 );
AddRes( index, typeof( Blight ), 1032675, 10, 1053098 );
AddRes( index, typeof( Corruption ), 1032676, 10, 1053098 );
AddRareRecipe( index, 200 );
ForceNonExceptional( index );
SetNeededExpansion( index, Expansion.ML );
if (Core.ML)
{
index = AddCraft(typeof(BlightGrippedLongbow), 1044566, 1072907, 75.0, 125.0, typeof(Log), 1044041, 20,
1044351);
AddRes(index, typeof(LardOfParoxysmus), 1032681, 1, 1053098);
AddRes(index, typeof(Blight), 1032675, 10, 1053098);
AddRes(index, typeof(Corruption), 1032676, 10, 1053098);
AddRareRecipe(index, 200);
ForceNonExceptional(index);
SetNeededExpansion(index, Expansion.ML);
/* TODO
index = AddCraft( typeof( FaerieFire ), 1044566, 1072908, 75.0, 125.0, typeof( Log ), 1044041, 20, 1044351 );
AddRes( index, typeof( LardOfParoxysmus ), 1032681, 1, 1053098 );
AddRes( index, typeof( Putrefication ), 1032678, 10, 1053098 );
AddRes( index, typeof( Taint ), 1032679, 10, 1053098 );
AddRareRecipe( index, 201 );
ForceNonExceptional( index );
SetNeededExpansion( index, Expansion.ML );
*/
/* TODO
index = AddCraft( typeof( FaerieFire ), 1044566, 1072908, 75.0, 125.0, typeof( Log ), 1044041, 20, 1044351 );
AddRes( index, typeof( LardOfParoxysmus ), 1032681, 1, 1053098 );
AddRes( index, typeof( Putrefication ), 1032678, 10, 1053098 );
AddRes( index, typeof( Taint ), 1032679, 10, 1053098 );
AddRareRecipe( index, 201 );
ForceNonExceptional( index );
SetNeededExpansion( index, Expansion.ML );
*/
index = AddCraft( typeof( SilvanisFeywoodBow ), 1044566, 1072955, 75.0, 125.0, typeof( Log ), 1044041, 20, 1044351 );
AddRes( index, typeof( LardOfParoxysmus ), 1032681, 1, 1053098 );
AddRes( index, typeof( Scourge ), 1032677, 10, 1053098 );
AddRes( index, typeof( Muculent ), 1032680, 10, 1053098 );
AddRareRecipe( index, 202 );
ForceNonExceptional( index );
SetNeededExpansion( index, Expansion.ML );
index = AddCraft(typeof(SilvanisFeywoodBow), 1044566, 1072955, 75.0, 125.0, typeof(Log), 1044041, 20,
1044351);
AddRes(index, typeof(LardOfParoxysmus), 1032681, 1, 1053098);
AddRes(index, typeof(Scourge), 1032677, 10, 1053098);
AddRes(index, typeof(Muculent), 1032680, 10, 1053098);
AddRareRecipe(index, 202);
ForceNonExceptional(index);
SetNeededExpansion(index, Expansion.ML);
/* TODO
index = AddCraft( typeof( MischiefMaker ), 1044566, 1072910, 75.0, 125.0, typeof( Log ), 1044041, 15, 1044351 );
AddRes( index, typeof( DreadHornMane ), 1032682, 1, 1053098 );
AddRes( index, typeof( Corruption ), 1032676, 10, 1053098 );
AddRes( index, typeof( Putrefication ), 1032678, 10, 1053098 );
AddRareRecipe( index, 203 );
ForceNonExceptional( index );
SetNeededExpansion( index, Expansion.ML );
*/
/* TODO
index = AddCraft( typeof( MischiefMaker ), 1044566, 1072910, 75.0, 125.0, typeof( Log ), 1044041, 15, 1044351 );
AddRes( index, typeof( DreadHornMane ), 1032682, 1, 1053098 );
AddRes( index, typeof( Corruption ), 1032676, 10, 1053098 );
AddRes( index, typeof( Putrefication ), 1032678, 10, 1053098 );
AddRareRecipe( index, 203 );
ForceNonExceptional( index );
SetNeededExpansion( index, Expansion.ML );
*/
index = AddCraft( typeof( TheNightReaper ), 1044566, 1072912, 75.0, 125.0, typeof( Log ), 1044041, 10, 1044351 );
AddRes( index, typeof( DreadHornMane ), 1032682, 1, 1053098 );
AddRes( index, typeof( Blight ), 1032675, 10, 1053098 );
AddRes( index, typeof( Scourge ), 1032677, 10, 1053098 );
AddRareRecipe( index, 204 );
ForceNonExceptional( index );
SetNeededExpansion( index, Expansion.ML );
index = AddCraft(typeof(TheNightReaper), 1044566, 1072912, 75.0, 125.0, typeof(Log), 1044041, 10, 1044351);
AddRes(index, typeof(DreadHornMane), 1032682, 1, 1053098);
AddRes(index, typeof(Blight), 1032675, 10, 1053098);
AddRes(index, typeof(Scourge), 1032677, 10, 1053098);
AddRareRecipe(index, 204);
ForceNonExceptional(index);
SetNeededExpansion(index, Expansion.ML);
index = AddCraft( typeof( BarbedLongbow ), 1044566, 1073505, 75.0, 125.0, typeof( Log ), 1044041, 20, 1044351 );
AddRes( index, typeof( FireRuby ), 1026254, 1, 1053098 );
AddRecipe( index, 205 );
SetNeededExpansion( index, Expansion.ML );
index = AddCraft(typeof(BarbedLongbow), 1044566, 1073505, 75.0, 125.0, typeof(Log), 1044041, 20, 1044351);
AddRes(index, typeof(FireRuby), 1026254, 1, 1053098);
AddRecipe(index, 205);
SetNeededExpansion(index, Expansion.ML);
index = AddCraft( typeof( SlayerLongbow ), 1044566, 1073506, 75.0, 125.0, typeof( Log ), 1044041, 20, 1044351 );
AddRes( index, typeof( BrilliantAmber ), 1026256, 1, 1053098 );
AddRecipe( index, 206 );
SetNeededExpansion( index, Expansion.ML );
index = AddCraft(typeof(SlayerLongbow), 1044566, 1073506, 75.0, 125.0, typeof(Log), 1044041, 20, 1044351);
AddRes(index, typeof(BrilliantAmber), 1026256, 1, 1053098);
AddRecipe(index, 206);
SetNeededExpansion(index, Expansion.ML);
index = AddCraft( typeof( FrozenLongbow ), 1044566, 1073507, 75.0, 125.0, typeof( Log ), 1044041, 20, 1044351 );
AddRes( index, typeof( Turquoise ), 1026250, 1, 1053098 );
AddRecipe( index, 207 );
SetNeededExpansion( index, Expansion.ML );
index = AddCraft(typeof(FrozenLongbow), 1044566, 1073507, 75.0, 125.0, typeof(Log), 1044041, 20, 1044351);
AddRes(index, typeof(Turquoise), 1026250, 1, 1053098);
AddRecipe(index, 207);
SetNeededExpansion(index, Expansion.ML);
index = AddCraft( typeof( LongbowOfMight ), 1044566, 1073508, 75.0, 125.0, typeof( Log ), 1044041, 10, 1044351 );
AddRes( index, typeof( BlueDiamond ), 1026255, 1, 1053098 );
AddRecipe( index, 208 );
SetNeededExpansion( index, Expansion.ML );
index = AddCraft(typeof(LongbowOfMight), 1044566, 1073508, 75.0, 125.0, typeof(Log), 1044041, 10, 1044351);
AddRes(index, typeof(BlueDiamond), 1026255, 1, 1053098);
AddRecipe(index, 208);
SetNeededExpansion(index, Expansion.ML);
index = AddCraft( typeof( RangersShortbow ), 1044566, 1073509, 75.0, 125.0, typeof( Log ), 1044041, 15, 1044351 );
AddRes( index, typeof( PerfectEmerald ), 1026251, 1, 1053098 );
AddRecipe( index, 209 );
SetNeededExpansion( index, Expansion.ML );
index = AddCraft(typeof(RangersShortbow), 1044566, 1073509, 75.0, 125.0, typeof(Log), 1044041, 15, 1044351);
AddRes(index, typeof(PerfectEmerald), 1026251, 1, 1053098);
AddRecipe(index, 209);
SetNeededExpansion(index, Expansion.ML);
index = AddCraft( typeof( LightweightShortbow ), 1044566, 1073510, 75.0, 125.0, typeof( Log ), 1044041, 15, 1044351 );
AddRes( index, typeof( WhitePearl ), 1026253, 1, 1053098 );
AddRecipe( index, 210 );
SetNeededExpansion( index, Expansion.ML );
index = AddCraft(typeof(LightweightShortbow), 1044566, 1073510, 75.0, 125.0, typeof(Log), 1044041, 15,
1044351);
AddRes(index, typeof(WhitePearl), 1026253, 1, 1053098);
AddRecipe(index, 210);
SetNeededExpansion(index, Expansion.ML);
index = AddCraft( typeof( MysticalShortbow ), 1044566, 1073511, 75.0, 125.0, typeof( Log ), 1044041, 15, 1044351 );
AddRes( index, typeof( EcruCitrine ), 1026252, 1, 1053098 );
AddRecipe( index, 211 );
SetNeededExpansion( index, Expansion.ML );
index = AddCraft(typeof(MysticalShortbow), 1044566, 1073511, 75.0, 125.0, typeof(Log), 1044041, 15, 1044351);
AddRes(index, typeof(EcruCitrine), 1026252, 1, 1053098);
AddRecipe(index, 211);
SetNeededExpansion(index, Expansion.ML);
index = AddCraft( typeof( AssassinsShortbow ), 1044566, 1073512, 75.0, 125.0, typeof( Log ), 1044041, 15, 1044351 );
AddRes( index, typeof( DarkSapphire ), 1026249, 1, 1053098 );
AddRecipe( index, 212 );
SetNeededExpansion( index, Expansion.ML );
}
index = AddCraft(typeof(AssassinsShortbow), 1044566, 1073512, 75.0, 125.0, typeof(Log), 1044041, 15,
1044351);
AddRes(index, typeof(DarkSapphire), 1026249, 1, 1053098);
AddRecipe(index, 212);
SetNeededExpansion(index, Expansion.ML);
}
MarkOption = true;
Repair = Core.AOS;
}
}
}
MarkOption = true;
Repair = Core.AOS;
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -3,76 +3,77 @@ using Server.Items;
namespace Server.Engines.Craft
{
public class DefCartography : CraftSystem
{
public override SkillName MainSkill => SkillName.Cartography;
public class DefCartography : CraftSystem
{
private static CraftSystem m_CraftSystem;
public override int GumpTitleNumber => 1044008;
private DefCartography() : base(1, 1, 1.25) // base( 1, 1, 3.0 )
{
}
public override double GetChanceAtMin( CraftItem item )
{
return 0.0; // 0%
}
public override SkillName MainSkill => SkillName.Cartography;
private static CraftSystem m_CraftSystem;
public override int GumpTitleNumber => 1044008;
public static CraftSystem CraftSystem
{
get
{
if ( m_CraftSystem == null )
m_CraftSystem = new DefCartography();
public static CraftSystem CraftSystem
{
get
{
if (m_CraftSystem == null)
m_CraftSystem = new DefCartography();
return m_CraftSystem;
}
}
return m_CraftSystem;
}
}
private DefCartography() : base( 1, 1, 1.25 )// base( 1, 1, 3.0 )
{
}
public override double GetChanceAtMin(CraftItem item)
{
return 0.0; // 0%
}
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
{
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
{
if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
return 1044038; // You have worn out your tool!
if (!BaseTool.CheckAccessible(tool, from))
return 1044263; // The tool must be on your person to use.
return 0;
}
return 0;
}
public override void PlayCraftEffect( Mobile from )
{
from.PlaySound( 0x249 );
}
public override void PlayCraftEffect(Mobile from)
{
from.PlaySound(0x249);
}
public override int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item )
{
if ( toolBroken )
from.SendLocalizedMessage( 1044038 ); // You have worn out your tool
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality,
bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
if ( failed )
{
if ( lostMaterial )
return 1044043; // You failed to create the item, and some of your materials are lost.
return 1044157; // You failed to create the item, but no materials were lost.
}
if (failed)
{
if (lostMaterial)
return 1044043; // You failed to create the item, and some of your materials are lost.
return 1044157; // You failed to create the item, but no materials were lost.
}
if ( quality == 0 )
return 502785; // You were barely able to make this item. It's quality is below average.
if ( makersMark && quality == 2 )
return 1044156; // You create an exceptional quality item and affix your maker's mark.
if ( quality == 2 )
return 1044155; // You create an exceptional quality item.
return 1044154; // You create the item.
}
if (quality == 0)
return 502785; // You were barely able to make this item. It's quality is below average.
if (makersMark && quality == 2)
return 1044156; // You create an exceptional quality item and affix your maker's mark.
if (quality == 2)
return 1044155; // You create an exceptional quality item.
return 1044154; // You create the item.
}
public override void InitCraftList()
{
AddCraft( typeof( LocalMap ), 1044448, 1015230, 10.0, 70.0, typeof( BlankMap ), 1044449, 1, 1044450 );
AddCraft( typeof( CityMap ), 1044448, 1015231, 25.0, 85.0, typeof( BlankMap ), 1044449, 1, 1044450 );
AddCraft( typeof( SeaChart ), 1044448, 1015232, 35.0, 95.0, typeof( BlankMap ), 1044449, 1, 1044450 );
AddCraft( typeof( WorldMap ), 1044448, 1015233, 39.5, 99.5, typeof( BlankMap ), 1044449, 1, 1044450 );
}
}
}
public override void InitCraftList()
{
AddCraft(typeof(LocalMap), 1044448, 1015230, 10.0, 70.0, typeof(BlankMap), 1044449, 1, 1044450);
AddCraft(typeof(CityMap), 1044448, 1015231, 25.0, 85.0, typeof(BlankMap), 1044449, 1, 1044450);
AddCraft(typeof(SeaChart), 1044448, 1015232, 35.0, 95.0, typeof(BlankMap), 1044449, 1, 1044450);
AddCraft(typeof(WorldMap), 1044448, 1015233, 39.5, 99.5, typeof(BlankMap), 1044449, 1, 1044450);
}
}
}

View file

@ -3,276 +3,293 @@ using Server.Items;
namespace Server.Engines.Craft
{
public class DefCooking : CraftSystem
{
public override SkillName MainSkill => SkillName.Cooking;
public class DefCooking : CraftSystem
{
private static CraftSystem m_CraftSystem;
public override int GumpTitleNumber => 1044003;
private DefCooking() : base(1, 1, 1.25) // base( 1, 1, 1.5 )
{
}
private static CraftSystem m_CraftSystem;
public override SkillName MainSkill => SkillName.Cooking;
public static CraftSystem CraftSystem
{
get
{
if ( m_CraftSystem == null )
m_CraftSystem = new DefCooking();
public override int GumpTitleNumber => 1044003;
return m_CraftSystem;
}
}
public static CraftSystem CraftSystem
{
get
{
if (m_CraftSystem == null)
m_CraftSystem = new DefCooking();
public override CraftECA ECA => CraftECA.ChanceMinusSixtyToFourtyFive;
return m_CraftSystem;
}
}
public override double GetChanceAtMin( CraftItem item )
{
return 0.0; // 0%
}
public override CraftECA ECA => CraftECA.ChanceMinusSixtyToFourtyFive;
private DefCooking() : base( 1, 1, 1.25 )// base( 1, 1, 1.5 )
{
}
public override double GetChanceAtMin(CraftItem item)
{
return 0.0; // 0%
}
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
{
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
{
if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
return 1044038; // You have worn out your tool!
if (!BaseTool.CheckAccessible(tool, from))
return 1044263; // The tool must be on your person to use.
return 0;
}
return 0;
}
public override void PlayCraftEffect( Mobile from )
{
}
public override void PlayCraftEffect(Mobile from)
{
}
public override int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item )
{
if ( toolBroken )
from.SendLocalizedMessage( 1044038 ); // You have worn out your tool
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality,
bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
if ( failed )
{
if ( lostMaterial )
return 1044043; // You failed to create the item, and some of your materials are lost.
return 1044157; // You failed to create the item, but no materials were lost.
}
if (failed)
{
if (lostMaterial)
return 1044043; // You failed to create the item, and some of your materials are lost.
return 1044157; // You failed to create the item, but no materials were lost.
}
if ( quality == 0 )
return 502785; // You were barely able to make this item. It's quality is below average.
if ( makersMark && quality == 2 )
return 1044156; // You create an exceptional quality item and affix your maker's mark.
if ( quality == 2 )
return 1044155; // You create an exceptional quality item.
return 1044154; // You create the item.
}
if (quality == 0)
return 502785; // You were barely able to make this item. It's quality is below average.
if (makersMark && quality == 2)
return 1044156; // You create an exceptional quality item and affix your maker's mark.
if (quality == 2)
return 1044155; // You create an exceptional quality item.
return 1044154; // You create the item.
}
public override void InitCraftList()
{
int index = -1;
public override void InitCraftList()
{
int index = -1;
/* Begin Ingredients */
index = AddCraft( typeof( SackFlour ), 1044495, 1024153, 0.0, 100.0, typeof( WheatSheaf ), 1044489, 2, 1044490 );
SetNeedMill( index, true );
/* Begin Ingredients */
index = AddCraft(typeof(SackFlour), 1044495, 1024153, 0.0, 100.0, typeof(WheatSheaf), 1044489, 2, 1044490);
SetNeedMill(index, true);
index = AddCraft( typeof( Dough ), 1044495, 1024157, 0.0, 100.0, typeof( SackFlour ), 1044468, 1, 1044253 );
AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
index = AddCraft(typeof(Dough), 1044495, 1024157, 0.0, 100.0, typeof(SackFlour), 1044468, 1, 1044253);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
index = AddCraft( typeof( SweetDough ), 1044495, 1041340, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
AddRes( index, typeof( JarHoney ), 1044472, 1, 1044253 );
index = AddCraft(typeof(SweetDough), 1044495, 1041340, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(JarHoney), 1044472, 1, 1044253);
index = AddCraft( typeof( CakeMix ), 1044495, 1041002, 0.0, 100.0, typeof( SackFlour ), 1044468, 1, 1044253 );
AddRes( index, typeof( SweetDough ), 1044475, 1, 1044253 );
index = AddCraft(typeof(CakeMix), 1044495, 1041002, 0.0, 100.0, typeof(SackFlour), 1044468, 1, 1044253);
AddRes(index, typeof(SweetDough), 1044475, 1, 1044253);
index = AddCraft( typeof( CookieMix ), 1044495, 1024159, 0.0, 100.0, typeof( JarHoney ), 1044472, 1, 1044253 );
AddRes( index, typeof( SweetDough ), 1044475, 1, 1044253 );
index = AddCraft(typeof(CookieMix), 1044495, 1024159, 0.0, 100.0, typeof(JarHoney), 1044472, 1, 1044253);
AddRes(index, typeof(SweetDough), 1044475, 1, 1044253);
if ( Core.ML )
{
index = AddCraft( typeof( CocoaButter ), 1044495, 1079998, 0.0, 100.0, typeof( CocoaPulp ), 1080530, 1, 1044253 );
SetItemHue( index, 0x457 );
SetNeededExpansion( index, Expansion.ML );
SetNeedOven( index, true );
if (Core.ML)
{
index = AddCraft(typeof(CocoaButter), 1044495, 1079998, 0.0, 100.0, typeof(CocoaPulp), 1080530, 1, 1044253);
SetItemHue(index, 0x457);
SetNeededExpansion(index, Expansion.ML);
SetNeedOven(index, true);
index = AddCraft( typeof( CocoaLiquor ), 1044495, 1079999, 0.0, 100.0, typeof( CocoaPulp ), 1080530, 1, 1044253 );
AddRes( index, typeof( EmptyPewterBowl ), 1025629, 1, 1044253 );
SetItemHue( index, 0x46A );
SetNeededExpansion( index, Expansion.ML );
SetNeedOven( index, true );
}
/* End Ingredients */
index = AddCraft(typeof(CocoaLiquor), 1044495, 1079999, 0.0, 100.0, typeof(CocoaPulp), 1080530, 1, 1044253);
AddRes(index, typeof(EmptyPewterBowl), 1025629, 1, 1044253);
SetItemHue(index, 0x46A);
SetNeededExpansion(index, Expansion.ML);
SetNeedOven(index, true);
}
/* End Ingredients */
/* Begin Preparations */
index = AddCraft( typeof( UnbakedQuiche ), 1044496, 1041339, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
AddRes( index, typeof( Eggs ), 1044477, 1, 1044253 );
/* Begin Preparations */
index = AddCraft(typeof(UnbakedQuiche), 1044496, 1041339, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(Eggs), 1044477, 1, 1044253);
// TODO: This must also support chicken and lamb legs
index = AddCraft( typeof( UnbakedMeatPie ), 1044496, 1041338, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
AddRes( index, typeof( RawRibs ), 1044482, 1, 1044253 );
// TODO: This must also support chicken and lamb legs
index = AddCraft(typeof(UnbakedMeatPie), 1044496, 1041338, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(RawRibs), 1044482, 1, 1044253);
index = AddCraft( typeof( UncookedSausagePizza ), 1044496, 1041337, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
AddRes( index, typeof( Sausage ), 1044483, 1, 1044253 );
index = AddCraft(typeof(UncookedSausagePizza), 1044496, 1041337, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(Sausage), 1044483, 1, 1044253);
index = AddCraft( typeof( UncookedCheesePizza ), 1044496, 1041341, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
AddRes( index, typeof( CheeseWheel ), 1044486, 1, 1044253 );
index = AddCraft(typeof(UncookedCheesePizza), 1044496, 1041341, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(CheeseWheel), 1044486, 1, 1044253);
index = AddCraft( typeof( UnbakedFruitPie ), 1044496, 1041334, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
AddRes( index, typeof( Pear ), 1044481, 1, 1044253 );
index = AddCraft(typeof(UnbakedFruitPie), 1044496, 1041334, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(Pear), 1044481, 1, 1044253);
index = AddCraft( typeof( UnbakedPeachCobbler ), 1044496, 1041335, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
AddRes( index, typeof( Peach ), 1044480, 1, 1044253 );
index = AddCraft(typeof(UnbakedPeachCobbler), 1044496, 1041335, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(Peach), 1044480, 1, 1044253);
index = AddCraft( typeof( UnbakedApplePie ), 1044496, 1041336, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
AddRes( index, typeof( Apple ), 1044479, 1, 1044253 );
index = AddCraft(typeof(UnbakedApplePie), 1044496, 1041336, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(Apple), 1044479, 1, 1044253);
index = AddCraft( typeof( UnbakedPumpkinPie ), 1044496, 1041342, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
AddRes( index, typeof( Pumpkin ), 1044484, 1, 1044253 );
index = AddCraft(typeof(UnbakedPumpkinPie), 1044496, 1041342, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
AddRes(index, typeof(Pumpkin), 1044484, 1, 1044253);
if ( Core.SE )
{
index = AddCraft( typeof( GreenTea ), 1044496, 1030315, 80.0, 130.0, typeof( GreenTeaBasket ), 1030316, 1, 1044253 );
AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
SetNeededExpansion( index, Expansion.SE );
SetNeedOven( index, true );
if (Core.SE)
{
index = AddCraft(typeof(GreenTea), 1044496, 1030315, 80.0, 130.0, typeof(GreenTeaBasket), 1030316, 1,
1044253);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
SetNeededExpansion(index, Expansion.SE);
SetNeedOven(index, true);
index = AddCraft( typeof( WasabiClumps ), 1044496, 1029451, 70.0, 120.0, typeof( BaseBeverage ), 1046458, 1, 1044253 );
AddRes( index, typeof( WoodenBowlOfPeas ), 1025633, 3, 1044253 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft(typeof(WasabiClumps), 1044496, 1029451, 70.0, 120.0, typeof(BaseBeverage), 1046458, 1,
1044253);
AddRes(index, typeof(WoodenBowlOfPeas), 1025633, 3, 1044253);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft( typeof( SushiRolls ), 1044496, 1030303, 90.0, 120.0, typeof( BaseBeverage ), 1046458, 1, 1044253 );
AddRes( index, typeof( RawFishSteak ), 1044476, 10, 1044253 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft(typeof(SushiRolls), 1044496, 1030303, 90.0, 120.0, typeof(BaseBeverage), 1046458, 1,
1044253);
AddRes(index, typeof(RawFishSteak), 1044476, 10, 1044253);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft( typeof( SushiPlatter ), 1044496, 1030305, 90.0, 120.0, typeof( BaseBeverage ), 1046458, 1, 1044253 );
AddRes( index, typeof( RawFishSteak ), 1044476, 10, 1044253 );
SetNeededExpansion( index, Expansion.SE );
}
index = AddCraft(typeof(SushiPlatter), 1044496, 1030305, 90.0, 120.0, typeof(BaseBeverage), 1046458, 1,
1044253);
AddRes(index, typeof(RawFishSteak), 1044476, 10, 1044253);
SetNeededExpansion(index, Expansion.SE);
}
index = AddCraft( typeof( TribalPaint ), 1044496, 1040000, Core.ML? 55.0 : 80.0, Core.ML? 105.0 : 80.0, typeof( SackFlour ), 1044468, 1, 1044253 );
AddRes( index, typeof( TribalBerry ), 1046460, 1, 1044253 );
index = AddCraft(typeof(TribalPaint), 1044496, 1040000, Core.ML ? 55.0 : 80.0, Core.ML ? 105.0 : 80.0,
typeof(SackFlour), 1044468, 1, 1044253);
AddRes(index, typeof(TribalBerry), 1046460, 1, 1044253);
if ( Core.SE )
{
index = AddCraft( typeof( EggBomb ), 1044496, 1030249, 90.0, 120.0, typeof( Eggs ), 1044477, 1, 1044253 );
AddRes( index, typeof( SackFlour ), 1044468, 3, 1044253 );
SetNeededExpansion( index, Expansion.SE );
}
/* End Preparations */
if (Core.SE)
{
index = AddCraft(typeof(EggBomb), 1044496, 1030249, 90.0, 120.0, typeof(Eggs), 1044477, 1, 1044253);
AddRes(index, typeof(SackFlour), 1044468, 3, 1044253);
SetNeededExpansion(index, Expansion.SE);
}
/* End Preparations */
/* Begin Baking */
index = AddCraft( typeof( BreadLoaf ), 1044497, 1024156, 0.0, 100.0, typeof( Dough ), 1044469, 1, 1044253 );
SetNeedOven( index, true );
/* Begin Baking */
index = AddCraft(typeof(BreadLoaf), 1044497, 1024156, 0.0, 100.0, typeof(Dough), 1044469, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft( typeof( Cookies ), 1044497, 1025643, 0.0, 100.0, typeof( CookieMix ), 1044474, 1, 1044253 );
SetNeedOven( index, true );
index = AddCraft(typeof(Cookies), 1044497, 1025643, 0.0, 100.0, typeof(CookieMix), 1044474, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft( typeof( Cake ), 1044497, 1022537, 0.0, 100.0, typeof( CakeMix ), 1044471, 1, 1044253 );
SetNeedOven( index, true );
index = AddCraft(typeof(Cake), 1044497, 1022537, 0.0, 100.0, typeof(CakeMix), 1044471, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft( typeof( Muffins ), 1044497, 1022539, 0.0, 100.0, typeof( SweetDough ), 1044475, 1, 1044253 );
SetNeedOven( index, true );
index = AddCraft(typeof(Muffins), 1044497, 1022539, 0.0, 100.0, typeof(SweetDough), 1044475, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft( typeof( Quiche ), 1044497, 1041345, 0.0, 100.0, typeof( UnbakedQuiche ), 1044518, 1, 1044253 );
SetNeedOven( index, true );
index = AddCraft(typeof(Quiche), 1044497, 1041345, 0.0, 100.0, typeof(UnbakedQuiche), 1044518, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft( typeof( MeatPie ), 1044497, 1041347, 0.0, 100.0, typeof( UnbakedMeatPie ), 1044519, 1, 1044253 );
SetNeedOven( index, true );
index = AddCraft(typeof(MeatPie), 1044497, 1041347, 0.0, 100.0, typeof(UnbakedMeatPie), 1044519, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft( typeof( SausagePizza ), 1044497, 1044517, 0.0, 100.0, typeof( UncookedSausagePizza ), 1044520, 1, 1044253 );
SetNeedOven( index, true );
index = AddCraft(typeof(SausagePizza), 1044497, 1044517, 0.0, 100.0, typeof(UncookedSausagePizza), 1044520, 1,
1044253);
SetNeedOven(index, true);
index = AddCraft( typeof( CheesePizza ), 1044497, 1044516, 0.0, 100.0, typeof( UncookedCheesePizza ), 1044521, 1, 1044253 );
SetNeedOven( index, true );
index = AddCraft(typeof(CheesePizza), 1044497, 1044516, 0.0, 100.0, typeof(UncookedCheesePizza), 1044521, 1,
1044253);
SetNeedOven(index, true);
index = AddCraft( typeof( FruitPie ), 1044497, 1041346, 0.0, 100.0, typeof( UnbakedFruitPie ), 1044522, 1, 1044253 );
SetNeedOven( index, true );
index = AddCraft(typeof(FruitPie), 1044497, 1041346, 0.0, 100.0, typeof(UnbakedFruitPie), 1044522, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft( typeof( PeachCobbler ), 1044497, 1041344, 0.0, 100.0, typeof( UnbakedPeachCobbler ), 1044523, 1, 1044253 );
SetNeedOven( index, true );
index = AddCraft(typeof(PeachCobbler), 1044497, 1041344, 0.0, 100.0, typeof(UnbakedPeachCobbler), 1044523, 1,
1044253);
SetNeedOven(index, true);
index = AddCraft( typeof( ApplePie ), 1044497, 1041343, 0.0, 100.0, typeof( UnbakedApplePie ), 1044524, 1, 1044253 );
SetNeedOven( index, true );
index = AddCraft(typeof(ApplePie), 1044497, 1041343, 0.0, 100.0, typeof(UnbakedApplePie), 1044524, 1, 1044253);
SetNeedOven(index, true);
index = AddCraft( typeof( PumpkinPie ), 1044497, 1041348, 0.0, 100.0, typeof( UnbakedPumpkinPie ), 1046461, 1, 1044253 );
SetNeedOven( index, true );
index = AddCraft(typeof(PumpkinPie), 1044497, 1041348, 0.0, 100.0, typeof(UnbakedPumpkinPie), 1046461, 1,
1044253);
SetNeedOven(index, true);
if ( Core.SE )
{
index = AddCraft( typeof( MisoSoup ), 1044497, 1030317, 60.0, 110.0, typeof( RawFishSteak ), 1044476, 1, 1044253 );
AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
SetNeededExpansion( index, Expansion.SE );
SetNeedOven( index, true );
if (Core.SE)
{
index = AddCraft(typeof(MisoSoup), 1044497, 1030317, 60.0, 110.0, typeof(RawFishSteak), 1044476, 1, 1044253);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
SetNeededExpansion(index, Expansion.SE);
SetNeedOven(index, true);
index = AddCraft( typeof( WhiteMisoSoup ), 1044497, 1030318, 60.0, 110.0, typeof( RawFishSteak ), 1044476, 1, 1044253 );
AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
SetNeededExpansion( index, Expansion.SE );
SetNeedOven( index, true );
index = AddCraft(typeof(WhiteMisoSoup), 1044497, 1030318, 60.0, 110.0, typeof(RawFishSteak), 1044476, 1,
1044253);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
SetNeededExpansion(index, Expansion.SE);
SetNeedOven(index, true);
index = AddCraft( typeof( RedMisoSoup ), 1044497, 1030319, 60.0, 110.0, typeof( RawFishSteak ), 1044476, 1, 1044253 );
AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
SetNeededExpansion( index, Expansion.SE );
SetNeedOven( index, true );
index = AddCraft(typeof(RedMisoSoup), 1044497, 1030319, 60.0, 110.0, typeof(RawFishSteak), 1044476, 1,
1044253);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
SetNeededExpansion(index, Expansion.SE);
SetNeedOven(index, true);
index = AddCraft( typeof( AwaseMisoSoup ), 1044497, 1030320, 60.0, 110.0, typeof( RawFishSteak ), 1044476, 1, 1044253 );
AddRes( index, typeof( BaseBeverage ), 1046458, 1, 1044253 );
SetNeededExpansion( index, Expansion.SE );
SetNeedOven( index, true );
}
/* End Baking */
index = AddCraft(typeof(AwaseMisoSoup), 1044497, 1030320, 60.0, 110.0, typeof(RawFishSteak), 1044476, 1,
1044253);
AddRes(index, typeof(BaseBeverage), 1046458, 1, 1044253);
SetNeededExpansion(index, Expansion.SE);
SetNeedOven(index, true);
}
/* End Baking */
/* Begin Barbecue */
index = AddCraft( typeof( CookedBird ), 1044498, 1022487, 0.0, 100.0, typeof( RawBird ), 1044470, 1, 1044253 );
SetNeedHeat( index, true );
SetUseAllRes( index, true );
/* Begin Barbecue */
index = AddCraft(typeof(CookedBird), 1044498, 1022487, 0.0, 100.0, typeof(RawBird), 1044470, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
index = AddCraft( typeof( ChickenLeg ), 1044498, 1025640, 0.0, 100.0, typeof( RawChickenLeg ), 1044473, 1, 1044253 );
SetNeedHeat( index, true );
SetUseAllRes( index, true );
index = AddCraft(typeof(ChickenLeg), 1044498, 1025640, 0.0, 100.0, typeof(RawChickenLeg), 1044473, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
index = AddCraft( typeof( FishSteak ), 1044498, 1022427, 0.0, 100.0, typeof( RawFishSteak ), 1044476, 1, 1044253 );
SetNeedHeat( index, true );
SetUseAllRes( index, true );
index = AddCraft(typeof(FishSteak), 1044498, 1022427, 0.0, 100.0, typeof(RawFishSteak), 1044476, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
index = AddCraft( typeof( FriedEggs ), 1044498, 1022486, 0.0, 100.0, typeof( Eggs ), 1044477, 1, 1044253 );
SetNeedHeat( index, true );
SetUseAllRes( index, true );
index = AddCraft(typeof(FriedEggs), 1044498, 1022486, 0.0, 100.0, typeof(Eggs), 1044477, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
index = AddCraft( typeof( LambLeg ), 1044498, 1025642, 0.0, 100.0, typeof( RawLambLeg ), 1044478, 1, 1044253 );
SetNeedHeat( index, true );
SetUseAllRes( index, true );
index = AddCraft(typeof(LambLeg), 1044498, 1025642, 0.0, 100.0, typeof(RawLambLeg), 1044478, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
index = AddCraft( typeof( Ribs ), 1044498, 1022546, 0.0, 100.0, typeof( RawRibs ), 1044485, 1, 1044253 );
SetNeedHeat( index, true );
SetUseAllRes( index, true );
/* End Barbecue */
index = AddCraft(typeof(Ribs), 1044498, 1022546, 0.0, 100.0, typeof(RawRibs), 1044485, 1, 1044253);
SetNeedHeat(index, true);
SetUseAllRes(index, true);
/* End Barbecue */
/* Begin Chocolatiering */
if ( Core.ML )
{
index = AddCraft( typeof( DarkChocolate ), 1080001, 1079994, 15.0, 100.0, typeof( SackOfSugar ), 1079997, 1, 1044253 );
AddRes( index, typeof( CocoaButter ), 1079998, 1, 1044253 );
AddRes( index, typeof( CocoaLiquor ), 1079999, 1, 1044253 );
SetItemHue( index, 0x465 );
SetNeededExpansion( index, Expansion.ML );
/* Begin Chocolatiering */
if (Core.ML)
{
index = AddCraft(typeof(DarkChocolate), 1080001, 1079994, 15.0, 100.0, typeof(SackOfSugar), 1079997, 1,
1044253);
AddRes(index, typeof(CocoaButter), 1079998, 1, 1044253);
AddRes(index, typeof(CocoaLiquor), 1079999, 1, 1044253);
SetItemHue(index, 0x465);
SetNeededExpansion(index, Expansion.ML);
index = AddCraft( typeof( MilkChocolate ), 1080001, 1079995, 32.5, 107.5, typeof( SackOfSugar ), 1079997, 1, 1044253 );
AddRes( index, typeof( CocoaButter ), 1079998, 1, 1044253 );
AddRes( index, typeof( CocoaLiquor ), 1079999, 1, 1044253 );
AddRes( index, typeof( BaseBeverage ), 1022544, 1, 1044253 );
SetBeverageType( index, BeverageType.Milk );
SetItemHue( index, 0x461 );
SetNeededExpansion( index, Expansion.ML );
index = AddCraft(typeof(MilkChocolate), 1080001, 1079995, 32.5, 107.5, typeof(SackOfSugar), 1079997, 1,
1044253);
AddRes(index, typeof(CocoaButter), 1079998, 1, 1044253);
AddRes(index, typeof(CocoaLiquor), 1079999, 1, 1044253);
AddRes(index, typeof(BaseBeverage), 1022544, 1, 1044253);
SetBeverageType(index, BeverageType.Milk);
SetItemHue(index, 0x461);
SetNeededExpansion(index, Expansion.ML);
index = AddCraft( typeof( WhiteChocolate ), 1080001, 1079996, 52.5, 127.5, typeof( SackOfSugar ), 1079997, 1, 1044253 );
AddRes( index, typeof( CocoaButter ), 1079998, 1, 1044253 );
AddRes( index, typeof( Vanilla ), 1080000, 1, 1044253 );
AddRes( index, typeof( BaseBeverage ), 1022544, 1, 1044253 );
SetBeverageType( index, BeverageType.Milk );
SetItemHue( index, 0x47E );
SetNeededExpansion( index, Expansion.ML );
}
/* End Chocolatiering */
}
}
}
index = AddCraft(typeof(WhiteChocolate), 1080001, 1079996, 52.5, 127.5, typeof(SackOfSugar), 1079997, 1,
1044253);
AddRes(index, typeof(CocoaButter), 1079998, 1, 1044253);
AddRes(index, typeof(Vanilla), 1080000, 1, 1044253);
AddRes(index, typeof(BaseBeverage), 1022544, 1, 1044253);
SetBeverageType(index, BeverageType.Milk);
SetItemHue(index, 0x47E);
SetNeededExpansion(index, Expansion.ML);
}
/* End Chocolatiering */
}
}
}

View file

@ -4,129 +4,130 @@ using Server.Mobiles;
namespace Server.Engines.Craft
{
public class DefGlassblowing : CraftSystem
{
public override SkillName MainSkill => SkillName.Alchemy;
public class DefGlassblowing : CraftSystem
{
private static CraftSystem m_CraftSystem;
public override int GumpTitleNumber => 1044622;
private DefGlassblowing() : base(1, 1, 1.25) // base( 1, 2, 1.7 )
{
}
private static CraftSystem m_CraftSystem;
public override SkillName MainSkill => SkillName.Alchemy;
public static CraftSystem CraftSystem
{
get
{
if ( m_CraftSystem == null )
m_CraftSystem = new DefGlassblowing();
public override int GumpTitleNumber => 1044622;
return m_CraftSystem;
}
}
public static CraftSystem CraftSystem
{
get
{
if (m_CraftSystem == null)
m_CraftSystem = new DefGlassblowing();
public override double GetChanceAtMin( CraftItem item )
{
if ( item.ItemType == typeof( HollowPrism ) )
return 0.5; // 50%
return m_CraftSystem;
}
}
return 0.0; // 0%
}
public override double GetChanceAtMin(CraftItem item)
{
if (item.ItemType == typeof(HollowPrism))
return 0.5; // 50%
private DefGlassblowing() : base( 1, 1, 1.25 )// base( 1, 2, 1.7 )
{
}
return 0.0; // 0%
}
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
{
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
if ( !BaseTool.CheckTool( tool, from ) )
return 1048146; // If you have a tool equipped, you must use that tool.
if ( !(from is PlayerMobile mobile && mobile.Glassblowing && mobile.Skills[SkillName.Alchemy].Base >= 100.0) )
return 1044634; // You havent learned glassblowing.
if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
{
if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
return 1044038; // You have worn out your tool!
if (!BaseTool.CheckTool(tool, from))
return 1048146; // If you have a tool equipped, you must use that tool.
if (!(from is PlayerMobile mobile && mobile.Glassblowing && mobile.Skills[SkillName.Alchemy].Base >= 100.0))
return 1044634; // You havent learned glassblowing.
if (!BaseTool.CheckAccessible(tool, from))
return 1044263; // The tool must be on your person to use.
bool anvil, forge;
bool anvil, forge;
DefBlacksmithy.CheckAnvilAndForge( from, 2, out anvil, out forge );
DefBlacksmithy.CheckAnvilAndForge(from, 2, out anvil, out forge);
if ( forge )
return 0;
if (forge)
return 0;
return 1044628; // You must be near a forge to blow glass.
}
return 1044628; // You must be near a forge to blow glass.
}
public override void PlayCraftEffect( Mobile from )
{
from.PlaySound( 0x2B ); // bellows
public override void PlayCraftEffect(Mobile from)
{
from.PlaySound(0x2B); // bellows
//if ( from.Body.Type == BodyType.Human && !from.Mounted )
// from.Animate( 9, 5, 1, true, false, 0 );
//if ( from.Body.Type == BodyType.Human && !from.Mounted )
// from.Animate( 9, 5, 1, true, false, 0 );
//new InternalTimer( from ).Start();
}
//new InternalTimer( from ).Start();
}
// Delay to synchronize the sound with the hit on the anvil
private class InternalTimer : Timer
{
private Mobile m_From;
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality,
bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
public InternalTimer( Mobile from ) : base( TimeSpan.FromSeconds( 0.7 ) )
{
m_From = from;
}
if (failed)
{
if (lostMaterial)
return 1044043; // You failed to create the item, and some of your materials are lost.
return 1044157; // You failed to create the item, but no materials were lost.
}
protected override void OnTick()
{
m_From.PlaySound( 0x2A );
}
}
from.PlaySound(0x41); // glass breaking
public override int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item )
{
if ( toolBroken )
from.SendLocalizedMessage( 1044038 ); // You have worn out your tool
if (quality == 0)
return 502785; // You were barely able to make this item. It's quality is below average.
if (makersMark && quality == 2)
return 1044156; // You create an exceptional quality item and affix your maker's mark.
if (quality == 2)
return 1044155; // You create an exceptional quality item.
return 1044154; // You create the item.
}
if ( failed )
{
if ( lostMaterial )
return 1044043; // You failed to create the item, and some of your materials are lost.
return 1044157; // You failed to create the item, but no materials were lost.
}
public override void InitCraftList()
{
int index = AddCraft(typeof(Bottle), 1044050, 1023854, 52.5, 102.5, typeof(Sand), 1044625, 1, 1044627);
SetUseAllRes(index, true);
from.PlaySound( 0x41 ); // glass breaking
AddCraft(typeof(SmallFlask), 1044050, 1044610, 52.5, 102.5, typeof(Sand), 1044625, 2, 1044627);
AddCraft(typeof(MediumFlask), 1044050, 1044611, 52.5, 102.5, typeof(Sand), 1044625, 3, 1044627);
AddCraft(typeof(CurvedFlask), 1044050, 1044612, 55.0, 105.0, typeof(Sand), 1044625, 2, 1044627);
AddCraft(typeof(LongFlask), 1044050, 1044613, 57.5, 107.5, typeof(Sand), 1044625, 4, 1044627);
AddCraft(typeof(LargeFlask), 1044050, 1044623, 60.0, 110.0, typeof(Sand), 1044625, 5, 1044627);
AddCraft(typeof(AniSmallBlueFlask), 1044050, 1044614, 60.0, 110.0, typeof(Sand), 1044625, 5, 1044627);
AddCraft(typeof(AniLargeVioletFlask), 1044050, 1044615, 60.0, 110.0, typeof(Sand), 1044625, 5, 1044627);
AddCraft(typeof(AniRedRibbedFlask), 1044050, 1044624, 60.0, 110.0, typeof(Sand), 1044625, 7, 1044627);
AddCraft(typeof(EmptyVialsWRack), 1044050, 1044616, 65.0, 115.0, typeof(Sand), 1044625, 8, 1044627);
AddCraft(typeof(FullVialsWRack), 1044050, 1044617, 65.0, 115.0, typeof(Sand), 1044625, 9, 1044627);
AddCraft(typeof(SpinningHourglass), 1044050, 1044618, 75.0, 125.0, typeof(Sand), 1044625, 10, 1044627);
if ( quality == 0 )
return 502785; // You were barely able to make this item. It's quality is below average.
if ( makersMark && quality == 2 )
return 1044156; // You create an exceptional quality item and affix your maker's mark.
if ( quality == 2 )
return 1044155; // You create an exceptional quality item.
return 1044154; // You create the item.
}
if (Core.ML)
{
index = AddCraft(typeof(HollowPrism), 1044050, 1072895, 100.0, 150.0, typeof(Sand), 1044625, 8, 1044627);
SetNeededExpansion(index, Expansion.ML);
}
}
public override void InitCraftList()
{
int index = AddCraft( typeof( Bottle ), 1044050, 1023854, 52.5, 102.5, typeof( Sand ), 1044625, 1, 1044627 );
SetUseAllRes( index, true );
// Delay to synchronize the sound with the hit on the anvil
private class InternalTimer : Timer
{
private Mobile m_From;
AddCraft( typeof( SmallFlask ), 1044050, 1044610, 52.5, 102.5, typeof( Sand ), 1044625, 2, 1044627 );
AddCraft( typeof( MediumFlask ), 1044050, 1044611, 52.5, 102.5, typeof( Sand ), 1044625, 3, 1044627 );
AddCraft( typeof( CurvedFlask ), 1044050, 1044612, 55.0, 105.0, typeof( Sand ), 1044625, 2, 1044627 );
AddCraft( typeof( LongFlask ), 1044050, 1044613, 57.5, 107.5, typeof( Sand ), 1044625, 4, 1044627 );
AddCraft( typeof( LargeFlask ), 1044050, 1044623, 60.0, 110.0, typeof( Sand ), 1044625, 5, 1044627 );
AddCraft( typeof( AniSmallBlueFlask ), 1044050, 1044614, 60.0, 110.0, typeof( Sand ), 1044625, 5, 1044627 );
AddCraft( typeof( AniLargeVioletFlask ), 1044050, 1044615, 60.0, 110.0, typeof( Sand ), 1044625, 5, 1044627 );
AddCraft( typeof( AniRedRibbedFlask ), 1044050, 1044624, 60.0, 110.0, typeof( Sand ), 1044625, 7, 1044627 );
AddCraft( typeof( EmptyVialsWRack ), 1044050, 1044616, 65.0, 115.0, typeof( Sand ), 1044625, 8, 1044627 );
AddCraft( typeof( FullVialsWRack ), 1044050, 1044617, 65.0, 115.0, typeof( Sand ), 1044625, 9, 1044627 );
AddCraft( typeof( SpinningHourglass ), 1044050, 1044618, 75.0, 125.0, typeof( Sand ), 1044625, 10, 1044627 );
public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(0.7))
{
m_From = from;
}
if ( Core.ML )
{
index = AddCraft( typeof( HollowPrism ), 1044050, 1072895, 100.0, 150.0, typeof( Sand ), 1044625, 8, 1044627 );
SetNeededExpansion( index, Expansion.ML );
}
}
}
}
protected override void OnTick()
{
m_From.PlaySound(0x2A);
}
}
}
}

View file

@ -1,393 +1,412 @@
using System;
using Server.Engines.BulkOrders;
using Server.Items;
using Server.Spells;
namespace Server.Engines.Craft
{
public class DefInscription : CraftSystem
{
public override SkillName MainSkill => SkillName.Inscribe;
public class DefInscription : CraftSystem
{
private static CraftSystem m_CraftSystem;
public override int GumpTitleNumber => 1044009;
private static Type typeofSpellScroll = typeof(SpellScroll);
private static CraftSystem m_CraftSystem;
private int m_Circle, m_Mana;
public static CraftSystem CraftSystem
{
get
{
if ( m_CraftSystem == null )
m_CraftSystem = new DefInscription();
private int m_Index;
return m_CraftSystem;
}
}
private Type[] m_RegTypes =
{
typeof(BlackPearl),
typeof(Bloodmoss),
typeof(Garlic),
typeof(Ginseng),
typeof(MandrakeRoot),
typeof(Nightshade),
typeof(SulfurousAsh),
typeof(SpidersSilk)
};
public override double GetChanceAtMin( CraftItem item )
{
return 0.0; // 0%
}
private DefInscription()
: base(1, 1, 1.25) // base( 1, 1, 3.0 )
{
}
private DefInscription()
: base( 1, 1, 1.25 ) // base( 1, 1, 3.0 )
{
}
public override SkillName MainSkill => SkillName.Inscribe;
public override int CanCraft( Mobile from, BaseTool tool, Type typeItem )
{
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
public override int GumpTitleNumber => 1044009;
if ( typeItem != null )
{
var o = Activator.CreateInstance( typeItem );
public static CraftSystem CraftSystem
{
get
{
if (m_CraftSystem == null)
m_CraftSystem = new DefInscription();
if ( o is SpellScroll scroll )
{
var book = Spellbook.Find( from, scroll.SpellID );
return m_CraftSystem;
}
}
var hasSpell = ( book != null && book.HasSpell( scroll.SpellID ) );
public override double GetChanceAtMin(CraftItem item)
{
return 0.0; // 0%
}
scroll.Delete();
public override int CanCraft(Mobile from, BaseTool tool, Type typeItem)
{
if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
return 1044038; // You have worn out your tool!
if (!BaseTool.CheckAccessible(tool, from))
return 1044263; // The tool must be on your person to use.
return ( hasSpell ? 0 : 1042404 ); // null : You don't have that spell!
}
if (typeItem != null)
{
object o = Activator.CreateInstance(typeItem);
if ( o is Item item )
{
item.Delete();
}
}
if (o is SpellScroll scroll)
{
Spellbook book = Spellbook.Find(from, scroll.SpellID);
return 0;
}
bool hasSpell = book != null && book.HasSpell(scroll.SpellID);
public override void PlayCraftEffect( Mobile from )
{
from.PlaySound( 0x249 );
}
scroll.Delete();
private static Type typeofSpellScroll = typeof( SpellScroll );
return hasSpell ? 0 : 1042404; // null : You don't have that spell!
}
public override int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item )
{
if ( toolBroken )
from.SendLocalizedMessage( 1044038 ); // You have worn out your tool
if (o is Item item) item.Delete();
}
if ( !typeofSpellScroll.IsAssignableFrom( item.ItemType ) ) // not a scroll
{
if ( failed )
{
if ( lostMaterial )
return 1044043; // You failed to create the item, and some of your materials are lost.
return 1044157; // You failed to create the item, but no materials were lost.
}
return 0;
}
if ( quality == 0 )
return 502785; // You were barely able to make this item. It's quality is below average.
if ( makersMark && quality == 2 )
return 1044156; // You create an exceptional quality item and affix your maker's mark.
if ( quality == 2 )
return 1044155; // You create an exceptional quality item.
return 1044154; // You create the item.
}
public override void PlayCraftEffect(Mobile from)
{
from.PlaySound(0x249);
}
if ( failed )
return 501630; // You fail to inscribe the scroll, and the scroll is ruined.
return 501629; // You inscribe the spell and put the scroll in your backpack.
}
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality,
bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
private int m_Circle, m_Mana;
if (!typeofSpellScroll.IsAssignableFrom(item.ItemType)) // not a scroll
{
if (failed)
{
if (lostMaterial)
return 1044043; // You failed to create the item, and some of your materials are lost.
return 1044157; // You failed to create the item, but no materials were lost.
}
private enum Reg
{
BlackPearl,
Bloodmoss,
Garlic,
Ginseng,
MandrakeRoot,
Nightshade,
SulfurousAsh,
SpidersSilk
}
if (quality == 0)
return 502785; // You were barely able to make this item. It's quality is below average.
if (makersMark && quality == 2)
return 1044156; // You create an exceptional quality item and affix your maker's mark.
if (quality == 2)
return 1044155; // You create an exceptional quality item.
return 1044154; // You create the item.
}
private Type[] m_RegTypes = {
typeof( BlackPearl ),
typeof( Bloodmoss ),
typeof( Garlic ),
typeof( Ginseng ),
typeof( MandrakeRoot ),
typeof( Nightshade ),
typeof( SulfurousAsh ),
typeof( SpidersSilk )
};
if (failed)
return 501630; // You fail to inscribe the scroll, and the scroll is ruined.
return 501629; // You inscribe the spell and put the scroll in your backpack.
}
private int m_Index;
private void AddSpell(Type type, params Reg[] regs)
{
double minSkill, maxSkill;
private void AddSpell( Type type, params Reg[] regs )
{
double minSkill, maxSkill;
switch (m_Circle)
{
default:
case 0:
minSkill = -25.0;
maxSkill = 25.0;
break;
case 1:
minSkill = -10.8;
maxSkill = 39.2;
break;
case 2:
minSkill = 03.5;
maxSkill = 53.5;
break;
case 3:
minSkill = 17.8;
maxSkill = 67.8;
break;
case 4:
minSkill = 32.1;
maxSkill = 82.1;
break;
case 5:
minSkill = 46.4;
maxSkill = 96.4;
break;
case 6:
minSkill = 60.7;
maxSkill = 110.7;
break;
case 7:
minSkill = 75.0;
maxSkill = 125.0;
break;
}
switch ( m_Circle )
{
default:
case 0:
minSkill = -25.0;
maxSkill = 25.0;
break;
case 1:
minSkill = -10.8;
maxSkill = 39.2;
break;
case 2:
minSkill = 03.5;
maxSkill = 53.5;
break;
case 3:
minSkill = 17.8;
maxSkill = 67.8;
break;
case 4:
minSkill = 32.1;
maxSkill = 82.1;
break;
case 5:
minSkill = 46.4;
maxSkill = 96.4;
break;
case 6:
minSkill = 60.7;
maxSkill = 110.7;
break;
case 7:
minSkill = 75.0;
maxSkill = 125.0;
break;
}
int index = AddCraft(type, 1044369 + m_Circle, 1044381 + m_Index++, minSkill, maxSkill, m_RegTypes[(int)regs[0]],
1044353 + (int)regs[0], 1, 1044361 + (int)regs[0]);
int index = AddCraft( type, 1044369 + m_Circle, 1044381 + m_Index++, minSkill, maxSkill, m_RegTypes[(int) regs[0]], 1044353 + (int) regs[0], 1, 1044361 + (int) regs[0] );
for (int i = 1; i < regs.Length; ++i)
AddRes(index, m_RegTypes[(int)regs[i]], 1044353 + (int)regs[i], 1, 1044361 + (int)regs[i]);
for ( int i = 1; i < regs.Length; ++i )
AddRes( index, m_RegTypes[(int) regs[i]], 1044353 + (int) regs[i], 1, 1044361 + (int) regs[i] );
AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378);
AddRes( index, typeof( BlankScroll ), 1044377, 1, 1044378 );
SetManaReq(index, m_Mana);
}
SetManaReq( index, m_Mana );
}
private void AddNecroSpell(int spell, int mana, double minSkill, Type type, params Type[] regs)
{
int index = AddCraft(type, 1061677, 1060509 + spell, minSkill, minSkill + 1.0, regs[0],
CraftItem.LabelNumber(regs[0]), 1,
501627); //Yes, on OSI it's only 1.0 skill diff'. Don't blame me, blame OSI.
private void AddNecroSpell( int spell, int mana, double minSkill, Type type, params Type[] regs )
{
int index = AddCraft( type, 1061677, 1060509 + spell, minSkill, minSkill + 1.0, regs[0], CraftItem.LabelNumber( regs[0] ), 1, 501627 ); //Yes, on OSI it's only 1.0 skill diff'. Don't blame me, blame OSI.
for (int i = 1; i < regs.Length; ++i)
AddRes(index, regs[i], CraftItem.LabelNumber(regs[0]), 1, 501627);
for ( int i = 1; i < regs.Length; ++i )
AddRes( index, regs[i], CraftItem.LabelNumber( regs[0] ), 1, 501627 );
AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378);
SetManaReq(index, mana);
}
AddRes( index, typeof( BlankScroll ), 1044377, 1, 1044378 );
SetManaReq( index, mana );
}
private void AddMysticismSpell(int spell, int mana, double minSkill, double maxSkill, Type type, params Type[] regs)
{
int index = AddCraft(type, 1111671, 1031678 + spell, minSkill, maxSkill, regs[0], CraftItem.LabelNumber(regs[0]),
1, 501627);
private void AddMysticismSpell( int spell, int mana, double minSkill, double maxSkill, Type type, params Type[] regs )
{
int index = AddCraft( type, 1111671, 1031678 + spell, minSkill, maxSkill, regs[0], CraftItem.LabelNumber( regs[0] ), 1, 501627 );
for (int i = 1; i < regs.Length; ++i)
AddRes(index, regs[i], CraftItem.LabelNumber(regs[i]), 1, 501627);
for ( int i = 1; i < regs.Length; ++i )
AddRes( index, regs[i], CraftItem.LabelNumber( regs[i] ), 1, 501627 );
AddRes(index, typeof(BlankScroll), 1044377, 1, 1044378);
SetManaReq(index, mana);
}
AddRes( index, typeof( BlankScroll ), 1044377, 1, 1044378 );
SetManaReq( index, mana) ;
}
public override void InitCraftList()
{
m_Circle = 0;
m_Mana = 4;
public override void InitCraftList()
{
m_Circle = 0;
m_Mana = 4;
AddSpell(typeof(ReactiveArmorScroll), Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh);
AddSpell(typeof(ClumsyScroll), Reg.Bloodmoss, Reg.Nightshade);
AddSpell(typeof(CreateFoodScroll), Reg.Garlic, Reg.Ginseng, Reg.MandrakeRoot);
AddSpell(typeof(FeeblemindScroll), Reg.Nightshade, Reg.Ginseng);
AddSpell(typeof(HealScroll), Reg.Garlic, Reg.Ginseng, Reg.SpidersSilk);
AddSpell(typeof(MagicArrowScroll), Reg.SulfurousAsh);
AddSpell(typeof(NightSightScroll), Reg.SpidersSilk, Reg.SulfurousAsh);
AddSpell(typeof(WeakenScroll), Reg.Garlic, Reg.Nightshade);
AddSpell( typeof( ReactiveArmorScroll ), Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh );
AddSpell( typeof( ClumsyScroll ), Reg.Bloodmoss, Reg.Nightshade );
AddSpell( typeof( CreateFoodScroll ), Reg.Garlic, Reg.Ginseng, Reg.MandrakeRoot );
AddSpell( typeof( FeeblemindScroll ), Reg.Nightshade, Reg.Ginseng );
AddSpell( typeof( HealScroll ), Reg.Garlic, Reg.Ginseng, Reg.SpidersSilk );
AddSpell( typeof( MagicArrowScroll ), Reg.SulfurousAsh );
AddSpell( typeof( NightSightScroll ), Reg.SpidersSilk, Reg.SulfurousAsh );
AddSpell( typeof( WeakenScroll ), Reg.Garlic, Reg.Nightshade );
m_Circle = 1;
m_Mana = 6;
m_Circle = 1;
m_Mana = 6;
AddSpell(typeof(AgilityScroll), Reg.Bloodmoss, Reg.MandrakeRoot);
AddSpell(typeof(CunningScroll), Reg.Nightshade, Reg.MandrakeRoot);
AddSpell(typeof(CureScroll), Reg.Garlic, Reg.Ginseng);
AddSpell(typeof(HarmScroll), Reg.Nightshade, Reg.SpidersSilk);
AddSpell(typeof(MagicTrapScroll), Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh);
AddSpell(typeof(MagicUnTrapScroll), Reg.Bloodmoss, Reg.SulfurousAsh);
AddSpell(typeof(ProtectionScroll), Reg.Garlic, Reg.Ginseng, Reg.SulfurousAsh);
AddSpell(typeof(StrengthScroll), Reg.Nightshade, Reg.MandrakeRoot);
AddSpell( typeof( AgilityScroll ), Reg.Bloodmoss, Reg.MandrakeRoot );
AddSpell( typeof( CunningScroll ), Reg.Nightshade, Reg.MandrakeRoot );
AddSpell( typeof( CureScroll ), Reg.Garlic, Reg.Ginseng );
AddSpell( typeof( HarmScroll ), Reg.Nightshade, Reg.SpidersSilk );
AddSpell( typeof( MagicTrapScroll ), Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh );
AddSpell( typeof( MagicUnTrapScroll ), Reg.Bloodmoss, Reg.SulfurousAsh );
AddSpell( typeof( ProtectionScroll ), Reg.Garlic, Reg.Ginseng, Reg.SulfurousAsh );
AddSpell( typeof( StrengthScroll ), Reg.Nightshade, Reg.MandrakeRoot );
m_Circle = 2;
m_Mana = 9;
m_Circle = 2;
m_Mana = 9;
AddSpell(typeof(BlessScroll), Reg.Garlic, Reg.MandrakeRoot);
AddSpell(typeof(FireballScroll), Reg.BlackPearl);
AddSpell(typeof(MagicLockScroll), Reg.Bloodmoss, Reg.Garlic, Reg.SulfurousAsh);
AddSpell(typeof(PoisonScroll), Reg.Nightshade);
AddSpell(typeof(TelekinisisScroll), Reg.Bloodmoss, Reg.MandrakeRoot);
AddSpell(typeof(TeleportScroll), Reg.Bloodmoss, Reg.MandrakeRoot);
AddSpell(typeof(UnlockScroll), Reg.Bloodmoss, Reg.SulfurousAsh);
AddSpell(typeof(WallOfStoneScroll), Reg.Bloodmoss, Reg.Garlic);
AddSpell( typeof( BlessScroll ), Reg.Garlic, Reg.MandrakeRoot );
AddSpell( typeof( FireballScroll ), Reg.BlackPearl );
AddSpell( typeof( MagicLockScroll ), Reg.Bloodmoss, Reg.Garlic, Reg.SulfurousAsh );
AddSpell( typeof( PoisonScroll ), Reg.Nightshade );
AddSpell( typeof( TelekinisisScroll ), Reg.Bloodmoss, Reg.MandrakeRoot );
AddSpell( typeof( TeleportScroll ), Reg.Bloodmoss, Reg.MandrakeRoot );
AddSpell( typeof( UnlockScroll ), Reg.Bloodmoss, Reg.SulfurousAsh );
AddSpell( typeof( WallOfStoneScroll ), Reg.Bloodmoss, Reg.Garlic );
m_Circle = 3;
m_Mana = 11;
m_Circle = 3;
m_Mana = 11;
AddSpell(typeof(ArchCureScroll), Reg.Garlic, Reg.Ginseng, Reg.MandrakeRoot);
AddSpell(typeof(ArchProtectionScroll), Reg.Garlic, Reg.Ginseng, Reg.MandrakeRoot, Reg.SulfurousAsh);
AddSpell(typeof(CurseScroll), Reg.Garlic, Reg.Nightshade, Reg.SulfurousAsh);
AddSpell(typeof(FireFieldScroll), Reg.BlackPearl, Reg.SpidersSilk, Reg.SulfurousAsh);
AddSpell(typeof(GreaterHealScroll), Reg.Garlic, Reg.SpidersSilk, Reg.MandrakeRoot, Reg.Ginseng);
AddSpell(typeof(LightningScroll), Reg.MandrakeRoot, Reg.SulfurousAsh);
AddSpell(typeof(ManaDrainScroll), Reg.BlackPearl, Reg.SpidersSilk, Reg.MandrakeRoot);
AddSpell(typeof(RecallScroll), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot);
AddSpell( typeof( ArchCureScroll ), Reg.Garlic, Reg.Ginseng, Reg.MandrakeRoot );
AddSpell( typeof( ArchProtectionScroll ), Reg.Garlic, Reg.Ginseng, Reg.MandrakeRoot, Reg.SulfurousAsh );
AddSpell( typeof( CurseScroll ), Reg.Garlic, Reg.Nightshade, Reg.SulfurousAsh );
AddSpell( typeof( FireFieldScroll ), Reg.BlackPearl, Reg.SpidersSilk, Reg.SulfurousAsh );
AddSpell( typeof( GreaterHealScroll ), Reg.Garlic, Reg.SpidersSilk, Reg.MandrakeRoot, Reg.Ginseng );
AddSpell( typeof( LightningScroll ), Reg.MandrakeRoot, Reg.SulfurousAsh );
AddSpell( typeof( ManaDrainScroll ), Reg.BlackPearl, Reg.SpidersSilk, Reg.MandrakeRoot );
AddSpell( typeof( RecallScroll ), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot );
m_Circle = 4;
m_Mana = 14;
m_Circle = 4;
m_Mana = 14;
AddSpell(typeof(BladeSpiritsScroll), Reg.BlackPearl, Reg.Nightshade, Reg.MandrakeRoot);
AddSpell(typeof(DispelFieldScroll), Reg.BlackPearl, Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh);
AddSpell(typeof(IncognitoScroll), Reg.Bloodmoss, Reg.Garlic, Reg.Nightshade);
AddSpell(typeof(MagicReflectScroll), Reg.Garlic, Reg.MandrakeRoot, Reg.SpidersSilk);
AddSpell(typeof(MindBlastScroll), Reg.BlackPearl, Reg.MandrakeRoot, Reg.Nightshade, Reg.SulfurousAsh);
AddSpell(typeof(ParalyzeScroll), Reg.Garlic, Reg.MandrakeRoot, Reg.SpidersSilk);
AddSpell(typeof(PoisonFieldScroll), Reg.BlackPearl, Reg.Nightshade, Reg.SpidersSilk);
AddSpell(typeof(SummonCreatureScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk);
AddSpell( typeof( BladeSpiritsScroll ), Reg.BlackPearl, Reg.Nightshade, Reg.MandrakeRoot );
AddSpell( typeof( DispelFieldScroll ), Reg.BlackPearl, Reg.Garlic, Reg.SpidersSilk, Reg.SulfurousAsh );
AddSpell( typeof( IncognitoScroll ), Reg.Bloodmoss, Reg.Garlic, Reg.Nightshade );
AddSpell( typeof( MagicReflectScroll ), Reg.Garlic, Reg.MandrakeRoot, Reg.SpidersSilk );
AddSpell( typeof( MindBlastScroll ), Reg.BlackPearl, Reg.MandrakeRoot, Reg.Nightshade, Reg.SulfurousAsh );
AddSpell( typeof( ParalyzeScroll ), Reg.Garlic, Reg.MandrakeRoot, Reg.SpidersSilk );
AddSpell( typeof( PoisonFieldScroll ), Reg.BlackPearl, Reg.Nightshade, Reg.SpidersSilk );
AddSpell( typeof( SummonCreatureScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk );
m_Circle = 5;
m_Mana = 20;
m_Circle = 5;
m_Mana = 20;
AddSpell(typeof(DispelScroll), Reg.Garlic, Reg.MandrakeRoot, Reg.SulfurousAsh);
AddSpell(typeof(EnergyBoltScroll), Reg.BlackPearl, Reg.Nightshade);
AddSpell(typeof(ExplosionScroll), Reg.Bloodmoss, Reg.MandrakeRoot);
AddSpell(typeof(InvisibilityScroll), Reg.Bloodmoss, Reg.Nightshade);
AddSpell(typeof(MarkScroll), Reg.Bloodmoss, Reg.BlackPearl, Reg.MandrakeRoot);
AddSpell(typeof(MassCurseScroll), Reg.Garlic, Reg.MandrakeRoot, Reg.Nightshade, Reg.SulfurousAsh);
AddSpell(typeof(ParalyzeFieldScroll), Reg.BlackPearl, Reg.Ginseng, Reg.SpidersSilk);
AddSpell(typeof(RevealScroll), Reg.Bloodmoss, Reg.SulfurousAsh);
AddSpell( typeof( DispelScroll ), Reg.Garlic, Reg.MandrakeRoot, Reg.SulfurousAsh );
AddSpell( typeof( EnergyBoltScroll ), Reg.BlackPearl, Reg.Nightshade );
AddSpell( typeof( ExplosionScroll ), Reg.Bloodmoss, Reg.MandrakeRoot );
AddSpell( typeof( InvisibilityScroll ), Reg.Bloodmoss, Reg.Nightshade );
AddSpell( typeof( MarkScroll ), Reg.Bloodmoss, Reg.BlackPearl, Reg.MandrakeRoot );
AddSpell( typeof( MassCurseScroll ), Reg.Garlic, Reg.MandrakeRoot, Reg.Nightshade, Reg.SulfurousAsh );
AddSpell( typeof( ParalyzeFieldScroll ), Reg.BlackPearl, Reg.Ginseng, Reg.SpidersSilk );
AddSpell( typeof( RevealScroll ), Reg.Bloodmoss, Reg.SulfurousAsh );
m_Circle = 6;
m_Mana = 40;
m_Circle = 6;
m_Mana = 40;
AddSpell(typeof(ChainLightningScroll), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SulfurousAsh);
AddSpell(typeof(EnergyFieldScroll), Reg.BlackPearl, Reg.MandrakeRoot, Reg.SpidersSilk, Reg.SulfurousAsh);
AddSpell(typeof(FlamestrikeScroll), Reg.SpidersSilk, Reg.SulfurousAsh);
AddSpell(typeof(GateTravelScroll), Reg.BlackPearl, Reg.MandrakeRoot, Reg.SulfurousAsh);
AddSpell(typeof(ManaVampireScroll), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk);
AddSpell(typeof(MassDispelScroll), Reg.BlackPearl, Reg.Garlic, Reg.MandrakeRoot, Reg.SulfurousAsh);
AddSpell(typeof(MeteorSwarmScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SulfurousAsh, Reg.SpidersSilk);
AddSpell(typeof(PolymorphScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk);
AddSpell( typeof( ChainLightningScroll ), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SulfurousAsh );
AddSpell( typeof( EnergyFieldScroll ), Reg.BlackPearl, Reg.MandrakeRoot, Reg.SpidersSilk, Reg.SulfurousAsh );
AddSpell( typeof( FlamestrikeScroll ), Reg.SpidersSilk, Reg.SulfurousAsh );
AddSpell( typeof( GateTravelScroll ), Reg.BlackPearl, Reg.MandrakeRoot, Reg.SulfurousAsh );
AddSpell( typeof( ManaVampireScroll ), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk );
AddSpell( typeof( MassDispelScroll ), Reg.BlackPearl, Reg.Garlic, Reg.MandrakeRoot, Reg.SulfurousAsh );
AddSpell( typeof( MeteorSwarmScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SulfurousAsh, Reg.SpidersSilk );
AddSpell( typeof( PolymorphScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk );
m_Circle = 7;
m_Mana = 50;
m_Circle = 7;
m_Mana = 50;
AddSpell(typeof(EarthquakeScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.Ginseng, Reg.SulfurousAsh);
AddSpell(typeof(EnergyVortexScroll), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.Nightshade);
AddSpell(typeof(ResurrectionScroll), Reg.Bloodmoss, Reg.Garlic, Reg.Ginseng);
AddSpell(typeof(SummonAirElementalScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk);
AddSpell(typeof(SummonDaemonScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk, Reg.SulfurousAsh);
AddSpell(typeof(SummonEarthElementalScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk);
AddSpell(typeof(SummonFireElementalScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk, Reg.SulfurousAsh);
AddSpell(typeof(SummonWaterElementalScroll), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk);
AddSpell( typeof( EarthquakeScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.Ginseng, Reg.SulfurousAsh );
AddSpell( typeof( EnergyVortexScroll ), Reg.BlackPearl, Reg.Bloodmoss, Reg.MandrakeRoot, Reg.Nightshade );
AddSpell( typeof( ResurrectionScroll ), Reg.Bloodmoss, Reg.Garlic, Reg.Ginseng );
AddSpell( typeof( SummonAirElementalScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk );
AddSpell( typeof( SummonDaemonScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk, Reg.SulfurousAsh );
AddSpell( typeof( SummonEarthElementalScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk );
AddSpell( typeof( SummonFireElementalScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk, Reg.SulfurousAsh );
AddSpell( typeof( SummonWaterElementalScroll ), Reg.Bloodmoss, Reg.MandrakeRoot, Reg.SpidersSilk );
if (Core.SE)
{
AddNecroSpell(0, 23, 39.6, typeof(AnimateDeadScroll), Reagent.GraveDust, Reagent.DaemonBlood);
AddNecroSpell(1, 13, 19.6, typeof(BloodOathScroll), Reagent.DaemonBlood);
AddNecroSpell(2, 11, 19.6, typeof(CorpseSkinScroll), Reagent.BatWing, Reagent.GraveDust);
AddNecroSpell(3, 7, 19.6, typeof(CurseWeaponScroll), Reagent.PigIron);
AddNecroSpell(4, 11, 19.6, typeof(EvilOmenScroll), Reagent.BatWing, Reagent.NoxCrystal);
AddNecroSpell(5, 11, 39.6, typeof(HorrificBeastScroll), Reagent.BatWing, Reagent.DaemonBlood);
AddNecroSpell(6, 23, 69.6, typeof(LichFormScroll), Reagent.GraveDust, Reagent.DaemonBlood,
Reagent.NoxCrystal);
AddNecroSpell(7, 17, 29.6, typeof(MindRotScroll), Reagent.BatWing, Reagent.DaemonBlood, Reagent.PigIron);
AddNecroSpell(8, 5, 19.6, typeof(PainSpikeScroll), Reagent.GraveDust, Reagent.PigIron);
AddNecroSpell(9, 17, 49.6, typeof(PoisonStrikeScroll), Reagent.NoxCrystal);
AddNecroSpell(10, 29, 64.6, typeof(StrangleScroll), Reagent.DaemonBlood, Reagent.NoxCrystal);
AddNecroSpell(11, 17, 29.6, typeof(SummonFamiliarScroll), Reagent.BatWing, Reagent.GraveDust,
Reagent.DaemonBlood);
AddNecroSpell(12, 23, 98.6, typeof(VampiricEmbraceScroll), Reagent.BatWing, Reagent.NoxCrystal,
Reagent.PigIron);
AddNecroSpell(13, 41, 79.6, typeof(VengefulSpiritScroll), Reagent.BatWing, Reagent.GraveDust,
Reagent.PigIron);
AddNecroSpell(14, 23, 59.6, typeof(WitherScroll), Reagent.GraveDust, Reagent.NoxCrystal, Reagent.PigIron);
AddNecroSpell(15, 17, 79.6, typeof(WraithFormScroll), Reagent.NoxCrystal, Reagent.PigIron);
AddNecroSpell(16, 40, 79.6, typeof(ExorcismScroll), Reagent.NoxCrystal, Reagent.GraveDust);
}
if ( Core.SE )
{
AddNecroSpell( 0, 23, 39.6, typeof( AnimateDeadScroll ), Reagent.GraveDust, Reagent.DaemonBlood );
AddNecroSpell( 1, 13, 19.6, typeof( BloodOathScroll ), Reagent.DaemonBlood );
AddNecroSpell( 2, 11, 19.6, typeof( CorpseSkinScroll ), Reagent.BatWing, Reagent.GraveDust );
AddNecroSpell( 3, 7, 19.6, typeof( CurseWeaponScroll ), Reagent.PigIron );
AddNecroSpell( 4, 11, 19.6, typeof( EvilOmenScroll ), Reagent.BatWing, Reagent.NoxCrystal );
AddNecroSpell( 5, 11, 39.6, typeof( HorrificBeastScroll ), Reagent.BatWing, Reagent.DaemonBlood );
AddNecroSpell( 6, 23, 69.6, typeof( LichFormScroll ), Reagent.GraveDust, Reagent.DaemonBlood, Reagent.NoxCrystal );
AddNecroSpell( 7, 17, 29.6, typeof( MindRotScroll ), Reagent.BatWing, Reagent.DaemonBlood, Reagent.PigIron );
AddNecroSpell( 8, 5, 19.6, typeof( PainSpikeScroll ), Reagent.GraveDust, Reagent.PigIron );
AddNecroSpell( 9, 17, 49.6, typeof( PoisonStrikeScroll ), Reagent.NoxCrystal );
AddNecroSpell( 10, 29, 64.6, typeof( StrangleScroll ), Reagent.DaemonBlood, Reagent.NoxCrystal );
AddNecroSpell( 11, 17, 29.6, typeof( SummonFamiliarScroll ), Reagent.BatWing, Reagent.GraveDust, Reagent.DaemonBlood );
AddNecroSpell( 12, 23, 98.6, typeof( VampiricEmbraceScroll ), Reagent.BatWing, Reagent.NoxCrystal, Reagent.PigIron );
AddNecroSpell( 13, 41, 79.6, typeof( VengefulSpiritScroll ), Reagent.BatWing, Reagent.GraveDust, Reagent.PigIron );
AddNecroSpell( 14, 23, 59.6, typeof( WitherScroll ), Reagent.GraveDust, Reagent.NoxCrystal, Reagent.PigIron );
AddNecroSpell( 15, 17, 79.6, typeof( WraithFormScroll ), Reagent.NoxCrystal, Reagent.PigIron );
AddNecroSpell( 16, 40, 79.6, typeof( ExorcismScroll ), Reagent.NoxCrystal, Reagent.GraveDust );
}
int index;
int index;
if (Core.ML)
{
index = AddCraft(typeof(EnchantedSwitch), 1044294, 1072893, 45.0, 95.0, typeof(BlankScroll), 1044377, 1,
1044378);
AddRes(index, typeof(SpidersSilk), 1044360, 1, 1044253);
AddRes(index, typeof(BlackPearl), 1044353, 1, 1044253);
AddRes(index, typeof(SwitchItem), 1073464, 1, 1044253);
ForceNonExceptional(index);
SetNeededExpansion(index, Expansion.ML);
if ( Core.ML )
{
index = AddCraft( typeof( EnchantedSwitch ), 1044294, 1072893, 45.0, 95.0, typeof( BlankScroll ), 1044377, 1, 1044378 );
AddRes( index, typeof( SpidersSilk ), 1044360, 1, 1044253 );
AddRes( index, typeof( BlackPearl ), 1044353, 1, 1044253 );
AddRes( index, typeof( SwitchItem ), 1073464, 1, 1044253 );
ForceNonExceptional( index );
SetNeededExpansion( index, Expansion.ML );
index = AddCraft(typeof(RunedPrism), 1044294, 1073465, 45.0, 95.0, typeof(BlankScroll), 1044377, 1, 1044378);
AddRes(index, typeof(SpidersSilk), 1044360, 1, 1044253);
AddRes(index, typeof(BlackPearl), 1044353, 1, 1044253);
AddRes(index, typeof(HollowPrism), 1072895, 1, 1044253);
ForceNonExceptional(index);
SetNeededExpansion(index, Expansion.ML);
}
index = AddCraft( typeof( RunedPrism ), 1044294, 1073465, 45.0, 95.0, typeof( BlankScroll ), 1044377, 1, 1044378 );
AddRes( index, typeof( SpidersSilk ), 1044360, 1, 1044253 );
AddRes( index, typeof( BlackPearl ), 1044353, 1, 1044253 );
AddRes( index, typeof( HollowPrism ), 1072895, 1, 1044253 );
ForceNonExceptional( index );
SetNeededExpansion( index, Expansion.ML );
}
// Runebook
index = AddCraft(typeof(Runebook), 1044294, 1041267, 45.0, 95.0, typeof(BlankScroll), 1044377, 8, 1044378);
AddRes(index, typeof(RecallScroll), 1044445, 1, 1044253);
AddRes(index, typeof(GateTravelScroll), 1044446, 1, 1044253);
// Runebook
index = AddCraft( typeof( Runebook ), 1044294, 1041267, 45.0, 95.0, typeof( BlankScroll ), 1044377, 8, 1044378 );
AddRes( index, typeof( RecallScroll ), 1044445, 1, 1044253 );
AddRes( index, typeof( GateTravelScroll ), 1044446, 1, 1044253 );
if (Core.AOS)
AddCraft(typeof(BulkOrderBook), 1044294, 1028793, 65.0, 115.0, typeof(BlankScroll), 1044377, 10, 1044378);
if ( Core.AOS )
{
AddCraft( typeof( BulkOrders.BulkOrderBook ), 1044294, 1028793, 65.0, 115.0, typeof( BlankScroll ), 1044377, 10, 1044378 );
}
if (Core.SE) AddCraft(typeof(Spellbook), 1044294, 1023834, 50.0, 126, typeof(BlankScroll), 1044377, 10, 1044378);
if ( Core.SE )
{
AddCraft( typeof( Spellbook ), 1044294, 1023834, 50.0, 126, typeof( BlankScroll ), 1044377, 10, 1044378 );
}
/* TODO
if ( Core.ML )
{
index = AddCraft( typeof( ScrappersCompendium ), 1044294, 1072940, 75.0, 125.0, typeof( BlankScroll ), 1044377, 100, 1044378 );
AddRes( index, typeof( DreadHornMane ), 1032682, 1, 1044253 );
AddRes( index, typeof( Taint ), 1032679, 10, 1044253 );
AddRes( index, typeof( Corruption ), 1032676, 10, 1044253 );
AddRareRecipe( index, 400 );
ForceNonExceptional( index );
SetNeededExpansion( index, Expansion.ML );
}
*/
/* TODO
if ( Core.ML )
{
index = AddCraft( typeof( ScrappersCompendium ), 1044294, 1072940, 75.0, 125.0, typeof( BlankScroll ), 1044377, 100, 1044378 );
AddRes( index, typeof( DreadHornMane ), 1032682, 1, 1044253 );
AddRes( index, typeof( Taint ), 1032679, 10, 1044253 );
AddRes( index, typeof( Corruption ), 1032676, 10, 1044253 );
AddRareRecipe( index, 400 );
ForceNonExceptional( index );
SetNeededExpansion( index, Expansion.ML );
}
*/
if (Core.SA)
{
AddCraft(typeof(MysticSpellbook), 1044294, 1031677, 50.0, 150.0, typeof(BlankScroll), 1044377, 10, 1044378);
if ( Core.SA )
{
AddCraft( typeof( MysticSpellbook ), 1044294, 1031677, 50.0, 150.0, typeof( BlankScroll ), 1044377, 10, 1044378 );
AddMysticismSpell(0, 4, -25.0, 25.0, typeof(NetherBoltScroll), Reagent.BlackPearl, Reagent.SulfurousAsh);
AddMysticismSpell(1, 4, -25.0, 25.0, typeof(HealingStoneScroll), Reagent.Bone, Reagent.Garlic,
Reagent.Ginseng, Reagent.SpidersSilk);
AddMysticismSpell(2, 6, -10.8, 39.2, typeof(PurgeMagicScroll), Reagent.FertileDirt, Reagent.Garlic,
Reagent.MandrakeRoot, Reagent.SulfurousAsh);
AddMysticismSpell(3, 6, -10.8, 39.2, typeof(EnchantScroll), Reagent.SpidersSilk, Reagent.MandrakeRoot,
Reagent.SulfurousAsh);
AddMysticismSpell(4, 9, 3.5, 53.5, typeof(SleepScroll), Reagent.Nightshade, Reagent.SpidersSilk,
Reagent.BlackPearl);
AddMysticismSpell(5, 9, 3.5, 53.5, typeof(EagleStrikeScroll), Reagent.Bloodmoss, Reagent.Bone,
Reagent.SpidersSilk, Reagent.MandrakeRoot);
AddMysticismSpell(6, 11, 17.8, 67.8, typeof(AnimatedWeaponScroll), Reagent.Bone, Reagent.BlackPearl,
Reagent.MandrakeRoot, Reagent.Nightshade);
AddMysticismSpell(7, 11, 17.8, 67.8, typeof(StoneFormScroll), Reagent.Bloodmoss, Reagent.FertileDirt,
Reagent.Garlic);
AddMysticismSpell(8, 14, 32.1, 82.1, typeof(SpellTriggerScroll), Reagent.DragonsBlood, Reagent.Garlic,
Reagent.MandrakeRoot, Reagent.SpidersSilk);
AddMysticismSpell(9, 14, 32.1, 82.1, typeof(MassSleepScroll), Reagent.Ginseng, Reagent.Nightshade,
Reagent.SpidersSilk);
AddMysticismSpell(10, 20, 46.4, 96.4, typeof(CleansingWindsScroll), Reagent.DragonsBlood, Reagent.Garlic,
Reagent.Ginseng, Reagent.MandrakeRoot);
AddMysticismSpell(11, 20, 46.4, 96.4, typeof(BombardScroll), Reagent.Bloodmoss, Reagent.DragonsBlood,
Reagent.Garlic, Reagent.SulfurousAsh);
AddMysticismSpell(12, 40, 60.7, 110.7, typeof(SpellPlagueScroll), Reagent.DaemonBone, Reagent.DragonsBlood,
Reagent.Nightshade, Reagent.SulfurousAsh);
AddMysticismSpell(13, 40, 60.7, 110.7, typeof(HailStormScroll), Reagent.DragonsBlood, Reagent.Bloodmoss,
Reagent.BlackPearl, Reagent.MandrakeRoot);
AddMysticismSpell(14, 50, 75.0, 125.0, typeof(NetherCycloneScroll), Reagent.MandrakeRoot, Reagent.Nightshade,
Reagent.SulfurousAsh, Reagent.Bloodmoss);
AddMysticismSpell(15, 50, 75.0, 125.0, typeof(RisingColossusScroll), Reagent.DaemonBone,
Reagent.DragonsBlood, Reagent.FertileDirt, Reagent.Nightshade);
}
AddMysticismSpell( 0, 4, -25.0, 25.0, typeof( NetherBoltScroll ), Reagent.BlackPearl, Reagent.SulfurousAsh );
AddMysticismSpell( 1, 4, -25.0, 25.0, typeof( HealingStoneScroll ), Reagent.Bone, Reagent.Garlic, Reagent.Ginseng, Reagent.SpidersSilk );
AddMysticismSpell( 2, 6, -10.8, 39.2, typeof( PurgeMagicScroll ), Reagent.FertileDirt, Reagent.Garlic, Reagent.MandrakeRoot, Reagent.SulfurousAsh );
AddMysticismSpell( 3, 6, -10.8, 39.2, typeof( EnchantScroll ), Reagent.SpidersSilk, Reagent.MandrakeRoot, Reagent.SulfurousAsh );
AddMysticismSpell( 4, 9, 3.5, 53.5, typeof( SleepScroll ), Reagent.Nightshade, Reagent.SpidersSilk, Reagent.BlackPearl );
AddMysticismSpell( 5, 9, 3.5, 53.5, typeof( EagleStrikeScroll ), Reagent.Bloodmoss, Reagent.Bone, Reagent.SpidersSilk, Reagent.MandrakeRoot );
AddMysticismSpell( 6, 11, 17.8, 67.8, typeof( AnimatedWeaponScroll ), Reagent.Bone, Reagent.BlackPearl, Reagent.MandrakeRoot, Reagent.Nightshade );
AddMysticismSpell( 7, 11, 17.8, 67.8, typeof( StoneFormScroll ), Reagent.Bloodmoss, Reagent.FertileDirt, Reagent.Garlic );
AddMysticismSpell( 8, 14, 32.1, 82.1, typeof( SpellTriggerScroll ), Reagent.DragonsBlood, Reagent.Garlic, Reagent.MandrakeRoot, Reagent.SpidersSilk );
AddMysticismSpell( 9, 14, 32.1, 82.1, typeof( MassSleepScroll ), Reagent.Ginseng, Reagent.Nightshade, Reagent.SpidersSilk );
AddMysticismSpell( 10, 20, 46.4, 96.4, typeof( CleansingWindsScroll ), Reagent.DragonsBlood, Reagent.Garlic, Reagent.Ginseng, Reagent.MandrakeRoot );
AddMysticismSpell( 11, 20, 46.4, 96.4, typeof( BombardScroll ), Reagent.Bloodmoss, Reagent.DragonsBlood, Reagent.Garlic, Reagent.SulfurousAsh );
AddMysticismSpell( 12, 40, 60.7, 110.7, typeof( SpellPlagueScroll ), Reagent.DaemonBone, Reagent.DragonsBlood, Reagent.Nightshade, Reagent.SulfurousAsh );
AddMysticismSpell( 13, 40, 60.7, 110.7, typeof( HailStormScroll ), Reagent.DragonsBlood, Reagent.Bloodmoss, Reagent.BlackPearl, Reagent.MandrakeRoot );
AddMysticismSpell( 14, 50, 75.0, 125.0, typeof( NetherCycloneScroll ), Reagent.MandrakeRoot, Reagent.Nightshade, Reagent.SulfurousAsh, Reagent.Bloodmoss );
AddMysticismSpell( 15, 50, 75.0, 125.0, typeof( RisingColossusScroll ), Reagent.DaemonBone, Reagent.DragonsBlood, Reagent.FertileDirt, Reagent.Nightshade );
}
MarkOption = true;
}
MarkOption = true;
}
}
}
private enum Reg
{
BlackPearl,
Bloodmoss,
Garlic,
Ginseng,
MandrakeRoot,
Nightshade,
SulfurousAsh,
SpidersSilk
}
}
}

View file

@ -4,137 +4,139 @@ using Server.Mobiles;
namespace Server.Engines.Craft
{
public class DefMasonry : CraftSystem
{
public override SkillName MainSkill => SkillName.Carpentry;
public class DefMasonry : CraftSystem
{
private static CraftSystem m_CraftSystem;
public override int GumpTitleNumber => 1044500;
private DefMasonry() : base(1, 1, 1.25) // base( 1, 2, 1.7 )
{
}
private static CraftSystem m_CraftSystem;
public override SkillName MainSkill => SkillName.Carpentry;
public static CraftSystem CraftSystem
{
get
{
if ( m_CraftSystem == null )
m_CraftSystem = new DefMasonry();
public override int GumpTitleNumber => 1044500;
return m_CraftSystem;
}
}
public static CraftSystem CraftSystem
{
get
{
if (m_CraftSystem == null)
m_CraftSystem = new DefMasonry();
public override double GetChanceAtMin( CraftItem item )
{
return 0.0; // 0%
}
return m_CraftSystem;
}
}
private DefMasonry() : base( 1, 1, 1.25 )// base( 1, 2, 1.7 )
{
}
public override double GetChanceAtMin(CraftItem item)
{
return 0.0; // 0%
}
public override bool RetainsColorFrom( CraftItem item, Type type )
{
return true;
}
public override bool RetainsColorFrom(CraftItem item, Type type)
{
return true;
}
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
{
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
if ( !BaseTool.CheckTool( tool, from ) )
return 1048146; // If you have a tool equipped, you must use that tool.
if ( !(from is PlayerMobile mobile && mobile.Masonry && mobile.Skills[SkillName.Carpentry].Base >= 100.0) )
return 1044633; // You havent learned stonecraft.
if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
{
if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
return 1044038; // You have worn out your tool!
if (!BaseTool.CheckTool(tool, from))
return 1048146; // If you have a tool equipped, you must use that tool.
if (!(from is PlayerMobile mobile && mobile.Masonry && mobile.Skills[SkillName.Carpentry].Base >= 100.0))
return 1044633; // You havent learned stonecraft.
if (!BaseTool.CheckAccessible(tool, from))
return 1044263; // The tool must be on your person to use.
return 0;
}
return 0;
}
public override void PlayCraftEffect( Mobile from )
{
// no effects
//if ( from.Body.Type == BodyType.Human && !from.Mounted )
// from.Animate( 9, 5, 1, true, false, 0 );
//new InternalTimer( from ).Start();
}
public override void PlayCraftEffect(Mobile from)
{
// no effects
//if ( from.Body.Type == BodyType.Human && !from.Mounted )
// from.Animate( 9, 5, 1, true, false, 0 );
//new InternalTimer( from ).Start();
}
// Delay to synchronize the sound with the hit on the anvil
private class InternalTimer : Timer
{
private Mobile m_From;
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality,
bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
public InternalTimer( Mobile from ) : base( TimeSpan.FromSeconds( 0.7 ) )
{
m_From = from;
}
if (failed)
{
if (lostMaterial)
return 1044043; // You failed to create the item, and some of your materials are lost.
return 1044157; // You failed to create the item, but no materials were lost.
}
protected override void OnTick()
{
m_From.PlaySound( 0x23D );
}
}
if (quality == 0)
return 502785; // You were barely able to make this item. It's quality is below average.
if (makersMark && quality == 2)
return 1044156; // You create an exceptional quality item and affix your maker's mark.
if (quality == 2)
return 1044155; // You create an exceptional quality item.
return 1044154; // You create the item.
}
public override int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item )
{
if ( toolBroken )
from.SendLocalizedMessage( 1044038 ); // You have worn out your tool
public override void InitCraftList()
{
// Decorations
AddCraft(typeof(Vase), 1044501, 1022888, 52.5, 102.5, typeof(Granite), 1044514, 1, 1044513);
AddCraft(typeof(LargeVase), 1044501, 1022887, 52.5, 102.5, typeof(Granite), 1044514, 3, 1044513);
if ( failed )
{
if ( lostMaterial )
return 1044043; // You failed to create the item, and some of your materials are lost.
return 1044157; // You failed to create the item, but no materials were lost.
}
if (Core.SE)
{
int index = AddCraft(typeof(SmallUrn), 1044501, 1029244, 82.0, 132.0, typeof(Granite), 1044514, 3, 1044513);
SetNeededExpansion(index, Expansion.SE);
if ( quality == 0 )
return 502785; // You were barely able to make this item. It's quality is below average.
if ( makersMark && quality == 2 )
return 1044156; // You create an exceptional quality item and affix your maker's mark.
if ( quality == 2 )
return 1044155; // You create an exceptional quality item.
return 1044154; // You create the item.
}
index = AddCraft(typeof(SmallTowerSculpture), 1044501, 1029242, 82.0, 132.0, typeof(Granite), 1044514, 3,
1044513);
SetNeededExpansion(index, Expansion.SE);
}
public override void InitCraftList()
{
// Decorations
AddCraft( typeof( Vase ), 1044501, 1022888, 52.5, 102.5, typeof( Granite ), 1044514, 1, 1044513 );
AddCraft( typeof( LargeVase ), 1044501, 1022887, 52.5, 102.5, typeof( Granite ), 1044514, 3, 1044513 );
// Furniture
AddCraft(typeof(StoneChair), 1044502, 1024635, 55.0, 105.0, typeof(Granite), 1044514, 4, 1044513);
AddCraft(typeof(MediumStoneTableEastDeed), 1044502, 1044508, 65.0, 115.0, typeof(Granite), 1044514, 6, 1044513);
AddCraft(typeof(MediumStoneTableSouthDeed), 1044502, 1044509, 65.0, 115.0, typeof(Granite), 1044514, 6, 1044513);
AddCraft(typeof(LargeStoneTableEastDeed), 1044502, 1044511, 75.0, 125.0, typeof(Granite), 1044514, 9, 1044513);
AddCraft(typeof(LargeStoneTableSouthDeed), 1044502, 1044512, 75.0, 125.0, typeof(Granite), 1044514, 9, 1044513);
if ( Core.SE )
{
int index = AddCraft( typeof( SmallUrn ), 1044501, 1029244, 82.0, 132.0, typeof( Granite ), 1044514, 3, 1044513 );
SetNeededExpansion( index, Expansion.SE );
// Statues
AddCraft(typeof(StatueSouth), 1044503, 1044505, 60.0, 120.0, typeof(Granite), 1044514, 3, 1044513);
AddCraft(typeof(StatueNorth), 1044503, 1044506, 60.0, 120.0, typeof(Granite), 1044514, 3, 1044513);
AddCraft(typeof(StatueEast), 1044503, 1044507, 60.0, 120.0, typeof(Granite), 1044514, 3, 1044513);
AddCraft(typeof(StatuePegasus), 1044503, 1044510, 70.0, 130.0, typeof(Granite), 1044514, 4, 1044513);
index = AddCraft( typeof( SmallTowerSculpture ), 1044501, 1029242, 82.0, 132.0, typeof( Granite ), 1044514, 3, 1044513 );
SetNeededExpansion( index, Expansion.SE );
}
SetSubRes(typeof(Granite), 1044525);
// Furniture
AddCraft( typeof( StoneChair ), 1044502, 1024635, 55.0, 105.0, typeof( Granite ), 1044514, 4, 1044513 );
AddCraft( typeof( MediumStoneTableEastDeed ), 1044502, 1044508, 65.0, 115.0, typeof( Granite ), 1044514, 6, 1044513 );
AddCraft( typeof( MediumStoneTableSouthDeed ), 1044502, 1044509, 65.0, 115.0, typeof( Granite ), 1044514, 6, 1044513 );
AddCraft( typeof( LargeStoneTableEastDeed ), 1044502, 1044511, 75.0, 125.0, typeof( Granite ), 1044514, 9, 1044513 );
AddCraft( typeof( LargeStoneTableSouthDeed ), 1044502, 1044512, 75.0, 125.0, typeof( Granite ), 1044514, 9, 1044513 );
AddSubRes(typeof(Granite), 1044525, 00.0, 1044514, 1044526);
AddSubRes(typeof(DullCopperGranite), 1044023, 65.0, 1044514, 1044527);
AddSubRes(typeof(ShadowIronGranite), 1044024, 70.0, 1044514, 1044527);
AddSubRes(typeof(CopperGranite), 1044025, 75.0, 1044514, 1044527);
AddSubRes(typeof(BronzeGranite), 1044026, 80.0, 1044514, 1044527);
AddSubRes(typeof(GoldGranite), 1044027, 85.0, 1044514, 1044527);
AddSubRes(typeof(AgapiteGranite), 1044028, 90.0, 1044514, 1044527);
AddSubRes(typeof(VeriteGranite), 1044029, 95.0, 1044514, 1044527);
AddSubRes(typeof(ValoriteGranite), 1044030, 99.0, 1044514, 1044527);
}
// Statues
AddCraft( typeof( StatueSouth ), 1044503, 1044505, 60.0, 120.0, typeof( Granite ), 1044514, 3, 1044513 );
AddCraft( typeof( StatueNorth ), 1044503, 1044506, 60.0, 120.0, typeof( Granite ), 1044514, 3, 1044513 );
AddCraft( typeof( StatueEast ), 1044503, 1044507, 60.0, 120.0, typeof( Granite ), 1044514, 3, 1044513 );
AddCraft( typeof( StatuePegasus ), 1044503, 1044510, 70.0, 130.0, typeof( Granite ), 1044514, 4, 1044513 );
// Delay to synchronize the sound with the hit on the anvil
private class InternalTimer : Timer
{
private Mobile m_From;
SetSubRes( typeof( Granite ), 1044525 );
public InternalTimer(Mobile from) : base(TimeSpan.FromSeconds(0.7))
{
m_From = from;
}
AddSubRes( typeof( Granite ), 1044525, 00.0, 1044514, 1044526 );
AddSubRes( typeof( DullCopperGranite ), 1044023, 65.0, 1044514, 1044527 );
AddSubRes( typeof( ShadowIronGranite ), 1044024, 70.0, 1044514, 1044527 );
AddSubRes( typeof( CopperGranite ), 1044025, 75.0, 1044514, 1044527 );
AddSubRes( typeof( BronzeGranite ), 1044026, 80.0, 1044514, 1044527 );
AddSubRes( typeof( GoldGranite ), 1044027, 85.0, 1044514, 1044527 );
AddSubRes( typeof( AgapiteGranite ), 1044028, 90.0, 1044514, 1044527 );
AddSubRes( typeof( VeriteGranite ), 1044029, 95.0, 1044514, 1044527 );
AddSubRes( typeof( ValoriteGranite ), 1044030, 99.0, 1044514, 1044527 );
}
}
}
protected override void OnTick()
{
m_From.PlaySound(0x23D);
}
}
}
}

View file

@ -3,390 +3,428 @@ using Server.Items;
namespace Server.Engines.Craft
{
public class DefTailoring : CraftSystem
{
public override SkillName MainSkill => SkillName.Tailoring;
public override int GumpTitleNumber => 1044005;
private static CraftSystem m_CraftSystem;
public static CraftSystem CraftSystem
{
get
{
if ( m_CraftSystem == null )
m_CraftSystem = new DefTailoring();
return m_CraftSystem;
}
}
public override CraftECA ECA => CraftECA.ChanceMinusSixtyToFourtyFive;
public override double GetChanceAtMin( CraftItem item )
{
return 0.5; // 50%
}
private DefTailoring() : base( 1, 1, 1.25 )// base( 1, 1, 4.5 )
{
}
public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
{
if ( tool == null || tool.Deleted || tool.UsesRemaining < 0 )
return 1044038; // You have worn out your tool!
if ( !BaseTool.CheckAccessible( tool, from ) )
return 1044263; // The tool must be on your person to use.
return 0;
}
private static Type[] m_TailorColorables = {
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 ( type != typeof( Cloth ) && type != typeof( UncutCloth ) )
return false;
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 )
{
from.PlaySound( 0x248 );
}
public override int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item )
{
if ( toolBroken )
from.SendLocalizedMessage( 1044038 ); // You have worn out your tool
if ( failed )
{
if ( lostMaterial )
return 1044043; // You failed to create the item, and some of your materials are lost.
return 1044157; // You failed to create the item, but no materials were lost.
}
if ( quality == 0 )
return 502785; // You were barely able to make this item. It's quality is below average.
if ( makersMark && quality == 2 )
return 1044156; // You create an exceptional quality item and affix your maker's mark.
if ( quality == 2 )
return 1044155; // You create an exceptional quality item.
return 1044154; // You create the item.
}
public override void InitCraftList()
{
int index = -1;
#region Hats
AddCraft( typeof( SkullCap ), 1011375, 1025444, 0.0, 25.0, typeof( Cloth ), 1044286, 2, 1044287 );
AddCraft( typeof( Bandana ), 1011375, 1025440, 0.0, 25.0, typeof( Cloth ), 1044286, 2, 1044287 );
AddCraft( typeof( FloppyHat ), 1011375, 1025907, 6.2, 31.2, typeof( Cloth ), 1044286, 11, 1044287 );
AddCraft( typeof( Cap ), 1011375, 1025909, 6.2, 31.2, typeof( Cloth ), 1044286, 11, 1044287 );
AddCraft( typeof( WideBrimHat ), 1011375, 1025908, 6.2, 31.2, typeof( Cloth ), 1044286, 12, 1044287 );
AddCraft( typeof( StrawHat ), 1011375, 1025911, 6.2, 31.2, typeof( Cloth ), 1044286, 10, 1044287 );
AddCraft( typeof( TallStrawHat ), 1011375, 1025910, 6.7, 31.7, typeof( Cloth ), 1044286, 13, 1044287 );
AddCraft( typeof( WizardsHat ), 1011375, 1025912, 7.2, 32.2, typeof( Cloth ), 1044286, 15, 1044287 );
AddCraft( typeof( Bonnet ), 1011375, 1025913, 6.2, 31.2, typeof( Cloth ), 1044286, 11, 1044287 );
AddCraft( typeof( FeatheredHat ), 1011375, 1025914, 6.2, 31.2, typeof( Cloth ), 1044286, 12, 1044287 );
AddCraft( typeof( TricorneHat ), 1011375, 1025915, 6.2, 31.2, typeof( Cloth ), 1044286, 12, 1044287 );
AddCraft( typeof( JesterHat ), 1011375, 1025916, 7.2, 32.2, typeof( Cloth ), 1044286, 15, 1044287 );
if ( Core.AOS )
AddCraft( typeof( FlowerGarland ), 1011375, 1028965, 10.0, 35.0, typeof( Cloth ), 1044286, 5, 1044287 );
if ( Core.SE )
{
index = AddCraft( typeof( ClothNinjaHood ), 1011375, 1030202, 80.0, 105.0, typeof( Cloth ), 1044286, 13, 1044287 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( Kasa ), 1011375, 1030211, 60.0, 85.0, typeof( Cloth ), 1044286, 12, 1044287 );
SetNeededExpansion( index, Expansion.SE );
}
#endregion
#region Shirts
AddCraft( typeof( Doublet ), 1015269, 1028059, 0, 25.0, typeof( Cloth ), 1044286, 8, 1044287 );
AddCraft( typeof( Shirt ), 1015269, 1025399, 20.7, 45.7, typeof( Cloth ), 1044286, 8, 1044287 );
AddCraft( typeof( FancyShirt ), 1015269, 1027933, 24.8, 49.8, typeof( Cloth ), 1044286, 8, 1044287 );
AddCraft( typeof( Tunic ), 1015269, 1028097, 00.0, 25.0, typeof( Cloth ), 1044286, 12, 1044287 );
AddCraft( typeof( Surcoat ), 1015269, 1028189, 8.2, 33.2, typeof( Cloth ), 1044286, 14, 1044287 );
AddCraft( typeof( PlainDress ), 1015269, 1027937, 12.4, 37.4, typeof( Cloth ), 1044286, 10, 1044287 );
AddCraft( typeof( FancyDress ), 1015269, 1027935, 33.1, 58.1, typeof( Cloth ), 1044286, 12, 1044287 );
AddCraft( typeof( Cloak ), 1015269, 1025397, 41.4, 66.4, typeof( Cloth ), 1044286, 14, 1044287 );
AddCraft( typeof( Robe ), 1015269, 1027939, 53.9, 78.9, typeof( Cloth ), 1044286, 16, 1044287 );
AddCraft( typeof( JesterSuit ), 1015269, 1028095, 8.2, 33.2, typeof( Cloth ), 1044286, 24, 1044287 );
if ( Core.AOS )
{
AddCraft( typeof( FurCape ), 1015269, 1028969, 35.0, 60.0, typeof( Cloth ), 1044286, 13, 1044287 );
AddCraft( typeof( GildedDress ), 1015269, 1028973, 37.5, 62.5, typeof( Cloth ), 1044286, 16, 1044287 );
AddCraft( typeof( FormalShirt ), 1015269, 1028975, 26.0, 51.0, typeof( Cloth ), 1044286, 16, 1044287 );
}
if ( Core.SE )
{
index = AddCraft( typeof( ClothNinjaJacket ), 1015269, 1030207, 75.0, 100.0, typeof( Cloth ), 1044286, 12, 1044287 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( Kamishimo ), 1015269, 1030212, 75.0, 100.0, typeof( Cloth ), 1044286, 15, 1044287 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( HakamaShita ), 1015269, 1030215, 40.0, 65.0, typeof( Cloth ), 1044286, 14, 1044287 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( MaleKimono ), 1015269, 1030189, 50.0, 75.0, typeof( Cloth ), 1044286, 16, 1044287 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( FemaleKimono ), 1015269, 1030190, 50.0, 75.0, typeof( Cloth ), 1044286, 16, 1044287 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( JinBaori ), 1015269, 1030220, 30.0, 55.0, typeof( Cloth ), 1044286, 12, 1044287 );
SetNeededExpansion( index, Expansion.SE );
}
#endregion
#region Pants
AddCraft( typeof( ShortPants ), 1015279, 1025422, 24.8, 49.8, typeof( Cloth ), 1044286, 6, 1044287 );
AddCraft( typeof( LongPants ), 1015279, 1025433, 24.8, 49.8, typeof( Cloth ), 1044286, 8, 1044287 );
AddCraft( typeof( Kilt ), 1015279, 1025431, 20.7, 45.7, typeof( Cloth ), 1044286, 8, 1044287 );
AddCraft( typeof( Skirt ), 1015279, 1025398, 29.0, 54.0, typeof( Cloth ), 1044286, 10, 1044287 );
if ( Core.AOS )
AddCraft( typeof( FurSarong ), 1015279, 1028971, 35.0, 60.0, typeof( Cloth ), 1044286, 12, 1044287 );
if ( Core.SE )
{
index = AddCraft( typeof( Hakama ), 1015279, 1030213, 50.0, 75.0, typeof( Cloth ), 1044286, 16, 1044287 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( TattsukeHakama ), 1015279, 1030214, 50.0, 75.0, typeof( Cloth ), 1044286, 16, 1044287 );
SetNeededExpansion( index, Expansion.SE );
}
#endregion
#region Misc
AddCraft( typeof( BodySash ), 1015283, 1025441, 4.1, 29.1, typeof( Cloth ), 1044286, 4, 1044287 );
AddCraft( typeof( HalfApron ), 1015283, 1025435, 20.7, 45.7, typeof( Cloth ), 1044286, 6, 1044287 );
AddCraft( typeof( FullApron ), 1015283, 1025437, 29.0, 54.0, typeof( Cloth ), 1044286, 10, 1044287 );
if ( Core.SE )
{
index = AddCraft( typeof( Obi ), 1015283, 1030219, 20.0, 45.0, typeof( Cloth ), 1044286, 6, 1044287 );
SetNeededExpansion( index, Expansion.SE );
}
if ( Core.ML )
{
index = AddCraft( typeof( ElvenQuiver ), 1015283, 1032657, 65.0, 115.0, typeof( Leather ), 1044462, 28, 1044463 );
AddRecipe( index, 501 );
SetNeededExpansion( index, Expansion.ML );
index = AddCraft( typeof( QuiverOfFire ), 1015283, 1073109, 65.0, 115.0, typeof( Leather ), 1044462, 28, 1044463 );
AddRes( index, typeof( FireRuby ), 1032695, 15, 1042081 );
AddRecipe( index, 502 );
SetNeededExpansion( index, Expansion.ML );
index = AddCraft( typeof( QuiverOfIce ), 1015283, 1073110, 65.0, 115.0, typeof( Leather ), 1044462, 28, 1044463 );
AddRes( index, typeof( WhitePearl ), 1032694, 15, 1042081 );
AddRecipe( index, 503 );
SetNeededExpansion( index, Expansion.ML );
index = AddCraft( typeof( QuiverOfBlight ), 1015283, 1073111, 65.0, 115.0, typeof( Leather ), 1044462, 28, 1044463 );
AddRes( index, typeof( Blight ), 1032675, 10, 1042081 );
AddRecipe( index, 504 );
SetNeededExpansion( index, Expansion.ML );
index = AddCraft( typeof( QuiverOfLightning ), 1015283, 1073112, 65.0, 115.0, typeof( Leather ), 1044462, 28, 1044463 );
AddRes( index, typeof( Corruption ), 1032676, 10, 1042081 );
AddRecipe( index, 505 );
SetNeededExpansion( index, Expansion.ML );
}
AddCraft( typeof( OilCloth ), 1015283, 1041498, 74.6, 99.6, typeof( Cloth ), 1044286, 1, 1044287 );
if ( Core.SE )
{
index = AddCraft( typeof( GozaMatEastDeed ), 1015283, 1030404, 55.0, 80.0, typeof( Cloth ), 1044286, 25, 1044287 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( GozaMatSouthDeed ), 1015283, 1030405, 55.0, 80.0, typeof( Cloth ), 1044286, 25, 1044287 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( SquareGozaMatEastDeed ), 1015283, 1030407, 55.0, 80.0, typeof( Cloth ), 1044286, 25, 1044287 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( SquareGozaMatSouthDeed ), 1015283, 1030406, 55.0, 80.0, typeof( Cloth ), 1044286, 25, 1044287 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( BrocadeGozaMatEastDeed ), 1015283, 1030408, 55.0, 80.0, typeof( Cloth ), 1044286, 25, 1044287 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( BrocadeGozaMatSouthDeed ), 1015283, 1030409, 55.0, 80.0, typeof( Cloth ), 1044286, 25, 1044287 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( BrocadeSquareGozaMatEastDeed ), 1015283, 1030411, 55.0, 80.0, typeof( Cloth ), 1044286, 25, 1044287 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( BrocadeSquareGozaMatSouthDeed ), 1015283, 1030410, 55.0, 80.0, typeof( Cloth ), 1044286, 25, 1044287 );
SetNeededExpansion( index, Expansion.SE );
}
#endregion
#region Footwear
if ( Core.AOS )
AddCraft( typeof( FurBoots ), 1015288, 1028967, 50.0, 75.0, typeof( Cloth ), 1044286, 12, 1044287 );
if ( Core.SE )
{
index = AddCraft( typeof( NinjaTabi ), 1015288, 1030210, 70.0, 95.0, typeof( Cloth ), 1044286, 10, 1044287 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( SamuraiTabi ), 1015288, 1030209, 20.0, 45.0, typeof( Cloth ), 1044286, 6, 1044287 );
SetNeededExpansion( index, Expansion.SE );
}
AddCraft( typeof( Sandals ), 1015288, 1025901, 12.4, 37.4, typeof( Leather ), 1044462, 4, 1044463 );
AddCraft( typeof( Shoes ), 1015288, 1025904, 16.5, 41.5, typeof( Leather ), 1044462, 6, 1044463 );
AddCraft( typeof( Boots ), 1015288, 1025899, 33.1, 58.1, typeof( Leather ), 1044462, 8, 1044463 );
AddCraft( typeof( ThighBoots ), 1015288, 1025906, 41.4, 66.4, typeof( Leather ), 1044462, 10, 1044463 );
#endregion
#region Leather Armor
if ( Core.ML )
{
index = AddCraft( typeof( SpellWovenBritches ), 1015293, 1072929, 92.5, 117.5, typeof( Leather ), 1044462, 15, 1044463 );
AddRes( index, typeof( EyeOfTheTravesty ), 1032685, 1, 1044253 );
AddRes( index, typeof( Putrefication ), 1032678, 10, 1044253 );
AddRes( index, typeof( Scourge ), 1032677, 10, 1044253 );
AddRareRecipe( index, 506 );
ForceNonExceptional( index );
SetNeededExpansion( index, Expansion.ML );
index = AddCraft( typeof( SongWovenMantle ), 1015293, 1072931, 92.5, 117.5, typeof( Leather ), 1044462, 15, 1044463 );
AddRes( index, typeof( EyeOfTheTravesty ), 1032685, 1, 1044253 );
AddRes( index, typeof( Blight ), 1032675, 10, 1044253 );
AddRes( index, typeof( Muculent ), 1032680, 10, 1044253 );
AddRareRecipe( index, 507 );
ForceNonExceptional( index );
SetNeededExpansion( index, Expansion.ML );
index = AddCraft( typeof( StitchersMittens ), 1015293, 1072932, 92.5, 117.5, typeof( Leather ), 1044462, 15, 1044463 );
AddRes( index, typeof( CapturedEssence ), 1032686, 1, 1044253 );
AddRes( index, typeof( Corruption ), 1032676, 10, 1044253 );
AddRes( index, typeof( Taint ), 1032679, 10, 1044253 );
AddRareRecipe( index, 508 );
ForceNonExceptional( index );
SetNeededExpansion( index, Expansion.ML );
}
AddCraft( typeof( LeatherGorget ), 1015293, 1025063, 53.9, 78.9, typeof( Leather ), 1044462, 4, 1044463 );
AddCraft( typeof( LeatherCap ), 1015293, 1027609, 6.2, 31.2, typeof( Leather ), 1044462, 2, 1044463 );
AddCraft( typeof( LeatherGloves ), 1015293, 1025062, 51.8, 76.8, typeof( Leather ), 1044462, 3, 1044463 );
AddCraft( typeof( LeatherArms ), 1015293, 1025061, 53.9, 78.9, typeof( Leather ), 1044462, 4, 1044463 );
AddCraft( typeof( LeatherLegs ), 1015293, 1025067, 66.3, 91.3, typeof( Leather ), 1044462, 10, 1044463 );
AddCraft( typeof( LeatherChest ), 1015293, 1025068, 70.5, 95.5, typeof( Leather ), 1044462, 12, 1044463 );
if ( Core.SE )
{
index = AddCraft( typeof( LeatherJingasa ), 1015293, 1030177, 45.0, 70.0, typeof( Leather ), 1044462, 4, 1044463 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( LeatherMempo ), 1015293, 1030181, 80.0, 105.0, typeof( Leather ), 1044462, 8, 1044463 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( LeatherDo ), 1015293, 1030182, 75.0, 100.0, typeof( Leather ), 1044462, 12, 1044463 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( LeatherHiroSode ), 1015293, 1030185, 55.0, 80.0, typeof( Leather ), 1044462, 5, 1044463 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( LeatherSuneate ), 1015293, 1030193, 68.0, 93.0, typeof( Leather ), 1044462, 12, 1044463 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( LeatherHaidate ), 1015293, 1030197, 68.0, 93.0, typeof( Leather ), 1044462, 12, 1044463 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( LeatherNinjaPants ), 1015293, 1030204, 80.0, 105.0, typeof( Leather ), 1044462, 13, 1044463 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( LeatherNinjaJacket ), 1015293, 1030206, 85.0, 110.0, typeof( Leather ), 1044462, 13, 1044463 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( LeatherNinjaBelt ), 1015293, 1030203, 50.0, 75.0, typeof( Leather ), 1044462, 5, 1044463 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( LeatherNinjaMitts ), 1015293, 1030205, 65.0, 90.0, typeof( Leather ), 1044462, 12, 1044463 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( LeatherNinjaHood ), 1015293, 1030201, 90.0, 115.0, typeof( Leather ), 1044462, 14, 1044463 );
SetNeededExpansion( index, Expansion.SE );
}
#endregion
#region Studded Armor
AddCraft( typeof( StuddedGorget ), 1015300, 1025078, 78.8, 103.8, typeof( Leather ), 1044462, 6, 1044463 );
AddCraft( typeof( StuddedGloves ), 1015300, 1025077, 82.9, 107.9, typeof( Leather ), 1044462, 8, 1044463 );
AddCraft( typeof( StuddedArms ), 1015300, 1025076, 87.1, 112.1, typeof( Leather ), 1044462, 10, 1044463 );
AddCraft( typeof( StuddedLegs ), 1015300, 1025082, 91.2, 116.2, typeof( Leather ), 1044462, 12, 1044463 );
AddCraft( typeof( StuddedChest ), 1015300, 1025083, 94.0, 119.0, typeof( Leather ), 1044462, 14, 1044463 );
if ( Core.SE )
{
index = AddCraft( typeof( StuddedMempo ), 1015300, 1030216, 80.0, 105.0, typeof( Leather ), 1044462, 8, 1044463 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( StuddedDo ), 1015300, 1030183, 95.0, 120.0, typeof( Leather ), 1044462, 14, 1044463 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( StuddedHiroSode ), 1015300, 1030186, 85.0, 110.0, typeof( Leather ), 1044462, 8, 1044463 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( StuddedSuneate ), 1015300, 1030194, 92.0, 117.0, typeof( Leather ), 1044462, 14, 1044463 );
SetNeededExpansion( index, Expansion.SE );
index = AddCraft( typeof( StuddedHaidate ), 1015300, 1030198, 92.0, 117.0, typeof( Leather ), 1044462, 14, 1044463 );
SetNeededExpansion( index, Expansion.SE );
}
#endregion
#region Female Armor
AddCraft( typeof( LeatherShorts ), 1015306, 1027168, 62.2, 87.2, typeof( Leather ), 1044462, 8, 1044463 );
AddCraft( typeof( LeatherSkirt ), 1015306, 1027176, 58.0, 83.0, typeof( Leather ), 1044462, 6, 1044463 );
AddCraft( typeof( LeatherBustierArms ), 1015306, 1027178, 58.0, 83.0, typeof( Leather ), 1044462, 6, 1044463 );
AddCraft( typeof( StuddedBustierArms ), 1015306, 1027180, 82.9, 107.9, typeof( Leather ), 1044462, 8, 1044463 );
AddCraft( typeof( FemaleLeatherChest ), 1015306, 1027174, 62.2, 87.2, typeof( Leather ), 1044462, 8, 1044463 );
AddCraft( typeof( FemaleStuddedChest ), 1015306, 1027170, 87.1, 112.1, typeof( Leather ), 1044462, 10, 1044463 );
#endregion
#region Bone Armor
index = AddCraft( typeof( BoneHelm ), 1049149, 1025206, 85.0, 110.0, typeof( Leather ), 1044462, 4, 1044463 );
AddRes( index, typeof( Bone ), 1049064, 2, 1049063 );
index = AddCraft( typeof( BoneGloves ), 1049149, 1025205, 89.0, 114.0, typeof( Leather ), 1044462, 6, 1044463 );
AddRes( index, typeof( Bone ), 1049064, 2, 1049063 );
index = AddCraft( typeof( BoneArms ), 1049149, 1025203, 92.0, 117.0, typeof( Leather ), 1044462, 8, 1044463 );
AddRes( index, typeof( Bone ), 1049064, 4, 1049063 );
index = AddCraft( typeof( BoneLegs ), 1049149, 1025202, 95.0, 120.0, typeof( Leather ), 1044462, 10, 1044463 );
AddRes( index, typeof( Bone ), 1049064, 6, 1049063 );
index = AddCraft( typeof( BoneChest ), 1049149, 1025199, 96.0, 121.0, typeof( Leather ), 1044462, 12, 1044463 );
AddRes( index, typeof( Bone ), 1049064, 10, 1049063 );
index = AddCraft(typeof(OrcHelm), 1049149, 1027947, 90.0, 115.0, typeof(Leather), 1044462, 6, 1044463);
AddRes(index, typeof(Bone), 1049064, 4, 1049063);
#endregion
// Set the overridable material
SetSubRes( typeof( Leather ), 1049150 );
// Add every material you want the player to be able to choose from
// This will override the overridable material
AddSubRes( typeof( Leather ), 1049150, 00.0, 1044462, 1049311 );
AddSubRes( typeof( SpinedLeather ), 1049151, 65.0, 1044462, 1049311 );
AddSubRes( typeof( HornedLeather ), 1049152, 80.0, 1044462, 1049311 );
AddSubRes( typeof( BarbedLeather ), 1049153, 99.0, 1044462, 1049311 );
MarkOption = true;
Repair = Core.AOS;
CanEnhance = Core.AOS;
}
}
}
public class DefTailoring : CraftSystem
{
private static CraftSystem m_CraftSystem;
private static Type[] m_TailorColorables =
{
typeof(GozaMatEastDeed), typeof(GozaMatSouthDeed),
typeof(SquareGozaMatEastDeed), typeof(SquareGozaMatSouthDeed),
typeof(BrocadeGozaMatEastDeed), typeof(BrocadeGozaMatSouthDeed),
typeof(BrocadeSquareGozaMatEastDeed), typeof(BrocadeSquareGozaMatSouthDeed)
};
private DefTailoring() : base(1, 1, 1.25) // base( 1, 1, 4.5 )
{
}
public override SkillName MainSkill => SkillName.Tailoring;
public override int GumpTitleNumber => 1044005;
public static CraftSystem CraftSystem
{
get
{
if (m_CraftSystem == null)
m_CraftSystem = new DefTailoring();
return m_CraftSystem;
}
}
public override CraftECA ECA => CraftECA.ChanceMinusSixtyToFourtyFive;
public override double GetChanceAtMin(CraftItem item)
{
return 0.5; // 50%
}
public override int CanCraft(Mobile from, BaseTool tool, Type itemType)
{
if (tool == null || tool.Deleted || tool.UsesRemaining < 0)
return 1044038; // You have worn out your tool!
if (!BaseTool.CheckAccessible(tool, from))
return 1044263; // The tool must be on your person to use.
return 0;
}
public override bool RetainsColorFrom(CraftItem item, Type type)
{
if (type != typeof(Cloth) && type != typeof(UncutCloth))
return false;
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)
{
from.PlaySound(0x248);
}
public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality,
bool makersMark, CraftItem item)
{
if (toolBroken)
from.SendLocalizedMessage(1044038); // You have worn out your tool
if (failed)
{
if (lostMaterial)
return 1044043; // You failed to create the item, and some of your materials are lost.
return 1044157; // You failed to create the item, but no materials were lost.
}
if (quality == 0)
return 502785; // You were barely able to make this item. It's quality is below average.
if (makersMark && quality == 2)
return 1044156; // You create an exceptional quality item and affix your maker's mark.
if (quality == 2)
return 1044155; // You create an exceptional quality item.
return 1044154; // You create the item.
}
public override void InitCraftList()
{
int index = -1;
#region Hats
AddCraft(typeof(SkullCap), 1011375, 1025444, 0.0, 25.0, typeof(Cloth), 1044286, 2, 1044287);
AddCraft(typeof(Bandana), 1011375, 1025440, 0.0, 25.0, typeof(Cloth), 1044286, 2, 1044287);
AddCraft(typeof(FloppyHat), 1011375, 1025907, 6.2, 31.2, typeof(Cloth), 1044286, 11, 1044287);
AddCraft(typeof(Cap), 1011375, 1025909, 6.2, 31.2, typeof(Cloth), 1044286, 11, 1044287);
AddCraft(typeof(WideBrimHat), 1011375, 1025908, 6.2, 31.2, typeof(Cloth), 1044286, 12, 1044287);
AddCraft(typeof(StrawHat), 1011375, 1025911, 6.2, 31.2, typeof(Cloth), 1044286, 10, 1044287);
AddCraft(typeof(TallStrawHat), 1011375, 1025910, 6.7, 31.7, typeof(Cloth), 1044286, 13, 1044287);
AddCraft(typeof(WizardsHat), 1011375, 1025912, 7.2, 32.2, typeof(Cloth), 1044286, 15, 1044287);
AddCraft(typeof(Bonnet), 1011375, 1025913, 6.2, 31.2, typeof(Cloth), 1044286, 11, 1044287);
AddCraft(typeof(FeatheredHat), 1011375, 1025914, 6.2, 31.2, typeof(Cloth), 1044286, 12, 1044287);
AddCraft(typeof(TricorneHat), 1011375, 1025915, 6.2, 31.2, typeof(Cloth), 1044286, 12, 1044287);
AddCraft(typeof(JesterHat), 1011375, 1025916, 7.2, 32.2, typeof(Cloth), 1044286, 15, 1044287);
if (Core.AOS)
AddCraft(typeof(FlowerGarland), 1011375, 1028965, 10.0, 35.0, typeof(Cloth), 1044286, 5, 1044287);
if (Core.SE)
{
index = AddCraft(typeof(ClothNinjaHood), 1011375, 1030202, 80.0, 105.0, typeof(Cloth), 1044286, 13, 1044287);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(Kasa), 1011375, 1030211, 60.0, 85.0, typeof(Cloth), 1044286, 12, 1044287);
SetNeededExpansion(index, Expansion.SE);
}
#endregion
#region Shirts
AddCraft(typeof(Doublet), 1015269, 1028059, 0, 25.0, typeof(Cloth), 1044286, 8, 1044287);
AddCraft(typeof(Shirt), 1015269, 1025399, 20.7, 45.7, typeof(Cloth), 1044286, 8, 1044287);
AddCraft(typeof(FancyShirt), 1015269, 1027933, 24.8, 49.8, typeof(Cloth), 1044286, 8, 1044287);
AddCraft(typeof(Tunic), 1015269, 1028097, 00.0, 25.0, typeof(Cloth), 1044286, 12, 1044287);
AddCraft(typeof(Surcoat), 1015269, 1028189, 8.2, 33.2, typeof(Cloth), 1044286, 14, 1044287);
AddCraft(typeof(PlainDress), 1015269, 1027937, 12.4, 37.4, typeof(Cloth), 1044286, 10, 1044287);
AddCraft(typeof(FancyDress), 1015269, 1027935, 33.1, 58.1, typeof(Cloth), 1044286, 12, 1044287);
AddCraft(typeof(Cloak), 1015269, 1025397, 41.4, 66.4, typeof(Cloth), 1044286, 14, 1044287);
AddCraft(typeof(Robe), 1015269, 1027939, 53.9, 78.9, typeof(Cloth), 1044286, 16, 1044287);
AddCraft(typeof(JesterSuit), 1015269, 1028095, 8.2, 33.2, typeof(Cloth), 1044286, 24, 1044287);
if (Core.AOS)
{
AddCraft(typeof(FurCape), 1015269, 1028969, 35.0, 60.0, typeof(Cloth), 1044286, 13, 1044287);
AddCraft(typeof(GildedDress), 1015269, 1028973, 37.5, 62.5, typeof(Cloth), 1044286, 16, 1044287);
AddCraft(typeof(FormalShirt), 1015269, 1028975, 26.0, 51.0, typeof(Cloth), 1044286, 16, 1044287);
}
if (Core.SE)
{
index = AddCraft(typeof(ClothNinjaJacket), 1015269, 1030207, 75.0, 100.0, typeof(Cloth), 1044286, 12,
1044287);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(Kamishimo), 1015269, 1030212, 75.0, 100.0, typeof(Cloth), 1044286, 15, 1044287);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(HakamaShita), 1015269, 1030215, 40.0, 65.0, typeof(Cloth), 1044286, 14, 1044287);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(MaleKimono), 1015269, 1030189, 50.0, 75.0, typeof(Cloth), 1044286, 16, 1044287);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(FemaleKimono), 1015269, 1030190, 50.0, 75.0, typeof(Cloth), 1044286, 16, 1044287);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(JinBaori), 1015269, 1030220, 30.0, 55.0, typeof(Cloth), 1044286, 12, 1044287);
SetNeededExpansion(index, Expansion.SE);
}
#endregion
#region Pants
AddCraft(typeof(ShortPants), 1015279, 1025422, 24.8, 49.8, typeof(Cloth), 1044286, 6, 1044287);
AddCraft(typeof(LongPants), 1015279, 1025433, 24.8, 49.8, typeof(Cloth), 1044286, 8, 1044287);
AddCraft(typeof(Kilt), 1015279, 1025431, 20.7, 45.7, typeof(Cloth), 1044286, 8, 1044287);
AddCraft(typeof(Skirt), 1015279, 1025398, 29.0, 54.0, typeof(Cloth), 1044286, 10, 1044287);
if (Core.AOS)
AddCraft(typeof(FurSarong), 1015279, 1028971, 35.0, 60.0, typeof(Cloth), 1044286, 12, 1044287);
if (Core.SE)
{
index = AddCraft(typeof(Hakama), 1015279, 1030213, 50.0, 75.0, typeof(Cloth), 1044286, 16, 1044287);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(TattsukeHakama), 1015279, 1030214, 50.0, 75.0, typeof(Cloth), 1044286, 16, 1044287);
SetNeededExpansion(index, Expansion.SE);
}
#endregion
#region Misc
AddCraft(typeof(BodySash), 1015283, 1025441, 4.1, 29.1, typeof(Cloth), 1044286, 4, 1044287);
AddCraft(typeof(HalfApron), 1015283, 1025435, 20.7, 45.7, typeof(Cloth), 1044286, 6, 1044287);
AddCraft(typeof(FullApron), 1015283, 1025437, 29.0, 54.0, typeof(Cloth), 1044286, 10, 1044287);
if (Core.SE)
{
index = AddCraft(typeof(Obi), 1015283, 1030219, 20.0, 45.0, typeof(Cloth), 1044286, 6, 1044287);
SetNeededExpansion(index, Expansion.SE);
}
if (Core.ML)
{
index = AddCraft(typeof(ElvenQuiver), 1015283, 1032657, 65.0, 115.0, typeof(Leather), 1044462, 28, 1044463);
AddRecipe(index, 501);
SetNeededExpansion(index, Expansion.ML);
index = AddCraft(typeof(QuiverOfFire), 1015283, 1073109, 65.0, 115.0, typeof(Leather), 1044462, 28, 1044463);
AddRes(index, typeof(FireRuby), 1032695, 15, 1042081);
AddRecipe(index, 502);
SetNeededExpansion(index, Expansion.ML);
index = AddCraft(typeof(QuiverOfIce), 1015283, 1073110, 65.0, 115.0, typeof(Leather), 1044462, 28, 1044463);
AddRes(index, typeof(WhitePearl), 1032694, 15, 1042081);
AddRecipe(index, 503);
SetNeededExpansion(index, Expansion.ML);
index = AddCraft(typeof(QuiverOfBlight), 1015283, 1073111, 65.0, 115.0, typeof(Leather), 1044462, 28,
1044463);
AddRes(index, typeof(Blight), 1032675, 10, 1042081);
AddRecipe(index, 504);
SetNeededExpansion(index, Expansion.ML);
index = AddCraft(typeof(QuiverOfLightning), 1015283, 1073112, 65.0, 115.0, typeof(Leather), 1044462, 28,
1044463);
AddRes(index, typeof(Corruption), 1032676, 10, 1042081);
AddRecipe(index, 505);
SetNeededExpansion(index, Expansion.ML);
}
AddCraft(typeof(OilCloth), 1015283, 1041498, 74.6, 99.6, typeof(Cloth), 1044286, 1, 1044287);
if (Core.SE)
{
index = AddCraft(typeof(GozaMatEastDeed), 1015283, 1030404, 55.0, 80.0, typeof(Cloth), 1044286, 25, 1044287);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(GozaMatSouthDeed), 1015283, 1030405, 55.0, 80.0, typeof(Cloth), 1044286, 25,
1044287);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(SquareGozaMatEastDeed), 1015283, 1030407, 55.0, 80.0, typeof(Cloth), 1044286, 25,
1044287);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(SquareGozaMatSouthDeed), 1015283, 1030406, 55.0, 80.0, typeof(Cloth), 1044286, 25,
1044287);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(BrocadeGozaMatEastDeed), 1015283, 1030408, 55.0, 80.0, typeof(Cloth), 1044286, 25,
1044287);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(BrocadeGozaMatSouthDeed), 1015283, 1030409, 55.0, 80.0, typeof(Cloth), 1044286, 25,
1044287);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(BrocadeSquareGozaMatEastDeed), 1015283, 1030411, 55.0, 80.0, typeof(Cloth), 1044286,
25, 1044287);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(BrocadeSquareGozaMatSouthDeed), 1015283, 1030410, 55.0, 80.0, typeof(Cloth), 1044286,
25, 1044287);
SetNeededExpansion(index, Expansion.SE);
}
#endregion
#region Footwear
if (Core.AOS)
AddCraft(typeof(FurBoots), 1015288, 1028967, 50.0, 75.0, typeof(Cloth), 1044286, 12, 1044287);
if (Core.SE)
{
index = AddCraft(typeof(NinjaTabi), 1015288, 1030210, 70.0, 95.0, typeof(Cloth), 1044286, 10, 1044287);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(SamuraiTabi), 1015288, 1030209, 20.0, 45.0, typeof(Cloth), 1044286, 6, 1044287);
SetNeededExpansion(index, Expansion.SE);
}
AddCraft(typeof(Sandals), 1015288, 1025901, 12.4, 37.4, typeof(Leather), 1044462, 4, 1044463);
AddCraft(typeof(Shoes), 1015288, 1025904, 16.5, 41.5, typeof(Leather), 1044462, 6, 1044463);
AddCraft(typeof(Boots), 1015288, 1025899, 33.1, 58.1, typeof(Leather), 1044462, 8, 1044463);
AddCraft(typeof(ThighBoots), 1015288, 1025906, 41.4, 66.4, typeof(Leather), 1044462, 10, 1044463);
#endregion
#region Leather Armor
if (Core.ML)
{
index = AddCraft(typeof(SpellWovenBritches), 1015293, 1072929, 92.5, 117.5, typeof(Leather), 1044462, 15,
1044463);
AddRes(index, typeof(EyeOfTheTravesty), 1032685, 1, 1044253);
AddRes(index, typeof(Putrefication), 1032678, 10, 1044253);
AddRes(index, typeof(Scourge), 1032677, 10, 1044253);
AddRareRecipe(index, 506);
ForceNonExceptional(index);
SetNeededExpansion(index, Expansion.ML);
index = AddCraft(typeof(SongWovenMantle), 1015293, 1072931, 92.5, 117.5, typeof(Leather), 1044462, 15,
1044463);
AddRes(index, typeof(EyeOfTheTravesty), 1032685, 1, 1044253);
AddRes(index, typeof(Blight), 1032675, 10, 1044253);
AddRes(index, typeof(Muculent), 1032680, 10, 1044253);
AddRareRecipe(index, 507);
ForceNonExceptional(index);
SetNeededExpansion(index, Expansion.ML);
index = AddCraft(typeof(StitchersMittens), 1015293, 1072932, 92.5, 117.5, typeof(Leather), 1044462, 15,
1044463);
AddRes(index, typeof(CapturedEssence), 1032686, 1, 1044253);
AddRes(index, typeof(Corruption), 1032676, 10, 1044253);
AddRes(index, typeof(Taint), 1032679, 10, 1044253);
AddRareRecipe(index, 508);
ForceNonExceptional(index);
SetNeededExpansion(index, Expansion.ML);
}
AddCraft(typeof(LeatherGorget), 1015293, 1025063, 53.9, 78.9, typeof(Leather), 1044462, 4, 1044463);
AddCraft(typeof(LeatherCap), 1015293, 1027609, 6.2, 31.2, typeof(Leather), 1044462, 2, 1044463);
AddCraft(typeof(LeatherGloves), 1015293, 1025062, 51.8, 76.8, typeof(Leather), 1044462, 3, 1044463);
AddCraft(typeof(LeatherArms), 1015293, 1025061, 53.9, 78.9, typeof(Leather), 1044462, 4, 1044463);
AddCraft(typeof(LeatherLegs), 1015293, 1025067, 66.3, 91.3, typeof(Leather), 1044462, 10, 1044463);
AddCraft(typeof(LeatherChest), 1015293, 1025068, 70.5, 95.5, typeof(Leather), 1044462, 12, 1044463);
if (Core.SE)
{
index = AddCraft(typeof(LeatherJingasa), 1015293, 1030177, 45.0, 70.0, typeof(Leather), 1044462, 4, 1044463);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(LeatherMempo), 1015293, 1030181, 80.0, 105.0, typeof(Leather), 1044462, 8, 1044463);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(LeatherDo), 1015293, 1030182, 75.0, 100.0, typeof(Leather), 1044462, 12, 1044463);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(LeatherHiroSode), 1015293, 1030185, 55.0, 80.0, typeof(Leather), 1044462, 5,
1044463);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(LeatherSuneate), 1015293, 1030193, 68.0, 93.0, typeof(Leather), 1044462, 12,
1044463);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(LeatherHaidate), 1015293, 1030197, 68.0, 93.0, typeof(Leather), 1044462, 12,
1044463);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(LeatherNinjaPants), 1015293, 1030204, 80.0, 105.0, typeof(Leather), 1044462, 13,
1044463);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(LeatherNinjaJacket), 1015293, 1030206, 85.0, 110.0, typeof(Leather), 1044462, 13,
1044463);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(LeatherNinjaBelt), 1015293, 1030203, 50.0, 75.0, typeof(Leather), 1044462, 5,
1044463);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(LeatherNinjaMitts), 1015293, 1030205, 65.0, 90.0, typeof(Leather), 1044462, 12,
1044463);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(LeatherNinjaHood), 1015293, 1030201, 90.0, 115.0, typeof(Leather), 1044462, 14,
1044463);
SetNeededExpansion(index, Expansion.SE);
}
#endregion
#region Studded Armor
AddCraft(typeof(StuddedGorget), 1015300, 1025078, 78.8, 103.8, typeof(Leather), 1044462, 6, 1044463);
AddCraft(typeof(StuddedGloves), 1015300, 1025077, 82.9, 107.9, typeof(Leather), 1044462, 8, 1044463);
AddCraft(typeof(StuddedArms), 1015300, 1025076, 87.1, 112.1, typeof(Leather), 1044462, 10, 1044463);
AddCraft(typeof(StuddedLegs), 1015300, 1025082, 91.2, 116.2, typeof(Leather), 1044462, 12, 1044463);
AddCraft(typeof(StuddedChest), 1015300, 1025083, 94.0, 119.0, typeof(Leather), 1044462, 14, 1044463);
if (Core.SE)
{
index = AddCraft(typeof(StuddedMempo), 1015300, 1030216, 80.0, 105.0, typeof(Leather), 1044462, 8, 1044463);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(StuddedDo), 1015300, 1030183, 95.0, 120.0, typeof(Leather), 1044462, 14, 1044463);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(StuddedHiroSode), 1015300, 1030186, 85.0, 110.0, typeof(Leather), 1044462, 8,
1044463);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(StuddedSuneate), 1015300, 1030194, 92.0, 117.0, typeof(Leather), 1044462, 14,
1044463);
SetNeededExpansion(index, Expansion.SE);
index = AddCraft(typeof(StuddedHaidate), 1015300, 1030198, 92.0, 117.0, typeof(Leather), 1044462, 14,
1044463);
SetNeededExpansion(index, Expansion.SE);
}
#endregion
#region Female Armor
AddCraft(typeof(LeatherShorts), 1015306, 1027168, 62.2, 87.2, typeof(Leather), 1044462, 8, 1044463);
AddCraft(typeof(LeatherSkirt), 1015306, 1027176, 58.0, 83.0, typeof(Leather), 1044462, 6, 1044463);
AddCraft(typeof(LeatherBustierArms), 1015306, 1027178, 58.0, 83.0, typeof(Leather), 1044462, 6, 1044463);
AddCraft(typeof(StuddedBustierArms), 1015306, 1027180, 82.9, 107.9, typeof(Leather), 1044462, 8, 1044463);
AddCraft(typeof(FemaleLeatherChest), 1015306, 1027174, 62.2, 87.2, typeof(Leather), 1044462, 8, 1044463);
AddCraft(typeof(FemaleStuddedChest), 1015306, 1027170, 87.1, 112.1, typeof(Leather), 1044462, 10, 1044463);
#endregion
#region Bone Armor
index = AddCraft(typeof(BoneHelm), 1049149, 1025206, 85.0, 110.0, typeof(Leather), 1044462, 4, 1044463);
AddRes(index, typeof(Bone), 1049064, 2, 1049063);
index = AddCraft(typeof(BoneGloves), 1049149, 1025205, 89.0, 114.0, typeof(Leather), 1044462, 6, 1044463);
AddRes(index, typeof(Bone), 1049064, 2, 1049063);
index = AddCraft(typeof(BoneArms), 1049149, 1025203, 92.0, 117.0, typeof(Leather), 1044462, 8, 1044463);
AddRes(index, typeof(Bone), 1049064, 4, 1049063);
index = AddCraft(typeof(BoneLegs), 1049149, 1025202, 95.0, 120.0, typeof(Leather), 1044462, 10, 1044463);
AddRes(index, typeof(Bone), 1049064, 6, 1049063);
index = AddCraft(typeof(BoneChest), 1049149, 1025199, 96.0, 121.0, typeof(Leather), 1044462, 12, 1044463);
AddRes(index, typeof(Bone), 1049064, 10, 1049063);
index = AddCraft(typeof(OrcHelm), 1049149, 1027947, 90.0, 115.0, typeof(Leather), 1044462, 6, 1044463);
AddRes(index, typeof(Bone), 1049064, 4, 1049063);
#endregion
// Set the overridable material
SetSubRes(typeof(Leather), 1049150);
// Add every material you want the player to be able to choose from
// This will override the overridable material
AddSubRes(typeof(Leather), 1049150, 00.0, 1044462, 1049311);
AddSubRes(typeof(SpinedLeather), 1049151, 65.0, 1044462, 1049311);
AddSubRes(typeof(HornedLeather), 1049152, 80.0, 1044462, 1049311);
AddSubRes(typeof(BarbedLeather), 1049153, 99.0, 1044462, 1049311);
MarkOption = true;
Repair = Core.AOS;
CanEnhance = Core.AOS;
}
}
}

File diff suppressed because it is too large Load diff